Generalise the firmware to n input links rather than hardcoding to 8 or using N_REGIONS
The following discussion from !59 (merged) should be addressed:
-
@rardino started a discussion: (+2 comments) I apologize to add more material to the MR. If possible (and to generalize the firmware), can we generalize the firmware to n input links (
N_ILINK
for instance) and not stick it to 8 input links? For instancetype TLinkBuffer is array (natural range <>) of ldata(7 downto 0);
would be changed to something like this
type TLinkBuffer is array (natural range <>) of ldata(N_ILINK - 1 downto 0);
with
N_STREAM
taken from thetop_decl
oralgo_decl
, for example.Same story for the
comma_gap_cleaner
(here), which would be changed from thisentity comma_gap_cleaner is generic ( QUADS : natural := N_REGION ); port ( clk : in std_logic; rst : in std_logic; d : in ldata(4*QUADS - 1 downto 0); q : out ldata(4*QUADS - 1 downto 0); lid : out TAuxInfo(4*QUADS - 1 downto 0); crc : out TAuxInfo(4*QUADS - 1 downto 0) ); end comma_gap_cleaner;
to this
entity comma_gap_cleaner is generic ( N_ILINK : natural := N_ILINK ); port ( clk : in std_logic; rst : in std_logic; d : in ldata(N_ILINK - 1 downto 0); q : out ldata(N_ILINK - 1 downto 0); lid : out TAuxInfo(N_ILINK - 1 downto 0); crc : out TAuxInfo(N_ILINK - 1 downto 0) ); end comma_gap_cleaner;
There are few more things that would need to be changed, but in principle it should be very fast. It would be great to have this generalization as everytime I have to build the gt/bmtf test firmware, I need to manually change these type of lines...
Cheers, Rocco