• 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. Mixed-Signal Design
  3. table_model multi-column data file

Stats

  • Locked Locked
  • Replies 3
  • Subscribers 64
  • Views 16501
  • 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

table_model multi-column data file

olalivier
olalivier over 7 years ago

Hi there, 

I try to write a model using table model, verilog-ams with wreal.

The file I want to use is a multi-column file with one x column (left most col) and several y columns. I would like to use this file and plot independantly all the y columns 

vy1  = $table_model(vx, "../data/text.txt","I,1L");
vy2 = $table_model(vx, "../data/text.txt","I,I,1L");
vy3 = $table_model(vx, "../data/text.txt","I,I,I,1L");

and so on. My table looks like this

IPRB1 X IPRB1 Y IPRB2 X IPRB2 Y IPRB4 X IPRB4 Y IPRB3 X IPRB3 Y
0.000000000000000E+00 3.162096725343170E-11 0.000000000000000E+00 3.162096725343160E-11 0.000000000000000E+00 3.170924885575280E-11 0.000000000000000E+00 3.170924903331000E-11
4.800000000000000E-08 4.828014646421500E-09 4.800000000000000E-08 4.828014646421500E-09 4.800000000000000E-08 4.828078816122020E-09 4.800000000000000E-08 4.828078816124640E-09
9.600000000000000E-08 9.640872049559960E-09 9.600000000000000E-08 9.640872049544430E-09 9.600000000000000E-08 9.640903627434960E-09 9.600000000000000E-08 9.640903627403870E-09
1.440000000000000E-07 1.445212538412270E-08 1.440000000000000E-07 1.445212538412190E-08 1.440000000000000E-07 1.445213629970190E-08 1.440000000000000E-07 1.445213629971590E-08
1.920000000000000E-07 1.926229797216590E-08 1.920000000000000E-07 1.926229797215260E-08 1.920000000000000E-07 1.926229309238320E-08 1.920000000000000E-07 1.926229309242870E-08
2.400000000000000E-07 2.407161292687310E-08 2.400000000000000E-07 2.407161292686580E-08 2.400000000000000E-07 2.407159507634300E-08 2.400000000000000E-07 2.407159507636590E-08
2.880000000000000E-07 2.888025477141720E-08 2.880000000000000E-07 2.888025477140600E-08 2.880000000000000E-07 2.888022570966160E-08 2.880000000000000E-07 2.888022570964910E-08
3.360000000000000E-07 3.368832800711010E-08 3.360000000000000E-07 3.368832800710330E-08 3.360000000000000E-07 3.368828898044660E-08 3.360000000000000E-07 3.368828898046150E-08
3.840000000000000E-07 3.849590980009490E-08 3.840000000000000E-07 3.849590980009320E-08 3.840000000000000E-07 3.849586174022050E-08 3.840000000000000E-07 3.849586174022720E-08
4.320000000000000E-07 4.330305901536250E-08 4.320000000000000E-07 4.330305901536050E-08 4.320000000000000E-07 4.330300264738480E-08 4.320000000000000E-07 4.330300264739470E-08

...

Is it possible to do so ??

thank you very much for your help.

Olivier
  • Cancel
  • Andrew Beckett
    Andrew Beckett over 7 years ago

    Hi Olivier,

    This got put into moderation because the system saw the repeated text and assumed it was spam. I moved it out of moderation, and then moved it to this forum instead as it's more appropriate for mixed-signal modelling.

    I think what  you want is:

    vy1=$table_model(vx,"forum48.txt","1L;1");
    vy2=$table_model(vx,"forum48.txt","I,I,1L;1");
    vy3=$table_model(vx,"forum48.txt","I,I,I,I,1L;1");

    In the first case, you want the left most column as the independent variable, and then the next column after that as the dependent variable (the output). That's the ;1 bit which tells it that the first of the remaining columns is the dependent variable. For the subsequent outputs, you always want to ignore a pair of columns, and then use the odd columns as the independent variable, with the column straight after that as being the dependent variable.

    I tweaked the numbers in  your table just so I could test that it was behaving as I was expecting - seems to work OK this way (if I've understood your requirement). Of course, I'm expecting that vx is the independent variable you're trying to look up in the table. Here's what I used for testing:

    `include "disciplines.vams"
    module forum48(op,ip);
    output op;
    input ip;
    electrical op,ip;

    real vx,vy1,vy2,vy3;
    analog begin
      vx=V(ip);
      vy1=$table_model(vx,"forum48.txt","1L;1");
      vy2=$table_model(vx,"forum48.txt","I,I,1L;1");
      vy3=$table_model(vx,"forum48.txt","I,I,I,I,1L;1");
      V(op) <+ vy1;
    end

    endmodule

    and then the netlist (I just tested with the above as a VerilogA model in forum48.va) with the netlist below as forum48.scs:

    //

    vramp (ramp 0) vsource type=pulse rise=1u val0=0 val1=3e-7
    I1 (meas ramp) forum48

    ahdl_include "forum48.va"

    myopts options saveahdlvars=all
    tran tran stop=1u

    Regards,

    Andrew.

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • olalivier
    olalivier over 7 years ago in reply to Andrew Beckett

    Dear Andrew,

    thank you very much for your answer. It works perfectly.

    If I may, I'd like to ask you another question related to table_model. Do you know what is the algorithm behind this function ? I would like to know if the table model loads the entire table once or if it access the file everytime I ask for it ? I ask this because my simulation time is quite long compared to transistor level (spectre) simulation... The design is small, around 30 transistors (65nm). schematic level takes around 200ms, verilog-wreal with table 4s...

    thank you for your answer.

    OL

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 7 years ago in reply to olalivier

    I don't know, is the simple answer. I suspect it's not read at each time point and is smarter than that (even if it was, I suspect it wouldn't have such a big impact). More likely it's some convergence challenge caused by your model - I can't really say though.

    This is something that would be best handled through customer support so that it can be investigated more closely.

    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