forked from Github_Repos/cvw
Fixed issue with rvvi tracer so it reports call csr changes, not just instrutions which write the CSRs.
This commit is contained in:
parent
4aa2b5737f
commit
fabe13bdce
@ -39,6 +39,7 @@ module rvviTrace #(
|
|||||||
logic [4:0] frf_a4;
|
logic [4:0] frf_a4;
|
||||||
logic frf_we4;
|
logic frf_we4;
|
||||||
logic [`XLEN-1:0] CSRArray [logic[11:0]];
|
logic [`XLEN-1:0] CSRArray [logic[11:0]];
|
||||||
|
logic [`XLEN-1:0] CSRArrayOld [logic[11:0]];
|
||||||
logic CSRWriteM, CSRWriteW;
|
logic CSRWriteM, CSRWriteW;
|
||||||
logic [11:0] CSRAdrM, CSRAdrW;
|
logic [11:0] CSRAdrM, CSRAdrW;
|
||||||
|
|
||||||
@ -202,10 +203,24 @@ module rvviTrace #(
|
|||||||
assign f_wb[0][0][index] = frf_wb[index];
|
assign f_wb[0][0][index] = frf_wb[index];
|
||||||
end
|
end
|
||||||
|
|
||||||
|
// record previous csr value.
|
||||||
|
integer index4;
|
||||||
|
always_ff @(posedge clk) begin
|
||||||
|
for (index4 = 0; index4 < `NUM_CSRS; index4 += 1) begin
|
||||||
|
if(CSRArray.exists(index4)) begin
|
||||||
|
CSRArrayOld[index4] = CSRArray[index4];
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
// check for csr value change.
|
||||||
|
integer index5;
|
||||||
always_comb begin
|
always_comb begin
|
||||||
csr_wb[0][0] <= '0;
|
for(index5 = 0; index5 < `NUM_CSRS; index5 += 1) begin
|
||||||
if(CSRWriteW)
|
if(CSRArray.exists(index5)) begin
|
||||||
csr_wb[0][0][CSRAdrW] <= 1'b1;
|
csr_wb[0][0][index5] = CSRArrayOld[index5] != CSRArray[index5] ? 1'b1 : 1'b0;
|
||||||
|
end else csr_wb[0][0][index5] = '0;
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
integer index3;
|
integer index3;
|
||||||
|
Loading…
Reference in New Issue
Block a user