Skip to content

Commit 283be1a

Browse files
committed
Fix regression tests to avoid -Winconsistent-overrides
-Woverloaded-virtual - synchronize examples with tests/uvm-systemc/examples
1 parent 665eaa2 commit 283be1a

File tree

172 files changed

+939
-819
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

172 files changed

+939
-819
lines changed

examples/uvmsc/integrated/ubus/vip/ubus_bus_monitor.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ class ubus_bus_monitor : public uvm::uvm_monitor
112112

113113
// The following two bits are used to control whether checks and coverage are
114114
// done both in the bus monitor class and the interface.
115-
bool checks_enable; // default true
116-
bool coverage_enable; // default true
115+
bool checks_enable {false}; // default true in SV example, currently not available in UVM SystemC
116+
bool coverage_enable {false}; // default true in SV example, currently not available in UVM SystemC
117117

118118
// The state of the ubus
119119
ubus_status status;

examples/uvmsc/simple/configuration/manual/sc_main.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ int sc_main(int, char*[])
3434
//uvm::uvm_config_db_options::turn_on_tracing();
3535

3636
// set configuration prior to creating the environment
37-
uvm::uvm_config_db<int>::set(nullptr, "topenv.*.u1", "v", 30);
38-
uvm::uvm_config_db<int>::set(nullptr, "topenv.inst2.u1", "v", 10);
39-
uvm::uvm_config_db<int>::set(nullptr, "topenv.*", "debug", 1);
40-
uvm::uvm_config_db<std::string>::set(nullptr, "*", "myaa[foo]", "hi");
41-
uvm::uvm_config_db<std::string>::set(nullptr, "*", "myaa[bar]", "bye");
42-
uvm::uvm_config_db<std::string>::set(nullptr, "*", "myaa[foobar]", "howdy");
43-
uvm::uvm_config_db<std::string>::set(nullptr, "topenv.inst1.u1", "myaa[foo]", "boo");
44-
uvm::uvm_config_db<std::string>::set(nullptr, "topenv.inst1.u1", "myaa[foobar]", "boobah");
37+
uvm::uvm_config_db<int>::set(NULL, "topenv.*.u1", "v", 30);
38+
uvm::uvm_config_db<int>::set(NULL, "topenv.inst2.u1", "v", 10);
39+
uvm::uvm_config_db<int>::set(NULL, "topenv.*", "debug", 1);
40+
uvm::uvm_config_db<std::string>::set(NULL, "*", "myaa[foo]", "hi");
41+
uvm::uvm_config_db<std::string>::set(NULL, "*", "myaa[bar]", "bye");
42+
uvm::uvm_config_db<std::string>::set(NULL, "*", "myaa[foobar]", "howdy");
43+
uvm::uvm_config_db<std::string>::set(NULL, "topenv.inst1.u1", "myaa[foo]", "boo");
44+
uvm::uvm_config_db<std::string>::set(NULL, "topenv.inst1.u1", "myaa[foobar]", "boobah");
4545

4646
topenv = new my_env("topenv");
4747

examples/uvmsc/simple/phases/timeout/tb_timer.h

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class tb_timer : public uvm::uvm_component
3434
{
3535
sc_core::sc_time t;
3636
if (uvm::uvm_config_db<sc_core::sc_time>::get(this, "run", "timeout", t) &&
37-
t.to_seconds() > 0)
37+
t > sc_core::SC_ZERO_TIME)
3838
{
3939
sc_core::wait(t);
4040
UVM_FATAL("TIMEOUT", "Time-out expired in run phase");
@@ -45,7 +45,7 @@ class tb_timer : public uvm::uvm_component
4545
{
4646
sc_core::sc_time t;
4747
if (uvm::uvm_config_db<sc_core::sc_time>::get(this, "pre_reset", "timeout", t) &&
48-
t.to_seconds() > 0)
48+
t > sc_core::SC_ZERO_TIME)
4949
{
5050
sc_core::wait(t);
5151
UVM_FATAL("TIMEOUT", "Time-out expired in pre_reset phase");
@@ -56,7 +56,7 @@ class tb_timer : public uvm::uvm_component
5656
{
5757
sc_core::sc_time t;
5858
if (uvm::uvm_config_db<sc_core::sc_time>::get(this, "reset", "timeout", t) &&
59-
t.to_seconds() > 0)
59+
t > sc_core::SC_ZERO_TIME)
6060
{
6161
sc_core::wait(t);
6262
UVM_FATAL("TIMEOUT", "Time-out expired in reset phase");
@@ -67,7 +67,7 @@ class tb_timer : public uvm::uvm_component
6767
{
6868
sc_core::sc_time t;
6969
if (uvm::uvm_config_db<sc_core::sc_time>::get(this, "post_reset", "timeout", t) &&
70-
t.to_seconds() > 0)
70+
t > sc_core::SC_ZERO_TIME)
7171
{
7272
sc_core::wait(t);
7373
UVM_FATAL("TIMEOUT", "Time-out expired in post_reset phase");
@@ -78,7 +78,7 @@ class tb_timer : public uvm::uvm_component
7878
{
7979
sc_core::sc_time t;
8080
if (uvm::uvm_config_db<sc_core::sc_time>::get(this, "pre_configure", "timeout", t) &&
81-
t.to_seconds() > 0)
81+
t > sc_core::SC_ZERO_TIME)
8282
{
8383
sc_core::wait(t);
8484
UVM_FATAL("TIMEOUT", "Time-out expired in pre_configure phase");
@@ -89,7 +89,7 @@ class tb_timer : public uvm::uvm_component
8989
{
9090
sc_core::sc_time t;
9191
if (uvm::uvm_config_db<sc_core::sc_time>::get(this, "configure", "timeout", t) &&
92-
t.to_seconds() > 0)
92+
t > sc_core::SC_ZERO_TIME)
9393
{
9494
sc_core::wait(t);
9595
UVM_FATAL("TIMEOUT", "Time-out expired in configure phase");
@@ -100,7 +100,7 @@ class tb_timer : public uvm::uvm_component
100100
{
101101
sc_core::sc_time t;
102102
if (uvm::uvm_config_db<sc_core::sc_time>::get(this, "post_configure", "timeout", t) &&
103-
t.to_seconds() > 0)
103+
t > sc_core::SC_ZERO_TIME)
104104
{
105105
sc_core::wait(t);
106106
UVM_FATAL("TIMEOUT", "Time-out expired in post_configure phase");
@@ -111,7 +111,7 @@ class tb_timer : public uvm::uvm_component
111111
{
112112
sc_core::sc_time t;
113113
if (uvm::uvm_config_db<sc_core::sc_time>::get(this, "pre_main", "timeout", t) &&
114-
t.to_seconds() > 0)
114+
t > sc_core::SC_ZERO_TIME)
115115
{
116116
sc_core::wait(t);
117117
UVM_FATAL("TIMEOUT", "Time-out expired in pre_main phase");
@@ -122,7 +122,7 @@ class tb_timer : public uvm::uvm_component
122122
{
123123
sc_core::sc_time t;
124124
if (uvm::uvm_config_db<sc_core::sc_time>::get(this, "main", "timeout", t) &&
125-
t.to_seconds() > 0)
125+
t > sc_core::SC_ZERO_TIME)
126126
{
127127
sc_core::wait(t);
128128
UVM_FATAL("TIMEOUT", "Time-out expired in main phase");
@@ -133,7 +133,7 @@ class tb_timer : public uvm::uvm_component
133133
{
134134
sc_core::sc_time t;
135135
if (uvm::uvm_config_db<sc_core::sc_time>::get(this, "post_main", "timeout", t) &&
136-
t.to_seconds() > 0)
136+
t > sc_core::SC_ZERO_TIME)
137137
{
138138
sc_core::wait(t);
139139
UVM_FATAL("TIMEOUT", "Time-out expired in post_main phase");
@@ -144,7 +144,7 @@ class tb_timer : public uvm::uvm_component
144144
{
145145
sc_core::sc_time t;
146146
if (uvm::uvm_config_db<sc_core::sc_time>::get(this, "pre_shutdown", "timeout", t) &&
147-
t.to_seconds() > 0)
147+
t > sc_core::SC_ZERO_TIME)
148148
{
149149
sc_core::wait(t);
150150
UVM_FATAL("TIMEOUT", "Time-out expired in pre_shutdown phase");
@@ -155,7 +155,7 @@ class tb_timer : public uvm::uvm_component
155155
{
156156
sc_core::sc_time t;
157157
if (uvm::uvm_config_db<sc_core::sc_time>::get(this, "shutdown", "timeout", t) &&
158-
t.to_seconds() > 0)
158+
t > sc_core::SC_ZERO_TIME)
159159
{
160160
sc_core::wait(t);
161161
UVM_FATAL("TIMEOUT", "Time-out expired in shutdown phase");
@@ -166,7 +166,7 @@ class tb_timer : public uvm::uvm_component
166166
{
167167
sc_core::sc_time t;
168168
if (uvm::uvm_config_db<sc_core::sc_time>::get(this, "post_shutdown", "timeout", t) &&
169-
t.to_seconds() > 0)
169+
t > sc_core::SC_ZERO_TIME)
170170
{
171171
sc_core::wait(t);
172172
UVM_FATAL("TIMEOUT", "Time-out expired in post_shutdown phase");

tests/tests/uvm-systemc/bugs/bug_184/basic_read_write_memory_management/bus_trans.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ class bus_trans: public uvm::uvm_sequence_item {
4040
uvm::uvm_sequence_item(name) {
4141
}
4242

43-
~bus_trans() {
43+
~bus_trans() override {
4444
}
4545

4646
UVM_OBJECT_UTILS(bus_trans);
4747

48-
virtual void do_copy( const uvm::uvm_object& rhs )
48+
void do_copy( const uvm::uvm_object& rhs ) override
4949
{
5050
const bus_trans* rhs_ = dynamic_cast<const bus_trans*>(&rhs);
5151
if(rhs_ == nullptr)
@@ -56,7 +56,7 @@ class bus_trans: public uvm::uvm_sequence_item {
5656
data = rhs_->data;
5757
}
5858

59-
virtual bool do_compare( const uvm::uvm_object& rhs, const uvm::uvm_comparer* comparer )
59+
bool do_compare( const uvm::uvm_object& rhs, const uvm::uvm_comparer* comparer ) const override
6060
{
6161
const bus_trans* rhs_ = dynamic_cast<const bus_trans*>(&rhs);
6262
if(rhs_ == nullptr)
@@ -65,7 +65,7 @@ class bus_trans: public uvm::uvm_sequence_item {
6565
return ((data == rhs_->data));
6666
}
6767

68-
void do_print( const uvm::uvm_printer& printer ) const
68+
void do_print( const uvm::uvm_printer& printer ) const override
6969
{
7070
unsigned int idx = 0;
7171
//for(const auto & i: data) {
@@ -75,7 +75,7 @@ class bus_trans: public uvm::uvm_sequence_item {
7575

7676
}
7777

78-
std::string convert2string()
78+
std::string convert2string() const override
7979
{
8080
std::ostringstream str;
8181
for(const auto & i: data) {

tests/tests/uvm-systemc/bugs/bug_184/basic_read_write_memory_management/env.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class env: public uvm::uvm_env
4747

4848
env( uvm::uvm_component_name name ) : uvm::uvm_env( name ), sqr(0), drv(0) {}
4949

50-
void build_phase(uvm::uvm_phase& phase)
50+
void build_phase(uvm::uvm_phase& phase) override
5151
{
5252
uvm::uvm_env::build_phase(phase);
5353

@@ -57,12 +57,12 @@ class env: public uvm::uvm_env
5757

5858
}
5959

60-
void connect_phase(uvm::uvm_phase& phase)
60+
void connect_phase(uvm::uvm_phase& phase) override
6161
{
6262
drv->seq_item_port(sqr->seq_item_export);
6363
}
6464

65-
void run_phase(uvm::uvm_phase& phase)
65+
void run_phase(uvm::uvm_phase& phase) override
6666
{
6767
phase.raise_objection(this);
6868
for (unsigned int i = 0; i < num_seqs; i++)

tests/tests/uvm-systemc/bugs/bug_184/basic_read_write_memory_management/my_driver.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class my_driver : public uvm::uvm_driver<REQ,RSP>
3434

3535
UVM_COMPONENT_PARAM_UTILS(my_driver<REQ,RSP>);
3636

37-
void run_phase(uvm::uvm_phase& phase)
37+
void run_phase(uvm::uvm_phase& phase) override
3838
{
3939
REQ req;
4040
RSP rsp;

tests/tests/uvm-systemc/bugs/bug_184/basic_read_write_memory_management/sequenceA.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ class sequenceA : public uvm::uvm_sequence<REQ,RSP>
3434

3535
UVM_OBJECT_PARAM_UTILS(sequenceA<REQ,RSP>);
3636

37-
void body()
37+
void body() override
3838
{
3939
std::string prstring;
4040
REQ* req;
41-
RSP* rsp;
41+
RSP* rsp;
4242

4343
UVM_INFO(this->get_name(), "Starting sequence", uvm::UVM_MEDIUM);
4444

tests/tests/uvm-systemc/bugs/bug_61/output_redirection/bus_trans.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ class bus_trans : public uvm::uvm_sequence_item
4444
op = BUS_READ;
4545
}
4646

47-
~bus_trans() {}
47+
~bus_trans() override {}
4848

4949
UVM_OBJECT_UTILS(bus_trans);
5050

51-
virtual void do_copy( const uvm::uvm_object& rhs )
51+
void do_copy( const uvm::uvm_object& rhs ) override
5252
{
5353
const bus_trans* rhs_ = dynamic_cast<const bus_trans*>(&rhs);
5454
if(rhs_ == nullptr)
@@ -61,7 +61,7 @@ class bus_trans : public uvm::uvm_sequence_item
6161
op = rhs_->op;
6262
}
6363

64-
virtual bool do_compare( const uvm::uvm_object& rhs, const uvm::uvm_comparer* comparer )
64+
bool do_compare( const uvm::uvm_object& rhs, const uvm::uvm_comparer* comparer ) const override
6565
{
6666
const bus_trans* rhs_ = dynamic_cast<const bus_trans*>(&rhs);
6767
if(rhs_ == nullptr)
@@ -70,14 +70,14 @@ class bus_trans : public uvm::uvm_sequence_item
7070
return ((op == rhs_->op) && (addr == rhs_->addr) && (data == rhs_->data));
7171
}
7272

73-
void do_print( const uvm::uvm_printer& printer ) const
73+
void do_print( const uvm::uvm_printer& printer ) const override
7474
{
7575
printer.print_string("op", (op ? "BUS_WRITE":"BUS_READ"));
7676
printer.print_field_int("addr", addr);
7777
printer.print_field_int("data", data);
7878
}
7979

80-
std::string convert2string()
80+
std::string convert2string() const override
8181
{
8282
std::ostringstream str;
8383
str << "op " << (op ? "BUS_WRITE":"BUS_READ");
@@ -101,7 +101,7 @@ class bus_req : public bus_trans
101101
{
102102
public:
103103
bus_req( const std::string& name = "bus_req_seq_item" ) : bus_trans(name) {}
104-
~bus_req() {}
104+
~bus_req() override {}
105105

106106
UVM_OBJECT_UTILS(bus_req);
107107

@@ -118,11 +118,11 @@ class bus_rsp : public bus_trans
118118
status = STATUS_NOT_OK;
119119
}
120120

121-
~bus_rsp() {}
121+
~bus_rsp() override {}
122122

123123
UVM_OBJECT_UTILS(bus_rsp);
124124

125-
virtual void do_copy( const uvm::uvm_object& rhs )
125+
void do_copy( const uvm::uvm_object& rhs ) override
126126
{
127127
const bus_rsp* rhs_ = dynamic_cast<const bus_rsp*>(&rhs);
128128
if(rhs_ == nullptr)
@@ -132,7 +132,7 @@ class bus_rsp : public bus_trans
132132
status = rhs_->status;
133133
}
134134

135-
std::string convert2string()
135+
std::string convert2string() const override
136136
{
137137
std::string statusstr;
138138

tests/tests/uvm-systemc/bugs/bug_61/output_redirection/env.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class env: public uvm::uvm_env
4646

4747
env( uvm::uvm_component_name name ) : uvm::uvm_env( name ), sqr(0), drv(0) {}
4848

49-
void build_phase(uvm::uvm_phase& phase)
49+
void build_phase(uvm::uvm_phase& phase) override
5050
{
5151
uvm::uvm_env::build_phase(phase);
5252

@@ -62,12 +62,12 @@ class env: public uvm::uvm_env
6262

6363
}
6464

65-
void connect_phase(uvm::uvm_phase& phase)
65+
void connect_phase(uvm::uvm_phase& phase) override
6666
{
6767
drv->seq_item_port(sqr->seq_item_export);
6868
}
6969

70-
void run_phase(uvm::uvm_phase& phase)
70+
void run_phase(uvm::uvm_phase& phase) override
7171
{
7272
phase.raise_objection(this);
7373
SC_FORK

tests/tests/uvm-systemc/bugs/bug_61/output_redirection/my_driver.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class my_driver : public uvm::uvm_driver<REQ,RSP>
3434

3535
UVM_COMPONENT_PARAM_UTILS(my_driver<REQ,RSP>);
3636

37-
void run_phase(uvm::uvm_phase& phase)
37+
void run_phase(uvm::uvm_phase& phase) override
3838
{
3939
REQ req;
4040
RSP rsp;

0 commit comments

Comments
 (0)