CSRs: avoid use of wdata_update in rdata for meicontext, which the SMT2 backend sees as a loop.

There is no functional loop here since this is an acyclic path between different bits of the rdata vector, but it makes sense that this would confuse tools that don't bitblast all the vectors.
This commit is contained in:
Luke Wren 2022-08-22 09:18:57 +01:00
parent ba775563d5
commit b90d12efed
1 changed files with 6 additions and 4 deletions

View File

@ -269,6 +269,8 @@ end
reg [XLEN-1:0] mie;
localparam MIE_WMASK = 32'h00000888; // meie, mtie, msie
wire meicontext_clearts = wen_m_mode && wtype != CSR_WTYPE_C && addr == MEICONTEXT && wdata[1];
always @ (posedge clk or negedge rst_n) begin
if (!rst_n) begin
mie <= X0;
@ -279,8 +281,8 @@ always @ (posedge clk or negedge rst_n) begin
// meicontext.clearts/mtiesave/msiesave can be used to clear and
// save standard timer and soft IRQ enables, simultaneously with
// saving external interrupt context.
mie[7] <= (mie[7] || wdata_update[3]) && !wdata_update[1];
mie[3] <= (mie[3] || wdata_update[2]) && !wdata_update[1];
mie[7] <= (mie[7] || wdata_update[3]) && !meicontext_clearts;
mie[3] <= (mie[3] || wdata_update[2]) && !meicontext_clearts;
end
end
end
@ -1220,8 +1222,8 @@ always @ (*) begin
meicontext_noirq,
2'h0,
meicontext_irq,
mie[7] && wdata_update[1],
mie[3] && wdata_update[1],
mie[7] && meicontext_clearts,
mie[3] && meicontext_clearts,
1'b0,
meicontext_mreteirq
};