Skip to content

serial_link: Integrate new version#253

Draft
fischeti wants to merge 18 commits intomainfrom
fischeti/rdl-slink
Draft

serial_link: Integrate new version#253
fischeti wants to merge 18 commits intomainfrom
fischeti/rdl-slink

Conversation

@fischeti
Copy link
Contributor

@fischeti fischeti commented Dec 1, 2025

The serial link received the SystemRDL treatment among other improvents for integration & parametrization

TODO:

  • Fix missing _reserved_Xx_Yy field names if non-default configurations are used.
  • Create and reference a new major release of serial_link once this PR is approved.
  • Maybe wait for clint: systemRDL based register generation #252 to be merged/discussed.
  • Update peakrdl-regblock package in Gitlab CI python environment.
  • Gitlab CI: fix ERROR: Cannot start server on port 3042: already in use. errors during FPGA boot jobs.
  • Based on treewide: Initial migration to SystemRDL #260, merge first

@fischeti fischeti marked this pull request as ready for review December 5, 2025 08:54
@fischeti fischeti requested review from creinwar and paulsc96 December 5, 2025 08:54
@fischeti fischeti force-pushed the fischeti/rdl-slink branch from 9d54f6e to 2d7ee47 Compare March 4, 2026 13:46
@fischeti fischeti marked this pull request as draft March 4, 2026 13:47
@fischeti fischeti force-pushed the fischeti/rdl-slink branch 3 times, most recently from 6f74ae4 to 972daef Compare March 4, 2026 20:04
fischeti added 18 commits March 5, 2026 15:02
Replace the lowRISC regtool-based hjson register description with a
SystemRDL source and peakrdl-regblock generated RTL. The generated
register block uses an APB4-flat CPU interface; a reg_to_apb bridge is
added in cheshire_soc to convert from the internal reg_iface demux.

- Add hw/regs/rdl/cheshire_regs.rdl (register source)
- Generate hw/regs/rtl/cheshire_regs{,_pkg}.sv via peakrdl regblock
- Update cheshire.mk: PEAKRDL_INCLUDES, replace regtool make rule
- Update sw/sw.mk: switch cheshire.h to chs_sw_gen_hdr_rule_rdl
- Update Bender.yml: point to new rtl/ file locations
- Update hw/cheshire_soc.sv: add reg_to_apb bridge, new pkg types
- Delete hw/regs/cheshire_regs.hjson and hjson-generated SV files
…er access

Create hw/regs/cheshire.rdl as a top-level SystemRDL address map that places
cheshire_regs at its canonical base address (0x0300_0000, from cheshire_pkg.sv).

Update the build system to generate sw/include/regs/cheshire.h from this map
via `peakrdl c-header`, and fix the PEAKRDL_INCLUDES path. Update all SW files
(util.h, zsl.c, flash.c, gpt.c) to access registers through the generated
cheshire_regs_t struct instead of the old _REG_OFFSET macros.
… names

Replace all remaining uses of *_REG_OFFSET macros and CHESHIRE_HW_FEATURES_*_BIT
constants in SW tests with the struct-based cheshire_regs_t access pattern and
the corresponding CHESHIRE_REGS__HW_FEATURES__*_bp bit-position macros generated
by peakrdl c-header.
…er access

Add apb_mask bitmap to reg_out_t in cheshire_pkg.sv, where bit i indicates that
reg-bus port i requires an APB4-flat bridge. Populate it in gen_reg_out (currently
only cheshire_regs/RegOut.regs). In cheshire_soc.sv, replace the hand-wired
reg_to_apb instance and named APB signals with a generate loop that instantiates
reg_to_apb for every port flagged in apb_mask. Future APB IPs need only set their
bit in gen_reg_out — no structural changes to cheshire_soc.sv required.

Also fixes the previous use of undefined chs_regs_apb_req_t/resp_t types by
switching to apb_req_t/apb_resp_t already defined by CHESHIRE_TYPEDEF_ALL.
Add CHS_REGS macro to util.h for typed access to the Cheshire SoC register
file, replacing the previous chs_hw_feature_present() helper which required
ugly CHESHIRE_REGS__HW_FEATURES__*_bp bit-position macros. Hardware feature
checks now access named struct fields directly (e.g. CHS_REGS->hw_features.f.dma).

The base address is now derived from the RDL-generated cheshire_t struct via
offsetof(cheshire_t, cheshire_regs), removing the dependency on the linker
symbol __base_regs in C code. Remove the corresponding extern declaration
from params.h (the linker symbol is retained in common.ldh for smp.h assembly).

Update all call sites to use CHS_REGS consistently.
@fischeti fischeti force-pushed the fischeti/rdl-slink branch from 972daef to 4c27fb9 Compare March 6, 2026 07:15
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.

1 participant