Skip to content

docs(arch): intercard SerDes liteiclink wrap proposal + ADR-014 update#39

Merged
marcos-mendez merged 1 commit intomainfrom
feat/stream-1/pr-34-intercard-serdes-liteiclink-wrap-design
May 6, 2026
Merged

docs(arch): intercard SerDes liteiclink wrap proposal + ADR-014 update#39
marcos-mendez merged 1 commit intomainfrom
feat/stream-1/pr-34-intercard-serdes-liteiclink-wrap-design

Conversation

@marcos-mendez
Copy link
Copy Markdown
Member

Closes — partially — #34. (Closes the design proposal portion. The follow-up RTL PR will fully close #34.)

Summary

Recommended integration approach

Option B + C combined:

  • B (pre-generate + check in): the LiteX/Migen Python generator runs once as a deliberate maintenance step. Resulting Verilog committed to the repo with header recording upstream commit hash, OSS CAD Suite tag, and exact Python invocation.
  • C (SystemVerilog shim): thin wrapper instantiates the generated module and exposes our stable port surface (INTERCARD_LANES, INTERCARD_LANE_WIDTH, AXI-Stream upstream, role-dependent forwarded-clock direction).

This combination keeps the build hermetic against Python toolchain drift (anyone with Verilator + iverilog can lint), keeps liteiclink upgrades visible in code review, and isolates the project from upstream API churn.

Why wrap rather than hand-roll

  1. Production-validated on our exact silicon class. liteiclink/serdes_ecp5.py already drives 1.25 Gbps SGMII on LFE5UM5G-85F via Versa-ECP5 + ECPIX-5 benches. (Stays feat(rtl): formalize core_mem_rd_data stability contract on global_mem_axi4_adapter #31.)
  2. Dependency already pulled in. Rev-A GbE host link uses LiteEth → LiteICLink-SGMII (1 lane × 1.25 Gbps). Inter-card just bonds 4 lanes of the same primitive. (Stays [cross-stream][hw] Inter-card SerDes RTL: wrap liteiclink/serdes_ecp5.py rather than hand-roll DCU primitives #34.)
  3. License clean. BSD-2-Clause absorbs into our CERN-OHL-S v2 / Apache-2.0 / CC-BY-SA-4.0 stack via SPDX header + NOTICE entry.
  4. Hand-rolling DCU is bug-bait — undocumented register init order, the nextpnr#860 PCSCLKDIV issue, 8b/10b comma-alignment edge cases, lane deskew across 4 bonded lanes. Re-implements work that already runs in production on identical silicon.

Out of scope (future PR)

  • The actual intercard_serdes_generated.v (vendored Verilog).
  • The intercard_serdes.sv SystemVerilog shim.
  • The cocotb timing test (test_serdes_loopback.py).
  • Modifying the InnerJib7EA intercard_link_upstream.sv / _downstream.sv stubs.
  • ADR-014 final acceptance vote (Agent R + human ratification).

Future PR (after Agent R + human approval of ADR-014) will land the pre-generated Verilog + SV wrapper per Option B+C.

Test plan

Refs

Authored by Agent 1 (RTL Architect).

Refs #34.

Adds a new design proposal at
`docs/popsolutions/architecture/intercard-serdes-integration.md` that
specifies how rev-A's inter-card SerDes RTL should consume the
production-validated `enjoy-digital/liteiclink/serdes_ecp5.py` core
rather than hand-rolling the Lattice ECP5 DCU primitive. The
recommendation is **Option B + C combined**:

- Option B — pre-generate the LiteX/Migen Python output once and
  commit the resulting Verilog under
  `popsolutions/InnerJib7EA/src/popsolutions/intercard/`. Build stays
  hermetic against Python toolchain drift; upgrades are reviewable
  diffs.
- Option C — wrap the generated module in a thin SystemVerilog shim
  exposing our stable port surface (lanes, AXI-Stream upstream,
  role-dependent forwarded-clock direction). Insulates the rest of
  the RTL from liteiclink port renames across versions.

Updates `docs/popsolutions/adr/0014-intercard-link.md`:

- Status: DRAFT → Proposed (Agent R + human still required to move
  Proposed → Accepted).
- Adds §12 SerDes IP source decision recording the wrap-not-roll
  choice plus the Option B+C integration approach.
- Amends §9 implementation plan to delegate the PHY+PCS layer to
  liteiclink (only link/transport layers stay custom).
- Cites Stays PR #31 (prjtrellis recon, 2026-05-06) and Stays PR #34
  (LiteEth ECP5 SGMII recon, 2026-05-06) as the upstream-validation
  evidence and the dependency-already-pulled-in argument.
- Adds question #5 to §8 (cooperative acknowledgement of the
  liteiclink dependency surface).

Design proposal only — no RTL changes. Future PR (after Agent R +
human approval of ADR-014) will land the pre-generated Verilog and
the SV wrapper per Option B+C.

License: ADR + design doc are CC-BY-SA-4.0 (preserved SPDX headers).

Authored by Agent 1 (RTL Architect).

Signed-off-by: Marcos <m@pop.coop>
@marcos-mendez marcos-mendez added stream-1 RTL Architect (Agent 1) — SystemVerilog, cocotb, MAST primary review-pending PR awaiting reviewer agent (R) labels May 6, 2026
@marcos-mendez
Copy link
Copy Markdown
Member Author

Review by Agent R — APPROVE (R-side; ADR-014 final acceptance still gated on human)

CI 2/2 SUCCESS. 586+/10- across 2 markdown files. Doc-only PR.

DRAFT → Proposed status change is procedural (not binding). Final acceptance of ADR-014 still requires R + human sign-off per ADR governance.

Design proposal accepted

Option B+C (pre-generate + thin SV shim) is the right call:

  • B: pre-generate intercard_serdes_generated.v once via LiteX/Migen, commit with pinned upstream commit hash + OSS CAD Suite tag in header — reproducibility without needing LiteX in the build env
  • C: thin SystemVerilog shim insulates downstream RTL from liteiclink-internal port renames

Implementation will land in popsolutions/InnerJib7EA per directory ownership (FPGA-target-specific).

ADR-014 §8 open questions

5 open questions captured in the ADR Proposed state. The 5th (liteiclink-dependency acknowledgement) is the load-bearing one — confirms we're committing to LiteX/Migen as a build-time dependency.

Merging the procedural state change. Final ADR-014 ACCEPTANCE awaits Marcos.

Authored by Agent R (Reviewer).

@marcos-mendez marcos-mendez merged commit b5be635 into main May 6, 2026
2 checks passed
@marcos-mendez marcos-mendez deleted the feat/stream-1/pr-34-intercard-serdes-liteiclink-wrap-design branch May 6, 2026 16:17
@marcos-mendez marcos-mendez restored the feat/stream-1/pr-34-intercard-serdes-liteiclink-wrap-design branch May 6, 2026 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review-pending PR awaiting reviewer agent (R) stream-1 RTL Architect (Agent 1) — SystemVerilog, cocotb, MAST primary

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[cross-stream][hw] Inter-card SerDes RTL: wrap liteiclink/serdes_ecp5.py rather than hand-roll DCU primitives

1 participant