mor1kx icon indicating copy to clipboard operation
mor1kx copied to clipboard

spr_ack is high when there is no mtspr/mfspr instructions

Open Harshitha172000 opened this issue 4 years ago • 2 comments

In the control module, signal spr_access is driven by the spr_group which is dependent on the address computed in the execution stage i.e., ctrl_alu_result_i. When we don’t have spr instructions but the last five bits of address ctrl_alu_result_i match to any of SPR groups then spr_access will get updated. Due to which spr_access_valid and spr_ack are driven when there are no mtspr/mfspr opcode signals.

Assertion:

always @(posedge clk)
   if ($onehot(spr_access) && !$past(rst) && f_past_valid)
      assert (ctrl_op_mtspr_i | ctrl_op_mfspr_i);

Trace: image

Harshitha172000 avatar Aug 06 '21 11:08 Harshitha172000

can you put a link to the code, or mention the module where this is happening?

stffrdhrn avatar Aug 15 '21 21:08 stffrdhrn

mor1kx_ctrl_cappuccino.v

Code: https://github.com/openrisc/mor1kx/blob/master/rtl/verilog/mor1kx_ctrl_cappuccino.v#L1653#L1656

Harshitha172000 avatar Aug 16 '21 16:08 Harshitha172000