• 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. Declaration, Initialization and shifting real type arrays...

Stats

  • Locked Locked
  • Replies 5
  • Subscribers 125
  • Views 14285
  • 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

Declaration, Initialization and shifting real type arrays in VerilogAMS

RFStuff
RFStuff over 4 years ago

Dear All,

I am trying to declare a real type array like:- real arr[4:0]={1,2,3,0}

Also, I tried to shift the array as arr[4:0]={arr[4:3],1.5}.

Both gives me error in verilogAMS. How we can achieve the above ? what is the right syntax to do ?

Kind Regards

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 4 years ago

    This is (as far as I know) not possible as part of the Verilog-AMS LRM. It is possible with SystemVerilog (albeit your examples have the wrong width - they are 5 bits wide and the top has 4 literal values; the bottom example syntax is slightly wrong even with SystemVerilog):

    real arr[3:0]={1,2,3,0};

    initial begin
      arr={arr[3:2],1.5,2.0};
      $strobe(arr[3]," ",arr[2]," ",arr[1]," ",arr[0]);
    end

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • RFStuff
    RFStuff over 4 years ago in reply to Andrew Beckett

    Thanks Andrew.

    well, I will write in SV. However, I would like to use also $table_model(), for reading data from a file and assigning it to the array.

    Is there any equivalent of $table_model in SV ?

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 4 years ago in reply to RFStuff

    You can use $table_model in Cadence SystemVerilog simulators (both the old INCISIVE and XCELIUM) by passing -rnm_tech to the irun/xrun command line. See this article.

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • RFStuff
    RFStuff over 4 years ago in reply to Andrew Beckett

    Dear Andrew,

    Thanks a lot. But, is it possible to add -rnm_tech option while firing the AMS simulation from ADE instead by the command "unix%  xrun filename.sv -rnm_tech".

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 4 years ago in reply to RFStuff

    Yes. On Simulation->Options->AMS Simulator, on the Main tab, go to the bottom, and then there's the "Additional Arguments" button. On the form that then appears, add an additional xrun argument of -rnm_tech - that should do it.

    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