calculating a config word during operating point analysis

Discussion in 'Cadence' started by Svenn Are Bjerkem, Oct 19, 2005.

  1. Hi,

    I have been trying to get the following problem solved using SpectreHDL
    (but also reading in the Verilog-A manual):

    How can I generate a config word during the dc operating point analysis
    using AHDL or Verilog-A?

    I want to simulate a calibration compensation for temperature and
    process of an internal resistor which varies quite a lot. The resulting
    word is used to switch on and off enough parallell transistors to get
    the approximate value. (Running loads of montecarlo runs on different
    temperatures)

    I have an unclocked successive approximation circuit which manage to
    find a 4-bit word during "dc" simulation, (that is during the "ic" run
    in a transient simulation). This circuitry is quite heavy and it take
    some time to generate that word, but it take even longer time in to find
    the word during transient sim.

    I have studied the manuals to understand that spectre perform one "ic"
    cycle at the beginning to find the initial conditions before going on
    doing transient. I have done something like:

    module nada (anin anref dout) ()
    analog {
    if ($analysis("ic")) {
    while (compare < reference) {
    compare = V(anin);
    reference = V(anref);
    ... convert ii to out[7:0] ...
    ii++;
    }
    }
    V(dout[7]) <- $transition(out[7], ... );
    ....
    V(dout[0]) <- $transition(out[0], ... );
    }

    Beware that there are no variables declared and some lines missing.

    My problem is that everything inside the while() loop is not getting out
    of the code because I do not reach the V(dout..) lines at the bottom.

    A second problem is that the $transition() function seems to stay stuck
    at its initial value and not follow the upcount in the while() loop,
    even if I move the $transition() statements into the while() loop. (I
    can see in the debugger that it steps into the V() assignments without
    anything happening on the output pins.

    I have the fear that it is not possible to use a high level description
    to solve this problem.

    Hope for some help,
     
    Svenn Are Bjerkem, Oct 19, 2005
    #1
  2. Simply because of the warning statements in the manual that $transition
    should not be executed conditionally, and I have always thought that
    while() is a conditional statement.

    I hadn't even thought about moving them inside the when() block and I
    will try to do so, but I would also like to hear why it would be OK to
    ignore the warning
     
    Svenn Are Bjerkem, Oct 27, 2005
    #2
  3. Hi Svenn,

    A quick answer here - don't have the time to try out your code to figure out
    what is going on.

    Anyway, you might want to consider using the "static" analysis instead of "ic",
    since this is the DC that preceeds transient etc.

    And putting transient inside any conditional is a bad move. It needs to be
    evaluated on every iteration, otherwise you loose the history information about
    the previous state of a signal, and it will do odd things...

    Andrew.
     
    Andrew Beckett, Oct 30, 2005
    #3
  4. In the manual it is stated that during DC the output of a $transition()
    command is the value of the expression. And I guess that this value is
    static.
    To get my understanding right:
    If I disable the dc point calculation in the option form for transient
    simulation, then "static" will not be run? (Not that I do, but there are
    so many possible DC simulations out there ...)

    Yes, this is more than clearly stated in the manual and I try to violate
    this only when finding out _why_ it doesn't work.
     
    Svenn Are Bjerkem, Nov 2, 2005
    #4
  5. Svenn,

    Sorry about the tardiness of my reply - I've been all over the place recently
    and have had difficulty giving comp.cad.cadence my normal level of attention.

    The "static" is run at the beginning of any analysis. However, it may be if you
    do a transient with a readic="filename", and a skipdc=yes, and you don't have
    a DC analysis enabled somewhere else, it may not happen - I don't know for
    certain.

    Unfortunately I don't know for certain - I'd have to try it, and even then I'm
    not sure I'd rely upon it!

    Regards,

    Andrew.
     
    Andrew Beckett, Nov 9, 2005
    #5
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.