The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl
Simulators >> AMS Simulators >> Assert statement with cadence spectre (spectre.scs)
https://designers-guide.org/forum/YaBB.pl?num=1501586821

Message started by Gp on Aug 1st, 2017, 4:27am

Title: Assert statement with cadence spectre (spectre.scs)
Post by Gp on Aug 1st, 2017, 4:27am

Hi All,

I want to add the assert statement in spectre (spectre.scs) file. I have try using following way:


vdd_chk assert sub=INV_1 expr="(V(vdd_ext_por_3v))" min=1.65  max=3.65 message="ERROR: por_vdd is out of range"
vdd_chklimit checklimit checkallasserts=yes enable=["por_vdd_chk"] severity=none
thresold_chk dyn_actnode subckt=INV_1 node=vdd_ext_por_3v dv=1.68  
myopt options dochecklimit=yes save=allpub checklimitdest=file checklimitfile="myfile"



In this way, Simulator will check from 1.65V to 3.65V only. But I want to add some dynamic voltage level. Like, In ramp period after 1.65 V my checkers will consider the given range. So, how to apply in this file?

Right now this checker checks from the initial period (0 ns). I have already know about time frame feature check_windows= [start stop]. But I want to check with voltage level.

So, kindly give me suggestions for dynamic voltage.

Title: Re: Assert statement with cadence spectre (spectre.scs)
Post by Andrew Beckett on Aug 2nd, 2017, 9:11pm

I don't understand what you're asking - please clarify what you mean. What do you mean by "in the ramp period after 1.65V"?

Andrew.

Title: Re: Assert statement with cadence spectre (spectre.scs)
Post by Gp on Aug 2nd, 2017, 9:20pm

I mean, I want to check only voltage level after 1.65. Ignore initial period from zero to voltage ramp start(i.e 1.65V).

Title: Re: Assert statement with cadence spectre (spectre.scs)
Post by Andrew Beckett on Aug 2nd, 2017, 9:43pm

If you mean that you don't want it to flag until the signal has at least crossed 1.65 the first time, then this would be one way of doing it:


Code:
vdd_chk assert sub=INV_1 expr="cross(V(vdd_ext_por_3v),'rise,1,1.65)>0 ? V(vdd_ext_por_3v) : 1.65" min=1.65  max=3.65 message="ERROR: por_vdd is out of range"


In other words, it uses the cross function to check that there had been at least one crossing - if so, it uses the value of the signal, otherwise it uses a value that is within the allowed range.

Regards,

Andrew.

Title: Re: Assert statement with cadence spectre (spectre.scs)
Post by Gp on Aug 2nd, 2017, 10:50pm

Hi Andrew,

I have tried this option. There is no any compilation issue but generated the following warnings. From this warning, I cannot understand the tool is take this option or not. and this option also not dump in waveform.



WARNING (SPECTRE-17003): Assert `vdd_chk' contains an expression that
       needs to be evaluated by MDL. Using this assert frequently may lead to
       performance issues because the MDL evaluator is slower than the native
       assert evaluator.

***************************************
Checklimit Analysis  `vdd_chklimit'
***************************************
The following asserts will be enabled for all subsequent analyses until the
       next checklimit analysis statement is found:
por_vdd_chk : ON

Warning from spectre during transient analysis `transient'.
   WARNING (MDL-351): por_vdd_chk, instance
       sensor_test_top.sip_top_u.chip_top_u.Icore_top.Ianalog_top.I_POR:
       Unable to bind function `cross'.
   WARNING (MDL-1305): Argument 'dir' cannot be cast from 'integer' to
       'name'.
   WARNING (MDL-1306): Argument 'sig' cannot be cast scalar to the waveform.

Title: Re: Assert statement with cadence spectre (spectre.scs)
Post by Gp on Aug 3rd, 2017, 12:10am

Hi Andrew,

I have fixed the issue and now working fine.

Thanks a lot.

Title: Re: Assert statement with cadence spectre (spectre.scs)
Post by Gp on Aug 3rd, 2017, 5:27am

Hi Andrew,

I have done the simulation successful with assert statement. But, I have a confusion about cross function with rise, fall and both direction.

expr="cross(V(vdd_ext_por_3v),'rise,1,1.65)>0 ? V(vdd_ext_por_3v)

In this statement, rise condition is working fine. But how to use fall and both direction?

I have tried with +1, -1 direction but, it generates following warning and I think, tool is not consider this way.

 WARNING (MDL-351): por_vdd_chk, instance
      sensor_test_top.sip_top_u.chip_top_u.Icore_top.Ianalog_top.I_POR:
      Unable to bind function `cross'.
  WARNING (MDL-1305): Argument 'dir' cannot be cast from 'integer' to
      'name'.
  WARNING (MDL-1306): Argument 'sig' cannot be cast scalar to the waveform.


Title: Re: Assert statement with cadence spectre (spectre.scs)
Post by Frank Wiedmann on Aug 4th, 2017, 1:07am

The MDL cross function is documented in chapter 2 of the "Spectre Circuit Simulator Measurement Description Language User Guide and Reference" (https://support.cadence.com/apex/techpubDocViewerPage?path=mdlref/mdlref16.1/chap2.html). The expressions for rising, falling and both directions are 'rise, 'fall, and 'cross, respectively. (This is different from the calculator cross function, where the expressions are "rising", "falling", and "either".)

Title: Re: Assert statement with cadence spectre (spectre.scs)
Post by Andrew Beckett on Aug 5th, 2017, 2:02am

I'm assuming the question is unrelated to your original question, but more of a question about cross in general - because I presume if it's ramping up, the first crossing would always be in the 'rise direction. All this is doing is trying to check if you've crossed once before applying the limit.

Frank is of course right in pointing out the difference between the MDL function cross and the OCEAN function cross.

Regards,

Andrew

Title: Re: Assert statement with cadence spectre (spectre.scs)
Post by Gp on Aug 5th, 2017, 2:28am

Hi Andrew,

'rise function is working fine but when I use 'cross or 'fall for clock signal ,than simulator shouted error message. I am using following way:

clk_chk assert sub=INV_1 expr="cross(V(clk),'cross,1,0.8)>0 ? V(clk ):0.8" min=0.8  max=1.6 message="ERROR: clk is out of range" level=error


From this statement, I want to check voltage level of 0.8V to 1.6V.  But 0.8V cross on falling edge than shouted error. so, How can I check voltage level for this clock signal.

Title: Re: Assert statement with cadence spectre (spectre.scs)
Post by Andrew Beckett on Aug 5th, 2017, 2:44am

Well, unless you show what the error was when it "shouted" it's rather hard to know. I tried the expression you gave and it worked fine.

In the unlikely event of this being version-specific, knowing the spectre version you're using would be useful too (at the very top of the spectre log file, or what you get from typing "spectre -W" in the terminal window).

Regards,

Andrew.

Title: Re: Assert statement with cadence spectre (spectre.scs)
Post by Gp on Aug 5th, 2017, 3:19am

spectre version is 15.20.602

Error Scenario: when I am using 'cross function, simulator check the rising edge first. At this edge when crossing 0.8V than it's check up to threshold 1.6. It's working fine as per my expectation.
But during falling edge when voltage change from higher to lower (1.6V to 0.8V) , it's cross less than 0.8 (0.8,0.7 and so on...).
At this point, checkers failed.
Similarly I faced the 'fall condition.

So, How can I this scenario fix?

Title: Re: Assert statement with cadence spectre (spectre.scs)
Post by Andrew Beckett on Aug 5th, 2017, 6:32am

It's not clear what you want the check to do. Clearly in the fall direction if the threshold is the same as the minimum value of the assert, then the first transition will fail.

Did you perhaps want to do:

clk_chk assert sub=INV_1 expr="cross(V(clk),'fall,1,1.6)>0 ? V(clk ):0.8" min=0.8  max=1.6 message="ERROR: clk is out of range" level=error

This will flag only the first time it goes out of the range 0.8 to 1.6 once it first comes into the range from above 1.6V.

Regards,

Andrew.

Title: Re: Assert statement with cadence spectre (spectre.scs)
Post by Gp on Aug 5th, 2017, 10:12am

If I want to check either direction (rise and fall together) than I think, 'cross can use insted of ' fall or 'rise.

But, when I use' cross than what wii be our expression? (I am confused about thresold value defined in expression)

Title: Re: Assert statement with cadence spectre (spectre.scs)
Post by Andrew Beckett on Aug 5th, 2017, 2:48pm

As I've said before, it's unclear what you actually want. Maybe you want this:

cross(V(clk),'fall,1,1.6)>0 || cross(V(clk),'rise,1,0.8)>0 || (V(clk)@0 >=0.8 && V(clk)@0 <=1.6) ? V(clk ):0.8

This is untested. What it's saying is if you've crossed from above 1.6 to below 1.6, or you've crossed from below 0.8 to above 0.8, or it was between 0.8 and 1.6 at time 0, then check the voltage on the clock between the min and max range (I only wrote the expression part above).

But I'm guessing...

Andrew.

Title: Re: Assert statement with cadence spectre (spectre.scs)
Post by Gp on Aug 5th, 2017, 6:38pm

Okay. Thanks
Now, I am clear.

Title: Re: Assert statement with cadence spectre (spectre.scs)
Post by Gp on Aug 8th, 2017, 9:15pm

Sorry for conversation move forward. But I have a doubt.

Can we use this assertion for Verilog-AMS model? I think, this assertion only used for sub-circuit (SPICE/spectre) defination.
Any option available in spectre for Verilog-AMS assertion? pslassert option is available but I don't know how is it use.

Title: Re: Assert statement with cadence spectre (spectre.scs)
Post by Andrew Beckett on Aug 9th, 2017, 11:31pm

Yes, provided you get the scoping correct for the assert, this will work.

Andrew.

Title: Re: Assert statement with cadence spectre (spectre.scs)
Post by Gp on Aug 9th, 2017, 11:34pm

In spectre, with assert option, I think no any option for define module name like we provide a sub-circuit name for spice schematic. So, how to pass the module name with spectre assert option?

Title: Re: Assert statement with cadence spectre (spectre.scs)
Post by Andrew Beckett on Aug 10th, 2017, 11:23am

The sub= option (or subs=[] option) can be given the module name. Module names are essentially subckts - so doesn't need a special option.

Andrew.

Title: Re: Assert statement with cadence spectre (spectre.scs)
Post by Gp on Aug 10th, 2017, 10:20pm

Thanks. Andrew

The Designer's Guide Community Forum » Powered by YaBB 2.2.2!
YaBB © 2000-2008. All Rights Reserved.