[otbn] Rename otbn_trace_intf to otbn_trace_if
Our style guide (enforced by Verible in CI) requires interfaces to
have names ending in _if.
Also replace a fall-through with an explicit default in a case
statement to fix the other "style violation" that Verible catches and
add a missing qualification on a port type (that VCS catches).
Signed-off-by: Rupert Swarbrick <rswarbrick@lowrisc.org>
diff --git a/hw/ip/otbn/dv/tracer/README.md b/hw/ip/otbn/dv/tracer/README.md
index 4fe3d5b..1d91eb4 100644
--- a/hw/ip/otbn/dv/tracer/README.md
+++ b/hw/ip/otbn/dv/tracer/README.md
@@ -1,7 +1,7 @@
# OTBN Tracer
The tracer consists of a module (`otbn_tracer.sv`) and an interface
-(`otbn_trace_intf.sv`). The interface is responsible for directly probing the
+(`otbn_trace_if.sv`). The interface is responsible for directly probing the
design and implementing any basic tracking logic that is required. The module
takes an instance of this interface and uses it to produce trace data.
@@ -11,10 +11,10 @@
`accept_otbn_trace_string` provides a trace record and a cycle count. There is
at most one call per cycle. Further details are below.
-A typical setup would bind an instantiation of `otbn_trace_intf` and
-`otbn_tracer` into `otbn_core` passing the `otbn_trace_intf` instance into the
+A typical setup would bind an instantiation of `otbn_trace_if` and
+`otbn_tracer` into `otbn_core` passing the `otbn_trace_if` instance into the
`otbn_tracer` instance. However this is no need for `otbn_tracer` to be bound
-into `otbn_core` provided it is given a `otbn_trace_intf` instance.
+into `otbn_core` provided it is given a `otbn_trace_if` instance.
## Trace Format
diff --git a/hw/ip/otbn/dv/tracer/lint/otbn_tracer_waivers.vlt b/hw/ip/otbn/dv/tracer/lint/otbn_tracer_waivers.vlt
index 4fffa0b..3d66384 100644
--- a/hw/ip/otbn/dv/tracer/lint/otbn_tracer_waivers.vlt
+++ b/hw/ip/otbn/dv/tracer/lint/otbn_tracer_waivers.vlt
@@ -7,8 +7,8 @@
lint_off -rule BLKSEQ -file "*/otbn_tracer.sv" -match "*Blocking assignments (=) in sequential (flop or latch) block*"
// Flag ISPR (3) has its own trace signals due to special handling
-lint_off -rule UNDRIVEN -file "*/otbn_trace_intf.sv" -match "*Bits of signal are not driven: 'ispr_*'[3]*"
+lint_off -rule UNDRIVEN -file "*/otbn_trace_if.sv" -match "*Bits of signal are not driven: 'ispr_*'[3]*"
-lint_off -rule UNUSED -file "*/otbn_trace_intf.sv" -match "*Bits of signal are not used: 'dmem_addr_o'*"
-lint_off -rule UNUSED -file "*/otbn_trace_intf.sv" -match "*Bits of signal are not used: 'insn_dec_shared'*"
-lint_off -rule UNUSED -file "*/otbn_trace_intf.sv" -match "*Bits of signal are not used: 'alu_bignum_operation'*"
+lint_off -rule UNUSED -file "*/otbn_trace_if.sv" -match "*Bits of signal are not used: 'dmem_addr_o'*"
+lint_off -rule UNUSED -file "*/otbn_trace_if.sv" -match "*Bits of signal are not used: 'insn_dec_shared'*"
+lint_off -rule UNUSED -file "*/otbn_trace_if.sv" -match "*Bits of signal are not used: 'alu_bignum_operation'*"
diff --git a/hw/ip/otbn/dv/tracer/otbn_tracer.core b/hw/ip/otbn/dv/tracer/otbn_tracer.core
index 89f7ebe..99a2ffc 100644
--- a/hw/ip/otbn/dv/tracer/otbn_tracer.core
+++ b/hw/ip/otbn/dv/tracer/otbn_tracer.core
@@ -16,7 +16,7 @@
- cpp/log_trace_listener.h: { is_include_file: true, file_type: cppSource }
- cpp/log_trace_listener.cc: { file_type: cppSource }
- rtl/otbn_tracer.sv: { file_type: systemVerilogSource }
- - rtl/otbn_trace_intf.sv: { file_type: systemVerilogSource }
+ - rtl/otbn_trace_if.sv: { file_type: systemVerilogSource }
files_verilator_waiver:
files:
- lint/otbn_tracer_waivers.vlt
diff --git a/hw/ip/otbn/dv/tracer/rtl/otbn_trace_intf.sv b/hw/ip/otbn/dv/tracer/rtl/otbn_trace_if.sv
similarity index 97%
rename from hw/ip/otbn/dv/tracer/rtl/otbn_trace_intf.sv
rename to hw/ip/otbn/dv/tracer/rtl/otbn_trace_if.sv
index 0d05f7f..f003738 100644
--- a/hw/ip/otbn/dv/tracer/rtl/otbn_trace_intf.sv
+++ b/hw/ip/otbn/dv/tracer/rtl/otbn_trace_if.sv
@@ -22,7 +22,8 @@
* otbn_core. Whatever binds the interface into otbn_core is responsible for connecting these
* up, e.g. using a wildcard '.*'.
*/
-interface otbn_trace_intf #(
+interface otbn_trace_if
+#(
parameter int ImemAddrWidth,
parameter int DmemAddrWidth,
parameter otbn_pkg::regfile_e RegFile = otbn_pkg::RegFileFF
@@ -42,9 +43,9 @@
input logic [31:0] rf_base_rd_data_b,
input logic [31:0] rf_base_wr_data,
- input logic [WdrAw-1:0] rf_bignum_rd_addr_a,
- input logic [WdrAw-1:0] rf_bignum_rd_addr_b,
- input logic [WdrAw-1:0] rf_bignum_wr_addr,
+ input logic [otbn_pkg::WdrAw-1:0] rf_bignum_rd_addr_a,
+ input logic [otbn_pkg::WdrAw-1:0] rf_bignum_rd_addr_b,
+ input logic [otbn_pkg::WdrAw-1:0] rf_bignum_wr_addr,
input logic [otbn_pkg::WLEN-1:0] rf_bignum_rd_data_a,
input logic [otbn_pkg::WLEN-1:0] rf_bignum_rd_data_b,
diff --git a/hw/ip/otbn/dv/tracer/rtl/otbn_tracer.sv b/hw/ip/otbn/dv/tracer/rtl/otbn_tracer.sv
index 44134d8..22b1ebb 100644
--- a/hw/ip/otbn/dv/tracer/rtl/otbn_tracer.sv
+++ b/hw/ip/otbn/dv/tracer/rtl/otbn_tracer.sv
@@ -4,7 +4,7 @@
/**
* Tracer module for OTBN. This produces a multi-line string as trace output at most once every
- * cycle and provides it to the simulation environment via a DPI call. It uses `otbn_trace_intf` to
+ * cycle and provides it to the simulation environment via a DPI call. It uses `otbn_trace_if` to
* get the information it needs. For further information see `hw/ip/otbn/dv/tracer/README.md`.
*/
module otbn_tracer
@@ -12,7 +12,7 @@
input logic clk_i,
input logic rst_ni,
- otbn_trace_intf otbn_trace
+ otbn_trace_if otbn_trace
);
import otbn_pkg::*;
@@ -87,9 +87,8 @@
IsprAcc: return "ACC";
IsprRnd: return "RND";
IsprFlags: return "FLAGS";
+ default: return "UNKNOWN_ISPR";
endcase
-
- return "UNKNOWN_ISPR";
endfunction
// Format flag information into a string
diff --git a/hw/ip/otbn/dv/verilator/otbn_top_sim.sv b/hw/ip/otbn/dv/verilator/otbn_top_sim.sv
index d4b3205..3527303 100644
--- a/hw/ip/otbn/dv/verilator/otbn_top_sim.sv
+++ b/hw/ip/otbn/dv/verilator/otbn_top_sim.sv
@@ -73,8 +73,8 @@
.dmem_rerror_i ( dmem_rerror )
);
- bind otbn_core otbn_trace_intf #(.ImemAddrWidth, .DmemAddrWidth) i_otbn_trace_intf (.*);
- bind otbn_core otbn_tracer u_otbn_tracer(.*, .otbn_trace(i_otbn_trace_intf));
+ bind otbn_core otbn_trace_if #(.ImemAddrWidth, .DmemAddrWidth) i_otbn_trace_if (.*);
+ bind otbn_core otbn_tracer u_otbn_tracer(.*, .otbn_trace(i_otbn_trace_if));
// Pulse otbn_start for 1 cycle immediately out of reset.
// Flop `done_o` from otbn_core to match up with model done signal.