Skip to content

Commit d1ddec1

Browse files
Formal: Lint fixup
Mostly line lengths and indexes. This commits also adds a Verible waiver file.
1 parent 46fbbc9 commit d1ddec1

File tree

5 files changed

+40
-26
lines changed

5 files changed

+40
-26
lines changed

.github/workflows/pr_lint.yml

+1
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,4 @@ jobs:
3636
reviewdog_reporter: github-pr-check
3737
suggest_fixes: "false"
3838
config_file: ${{ env.verible_config }}
39+
extra_args: "--waiver_files lint/verible_waiver.vbw"

dv/formal/check/peek/follower.sv

+3-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ always_comb begin
4949
ex_has_branched_d = ex_has_branched_q;
5050
end
5151

52-
ex_has_branched_d = (ex_has_branched_d | `IF.branch_req) && ~ex_kill && (`IDC.ctrl_fsm_cs == `IDC.DECODE);
52+
ex_has_branched_d = (ex_has_branched_d | `IF.branch_req) &&
53+
~ex_kill &&
54+
(`IDC.ctrl_fsm_cs == `IDC.DECODE);
5355
end
5456

5557
always @(posedge clk_i or negedge rst_ni) begin

dv/formal/check/top.sv

+18-8
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,10 @@ ConstantBoot: assume property (boot_addr_i == $past(boot_addr_i));
124124
// 3. Always fetch enable
125125
FetchEnable: assume property (fetch_enable_i == IbexMuBiOn);
126126
// 4. Never try to sleep if we couldn't ever wake up
127-
WFIStart: assume property (`IDC.ctrl_fsm_cs == SLEEP |-> `CSR.mie_q.irq_software | `CSR.mie_q.irq_timer | `CSR.mie_q.irq_external);
127+
WFIStart: assume property (`IDC.ctrl_fsm_cs == SLEEP |->
128+
`CSR.mie_q.irq_software |
129+
`CSR.mie_q.irq_timer |
130+
`CSR.mie_q.irq_external);
128131
// 5. Disable clock gating
129132
TestEn: assume property (test_en_i);
130133
// See protocol/* for further assumptions
@@ -169,7 +172,7 @@ TestEn: assume property (test_en_i);
169172
////////////////////// Abstract State //////////////////////
170173

171174
// Pre state is the architectural state of Ibex at the start of the cycle
172-
logic [31:0] pre_regs[31:0];
175+
logic [31:0] pre_regs[32];
173176
logic [31:0] pre_nextpc;
174177
logic [31:0] pre_mip;
175178

@@ -262,10 +265,11 @@ assign lsu_had_first_resp = `LSU.ls_fsm_cs == `LSU.WAIT_GNT && `LSU.split_misali
262265
////////////////////// Wrap signals //////////////////////
263266

264267
logic spec_en; // The specification is being queried in this cycle
265-
logic has_spec_past; // There is a previous step to compare against. Will become 0 on uncheckable CSRs and at reset.
268+
logic has_spec_past; // There is a previous step to compare against.
269+
// Will become 0 on uncheckable CSRs and at reset.
266270

267271
// The previous specification output to be compared with the new input
268-
logic [31:0] spec_past_regs[31:0];
272+
logic [31:0] spec_past_regs[32];
269273
logic [31:0] spec_past_has_reg; // Registers will have past values only when they are written to.
270274
`define X(n) spec_past_``n
271275
`X_EACH_CSR_TYPED
@@ -286,7 +290,8 @@ logic wbexc_illegal; // EXC has an illegal instruction
286290
logic wbexc_compressed_illegal; // EXC has an illegal instruction
287291
logic wbexc_err; // EXC has an error
288292
logic instr_will_progress; // Instruction will finish EX
289-
logic wfi_will_finish; // WFI instruction retire by flushing the pipeline, but that isn't an exception
293+
logic wfi_will_finish; // WFI instruction retire by flushing the pipeline,
294+
// but that isn't an exception.
290295
logic wbexc_csr_pipe_flush; // The pipeline is being flushed due to a CSR write
291296
logic wbexc_handling_irq; // Check the results of handling an IRQ
292297

@@ -326,7 +331,8 @@ logic spec_post_wX_en;
326331

327332
logic spec_int_err;
328333

329-
logic spec_fetch_err; // The specification has experienced a fetch error, regardless of whether or not it was told to.
334+
logic spec_fetch_err; // The specification has experienced a fetch error,
335+
// regardless of whether or not it was told to.
330336
assign spec_fetch_err =
331337
(main_mode == MAIN_IFERR && spec_api_i.main_result == MAINRES_OK) ||
332338
spec_api_i.main_result == MAINRES_IFERR_1 || spec_api_i.main_result == MAINRES_IFERR_2;
@@ -386,10 +392,14 @@ assign lsu_waiting_for_misal =
386392
((`LSU.data_type_q == 2'b01) && (`LSU.rdata_offset_q == 2'b11));
387393

388394
logic addr_last_matches;
389-
assign addr_last_matches = `ID.rf_rdata_a_fwd + (ex_is_store_instr? `ID.imm_s_type : `ID.imm_i_type) == `LSU.addr_last_q;
395+
assign addr_last_matches = `ID.rf_rdata_a_fwd +
396+
(ex_is_store_instr? `ID.imm_s_type : `ID.imm_i_type) ==
397+
`LSU.addr_last_q;
390398

391399
logic addr_last_d_matches;
392-
assign addr_last_d_matches = `ID.rf_rdata_a_fwd + (ex_is_store_instr? `ID.imm_s_type : `ID.imm_i_type) == `LSU.addr_last_d;
400+
assign addr_last_d_matches = `ID.rf_rdata_a_fwd +
401+
(ex_is_store_instr? `ID.imm_s_type : `ID.imm_i_type) ==
402+
`LSU.addr_last_d;
393403

394404
////////////////////// Compare //////////////////////
395405

dv/formal/spec/spec_api.sv

+17-17
Original file line numberDiff line numberDiff line change
@@ -99,27 +99,27 @@ module spec_api #(
9999
output logic [3:0] mem_write_snd_be_o
100100
);
101101

102-
bit rX_sail_invoke[1:0];
103-
logic [31:0] rX_sail_invoke_ret[1:0];
104-
logic [63:0] rX_sail_invoke_arg_0[1:0];
102+
bit rX_sail_invoke[2];
103+
logic [31:0] rX_sail_invoke_ret[2];
104+
logic [63:0] rX_sail_invoke_arg_0[2];
105105
assign rx_a_en_o = rX_sail_invoke[0];
106106
assign rx_a_addr_o = rX_sail_invoke_arg_0[0][4:0];
107107
assign rX_sail_invoke_ret[0] = rx_a_i;
108108
assign rx_b_en_o = rX_sail_invoke[1];
109109
assign rx_b_addr_o = rX_sail_invoke_arg_0[1][4:0];
110110
assign rX_sail_invoke_ret[1] = rx_b_i;
111111

112-
logic wX_sail_invoke[0:0];
113-
logic [63:0] wX_sail_invoke_arg_0[0:0];
114-
logic [31:0] wX_sail_invoke_arg_1[0:0];
112+
logic wX_sail_invoke[1];
113+
logic [63:0] wX_sail_invoke_arg_0[1];
114+
logic [31:0] wX_sail_invoke_arg_1[1];
115115
assign wx_en_o = wX_sail_invoke[0];
116116
assign wx_addr_o = wX_sail_invoke_arg_0[0][4:0];
117117
assign wx_o = wX_sail_invoke_arg_1[0];
118118

119-
logic write_ram_sail_invoke[1:0];
120-
logic [31:0] write_ram_sail_invoke_arg_1[1:0];
121-
logic [31:0] write_ram_sail_invoke_arg_2[1:0];
122-
logic [3:0] write_ram_sail_invoke_arg_3[1:0];
119+
logic write_ram_sail_invoke[2];
120+
logic [31:0] write_ram_sail_invoke_arg_1[2];
121+
logic [31:0] write_ram_sail_invoke_arg_2[2];
122+
logic [3:0] write_ram_sail_invoke_arg_3[2];
123123
assign mem_write_o = write_ram_sail_invoke[0];
124124
assign mem_write_snd_gran_o = write_ram_sail_invoke[1];
125125
assign mem_write_fst_addr_o = write_ram_sail_invoke_arg_1[0];
@@ -129,9 +129,9 @@ assign mem_write_snd_wdata_o = write_ram_sail_invoke_arg_2[1];
129129
assign mem_write_fst_be_o = write_ram_sail_invoke_arg_3[0];
130130
assign mem_write_snd_be_o = write_ram_sail_invoke_arg_3[1];
131131

132-
logic read_ram_sail_invoke[1:0];
133-
logic [31:0] read_ram_sail_invoke_ret[1:0];
134-
logic [31:0] read_ram_sail_invoke_arg_1[1:0];
132+
logic read_ram_sail_invoke[2];
133+
logic [31:0] read_ram_sail_invoke_ret[2];
134+
logic [31:0] read_ram_sail_invoke_arg_1[2];
135135
assign mem_read_o = read_ram_sail_invoke[0];
136136
assign mem_read_snd_gran_o = read_ram_sail_invoke[1];
137137
assign mem_read_fst_addr_o = read_ram_sail_invoke_arg_1[0];
@@ -160,10 +160,10 @@ assign mcounteren_o = mcounteren_out.bits;
160160
t_Mtvec mtvec_out;
161161
assign mtvec_o = mtvec_out.bits;
162162

163-
t_Pmpcfg_ent pmpcfg_n_in[63:0];
164-
logic [31:0] pmpaddr_n_in[63:0];
165-
t_Pmpcfg_ent pmpcfg_n_out[63:0];
166-
logic [31:0] pmpaddr_n_out[63:0];
163+
t_Pmpcfg_ent pmpcfg_n_in[64];
164+
logic [31:0] pmpaddr_n_in[64];
165+
t_Pmpcfg_ent pmpcfg_n_out[64];
166+
logic [31:0] pmpaddr_n_out[64];
167167
for (genvar i = 0; i < 64; i++) begin: g_pmp_bind
168168
if (i < PMPNumRegions) begin: g_pmp_bind_real
169169
assign pmpcfg_n_in[i] = '{bits: pmp_cfg_i[i]};

lint/verible_waiver.vbw

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
waive --rule=module-port --location="spec_instance.sv"

0 commit comments

Comments
 (0)