• 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. setting temperature by veriloga via cds_set_temperature...

Stats

  • Locked Locked
  • Replies 4
  • Subscribers 126
  • Views 10029
  • 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

setting temperature by veriloga via cds_set_temperature and make it work for stb analysis

StephanWeber
StephanWeber over 2 years ago

Hi,

according the Cadebnce suggestions I made such kind of VA module:

// VerilogA for bhvLib, vctemp, veriloga

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

module vctemp(in);
 parameter real tupdate  = 10u from (1p:1];
input in;
electrical in;

real temper=0;

analog begin

@(timer(tupdate,tupdate)) begin
  temper = V(in);
  $cds_set_temperature(temper);
end
end
endmodule

Without timer I got unfortunately a crash with spectre. But with timer the DC and tran analysis with a thermal RC network (generating Vin) works fine (just a bit slow).

However, I also want to check the stability for my thermal loop, and this does not work well, because the loop gain plots are very noisy with the VA cell in my testbench.

I believe, if we had a continous T update according the the input voltage, stb would work fine, but as mentioned then I got the crashes.

I made an alternative modeling without verilogA and using a vcvs with -2mV//K to mimic the bipolar T-sensor behavior, and that works well also in stb analysis. But it would be great to make stb working also together with that VA module.

Does anybody has an idea to make cds_set_temperature work in stb (or AC) analysis?

Bye Stephan

  • Cancel
  • ShawnLogan
    ShawnLogan over 2 years ago

    Dear Stephan,

    StephanWeber said:
    Does anybody has an idea to make cds_set_temperature work in stb (or AC) analysis?

    My limited understanding of the use of $cds_set_temperature from the verilog-A reference manual:

    set_temperature_function ::=
        $cds_set_temperature(expression)

    expression should be a real-type expression that represents the temperature to be set in degree Celsius. You can use variables and parameters in the expression.

    When $cds_set_temperature() is called during simulation, the simulation behavior changes in a way similar to dynamic parameter simulation.

    Hence, its use appears to be designed to be an alternative to using the temperature as a dynamic parameter in a transient simulation. This makes sense as you noted without a timer in your veriloga code, the simulation did not complete successfully. 

    As such, have you explored using a timer in your veriloga code to change the temperature at specific times in a transient simulation. For example, you might change the temperature every 1 ms to use an arbitrary example. Include a stability analysis (acnames = stb) at actimes of, for example, 0.50 ms 1.50 ms 2.50 ms. If you perform a transient simulation for 3 ms, the temperature will change from its value at time = 0, 1 ms, 2 ms, and 3 ms. A stability analysis will be performed at the DC operating point at simulation times 0.50 ms, 1.50 ms, and 2.50 ms. The acname and actimes parameters are set in the Transient simulation GUI under the Options-> Output tab as shown in Figure 1.

    Do you think this might help you? Without knowing all the details of your circuit and application, I am not sure if it will address your question, but thought I would at least pass the thought by you StephanWeber.

    Shawn

    Figure 1

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

    Hi Shawn,

    the problem with stb analysis is that it looks incorrect, both for stb in general, and also for stb used in actimes and acnames. I believe it is a deeper problem.

    Bye Stephan

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 2 years ago in reply to StephanWeber

    You should contact support. I'm not sure this will work anyway - changing the temperature should only be done discretely and in small steps as is likely to cause major convergence difficulty otherwise.

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • drdanmc
    drdanmc over 2 years ago

    My understanding of your question is that you a have a thermal controller that includes a BJT based temperature sensor and presumably some control circuit driving a heating element and you want to use stb analysis to check the stability of this loop when the thermal network is modeled with some RC network.  If that is a correct understanding then I do not believe you will be able to get $cds_set_temperature() to work.  stb analysis, like an ac analysis, finds a operating point, linearizes the network around that operating point and then simulates with frequency as a variable.  $cds_set_temperature() doesn't really have the notion of an AC response from some signal to temperature.  I think what you'll need to do is develop a model for your temperature sensor.  That may be as simple as fitting a straight line or low order polynomial to a sensor output vs temperature curve that you simulate.  Similarly, you would need a model for the heater + thermal network.  You could do all of this with electrical analogies for the thermal network where you do something like use voltages to represent temperature and current to represent power.  Alternatively you could write Verilog-A models and use the "thermal" discipline for the thermal portions of your model.  The "thermal"discipline uses the "Temperature" nature as the potential and "Power" nature as the flow (see disciplines.vams in the spectre install directory).  But the short answer is that from the point of view of AC and AC-like (noise, stb) simulations, temperature is like a fixed part of the operating point as opposed to an input to linearized models.  If you sweep temperature in an AC sim, then spectre recomputes an operating point at each temperature but runs the AC part at a fixed frequency.

    Your approach of using the timer to call $cds_set_temperature() should work though in a transient simulation as long as you can ensure small steps in temperature

    • 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