From e41edbfbab2a4cc6b5c962dbe0ad20acc9d067f1 Mon Sep 17 00:00:00 2001 From: gianmarcogirau Date: Fri, 12 Jul 2019 10:18:48 +0100 Subject: [PATCH] ELGIP-73 HMBXR5601-771 - avalon waitrequest signal is now asserted by default, which allows the signal to be generated in a sequential wasy, instead of being combinational --- generic_ip/common/0/sim/wave_cs_bus_itf.do | 3 +-- generic_ip/common/0/src/cs_bus_itf.vhd | 21 ++++++++++++--------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/generic_ip/common/0/sim/wave_cs_bus_itf.do b/generic_ip/common/0/sim/wave_cs_bus_itf.do index 1edb5e8..1203a93 100644 --- a/generic_ip/common/0/sim/wave_cs_bus_itf.do +++ b/generic_ip/common/0/sim/wave_cs_bus_itf.do @@ -52,13 +52,12 @@ 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} +WaveRestoreCursors {{Cursor 1} {515000 ps} 0} quietly wave cursor active 1 configure wave -namecolwidth 273 configure wave -valuecolwidth 187 diff --git a/generic_ip/common/0/src/cs_bus_itf.vhd b/generic_ip/common/0/src/cs_bus_itf.vhd index 3974670..63147de 100644 --- a/generic_ip/common/0/src/cs_bus_itf.vhd +++ b/generic_ip/common/0/src/cs_bus_itf.vhd @@ -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: 2019-07-11 +-- Last update: 2019-07-12 ------------------------------------------------------------------------------- -- Revisions : -- Date Version Author Description @@ -57,7 +57,6 @@ architecture RTL of cs_bus_ift is 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; @@ -78,10 +77,10 @@ begin cs_wr_data <= (others => '0'); cs_re <= (others => '0'); avs_readdata <= (others => '0'); + avs_waitrequest <= '1'; 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; @@ -116,10 +115,16 @@ begin 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'; + -- waitrequest can be decoupled from the read and write request signals. + -- waitrequest may be asserted during idle cycles. An Avalon-MM master may initiate + -- a transaction when waitrequest is asserted and wait for that signal to be + -- deasserted. Decoupling waitrequest from read and write requests may improve + -- system timing. Decoupling eliminates a combinational loop including the read, + -- write, and waitrequest signals. + if(avs_wr_en = '1' or read_valid = '1') then + avs_waitrequest <= '0'; + else + avs_waitrequest <= '1'; end if; if(avs_rd_en = '1') then read_timeout_cnt <= (others => '0'); @@ -136,8 +141,6 @@ begin 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';