Skip to content

Commit

Permalink
interrupt_assert: make sim compiler happy
Browse files Browse the repository at this point in the history
Signed-off-by: Robin Pedersen <Robin.Pedersen@silabs.com>
  • Loading branch information
silabs-robin committed Dec 9, 2022
1 parent 14f307f commit 303c44c
Showing 1 changed file with 36 additions and 32 deletions.
68 changes: 36 additions & 32 deletions cv32e40s/tb/uvmt/uvmt_cv32e40s_interrupt_assert.sv
Expand Up @@ -433,55 +433,32 @@ module uvmt_cv32e40s_interrupt_assert
is_wfi_wfe_in_wb_d2 <= is_wfi_wfe_in_wb_d1;
end

logic is_wfi_wfe_blocked;
assign is_wfi_wfe_blocked = (
|obi_iside_outstanding ||
|obi_iside_outstanding_d1 || // Arbitrary uarch decision
|obi_dside_outstanding ||
|obi_dside_outstanding_d1 || // Arbitrary uarch decision
(writebufstate != WBUF_EMPTY)
);

logic is_wfi_wfe_wake;
assign is_wfi_wfe_wake = (
(|pending_enabled_irq) ||
debug_req_i ||
pending_nmi ||
(wu_wfe_i && is_wfe)
);

logic obi_iside_initiating;
logic obi_dside_initiating;
logic obi_iside_receiving;
logic obi_dside_receiving;
logic [31:0] obi_iside_outstanding;
logic [31:0] obi_dside_outstanding;
logic mpu_iside_req_d1;
logic mpu_iside_gnt_d1;
logic obi_dside_req_d1;
logic obi_dside_gnt_d1;
logic [31:0] obi_iside_outstanding_d1;
logic [31:0] obi_dside_outstanding_d1;
always @(posedge clk) begin
mpu_iside_req_d1 <= mpu_iside_req;
mpu_iside_gnt_d1 <= mpu_iside_gnt;
obi_dside_req_d1 <= obi_dside_req;
obi_dside_gnt_d1 <= obi_dside_gnt;
obi_iside_outstanding_d1 <= obi_iside_outstanding;
obi_dside_outstanding_d1 <= obi_dside_outstanding;
end

logic obi_iside_initiating;
assign obi_iside_initiating = (
mpu_iside_req &&
//( !mpu_iside_req_d1 || mpu_iside_gnt_d1)
mpu_iside_gnt
);
logic obi_dside_initiating;
assign obi_dside_initiating = (
obi_dside_req &&
( !obi_dside_req_d1 || obi_dside_gnt_d1)
//obi_dside_gnt
);
logic obi_iside_receiving = mpu_iside_rvalid;
logic obi_dside_receiving = obi_dside_rvalid;
assign obi_iside_receiving = mpu_iside_rvalid;
assign obi_dside_receiving = obi_dside_rvalid;

logic [31:0] obi_iside_outstanding;
logic [31:0] obi_dside_outstanding;
always @(posedge clk_i or negedge rst_ni) begin
if (!rst_ni) begin
obi_iside_outstanding <= 1'b 0;
Expand All @@ -505,6 +482,32 @@ module uvmt_cv32e40s_interrupt_assert
end
end

always @(posedge clk) begin
mpu_iside_req_d1 <= mpu_iside_req;
mpu_iside_gnt_d1 <= mpu_iside_gnt;
obi_dside_req_d1 <= obi_dside_req;
obi_dside_gnt_d1 <= obi_dside_gnt;
obi_iside_outstanding_d1 <= obi_iside_outstanding;
obi_dside_outstanding_d1 <= obi_dside_outstanding;
end

logic is_wfi_wfe_blocked;
assign is_wfi_wfe_blocked = (
|obi_iside_outstanding ||
|obi_iside_outstanding_d1 || // Arbitrary uarch decision
|obi_dside_outstanding ||
|obi_dside_outstanding_d1 || // Arbitrary uarch decision
(writebufstate != WBUF_EMPTY)
);

logic is_wfi_wfe_wake;
assign is_wfi_wfe_wake = (
(|pending_enabled_irq) ||
debug_req_i ||
pending_nmi ||
(wu_wfe_i && is_wfe)
);

logic model_sleepmode;
always_latch begin
if (!rst_ni) begin
Expand Down Expand Up @@ -585,7 +588,8 @@ module uvmt_cv32e40s_interrupt_assert
) else `uvm_error(info_tag, "both models must match");

a_wfi_assert_sleepmode_fellreason: assert property (
$fell(is_wfi_wfe_in_wb)
$past(is_wfi_wfe_in_wb) &&
!is_wfi_wfe_in_wb
|->
$past(wb_valid) ||
wb_kill // TODO:silabs-robin Don't use "wb_kill" anywhere
Expand Down

0 comments on commit 303c44c

Please sign in to comment.