Skip to content

Commit ac087df

Browse files
Resolve or waive linter issues
Signed-off-by: Mike Thompson <[email protected]>
1 parent d64c46e commit ac087df

10 files changed

+35
-113
lines changed

cv32e40p/tb/uvmt/uvmt_cv32e40p_iss_wrap.sv

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ module uvmt_cv32e40p_iss_wrap
8686
step_compare_if.ovp_cpu_state_cont = cpu.control.state_cont;
8787
end
8888

89-
function void split(input string in_s, output string s1, s2);
89+
function automatic void split(ref string in_s, ref string s1, s2);
9090
automatic int i;
9191
for (i=0; i<in_s.len(); i++) begin
9292
if (in_s.getc(i) == ":")

cv32e40p/tb/uvmt/uvmt_cv32e40p_step_compare.sv

+4-2
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@ module uvmt_cv32e40p_step_compare
113113
end
114114
end
115115

116-
function void check_32bit(input string compared, input bit [31:0] expected, input logic [31:0] actual);
116+
// Waiving Verissimo SVTB.32.2.0: Pass strings by reference unless otherwise needed
117+
function void check_32bit(input string compared, input bit [31:0] expected, input logic [31:0] actual); //@DVT_LINTER_WAIVER "MT20211228_1" disable SVTB.32.2.0
117118
static int now = 0;
118119
if (now != $time) begin
119120
miscompare = 0;
@@ -384,7 +385,8 @@ module uvmt_cv32e40p_step_compare
384385
end
385386

386387
// RTL->RM CSR : mcycle, minstret, mcycleh, minstreth
387-
function automatic void pushRTL2RM(string message);
388+
// Waiving Verissimo SVTB.32.2.0: Pass strings by reference unless otherwise needed
389+
function automatic void pushRTL2RM(string message); //@DVT_LINTER_WAIVER "MT20211228_2" disable SVTB.32.2.0
388390
logic [ 5:0] gpr_addr;
389391
logic [31:0] gpr_value;
390392

cv32e40p/tests/uvmt/base-tests/uvmt_cv32e40p_base_test.sv

+2-1
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,9 @@ class uvmt_cv32e40p_base_test_c extends uvm_test;
176176

177177
/**
178178
* Prints overlined and underlined text in uppercase.
179+
* Waiving Verissimo SVTB.32.2.0: Pass strings by reference unless otherwise needed
179180
*/
180-
extern function void print_banner(string text);
181+
extern function void print_banner(string text); //@DVT_LINTER_WAIVER "MT20211228_3" disable SVTB.32.2.0
181182

182183
/**
183184
* Fatals out after watchdog_timeout has elapsed.

lib/uvm_agents/uvma_obi_memory/src/comps/uvma_obi_memory_drv.sv

+16-103
Original file line numberDiff line numberDiff line change
@@ -92,19 +92,10 @@ class uvma_obi_memory_drv_c extends uvm_driver#(
9292

9393
/**
9494
* Drives the virtual interface's (cntxt.vif) signals using req's contents.
95+
* This task handles both READ and WRITE transactions.
9596
*/
9697
extern task drv_mstr_req(ref uvma_obi_memory_mstr_seq_item_c req);
9798

98-
/**
99-
* Drives the virtual interface's (cntxt.vif) signals using req's contents.
100-
*/
101-
extern task drv_mstr_read_req(ref uvma_obi_memory_mstr_seq_item_c req);
102-
103-
/**
104-
* Drives the virtual interface's (cntxt.vif) signals using req's contents.
105-
*/
106-
extern task drv_mstr_write_req(ref uvma_obi_memory_mstr_seq_item_c req);
107-
10899
/**
109100
* Drives the virtual interface's (cntxt.vif) signals using req's contents.
110101
*/
@@ -357,30 +348,13 @@ task uvma_obi_memory_drv_c::prep_req(ref uvma_obi_memory_base_seq_item_c req);
357348

358349
endtask : prep_req
359350

360-
351+
// Both Master READ and WRITE transactions are handled here because the signalling is almost identical.
361352
task uvma_obi_memory_drv_c::drv_mstr_req(ref uvma_obi_memory_mstr_seq_item_c req);
362353

363-
case (req.access_type)
364-
UVMA_OBI_MEMORY_ACCESS_READ: begin
365-
drv_mstr_read_req(req);
366-
end
367-
368-
UVMA_OBI_MEMORY_ACCESS_WRITE: begin
369-
drv_mstr_write_req(req);
370-
end
371-
372-
default: `uvm_fatal("OBI_MEMORY_DRV", $sformatf("Invalid access_type: %0d", req.access_type))
373-
endcase
374-
375-
endtask : drv_mstr_req
376-
377-
378-
// This task has redundant code with drv_mstr_write_req for the request and
379-
// address phases. Rather than create a new method for the common code, the
380-
// waiver pragmas (@DVT) are placed to warn future maintainers of the situation.
381-
task uvma_obi_memory_drv_c::drv_mstr_read_req(ref uvma_obi_memory_mstr_seq_item_c req);
354+
if (req.access_type != UVMA_OBI_MEMORY_ACCESS_READ || req.access_type != UVMA_OBI_MEMORY_ACCESS_WRITE) begin
355+
`uvm_fatal("OBI_MEMORY_DRV", $sformatf("Invalid access_type: %0d", req.access_type))
356+
end
382357

383-
//@DVT_LINTER_WAIVER_START "MT20211004_1" disable SVTB.33.1.0, SVTB.33.2.0
384358
// Req Latency cycles
385359
repeat (req.req_latency) begin
386360
@(mstr_mp.drv_mstr_cb);
@@ -392,7 +366,6 @@ task uvma_obi_memory_drv_c::drv_mstr_read_req(ref uvma_obi_memory_mstr_seq_item_
392366
for (int unsigned ii=0; ii<cfg.addr_width; ii++) begin
393367
mstr_mp.drv_mstr_cb.addr[ii] <= req.address[ii];
394368
end
395-
//@DVT_LINTER_WAIVER_END "MT20211004_1"
396369
for (int unsigned ii=0; ii<(cfg.data_width/8); ii++) begin
397370
mstr_mp.drv_mstr_cb.be[ii] <= req.be[ii];
398371
end
@@ -403,6 +376,16 @@ task uvma_obi_memory_drv_c::drv_mstr_read_req(ref uvma_obi_memory_mstr_seq_item_
403376
mstr_mp.drv_mstr_cb.aid[ii] <= req.id[ii];
404377
end
405378

379+
// Handle WRITE
380+
if (req.access_type == UVMA_OBI_MEMORY_ACCESS_WRITE) begin
381+
for (int unsigned ii=0; ii<cfg.data_width; ii++) begin
382+
mstr_mp.drv_mstr_cb.wdata[ii] <= req.wdata[ii];
383+
end
384+
for (int unsigned ii=0; ii<cfg.wuser_width; ii++) begin
385+
mstr_mp.drv_mstr_cb.wuser[ii] <= req.wuser[ii];
386+
end
387+
end
388+
406389
// Wait for grant
407390
while (mstr_mp.drv_mstr_cb.gnt !== 1'b1) begin
408391
@(mstr_mp.drv_mstr_cb);
@@ -438,77 +421,7 @@ task uvma_obi_memory_drv_c::drv_mstr_read_req(ref uvma_obi_memory_mstr_seq_item_
438421
@(mstr_mp.drv_mstr_cb);
439422
end
440423

441-
endtask : drv_mstr_read_req
442-
443-
444-
// This task has redundant code with drv_mstr_read_req for the request and
445-
// address phases. Rather than create a new method for the common code, the
446-
// waiver pragmas (@DVT) are placed to warn future maintainers of the situation.
447-
task uvma_obi_memory_drv_c::drv_mstr_write_req(ref uvma_obi_memory_mstr_seq_item_c req);
448-
449-
//@DVT_LINTER_WAIVER_START "MT20210901_3" disable SVTB.33.1.0, SVTB.33.2.0
450-
// Req Latency cycles
451-
repeat (req.req_latency) begin
452-
@(mstr_mp.drv_mstr_cb);
453-
end
454-
455-
// Address phase
456-
mstr_mp.drv_mstr_cb.req <= 1'b1;
457-
mstr_mp.drv_mstr_cb.we <= req.access_type;
458-
for (int unsigned ii=0; ii<cfg.addr_width; ii++) begin
459-
mstr_mp.drv_mstr_cb.addr[ii] <= req.address[ii];
460-
end
461-
//@DVT_LINTER_WAIVER_END "MT20210901_3"
462-
for (int unsigned ii=0; ii<cfg.data_width; ii++) begin
463-
mstr_mp.drv_mstr_cb.wdata[ii] <= req.wdata[ii];
464-
end
465-
for (int unsigned ii=0; ii<(cfg.data_width/8); ii++) begin
466-
mstr_mp.drv_mstr_cb.be[ii] <= req.be[ii];
467-
end
468-
for (int unsigned ii=0; ii<cfg.auser_width; ii++) begin
469-
mstr_mp.drv_mstr_cb.auser[ii] <= req.auser[ii];
470-
end
471-
for (int unsigned ii=0; ii<cfg.wuser_width; ii++) begin
472-
mstr_mp.drv_mstr_cb.wuser[ii] <= req.wuser[ii];
473-
end
474-
for (int unsigned ii=0; ii<cfg.id_width; ii++) begin
475-
mstr_mp.drv_mstr_cb.aid[ii] <= req.id[ii];
476-
end
477-
478-
// Wait for grant
479-
while (mstr_mp.drv_mstr_cb.gnt !== 1'b1) begin
480-
@(mstr_mp.drv_mstr_cb);
481-
end
482-
483-
// Wait for rvalid
484-
while (mstr_mp.drv_mstr_cb.rvalid !== 1'b1) begin
485-
@(mstr_mp.drv_mstr_cb);
486-
end
487-
repeat (req.rready_latency) begin
488-
@(mstr_mp.drv_mstr_cb);
489-
end
490-
491-
// Response phase
492-
mstr_mp.drv_mstr_cb.rready <= 1'b1;
493-
mstr_mp.drv_mstr_cb.req <= 1'b0;
494-
repeat (req.rready_hold) begin
495-
if (mstr_mp.drv_mstr_cb.rvalid !== 1'b1) begin
496-
break;
497-
end
498-
@(mstr_mp.drv_mstr_cb);
499-
end
500-
while (mstr_mp.drv_mstr_cb.rvalid === 1'b1) begin
501-
@(mstr_mp.drv_mstr_cb);
502-
end
503-
504-
// Tail
505-
mstr_mp.drv_mstr_cb.rready <= 1'b0;
506-
drv_mstr_idle();
507-
repeat (req.tail_length) begin
508-
@(mstr_mp.drv_mstr_cb);
509-
end
510-
511-
endtask : drv_mstr_write_req
424+
endtask : drv_mstr_req
512425

513426

514427
task uvma_obi_memory_drv_c::drv_slv_req(ref uvma_obi_memory_slv_seq_item_c req);

lib/uvm_agents/uvma_obi_memory/src/seq/uvma_obi_memory_slv_seq.sv

+2-1
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,9 @@ class uvma_obi_memory_slv_seq_c extends uvma_obi_memory_slv_base_seq_c;
4343

4444
/**
4545
* Register sequences with a range of addresses on this OBI
46+
* Waiving Verissimo SVTB.32.2.0: Pass strings by reference unless otherwise needed
4647
*/
47-
extern virtual function uvma_obi_memory_vp_base_seq_c register_vp_vseq(string name,
48+
extern virtual function uvma_obi_memory_vp_base_seq_c register_vp_vseq(string name, //@DVT_LINTER_WAIVER "MT20211228_9" disable SVTB.32.2.0
4849
bit[31:0] start_address,
4950
uvm_object_wrapper seq_type);
5051

lib/uvm_libs/uvml_logs/uvml_logs_mon_trn_logger.sv

+2-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ class uvml_logs_mon_trn_logger_c#(
9999
/**
100100
* Writes msg to disk
101101
*/
102-
extern function void fwrite(string msg);
102+
// Waiving Verissimo linter SVTB.32.2.0: Pass strings by reference unless otherwise needed
103+
extern function void fwrite(string msg); //@DVT_LINTER_WAIVER "MT20211228_8" disable SVTB.32.2.0
103104

104105
endclass : uvml_logs_mon_trn_logger_c
105106

lib/uvm_libs/uvml_logs/uvml_logs_reg_logger_cbs.sv

+2-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ class uvml_logs_reg_logger_cbs_c extends uvm_reg_cbs;
8181
/**
8282
* Writes msg to disk
8383
*/
84-
extern function void fwrite(string msg);
84+
// Waiving Verissimo linter SVTB.32.2.0: Pass strings by reference unless otherwise needed
85+
extern function void fwrite(string msg); //@DVT_LINTER_WAIVER "MT20211228_7" disable SVTB.32.2.0
8586

8687
endclass
8788

lib/uvm_libs/uvml_logs/uvml_logs_rs_json.sv

+2-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ class uvml_logs_rs_json_c extends uvm_default_report_server;
6565
/**
6666
*
6767
*/
68-
extern virtual function string compose_report_message(uvm_report_message report_message, string report_object_name="");
68+
// Waiving Verissimo linter SVTB.32.2.0: Pass strings by reference unless otherwise needed
69+
extern virtual function string compose_report_message(uvm_report_message report_message, string report_object_name=""); //@DVT_LINTER_WAIVER "MT20211228_6" disable SVTB.32.2.0
6970

7071
endclass : uvml_logs_rs_json_c
7172

lib/uvm_libs/uvml_logs/uvml_logs_rs_text.sv

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ class uvml_logs_rs_text_c extends uvm_default_report_server;
3434
/**
3535
*
3636
*/
37-
extern virtual function string compose_report_message(uvm_report_message report_message, string report_object_name="");
37+
// Waiving Verissimo linter SVTB.32.2.0: Pass strings by reference unless otherwise needed
38+
extern virtual function string compose_report_message(uvm_report_message report_message, string report_object_name=""); //@DVT_LINTER_WAIVER "MT20211228_5" disable SVTB.32.2.0
3839

3940
/**
4041
*

lib/uvm_libs/uvml_logs/uvml_logs_seq_item_logger.sv

+2-1
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,9 @@ class uvml_logs_seq_item_logger_c#(
9898

9999
/**
100100
* Writes msg to disk
101+
* Waiving Verissimo SVTB.32.2.0: Pass strings by reference unless otherwise needed
101102
*/
102-
extern function void fwrite(string msg);
103+
extern function void fwrite(string msg); //@DVT_LINTER_WAIVER "MT20211228_4" disable SVTB.32.2.0
103104

104105
endclass : uvml_logs_seq_item_logger_c
105106

0 commit comments

Comments
 (0)