Skip to content

Commit

Permalink
adding frameCnt register to SsiPrbsTx.vhd
Browse files Browse the repository at this point in the history
  • Loading branch information
ruck314 committed Apr 26, 2024
1 parent 7f4f7ec commit ebe0633
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions protocols/ssi/rtl/SsiPrbsTx.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,10 @@ architecture rtl of SsiPrbsTx is
DATA_S);

type RegType is record
cntRst : sl;
busy : sl;
overflow : sl;
frameCnt : slv(31 downto 0);
length : slv(31 downto 0);
packetLength : slv(31 downto 0);
dataCnt : slv(31 downto 0);
Expand All @@ -116,8 +118,10 @@ architecture rtl of SsiPrbsTx is
end record;

constant REG_INIT_C : RegType := (
cntRst => '1',
busy => '1',
overflow => '0',
frameCnt => (others => '0'),
length => (others => '0'),
packetLength => AXI_DEFAULT_PKT_LEN_G,
dataCnt => (others => '0'),
Expand Down Expand Up @@ -155,6 +159,9 @@ begin
-- Latch the current value
v := r;

-- Reset strobes
v.cntRst := '0';

----------------------------------------------------------------------------------------------
-- Axi-Lite Registers
----------------------------------------------------------------------------------------------
Expand All @@ -178,6 +185,9 @@ begin
axiSlaveRegisterR(axilEp, X"1C", 0, r.trigDly);

axiSlaveRegisterR(axilEp, X"20", 0, toSlv(PRBS_SEED_SIZE_G, 32));
axiSlaveRegisterR(axilEp, X"24", 0, r.frameCnt);

axiWrDetect(axilEp, X"FC", v.cntRst);

axiSlaveDefault(axilEp, v.axilWriteSlave, v.axilReadSlave, AXI_RESP_DECERR_C);

Expand Down Expand Up @@ -266,6 +276,8 @@ begin
v.dataCnt := r.dataCnt + 1;
-- Set the SOF bit
ssiSetUserSof(PRBS_SSI_CONFIG_C, v.txAxisMaster, '1');
-- Count the frame
v.frameCnt := r.frameCnt + 1;
-- Next State
v.state := LENGTH_S;
end if;
Expand Down Expand Up @@ -320,6 +332,11 @@ begin
----------------------------------------------------------------------
end case;

-- Check for counter reset
if (r.cntRst = '1') then
v.frameCnt := (others=>'0');
end if;

-- Reset
if (RST_ASYNC_G = false and locRst = '1') then
v := REG_INIT_C;
Expand Down

0 comments on commit ebe0633

Please sign in to comment.