Skip to content

Conversation

@Thibault-Trombert
Copy link
Contributor

No description provided.

@Thibault-Trombert Thibault-Trombert changed the title I didn't click, mb Add ECM support, stream handling improvements, and committed_padder component. Nov 10, 2025
Copy link
Owner

@nipo nipo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall assessment: The committed_padder component is well-designed and thoroughly tested (excellent work on the test coverage!). However, there are several critical issues that must be addressed before this can be merged.

Must Fix:

  • Type mismatch in committed_padder (committed_req vs committed_req_t)
  • FIFO generate condition logic needs verification
  • Process sensitivity list issue in packet_counter_proc
  • Test case 6 behavior discrepancy (cancelled frames + padding)

Needs Justification:

  • Severity downgrade in width_adapter (could hide bugs)
  • Impure function marking without clear side effects

Documentation:

  • Document ready_toggle feature purpose
  • Fix typo in comment
  • Consider renaming wwv function for clarity

Please address these issues and I'll be happy to re-review.

reset_n_i : in std_ulogic;
clock_i : in std_ulogic;

in_i : in committed_req;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Type mismatch: should be committed_req_t not committed_req (and similarly for committed_ack_t). The package definition uses committed_req_t as the type name.

out_available_o => out_available_o,
in_free_o => in_free_o
);
generate_fifo_homogenous: if clock_i'length /= 1 generate
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This condition looks problematic. Should this be checking clock_count_c /= 1 instead of clock_i'length /= 1? The generic clock_count_c indicates the intended number of clocks, but clock_i'length may not behave as expected here.

out_available_o <= to_integer(out_available);
in_free_o <= to_integer(in_free);

packet_counter_proc: process(reset_n_i, clock_i) is
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sensitivity list includes reset_n_i but the reset is checked inside the rising_edge block (line 106-108). This should be a synchronous-reset-only process with just process(clock_i) or the reset should be moved to an async section.

assert in_config_c.has_keep = out_config_c.has_keep
report "In/out keep do not match"
severity failure;
severity warning;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why downgrade this from failure to warning? Mismatched keep signals between input and output could lead to data corruption. This seems like it should remain a fatal error. Please provide justification for this change or revert it.


-- Factory function for a frame
function frame(
impure function frame(
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this function now marked impure? There's no obvious state modification or side effects in the implementation. Impure functions can behave differently in synthesis vs simulation. Please document the reason for this change.

variable user : out std_ulogic_vector;
variable dest : out std_ulogic_vector);
variable dest : out std_ulogic_vector;
constant ready_toggle : boolean := false);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the use case for ready_toggle? The PRBS-based ready toggling seems simulation-specific but isn't documented. Please add a comment explaining when and why this feature should be used.

return to_le(resize(n, 32));
end function;

function wwv(n: integer range 0 to 65535 )
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function takes a 16-bit integer but returns 32 bits (via resize to 32). Is this intentional? For ECM, the statistics field is indeed 32-bit, but the function name and parameter suggest 16-bit. Consider renaming to dwv (dword value) or adjusting the parameter range to match the 32-bit output.

generic(
clock_hz_c : natural;

-- Whether l1 has FCS appended ot frames
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: "appended ot frames" should be "appended to frames"

out_s.req, out_s.ack, clock_s,
from_hex("ffffffffffffffff"), true, LOG_LEVEL_FATAL,
1, 2);

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment says "3 data + 5 padding bytes with cancel" but according to the implementation (committed_padder.vhd lines 117-118), cancelled frames skip padding and exit early. So this should actually be "3 data bytes + cancel (no padding)". Please verify the expected behavior and update either the test or the implementation.

@Thibault-Trombert Thibault-Trombert force-pushed the master branch 4 times, most recently from b2bdf05 to cad2ce2 Compare December 8, 2025 09:46
@Thibault-Trombert Thibault-Trombert changed the title Add ECM support, stream handling improvements, and committed_padder component. Add ECM support, improve stream handling, and add the committed_padder component. The RGMII driver now handles the AXI4-Stream interface, with various stream tools added and updated. Dec 8, 2025
@Thibault-Trombert Thibault-Trombert force-pushed the master branch 4 times, most recently from b0c132d to 3693ac2 Compare December 9, 2025 14:53
nipo and others added 19 commits December 29, 2025 14:07
Add a module that pads committed frames to a minimum size by
appending a constant padding byte. Frames already meeting or
exceeding the minimum size are passed through unchanged.

Configuration:
- min_size_c: Minimum frame size (positive generic)
- padding_byte_c: Padding byte value (default x"00")

Implementation uses a 2-deep FIFO to break combinatorial paths
between input and output. The output stage maintains a down-counter
initialized to min_size_c, decremented for each data byte output.
When the input frame ends, padding is added if counter hasn't
reached zero before outputting the commit/cancel status.

Includes comprehensive testbench covering:
- Short frames (require padding)
- Exact size frames (no padding)
- Long frames (no padding)
- Empty frames (full padding)
- Both commit and cancel status handling

tests/bnoc/committed_padder: fix on comments.
…cs is forwarded.

nsl_inet/ethernet: ethernet host generics to specify whether or not fcs is forwarded.

lib/nsl_inet/func: typo.
…cancellable FIFO depending on the number of input clocks. When a single clock is provided, the FIFO tracks the number of available stored packets.
…h AXI4-Stream instead of the BNOC-specific committed type.
… in pin can alse be used to force CRC invalid.
…ackets between two independant clock domains. No back-pressure on the input interface: if the fifo in overrun the entire packet is dropped.

t
…ived. If the packet is smaller, it is just outputted.
…aster_vector in order to use it as local fifo.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants