ljepson74 Posted August 13, 2015 Report Posted August 13, 2015 How do I display the name string of the UVM_VERBOSITY? I have been using this to report the verbosity level, but it returns an int. m_rh.get_verbosity_level() How would you display the enumerated name as opposed to the enumerated value? I'm looking at section "6.19 Enumerations" of the LRM (1800-2012.pdf) and close, but not there yet, so I punt this question out into the ether. .name() seems like it should be in there somewhere. Quote
tudor.timi Posted August 13, 2015 Report Posted August 13, 2015 You can use enum_var.name() to return a string of the literal stored in enum_val (section 6.19.5.6 of the LRM). Quote
apfitch Posted August 13, 2015 Report Posted August 13, 2015 Just as an aside, you can also use the %p formatter to display enumerated types (and pretty well anything else), e.g. $display("Verbosity is %p", m_rh.get_verbosity_level() ); The disadvantage of %p compared to Tudor's string is that %p tends to print things out more verbosely (ironic in this case!) regards Alan P.S. You might have to cast m_rh to the type of the verbosity level in that context. tudor.timi 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.