• 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. Custom Calculator Function with Parametric sweeps

Stats

  • Locked Locked
  • Replies 6
  • Subscribers 126
  • Views 16405
  • 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

Custom Calculator Function with Parametric sweeps

Eugene201
Eugene201 over 9 years ago

I'm trying to create a calculator function to measure the sample period of a sample and hold circuit. I was able to create a function which achieves what I want and posted the code below. However, this function only works for a single run simulation and returns the correct value. When the same function is applied to a swept variable or optimization simulation it returns an eval error. This is because the waves being passed to the function are family_waves. I have tried to use the fam* functions to separate the simulation results without success. The simulator calculates the results for each individual point in the simulation which for a family of waves would require the presence of a variable identifying the particular simulation but I don't know how to get that. I have not been able to find documentation regarding the difference of how variables are passed in single vs optimization or sweep runs. Any help is greatly appreciated. 

I'm running the simulation using ADE-GXL transient analysis with sweeping global variables.

Version of Cadence is IC6.1.6-64b.500.9

(procedure (ezSampleRipple waveClk waveSig)
(let (sweepVal waveTemp1 yList timeList len outNum waveClk1 waveSig1
(maxTemp 0) (minTemp 0) (DiffTemp 0) (diffSum 0)
)

;;;;;attempted solution for parametric sweep

if(famIsFamily(waveClk)
waveClk = famValue(waveClk famGetSweepValues(waveClk));
);end if
if(famIsFamily(waveSig)
waveSig = famValue(waveSig famGetSweepValues(waveSig))
);end if

;;;;;;;;;;;;;;

WaveTemp1 = cross(waveClk 0 0 "falling" t "time")

yList = drGetWaveformYVec(WaveTemp1)

setq(len (drVectorLength yList))

for(i 0 (sub1 len)
(setq timeList (tconc timeList (drGetElem yList i)))
);end for

foreach(crossTime car(timeList)

maxTemp = ymax(sample(waveSig (crossTime+5p) (crossTime+45p) "linear" 0.1p))
minTemp = ymin(sample(waveSig (crossTime+5p) (crossTime+45p) "linear" 0.1p))
diffTemp = maxTemp-minTemp
diffSum = diffSum + diffTemp

);foreach

outNum = diffSum / len

) ; let
) ; procedure

Thank you in advance,

Eugene

  • Cancel
Parents
  • Eugene201
    Eugene201 over 9 years ago

    Frank Wiedmann said:

    Have you tried using the famEval() function (see http://support.cadence.com/wps/mypoc/cos?uri=deeplinkmin:TechPubDocs;src=pubs;q=/vivaxlskill/vivaxlskill6.1.6/chap4.html#1033660)?

    Hi Frank,

    Thank you for the quick reply. I did not see this function in skartistref and didn't originally try it. I think this function is exactly what I'm looking for but I'm having trouble implementing it. I get the sweep name and sweep value using the fam functions provided. However, when running the function fails and says error evaluating (VT("/net014")-VT("/net015")). I have included the cut-out of how to isolate a single wave but it doesn't work. Please let me know if I'm using this wrong.

    sweepVal = famGetSweepValues(waveClk)
    sweepName = famGetSweepName(waveClk)
    sweepVal=car(sweepVal)

    if(famIsFamily(waveClk)
    waveClk = famEval((VT("/net014")-VT("/net015")) sweepName sweepValue)
    );end if
    if(famIsFamily(waveSig)
    waveSig = famEval((VT("/vinp")-VT("/vinn")) sweepName sweepValue)
    );end if

    Thank you,

    Eugene

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Eugene201
    Eugene201 over 9 years ago

    Frank Wiedmann said:

    Have you tried using the famEval() function (see http://support.cadence.com/wps/mypoc/cos?uri=deeplinkmin:TechPubDocs;src=pubs;q=/vivaxlskill/vivaxlskill6.1.6/chap4.html#1033660)?

    Hi Frank,

    Thank you for the quick reply. I did not see this function in skartistref and didn't originally try it. I think this function is exactly what I'm looking for but I'm having trouble implementing it. I get the sweep name and sweep value using the fam functions provided. However, when running the function fails and says error evaluating (VT("/net014")-VT("/net015")). I have included the cut-out of how to isolate a single wave but it doesn't work. Please let me know if I'm using this wrong.

    sweepVal = famGetSweepValues(waveClk)
    sweepName = famGetSweepName(waveClk)
    sweepVal=car(sweepVal)

    if(famIsFamily(waveClk)
    waveClk = famEval((VT("/net014")-VT("/net015")) sweepName sweepValue)
    );end if
    if(famIsFamily(waveSig)
    waveSig = famEval((VT("/vinp")-VT("/vinn")) sweepName sweepValue)
    );end if

    Thank you,

    Eugene

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
No Data

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