Line 9... |
Line 9... |
--| EPP - Wishbone bridge.
|
--| EPP - Wishbone bridge.
|
--| This module is in the wishbone side (IEEE Std. 1284-2000).
|
--| This module is in the wishbone side (IEEE Std. 1284-2000).
|
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
--| File history:
|
--| File history:
|
--| 0.01 | nov-2008 | First release
|
--| 0.01 | nov-2008 | First release
|
|
--| 0.1 | jan-2009 | Sinc reset
|
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
--| Copyright ® 2008, Facundo Aguilera.
|
--| Copyright ® 2008, Facundo Aguilera.
|
--|
|
--|
|
--| This VHDL design file is an open design; you can redistribute it and/or
|
--| This VHDL design file is an open design; you can redistribute it and/or
|
--| modify it and/or implement it after contacting the author.
|
--| modify it and/or implement it after contacting the author.
|
Line 76... |
Line 77... |
|
|
|
|
-- Data R/W
|
-- Data R/W
|
data_strobing: process (inAutoFd, ACK_I, CLK_I, pre_STB_O, RST_I, rst_pp)
|
data_strobing: process (inAutoFd, ACK_I, CLK_I, pre_STB_O, RST_I, rst_pp)
|
begin
|
begin
|
if (rst_pp = '1') then -- Reset de interfaz EPP
|
|
data_reg <= "00000000";
|
if (rst_pp = '1' or RST_I = '1') then -- Reset de interfaz EPP
|
|
data_reg <= (others => '0');
|
pre_STB_O <= '0';
|
pre_STB_O <= '0';
|
data_ack <= '0';
|
data_ack <= '0';
|
elsif (CLK_I'event and CLK_I = '1') then
|
elsif (CLK_I'event and CLK_I = '1') then
|
if (RST_I = '1') then -- Reset de interfaz Wishbone
|
if RST_I = '1' then
|
data_reg <= "00000000";
|
data_reg <= (others => '0');
|
pre_STB_O <= '0';
|
pre_STB_O <= '0';
|
data_ack <= '0';
|
data_ack <= '0';
|
else
|
else
|
if (inAutoFd = '0') then -- Data strobe
|
if (inAutoFd = '0' and data_ack = '0') then -- Data strobe
|
pre_STB_O <= '1';
|
pre_STB_O <= '1';
|
if (inStrobe = '0') then -- Escritura EPP
|
if (inStrobe = '0') then -- Escritura EPP
|
data_reg <= iData;
|
data_reg <= iData;
|
end if;
|
end if;
|
end if;
|
end if;
|
Line 104... |
Line 106... |
end if;
|
end if;
|
end if;
|
end if;
|
if (inAutoFd = '1' and data_ack = '1') then -- iBusy solo se pondrá a cero
|
if (inAutoFd = '1' and data_ack = '1') then -- iBusy solo se pondrá a cero
|
data_ack <= '0'; -- una vez que haya respuesta desde la PC
|
data_ack <= '0'; -- una vez que haya respuesta desde la PC
|
end if;
|
end if;
|
|
|
end process;
|
end process;
|
STB_O <= pre_STB_O;
|
STB_O <= pre_STB_O;
|
CYC_O <= pre_STB_O;
|
CYC_O <= pre_STB_O;
|
DAT_O <= data_reg; -- se utiliza el mismo registro para salida de datos
|
DAT_O <= data_reg; -- se utiliza el mismo registro para salida de datos
|
-- a wishbone, lectura y escritura de datos desde epp
|
-- a wishbone, lectura y escritura de datos desde epp
|
Line 116... |
Line 119... |
-- Adr R/W
|
-- Adr R/W
|
adr_ack <= not(inSelectIn); -- Autoconfirmación de estado.
|
adr_ack <= not(inSelectIn); -- Autoconfirmación de estado.
|
adr_strobing: process (inSelectIn, RST_I, rst_pp)
|
adr_strobing: process (inSelectIn, RST_I, rst_pp)
|
begin
|
begin
|
if (RST_I = '1' or rst_pp = '1') then
|
if (RST_I = '1' or rst_pp = '1') then
|
adr_reg <= "00000000";
|
adr_reg <= (others => '0');
|
elsif (inSelectIn'event and inSelectIn = '1') then -- Adr strobe
|
elsif (inSelectIn'event and inSelectIn = '1') then -- Adr strobe
|
if inStrobe = '0' then
|
if inStrobe = '0' then
|
adr_reg <= iData;
|
adr_reg <= iData;
|
end if;
|
end if;
|
end if;
|
end if;
|
Line 129... |
Line 132... |
|
|
|
|
-- Puerto bidireccional
|
-- Puerto bidireccional
|
iData <= data_reg when (inStrobe = '1' and data_ack = '1') else
|
iData <= data_reg when (inStrobe = '1' and data_ack = '1') else
|
adr_reg when (inStrobe = '1' and adr_ack = '1') else
|
adr_reg when (inStrobe = '1' and adr_ack = '1') else
|
"ZZZZZZZZ";
|
(others => 'Z');
|
|
|
|
|
|
|
end con_registro;
|
end con_registro;
|
No newline at end of file
|
No newline at end of file
|