• Home
  • :
  • Community
  • :
  • Forums
  • :
  • Custom IC Design
  • :
  • Declaration, Initialization and shifting real type arrays...

Custom IC Design Forums

Declaration, Initialization and shifting real type arrays in VerilogAMS

RFStuff
RFStuff 1 month 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

  • Reply
  • Cancel
  • Cancel
  • Andrew Beckett
    Andrew Beckett 1 month 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
    • Up 0 Down
    • Reply
    • Cancel
  • RFStuff
    RFStuff 1 month 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
    • Up 0 Down
    • Reply
    • Cancel
  • Andrew Beckett
    Andrew Beckett 1 month 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
    • Up 0 Down
    • Reply
    • Cancel
  • RFStuff
    RFStuff 1 month 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
    • Up 0 Down
    • Reply
    • Cancel
  • Andrew Beckett
    Andrew Beckett 1 month 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
    • Up 0 Down
    • Reply
    • 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.