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

Release Candidate v2.50.0 #1182

Merged
merged 55 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
cf07317
Create SaciAxiLiteMaster module
bengineerd Jun 11, 2024
9c6aee9
depreciating VLAN support in ethernet/EthMacCore because never tested…
ruck314 Jul 11, 2024
7395517
depreciating VLAN support in ethernet/IpV4Engine because never tested…
ruck314 Jul 11, 2024
2a25161
Pgp2fcGtyCore was build with 2023.1 (not 2020.1)
ruck314 Jul 24, 2024
0c38215
Merge pull request #1181 from slaclab/pgp2fc-version-check
ruck314 Jul 24, 2024
5c21dbc
Merge pull request #1176 from slaclab/eth-vlan-removal
ruck314 Aug 12, 2024
e190495
bug fix for locked IPs in MicroblazeBasicCore.bd for v2022.2 (or later)
ruck314 Aug 15, 2024
b0b2298
Merge pull request #1183 from slaclab/microblaze-dev
ruck314 Aug 15, 2024
7ad37a4
bug fix for microblaze/bd/2021.1
ruck314 Aug 15, 2024
a3f26a3
bug fix for microblaze/bd/2021.1
ruck314 Aug 15, 2024
11a7628
copying src from FilMarini:surf:roce fork
ruck314 Aug 23, 2024
3df82f7
copying src from FilMarini:surf:roce fork
ruck314 Aug 23, 2024
04fb1a5
emacs VHDL beautify
ruck314 Aug 23, 2024
00ebb05
removing isRoCE port (application specific) and switch to standard re…
ruck314 Aug 23, 2024
3549aa9
emacs VHDL beautify
ruck314 Aug 23, 2024
afca655
removing isRoCE port (application specific) and switch to standard re…
ruck314 Aug 23, 2024
e6cfae8
Remove variables from configuration
bengineerd Aug 26, 2024
853d681
Fix syntax error
bengineerd Aug 26, 2024
6162099
Merge remote-tracking branch 'origin/pre-release' into SaciAxiLiteMaster
bengineerd Sep 5, 2024
c1b2c19
Add testbench
bengineerd Sep 5, 2024
559d568
Only test at 0x00000000
bengineerd Sep 5, 2024
e719672
Fix syntax errors
bengineerd Sep 5, 2024
c478657
Fix typo
bengineerd Sep 5, 2024
a01a497
Fix axi lite clock period
bengineerd Sep 5, 2024
b9c4351
renaming file
ruck314 Sep 5, 2024
bf74f44
Move to pure VHDL sim
bengineerd Sep 5, 2024
bddd591
Assign upper addr bits, expand sim
bengineerd Sep 5, 2024
62fb73b
Restore cocotb sim
bengineerd Sep 5, 2024
7c4526e
Merge remote-tracking branch 'refs/remotes/origin/SaciAxiLiteMaster' …
bengineerd Sep 5, 2024
36e4490
Cleanup
bengineerd Sep 6, 2024
e649813
Cleanup
bengineerd Sep 6, 2024
9bb039a
Cleanup
bengineerd Sep 6, 2024
16d97e8
Add assert to SaciMaster2 to catch impossible SACI_CLK_PERIOD_G
bengineerd Sep 6, 2024
1465a5b
Faster SACI clock
bengineerd Sep 6, 2024
5422fbb
Cleanup
bengineerd Sep 6, 2024
10c470b
Linting
bengineerd Sep 6, 2024
0d02aee
Documentation
bengineerd Sep 6, 2024
b9898ff
Whitespace cleanup
bengineerd Sep 6, 2024
ef5f2a4
Update AxiStreamTrailerAppend.vhd
bengineerd Sep 6, 2024
e199cc1
Linting
bengineerd Sep 6, 2024
cdccc4c
Merge pull request #1185 from slaclab/AxiStreamTrailerAppend
ruck314 Sep 6, 2024
21df1bb
Merge pull request #1184 from slaclab/AxiStreamCompact
ruck314 Sep 6, 2024
8c3d087
Update test_SaciAxiLiteMasterTb.py
ruck314 Sep 6, 2024
7b4c2d9
Merge pull request #1163 from slaclab/SaciAxiLiteMaster
ruck314 Sep 6, 2024
8cb0c9e
Merge pull request #1186 from slaclab/axi-version-noconfig
ruck314 Sep 6, 2024
c6a90d4
copying src from FilMarini:surf:roce fork
ruck314 Sep 6, 2024
12133e1
emacs VHDL beautify
ruck314 Sep 6, 2024
0a44476
switch to standard reset convention
ruck314 Sep 6, 2024
0928e26
updating Description
ruck314 Sep 6, 2024
058f525
adding future support for RoCEv2 iCRC
ruck314 Sep 6, 2024
e2b9721
Merge pull request #1188 from slaclab/UdpEngineRx-RoCEv2
ruck314 Sep 6, 2024
9a26176
applied patch to AxiStreamCompact
FilMarini Sep 7, 2024
645e23a
applied SLAC emacs beautify
FilMarini Sep 9, 2024
2602ab8
Merge pull request #1187 from slaclab/AxiStreamTrailerRemove
ruck314 Sep 9, 2024
a6f05e9
Merge pull request #1190 from FilMarini/pre-release
ruck314 Sep 9, 2024
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
266 changes: 266 additions & 0 deletions axi/axi-stream/rtl/AxiStreamCompact.vhd
Original file line number Diff line number Diff line change
@@ -0,0 +1,266 @@
-------------------------------------------------------------------------------
-- Company : SLAC National Accelerator Laboratory
-------------------------------------------------------------------------------
-- Description:
-- Block to compact AXI-Streams if tKeep bits are not contiguous
-------------------------------------------------------------------------------
-- This file is part of 'SLAC Firmware Standard Library'.
-- It is subject to the license terms in the LICENSE.txt file found in the
-- top-level directory of this distribution and at:
-- https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html.
-- No part of 'SLAC Firmware Standard Library', including this file,
-- may be copied, modified, propagated, or distributed except according to
-- the terms contained in the LICENSE.txt file.
-------------------------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
-- use ieee.std_logic_arith.all;
use ieee.numeric_std.all;


library surf;
use surf.StdRtlPkg.all;
use surf.AxiStreamPkg.all;

entity AxiStreamCompact is

generic (
TPD_G : time := 1 ns;
RST_ASYNC_G : boolean := false;
PIPE_STAGES_G : natural := 0;
SLAVE_AXI_CONFIG_G : AxiStreamConfigType;
MASTER_AXI_CONFIG_G : AxiStreamConfigType);
port (
-- Clock and Reset
axisClk : in sl;
axisRst : in sl;
-- Slave Port
sAxisMaster : in AxiStreamMasterType;
sAxisSlave : out AxiStreamSlaveType;
-- Master Port
mAxisMaster : out AxiStreamMasterType;
mAxisSlave : in AxiStreamSlaveType);
end entity AxiStreamCompact;

architecture rtl of AxiStreamCompact is

function getTKeepMin (
tKeep : slv;
axisConfig : AxiStreamConfigType
)
return natural is
variable tKeepFull : slv(AXI_STREAM_MAX_TKEEP_WIDTH_C-1 downto 0);
variable i : natural;
begin -- function getTKeepRange
tKeepFull := resize(tKeep, AXI_STREAM_MAX_TKEEP_WIDTH_C);
for i in 0 to axisConfig.TDATA_BYTES_C-1 loop
if tKeepFull(i) = '1' then
return i;
end if;
end loop; -- i
end function getTKeepMin;

function getTKeepMax (
tKeep : slv;
axisConfig : AxiStreamConfigType
)
return natural is
variable tKeepFull : slv(AXI_STREAM_MAX_TKEEP_WIDTH_C-1 downto 0);
variable i : natural;
begin -- function getTKeepRange
tKeepFull := resize(tKeep, AXI_STREAM_MAX_TKEEP_WIDTH_C);
for i in axisConfig.TDATA_BYTES_C-1 downto 0 loop
if tKeepFull(i) = '1' then
return i;
end if;
end loop; -- i
end function getTKeepMax;

constant SLV_BYTES_C : positive := SLAVE_AXI_CONFIG_G.TDATA_BYTES_C;
constant MST_BYTES_C : positive := MASTER_AXI_CONFIG_G.TDATA_BYTES_C;

type RegType is record
count : natural;
obMaster : AxiStreamMasterType;
ibSlave : AxiStreamSlaveType;
tLastDet : boolean;
tLastOnNext : boolean;
tUserSet : boolean;
fullBus : boolean;
end record RegType;

constant REG_INIT_C : RegType := (
count => 0,
obMaster => axiStreamMasterInit(MASTER_AXI_CONFIG_G),
ibSlave => AXI_STREAM_SLAVE_INIT_C,
tLastDet => false,
tLastOnNext => false,
tUserSet => false,
fullBus => false
);

signal r : RegType := REG_INIT_C;
signal rin : RegType;

signal pipeAxisMaster : AxiStreamMasterType;
signal pipeAxisSlave : AxiStreamSlaveType;

begin -- architecture rtl

-- Make sure data widths are the same
assert (MST_BYTES_C >= SLV_BYTES_C)
report "Master data widths must be greater or equal than slave" severity failure;

comb : process (axisRst, pipeAxisSlave, r, sAxisMaster) is
variable v : RegType;
variable tKeepMin : natural;
variable tKeepWidth : natural;
variable tDataWidth : natural;
variable tDataMin : natural;
variable tDataCount : natural;
variable tDataVar : slv(sAxisMaster.tData'range);
begin -- process
-- Latch current value
v := r;

-- Init ready
v.ibSlave.tReady := '0';
v.tLastDet := false;
v.tLastOnNext := false;

-- Choose ready source and clear valid
if (pipeAxisSlave.tReady = '1') then
v.obMaster.tValid := '0';
end if;

-- Accept input data
if v.obMaster.tValid = '0' and not r.tLastOnNext then

-- Ready to accept
v.ibSlave.tReady := '1';

-- Input data is valid
if sAxisMaster.tValid = '1' then

-- Reset full flags
v.fullBus := false;

-- get tKeet boundaries
tKeepMin := getTKeepMin(sAxisMaster.tKeep, SLAVE_AXI_CONFIG_G);
tKeepWidth := getTKeep(sAxisMaster.tKeep, SLAVE_AXI_CONFIG_G);
tDataWidth := to_integer(shift_left(to_unsigned(tKeepWidth, SLV_BYTES_C), 3));
tDataCount := to_integer(shift_left(to_unsigned(r.count, SLV_BYTES_C), 3));
tDataMin := to_integer(shift_left(to_unsigned(tKeepMin, SLV_BYTES_C), 3));

-- Checks
-- -- Overflow
if tKeepWidth + r.count >= MASTER_AXI_CONFIG_G.TDATA_BYTES_C then
v.fullBus := true;
end if;
-- -- tLast
v.tLastDet := false;
if sAxisMaster.tLast = '1' then
v.tLastDet := true;
if tKeepWidth + r.count > MST_BYTES_C then
v.tLastDet := false;
v.tLastOnNext := true;
end if;
end if;

-- Gen bus
-- Shift if bus was full
if r.fullBus and not r.tLastOnNext then
v.obMaster.tData := std_logic_vector(shift_right(unsigned(r.obMaster.tData), MST_BYTES_C*8));
end if;
---- Remove initial bits
tDataVar := std_logic_vector(shift_right(unsigned(sAxisMaster.tData), tDataMin));
v.obMaster.tData(v.obMaster.tData'length-1 downto tDataCount+tDataWidth) := (others => '0');
v.obMaster.tData(tDataCount+tDataWidth-1 downto tDataCount) := tDataVar(tDataWidth-1 downto 0);
v.obMaster.tKeep := (others => '0');
v.obMaster.tKeep(r.count+tKeepWidth-1 downto 0) := (others => '1');
if not r.tUserSet then
v.obMaster.tUser := sAxisMaster.tUser;
v.tUserSet := true;
end if;

-- Update counter
v.count := r.count + tKeepWidth;

-- Bus is full
if v.fullBus or v.tLastDet or r.tLastOnNext then
-- Set tValid
v.obMaster.tValid := '1';
-- Update bit counter and shift data
if v.fullBus then
v.count := r.count + tKeepWidth - MST_BYTES_C;
else
v.count := 0;
end if;
-- Set tLast
if v.tLastDet and not v.tLastOnNext then
v.obMaster.tLast := '1';
else
v.obMaster.tLast := '0';
end if;
-- Set tData in case of forced tLast
if r.tLastOnNext then
v.obMaster.tData := std_logic_vector(shift_right(unsigned(r.obMaster.tData), MST_BYTES_C*8));
v.obMaster.tKeep := std_logic_vector(shift_right(unsigned(r.obMaster.tKeep), MST_BYTES_C));
v.obMaster.tLast := '1';
end if;
v.tUserSet := false;
end if;

end if;
end if;


sAxisSlave <= v.ibSlave;
pipeAxisMaster.tData(pipeAxisMaster.tData'length-1 downto MST_BYTES_C*8) <= (others => '0');
pipeAxisMaster.tData((MST_BYTES_C*8)-1 downto 0) <= r.obMaster.tData((MST_BYTES_C*8)-1 downto 0);
pipeAxisMaster.tKeep(pipeAxisMaster.tKeep'length-1 downto MST_BYTES_C) <= (others => '0');
pipeAxisMaster.tKeep((MST_BYTES_C)-1 downto 0) <= r.obMaster.tKeep((MST_BYTES_C)-1 downto 0);
pipeAxisMaster.tValid <= r.obMaster.tValid;
pipeAxisMaster.tUser <= r.obMaster.tUser;
pipeAxisMaster.tLast <= r.obMaster.tLast;

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

-- Register the variable for next clock cycle
rin <= v;


end process comb;

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

-- Optional output pipeline registers to ease timing
AxiStreamPipeline_1 : entity surf.AxiStreamPipeline
generic map (
TPD_G => TPD_G,
RST_ASYNC_G => RST_ASYNC_G,
-- SIDE_BAND_WIDTH_G => SIDE_BAND_WIDTH_G,
PIPE_STAGES_G => PIPE_STAGES_G)
port map (
axisClk => axisClk,
axisRst => axisRst,
sAxisMaster => pipeAxisMaster,
-- sSideBand => pipeSideBand,
sAxisSlave => pipeAxisSlave,
mAxisMaster => mAxisMaster,
-- mSideBand => mSideBand,
mAxisSlave => mAxisSlave);


end architecture rtl;
Loading
Loading