Skip to content

Commit 7fbd858

Browse files
committed
[dv] Remove two unused flags from dv_base_mem
These were added in February 2022 (with commit ab1d927). The read_to_wo_mem_ok flag was never actually used. The only use of the write_to_ro_mem_ok flag in was removed in October 2022 (commit 175e33f) when rv_dm learned to generate R/W errors. Signed-off-by: Rupert Swarbrick <rswarbrick@lowrisc.org>
1 parent 5e03e84 commit 7fbd858

File tree

2 files changed

+12
-34
lines changed

2 files changed

+12
-34
lines changed

hw/dv/sv/cip_lib/cip_base_scoreboard.sv

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -667,13 +667,13 @@ class cip_base_scoreboard #(type RAL_T = dv_base_reg_block,
667667
// check if mem read happens while mem doesn't allow read (WO)
668668
if ((mem_access == "WO") && (item.a_opcode == tlul_pkg::Get)) begin
669669
invalid_access = 1;
670-
mem_wo_err = !mem.get_read_to_wo_mem_ok();
670+
mem_wo_err = 1;
671671
end
672672

673673
// check if mem write happens while mem is RO
674674
if ((mem_access == "RO") && (item.a_opcode != tlul_pkg::Get)) begin
675675
invalid_access = 1;
676-
mem_ro_err = !mem.get_write_to_ro_mem_ok();
676+
mem_ro_err = 1;
677677
end
678678

679679
if (invalid_access) begin

hw/dv/sv/dv_base_reg/dv_base_mem.sv

Lines changed: 10 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@
22
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
33
// SPDX-License-Identifier: Apache-2.0
44

5-
// base register reg class which will be used to generate the reg mem
5+
// Specialised version of uvm_mem for OpenTitan
6+
//
7+
// The specialised version adds the possibilities that a memory:
8+
//
9+
// - might not support partial writes (even if the bus would otherwise support them).
10+
//
11+
// - might store integrity data but not check it (merely passing it through to the next read).
612

713
class dv_base_mem extends uvm_mem;
8-
9-
// if mem doesn't support partial write, doing that will result d_error = 1
14+
// If true, the memory supports partial writes. If not, any partial write will get an error
15+
// response (d_error=1 in TileLink).
1016
local bit mem_partial_write_support;
1117

12-
// Modifies the expectation of writes / reads to RO / WO mem. By default it should be an error
13-
// response, but some implementations may choose to just ignore it.
14-
local bit write_to_ro_mem_ok;
15-
local bit read_to_wo_mem_ok;
16-
17-
// if data integrity is passthru, mem stores integrity along with data but it won't check the
18-
// data integrity
18+
// If true, mem stores integrity along with data but it won't check the data integrity
1919
local bit data_intg_passthru;
2020

2121
// Create a new instance of the memory abstraction class.
@@ -33,12 +33,6 @@ class dv_base_mem extends uvm_mem;
3333
extern function void set_data_intg_passthru(bit enable);
3434
extern function bit get_data_intg_passthru();
3535

36-
extern function void set_write_to_ro_mem_ok(bit ok);
37-
extern function bit get_write_to_ro_mem_ok();
38-
39-
extern function void set_read_to_wo_mem_ok(bit ok);
40-
extern function bit get_read_to_wo_mem_ok();
41-
4236
// This overrides uvm_mem::configure (which is *not* a virtual function), removing the check that
4337
// the requested "access" is RW or RO, because we want to support WO as well.
4438
//
@@ -72,22 +66,6 @@ function bit dv_base_mem::get_data_intg_passthru();
7266
return data_intg_passthru;
7367
endfunction
7468

75-
function void dv_base_mem::set_write_to_ro_mem_ok(bit ok);
76-
write_to_ro_mem_ok = ok;
77-
endfunction
78-
79-
function bit dv_base_mem::get_write_to_ro_mem_ok();
80-
return write_to_ro_mem_ok;
81-
endfunction
82-
83-
function void dv_base_mem::set_read_to_wo_mem_ok(bit ok);
84-
read_to_wo_mem_ok = ok;
85-
endfunction
86-
87-
function bit dv_base_mem::get_read_to_wo_mem_ok();
88-
return read_to_wo_mem_ok;
89-
endfunction
90-
9169
// Note: This is a copied version of uvm_mem::configure, but tweaked to remove the check on m_access
9270
// (loosened slightly and now moved to the constructor)
9371
function void dv_base_mem::configure(uvm_reg_block parent, string hdl_path="");

0 commit comments

Comments
 (0)