[top] update transactional modules to use mubi for idle
- this touches aes / hmac / kmac / otbn
Signed-off-by: Timothy Chen <timothytim@google.com>
diff --git a/hw/ip/aes/data/aes.hjson b/hw/ip/aes/data/aes.hjson
index dda7cdc..6552f70 100644
--- a/hw/ip/aes/data/aes.hjson
+++ b/hw/ip/aes/data/aes.hjson
@@ -150,8 +150,8 @@
{ name: "idle",
type: "uni",
act: "req",
- package: "",
- struct: "logic",
+ package: "prim_mubi_pkg",
+ struct: "mubi4",
width: "1"
},
{ struct: "lc_tx"
diff --git a/hw/ip/aes/rtl/aes.sv b/hw/ip/aes/rtl/aes.sv
index 28defc5..8245821 100644
--- a/hw/ip/aes/rtl/aes.sv
+++ b/hw/ip/aes/rtl/aes.sv
@@ -41,7 +41,7 @@
input logic rst_shadowed_ni,
// Idle indicator for clock manager
- output logic idle_o,
+ output prim_mubi_pkg::mubi4_t idle_o,
// Life cycle
input lc_ctrl_pkg::lc_tx_t lc_escalate_en_i,
@@ -205,7 +205,7 @@
.hw2reg ( hw2reg )
);
- assign idle_o = reg2hw.status.idle.q;
+ assign idle_o = prim_mubi_pkg::mubi4_bool_to_mubi(reg2hw.status.idle.q);
////////////
// Alerts //
diff --git a/hw/ip/hmac/data/hmac.hjson b/hw/ip/hmac/data/hmac.hjson
index 1c7ab6a..f6214ae 100644
--- a/hw/ip/hmac/data/hmac.hjson
+++ b/hw/ip/hmac/data/hmac.hjson
@@ -28,8 +28,8 @@
{ name: "idle",
type: "uni",
act: "req",
- package: "",
- struct: "logic",
+ package: "prim_mubi_pkg",
+ struct: "mubi4",
width: "1"
}
],
diff --git a/hw/ip/hmac/rtl/hmac.sv b/hw/ip/hmac/rtl/hmac.sv
index 783827a..260fb68 100644
--- a/hw/ip/hmac/rtl/hmac.sv
+++ b/hw/ip/hmac/rtl/hmac.sv
@@ -25,7 +25,7 @@
output logic intr_fifo_empty_o,
output logic intr_hmac_err_o,
- output logic idle_o
+ output prim_mubi_pkg::mubi4_t idle_o
);
@@ -560,9 +560,9 @@
&& hmac_core_idle && sha_core_idle;
always_ff @(posedge clk_i or negedge rst_ni) begin
if (!rst_ni) begin
- idle_o <= 1'b 1;
+ idle_o <= prim_mubi_pkg::MuBi4False;
end else begin
- idle_o <= idle;
+ idle_o <= prim_mubi_pkg::mubi4_bool_to_mubi(idle);
end
end
diff --git a/hw/ip/kmac/data/kmac.hjson b/hw/ip/kmac/data/kmac.hjson
index 0e2c6eb..82d8da7 100644
--- a/hw/ip/kmac/data/kmac.hjson
+++ b/hw/ip/kmac/data/kmac.hjson
@@ -157,8 +157,8 @@
{ name: "idle",
type: "uni",
act: "req",
- package: "",
- struct: "logic",
+ package: "prim_mubi_pkg",
+ struct: "mubi4",
width: "1"
}
{ struct: "logic"
diff --git a/hw/ip/kmac/rtl/kmac.sv b/hw/ip/kmac/rtl/kmac.sv
index bbda64f..3917183 100644
--- a/hw/ip/kmac/rtl/kmac.sv
+++ b/hw/ip/kmac/rtl/kmac.sv
@@ -75,7 +75,7 @@
output logic en_masking_o,
// Idle signal
- output logic idle_o
+ output prim_mubi_pkg::mubi4_t idle_o
);
////////////////
@@ -534,11 +534,11 @@
// The logic checks idle of SHA3 engine, MSG_FIFO, KMAC_CORE, KEYMGR interface
always_ff @(posedge clk_i or negedge rst_ni) begin
if (!rst_ni) begin
- idle_o <= 1'b 1;
+ idle_o <= prim_mubi_pkg::MuBi4True;
end else if ((sha3_fsm == sha3_pkg::StIdle) && (msgfifo_empty || SecIdleAcceptSwMsg)) begin
- idle_o <= 1'b 1;
+ idle_o <= prim_mubi_pkg::MuBi4True;
end else begin
- idle_o <= 1'b 0;
+ idle_o <= prim_mubi_pkg::MuBi4False;
end
end
diff --git a/hw/ip/otbn/data/otbn.hjson b/hw/ip/otbn/data/otbn.hjson
index 88399a2..4f2df45 100644
--- a/hw/ip/otbn/data/otbn.hjson
+++ b/hw/ip/otbn/data/otbn.hjson
@@ -89,19 +89,13 @@
package: "edn_pkg"
},
- // OTBN is not performing any operation and can be clock/power-gated. One
- // idle for each clock domain (see assignments in "clocking" dictionary above).
+ // OTBN is not performing any operation and can be clock/power-gated.
{ name: "idle",
type: "uni",
- struct: "logic",
+ struct: "mubi4",
width: "1",
act: "req",
- },
- { name: "idle_otp",
- type: "uni",
- struct: "logic",
- width: "1",
- act: "req",
+ package: "prim_mubi_pkg"
},
// ram configuration
diff --git a/hw/ip/otbn/rtl/otbn.sv b/hw/ip/otbn/rtl/otbn.sv
index 6697d0f..2f18df8 100644
--- a/hw/ip/otbn/rtl/otbn.sv
+++ b/hw/ip/otbn/rtl/otbn.sv
@@ -33,8 +33,7 @@
output tlul_pkg::tl_d2h_t tl_o,
// Inter-module signals
- output logic idle_o,
- output logic idle_otp_o,
+ output prim_mubi_pkg::mubi4_t idle_o,
// Interrupts
output logic intr_done_o,
@@ -135,11 +134,7 @@
// Note: This is not the same thing as STATUS == IDLE. For example, we want to allow clock gating
// when locked.
- assign idle_o = is_not_running;
-
- // TODO: These two signals aren't technically in the same clock domain. Sort out how we do the
- // signalling properly.
- assign idle_otp_o = idle_o;
+ assign idle_o = prim_mubi_pkg::mubi4_bool_to_mubi(is_not_running);
// Lifecycle ==================================================================
@@ -972,7 +967,6 @@
`ASSERT_KNOWN(TlODValidKnown_A, tl_o.d_valid)
`ASSERT_KNOWN(TlOAReadyKnown_A, tl_o.a_ready)
`ASSERT_KNOWN(IdleOKnown_A, idle_o)
- `ASSERT_KNOWN(IdleOtpOKnown_A, idle_otp_o, clk_otp_i, !rst_otp_ni)
`ASSERT_KNOWN(IntrDoneOKnown_A, intr_done_o)
`ASSERT_KNOWN(AlertTxOKnown_A, alert_tx_o)
`ASSERT_KNOWN(EdnRndOKnown_A, edn_rnd_o, clk_edn_i, !rst_edn_ni)