More updates to the CDSVN scripts

Our friend from Brazil (Nilton Jr) sent us the attached update last year: CDSVN. I’m just getting around to posting them now. I haven’t tried them out, but they are “customizations [they] made to [their] environment”.

Also, we got another contribution from Iou Bingyong: svnMenu.il. He says:

I’m in China and I have tried your script today . It works fine in IC615, great works!
I wrote a skill script to add the “Subversion” menu in schematic/layout editor. In this way the “menus” sub-directory is not needed and I think this should be a little easier to setup.

Posted in Analog Professional | Tagged , , | Leave a comment

Shortcut to plot relative to reference signal

Ocean/skill script follows. Select a net. Press ctrl-g. Now that net is your “reference”. Select a different net (or the same net if you are fond of trivial signals). Press ctrl-r that second net is plotted relative to the reference.

This is useful for debugging multiple supply domains, supply/ground bounce, and differential circuits.

relVt.il:
procedure( relVT(netname)
  VT(netname) - VTGND
)

procedure( selVT()
  wid=hiGetCurrentWindow()
  path = geGetAdjustedPath(wid strcat(geGetInstHier(wid) "/" car(geGetSelSet())~>net~>name))
  relVT(path)
)

procedure( setGnd()
  wid=hiGetCurrentWindow()
  path = geGetAdjustedPath(wid strcat(geGetInstHier(wid) "/" car(geGetSelSet())~>net~>name))
  VTGND = VT(path)
)

procedure( plotSelVT()
  let( ((sVT selVT()))
    plot(sVT)
  )
)

hiSetBindKey("Schematics" "CtrlR" "plotSelVT()")
hiSetBindKey("Schematics" "CtrlG" "setGnd()")
Posted in Analog Professional | Tagged , , , , , | Leave a comment

Cadence (awd) Waveform Colors

Hex & RGB values:
FF00000; (255,0,0)
01CC66; (1,204,102)
FFBFF2; (255,191,242)
FF8000; (255,128,0)

Posted in Analog Professional | Tagged , , , , | Leave a comment

Creating a Nyquist plot with Cadence

Cadence has a stability analysis that returns loop gain (return ratio). Typically, this is done using a log sweep of frequency. The reason is that doing a uniform linear sweep results in too large frequency steps for low frequencies and/or too large of a step for higher frequencies.

Unfortunately, when you do a logarithmic sweep, you can’t cover from negative to positive frequencies–which is what you want when you generate a Nyquist plot. With the code below, you can reflect the positive frequencies onto negative to get the full Nyquist plot:

; load "~/cadence/skill/abConcatWaveforms.il"
lg = -getData("loopGain" ?result "stb")
; abConcatWaveforms externally defined
lg2 = abConcatWaveforms(flip(conjugate(lg)) lg)
w = newWindow()
ocnYvsYplot(?wavex real(lg2) ?wavey imag(lg2))
stb_x = xmin(abs(lg2-complex(-1.0,0.0))**2)
stb_margin = value(lg2, stb_x)
addTitle(sprintf(nil "stb_margin = %f dB" -dB20(stb_margin)))
xLimit( list(-1.6 0.2) )
yLimit( list(-0.5 0.5) )

You’ll need Andrew Beckett’s abConcatWaveforms function defined and loaded.

Posted in Analog Professional | Tagged , , , , , | Leave a comment

For loops in Cadence

If one is doing an analysis over a range of variables, one should use the paramAnalysis ocean function. That said, I’m constantly having to look up how to do a for loop in Skill. So, I’m placing a couple examples where I know I can get to them.

Read More »

Posted in Analog Professional | Tagged , , | Leave a comment

Skill File I/O

I keep having to look this up, so I’m going to put it here for easy reference:

Open a File

h = outfile("new_file.txt", "w")
h = infile("existing_file.txt")
h = outfile("partial_file.txt", "a")

Opens new file for writing, existing file for reading, and partial file for appending, respectively.

Write to a file

write("Hello World!\n", h)
fprintf(h, "gm = %f", OP("/M23" "gm"))
print(OP("/M23" "gm"), h)
pprint(OP("/M23" "gm"), h)

Write “Hello World!” to a file (newlines are explicit); construct formatted string and write to file; print using native format to a file; pretty-print (useful for nested lists etc) to a file. File handle is h.

Read from a file

str = lineread(h)

Reads a single line as a string

Posted in Analog Professional | Tagged , , | Leave a comment

Updates to Cadence/Subversion (CDSVN) scripts

Our Brazilian Friends PCS and NGJr have offered the following changes to the CDSVN package:

  • Into the file “cdsLibMgr.lib” was created the menu item “SVN Unlock Cell”
  • Into the file “svnLockCell.il” were created the procedures “svnUnlockCell” and “svnUnlockCellFormCB”
  • Inside the procedures “svnUnlockCellFormCB” and “svnUnlockCVFormCB” were made the following changes:
  • where you have: if( !(rexMatchp(“.*.svn$”, file~>readPath) || rexMatchp(“.*%”, file~>readPath))
  • was changed to: if( !(rexMatchp(“.*.svn$”, file~>readPath) || rexMatchp(” “, file~>readPath))

Behaviors observed:

  • We don´t want the files *.cd% under version control, but if for some reason they are under version control that exist the possibility to lock them or unlock them.
  • Copying a “cell” or a “view” by “Library Manager” doesn´t copy files *.cd% which is not a problem because we don´t want these files under version control.
  • The command “[user@host CDSVN]$ svn lock *” or “[user@host CDSVN/bin]$ lock directory/” locks the files *.cd%, however, the “CDSVN Unlock Cell” or “CDSVN Unlock View” does not unlock.
  • The “CDSVN Lock Cell” or “CDSVN Lock View” does not unlock the files *.cd%, however, the commands “[user@host CDSVN]$ svn unlock *” or “[user@host CDSVN/bin]$ unlock directory/” are able to unlock.
  • Copying by the command “[user@host CDSVN]$ svn copy” copies the files *.cd% only if they are already under version control. The same behavior occurs for “CDSVN Copy Cell” or “CDSVN Copy View”. This is not a problem.
  • The command “[user@host CDSVN]$ svn add”, “CDSVN Add Cell” or “CDSVN Add View” does not add files *.cd% even because this type of file is in the list of ignored files as showed below:
    [user@host /home/user/.subversion] vi config
    global-ignores = *.cd% *.cd- *.cdslck *.Cat% *.abstract.status *.abstract.messages *.inca* *inca* .cdsvmod expand.cfg% transcript_ms

    [user@host CDSVN/]vi cadence_ignores.txt
    *.cd%
    *.cd-
    *.cdslck
    *.Cat%
    *.abstract.status
    *.abstract.messages
    *.inca*
    *inca*
    ….
    cdsvmod
    expand.cfg%
    transcript_ms

Their updated files are attached. Special thanks to PCS for coordinating this. Remember, the CDSVN scripts are licensed under GPL.

cdsLibMgr.il
svnLockCell.il
cdsLibMgr.il

Posted in Analog Professional | Tagged , , , , | 1 Comment

My other blogs & plans for the future

It used to be that I’d post just about anything here. However, after a few months of posting circuit design articles, I developed a consistent readership and decided that most of you aren’t interested in my daily life and/or the tech hobbies that I might be up to. As a result, I separated my personally-centered blogs from this blog.
I just wanted to quickly mention that if anyone is interested, I have two other blogs:
Personal Blog
Tech (software/computer) Blog

Also, you’ll notice that Google Ads are prominently displayed on this blog. I wanted to recoup the hosting costs of running this blog. Unfortunately, that didn’t end up being as profitable as I thought. So, as soon as I hit $100 of ad revenue (which is the minimum to cash out of my Google AdSense account), I’ll remove the ads. I’ll essentially be eating the hosting cost (in addition to the time I’ve put into the blog).

Unless I change my mind. Which is unlikely.

Also, I might try out some more social features on the web site. If I get the time. Which is also unlikely.

Posted in Uncategorized | Tagged , , | Leave a comment