Skip to content

Instruction Tracing#3071

Merged
JeanRochCoulon merged 25 commits into
openhwgroup:masterfrom
ThalesSiliconSecurity:instruction-tracing
Nov 28, 2025
Merged

Instruction Tracing#3071
JeanRochCoulon merged 25 commits into
openhwgroup:masterfrom
ThalesSiliconSecurity:instruction-tracing

Conversation

@MaxCThales

Copy link
Copy Markdown
Contributor

Integration of instr_tracing in corev_apu

More testing in real conditions pinpointed some bugs:

* `iretire` value was sometimes off by 1 because `counter_o` was not
  cleared correctly in instr_to_trace
* A dimension was redundant in the `itype` field of iti_to_encoder
* `valid_o` in cva6_iti was not being cleared when the output was not
  valid
* Reset value fix for enum itype and priv
* Added modularity to the ITI module to ensure compatibility with an
  instruction-by-instruction encoder configuration (`block_mode = 0`)
* Moved the code to corev_apu/instr_tracing/ITI for better project
  structure
* Modified the `iti_test.sh` to accept an executable as an argument
* ITI is integrated into `ariane_xilinx.sv` and `ariane_testharness.sv`
* Add `dpti_ctrl.vhd` from Digilent in the `ariane_xilinx.sv` platform
* Add in the fpga flow the tcl files to build `xlnx_dpti_clk` needed for
  the dpti_ctrl
* Add `slicer_DPTI.sv` to convert encapsulated packet (320 bits) into
  slices (8 bits)
* Add constraints in `ariane.xdc` and `genesy-2.xdc` to correctly
  synthesize with Vivado 2018.2
* Modify the Makefile to add dpti in the fpga build
* Adding script for debug and format conversion in /Decapsuler
* Adding in /SW the Receiver_DPTI that catch slices, reconstruct
  encapsulated packet and decapsulate them
* Adding json files in /SW/FPGA_auto to custom Vscode in order to automate remote
  debugging  (with openocd, gdb)
* Add Documentation about Instruction Tracing, the work done, the choice
  made, the work that remains to be done
* Upgrading the previous CI Test using the referenceFlow from the
  E-Trace Specification for greater robustness and modularity
Comment thread core/cva6_rvfi.sv
assign rvfi_csr_o.``CSR_NAME``.wdata = CSR_ENABLE_COND ? { {{CVA6Cfg.XLEN-$bits(CSR_SOURCE_NAME)}, CSR_SOURCE_NAME} } : 0; \
assign rvfi_csr_o.``CSR_NAME``.rmask = CSR_ENABLE_COND ? 1 : 0; \
assign rvfi_csr_o.``CSR_NAME``.wmask = (rvfi_csr_o.``CSR_NAME``.rdata != {{CVA6Cfg.XLEN - $bits(CSR_SOURCE_NAME)}, CSR_SOURCE_NAME}) && CSR_ENABLE_COND;
`define CONNECT_RVFI_FULL(CSR_ENABLE_COND, CSR_NAME, CSR_SOURCE_NAME) \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[verible-verilog-format] reported by reviewdog 🐶

Suggested change
`define CONNECT_RVFI_FULL(CSR_ENABLE_COND, CSR_NAME, CSR_SOURCE_NAME) \
`define CONNECT_RVFI_FULL(CSR_ENABLE_COND, CSR_NAME,
CSR_SOURCE_NAME) \

Comment thread core/cva6_rvfi.sv

`CONNECT_RVFI_FULL(CVA6Cfg.RVS, sstatus,
csr.mstatus_extended & SMODE_STATUS_READ_MASK[CVA6Cfg.XLEN-1:0])
`CONNECT_RVFI_FULL(CVA6Cfg.RVS, sstatus, csr.mstatus_extended & SMODE_STATUS_READ_MASK[CVA6Cfg.XLEN-1:0])

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[verible-verilog-format] reported by reviewdog 🐶

Suggested change
`CONNECT_RVFI_FULL(CVA6Cfg.RVS, sstatus, csr.mstatus_extended & SMODE_STATUS_READ_MASK[CVA6Cfg.XLEN-1:0])
`CONNECT_RVFI_FULL(CVA6Cfg.RVS, sstatus,
csr.mstatus_extended & SMODE_STATUS_READ_MASK[CVA6Cfg.XLEN-1:0])

Comment thread core/cva6_rvfi.sv
for (i = 0; i < 16; i++) begin
`CONNECT_RVFI_FULL(1'b1, pmpaddr[i], {
csr.pmpaddr_q[i][CVA6Cfg.PLEN-3:1], pmpcfg_q[i].addr_mode[1]})
`CONNECT_RVFI_FULL(1'b1, pmpaddr[i], {csr.pmpaddr_q[i][CVA6Cfg.PLEN-3:1], pmpcfg_q[i].addr_mode[1]})

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[verible-verilog-format] reported by reviewdog 🐶

Suggested change
`CONNECT_RVFI_FULL(1'b1, pmpaddr[i], {csr.pmpaddr_q[i][CVA6Cfg.PLEN-3:1], pmpcfg_q[i].addr_mode[1]})
`CONNECT_RVFI_FULL(1'b1, pmpaddr[i], {
csr.pmpaddr_q[i][CVA6Cfg.PLEN-3:1], pmpcfg_q[i].addr_mode[1]})

@github-actions

github-actions Bot commented Aug 6, 2025

Copy link
Copy Markdown
Contributor

❌ failed run, report available here.

@MaxCThales MaxCThales force-pushed the instruction-tracing branch from 5257789 to 7fd2aa3 Compare August 6, 2025 13:45
@github-actions

github-actions Bot commented Aug 6, 2025

Copy link
Copy Markdown
Contributor

❌ failed run, report available here.

2 similar comments
@github-actions

github-actions Bot commented Aug 6, 2025

Copy link
Copy Markdown
Contributor

❌ failed run, report available here.

@github-actions

github-actions Bot commented Aug 7, 2025

Copy link
Copy Markdown
Contributor

❌ failed run, report available here.

MaxCThales and others added 2 commits August 8, 2025 10:45
Co-authored-by: ALLART Come <come.allart@thalesgroup.com>
@github-actions

github-actions Bot commented Aug 8, 2025

Copy link
Copy Markdown
Contributor

❌ failed run, report available here.

3 similar comments
@github-actions

Copy link
Copy Markdown
Contributor

❌ failed run, report available here.

@github-actions

Copy link
Copy Markdown
Contributor

❌ failed run, report available here.

@github-actions

Copy link
Copy Markdown
Contributor

❌ failed run, report available here.

@JeanRochCoulon

Copy link
Copy Markdown
Contributor

@MaxCThales The PR breaks the GitHub CI. It cannot be integrated. Any ideas ?

@github-actions

Copy link
Copy Markdown
Contributor

❌ failed run, report available here.

@github-actions

Copy link
Copy Markdown
Contributor

👋 Hi there!

This pull request seems inactive. Need more help or have updates? Feel free to let us know. If there are no updates within the next few days, we'll go ahead and close this PR. 😊

@github-actions github-actions Bot added the Status:Stale Issue or PR is stale and hasn't received any updates. label Nov 27, 2025
@JeanRochCoulon JeanRochCoulon removed the Status:Stale Issue or PR is stale and hasn't received any updates. label Nov 27, 2025
@github-actions

Copy link
Copy Markdown
Contributor

❌ failed run, report available here.

@JeanRochCoulon JeanRochCoulon merged commit a667f48 into openhwgroup:master Nov 28, 2025
12 checks passed
@JeanRochCoulon

Copy link
Copy Markdown
Contributor

Great work @MaxCThales ! Thanks a lot

AngelaGonzalezMarino pushed a commit to planvtech/cva6 that referenced this pull request Mar 17, 2026
Integration of instr_tracing in corev_apu

---------

Co-authored-by: ALLART Come <come.allart@thalesgroup.com>
Co-authored-by: Guillaume Chauvon <guillaume.chauvon@thalesgroup.com>
Co-authored-by: Coulon Jean Roch <jean-roch.coulon@thalesgroup.com>
AngelaGonzalezMarino pushed a commit to planvtech/cva6 that referenced this pull request Apr 6, 2026
Integration of instr_tracing in corev_apu

---------

Co-authored-by: ALLART Come <come.allart@thalesgroup.com>
Co-authored-by: Guillaume Chauvon <guillaume.chauvon@thalesgroup.com>
Co-authored-by: Coulon Jean Roch <jean-roch.coulon@thalesgroup.com>
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.

3 participants