Skip to content
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

Static races in static const declarations #6

Closed
jrefice opened this issue Feb 22, 2024 · 0 comments
Closed

Static races in static const declarations #6

jrefice opened this issue Feb 22, 2024 · 0 comments

Comments

@jrefice
Copy link
Contributor

jrefice commented Feb 22, 2024

Copied from Mantis 8376:

Hi Everyone

Want to bring to a notice and we should fix following race condition.

Inside uvm_cmd_line_report.svh

there is a race between two declarations with init. there is a group of classes in the new uvm uvmcmdline* that all follow the same 'broken' pattern. there is a 'static const xx ' class member with initialisation. the idea is to make a local const BUT the assignment is not guaranteed to have executed before it is used. we tried a change from 'static const' to 'localparam'

35: //static const string prefix = "+UVM_VERBOSITY=";

Change :
localparam string prefix = "+UVM_VERBOSITY=";

Thanks and Regards
Shobhit Kapoor

Noting that this pattern repeats in a few places:

src/base/uvm_cmdline_report.svh:46:  static const string prefix = "+UVM_VERBOSITY=";
src/base/uvm_cmdline_report.svh:183:  static const string prefix = "+uvm_set_verbosity="; 
src/base/uvm_cmdline_report.svh:379:  static const string prefix="+uvm_set_action=";
src/base/uvm_cmdline_report.svh:509:  static const string prefix="+uvm_set_severity=";
src/base/uvm_spell_chkr.svh:42:  static const int unsigned max = '1;

src/base/uvm_report_catcher.svh:90:  const static int DO_NOT_CATCH      = 1; 
src/base/uvm_report_catcher.svh:91:  const static int DO_NOT_MODIFY     = 2; 
src/comps/uvm_random_stimulus.svh:59:  const static string type_name = "uvm_random_stimulus #(T)";
src/deprecated/macros/uvm_object_defines.svh:506://| const static string type_name = TNAME_STRING;
src/deprecated/macros/uvm_object_defines.svh:516:     const static string type_name = TNAME_STRING; \
jrefice added a commit to jrefice/uvm-core-official that referenced this issue May 9, 2024
@jrefice jrefice added this to the Post-2020.3.0 updates milestone May 9, 2024
jrefice added a commit to jrefice/uvm-core-official that referenced this issue May 9, 2024


Signed-off-by: Justin Refice <jrefice@nvidia.com>
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

No branches or pull requests

2 participants