Skip to content

Update src and examples to use override keyword #324

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 3 additions & 3 deletions examples/uvmsc/integrated/apb/inc/apb_agent.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ class apb_agent : public uvm::uvm_agent
UVM_COMPONENT_UTILS(apb_agent);

apb_agent(uvm::uvm_component_name name);
~apb_agent();
~apb_agent() override;

virtual void build_phase(uvm::uvm_phase& phase);
void build_phase(uvm::uvm_phase& phase) override;

virtual void connect_phase(uvm::uvm_phase& phase);
void connect_phase(uvm::uvm_phase& phase) override;

};

Expand Down
1 change: 1 addition & 0 deletions examples/uvmsc/integrated/apb/inc/apb_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

#include <systemc>
#include <uvm>
#include "integrated/apb/inc/apb_if.h"

class apb_config : public uvm::uvm_object
{
Expand Down
4 changes: 2 additions & 2 deletions examples/uvmsc/integrated/apb/inc/apb_master.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ class apb_master : public uvm::uvm_driver<apb_rw>

apb_master(uvm::uvm_component_name name);

virtual void build_phase(uvm::uvm_phase & phase);
void build_phase(uvm::uvm_phase & phase) override;

virtual void run_phase(uvm::uvm_phase & phase);
void run_phase(uvm::uvm_phase & phase) override;

private:
void read(const sc_dt::sc_lv<32> & addr, sc_dt::sc_lv<32> & data);
Expand Down
4 changes: 2 additions & 2 deletions examples/uvmsc/integrated/apb/inc/apb_monitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ class apb_monitor : public uvm::uvm_monitor

apb_monitor(uvm::uvm_component_name name);

virtual void build_phase(uvm::uvm_phase & phase);
void build_phase(uvm::uvm_phase & phase) override;

virtual void run_phase(uvm::uvm_phase & phase);
void run_phase(uvm::uvm_phase & phase) override;
};

#endif /* APB_MONITOR_H_ */
12 changes: 6 additions & 6 deletions examples/uvmsc/integrated/apb/inc/apb_rw.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ class apb_rw : public uvm::uvm_sequence_item {
apb_rw(const std::string & name = "apb_rw") :
uvm::uvm_sequence_item(name) {}

virtual void do_print(const uvm::uvm_printer& printer) const;
virtual void do_pack(uvm::uvm_packer& p) const;
virtual void do_unpack(uvm::uvm_packer& p);
virtual void do_copy(const uvm::uvm_object& rhs);
virtual bool do_compare(const uvm_object& rhs, const uvm::uvm_comparer* comparer = nullptr) const;
std::string convert2string() const;
void do_print(const uvm::uvm_printer& printer) const override;
void do_pack(uvm::uvm_packer& p) const override;
void do_unpack(uvm::uvm_packer& p) override;
void do_copy(const uvm::uvm_object& rhs) override;
bool do_compare(const uvm_object& rhs, const uvm::uvm_comparer* comparer = nullptr) const override;
std::string convert2string() const override;
};

#endif /* APB_RW_ */
4 changes: 2 additions & 2 deletions examples/uvmsc/integrated/apb/inc/reg2apb_adapter.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ class reg2apb_adapter : public uvm::uvm_reg_adapter
reg2apb_adapter(const std::string & name = "reg2apb_adapter") :
uvm::uvm_reg_adapter(name) {}

virtual uvm::uvm_sequence_item* reg2bus(const uvm::uvm_reg_bus_op &);
uvm::uvm_sequence_item* reg2bus(const uvm::uvm_reg_bus_op &) override;

virtual void bus2reg(const uvm::uvm_sequence_item *, uvm::uvm_reg_bus_op &);
void bus2reg(const uvm::uvm_sequence_item *, uvm::uvm_reg_bus_op &) override;
};

#endif /* REG2APB_ADAPTER_H_ */
24 changes: 12 additions & 12 deletions examples/uvmsc/integrated/ubus/test_lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class ubus_example_base_test : public uvm::uvm_test
test_pass = true;
}

virtual void build_phase(uvm::uvm_phase& phase)
void build_phase(uvm::uvm_phase& phase) override
{
uvm::uvm_test::build_phase(phase);

Expand All @@ -64,7 +64,7 @@ class ubus_example_base_test : public uvm::uvm_test
printer->knobs.depth = 3;
}

void end_of_elaboration_phase(uvm::uvm_phase& phase)
void end_of_elaboration_phase(uvm::uvm_phase& phase) override
{
// Set verbosity for the bus monitor for this demo
if(ubus_example_tb0->ubus0->bus_monitor != nullptr)
Expand All @@ -74,20 +74,20 @@ class ubus_example_base_test : public uvm::uvm_test
this->sprint(printer), uvm::UVM_LOW);
}

void run_phase(uvm::uvm_phase& phase)
void run_phase(uvm::uvm_phase& phase) override
{
//set a drain-time for the environment if desired
sc_core::sc_time drain_time = sc_core::sc_time(50.0, sc_core::SC_NS);
phase.get_objection()->set_drain_time(this, drain_time);
}

void extract_phase(uvm::uvm_phase& phase)
void extract_phase(uvm::uvm_phase& phase) override
{
if(ubus_example_tb0->scoreboard0->sbd_error)
test_pass = false;
}

void report_phase(uvm::uvm_phase& phase)
void report_phase(uvm::uvm_phase& phase) override
{
if(test_pass)
{
Expand All @@ -99,7 +99,7 @@ class ubus_example_base_test : public uvm::uvm_test
}
}

void final_phase(uvm::uvm_phase& phase)
void final_phase(uvm::uvm_phase& phase) override
{
delete printer;
}
Expand All @@ -118,7 +118,7 @@ class test_read_modify_write : public ubus_example_base_test
: ubus_example_base_test(name)
{}

virtual void build_phase(uvm::uvm_phase& phase)
void build_phase(uvm::uvm_phase& phase) override
{
uvm::uvm_config_db<uvm::uvm_object_wrapper*>::set(this,
"ubus_example_tb0.ubus0.masters[0].sequencer.run_phase",
Expand All @@ -144,7 +144,7 @@ class test_r8_w8_r4_w4 : public ubus_example_base_test
: ubus_example_base_test(name)
{}

virtual void build_phase(uvm::uvm_phase& phase)
void build_phase(uvm::uvm_phase& phase) override
{
ubus_example_base_test::build_phase(phase);

Expand All @@ -170,7 +170,7 @@ class test_2m_4s : public ubus_example_base_test
: ubus_example_base_test(name)
{}

virtual void build_phase(uvm::uvm_phase& phase)
void build_phase(uvm::uvm_phase& phase) override
{
// Overides to the ubus_example_tb build_phase()
// Set the topology to 2 masters, 4 slaves
Expand Down Expand Up @@ -212,7 +212,7 @@ class test_2m_4s : public ubus_example_base_test
ubus_example_base_test::build_phase(phase);
}

void connect_phase(uvm::uvm_phase& phase)
void connect_phase(uvm::uvm_phase& phase) override
{
// Connect other slaves monitor to scoreboard
ubus_example_tb0->ubus0->slaves[1]->monitor->item_collected_port.connect(
Expand All @@ -225,7 +225,7 @@ class test_2m_4s : public ubus_example_base_test
ubus_example_tb0->scoreboard0->item_collected_export);
}

void end_of_elaboration_phase(uvm::uvm_phase& phase)
void end_of_elaboration_phase(uvm::uvm_phase& phase) override
{
// Set up slave address map for ubus0 (slaves[0] is overwritten here)
ubus_example_tb0->ubus0->set_slave_address_map("slaves[0]", 0x0000, 0x3fff);
Expand All @@ -236,7 +236,7 @@ class test_2m_4s : public ubus_example_base_test
ubus_example_base_test::end_of_elaboration_phase(phase);
}

virtual void final_phase(uvm::uvm_phase& phase)
void final_phase(uvm::uvm_phase& phase) override
{
loop_read_modify_write_seq::type_id::destroy(lrmw_seq); // clean-up
}
Expand Down
12 changes: 6 additions & 6 deletions examples/uvmsc/integrated/ubus/ubus_example_master_seq_lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class incr_read_byte_seq : public ubus_base_sequence
constraint transmit_del_ct { (incr_transmit_del <= 10); }
*/

virtual void body()
void body() override
{
std::ostringstream str;
str << get_sequence_path()
Expand Down Expand Up @@ -109,7 +109,7 @@ class incr_write_byte_seq : public ubus_base_sequence
constraint transmit_del_ct { (incr_transmit_del <= 10); }
*/

virtual void body()
void body() override
{
std::ostringstream str;
str << get_sequence_path()
Expand Down Expand Up @@ -149,7 +149,7 @@ class incr_read_write_read_seq : public ubus_base_sequence
incr_read_byte_seq* read0;
incr_write_byte_seq* write0;

virtual void body()
void body() override
{
std::ostringstream str;
str << get_sequence_path()
Expand Down Expand Up @@ -186,7 +186,7 @@ class r8_w8_r4_w4_seq : public ubus_base_sequence

//constraint start_address_ct { (start_address == 16'h4000); }

virtual void body()
void body() override
{
std::ostringstream str;
str << get_sequence_path()
Expand Down Expand Up @@ -239,7 +239,7 @@ class read_modify_write_seq : public ubus_base_sequence
/* rand */ sc_dt::sc_uint<16> addr_check;
sc_dt::sc_uint<8> m_data0_check;

virtual void body()
void body() override
{
std::ostringstream str;
str << get_sequence_path()
Expand Down Expand Up @@ -320,7 +320,7 @@ class loop_read_modify_write_seq : public ubus_base_sequence

read_modify_write_seq* rmw_seq;

virtual void body()
void body() override
{
uvm::uvm_config_db<int>::get(nullptr, get_full_name(), "itr", itr);

Expand Down
2 changes: 1 addition & 1 deletion examples/uvmsc/integrated/ubus/ubus_example_scoreboard.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class ubus_example_scoreboard : public uvm::uvm_scoreboard
virtual void write(const ubus_transfer& trans);

// report_phase
virtual void report_phase(uvm::uvm_phase& phase);
void report_phase(uvm::uvm_phase& phase) override;

int sbd_error;

Expand Down
6 changes: 3 additions & 3 deletions examples/uvmsc/integrated/ubus/ubus_example_tb.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class ubus_example_tb : public uvm::uvm_env
{}

// build_phase
virtual void build_phase(uvm::uvm_phase& phase)
void build_phase(uvm::uvm_phase& phase) override
{
uvm::uvm_env::build_phase(phase);

Expand All @@ -74,14 +74,14 @@ class ubus_example_tb : public uvm::uvm_env
assert(scoreboard0);
}

void connect_phase(uvm::uvm_phase& phase)
void connect_phase(uvm::uvm_phase& phase) override
{
// Connect slave0 monitor to scoreboard
ubus0->slaves[0]->monitor->item_collected_port.connect(
scoreboard0->item_collected_export);
}

void end_of_elaboration_phase(uvm::uvm_phase& phase)
void end_of_elaboration_phase(uvm::uvm_phase& phase) override
{
// Set up slave address map for ubus0 (basic default)
ubus0->set_slave_address_map("slaves[0]", 0, 0xffff);
Expand Down
10 changes: 5 additions & 5 deletions examples/uvmsc/integrated/ubus/vip/slave_address_map_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ class slave_address_map_info : public uvm::uvm_object
}

// added mandatory field functions
virtual void do_print(const uvm::uvm_printer& printer) const
void do_print(const uvm::uvm_printer& printer) const override
{
printer.print_field_int("min_addr", min_addr);
printer.print_field_int("max_addr", max_addr);
}

virtual void do_copy( const uvm::uvm_object& rhs )
void do_copy( const uvm::uvm_object& rhs ) override
{
const slave_address_map_info* rhs_ =
dynamic_cast<const slave_address_map_info*>(&rhs);
Expand All @@ -83,8 +83,8 @@ class slave_address_map_info : public uvm::uvm_object
max_addr = rhs_->max_addr;
}

virtual bool do_compare(const uvm::uvm_object& rhs,
const uvm::uvm_comparer* comparer ) const
bool do_compare(const uvm::uvm_object& rhs,
const uvm::uvm_comparer* comparer ) const override
{
const slave_address_map_info* rhs_ =
dynamic_cast<const slave_address_map_info*>(&rhs);
Expand All @@ -96,7 +96,7 @@ class slave_address_map_info : public uvm::uvm_object
&& (max_addr == rhs_->max_addr));
}

std::string convert2string() const
std::string convert2string() const override
{
std::ostringstream str;
str << "min_addr=" << min_addr
Expand Down
8 changes: 4 additions & 4 deletions examples/uvmsc/integrated/ubus/vip/ubus_bus_monitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ class ubus_bus_monitor : public uvm::uvm_monitor

ubus_bus_monitor(uvm::uvm_component_name name);
void set_slave_configs(std::string slave_name, unsigned int min_addr, unsigned int max_addr);
void build_phase(uvm::uvm_phase& phase);
void run_phase(uvm::uvm_phase& phase);
void build_phase(uvm::uvm_phase& phase) override;
void run_phase(uvm::uvm_phase& phase) override;
void observe_reset();
void check_reset_on_posedge();
void check_reset_on_negedge();
Expand All @@ -112,8 +112,8 @@ class ubus_bus_monitor : public uvm::uvm_monitor

// The following two bits are used to control whether checks and coverage are
// done both in the bus monitor class and the interface.
bool checks_enable; // default true
bool coverage_enable; // default true
bool checks_enable {false}; // default true in SV example, currently not available in UVM SystemC
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add TODO or FIXME labels?

bool coverage_enable {false}; // default true in SV example, currently not available in UVM SystemC

// The state of the ubus
ubus_status status;
Expand Down
4 changes: 2 additions & 2 deletions examples/uvmsc/integrated/ubus/vip/ubus_env.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ class ubus_env : public uvm::uvm_env

ubus_env(uvm::uvm_component_name name);

void build_phase(uvm::uvm_phase& phase);
void build_phase(uvm::uvm_phase& phase) override;

void set_slave_address_map( std::string slave_name, int min_addr, int max_addr);
void run_phase(uvm::uvm_phase& phase);
void run_phase(uvm::uvm_phase& phase) override;

protected:

Expand Down
4 changes: 2 additions & 2 deletions examples/uvmsc/integrated/ubus/vip/ubus_master_agent.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ class ubus_master_agent : public uvm::uvm_agent

ubus_master_agent(uvm::uvm_component_name name);

void build_phase(uvm::uvm_phase& phase);
void build_phase(uvm::uvm_phase& phase) override;

void connect_phase(uvm::uvm_phase& phase);
void connect_phase(uvm::uvm_phase& phase) override;

protected:
int master_id;
Expand Down
4 changes: 2 additions & 2 deletions examples/uvmsc/integrated/ubus/vip/ubus_master_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ class ubus_master_driver : public uvm::uvm_driver<ubus_transfer>

ubus_master_driver(uvm::uvm_component_name name);

void build_phase(uvm::uvm_phase& phase);
virtual void run_phase(uvm::uvm_phase& phase);
void build_phase(uvm::uvm_phase& phase) override;
void run_phase(uvm::uvm_phase& phase) override;

protected:

Expand Down
6 changes: 3 additions & 3 deletions examples/uvmsc/integrated/ubus/vip/ubus_master_monitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ class ubus_master_monitor : public uvm::uvm_monitor
// constructor
ubus_master_monitor( uvm::uvm_component_name name);

void build_phase(uvm::uvm_phase& phase);
void run_phase(uvm::uvm_phase& phase);
void build_phase(uvm::uvm_phase& phase) override;
void run_phase(uvm::uvm_phase& phase) override;

protected:

Expand All @@ -93,7 +93,7 @@ class ubus_master_monitor : public uvm::uvm_monitor
virtual void check_transfer_size();
virtual void check_transfer_data_size();
virtual void perform_transfer_coverage();
virtual void report_phase(uvm::uvm_phase& phase);
void report_phase(uvm::uvm_phase& phase) override;

// data members
private:
Expand Down
Loading