Skip to content

Commit

Permalink
add full flag detection; do not interfere with data-flow
Browse files Browse the repository at this point in the history
  • Loading branch information
cbakalis-slac committed Oct 31, 2023
1 parent dfbd2f6 commit e4fc31c
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 8 deletions.
10 changes: 7 additions & 3 deletions protocols/ssp/rtl/SspDecoder12b14b.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ entity SspDecoder12b14b is
sof : out sl;
eof : out sl;
eofe : out sl;
fifoFull : out sl;
-- Decoder Monitoring
idleCode : out sl;
validDec : out sl;
Expand Down Expand Up @@ -97,8 +98,10 @@ begin
SSP_IDLE_K_G => "1",
SSP_SOF_CODE_G => K_120_0_C,
SSP_SOF_K_G => "1",
SSP_EOF_CODE_G => K_120_2_C,
SSP_EOF_K_G => "1")
SSP_EOF_CODE_G => K_120_1_C,
SSP_EOF_K_G => "1",
SSP_FULL_CODE_G => K_120_2_C,
SSP_FULL_K_G => "1")
port map (
-- Clock and Reset
clk => clk,
Expand All @@ -117,6 +120,7 @@ begin
idle => idleInt,
sof => sof,
eof => eof,
eofe => eofe);
eofe => eofe,
fifoFull => fifoFull);

end architecture rtl;
22 changes: 19 additions & 3 deletions protocols/ssp/rtl/SspDeframer.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ entity SspDeframer is
SSP_SOF_CODE_G : slv;
SSP_SOF_K_G : slv;
SSP_EOF_CODE_G : slv;
SSP_EOF_K_G : slv);
SSP_EOF_K_G : slv;
SSP_FULL_CODE_G : slv;
SSP_FULL_K_G : slv);
port (
-- Clock and Reset
clk : in sl;
Expand All @@ -55,7 +57,8 @@ entity SspDeframer is
idle : out sl;
sof : out sl;
eof : out sl;
eofe : out sl);
eofe : out sl;
fifoFull : out sl);
end entity SspDeframer;

architecture rtl of SspDeframer is
Expand All @@ -81,6 +84,7 @@ architecture rtl of SspDeframer is
sof : sl;
eof : sl;
eofe : sl;
full : sl;

end record RegType;

Expand All @@ -97,7 +101,8 @@ architecture rtl of SspDeframer is
idle => '0',
sof => '0',
eof => '0',
eofe => '0');
eofe => '0',
full => '0');

signal r : RegType := REG_INIT_C;
signal rin : RegType;
Expand All @@ -111,8 +116,19 @@ begin

v.errorOut := '0';

-- reset the full strobe
v.full := '0';

if (validIn = '1') then

-- simple raise of Full flag for now
if (dataKIn = SSP_FULL_K_G) and (dataIn = SSP_FULL_CODE_G) then
v.full := '1';
else
v.full := '0';
end if;


if (dataKIn = SSP_IDLE_K_G) and (dataIn = SSP_IDLE_CODE_G) then
v.idle := '1';
else
Expand Down
4 changes: 3 additions & 1 deletion protocols/ssp/rtl/SspLowSpeedDecoder12b14bWrapper.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ entity SspLowSpeedDecoder12b14bWrapper is
rxSof : out slv(NUM_LANE_G-1 downto 0);
rxEof : out slv(NUM_LANE_G-1 downto 0);
rxEofe : out slv(NUM_LANE_G-1 downto 0);
rxFifoFull : out slv(NUM_LANE_G-1 downto 0);
-- AXI-Lite Interface (axilClk domain)
axilClk : in sl;
axilRst : in sl;
Expand Down Expand Up @@ -113,7 +114,8 @@ begin
rxData => rxData(i),
rxSof => rxSof(i),
rxEof => rxEof(i),
rxEofe => rxEofe(i));
rxEofe => rxEofe(i),
rxFifoFull => rxFifoFull(i));

end generate GEN_VEC;

Expand Down
6 changes: 5 additions & 1 deletion protocols/ssp/rtl/SspLowSpeedDecoderLane.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ entity SspLowSpeedDecoderLane is
rxData : out slv(DATA_WIDTH_G-1 downto 0);
rxSof : out sl;
rxEof : out sl;
rxEofe : out sl);
rxEofe : out sl;
rxFifoFull : out slv(NUM_LANE_G-1 downto 0));
end SspLowSpeedDecoderLane;

architecture mapping of SspLowSpeedDecoderLane is
Expand Down Expand Up @@ -176,6 +177,7 @@ begin
end process;

GEN_10B12B : if (DATA_WIDTH_G = 10) generate
rxFifoFull <= '0';
U_Decoder : entity surf.SspDecoder10b12b
generic map (
TPD_G => TPD_G,
Expand Down Expand Up @@ -224,6 +226,7 @@ begin
sof => rxSof,
eof => rxEof,
eofe => rxEofe,
fifoFull => rxFifoFull,
-- Decoder Monitoring
idleCode => idle,
validDec => decodeValid,
Expand All @@ -232,6 +235,7 @@ begin
end generate;

GEN_16B20B : if (DATA_WIDTH_G = 16) generate
rxFifoFull <= '0';
U_Decoder : entity surf.SspDecoder8b10b
generic map (
TPD_G => TPD_G,
Expand Down

0 comments on commit e4fc31c

Please sign in to comment.