Maintenance scheduled 24th July -- expect downtime along that day

Commit 757b8fff authored by penacoba's avatar penacoba

Improved models for testbench


git-svn-id: http://svn.ohwr.org/fmc-tdc@52 85dfdc96-de2c-444c-878d-45b388be74a9
parent 320d75f0
......@@ -152,8 +152,8 @@ begin
interface_fifo1: acam_fifo_model
generic map(
size => 256,
full_threshold => 20,
empty_threshold => 10
full_threshold => 10,
empty_threshold => 1
)
port map(
data_input => timestamp_for_fifo1,
......@@ -167,8 +167,8 @@ begin
interface_fifo2: acam_fifo_model
generic map(
size => 256,
full_threshold => 20,
empty_threshold => 10
full_threshold => 10,
empty_threshold => 1
)
port map(
data_input => timestamp_for_fifo2,
......
......@@ -31,6 +31,8 @@ end acam_fifo_model;
architecture behavioral of acam_fifo_model is
constant ts_ef : time:= 11800 ps; -- maximum empty flag set time
subtype index is natural range size-1 downto 0;
subtype memory_cell is std_logic_vector(27 downto 0);
type memory_block is array (natural range size-1 downto 0) of memory_cell;
......@@ -59,15 +61,22 @@ begin
begin
if rising_edge(rd_fifo) then
data_output <= fifo(rd_pointer);
end if;
if falling_edge(rd_fifo) then
if rd_pointer = size-1 then
rd_pointer <= 0;
rd_pointer <= 0 after ts_ef;
else
rd_pointer <= rd_pointer + 1;
rd_pointer <= rd_pointer + 1 after ts_ef;
end if;
end if;
-- if falling_edge(rd_fifo) then
-- if rd_pointer = size-1 then
-- rd_pointer <= 0;
-- else
-- rd_pointer <= rd_pointer + 1;
-- end if;
-- end if;
end process;
flags: process(level)
......
......@@ -68,7 +68,7 @@ end component; -- cmd_router1
type boolean_vector is array (natural range <>) of boolean;
constant MAX_FILES : integer := 10;
constant FILENAMES : FILE_ARRAY(0 to MAX_FILES-1) := (others=>"data_vectors/acam_test_cmd0.vec");
constant FILENAMES : FILE_ARRAY(0 to MAX_FILES-1) := (others=>"data_vectors/atdc_test_cmd0.vec");
-- , "data_vectors/acam_test_cmd1.vec");
-- "data_vectors/acam_test_cmd2.vec", "data_vectors/acam_test_cmd3.vec",
-- "data_vectors/acam_test_cmd4.vec", "data_vectors/acam_test_cmd5.vec",
......
......@@ -271,7 +271,7 @@ constant spec_clk_period : time:= 50 ns;
-- Number of Models receiving commands
constant N_BFM : integer := 1; -- 0 : GN412X_BFM in Model Mode
-- -- 1 : GN412X_BFM in DUT mode
-- -- 1 : GN412X_BFM in DUT mode
-- Number of files to feed BFMs
constant N_FILES : integer := 1;
--
......@@ -320,6 +320,7 @@ signal tstop2 : std_logic;
signal tstop3 : std_logic;
signal tstop4 : std_logic;
signal tstop5 : std_logic;
signal dummy_tstop5 : std_logic;
signal tdc_in_fpga_5 : std_logic;
......@@ -482,7 +483,7 @@ begin
tstop2_i => tstop2,
tstop3_i => tstop3,
tstop4_i => tstop4,
tstop5_i => tstop5,
tstop5_i => dummy_tstop5,
startdis_i => start_dis_o,
stopdis_i => stop_dis_o,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment