• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Custom IC Design
  3. Hierarchical member access in VerilogA

Stats

  • Locked Locked
  • Replies 6
  • Subscribers 125
  • Views 16345
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Hierarchical member access in VerilogA

DimitarT
DimitarT over 5 years ago

Hi,

 

I need to access a variable of instance from within the parent module in VerilogA. Something like this:

module child;

      integer child_int;
// some code
//....

endmodule

module parent;

     child my_child;

analog begin
      @(initial_step)
           $display(“Child_int value : %d”, my_child.child_int);
end     

endmodule      

 

This example results in the following error during extraction:

Error found by spectre during AHDL compile.

    ERROR (VACOMP-2162): "$display("Child_int value %s", my_child.child_int<<--?

        ); "

        "/home/……./projects/……/veriloga/veriloga.va",

        line 124: Encountered a hierarchical name that is either incomplete or

        unsupported. Specify the hierarchical name as :

        [ instance_name{.instance_name}.]HDL_Instance_name

 

Searching through the Cadence VerilogA LRM doesn’t really give any hint. So what am I missing?

Thanks and best regards,

Dimitar

  • Cancel
Parents
  • DimitarT
    DimitarT over 5 years ago

    Hi,

    shortly after posting this question I noticed that in the Cadence VerilogA LRM it is explicitly mentioned that "Named nodes in hierarchical instantiation" are not supported.

    Better late than even later Slight smile

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 5 years ago in reply to DimitarT

    Actually, I don't think that's what this limitation is talking about (not sure I could find the precise reference you mention anyway).

    However, you can achieve the same thing for variable access using the $cds_get_analog_value function (or $cgav for short):

    $display("Child_int value : %g", $cgav("my_child.child_int"));

    Note that this returns the value as a float even though it's an integer inside, but this does work...

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • DimitarT
    DimitarT over 5 years ago in reply to Andrew Beckett

    Actually I cited from VerilogA LRM version 6.1 from 2006, p.491. 

    Thanks for the suggestion with $cgav(), it works in my setup!

    Best regards,

    Dimitar

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • DimitarT
    DimitarT over 5 years ago in reply to Andrew Beckett

    Actually I cited from VerilogA LRM version 6.1 from 2006, p.491. 

    Thanks for the suggestion with $cgav(), it works in my setup!

    Best regards,

    Dimitar

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
  • Andrew Beckett
    Andrew Beckett over 5 years ago in reply to DimitarT

    Hi Dimitar,

    I'm not sure why you'd use such an ancient version of the VerilogA reference manual. There have been 14 major releases since then. I did find some copies on the internet (which are breaking copyright by publishing) so maybe that's why you're looking at an old manual rather than the one in your installation... (I hope you're not using MMSIM6.1!)

    Anyway, glad $cgav works (I'm sure you're not using a 14-year old software version because of that!)

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • DimitarT
    DimitarT over 5 years ago in reply to Andrew Beckett

    Hi Andrew,

    strangely enough, this 2006' LRM is the first web search result I get :) Apologies for the confusion.

    But yes, I forgot to mention I used IC 6.1.8/ spectre18.10/mmsim15.10.

    Thanks for the help!

    -

    Dimitar

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 5 years ago in reply to DimitarT

    Thanks Dimitar - I found that University re-published document too. Our documentation is not supposed to be re-published by anyone for two reasons:

    1. It's Cadence's copyright and so they are not allowed to publish it (page 2 of most of our manuals say this, including this one).
    2. It tends to lead to people consulting out of date information (as you were doing - in current versions the Named nodes in hierarchical instantiation is no longer in that section of the documentation; anyway, what you are doing here is not a hierarchical instantiation so whatever that is referring to is not relevant here). I think it's the next bullet point, Hierarchical names except for node.potential.abstol, although that is rather vague because hierarchical node names in the V() function do work for hierarchical node names. So it's not terribly well worded.

    Anyway, thanks for the pointer. I'd suggest you run (in the terminal):

    `spectre_root`/bin/cdnshelp

    Or look at the doc directory under the location that "spectre_root" returns, and then at veriaref/veriaref.pdf which gives you the current version. BTW, having both SPECTRE and MMSIM in your path makes no sense sense SPECTRE is just the newer name for the release and SPECTRE18.10 is a 3-year newer version than MMSIM15.10

    Regards,

     Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information