• 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. Create an array of variables using an array of vdc inst...

Stats

  • Locked Locked
  • Replies 5
  • Subscribers 64
  • Views 19099
  • 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

Create an array of variables using an array of vdc instances

jdimov
jdimov over 4 years ago

in the case of using Schematic editor for creating a testbench and ADE Explorer/Assembler for simulating it,

I was thinking how can I make my simulations easier when I have to check a variety of input signals in bits/buses and avoid instantiating a lot of vdc generators just to generate one bit-word and similar.

I am posting a picture of the idea:

In the picture you can see a 4-bit bus line in<0:3> (the right side), and each bit generated as a single vdc component, and I could have named the dc voltage of each to be a variable (in the picture it isn't) and then those variables would be listed in ADE as design variables. And you would have to label each bit line like in the picture.

What do you do if you have a very big testbench and a lot bigger bus lines?

On the left side I tried instantiating one vdc component by making an array. It is called V5<0:3>, and made a bus called myBus<0:3>, similarly I made an array of gnd components and noConn components and everything checked without errors. What is left is to create an array of design variables.
At this point what would be very neat is to be able to enter vh<0:3> as a design variable for the DC voltage value, as you can see in the bottom left corner in the Property Editor tab of the V5<0:3> generator array.
Then when ADE is opened and you want to import design variable from schematic, you would expect to have variables vh<0>, vh<1> and so on... similarly like when you label a bus net.

Is this possible?

My other solution is to just write a verilogams model I would instantiate with my desired bias signals and then import design parameters from there as variables you pass to a model.

  • Cancel
Parents
  • ShawnLogan
    ShawnLogan over 4 years ago

    Dear jdimov,

    jdimov said:
    At this point what would be very neat is to be able to enter vh<0:3> as a design variable for the DC voltage value, as you can see in the bottom left corner in the Property Editor tab of the V5<0:3> generator array.

    If I understand your question correctly, I made a simple 8 bit veriloga "A/D" converter to create a digital bus whose decimal value is a design variable. Figure 1 shows the instantiation of the 8 bit veriloga symbol. A pulse generator that takes two design values drives the A/D input input and toggles between two decimal values that are converted to their respective 8 bit binary words. You can leave any unused bits of the converter as no connects to create an N bit bus where N<8. You could also drive it with a DC source whose value is set as a single design variable.

    I've included the code for the cell from which you can create a symbol for use in schematics. I hope this provides some insight to you - assuming I correctly understood your question!

    Shawn

    Fiigure 1

    Example if instantiation of 8 bit veriloga based A/D

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • ShawnLogan
    ShawnLogan over 4 years ago in reply to ShawnLogan

    Dear jdimov,

    jdimov said:
    At this point what would be very neat is to be able to enter vh<0:3> as a design variable for the DC voltage value, as you can see in the bottom left corner in the Property Editor tab of the V5<0:3> generator array.

    If I understand your question correctly, I made a simple 8 bit veriloga "A/D" converter to create a digital bus whose decimal value is a design variable. Figure 1 shows the instantiation of the 8 bit veriloga symbol. A pulse generator that takes two design values drives the A/D input input and toggles between two decimal values that are converted to their respective 8 bit binary words. You can leave any unused bits of the converter as no connects to create an N bit bus where N<8. You could also drive it with a DC source whose value is set as a single design variable.

    I've included the code for the cell from which you can create a symbol for use in schematics. I hope this provides some insight to you - assuming I correctly understood your question!

    Shawn

    Fiigure 1

    Example if instantiation of 8 bit veriloga based A/D


    // VerilogA for simple transient compatible eightbit_ad,
    // sml 8/10/2020


    `include "constants.vams"
    `include "disciplines.vams"

    module eightbit_ad(VOUT, VDD, VIN, VSS);
    output [7:0] VOUT;
    electrical [7:0] VOUT;
    input VDD;
    electrical VDD;
    input VIN;
    electrical VIN;
    input VSS;
    electrical VSS;
    integer vin_integer;
    parameter real rise_fall_time = 50e-12;
    integer vout[7:0];

    analog begin

    vin_integer = V(VIN,VSS);

    if (vin_integer%256<128) V(VOUT[7],VSS)<+V(VSS);
    else V(VOUT[7],VSS)<+V(VDD,VSS);
    V(VOUT[7],VSS)<+ transition(V(VDD)*vout[7],rise_fall_time,rise_fall_time);

    if (vin_integer%128<64) V(VOUT[6],VSS)<+V(VSS);
    else V(VOUT[6],VSS)<+V(VDD,VSS);
    V(VOUT[6],VSS)<+ transition(V(VDD)*vout[6],rise_fall_time,rise_fall_time);

    if (vin_integer%64<32) V(VOUT[5],VSS)<+V(VSS);
    else V(VOUT[5],VSS)<+V(VDD,VSS);
    V(VOUT[5],VSS)<+ transition(V(VDD)*vout[5],rise_fall_time,rise_fall_time);

    if (vin_integer%32<16) V(VOUT[4],VSS)<+V(VSS);
    else V(VOUT[4],VSS)<+V(VDD,VSS);
    V(VOUT[4],VSS)<+ transition(V(VDD)*vout[4],rise_fall_time,rise_fall_time);

    if (vin_integer%16<8) V(VOUT[3],VSS)<+V(VSS);
    else V(VOUT[3],VSS)<+V(VDD,VSS);
    V(VOUT[3],VSS)<+ transition(V(VDD)*vout[3],rise_fall_time,rise_fall_time);

    if (vin_integer%8<4) V(VOUT[2],VSS)<+V(VSS);
    else V(VOUT[2],VSS)<+V(VDD,VSS);
    V(VOUT[2],VSS)<+ transition(V(VDD)*vout[2],rise_fall_time,rise_fall_time);

    if (vin_integer%4<2) vout[1]=0;
    else vout[1]=1;
    V(VOUT[1],VSS)<+ transition(V(VDD)*vout[1],rise_fall_time,rise_fall_time);

    if (vin_integer%2<1) vout[0]=0;
    else vout[0]=1;
    V(VOUT[0],VSS)<+ transition(V(VDD)*vout[0],rise_fall_time,rise_fall_time);

    end

    endmodule

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • jdimov
    jdimov over 4 years ago in reply to ShawnLogan

    Hi ShawnLogan and thanks for a detailed reply. I think I understood your ADC but I am not it corresponds to my question so I'll try to explain it more.

    My question is more discussion based.

    For a scenario in which you have a top-level chip to test and it has both analog and digital inputs, various, and let's say all in all you have to create 40 input signals and many are buses with bits you need to change from test to test. And you will be using ADE to create your testbench schematic. (and don't limit yourself to transient simulation only, you use these for dc simulations too)

    What would be your approach to creating the 40 signals? (in ADE)

    Through my experience there were times I would create those 40 vdc (or some vbit, vpulse) generators by hand, then go into labeling them...
    My other approach was to create a verilogams module with simple output structure with what I needed and then instantiate that cellview with its symbol, etc. .... but this was not favorable with other team members for example. Many preferred to see the generators for different reasons.

    Thinking about ways to make the process of creating this kind of testbench quicker I was hoping (for cases where you need to input bus/vector signals) to instantiate an array of vdc generators (the left side of my picture) like V5<0:3> and hoped that if I enter a design variable for DC voltage value like "vh<0:3>" that it would create 4 different design variables in ADE. It didn't. I don't know if that is even possible or not. If it's possible maybe I'm not doing it right then...?

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

    A couple of other ideas:

    1. Use the "bussetp" component I created from this article: Creating a component that allows setting a value on a bus in an analog simulation
    2. Use a vector file (Setup->Simulation Files in ADE) to allow you to create stimulus based on a vector file input. That tends to be more useful if you want time-varying values rather than static values.

    Andrew

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

    A couple of other ideas:

    1. Use the "bussetp" component I created from this article: Creating a component that allows setting a value on a bus in an analog simulation
    2. Use a vector file (Setup->Simulation Files in ADE) to allow you to create stimulus based on a vector file input. That tends to be more useful if you want time-varying values rather than static values.

    Andrew

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

    Hi Andrey,

    The bussetp component is really helpful!

    I never used vector files. I found some documentation about it so I'll have to look into it a bit more.

    Thanks

    • 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