Skip to content

Commit

Permalink
Merge pull request #859 from pascalgouedo/dev_dd_pgo_rvfi
Browse files Browse the repository at this point in the history
RFVI update in trace_apu_req found by hwloop single-stepping in debug mode.
  • Loading branch information
davideschiavone authored Aug 29, 2023
2 parents a90f10d + d7213fe commit c36466b
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions bhv/cv32e40p_rvfi.sv
Original file line number Diff line number Diff line change
Expand Up @@ -1109,12 +1109,29 @@ insn_trace_t trace_if, trace_id, trace_ex, trace_ex_next, trace_wb;
`CSR_FROM_PIPE(apu_req, misa)
`CSR_FROM_PIPE(apu_req, tdata1)
`CSR_FROM_PIPE(apu_req, tdata2)
trace_apu_req.m_csr.tinfo_we = '0; // READ ONLY csr_tinfo_we_i;
trace_apu_req.m_csr.tinfo_we = '0; // READ ONLY csr_tinfo_we_i;
trace_apu_req.m_csr.tinfo_rdata = r_pipe_freeze_trace.csr.tinfo_q;
trace_apu_req.m_csr.tinfo_rmask = '1;
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 c36466b

Please sign in to comment.