Converted logic to all registers high during power up AND reset!
This commit is contained in:
@@ -166,83 +166,83 @@ begin
|
||||
end if;
|
||||
end process;
|
||||
|
||||
clock_init: process(CLK_EXT)
|
||||
clock_init: process(CLK_EXT,reset,SET_FREQUENCY)
|
||||
begin
|
||||
if(rising_edge(CLK_EXT))then
|
||||
if(reset = '0' and SET_FREQUENCY ='1')then
|
||||
LAN_RST_SM <= nop;
|
||||
LAN_CS_RST<='0';
|
||||
LAN_WR_RST<='0';
|
||||
else
|
||||
--init the clock afer reset finished!
|
||||
case LAN_RST_SM is
|
||||
when nop=>
|
||||
LAN_CS_RST<='0';
|
||||
LAN_WR_RST<='0';
|
||||
LAN_RST_SM<=wait0;
|
||||
when wait0=>
|
||||
LAN_CS_RST<='1';
|
||||
LAN_WR_RST<='0';
|
||||
LAN_RST_SM<=clr;
|
||||
when clr=>
|
||||
LAN_CS_RST<='1';
|
||||
LAN_WR_RST<='1';
|
||||
LAN_RST_SM<=clr_commit;
|
||||
when clr_commit=>
|
||||
LAN_CS_RST<='1';
|
||||
LAN_WR_RST<='0';
|
||||
LAN_RST_SM<=wait1;
|
||||
when wait1=>
|
||||
LAN_CS_RST<='1';
|
||||
LAN_WR_RST<='0';
|
||||
LAN_RST_SM<=set;
|
||||
when set=>
|
||||
LAN_CS_RST<='1';
|
||||
LAN_WR_RST<='1';
|
||||
LAN_RST_SM<=set_commit;
|
||||
when set_commit=>
|
||||
LAN_CS_RST<='1';
|
||||
LAN_WR_RST<='0';
|
||||
LAN_RST_SM<=done;
|
||||
when done=> --stay here
|
||||
SET_FREQUENCY <='0';
|
||||
LAN_CS_RST<='0';
|
||||
LAN_WR_RST<='0';
|
||||
LAN_RST_SM<=done;
|
||||
end case;
|
||||
end if;
|
||||
if(reset = '0' and SET_FREQUENCY ='1')then
|
||||
LAN_RST_SM <= nop;
|
||||
LAN_CS_RST<='1';
|
||||
LAN_WR_RST<='1';
|
||||
elsif(rising_edge(CLK_EXT))then
|
||||
|
||||
--init the clock afer reset finished!
|
||||
case LAN_RST_SM is
|
||||
when nop=>
|
||||
LAN_CS_RST<='1';
|
||||
LAN_WR_RST<='1';
|
||||
LAN_RST_SM<=wait0;
|
||||
when wait0=>
|
||||
LAN_CS_RST<='0';
|
||||
LAN_WR_RST<='1';
|
||||
LAN_RST_SM<=clr;
|
||||
when clr=>
|
||||
LAN_CS_RST<='0';
|
||||
LAN_WR_RST<='0';
|
||||
LAN_RST_SM<=clr_commit;
|
||||
when clr_commit=>
|
||||
LAN_CS_RST<='0';
|
||||
LAN_WR_RST<='1';
|
||||
LAN_RST_SM<=wait1;
|
||||
when wait1=>
|
||||
LAN_CS_RST<='0';
|
||||
LAN_WR_RST<='1';
|
||||
LAN_RST_SM<=set;
|
||||
when set=>
|
||||
LAN_CS_RST<='0';
|
||||
LAN_WR_RST<='0';
|
||||
LAN_RST_SM<=set_commit;
|
||||
when set_commit=>
|
||||
LAN_CS_RST<='0';
|
||||
LAN_WR_RST<='1';
|
||||
LAN_RST_SM<=done;
|
||||
when done=> --stay here
|
||||
SET_FREQUENCY <='0';
|
||||
LAN_CS_RST<='1';
|
||||
LAN_WR_RST<='1';
|
||||
LAN_RST_SM<=done;
|
||||
end case;
|
||||
|
||||
end if;
|
||||
end process clock_init;
|
||||
|
||||
ADDRESS_DECODE: process(reset,AMIGA_CLK)
|
||||
begin
|
||||
if(reset ='0')then
|
||||
autoconfig <= '0';
|
||||
ide <= '0';
|
||||
lan_adr <= '0';
|
||||
lan_adr_sw <= '0';
|
||||
cp <= '0';
|
||||
autoconfig <= '1';
|
||||
ide <= '1';
|
||||
lan_adr <= '1';
|
||||
lan_adr_sw <= '1';
|
||||
cp <= '1';
|
||||
elsif(rising_edge(AMIGA_CLK))then
|
||||
--default values
|
||||
autoconfig <= '0';
|
||||
ide <= '0';
|
||||
lan_adr <= '0';
|
||||
lan_adr_sw <= '0';
|
||||
cp <= '0';
|
||||
autoconfig <= '1';
|
||||
ide <= '1';
|
||||
lan_adr <= '1';
|
||||
lan_adr_sw <= '1';
|
||||
cp <= '1';
|
||||
if(A(23 downto 16) = x"E8" and AUTO_CONFIG_DONE > "00" and CFIN='0')then
|
||||
autoconfig <= '1';
|
||||
autoconfig <= '0';
|
||||
end if;
|
||||
if(A(23 downto 16) = LAN_BASEADR and SHUT_UP(0)='0' )then
|
||||
if(A(14 downto 13)<"11")then
|
||||
lan_adr_sw <= '1';
|
||||
lan_adr_sw <= '0';
|
||||
end if;
|
||||
lan_adr <= '1';
|
||||
lan_adr <= '0';
|
||||
end if;
|
||||
if(A(23 downto 16) = CP_BASEADR and SHUT_UP(1)='0')then
|
||||
cp <= '1';
|
||||
cp <= '0';
|
||||
end if;
|
||||
if(A(23 downto 16) = IDE_BASEADR and SHUT_UP(2)='0')then
|
||||
ide <= '1';
|
||||
ide <= '0';
|
||||
end if;
|
||||
end if;
|
||||
end process ADDRESS_DECODE;
|
||||
@@ -260,11 +260,11 @@ begin
|
||||
LAN_IRQ_OUT <='0';
|
||||
elsif(LAN_INT ='1' or LAN_INT_ENABLE = '1')then
|
||||
LAN_IRQ_OUT <='1';
|
||||
elsif(lan_adr = '1' and DS ='0' and RW='0' and A(15)='1') then
|
||||
elsif(lan_adr = '0' and DS ='0' and RW='0' and A(15)='1') then
|
||||
LAN_IRQ_OUT <= D(14); --controll lan irq
|
||||
end if;
|
||||
|
||||
if(lan_adr = '1' and DS ='0' and RW='0' and A(15)='1') then --enable if a write to A15 occured
|
||||
if(lan_adr = '0' and DS ='0' and RW='0' and A(15)='1') then --enable if a write to A15 occured
|
||||
LAN_INT_ENABLE <= not(D(15));
|
||||
end if;
|
||||
end if;
|
||||
@@ -283,7 +283,7 @@ begin
|
||||
LAN_WRH_S <= '1';
|
||||
LAN_WRL_S <= '1';
|
||||
|
||||
if(lan_adr='1' and DS='0' and A(15)='0')then
|
||||
if(lan_adr='0' and DS='0' and A(15)='0')then
|
||||
LAN_RD_S <= not(RW);
|
||||
-- swapped LDS/UDS here: ENC624 is little endian
|
||||
LAN_WRH_S <= not(not LDS and not RW);
|
||||
@@ -300,12 +300,12 @@ begin
|
||||
CP_WE_S <= '1';
|
||||
CP_RD_S <= '1';
|
||||
elsif falling_edge(AMIGA_CLK) then
|
||||
if(cp = '1' and AS='0' and RW ='1')then
|
||||
if(cp = '0' and AS='0' and RW ='1')then
|
||||
CP_RD_S <= '0';
|
||||
else
|
||||
CP_RD_S <= '1';
|
||||
end if;
|
||||
if(cp = '1' and DS='0' and RW ='0')then --datastrobe instead of AS!!!
|
||||
if(cp = '0' and DS='0' and RW ='0')then --datastrobe instead of AS!!!
|
||||
CP_WE_S <= '0';
|
||||
else
|
||||
CP_WE_S <= '1';
|
||||
@@ -321,7 +321,7 @@ begin
|
||||
if (reset = '0') then
|
||||
IDE_ENABLE <= '1';
|
||||
elsif falling_edge(AMIGA_CLK) then
|
||||
if(ide='1' and AS='0' and RW='0')then
|
||||
if(ide='0' and AS='0' and RW='0')then
|
||||
IDE_ENABLE <= '0'; -- enable IDE on first write
|
||||
end if;
|
||||
end if;
|
||||
@@ -337,7 +337,7 @@ begin
|
||||
IDE_TERM <= '1';
|
||||
elsif falling_edge(AMIGA_CLK) then
|
||||
|
||||
if(ide='1' and AS ='0')then
|
||||
if(ide='0' and AS ='0')then
|
||||
if(RW='0')then
|
||||
--the write goes to the hdd!
|
||||
IDE_W_S <= '0';
|
||||
@@ -387,7 +387,7 @@ begin
|
||||
DS_D <= DS;
|
||||
if(AS='1')then
|
||||
AUTO_CONFIG_DONE <= AUTO_CONFIG_DONE_CYCLE;
|
||||
elsif(autoconfig= '1' and DS='0') then
|
||||
elsif(autoconfig= '0' and DS='0') then
|
||||
case A(6 downto 1) is
|
||||
when "000000" =>
|
||||
if(AUTO_CONFIG_DONE > 1)then
|
||||
@@ -482,11 +482,11 @@ begin
|
||||
A_LAN_OUT <= LAN_A_SETREG(13 downto 0);
|
||||
end if;
|
||||
|
||||
if(lan_adr ='1')then --the lanport is shifted by one adress line but I forgot to adopt the clockport address!
|
||||
if(lan_adr ='0')then --the lanport is shifted by one adress line but I forgot to adopt the clockport address!
|
||||
A_LAN_OUT <= A(14 downto 1);
|
||||
end if;
|
||||
|
||||
if(cp = '1')then
|
||||
if(cp = '0')then
|
||||
A_LAN_OUT <= A(12 downto 1) &"00";
|
||||
end if;
|
||||
end if;
|
||||
@@ -506,27 +506,27 @@ begin
|
||||
end if;
|
||||
|
||||
|
||||
if(lan_adr ='1' and lan_adr_sw ='1') then
|
||||
if(lan_adr ='0' and lan_adr_sw ='0') then
|
||||
D_IN <= D( 7 downto 0) & D(15 downto 8);
|
||||
end if;
|
||||
if(cp ='1') then
|
||||
if(cp ='0') then
|
||||
D_IN <= D(15 downto 8) & D(15 downto 8);
|
||||
end if;
|
||||
if((lan_adr ='1' and lan_adr_sw ='0') or ide ='1') then
|
||||
if((lan_adr ='0' and lan_adr_sw ='1') or ide ='0') then
|
||||
D_IN <= D( 15 downto 0);
|
||||
end if;
|
||||
|
||||
--out sample
|
||||
if((lan_adr ='1' and lan_adr_sw ='0') or ide = '1') then
|
||||
if((lan_adr ='0' and lan_adr_sw ='1') or ide = '0') then
|
||||
D_OUT <= DQ( 15 downto 0);
|
||||
end if;
|
||||
if(lan_adr ='1' and lan_adr_sw ='1') then
|
||||
if(lan_adr ='0' and lan_adr_sw ='0') then
|
||||
D_OUT <= DQ(7 downto 0)&DQ(15 downto 8);
|
||||
end if;
|
||||
if(cp = '1') then
|
||||
if(cp = '0') then
|
||||
D_OUT <= DQ(7 downto 0)&DQ(7 downto 0);
|
||||
end if;
|
||||
if(autoconfig ='1') then
|
||||
if(autoconfig ='0') then
|
||||
D_OUT <= Dout1 & x"FFF";
|
||||
end if;
|
||||
end if;
|
||||
@@ -534,23 +534,23 @@ begin
|
||||
end process;
|
||||
|
||||
|
||||
LAN_CS <= lan_adr when LAN_RST_SM =done else LAN_CS_RST;
|
||||
LAN_WRL <= not(LAN_WRL_S) when AS ='0' and LAN_RST_SM =done else LAN_WR_RST;
|
||||
LAN_WRH <= not(LAN_WRH_S) when AS ='0' and LAN_RST_SM =done else LAN_WR_RST;
|
||||
LAN_CS <= not(lan_adr) when LAN_RST_SM =done else not(LAN_CS_RST);
|
||||
LAN_WRL <= not(LAN_WRL_S) when AS ='0' and LAN_RST_SM =done else not(LAN_WR_RST);
|
||||
LAN_WRH <= not(LAN_WRH_S) when AS ='0' and LAN_RST_SM =done else not(LAN_WR_RST);
|
||||
LAN_RD <= not(LAN_RD_S ) when (AS_D ='0' or AS ='0') and LAN_RST_SM =done else '0';
|
||||
|
||||
CP_WE <= CP_WE_S when AS ='0' and CP_WE_QUIRK ='1' else '1';
|
||||
CP_RD <= CP_RD_S when (AS_D ='0' or AS ='0') else '1';
|
||||
CP_CS <= not cp;
|
||||
CP_CS <= cp;
|
||||
|
||||
A_LAN(13 downto 0)<= A_LAN_OUT;
|
||||
|
||||
--signal assignment
|
||||
D <= D_OUT when RW='1' and (AS_D ='0' or AS ='0') and (lan_adr ='1' or ide = '1' or cp = '1' or autoconfig ='1') else
|
||||
D <= D_OUT when RW='1' and (AS_D ='0' or AS ='0') and (lan_adr ='0' or ide = '0' or cp = '0' or autoconfig ='0') else
|
||||
(others => 'Z');
|
||||
|
||||
|
||||
DQ <= D_IN when (RW='0' and AS='0' and (lan_adr ='1' or cp ='1' or ide ='1')) or SET_FREQUENCY ='1'
|
||||
DQ <= D_IN when (RW='0' and AS='0' and (lan_adr ='0' or cp ='0' or ide ='0')) or SET_FREQUENCY ='1'
|
||||
else (others => 'Z');
|
||||
|
||||
IDE_W <= IDE_W_S when AS = '0' else '1';
|
||||
@@ -568,14 +568,14 @@ begin
|
||||
else 'Z';
|
||||
|
||||
|
||||
OWN <= 'Z';--'0' when AS='0' and (autoconfig = '1' or ide = '1' or lan_adr = '1' or cp = '1') else 'Z';
|
||||
SLAVE <= '0' when (AS_D ='0' or AS ='0') and (autoconfig = '1' or ide = '1' or lan_adr = '1' or cp = '1') else '1';
|
||||
OWN <= 'Z';--'0' when AS='0' and (autoconfig = '0' or ide = '0' or lan_adr = '0' or cp = '0') else 'Z';
|
||||
SLAVE <= '0' when (AS_D ='0' or AS ='0') and (autoconfig = '0' or ide = '0' or lan_adr = '0' or cp = '0') else '1';
|
||||
CFOUT <= '0' when AUTO_CONFIG_DONE = "00" else '1';
|
||||
|
||||
OVR <= 'Z';
|
||||
--OVR <= '0' when ide='1' and (AS_D ='0' or AS ='0') else 'Z';
|
||||
--OVR <= '0' when ide='0' and (AS_D ='0' or AS ='0') else 'Z';
|
||||
|
||||
--DTACK <= IDE_TERM when ide='1' and (AS_D ='0' or AS ='0') else 'Z';
|
||||
--DTACK <= IDE_TERM when ide='0' and (AS_D ='0' or AS ='0') else 'Z';
|
||||
DTACK <= 'Z';
|
||||
A <= (others => 'Z');
|
||||
MTACK <= 'Z';
|
||||
|
||||
Reference in New Issue
Block a user