Jump to content

puneet

Members
  • Content Count

    4
  • Joined

  • Last visited

  1. @tudor C++ const does not propagate across pointer boundaries. I was just referring to that simple and well known fact.
  2. @kirloy I updated my Edaplayground example to demonstrate that const does not either make the immediate object immutable.
  3. @kirloy if you notice, what @tudor demonstrated is hierarchical immutability (const is getting propagated to sub-objects as well) which is not even possible with C++ as pointed out by @apfitch-- though some modern programming languages are known to provide that feature. Though it would indeed be great to have such a feature in systemverilog, unfortunately @tudor's example only demonstrates a tool bug -- considering that this slightly modified code example that I created is breaking the illusionary immutability. Take a look: http://www.edaplayground.com/x/8YD
  4. Not quite. The example in 13.5.2 applies only to arrays. Arrays in SV are value objects (do not exhibit pointer-semantics as in C/C++). So when we make an array const, the const applies to array members as well. 13.5.2 has to be read along with section 6.20.6 which states: So, clearly const does not propagate to the object members. The example you provided on EDA Playground seems like a tool bug. The example compiles and runs fine when we select modelsim 10.1d on EDA Playground. BTW, what the OP posted is a long standing issue http://verificationguild.com/modules.php?name=Forums&file=viewtopic&t=1490
×
×
  • Create New...