ELGIP-73 HMBXR5601-771 - Removed read-data-valid from Single-Channel FPM Avalon Slave interface and replace it with wait-request signal, which allows variable read latency without having additional pending read/write accesses. This change is classified as minor-version, cause for the single-channel FPM the modification is completely confined within the block Qsys definition file (fire_pulse_manager_0_hw.tcl)
This commit is contained in:
parent
138b0e59d1
commit
06d8ad48e9
7 changed files with 557 additions and 44 deletions
68
generic_ip/common/0/sim/sim_cs_bus_itf.do
Normal file
68
generic_ip/common/0/sim/sim_cs_bus_itf.do
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
# Simulation macro
|
||||
|
||||
.main clear
|
||||
|
||||
# Cleanup libraries
|
||||
foreach lib [list work OSVVM] {
|
||||
file delete -force -- $lib
|
||||
vlib $lib
|
||||
}
|
||||
|
||||
set COMP_ONLY 0
|
||||
|
||||
set TB_PATH ./../src/test
|
||||
set SRC_PATH ../src
|
||||
set OSVVM_PATH $TB_PATH/OSVVM
|
||||
|
||||
set WORKLIB work
|
||||
|
||||
vlib ./work
|
||||
vmap work ./work
|
||||
|
||||
if {$COMP_ONLY == 0} {
|
||||
# Compile the constrained random related packages
|
||||
vlib OSVVM
|
||||
vcom -2008 -work OSVVM \
|
||||
$OSVVM_PATH/RandomBasePkg.vhd \
|
||||
$OSVVM_PATH/SortListPkg_int.vhd \
|
||||
$OSVVM_PATH/RandomPkg.vhd \
|
||||
$OSVVM_PATH/NamePkg.vhd \
|
||||
$OSVVM_PATH/MessagePkg.vhd \
|
||||
$OSVVM_PATH/CoveragePkg.vhd
|
||||
}
|
||||
|
||||
# compile the UUTs:
|
||||
vcom -2008 -work $WORKLIB $SRC_PATH/cs_bus_itf.vhd
|
||||
|
||||
|
||||
# Compile the testbench and the other components supporting the test
|
||||
if {$COMP_ONLY == 0} {
|
||||
# Test support packages
|
||||
vcom -2008 -work $WORKLIB $TB_PATH/common_test_pkg.vhd
|
||||
vcom -2008 -work $WORKLIB $TB_PATH/log_pkg.vhd
|
||||
vcom -2008 -work $WORKLIB $TB_PATH/avalon_verify_pkg.vhd
|
||||
|
||||
# Testbench
|
||||
vcom -2008 -work $WORKLIB $TB_PATH/cs_bus_itf_tb.vhd
|
||||
|
||||
vsim -t ps work.cs_bus_itf_tb
|
||||
|
||||
|
||||
#add wave cs_bus_itf_tb/*
|
||||
#add wave cs_bus_itf_tb/iUUT/*
|
||||
|
||||
# remove warnings from standard numeric/arithmetic packages (speed-up simulation)
|
||||
set StdArithNoWarnings 1
|
||||
set NumericStdNoWarnings 1
|
||||
|
||||
do wave_cs_bus_itf.do
|
||||
|
||||
when -label end_of_simulation {test_completed == true} {echo "Simulation Completed"; stop ;}
|
||||
run -all
|
||||
|
||||
#run 1 ms;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
77
generic_ip/common/0/sim/wave_cs_bus_itf.do
Normal file
77
generic_ip/common/0/sim/wave_cs_bus_itf.do
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
onerror {resume}
|
||||
quietly WaveActivateNextPane {} 0
|
||||
add wave -noupdate /cs_bus_itf_tb/reset_n
|
||||
add wave -noupdate /cs_bus_itf_tb/clk
|
||||
add wave -noupdate -radix hexadecimal /cs_bus_itf_tb/avs_address
|
||||
add wave -noupdate /cs_bus_itf_tb/avs_write
|
||||
add wave -noupdate -radix hexadecimal /cs_bus_itf_tb/avs_writedata
|
||||
add wave -noupdate /cs_bus_itf_tb/avs_read
|
||||
add wave -noupdate /cs_bus_itf_tb/avs_waitrequest
|
||||
add wave -noupdate -radix hexadecimal /cs_bus_itf_tb/avs_readdata
|
||||
add wave -noupdate /cs_bus_itf_tb/cs_addr
|
||||
add wave -noupdate /cs_bus_itf_tb/cs_we
|
||||
add wave -noupdate -radix hexadecimal /cs_bus_itf_tb/cs_wr_data
|
||||
add wave -noupdate /cs_bus_itf_tb/cs_re
|
||||
add wave -noupdate /cs_bus_itf_tb/cs_rv
|
||||
add wave -noupdate -radix hexadecimal /cs_bus_itf_tb/cs_rd_data
|
||||
add wave -noupdate -radix hexadecimal /cs_bus_itf_tb/avs_m
|
||||
add wave -noupdate -radix hexadecimal /cs_bus_itf_tb/avs_s
|
||||
add wave -noupdate /cs_bus_itf_tb/end_of_stimuli
|
||||
add wave -noupdate /cs_bus_itf_tb/test_completed
|
||||
add wave -noupdate /cs_bus_itf_tb/setup
|
||||
add wave -noupdate /cs_bus_itf_tb/running
|
||||
add wave -noupdate /cs_bus_itf_tb/passed
|
||||
add wave -noupdate /cs_bus_itf_tb/failed
|
||||
add wave -noupdate /cs_bus_itf_tb/blk_0_re
|
||||
add wave -noupdate /cs_bus_itf_tb/blk_0_we
|
||||
add wave -noupdate /cs_bus_itf_tb/blk_0_rv
|
||||
add wave -noupdate /cs_bus_itf_tb/blk_0_re_d
|
||||
add wave -noupdate /cs_bus_itf_tb/blk_1_re
|
||||
add wave -noupdate /cs_bus_itf_tb/blk_1_we
|
||||
add wave -noupdate /cs_bus_itf_tb/blk_1_rv
|
||||
add wave -noupdate /cs_bus_itf_tb/blk_1_re_d
|
||||
add wave -noupdate -radix hexadecimal /cs_bus_itf_tb/blk_0_wr_data
|
||||
add wave -noupdate -radix hexadecimal /cs_bus_itf_tb/blk_0_rd_data
|
||||
add wave -noupdate -radix hexadecimal /cs_bus_itf_tb/blk_1_wr_data
|
||||
add wave -noupdate -radix hexadecimal /cs_bus_itf_tb/blk_1_rd_data
|
||||
add wave -noupdate /cs_bus_itf_tb/iUUT/rstN
|
||||
add wave -noupdate /cs_bus_itf_tb/iUUT/clk
|
||||
add wave -noupdate -radix hexadecimal /cs_bus_itf_tb/iUUT/avs_address
|
||||
add wave -noupdate /cs_bus_itf_tb/iUUT/avs_write
|
||||
add wave -noupdate -radix hexadecimal /cs_bus_itf_tb/iUUT/avs_writedata
|
||||
add wave -noupdate /cs_bus_itf_tb/iUUT/avs_read
|
||||
add wave -noupdate /cs_bus_itf_tb/iUUT/avs_waitrequest
|
||||
add wave -noupdate -radix hexadecimal /cs_bus_itf_tb/iUUT/avs_readdata
|
||||
add wave -noupdate -radix hexadecimal /cs_bus_itf_tb/iUUT/cs_addr
|
||||
add wave -noupdate /cs_bus_itf_tb/iUUT/cs_we
|
||||
add wave -noupdate -radix hexadecimal /cs_bus_itf_tb/iUUT/cs_wr_data
|
||||
add wave -noupdate /cs_bus_itf_tb/iUUT/cs_re
|
||||
add wave -noupdate /cs_bus_itf_tb/iUUT/cs_rv
|
||||
add wave -noupdate -radix hexadecimal /cs_bus_itf_tb/iUUT/cs_rd_data
|
||||
add wave -noupdate -radix hexadecimal /cs_bus_itf_tb/iUUT/cs_rd_data_i
|
||||
add wave -noupdate /cs_bus_itf_tb/iUUT/avs_read_d
|
||||
add wave -noupdate /cs_bus_itf_tb/iUUT/avs_rd_en
|
||||
add wave -noupdate /cs_bus_itf_tb/iUUT/read_valid
|
||||
add wave -noupdate /cs_bus_itf_tb/iUUT/stall_read
|
||||
add wave -noupdate /cs_bus_itf_tb/iUUT/dummy_rv
|
||||
add wave -noupdate /cs_bus_itf_tb/iUUT/timeout_flag
|
||||
add wave -noupdate -radix unsigned /cs_bus_itf_tb/iUUT/read_timeout_cnt
|
||||
add wave -noupdate /cs_bus_itf_tb/iUUT/avs_address_i
|
||||
TreeUpdate [SetDefaultTree]
|
||||
WaveRestoreCursors {{Cursor 1} {1273181 ps} 0}
|
||||
quietly wave cursor active 1
|
||||
configure wave -namecolwidth 273
|
||||
configure wave -valuecolwidth 187
|
||||
configure wave -justifyvalue left
|
||||
configure wave -signalnamewidth 0
|
||||
configure wave -snapdistance 10
|
||||
configure wave -datasetprefix 0
|
||||
configure wave -rowmargin 4
|
||||
configure wave -childrowmargin 2
|
||||
configure wave -gridoffset 0
|
||||
configure wave -gridperiod 1
|
||||
configure wave -griddelta 40
|
||||
configure wave -timeline 0
|
||||
configure wave -timelineunits ps
|
||||
update
|
||||
WaveRestoreZoom {0 ps} {3540224 ps}
|
||||
|
|
@ -10,7 +10,7 @@
|
|||
-- Description: Split the memory space from the Avalon-MM I/F and drive the C&S
|
||||
-- bus for a programmable number of FW processing blocks
|
||||
-------------------------------------------------------------------------------
|
||||
-- Last update: 2016-10-28
|
||||
-- Last update: 2019-07-11
|
||||
-------------------------------------------------------------------------------
|
||||
-- Revisions :
|
||||
-- Date Version Author Description
|
||||
|
|
@ -23,7 +23,9 @@ use ieee.std_logic_1164.all;
|
|||
use ieee.numeric_std.all;
|
||||
|
||||
entity cs_bus_ift is
|
||||
generic(blk_num : integer range 1 to 16 := 1);
|
||||
generic(
|
||||
BLK_NUM : integer range 1 to 16 := 1;
|
||||
READ_TIMEOUT : integer range 16 to 1023 := 64);
|
||||
port(
|
||||
rstN : in std_logic;
|
||||
clk : in std_logic;
|
||||
|
|
@ -32,32 +34,39 @@ entity cs_bus_ift is
|
|||
avs_write : in std_logic;
|
||||
avs_writedata : in std_logic_vector(31 downto 0);
|
||||
avs_read : in std_logic;
|
||||
avs_readdatavalid : out std_logic;
|
||||
avs_waitrequest : out std_logic;
|
||||
avs_readdata : out std_logic_vector(31 downto 0);
|
||||
-- C&S bus
|
||||
cs_addr : out std_logic_vector(10 downto 0);
|
||||
cs_we : out std_logic_vector(blk_num-1 downto 0);
|
||||
cs_we : out std_logic_vector(BLK_NUM-1 downto 0);
|
||||
cs_wr_data : out std_logic_vector(31 downto 0);
|
||||
cs_re : out std_logic_vector(blk_num-1 downto 0);
|
||||
cs_rv : in std_logic_vector(blk_num-1 downto 0);
|
||||
cs_rd_data : in std_logic_vector(32*blk_num-1 downto 0));
|
||||
cs_re : out std_logic_vector(BLK_NUM-1 downto 0);
|
||||
cs_rv : in std_logic_vector(BLK_NUM-1 downto 0);
|
||||
cs_rd_data : in std_logic_vector(32*BLK_NUM-1 downto 0));
|
||||
end cs_bus_ift;
|
||||
|
||||
architecture RTL of cs_bus_ift is
|
||||
|
||||
-- limit to 16 the maximum number of user blocks
|
||||
type rd_bus_t is array (0 to blk_num-1) of std_logic_vector(31 downto 0);
|
||||
type rd_bus_t is array (0 to BLK_NUM-1) of std_logic_vector(31 downto 0);
|
||||
|
||||
signal cs_rd_data_i : rd_bus_t;
|
||||
signal avs_read_d : std_logic;
|
||||
signal avs_rd_en : std_logic;
|
||||
signal dummy_rv : std_logic; -- Dummy Read valid: asserted when
|
||||
-- trying to read from not allocated addresses
|
||||
signal avs_address_i : std_logic_vector(14 downto 0);
|
||||
signal cs_rd_data_i : rd_bus_t;
|
||||
signal avs_read_d : std_logic;
|
||||
signal avs_rd_en : std_logic;
|
||||
signal avs_write_d : std_logic;
|
||||
signal avs_wr_en : std_logic;
|
||||
signal sel_read_valid : std_logic;
|
||||
signal read_valid : std_logic;
|
||||
signal stall_read : std_logic;
|
||||
signal dummy_rv : std_logic; -- Dummy Read valid: asserted when
|
||||
-- trying to read from not allocated addresses
|
||||
signal timeout_flag : std_logic;
|
||||
signal read_timeout_cnt : std_logic_vector( 9 downto 0);
|
||||
signal avs_address_i : std_logic_vector(14 downto 0);
|
||||
|
||||
begin
|
||||
|
||||
BUS_REMAP: for i in 0 to blk_num-1 generate
|
||||
BUS_REMAP: for i in 0 to BLK_NUM-1 generate
|
||||
cs_rd_data_i(i) <= cs_rd_data((i+1)*32-1 downto i*32);
|
||||
end generate BUS_REMAP;
|
||||
|
||||
|
|
@ -68,49 +77,71 @@ begin
|
|||
cs_we <= (others => '0');
|
||||
cs_wr_data <= (others => '0');
|
||||
cs_re <= (others => '0');
|
||||
avs_readdatavalid <= '0';
|
||||
avs_readdata <= (others => '0');
|
||||
avs_read_d <= '0';
|
||||
avs_write_d <= '0';
|
||||
dummy_rv <= '0';
|
||||
stall_read <= '0';
|
||||
elsif(clk = '1' and clk'event) then
|
||||
if(avs_write = '1' or avs_read = '1') then
|
||||
avs_address_i <= avs_address;
|
||||
end if;
|
||||
avs_read_d <= avs_read;
|
||||
for i in 0 to blk_num-1 loop
|
||||
avs_read_d <= avs_read;
|
||||
avs_write_d <= avs_write;
|
||||
for i in 0 to BLK_NUM-1 loop
|
||||
-- limit to 16 the maximum number of user blocks
|
||||
if(avs_write = '1' and to_integer(unsigned(avs_address(avs_address'high downto avs_address'high-3))) = i) then
|
||||
if(avs_wr_en = '1' and to_integer(unsigned(avs_address(avs_address'high downto avs_address'high-3))) = i) then
|
||||
cs_we(i) <= '1';
|
||||
else
|
||||
cs_we(i) <= '0';
|
||||
end if;
|
||||
end loop; -- i
|
||||
cs_wr_data <= avs_writedata;
|
||||
for i in 0 to blk_num-1 loop
|
||||
if(avs_wr_en = '1') then
|
||||
cs_wr_data <= avs_writedata;
|
||||
end if;
|
||||
for i in 0 to BLK_NUM-1 loop
|
||||
if(avs_rd_en = '1' and to_integer(unsigned(avs_address(avs_address'high downto avs_address'high-3))) = i) then
|
||||
cs_re(i) <= '1';
|
||||
else
|
||||
cs_re(i) <= '0';
|
||||
end if;
|
||||
end loop; -- i
|
||||
if(avs_rd_en = '1' and (to_integer(unsigned(avs_address(avs_address'high downto avs_address'high-3))) >= blk_num)) then
|
||||
if((avs_rd_en = '1' and (to_integer(unsigned(avs_address(avs_address'high downto avs_address'high-3))) >= BLK_NUM)) or timeout_flag = '1') then
|
||||
dummy_rv <= '1';
|
||||
else
|
||||
dummy_rv <= '0';
|
||||
end if;
|
||||
avs_readdatavalid <= dummy_rv or cs_rv(to_integer(unsigned(avs_address_i(avs_address'high downto avs_address'high-3))));
|
||||
if(dummy_rv = '0') then
|
||||
if(sel_read_valid = '1') then
|
||||
avs_readdata <= cs_rd_data_i(to_integer(unsigned(avs_address_i(avs_address'high downto avs_address'high-3))));
|
||||
else
|
||||
elsif(dummy_rv = '1') then
|
||||
avs_readdata <= X"DEAD_BEEF";
|
||||
end if;
|
||||
if(avs_rd_en = '1') then
|
||||
stall_read <= '1';
|
||||
elsif(read_valid = '1') then
|
||||
stall_read <= '0';
|
||||
end if;
|
||||
if(avs_rd_en = '1') then
|
||||
read_timeout_cnt <= (others => '0');
|
||||
elsif(avs_read_d = '1') then
|
||||
read_timeout_cnt <= std_logic_vector(unsigned(read_timeout_cnt)+1);
|
||||
end if;
|
||||
end if;
|
||||
end process pLatchIO;
|
||||
|
||||
avs_rd_en <= avs_read and not avs_read_d;
|
||||
sel_read_valid <= cs_rv(to_integer(unsigned(avs_address_i(avs_address'high downto avs_address'high-3))));
|
||||
read_valid <= dummy_rv or sel_read_valid;
|
||||
|
||||
|
||||
avs_rd_en <= avs_read and not avs_read_d;
|
||||
avs_wr_en <= avs_write and not avs_write_d;
|
||||
|
||||
avs_waitrequest <= avs_rd_en or avs_wr_en or stall_read;
|
||||
|
||||
cs_addr <= avs_address_i(10 downto 0);
|
||||
|
||||
timeout_flag <= '1' when unsigned(read_timeout_cnt) = READ_TIMEOUT else '0';
|
||||
|
||||
end RTL;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -353,9 +353,9 @@ package body AVALON_VERIFY_PKG is
|
|||
mm_m_rec.mm_writedata <= data;
|
||||
mm_m_rec.mm_write <= '1';
|
||||
wait until falling_edge(clk_clk);
|
||||
while(mm_use_waitrequest.is_set = true and mm_s_rec.mm_waitrequest = '1') loop
|
||||
wait until falling_edge(clk_clk);
|
||||
end loop;
|
||||
if(mm_use_waitrequest.is_set = true and mm_s_rec.mm_waitrequest = '1') then
|
||||
wait until falling_edge(mm_s_rec.mm_waitrequest);
|
||||
end if;
|
||||
wait until rising_edge(clk_clk);
|
||||
mm_m_rec.mm_byteenable <= "0000";
|
||||
mm_m_rec.mm_write <= '0';
|
||||
|
|
@ -425,9 +425,9 @@ package body AVALON_VERIFY_PKG is
|
|||
mm_m_rec.mm_address <= addr or base_addr;
|
||||
mm_m_rec.mm_read <= '1';
|
||||
wait until falling_edge(clk_clk);
|
||||
while(mm_use_waitrequest.is_set = true and mm_s_rec.mm_waitrequest = '1') loop
|
||||
wait until falling_edge(clk_clk);
|
||||
end loop;
|
||||
if(mm_use_waitrequest.is_set = true and mm_s_rec.mm_waitrequest = '1') then
|
||||
wait until falling_edge(mm_s_rec.mm_waitrequest);
|
||||
end if;
|
||||
wait until rising_edge(clk_clk);
|
||||
mm_m_rec.mm_read <= '0';
|
||||
if(mm_use_waitrequest.is_set = false) then
|
||||
|
|
|
|||
332
generic_ip/common/0/src/test/cs_bus_itf_tb.vhd
Normal file
332
generic_ip/common/0/src/test/cs_bus_itf_tb.vhd
Normal file
|
|
@ -0,0 +1,332 @@
|
|||
-------------------------------------------------------------------------------
|
||||
-- Title : cs_bus_itf_tb
|
||||
-- Project : Generic
|
||||
-------------------------------------------------------------------------------
|
||||
-- File : cs_bus_itf_tb.vhd
|
||||
-- Author : GMG
|
||||
-- Company : Global Inkjet Systems
|
||||
-- Created : 2019-07-10
|
||||
-- Last update: 2019-07-10
|
||||
-- SVN ID : Git
|
||||
-- Standard : VHDL'2008
|
||||
-------------------------------------------------------------------------------
|
||||
-- Description:
|
||||
-- Verifies Time-of-Flight Compensation
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
library std;
|
||||
use std.textio.all;
|
||||
|
||||
library ieee;
|
||||
use ieee.std_logic_1164.all;
|
||||
use ieee.numeric_std.all;
|
||||
|
||||
use work.log_pkg.all;
|
||||
use work.avalon_verify_pkg.all;
|
||||
|
||||
entity cs_bus_itf_tb is
|
||||
-- ..
|
||||
end entity cs_bus_itf_tb;
|
||||
|
||||
architecture behav of cs_bus_itf_tb is
|
||||
|
||||
constant CLK_PERIOD : time := 10 ns;
|
||||
|
||||
-- Logging Verbosity Level
|
||||
constant VERBOSITY_LEVEL : verb_level_t := VMEDIUM;
|
||||
|
||||
constant BLK_NUM : natural := 8;
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
-- Signal declarations
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
signal reset_n : std_logic;
|
||||
signal clk : std_logic := '0';
|
||||
signal avs_address : std_logic_vector(14 downto 0);
|
||||
signal avs_write : std_logic;
|
||||
signal avs_writedata : std_logic_vector(31 downto 0);
|
||||
signal avs_read : std_logic;
|
||||
signal avs_waitrequest : std_logic;
|
||||
signal avs_readdata : std_logic_vector(31 downto 0);
|
||||
signal cs_addr : std_logic_vector(10 downto 0);
|
||||
signal cs_we : std_logic_vector(BLK_NUM-1 downto 0);
|
||||
signal cs_wr_data : std_logic_vector(31 downto 0);
|
||||
signal cs_re : std_logic_vector(BLK_NUM-1 downto 0);
|
||||
signal cs_rv : std_logic_vector(BLK_NUM-1 downto 0);
|
||||
signal cs_rd_data : std_logic_vector(32*BLK_NUM-1 downto 0);
|
||||
--
|
||||
signal avs_m : mm_m_rec_t;
|
||||
signal avs_s : mm_s_rec_t;
|
||||
--
|
||||
signal end_of_stimuli : boolean;
|
||||
signal test_completed : boolean;
|
||||
signal setup : boolean;
|
||||
signal running : boolean;
|
||||
signal passed : boolean;
|
||||
signal failed : boolean;
|
||||
|
||||
shared variable error_flag : boolean;
|
||||
|
||||
signal blk_0_re, blk_0_we, blk_0_rv, blk_0_re_d : std_logic;
|
||||
signal blk_1_re, blk_1_we, blk_1_rv, blk_1_re_d : std_logic;
|
||||
signal blk_0_wr_data, blk_0_rd_data : std_logic_vector(31 downto 0);
|
||||
signal blk_1_wr_data, blk_1_rd_data : std_logic_vector(31 downto 0);
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
-- TB Functions / Procedures
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
procedure wait_latency(
|
||||
signal clk : in std_logic;
|
||||
cycles : in natural) is
|
||||
begin
|
||||
for i in 1 to cycles loop
|
||||
wait until clk = '1' and clk'event;
|
||||
end loop; -- i
|
||||
end procedure wait_latency;
|
||||
-----------------------------------------------------------------------------
|
||||
-- End declarative part
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
begin -- architecture behav
|
||||
|
||||
clk <= not clk after 0.5*CLK_PERIOD;
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
-- UUT
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
iUUT: entity work.cs_bus_ift
|
||||
generic map (
|
||||
BLK_NUM => BLK_NUM,
|
||||
READ_TIMEOUT => 32)
|
||||
port map (
|
||||
rstN => reset_n,
|
||||
clk => clk,
|
||||
avs_address => avs_address,
|
||||
avs_write => avs_write,
|
||||
avs_writedata => avs_writedata,
|
||||
avs_read => avs_read,
|
||||
avs_waitrequest => avs_waitrequest,
|
||||
avs_readdata => avs_readdata,
|
||||
cs_addr => cs_addr,
|
||||
cs_we => cs_we,
|
||||
cs_wr_data => cs_wr_data,
|
||||
cs_re => cs_re,
|
||||
cs_rv => cs_rv,
|
||||
cs_rd_data => cs_rd_data);
|
||||
|
||||
-- Instantiate only 2 dummy blocks, leave the rest unconnected
|
||||
blk_0_we <= cs_we(0);
|
||||
blk_1_we <= cs_we(1);
|
||||
|
||||
blk_0_re <= cs_re(0);
|
||||
blk_1_re <= cs_re(1);
|
||||
|
||||
cs_rv <= (0 => blk_0_rv, 1 => blk_1_rv, others => '0');
|
||||
|
||||
cs_rd_data(31 downto 0) <= blk_0_rd_data;
|
||||
cs_rd_data(63 downto 32) <= blk_1_rd_data;
|
||||
cs_rd_data(32*BLK_NUM-1 downto 64) <= (others => '1');
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
-- CS-BUS dummy pripherals
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
pDUMMY_0 : process(clk)
|
||||
variable rd_val_v : std_logic_vector(3 downto 0) := (others => '0');
|
||||
begin
|
||||
if(clk = '1' and clk'event) then
|
||||
if(blk_0_we = '1') then
|
||||
blk_0_wr_data <= cs_wr_data;
|
||||
end if;
|
||||
blk_0_re_d <= blk_0_re;
|
||||
if(blk_0_re = '1' and blk_0_re_d = '0') then
|
||||
rd_val_v := (0 => '1', others => '0');
|
||||
else
|
||||
rd_val_v := '0' & rd_val_v(rd_val_v'left downto 1);
|
||||
end if;
|
||||
if(rd_val_v(0) = '1') then
|
||||
blk_0_rv <= '1';
|
||||
blk_0_rd_data <= X"AAAA0000";
|
||||
else
|
||||
blk_0_rv <= '0';
|
||||
blk_0_rd_data <= X"0000BAD0";
|
||||
end if;
|
||||
end if;
|
||||
end process pDUMMY_0;
|
||||
|
||||
pDUMMY_1 : process(clk)
|
||||
variable rd_val_v : std_logic_vector(3 downto 0) := (others => '0');
|
||||
begin
|
||||
if(clk = '1' and clk'event) then
|
||||
if(blk_1_we = '1') then
|
||||
blk_1_wr_data <= cs_wr_data;
|
||||
end if;
|
||||
blk_1_re_d <= blk_1_re;
|
||||
if(blk_1_re = '1' and blk_1_re_d = '0') then
|
||||
rd_val_v := (3 => '1', others => '0');
|
||||
else
|
||||
rd_val_v := '0' & rd_val_v(rd_val_v'left downto 1);
|
||||
end if;
|
||||
if(rd_val_v(0) = '1') then
|
||||
blk_1_rv <= '1';
|
||||
blk_1_rd_data <= X"BBBB0000";
|
||||
else
|
||||
blk_1_rv <= '0';
|
||||
blk_1_rd_data <= X"0000BAD1";
|
||||
end if;
|
||||
end if;
|
||||
end process pDUMMY_1;
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
-- Avalon interface
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
clk_clk <= clk;
|
||||
reset_reset_n <= reset_n;
|
||||
|
||||
avs_s.mm_readdata <= avs_readdata;
|
||||
|
||||
avs_s.mm_readdatavalid <= '0';
|
||||
|
||||
avs_s.mm_waitrequest <= avs_waitrequest;
|
||||
avs_s.use_readvalid <= false;
|
||||
|
||||
avs_address <= avs_m.mm_address(avs_address'range);
|
||||
avs_write <= avs_m.mm_write;
|
||||
avs_writedata <= avs_m.mm_writedata;
|
||||
avs_read <= avs_m.mm_read;
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
-- Testbench Logic
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
pTB_CTRL : process
|
||||
|
||||
procedure wr_data(
|
||||
blk : natural;
|
||||
reg : natural;
|
||||
data : in std_logic_vector(31 downto 0);
|
||||
signal avs_s : in mm_s_rec_t;
|
||||
signal avs_m : out mm_m_rec_t) is
|
||||
|
||||
|
||||
variable addr : std_logic_vector(31 downto 0) := (others => '0');
|
||||
|
||||
begin
|
||||
|
||||
addr := 17x"0" & std_logic_vector(to_unsigned(blk,4)) & std_logic_vector(to_unsigned(reg,11));
|
||||
mm_32b_write(addr, data, avs_s, avs_m);
|
||||
|
||||
end procedure wr_data;
|
||||
|
||||
procedure rd_data(
|
||||
blk : natural;
|
||||
reg : natural;
|
||||
data : out std_logic_vector(31 downto 0);
|
||||
signal avs_s : in mm_s_rec_t;
|
||||
signal avs_m : out mm_m_rec_t) is
|
||||
|
||||
|
||||
variable addr : std_logic_vector(31 downto 0) := (others => '0');
|
||||
|
||||
begin
|
||||
|
||||
addr := 17x"0" & std_logic_vector(to_unsigned(blk,4)) & std_logic_vector(to_unsigned(reg,11));
|
||||
mm_32b_read(addr, data, avs_s, avs_m);
|
||||
|
||||
end procedure rd_data;
|
||||
|
||||
variable data : std_logic_vector(31 downto 0);
|
||||
|
||||
begin
|
||||
|
||||
-- Set the verbosity level for logging
|
||||
set_log_verbosity(VERBOSITY_LEVEL);
|
||||
--set_log_verbosity(VHIGH);
|
||||
|
||||
-- initilialize the Avalon master-bus
|
||||
mm_m_init(avs_m, use_waitrequest => true);
|
||||
|
||||
log_header("verifying CS_BUS_ITF:", VLOW);
|
||||
|
||||
setup <= false;
|
||||
running <= false;
|
||||
passed <= false;
|
||||
error_flag := false;
|
||||
|
||||
-- Reset
|
||||
reset_n <= '0';
|
||||
wait for 100 ns;
|
||||
wait until clk = '1' and clk'event;
|
||||
reset_n <= '1';
|
||||
|
||||
wait for 200 ns;
|
||||
running <= true;
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
-- Write & Read
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
wait_latency(clk, 20);
|
||||
|
||||
wr_data(0, 4, X"A0A0B1B1", avs_s, avs_m);
|
||||
wait_latency(clk, 5);
|
||||
if(blk_0_wr_data /= X"A0A0B1B1") then
|
||||
log("ERROR : Expecting written data A0A0B1B1 on block 0", VLOW);
|
||||
error_flag := true;
|
||||
end if;
|
||||
|
||||
wait_latency(clk, 20);
|
||||
wr_data(0, 8, X"C0C0D1D1", avs_s, avs_m);
|
||||
wait_latency(clk, 5);
|
||||
if(blk_0_wr_data /= X"C0C0D1D1") then
|
||||
log("ERROR : Expecting written data C0C0D1D1 on block 1", VLOW);
|
||||
error_flag := true;
|
||||
end if;
|
||||
|
||||
wait_latency(clk, 20);
|
||||
wr_data(2, 0, X"EE00FF11", avs_s, avs_m);
|
||||
wait_latency(clk, 20);
|
||||
wr_data(7, 0, X"EE00FF11", avs_s, avs_m);
|
||||
|
||||
|
||||
for blk_num in 0 to 7 loop
|
||||
rd_data(blk_num, 16, data, avs_s, avs_m);
|
||||
log("Read Data 0x" & to_hstring(data) & " from block " & to_string(blk_num), VLOW);
|
||||
wait_latency(clk, 50);
|
||||
end loop; -- blk_num
|
||||
|
||||
wait_latency(clk, 50);
|
||||
running <= false;
|
||||
|
||||
wait for 5 us;
|
||||
end_of_stimuli <= true;
|
||||
if(error_flag = false) then
|
||||
passed <= true after 100 ns;
|
||||
end if;
|
||||
wait;
|
||||
|
||||
end process pTB_CTRL;
|
||||
|
||||
failed <= error_flag after 100 ns;
|
||||
|
||||
pREPORT_RESULT : process
|
||||
begin
|
||||
wait until failed = true or passed = true;
|
||||
wait for 1 us;
|
||||
log_separator_line(VLOW);
|
||||
if(failed = true) then
|
||||
log("FAILURE: test completed with errors.", VLOW);
|
||||
elsif(passed = true) then
|
||||
log("SUCCESS: test successfully completed.", VLOW);
|
||||
end if;
|
||||
log_separator_line(VLOW);
|
||||
test_completed <= true;
|
||||
end process pREPORT_RESULT;
|
||||
|
||||
|
||||
end architecture behav;
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
# TCL File Generated by Component Editor 16.0
|
||||
# Wed Oct 25 15:26:07 BST 2017
|
||||
# Wed Jul 10 10:00:03 BST 2019
|
||||
# DO NOT MODIFY
|
||||
|
||||
|
||||
#
|
||||
# fire_pulse_manager_0 "fire_pulse_manager_0" v1.0
|
||||
# GMG 2017.10.25.15:26:07
|
||||
# GMG 2019.07.10.10:00:03
|
||||
# Fire Pulse Manager
|
||||
#
|
||||
|
||||
|
|
@ -40,12 +40,11 @@ add_fileset QUARTUS_SYNTH QUARTUS_SYNTH "" ""
|
|||
set_fileset_property QUARTUS_SYNTH TOP_LEVEL fire_pulse_manager_0
|
||||
set_fileset_property QUARTUS_SYNTH ENABLE_RELATIVE_INCLUDE_PATHS false
|
||||
set_fileset_property QUARTUS_SYNTH ENABLE_FILE_OVERWRITE_MODE false
|
||||
#add_fileset_file pkg_functions.vhd VHDL PATH ../../../common/0/src/pkg_functions.vhd
|
||||
add_fileset_file common_pkg.vhd VHDL PATH ../../../common/0/src/common_pkg.vhd
|
||||
add_fileset_file sync_reset.vhd VHDL PATH ../../../common/0/src/sync_reset.vhd
|
||||
add_fileset_file sync_wire.vhd VHDL PATH ../../../common/0/src/sync_wire.vhd
|
||||
add_fileset_file sync_wire_rEdge.vhd VHDL PATH ../../../common/0/src/sync_wire_rEdge.vhd
|
||||
add_fileset_file fifo_1024x32.vhd VHDL PATH ../../../common/0//src/altera/fifo_1024x32.vhd
|
||||
add_fileset_file fifo_1024x32.vhd VHDL PATH ../../../common/0/src/altera/fifo_1024x32.vhd
|
||||
add_fileset_file fifo_256x32.vhd VHDL PATH ../../../common/0/src/altera/fifo_256x32.vhd
|
||||
add_fileset_file sync_fifo.vhd VHDL PATH ../../../common/0/src/altera/sync_fifo.vhd
|
||||
add_fileset_file cs_bus_itf.vhd VHDL PATH ../../../common/0/src/cs_bus_itf.vhd
|
||||
|
|
@ -72,12 +71,11 @@ add_fileset SIM_VHDL SIM_VHDL "" ""
|
|||
set_fileset_property SIM_VHDL TOP_LEVEL fire_pulse_manager_0
|
||||
set_fileset_property SIM_VHDL ENABLE_RELATIVE_INCLUDE_PATHS false
|
||||
set_fileset_property SIM_VHDL ENABLE_FILE_OVERWRITE_MODE false
|
||||
#add_fileset_file pkg_functions.vhd VHDL PATH ../../../common/0/src/pkg_functions.vhd
|
||||
add_fileset_file common_pkg.vhd VHDL PATH ../../../common/0/src/common_pkg.vhd
|
||||
add_fileset_file sync_reset.vhd VHDL PATH ../../../common/0/src/sync_reset.vhd
|
||||
add_fileset_file sync_wire.vhd VHDL PATH ../../../common/0/src/sync_wire.vhd
|
||||
add_fileset_file sync_wire_rEdge.vhd VHDL PATH ../../../common/0/src/sync_wire_rEdge.vhd
|
||||
add_fileset_file fifo_1024x32.vhd VHDL PATH ../../../common/0//src/altera/fifo_1024x32.vhd
|
||||
add_fileset_file fifo_1024x32.vhd VHDL PATH ../../../common/0/src/altera/fifo_1024x32.vhd
|
||||
add_fileset_file fifo_256x32.vhd VHDL PATH ../../../common/0/src/altera/fifo_256x32.vhd
|
||||
add_fileset_file sync_fifo.vhd VHDL PATH ../../../common/0/src/altera/sync_fifo.vhd
|
||||
add_fileset_file cs_bus_itf.vhd VHDL PATH ../../../common/0/src/cs_bus_itf.vhd
|
||||
|
|
@ -98,7 +96,7 @@ add_fileset_file smb_diagnostics_0.vhd VHDL PATH ../src/smb_diagnostics_0.vhd
|
|||
add_fileset_file fire_pulse_0_pkg.vhd VHDL PATH ../src/fire_pulse_0_pkg.vhd
|
||||
add_fileset_file uart_regen_0.vhd VHDL PATH ../src/uart_regen_0.vhd
|
||||
add_fileset_file fire_pulse_ctrl_0.vhd VHDL PATH ../src/fire_pulse_ctrl_0.vhd
|
||||
add_fileset_file fire_pulse_manager_0.vhd VHDL PATH ../src/fire_pulse_manager_0.vhd
|
||||
add_fileset_file fire_pulse_manager_0.vhd VHDL PATH ../src/fire_pulse_manager_0.vhd
|
||||
|
||||
|
||||
#
|
||||
|
|
@ -153,7 +151,7 @@ set_interface_property avs burstcountUnits WORDS
|
|||
set_interface_property avs explicitAddressSpan 0
|
||||
set_interface_property avs holdTime 0
|
||||
set_interface_property avs linewrapBursts false
|
||||
set_interface_property avs maximumPendingReadTransactions 1
|
||||
set_interface_property avs maximumPendingReadTransactions 0
|
||||
set_interface_property avs maximumPendingWriteTransactions 0
|
||||
set_interface_property avs readLatency 0
|
||||
set_interface_property avs readWaitTime 1
|
||||
|
|
@ -170,8 +168,8 @@ add_interface_port avs avs_address address Input 15
|
|||
add_interface_port avs avs_write write Input 1
|
||||
add_interface_port avs avs_writedata writedata Input 32
|
||||
add_interface_port avs avs_read read Input 1
|
||||
add_interface_port avs avs_readdatavalid readdatavalid Output 1
|
||||
add_interface_port avs avs_readdata readdata Output 32
|
||||
add_interface_port avs avs_waitrequest waitrequest Output 1
|
||||
set_interface_assignment avs embeddedsw.configuration.isFlash 0
|
||||
set_interface_assignment avs embeddedsw.configuration.isMemoryDevice 0
|
||||
set_interface_assignment avs embeddedsw.configuration.isNonVolatileStorage 0
|
||||
|
|
@ -217,6 +215,7 @@ add_interface_port rx_clk rx_clk clk Input 1
|
|||
add_interface irq_0 interrupt end
|
||||
set_interface_property irq_0 associatedAddressablePoint ""
|
||||
set_interface_property irq_0 associatedClock clock
|
||||
set_interface_property irq_0 associatedReset reset
|
||||
set_interface_property irq_0 bridgedReceiverOffset ""
|
||||
set_interface_property irq_0 bridgesToReceiver ""
|
||||
set_interface_property irq_0 ENABLED true
|
||||
|
|
@ -227,12 +226,14 @@ set_interface_property irq_0 SVD_ADDRESS_GROUP ""
|
|||
|
||||
add_interface_port irq_0 ins_fpm_irq_0 irq Output 1
|
||||
|
||||
|
||||
#
|
||||
# connection point irq_1
|
||||
#
|
||||
add_interface irq_1 interrupt end
|
||||
set_interface_property irq_1 associatedAddressablePoint ""
|
||||
set_interface_property irq_1 associatedClock clock
|
||||
set_interface_property irq_1 associatedReset reset
|
||||
set_interface_property irq_1 bridgedReceiverOffset ""
|
||||
set_interface_property irq_1 bridgesToReceiver ""
|
||||
set_interface_property irq_1 ENABLED true
|
||||
|
|
@ -243,12 +244,14 @@ set_interface_property irq_1 SVD_ADDRESS_GROUP ""
|
|||
|
||||
add_interface_port irq_1 ins_fpm_irq_1 irq Output 1
|
||||
|
||||
|
||||
#
|
||||
# connection point irq_2
|
||||
#
|
||||
add_interface irq_2 interrupt end
|
||||
set_interface_property irq_2 associatedAddressablePoint ""
|
||||
set_interface_property irq_2 associatedClock clock
|
||||
set_interface_property irq_2 associatedReset reset
|
||||
set_interface_property irq_2 bridgedReceiverOffset ""
|
||||
set_interface_property irq_2 bridgesToReceiver ""
|
||||
set_interface_property irq_2 ENABLED true
|
||||
|
|
@ -259,12 +262,14 @@ set_interface_property irq_2 SVD_ADDRESS_GROUP ""
|
|||
|
||||
add_interface_port irq_2 ins_fpm_irq_2 irq Output 1
|
||||
|
||||
|
||||
#
|
||||
# connection point irq_3
|
||||
#
|
||||
add_interface irq_3 interrupt end
|
||||
set_interface_property irq_3 associatedAddressablePoint ""
|
||||
set_interface_property irq_3 associatedClock clock
|
||||
set_interface_property irq_3 associatedReset reset
|
||||
set_interface_property irq_3 bridgedReceiverOffset ""
|
||||
set_interface_property irq_3 bridgesToReceiver ""
|
||||
set_interface_property irq_3 ENABLED true
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
-- Author : Gianmarco Girau
|
||||
-- Company : Global Inkjet Systems
|
||||
-- Created : 2017-09-06
|
||||
-- Last update: 2019-03-22
|
||||
-- Last update: 2019-07-10
|
||||
-- SVN ID : Git
|
||||
-- Standard : VHDL'08
|
||||
-------------------------------------------------------------------------------
|
||||
|
|
@ -45,7 +45,7 @@ entity fire_pulse_manager_0 is
|
|||
avs_write : in std_logic;
|
||||
avs_writedata : in std_logic_vector(31 downto 0);
|
||||
avs_read : in std_logic;
|
||||
avs_readdatavalid : out std_logic;
|
||||
avs_waitrequest : out std_logic;
|
||||
avs_readdata : out std_logic_vector(31 downto 0));
|
||||
end entity fire_pulse_manager_0;
|
||||
|
||||
|
|
@ -162,7 +162,7 @@ begin
|
|||
avs_write => avs_write,
|
||||
avs_writedata => avs_writedata,
|
||||
avs_read => avs_read,
|
||||
avs_readdatavalid => avs_readdatavalid,
|
||||
avs_waitrequest => avs_waitrequest,
|
||||
avs_readdata => avs_readdata,
|
||||
cs_addr => cs_addr,
|
||||
cs_we => cs_write_en,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue