Skip to content

DENIM (Dynamic endpoint network impairment model) semester project - #235

Open
RaresToader wants to merge 6 commits into
fpgasystems:masterfrom
RaresToader:denim_semester_project
Open

RaresToader wants to merge 6 commits into
fpgasystems:masterfrom
RaresToader:denim_semester_project

Conversation

@RaresToader

@RaresToader RaresToader commented Aug 28, 2026 •

Copy link
Copy Markdown

Description

DENIM is an in-path impairment module for RoCE v2 traffic, sitting in the service layer
(nclk domain) so that experiments can inject deterministic network events at the endpoint.

A stateless filter matches the first 64B beat of each frame against 8 rule slots and emits a
verdict tag {valid, rule_id, effect_mask}. Chained effect blocks (ECN / drop / delay) act on
the tag only. Rules are written as
<cond>[, <cond>...] : <effect>[, <effect>], e.g. qpn 3, psn 50-150 : ecn, delay 1us.
Two constructs make impairments repeatable across runs: psn +K addresses packets by
position in the flow rather than by absolute PSN (the base is captured in hardware from the
connection's first packet), and once / shots N bound how many packets a rule may act on,
so a rule can inject e.g. transient loss.

Everything is behind EN_DENIM and off by default. Includes a control vFPGA CSR slave,
denim_ctl for driving it from software, and examples/13_denim with documentation.

Type of change

  • New feature

Tests & Results

Simulation. 15 xsim testbenches, covering field extraction, match priority, effect chaining, relative-PSN capture,
shot limits, delay FIFO overflow, and the CSR path. The rule parser has its own host-side unit tests.

Timing. Full shell build for u55c: WNS +0.046 ns, WHS +0.019 ns, 0 failing
endpoints
of ~1.5M.

Hardware E2E tests. Two Alveo U55C nodes, 09_perf_rdma as the traffic source, DENIM on the receiving
node.

Not yet covered: TODO PCAP level verification

IMPORTANT

  • Most of my DENIM builds were done with Vivado 2024.1, and tried a few with 2024.2 and that
    also worked well. Can only vouch for builds generated with these two Vivado versions.

Checklist

  • I have commented my code and made corresponding changes to the documentation.
  • I have added tests/results that prove my fix is effective or that my feature works.
  • My changes generate no new warnings or errors & all tests successfully pass.

Adds a configurable impairment module in series on the network stack's
receive stream, so experiments (for instance congestion-control ones)
can trigger deterministic events.
Wires the module into the network stack ahead of the RoCE stack and adds EN_DENIM through the build (like other optional services).
A vFPGA exposing the rule table and counters over CSRs, plus a full RDMA endpoint, so one can test DENIM's functionality when the node acts as a server (receiver in the RDMA exchange).

denim_ctl parses the rule grammar and installs the rules. It checks the register map version at startup.
…ow much a rule can

fire, intention is to be able to "impact" just a selected portion of traffic.

Register map goes to 1.3.
@RaresToader RaresToader changed the title Denim semester project DENIM (Dynamic endpoint network impairment model) semester project Aug 28, 2026
@RaresToader
RaresToader marked this pull request as ready for review September 8, 2026 10:27
Maximilian and others added 2 commits September 18, 2026 18:55
Splitting the sniffer block to make room for the DENIM interface
declarations reopened the second half with a bare `en_sniffer` guard,
dropping the `sniffer_vfpga_id == c_reg` half of the condition.

The port list and the interface declarations still carry the full
guard, so for any vFPGA that is not the sniffer's, the wrapper was
emitted with the 13 sniffer/filter_config assigns but neither the
ports nor the interfaces they refer to. Every identifier on both
sides of those assignments is then undeclared and elaboration fails.

Only reachable with EN_SNIFFER=1 and N_REGIONS > 1: example 11 ships
with a single region, where the dropped condition is trivially true,
and the DENIM example sets EN_SNIFFER=0, so no shipped configuration
hits it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The README documented the rule language and denim_ctl thoroughly but
never covered the Coyote-side mechanisms the example demonstrates, which
is what the other example READMEs are for.

Adds two short subsections with verbatim snippets from the source:

  - how a service is spliced into the shell's RX stream in
    network_stack.sv, and why the insertion sits upstream of the
    sniffer tap
  - how the rule table crosses aclk -> nclk via meta_ccross, why the
    config interface is 72 bits, and why reads are served from a
    shadow register array in denim_slv rather than crossing back

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@bo3z bo3z added this to the 0.4.0 milestone Sep 24, 2026
@bo3z bo3z added the enhancement New feature or request label Sep 24, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants