Skip to content

Commit

Permalink
Merge pull request #1214 from slaclab/AxiStreamFrameRateLimiter
Browse files Browse the repository at this point in the history
Update to AxiStreamFrameRateLimiter.vhd
  • Loading branch information
ruck314 authored Oct 28, 2024
2 parents 5494d20 + 4f5c274 commit fe3e643
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions axi/axi-stream/rtl/AxiStreamFrameRateLimiter.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ entity AxiStreamFrameRateLimiter is
sAxisSlave : out AxiStreamSlaveType;
mAxisMaster : out AxiStreamMasterType;
mAxisSlave : in AxiStreamSlaveType;
mAxisCtrl : in AxiStreamCtrlType := AXI_STREAM_CTRL_UNUSED_C;
-- Optional: AXI Lite Interface (axilClk domain)
axilClk : in sl := '0';
axilRst : in sl := '0';
Expand Down Expand Up @@ -135,7 +136,8 @@ begin
dataIn => writeReg(1)(0),
dataOut => backpressure);

comb : process (axisRst, backpressure, r, rateLimit, sAxisMaster, txSlave) is
comb : process (axisRst, backpressure, mAxisCtrl, r, rateLimit, sAxisMaster,
txSlave) is
variable v : RegType;
variable i : natural;
begin
Expand All @@ -157,8 +159,16 @@ begin
when IDLE_S =>
-- Update the variable
if (r.rateLimit = 0) or (r.rateLimit /= r.frameCnt) then
v.tValid := '1';
-- Check if back pressure mode
if (backpressure = '0') then
-- Accept data if not paused downstream
v.tValid := not(mAxisCtrl.pause);
else
-- Accept data
v.tValid := '1';
end if;
else
-- Blow off data
v.tValid := '0';
end if;

Expand Down

0 comments on commit fe3e643

Please sign in to comment.