Line 47... |
Line 47... |
library altera; use altera.stp;
|
library altera; use altera.stp;
|
|
|
|
|
entity user is port(
|
entity user is port(
|
/* Comment-out for simulation. */
|
/* Comment-out for simulation. */
|
clk,reset:in std_ulogic;
|
clk,nReset:in std_ulogic;
|
|
|
/* AXI Master interface */
|
/* AXI Master interface */
|
-- axiMaster_in:in t_axi4StreamTransactor_s2m;
|
-- axiMaster_in:in t_axi4StreamTransactor_s2m;
|
axiMaster_out:buffer t_axi4StreamTransactor_m2s;
|
axiMaster_out:buffer t_axi4StreamTransactor_m2s
|
|
|
/* Debug ports. */
|
/* Debug ports. */
|
selTxn:in unsigned(3 downto 0):=x"0"
|
-- selTxn:in unsigned(3 downto 0):=x"5" -- select PRBS by default.
|
);
|
);
|
end entity user;
|
end entity user;
|
|
|
architecture rtl of user is
|
architecture rtl of user is
|
signal i_reset:std_ulogic:='0';
|
signal i_reset:std_ulogic:='0';
|
signal porCnt:unsigned(3 downto 0);
|
signal porCnt:unsigned(3 downto 0);
|
|
|
/* Global counters. */
|
/* Global counters. */
|
constant maxSymbols:positive:=2048; --maximum number of symbols allowed to be transmitted in a frame. Each symbol's width equals tData's width.
|
constant maxSymbols:positive:=2048; --maximum number of symbols allowed to be transmitted in a frame. Each symbol's width equals tData's width.
|
signal symbolsPerTransfer:t_cnt;
|
|
signal outstandingTransactions:t_cnt;
|
signal lastTransaction:boolean;
|
|
|
/* BFM signalling. */
|
/* BFM signalling. */
|
signal readRequest,writeRequest:t_bfm:=(address=>(others=>'X'),message=>(others=>'X'),trigger=>false);
|
signal readRequest,writeRequest:t_bfm:=(address=>(others=>'X'),message=>(others=>'X'),trigger=>false);
|
signal readResponse,writeResponse:t_bfm;
|
signal readResponse,writeResponse:t_bfm;
|
|
|
/* Tester signals. */
|
/* Tester signals. */
|
/* synthesis translate_off */
|
/* synthesis translate_off */
|
signal clk,reset:std_ulogic:='0';
|
signal clk,nReset:std_ulogic:='0';
|
attribute period:time; attribute period of clk:signal is 10 ps;
|
attribute period:time; attribute period of clk:signal is 10 ps;
|
/* synthesis translate_on */
|
/* synthesis translate_on */
|
|
|
signal dbg_axiTxFSM:axiBfmStatesTx;
|
signal dbg_axiTxFSM:axiBfmStatesTx;
|
signal anlysr_dataIn:std_logic_vector(255 downto 0);
|
signal anlysr_dataIn:std_logic_vector(255 downto 0);
|
signal anlysr_trigger:std_ulogic;
|
signal anlysr_trigger:std_ulogic;
|
|
|
signal axiMaster_in:t_axi4StreamTransactor_s2m;
|
signal axiMaster_in:t_axi4StreamTransactor_s2m;
|
signal irq_write:std_ulogic; -- clock gating.
|
signal irq_write:std_ulogic; -- clock gating.
|
|
|
|
signal selTxn:unsigned(3 downto 0):=4x"0"; -- select PRBS by default.
|
|
|
begin
|
begin
|
/* Bus functional models. */
|
/* Bus functional models. */
|
axiMaster: entity tauhop.axiBfmMaster(rtl)
|
axiMaster: entity tauhop.axiBfmMaster(rtl)
|
port map(
|
port map(
|
aclk=>irq_write, n_areset=>not i_reset,
|
aclk=>irq_write, n_areset=>not i_reset,
|
Line 95... |
Line 97... |
readRequest=>readRequest, writeRequest=>writeRequest,
|
readRequest=>readRequest, writeRequest=>writeRequest,
|
readResponse=>readResponse, writeResponse=>writeResponse,
|
readResponse=>readResponse, writeResponse=>writeResponse,
|
axiMaster_in=>axiMaster_in,
|
axiMaster_in=>axiMaster_in,
|
axiMaster_out=>axiMaster_out,
|
axiMaster_out=>axiMaster_out,
|
|
|
symbolsPerTransfer=>symbolsPerTransfer,
|
lastTransaction=>lastTransaction,
|
outstandingTransactions=>outstandingTransactions,
|
|
dbg_axiTxFSM=>dbg_axiTxFSM
|
dbg_axiTxFSM=>dbg_axiTxFSM
|
);
|
);
|
|
|
/* Clocks and reset. */
|
/* Clocks and reset. */
|
/* Power-on Reset circuitry. */
|
/* Power-on Reset circuitry. */
|
por: process(reset,clk) is begin
|
por: process(nReset,clk) is begin
|
if reset then i_reset<='1'; porCnt<=(others=>'1');
|
if not nReset then i_reset<='1'; porCnt<=(others=>'1');
|
elsif rising_edge(clk) then
|
elsif rising_edge(clk) then
|
i_reset<='0';
|
i_reset<='0';
|
|
|
if porCnt>0 then i_reset<='1'; porCnt<=porCnt-1; end if;
|
if porCnt>0 then i_reset<='1'; porCnt<=porCnt-1; end if;
|
end if;
|
end if;
|
end process por;
|
end process por;
|
|
|
/* synthesis translate_off */
|
/* synthesis translate_off */
|
clk<=not clk after clk'period/2;
|
clk<=not clk after clk'period/2;
|
process is begin
|
process is begin
|
reset<='0'; wait for 1 ps;
|
nReset<='0'; wait for 1 ps;
|
reset<='1'; wait for 500 ps;
|
nReset<='1'; wait for 500 ps;
|
reset<='0';
|
nReset<='0';
|
wait;
|
wait;
|
end process;
|
end process;
|
/* synthesis translate_on */
|
/* synthesis translate_on */
|
|
|
/* Simulation Tester. */
|
/* Simulation Tester. */
|
|
|
/* Hardware tester. */
|
/* Hardware tester. */
|
bist: entity work.tester(rtl) port map(
|
bist: entity work.tester(cdcrv) port map(
|
clk=>clk, reset=>i_reset,
|
clk=>clk, reset=>i_reset,
|
axiMaster_in=>axiMaster_in,
|
axiMaster_in=>axiMaster_in,
|
axiMaster_out=>axiMaster_out,
|
axiMaster_out=>axiMaster_out,
|
readRequest=>readRequest, writeRequest=>writeRequest,
|
readRequest=>readRequest, writeRequest=>writeRequest,
|
readResponse=>readResponse, writeResponse=>writeResponse,
|
readResponse=>readResponse, writeResponse=>writeResponse,
|
irq_write=>irq_write,
|
irq_write=>irq_write,
|
symbolsPerTransfer=>symbolsPerTransfer,
|
lastTransaction=>lastTransaction,
|
outstandingTransactions=>outstandingTransactions,
|
|
selTxn=>selTxn
|
selTxn=>selTxn
|
);
|
);
|
end architecture rtl;
|
end architecture rtl;
|
|
|
No newline at end of file
|
No newline at end of file
|