Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding more RST_ASYNC_G support #1068

Merged
merged 38 commits into from
Apr 24, 2023
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
b9e9647
adding more RST_ASYNC_G support to 'base' and 'dsp' code
ruck314 Apr 7, 2023
4783e9f
fixed syntax
ruck314 Apr 7, 2023
be2bb37
changing SugoiSubordinate simRst to pwrUpRst with RST_POLARITY_G support
ruck314 Apr 7, 2023
44fc6b1
more RST_ASYNC_G suppport
ruck314 Apr 7, 2023
26bf9c3
revert change that was a bug
ruck314 Apr 7, 2023
ab87e8e
adding RST_ASYNC_G support to axi/axi-lite & protocols/packetizer
ruck314 Apr 7, 2023
b92eb56
adding RST_ASYNC_G support
ruck314 Apr 7, 2023
65e84f4
adding more RST_ASYNC_G support to axi-stream
ruck314 Apr 8, 2023
b2d9419
adding more RST_ASYNC_G support to protocols/ssi
ruck314 Apr 8, 2023
0e4f205
adding more RST_ASYNC_G support to protocols/pgp4
ruck314 Apr 8, 2023
352b0e8
bug fix
ruck314 Apr 8, 2023
e40b211
bug fix
ruck314 Apr 8, 2023
aeb9e40
bug fix
ruck314 Apr 8, 2023
15603b1
Merge remote-tracking branch 'origin/pre-release' into ESCORE-782
ruck314 Apr 8, 2023
045690c
changing pwrUpRst to pwrOnRstL
ruck314 Apr 8, 2023
4478afa
updating submodule lock
ruck314 Apr 8, 2023
25a5e68
more RST_ASYNC_G support updates
ruck314 Apr 8, 2023
beb4d06
applying @cbakalis-slac review recommendations
ruck314 Apr 14, 2023
18d558d
This process should have a comb label.
ruck314 Apr 18, 2023
dd35570
If this had a static true, it should probably stay that way.
ruck314 Apr 18, 2023
3ef43b4
This process should have a comb label.
ruck314 Apr 18, 2023
6d29be0
If this had a static true, it should probably stay that way.
ruck314 Apr 18, 2023
fb60489
reverting changes to AxiStreamFifo.vhd because will depreciate this m…
ruck314 Apr 18, 2023
a498b8b
Synchronous reset might be required here
ruck314 Apr 18, 2023
f581c83
The fifoReadLast signal needs to always act synchronously
ruck314 Apr 18, 2023
b27b909
The bufferClearSync should always act synchronously for proper timing…
ruck314 Apr 18, 2023
0e05377
reverting base/delay/rtl/SlvDelay.vhd because intending to implement …
ruck314 Apr 18, 2023
5702b9d
RST_ASYNC_G => false might be required.
ruck314 Apr 18, 2023
7e4ca22
Add comb process label.
ruck314 Apr 18, 2023
42c0b5f
If reset polarity is configurable, this should not have an L suffix.
ruck314 Apr 18, 2023
b45974a
adding same RST_ASYNC_G support Crc32/Crc32Parallel that was applied …
ruck314 Apr 18, 2023
54c671e
fixed typo
ruck314 Apr 18, 2023
3813809
resetStat much always operate synchronously.
ruck314 Apr 18, 2023
325edbd
resetStat must not operate asynchronously.
ruck314 Apr 18, 2023
52dcd3d
bug fix
ruck314 Apr 18, 2023
4dc8376
updating ruckus submodule lock
ruck314 Apr 21, 2023
8c03e76
`if` statement evaluated slip edge must be synchronous
ruck314 Apr 22, 2023
19775fe
git co origin/pre-release -- ruckus.tcl
ruck314 Apr 24, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions axi/axi-lite/rtl/AxiDualPortRam.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ use surf.AxiLitePkg.all;
entity AxiDualPortRam is
generic (
TPD_G : time := 1 ns;
RST_ASYNC_G : boolean := false;
SYNTH_MODE_G : string := "inferred";
MEMORY_TYPE_G : string := "block";
MEMORY_INIT_FILE_G : string := "none"; -- Used for MEMORY_TYPE_G="XPM only
Expand Down Expand Up @@ -201,6 +202,7 @@ begin
DualPortRam_1 : entity surf.DualPortRam
generic map (
TPD_G => TPD_G,
RST_ASYNC_G => RST_ASYNC_G,
MEMORY_TYPE_G => MEMORY_TYPE_G,
REG_EN_G => ite(READ_LATENCY_G >= 1, true, false),
DOA_REG_G => ite(READ_LATENCY_G >= 2, true, false),
Expand Down Expand Up @@ -232,6 +234,7 @@ begin
DualPortRam_1 : entity surf.DualPortRam
generic map (
TPD_G => TPD_G,
RST_ASYNC_G => RST_ASYNC_G,
MEMORY_TYPE_G => MEMORY_TYPE_G,
REG_EN_G => ite(READ_LATENCY_G >= 1, true, false),
DOA_REG_G => ite(READ_LATENCY_G >= 2, true, false),
Expand Down Expand Up @@ -261,6 +264,7 @@ begin
U_TrueDualPortRam_1 : entity surf.TrueDualPortRam
generic map (
TPD_G => TPD_G,
RST_ASYNC_G => RST_ASYNC_G,
BYTE_WR_EN_G => true,
DOA_REG_G => ite(READ_LATENCY_G >= 2, true, false),
DOB_REG_G => ite(READ_LATENCY_G >= 2, true, false),
Expand Down Expand Up @@ -301,6 +305,7 @@ begin
U_SynchronizerFifo_1 : entity surf.SynchronizerFifo
generic map (
TPD_G => TPD_G,
RST_ASYNC_G => RST_ASYNC_G,
COMMON_CLK_G => COMMON_CLK_G,
MEMORY_TYPE_G => "distributed",
DATA_WIDTH_G => ADDR_WIDTH_G+DATA_WIDTH_G+ADDR_AXI_BYTES_C)
Expand Down Expand Up @@ -387,7 +392,7 @@ begin
end case;

-- Reset
if (axiRst = '1') then
if (RST_ASYNC_G = false and axiRst = '1') then
v := REG_INIT_C;
end if;

Expand All @@ -400,18 +405,22 @@ begin

end process comb;

seq : process (axiClk) is
seq : process (axiClk, axiRst) is
begin
if (rising_edge(axiClk)) then
if (RST_ASYNC_G and axiRst = '1') then
r <= REG_INIT_C after TPD_G;
elsif rising_edge(axiClk) then
r <= rin after TPD_G;
end if;
end process seq;

OUT_REG : if((READ_LATENCY_G = 3) and (SYNTH_MODE_G /= "xpm")) generate
REG : process (clk) is
REG : process (clk, rst) is
begin
if(rising_edge(clk)) then
if (rst = '1') then
if (RST_ASYNC_G and rst = '1') then
dout <= (others => '0');
elsif (rising_edge(clk)) then
if (RST_ASYNC_G = false and rst = '1') then
dout <= (others => '0');
else
dout <= doutInt;
Expand Down
19 changes: 9 additions & 10 deletions axi/axi-lite/rtl/AxiLiteAsync.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@ use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;


library surf;
use surf.StdRtlPkg.all;
use surf.AxiLitePkg.all;

entity AxiLiteAsync is
generic (
TPD_G : time := 1 ns;
RST_ASYNC_G : boolean := false;
AXI_ERROR_RESP_G : slv(1 downto 0) := AXI_RESP_SLVERR_C;
COMMON_CLK_G : boolean := false;
NUM_ADDR_BITS_G : natural := 32;
PIPE_STAGES_G : integer range 0 to 16 := 0);
COMMON_CLK_G : boolean := false;
NUM_ADDR_BITS_G : natural := 32;
PIPE_STAGES_G : integer range 0 to 16 := 0);
port (
-- Slave Port
sAxiClk : in sl;
Expand Down Expand Up @@ -120,8 +120,6 @@ begin
asyncRst => mAxiClkRst,
syncRst => m2sRst);



------------------------------------
-- Read: Slave to Master
------------------------------------
Expand All @@ -130,6 +128,7 @@ begin
U_ReadSlaveToMastFifo : entity surf.FifoASync
generic map (
TPD_G => TPD_G,
RST_ASYNC_G => RST_ASYNC_G,
RST_POLARITY_G => '1',
MEMORY_TYPE_G => "distributed", -- Use Dist Ram
FWFT_EN_G => true,
Expand Down Expand Up @@ -184,7 +183,6 @@ begin
mAxiReadMaster.arvalid <= readSlaveToMastValid;
readSlaveToMastRead <= mAxiReadSlave.arready;


------------------------------------
-- Read: Master To Slave
------------------------------------
Expand All @@ -193,6 +191,7 @@ begin
U_ReadMastToSlaveFifo : entity surf.FifoASync
generic map (
TPD_G => TPD_G,
RST_ASYNC_G => RST_ASYNC_G,
RST_POLARITY_G => '1',
MEMORY_TYPE_G => "distributed", -- Use Dist Ram
FWFT_EN_G => true,
Expand Down Expand Up @@ -242,7 +241,6 @@ begin
sAxiReadSlave.rvalid <= ite(m2sRst = '0', readMastToSlaveValid, '1');
readMastToSlaveRead <= sAxiReadMaster.rready;


------------------------------------
-- Write Addr : Slave To Master
------------------------------------
Expand All @@ -251,6 +249,7 @@ begin
U_WriteAddrSlaveToMastFifo : entity surf.FifoASync
generic map (
TPD_G => TPD_G,
RST_ASYNC_G => RST_ASYNC_G,
RST_POLARITY_G => '1',
MEMORY_TYPE_G => "distributed", -- Use Dist Ram
FWFT_EN_G => true,
Expand Down Expand Up @@ -305,7 +304,6 @@ begin
mAxiWriteMaster.awvalid <= writeAddrSlaveToMastValid;
writeAddrSlaveToMastRead <= mAxiWriteSlave.awready;


------------------------------------
-- Write Data : Slave to Master
------------------------------------
Expand All @@ -314,6 +312,7 @@ begin
U_WriteDataSlaveToMastFifo : entity surf.FifoASync
generic map (
TPD_G => TPD_G,
RST_ASYNC_G => RST_ASYNC_G,
RST_POLARITY_G => '1',
MEMORY_TYPE_G => "distributed", -- Use Dist Ram
FWFT_EN_G => true,
Expand Down Expand Up @@ -363,7 +362,6 @@ begin
mAxiWriteMaster.wvalid <= writeDataSlaveToMastValid;
writeDataSlaveToMastRead <= mAxiWriteSlave.wready;


------------------------------------
-- Write: Status Master To Slave
------------------------------------
Expand All @@ -372,6 +370,7 @@ begin
U_WriteMastToSlaveFifo : entity surf.FifoASync
generic map (
TPD_G => TPD_G,
RST_ASYNC_G => RST_ASYNC_G,
RST_POLARITY_G => '1',
MEMORY_TYPE_G => "distributed", -- Use Dist Ram
FWFT_EN_G => true,
Expand Down
9 changes: 4 additions & 5 deletions axi/axi-lite/rtl/AxiLiteCrossbar.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ use surf.ArbiterPkg.all;
use surf.TextUtilPkg.all;

entity AxiLiteCrossbar is

generic (
TPD_G : time := 1 ns;
RST_ASYNC_G : boolean := false;
Expand Down Expand Up @@ -175,7 +174,7 @@ begin
case (r.slave(s).wrState) is
when S_WAIT_AXI_TXN_S =>

-- Incomming write
-- Incoming write
if (sAxiWriteMasters(s).awvalid = '1' and sAxiWriteMasters(s).wvalid = '1') then

for m in MASTERS_CONFIG_G'range loop
Expand Down Expand Up @@ -248,7 +247,7 @@ begin
case (r.slave(s).rdState) is
when S_WAIT_AXI_TXN_S =>

-- Incomming read
-- Incoming read
if (sAxiReadMasters(s).arvalid = '1') then
for m in MASTERS_CONFIG_G'range loop
-- Check for address match
Expand Down Expand Up @@ -340,7 +339,7 @@ begin
end if;

-- Upon valid request (set 1 cycle previous by arbitrate()), connect slave side
-- busses to this master's outputs.
-- buses to this master's outputs.
if (r.master(m).wrValid = '1') then
v.master(m).wrAcks := r.master(m).wrAcks;
v.mAxiWriteMasters(m) := sAxiWriteMasters(conv_integer(r.master(m).wrAckNum));
Expand Down Expand Up @@ -397,7 +396,7 @@ begin
end if;

-- Upon valid request (set 1 cycle previous by arbitrate()), connect slave side
-- busses to this master's outputs.
-- buses to this master's outputs.
if (r.master(m).rdValid = '1') then
v.master(m).rdAcks := r.master(m).rdAcks;
v.mAxiReadMasters(m) := sAxiReadMasters(conv_integer(r.master(m).rdAckNum));
Expand Down
45 changes: 20 additions & 25 deletions axi/axi-lite/rtl/AxiLiteFifoPop.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
-- Supports reading of general purpose FIFOs from the AxiLite bus.
-- One address location per FIFO.
-- Address map depends on the POP and LOOP FIFO counts.
-- RANGE_LSB_G sets the address bit which seperates the
-- RANGE_LSB_G sets the address bit which separates the
-- POP FIFO address space from the loop FIFO address space.
-- RANGE_LSB_G must be large enough for the number of POP and LOOP FIFOs
-- enabled. I.E. if POP_FIFO_COUNT_C is 8, RANGE_FIFO_G must be > 5.
-- POP Fifos exist at 0x0, 0x4, 0x8, 0xC ...
-- LOOP Fifos exist at 2^(RANGE_LSB_C) + 0x0, + 0x4, etc.
-- POP FIFOs exist at 0x0, 0x4, 0x8, 0xC ...
-- LOOP FIFOs exist at 2^(RANGE_LSB_C) + 0x0, + 0x4, etc.
-------------------------------------------------------------------------------
-- This file is part of 'SLAC Firmware Standard Library'.
-- It is subject to the license terms in the LICENSE.txt file found in the
Expand All @@ -23,9 +23,8 @@

library ieee;
use ieee.std_logic_1164.all;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;

use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;

library surf;
use surf.StdRtlPkg.all;
Expand All @@ -34,6 +33,7 @@ use surf.AxiLitePkg.all;
entity AxiLiteFifoPop is
generic (
TPD_G : time := 1 ns;
RST_ASYNC_G : boolean := true;
POP_FIFO_COUNT_G : positive := 1;
POP_SYNC_FIFO_G : boolean := false;
POP_MEMORY_TYPE_G : string := "block";
Expand All @@ -45,10 +45,8 @@ entity AxiLiteFifoPop is
LOOP_ADDR_WIDTH_G : integer range 4 to 48 := 4;
RANGE_LSB_G : integer range 0 to 31 := 8;
VALID_POSITION_G : integer range 0 to 31 := 0;
VALID_POLARITY_G : sl := '0'
);
VALID_POLARITY_G : sl := '0');
port (

-- AXI Interface (axiClk)
axiClk : in sl;
axiClkRst : in sl;
Expand All @@ -61,16 +59,14 @@ entity AxiLiteFifoPop is
loopFifoValid : out slv(LOOP_FIFO_COUNT_G-1 downto 0);
loopFifoAEmpty : out slv(LOOP_FIFO_COUNT_G-1 downto 0);
loopFifoAFull : out slv(LOOP_FIFO_COUNT_G-1 downto 0);

-- POP FIFO Write Interface (popFifoClk)
popFifoClk : in slv(POP_FIFO_COUNT_G-1 downto 0);
popFifoRst : in slv(POP_FIFO_COUNT_G-1 downto 0);
popFifoWrite : in slv(POP_FIFO_COUNT_G-1 downto 0);
popFifoDin : in Slv32Array(POP_FIFO_COUNT_G-1 downto 0);
popFifoFull : out slv(POP_FIFO_COUNT_G-1 downto 0);
popFifoAFull : out slv(POP_FIFO_COUNT_G-1 downto 0);
popFifoPFull : out slv(POP_FIFO_COUNT_G-1 downto 0)
);
popFifoPFull : out slv(POP_FIFO_COUNT_G-1 downto 0));
end AxiLiteFifoPop;

architecture structure of AxiLiteFifoPop is
Expand Down Expand Up @@ -129,7 +125,7 @@ begin
CASCADE_SIZE_G => 1,
LAST_STAGE_ASYNC_G => true,
RST_POLARITY_G => '1',
RST_ASYNC_G => true,
RST_ASYNC_G => RST_ASYNC_G,
GEN_SYNC_FIFO_G => POP_SYNC_FIFO_G,
MEMORY_TYPE_G => POP_MEMORY_TYPE_G,
FWFT_EN_G => true,
Expand Down Expand Up @@ -182,7 +178,7 @@ begin
CASCADE_SIZE_G => 1,
LAST_STAGE_ASYNC_G => true,
RST_POLARITY_G => '1',
RST_ASYNC_G => true,
RST_ASYNC_G => RST_ASYNC_G,
GEN_SYNC_FIFO_G => true,
MEMORY_TYPE_G => LOOP_MEMORY_TYPE_G,
FWFT_EN_G => true,
Expand Down Expand Up @@ -237,15 +233,6 @@ begin
-- AXI Lite
-----------------------------------------

-- Sync
process (axiClk) is
begin
if (rising_edge(axiClk)) then
r <= rin after TPD_G;
end if;
end process;

-- Async
process (r, axiClkRst, axiReadMaster, axiWriteMaster, ipopFifoDout, ipopFifoValid, iloopFifoDout, iloopFifoValid ) is
ruck314 marked this conversation as resolved.
Show resolved Hide resolved
variable v : RegType;
variable axiStatus : AxiLiteStatusType;
Expand Down Expand Up @@ -303,7 +290,7 @@ begin
end if;

-- Reset
if (axiClkRst = '1') then
if (RST_ASYNC_G = false and axiClkRst = '1') then
v := REG_INIT_C;
end if;

Expand All @@ -320,5 +307,13 @@ begin

end process;

end architecture structure;
seq : process (axiClk, axiClkRst) is
begin
if (RST_ASYNC_G and axiClkRst = '1') then
r <= REG_INIT_C after TPD_G;
elsif rising_edge(axiClk) then
r <= rin after TPD_G;
end if;
end process seq;

end architecture structure;
Loading