Line 1... |
Line 1... |
|
|
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
-- UNSL
|
-- UNSL - Modular Oscilloscope
|
--
|
--
|
-- File: eppwbn_wbn_side.vhd
|
-- File: eppwbn_wbn_side.vhd
|
-- File history:
|
-- Version: 0.20
|
-- See cvs history in opencores
|
-- Targeted device: Actel A3PE1500
|
--
|
--------------------------------------------------------------------------------
|
-- Description:
|
-- Description:
|
-- EPP- Wishbone bridge. This module is in the wishbone side.
|
-- EPP - Wishbone bridge.
|
--
|
-- This module is in the wishbone side (IEEE Std. 1284-2000).
|
-- Targeted device: Actel A3PR1500 <Die> <Package>
|
-------------------------------------------------------------------------------
|
-- Author: Facundo Aguilera
|
-- File history:
|
--
|
-- 0.01 | nov-2008 | First release
|
-- GPL
|
|
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
|
-- Copyright Facundo Aguilera 2008
|
|
-- GPL
|
|
|
|
|
-- comments in spanish
|
|
|
|
library IEEE;
|
library IEEE;
|
use IEEE.STD_LOGIC_1164.ALL;
|
use IEEE.STD_LOGIC_1164.ALL;
|
use IEEE.STD_LOGIC_ARITH.ALL;
|
--use IEEE.STD_LOGIC_ARITH.ALL;
|
|
|
|
|
entity eppwbn_wbn_side is
|
entity eppwbn_wbn_side is
|
port(
|
port(
|
|
|
-- salida al puerto epp
|
-- al puerto epp
|
inStrobe: in std_logic; -- Nomenclatura IEEE Std. 1284 ECP/EPP (Compatibiliy)
|
inStrobe: in std_logic; -- Nomenclatura IEEE Std. 1284, Negotiation/ECP/EPP (Compatibiliy)
|
-- HostClk/nWrite
|
-- HostClk/nWrite
|
iData: inout std_logic_vector (7 downto 0); -- AD8..1/AD8..1 (Data1..Data8)
|
iData: inout std_logic_vector (7 downto 0); -- AD8..1/AD8..1 (Data1..Data8)
|
-- inAck: out std_logic; -- PtrClk/PeriphClk/Intr
|
-- inAck: out std_logic; -- PtrClk/PeriphClk/Intr
|
iBusy: out std_logic; -- PtrBusy/PeriphAck/nWait
|
iBusy: out std_logic; -- PtrBusy/PeriphAck/nWait
|
-- iPError: out std_logic; -- AckData/nAckReverse
|
-- iPError: out std_logic; -- AckData/nAckReverse
|
Line 39... |
Line 39... |
-- inFault: out std_logic; -- nDataAvail/nPeriphRequest
|
-- inFault: out std_logic; -- nDataAvail/nPeriphRequest
|
inSelectIn: in std_logic; -- 1284 Active/nAStrb
|
inSelectIn: in std_logic; -- 1284 Active/nAStrb
|
-- iHostLogicH: in std_logic; -- (Host Logic High)
|
-- iHostLogicH: in std_logic; -- (Host Logic High)
|
-- i indica misma señal de salida al puerto, aunque interna en el core y controlada por el bloque de control
|
-- i indica misma señal de salida al puerto, aunque interna en el core y controlada por el bloque de control
|
|
|
-- salida a la interface wishbone
|
-- a la interface wishbone
|
RST_I: in std_logic;
|
RST_I: in std_logic;
|
CLK_I: in std_logic;
|
CLK_I: in std_logic;
|
DAT_I: in std_logic_vector (7 downto 0);
|
DAT_I: in std_logic_vector (7 downto 0);
|
DAT_O: out std_logic_vector (7 downto 0);
|
DAT_O: out std_logic_vector (7 downto 0);
|
ADR_O: out std_logic_vector (7 downto 0);
|
ADR_O: out std_logic_vector (7 downto 0);
|
Line 51... |
Line 51... |
STB_O: out std_logic;
|
STB_O: out std_logic;
|
ACK_I: in std_logic ;
|
ACK_I: in std_logic ;
|
WE_O: out std_logic;
|
WE_O: out std_logic;
|
|
|
|
|
rst_epp: in std_logic -- reser de la interfaz EPP
|
rst_pp: in std_logic -- reset desde la interfaz del puerto paralelo
|
|
|
|
|
-- selección de posición del byte
|
|
|
|
);
|
);
|
|
|
end eppwbn_wbn_side;
|
end eppwbn_wbn_side;
|
|
|
Line 74... |
Line 72... |
iBusy <= adr_ack or data_ack; -- nWait. Se utiliza para confirmación de lectuira/escritura de datos/direcciones
|
iBusy <= adr_ack or data_ack; -- nWait. Se utiliza para confirmación de lectuira/escritura de datos/direcciones
|
WE_O <= not(inStrobe); -- Ambas señales tienen la misma utilidad, habilitan escritura
|
WE_O <= not(inStrobe); -- Ambas señales tienen la misma utilidad, habilitan escritura
|
|
|
|
|
-- Data R/W
|
-- Data R/W
|
data_strobing: process (inAutoFd, ACK_I, CLK_I, pre_STB_O, RST_I, rst_epp)
|
data_strobing: process (inAutoFd, ACK_I, CLK_I, pre_STB_O, RST_I, rst_pp)
|
begin
|
begin
|
if (rst_epp = '1') then -- Reset de interfaz EPP
|
if (rst_pp = '1') then -- Reset de interfaz EPP
|
data_reg <= "00000000";
|
data_reg <= "00000000";
|
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 -- Reset de interfaz Wishbone
|
Line 101... |
Line 99... |
data_reg <= DAT_I;
|
data_reg <= DAT_I;
|
end if;
|
end if;
|
end if;
|
end if;
|
end if;
|
end if;
|
end if;
|
end if;
|
if (inAutoFd = '1' and data_ack = '1') then -- iBusy solo se pondrá a cero una vez que haya respuesta desde la PC
|
if (inAutoFd = '1' and data_ack = '1') then -- iBusy solo se pondrá a cero
|
data_ack <= '0';
|
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 a wishbone, lectura y escritura de datos desde epp
|
DAT_O <= data_reg; -- se utiliza el mismo registro para salida de datos
|
|
-- a wishbone, lectura y escritura de datos desde epp
|
|
|
|
|
-- 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_epp)
|
adr_strobing: process (inSelectIn, RST_I, rst_pp)
|
begin
|
begin
|
if (RST_I = '1' or rst_epp = '1') then
|
if (RST_I = '1' or rst_pp = '1') then
|
adr_reg <= "00000000";
|
adr_reg <= "00000000";
|
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;
|