Skip to content

Commit

Permalink
Removed wd1772 and back to wd1793
Browse files Browse the repository at this point in the history
  • Loading branch information
rampa069 committed Mar 17, 2020
1 parent d1fa135 commit f1343f7
Show file tree
Hide file tree
Showing 7 changed files with 988 additions and 68 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
[submodule "fdc1772-verilator"]
path = fdc1772-verilator
url = [email protected]:gyurco/fdc1772-verilator.git
4 changes: 1 addition & 3 deletions Oric_Sidi.qsf
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,8 @@ set_global_assignment -name USE_SIGNALTAP_FILE rtl/stp1.stp
set_global_assignment -name TIMEQUEST_MULTICORNER_ANALYSIS OFF
set_global_assignment -name SYNTH_TIMING_DRIVEN_SYNTHESIS ON
set_global_assignment -name OPTIMIZE_POWER_DURING_SYNTHESIS OFF
set_global_assignment -name SYSTEMVERILOG_FILE rtl/wd1793.sv
set_global_assignment -name VERILOG_FILE mist/sd_card.v
set_global_assignment -name VERILOG_FILE "fdc1772-verilator/fdc1772.v"
set_global_assignment -name VERILOG_FILE "fdc1772-verilator/floppy.v"
set_global_assignment -name VERILOG_FILE mist/mist_io.v
set_global_assignment -name VHDL_FILE rtl/rom/MICRODIS.vhd
set_global_assignment -name SYSTEMVERILOG_FILE mist/sdram.sv
set_global_assignment -name QIP_FILE mist/mist.qip
Expand Down
1 change: 0 additions & 1 deletion fdc1772-verilator
Submodule fdc1772-verilator deleted from 338b13
26 changes: 18 additions & 8 deletions rtl/OricAtmos_MiST.sv
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
module OricAtmos_MiST(
input CLOCK_27,

output [5:0] VGA_R,
output [5:0] VGA_G,
output [5:0] VGA_B,
output VGA_HS,
output VGA_VS,
output LED,

input UART_RXD,
output UART_TXD,

output AUDIO_L,
output AUDIO_R,

input SPI_SCK,
output SPI_DO,
input SPI_DI,
input SPI_SS2,
input SPI_SS3,
input SPI_SS4,
input CONF_DATA0,

output [12:0] SDRAM_A,
inout [15:0] SDRAM_DQ,
output SDRAM_DQML,
Expand All @@ -33,8 +37,8 @@ module OricAtmos_MiST(
`include "build_id.v"
localparam CONF_STR = {
"ORIC;;",
"S0,IMG,Mount Drive A:;",
"S1,IMG,Mount Drive B:;",
"S0,IMGDSK,Mount Drive A:;",
"S1,IMGDSK,Mount Drive B:;",
"O3,ROM,Oric Atmos,Oric 1;",
"O6,FDD Controller,Off,On;",
"O7,Drive Write,Prohibit,Allow;",
Expand Down Expand Up @@ -75,10 +79,8 @@ wire rom_changed;



//assign LED = 1'b0;
assign AUDIO_R = AUDIO_L;
//assign LED=!remote;
assign LED = img_mounted;
assign disk_enable = ~status[6];
assign reset = (status[0] | buttons[1]);
assign rom = ~status[3] ;
Expand Down Expand Up @@ -128,7 +130,7 @@ user_io(
.sd_din_strobe (sd_din_strobe ),
.sd_buff_addr (sd_buff_addr ),
.img_mounted (img_mounted ),
.img_size (img_size ),
.img_size (img_size )
);


Expand Down Expand Up @@ -179,13 +181,15 @@ oricatmos oricatmos(
.ram_we (ram_we ),
.joystick_0 ( joystick_0 ),
.joystick_1 ( joystick_1 ),
.fd_led (LED),
.fdd_ready (fdd_ready ),
.phi2 (phi2 ),
.pll_locked (pll_locked),
.disk_enable (disk_enable),
.rom (rom),
.img_mounted ( img_mounted ), // signaling that new image has been mounted
.img_size ( img_size ), // size of image in bytes
.img_wp ( status[7] ), // write protect
.img_wp ( status[7] ), // write protect
.sd_lba ( sd_lba ),
.sd_rd ( sd_rd ),
.sd_wr ( sd_wr ),
Expand Down Expand Up @@ -275,7 +279,13 @@ audiodac(
);



always @(posedge clk_24) begin
reg old_mounted;
reg fdd_ready;
old_mounted <= img_mounted;
if(reset) fdd_ready <= 0;
else if(~old_mounted & img_mounted) fdd_ready <= 1;
end

/////////////////// FDC ///////////////////
wire [31:0] sd_lba;
Expand Down
103 changes: 59 additions & 44 deletions rtl/microdisc.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity Microdisc is
port(
CLK: in std_logic; -- 32 Mhz input clock
CLK_SYS: in std_logic;
CLK_SYS: in std_logic; -- 24 Mhz input clock
-- Oric Expansion Port Signals
DI: in std_logic_vector(7 downto 0); -- 6502 Data Bus
DO: out std_logic_vector(7 downto 0); -- 6502 Data Bus
Expand Down Expand Up @@ -67,41 +67,49 @@ entity Microdisc is
sd_dout: in std_logic_vector (7 downto 0);
sd_din: out std_logic_vector (7 downto 0);
sd_dout_strobe: in std_logic;
sd_din_strobe: in std_logic
sd_din_strobe: in std_logic;

fdd_ready: in std_logic;
fd_led: out std_logic
);
end Microdisc;

architecture Behavioral of Microdisc is
component fdc1772
component wd1793
port(
clkcpu: in std_logic;
clk8m_en: in std_logic;
clk_sys: in std_logic;
ce: in std_logic;

floppy_drive: in std_logic_vector (3 downto 0);
floppy_side: in std_logic;
floppy_reset: in std_logic;
reset: in std_logic;
io_en: in std_logic;
rd: in std_logic;
wr: in std_logic;
addr: in std_logic_vector (1 downto 0);
din: in std_logic_vector (7 downto 0);
dout: out std_logic_vector (7 downto 0);

irq: out std_logic;
drq: out std_logic;
intrq: out std_logic;
drq: out std_logic;

cpu_addr: in std_logic_vector (1 downto 0);
cpu_sel: in std_logic;
cpu_rw: in std_logic;
cpu_din: in std_logic_vector (7 downto 0);
cpu_dout: out std_logic_vector (7 downto 0);
busy: out std_logic;
ready: in std_logic;
layout: in std_logic;
side: in std_logic;

img_mounted: in std_logic;
img_wp: in std_logic_vector (1 downto 0);
img_size: in std_logic_vector (31 downto 0);
wp: in std_logic;
img_size: in std_logic_vector (19 downto 0);
sd_lba: out std_logic_vector (31 downto 0);
sd_rd: out std_logic_vector (1 downto 0);
sd_wr: out std_logic_vector (1 downto 0);
sd_rd: out std_logic;
sd_wr: out std_logic;
sd_ack: in std_logic;
sd_buff_addr: in std_logic_vector (8 downto 0);
sd_dout: in std_logic_vector (7 downto 0);
sd_din: out std_logic_vector (7 downto 0);
sd_dout_strobe: in std_logic;
sd_din_strobe: in std_logic
sd_buff_dout: in std_logic_vector (7 downto 0);
sd_buff_din: out std_logic_vector (7 downto 0);

size_code: in std_logic_vector (2 downto 0)
--sd_dout_strobe: in std_logic;
--sd_din_strobe: in std_logic

);
end component;
Expand Down Expand Up @@ -154,37 +162,42 @@ architecture Behavioral of Microdisc is

begin

fdd1: fdc1772
fdd1: wd1793
port map
(
clkcpu => CLK_SYS,
clk8m_en => fdc_CLK,
clk_sys => CLK_SYS,
ce => fdc_CLK,

floppy_drive => "00" & DSEL,
floppy_side => SSEL,
floppy_reset => not nRESET,
reset => not nRESET,
io_en => not fdc_nCS,
rd => not fdc_nRE,
wr => not fdc_nWE,
addr => fdc_A,
din => fdc_DALin,
dout => fdc_DALout,

irq => fdc_IRQ,
intrq => fdc_IRQ,
drq => fdc_DRQ,

cpu_addr => fdc_A,
cpu_sel => not fdc_nCS,
cpu_rw => not RnW,
cpu_din => fdc_DALin,
cpu_dout => fdc_DALout,
ready => fdd_ready, --img_mounted,
--busy =>

layout => '1',
size_code => "001",
side => SSEL,
--prepare =>
img_mounted => img_mounted,
img_wp => img_wp,
img_size => img_size,
wp => img_wp(0),
img_size => img_size (19 downto 0),
sd_lba => sd_lba,
sd_rd => sd_rd,
sd_wr => sd_wr,
sd_rd => sd_rd(0),
sd_wr => sd_wr(0),
sd_ack => sd_ack,
sd_buff_addr => sd_buff_addr,
sd_dout => sd_dout,
sd_din => sd_din,
sd_dout_strobe => sd_dout_strobe,
sd_din_strobe => sd_din_strobe
sd_buff_dout => sd_dout,
sd_buff_din => sd_din
--sd_dout_strobe => sd_dout_strobe,
--sd_din_strobe => sd_din_strobe
);


Expand All @@ -202,7 +215,9 @@ fdd1: fdc1772
fdc_nWE <= IO or RnW;
fdc_CLK <= not PH2_2;
fdc_DALin <= DI;

-- DEBUG led
fd_led <= not fdc_DRQ;

-- ORIC Expansion Port Signals
IOCTRL <= '0' when sel = '1' else '1';
nROMDIS <= '0' when inROMDIS = '0' else '1';
Expand Down
20 changes: 11 additions & 9 deletions rtl/oricatmos.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,11 @@ entity oricatmos is
ram_oe : out std_logic;
ram_we : out std_logic;
phi2 : out std_logic;
joystick_0 : in std_logic_vector( 7 downto 0);
joystick_1 : in std_logic_vector( 7 downto 0);
pll_locked : in std_logic;
fd_led : out std_logic;
fdd_ready : in std_logic;
joystick_0 : in std_logic_vector( 7 downto 0);
joystick_1 : in std_logic_vector( 7 downto 0);
pll_locked : in std_logic;
disk_enable : in std_logic;
rom : in std_logic;
img_mounted: in std_logic;
Expand Down Expand Up @@ -150,10 +152,8 @@ architecture RTL of oricatmos is
signal ula_VIDEO_B : std_logic;
signal ula_SYNC : std_logic;

-- -- ÑAPA
-- signal display_enable : std_logic;

signal lSRAM_D : std_logic_vector(7 downto 0);

-- signal lSRAM_D : std_logic_vector(7 downto 0);
signal ENA_1MHZ : std_logic;
signal ROM_ATMOS_DO : std_logic_vector(7 downto 0);
signal ROM_1_DO : std_logic_vector(7 downto 0);
Expand Down Expand Up @@ -361,7 +361,7 @@ inst_key : keyboard
inst_microdisc: work.Microdisc
port map(
CLK => clk_MICRODISC, -- 32 Mhz input clock
CLK_SYS => clk_in,
CLK_SYS => CLK_IN,
-- Oric Expansion Port Signals
DI => cpu_do, -- 6502 Data Bus
DO => cont_D_OUT, -- 6502 Data Bus
Expand Down Expand Up @@ -395,7 +395,9 @@ inst_microdisc: work.Microdisc
sd_dout => sd_dout,
sd_din => sd_din,
sd_dout_strobe => sd_dout_strobe,
sd_din_strobe => sd_din_strobe
sd_din_strobe => sd_din_strobe,
fdd_ready => fdd_ready,
fd_led => fd_led
);


Expand Down
Loading

0 comments on commit f1343f7

Please sign in to comment.