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

Conversation

voertler
Copy link
Contributor

@voertler voertler commented Mar 5, 2025

This PR implemts #289 for src, examples and tests

@voertler
Copy link
Contributor Author

voertler commented Mar 5, 2025

@voertler This needs to be rebased on the current master

@voertler
Copy link
Contributor Author

@barnasc PR has been rebased so that it can be merged

@barnasc
Copy link
Contributor

barnasc commented Mar 10, 2025

I reviewed the PR and have some questions/remarks:

  • It seems override is also used for member functions examples where a component is actually considered the only (and final) implementation, so I would expect 'final in such case and not override.
  • There seems some controversy about adding override to destructors. What is our strategy here?
  • some nullptr arguments are unintentially replaced by NULL?
  • in some cases we remove the virtual keyword and now the indentation of arguments is not aligned anymore
  • some other comments in-line

Copy link
Contributor

@barnasc barnasc left a comment

Choose a reason for hiding this comment

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

see comments above

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::uvm_object& rhs, const uvm::uvm_comparer* comparer = nullptr ) const override;
Copy link
Contributor

Choose a reason for hiding this comment

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

I see we changed the signature of do_compare, where a second argument has been added to specify the comparer. Is this really required? Can we specify the comparer not in a different way?

uvm::uvm_reg_data_t previous,
uvm::uvm_reg_data_t& value,
uvm::uvm_reg_data_t value,
Copy link
Contributor

Choose a reason for hiding this comment

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

We need to check this, I would expect value can change, in this method (in UVM-SV this is an inout type, so we might need to keep it as pass-by-reference. We also need to check the LRM

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is discussed #331

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This should be a reference not a copy

@@ -32,7 +32,7 @@ class test : public uvm_test
test( uvm_component_name name ) : uvm_test(name)
{}

virtual void report_phase( uvm_phase& phase )
void report_phase( uvm_phase& phase ) override
Copy link
Contributor

Choose a reason for hiding this comment

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

remove empty space at front

@@ -25,11 +25,12 @@

#ifndef UVM_COMPONENT_REGISTRY_H_
#define UVM_COMPONENT_REGISTRY_H_

Copy link
Contributor

Choose a reason for hiding this comment

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

remove whitespaces

@@ -21,6 +21,8 @@
#define UVM_COPY_MAP_H_

//////////////
#include <map>
#include "uvmsc/base/uvm_object.h"
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need an include here or is a forward declaration not sufficient?

#include "uvmsc/misc/uvm_status_container.h"
#include "uvmsc/misc/uvm_copy_map.h"

#include "uvmsc/base/uvm_object.h"
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need an include here or is a forward declaration enough?

uvm_object* clone() override;
void do_copy( const uvm_object& rhs ) override;
bool do_compare( const uvm_object& rhs,
const uvm_comparer* comparer ) const override;
Copy link
Contributor

Choose a reason for hiding this comment

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

fix indentation

@voertler
Copy link
Contributor Author

voertler commented Mar 19, 2025

VWG:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants