Skip to content

Commit b6ffdba

Browse files
committed
Fix lint warnings
1 parent 2dac8fc commit b6ffdba

File tree

5 files changed

+27
-24
lines changed

5 files changed

+27
-24
lines changed

src/isa/riscv_csr_instr.sv

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,25 +46,25 @@ class riscv_csr_instr extends riscv_instr;
4646
}
4747
}
4848

49-
constraint csr_csrrw {
49+
constraint csr_csrrw_c {
5050
if (instr_name == CSRRW || instr_name == CSRRWI) {
5151
write_csr == 1'b1;
5252
}
5353
}
5454

55-
constraint csr_csrrsc {
55+
constraint csr_csrrsc_c {
5656
if (instr_name == CSRRS || instr_name == CSRRC) {
5757
(write_csr == 1'b1) || rs1 == 0;
5858
}
5959
}
6060

61-
constraint csr_csrrsci {
61+
constraint csr_csrrsci_c {
6262
if(instr_name == CSRRSI || instr_name == CSRRCI) {
6363
(write_csr == 1'b1) || imm == 0;
6464
}
6565
}
6666

67-
constraint order {
67+
constraint order_c {
6868
// Choose a CSR before deciding whether we want to write to the CSR values. Then choose whether
6969
// to read or write before choosing the rs1 and imm values. This ensures read-only accesses to
7070
// read-only CSRs with similar probability to other CSR accesses and ensures a reasonable write

src/riscv_asm_program_gen.sv

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -581,17 +581,18 @@ class riscv_asm_program_gen extends uvm_object;
581581
`uvm_fatal(`gfn, "Couldn't find a memory region big enough to initialize the vector registers")
582582

583583
for (int v = 0; v < NUM_VEC_GPR; v++) begin
584-
// Select random region
584+
// Select random region
585585
int region = $urandom_range(0, valid_mem_region.size()-1);
586-
// Get valid start offset in region
586+
// Get valid start offset in region
587587
int offset = $urandom_range(0, (valid_mem_region[region].size_in_bytes - (cfg.vector_cfg.vlen / 8)) /
588-
(sew / 8)) * (sew / 8);
589-
// Generate load
588+
(sew / 8)) * (sew / 8);
589+
// Generate load
590590
instr_stream.push_back($sformatf("%0sla x%0d, %0s+%0d", indent, cfg.gpr[0],
591591
valid_mem_region[region].name, offset));
592592
instr_stream.push_back($sformatf("%0svle%0d.v v%0d, (x%0d)", indent, sew, v, cfg.gpr[0]));
593593
end
594594
end
595+
default: ;
595596
endcase
596597

597598
// Initialize vector CSRs

src/riscv_illegal_instr.sv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ class riscv_illegal_instr extends uvm_object;
142142
}
143143
}
144144

145-
constraint legal_rv32_c_slli {
145+
constraint legal_rv32_c_slli_c {
146146
if ((c_msb == 3'b000) && (c_op == 2'b10) && (XLEN == 32)) {
147147
if (exception == kReservedCompressedInstr) {
148148
instr_bin[12] == 1;

src/riscv_instr_stream.sv

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,8 @@ class riscv_rand_instr_stream extends riscv_instr_stream;
330330
// For every current vtype config, there will always be a legal vlmul when vsew
331331
// is reduced, since there is always space for at least one element in a fractional
332332
// register. So setting to smallest vsew here is always possible.
333-
if (!cfg.vector_cfg.vtype.fractional_lmul && vsew/8 > cfg.vector_cfg.vtype.vsew/cfg.vector_cfg.vtype.vlmul) begin
333+
if (!cfg.vector_cfg.vtype.fractional_lmul &&
334+
vsew/8 > cfg.vector_cfg.vtype.vsew/cfg.vector_cfg.vtype.vlmul) begin
334335
vsew = 8;
335336
end
336337
// Calculate new vlmul and update vtype, while vl remains constant

src/riscv_load_store_instr_lib.sv

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -523,11 +523,11 @@ endclass
523523
class riscv_vector_load_store_instr_stream extends riscv_mem_access_stream;
524524

525525
// List of vector load/store instructions (grouped into different address modes)
526-
localparam riscv_instr_name_t unit_strided[] = {VLE_V, VSE_V, VLEFF_V,
527-
VLM_V, VSM_V, VLRE_V, VSR_V,
528-
VLSEGE_V, VSSEGE_V, VLSEGEFF_V};
529-
localparam riscv_instr_name_t strided[] = {VLSE_V, VSSE_V, VLSSEGE_V, VSSSEGE_V};
530-
localparam riscv_instr_name_t indexed[] = {VLUXEI_V, VLOXEI_V, VSUXEI_V, VSOXEI_V,
526+
localparam riscv_instr_name_t UnitStrided[] = {VLE_V, VSE_V, VLEFF_V,
527+
VLM_V, VSM_V, VLRE_V, VSR_V,
528+
VLSEGE_V, VSSEGE_V, VLSEGEFF_V};
529+
localparam riscv_instr_name_t Strided[] = {VLSE_V, VSSE_V, VLSSEGE_V, VSSSEGE_V};
530+
localparam riscv_instr_name_t Indexed[] = {VLUXEI_V, VLOXEI_V, VSUXEI_V, VSOXEI_V,
531531
VLUXSEGEI_V, VLOXSEGEI_V, VSUXSEGEI_V, VSOXSEGEI_V};
532532

533533
// Types of vector load/store address modes
@@ -642,20 +642,20 @@ class riscv_vector_load_store_instr_stream extends riscv_mem_access_stream;
642642
super.pre_randomize();
643643

644644
// Build list of allowed address modes (according to unsupported_instr list)
645-
foreach(unit_strided[i]) begin
646-
if (!(unit_strided[i] inside {unsupported_instr})) begin
645+
foreach(UnitStrided[i]) begin
646+
if (!(UnitStrided[i] inside {unsupported_instr})) begin
647647
allowed_address_modes = {allowed_address_modes, UNIT_STRIDED};
648648
break;
649649
end
650650
end
651-
foreach(strided[i]) begin
652-
if (!(strided[i] inside {unsupported_instr})) begin
651+
foreach(Strided[i]) begin
652+
if (!(Strided[i] inside {unsupported_instr})) begin
653653
allowed_address_modes = {allowed_address_modes, STRIDED};
654654
break;
655655
end
656656
end
657-
foreach(indexed[i]) begin
658-
if (!(indexed[i] inside {unsupported_instr})) begin
657+
foreach(Indexed[i]) begin
658+
if (!(Indexed[i] inside {unsupported_instr})) begin
659659
allowed_address_modes = {allowed_address_modes, INDEXED};
660660
break;
661661
end
@@ -758,14 +758,15 @@ class riscv_vector_load_store_instr_stream extends riscv_mem_access_stream;
758758
// Get instructions for selected address mode
759759
case (address_mode)
760760
UNIT_STRIDED : begin
761-
possible_instr = {unit_strided};
761+
possible_instr = {UnitStrided};
762762
end
763763
STRIDED : begin
764-
possible_instr = {strided};
764+
possible_instr = {Strided};
765765
end
766766
INDEXED : begin
767-
possible_instr = {indexed};
767+
possible_instr = {Indexed};
768768
end
769+
default: ;
769770
endcase
770771

771772
// Filter out illegal instructions for current config

0 commit comments

Comments
 (0)