Skip to content

Commit

Permalink
RFVI update in trace_apu_req found by hwloop single-stepping in debug…
Browse files Browse the repository at this point in the history
… mode.

Signed-off-by: Pascal Gouedo <[email protected]>
  • Loading branch information
Pascal Gouedo committed Aug 29, 2023
1 parent 3af393a commit e4d2ba0
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion bhv/cv32e40p_rvfi.sv
Original file line number Diff line number Diff line change
Expand Up @@ -1115,6 +1115,23 @@ insn_trace_t trace_if, trace_id, trace_ex, trace_ex_next, trace_wb;
trace_apu_req.m_csr.tinfo_wdata = r_pipe_freeze_trace.csr.tinfo_n;
trace_apu_req.m_csr.tinfo_wmask = '0;

trace_apu_req.m_csr.minstret_we = r_pipe_freeze_trace.csr.mhpmcounter_write_lower[2];
trace_apu_req.m_csr.minstret_rdata = r_pipe_freeze_trace.csr.mhpmcounter_q[2];
trace_apu_req.m_csr.minstret_rmask = '1;
trace_apu_req.m_csr.minstret_wdata = r_pipe_freeze_trace.csr.mhpmcounter_q;
trace_apu_req.m_csr.minstret_wmask = r_pipe_freeze_trace.csr.mhpmcounter_write_lower[2] ? '1 : '0;

trace_apu_req.m_csr.lpcount0_we = '0;
trace_apu_req.m_csr.lpcount0_rdata = r_pipe_freeze_trace.hwloop.counter_q[0];
trace_apu_req.m_csr.lpcount0_rmask = '1;
trace_apu_req.m_csr.lpcount0_wdata = '0;
trace_apu_req.m_csr.lpcount0_wmask = '0;

trace_apu_req.m_csr.lpcount1_we = '0;
trace_apu_req.m_csr.lpcount1_rdata = r_pipe_freeze_trace.hwloop.counter_q[1];
trace_apu_req.m_csr.lpcount1_rmask = '1;
trace_apu_req.m_csr.lpcount1_wdata = '0;
trace_apu_req.m_csr.lpcount1_wmask = '0;

`CSR_FROM_PIPE(apu_req, frm)

Expand Down Expand Up @@ -1478,7 +1495,7 @@ insn_trace_t trace_if, trace_id, trace_ex, trace_ex_next, trace_wb;
trace_ex.m_csr.frm_wmask = '0;
trace_ex.m_csr.fcsr_wmask = '0;

if (r_pipe_freeze_trace.apu_req) begin
if (r_pipe_freeze_trace.apu_req && r_pipe_freeze_trace.apu_gnt) begin
trace_id.m_is_apu = 1'b1;
trace_id.m_apu_req_id = cnt_apu_req;
trace_apu_req = new();
Expand Down

0 comments on commit e4d2ba0

Please sign in to comment.