Quantcast
Channel: Cadence Custom IC Skill Forum
Viewing all 5068 articles
Browse latest View live

How to apply "ocnYvsYplot" API to a family of waveforms

$
0
0

Hi All

Does someone know how to apply "ocnYvsYplot" API to a family of waveforms.

According to the API manual, "ocnYvsYplot" is not supported for a family of waveforms.

But I want to use it in the ADEXL, even with the single norminal run, the final simulation data will consider it's a family waveforms.

I have tried "famMap" function, but do not know how to deal with the "Key" type argument.

Best Regards

Yi


Create symbol from schematic.

$
0
0

Hi all,

1. I'm reading info from file.

2. The main part. Create library and schematic view. Insert mos device to schematic. After that i need to create symbol, but i stuck on this step. How can i do it ? Secondly how can i close the schematic editor window ?

Here is my cod:


x=infile("~/Desktop/Skill/input")
fscanf(x "%s %s %f %s %f %d %s %s %f %s %f %d" p w wp l lp mp n w1 wn l1 ln mn)
list(p wp lp mp n wn ln mn)

procedure( lib( name)
    dbCreateLib( name)
/*********************************/
    deNewCellView( name "p05" "schematic" "schematic" nil)
    cv=geGetEditCellView()
    dbCreateParamInstByMasterName(cv "Tech_lib" p "symbol" "i1" list(0 0) "R0" mp list(list("w_fing" "float" wp ) list("l" "float" lp)))
    schCheck(cv)
    dbSave(cv)
/*    hiCloseWindow( cv) */
/*********************************/
/*    deNewCellView( name "p05" "symbol" "schematicSymbol" nil)*/
schHiViewToView( name "p05" "schematic" "symbol" "schematicSymbol" )
hiFormDone(schSgForm)
);procedure

Best regards,

Sergey.

Traversing the sweeps of a family of waveforms to calculate the max turn-on time

$
0
0

Hello:

I am trying to make a turn-on time measurement on a transient voltage.  This measures how long it takes for a certain voltage to reach a certain Y-value threshold, Yth.  However I would like to create a function that can take a family of waveforms (set of corners) and give me the maximum of the turn-on times over the family of waveforms.  Here is what I have so far with comments explaining how I would like the function to work:

;apGetMaxTurnOn(famIn tmin tmax Yth)
; INPUTS
; famIn - wave or family of waves to measure the turn-on time.
; tmin - minimum time
; tmax - maximim time
; Yth - Y value threshold to get the period.
; Returns a list with the following elements
; '(maxWaveform maxT cornerInfo)
; maxWaveform: Waveform object with the max turn-on period
; maxT - Max turn-on period
; cornerInfo - A list with the corner information. One entry for each sweep name in the family of curves.
; EXAMPLE
; ; Calculate the max turn-on time to 1.5v for famIn which is between 0us and 20us
; turnOnList = apGetMaxTurnOn(nthelem(6 out) 0 20u -2.5)
procedure(apGetMaxTurnOn(famIn tmin tmax Yth)
let(()
xVal=cross(clip(famIn tmin tmax) Yth 1 "either" nil nil nil )
;xVal=cross(nthelem(6 out) -2.5 1 "either" nil nil nil )
when(drIsWaveform(xVal)
1 ; TO DO: Return the turn-on list for the turn-on time of the single waveform
)
when(famIsFamily(xVal)
1 ; TO DO: Return the turn-on list list as described above for the trace with the max turn-on time
))
)

I have figured out how to get to the data by  repeatedly using drGetWaveformYVec and drGetElem:

Note: xVal is a family of waveforms with the lowest waveform in the sweep hierarchy having the turn-on period for one of the traces.

drGetElem(drGetWaveformYVec(drGetElem(drGetWaveformYVec(drGetElem(drGetWaveformYVec(xVall) 0)) 0)) 0)

However I would like the function to work with any number of sweep parameters but I'm not sure how to traverse an unknown number of sweep parameters.  If I knew the number of sweep parameters I could use a nested loop, however the family of waveforms that is input to the function could have an arbitrary number of sweeps. 

What's the best way to traverse a family of waveforms to calculate the max turn-on period?  Could you please provide some example code?

I am using IC6.1.7.

-Curtis

API for adding Calculator Function Categories

$
0
0

Hello:

1. Is there a way to add a calculator function category using a SKILL function rather than by defining them in the "template catalog summary file"

2. Is there a way to define the category when using "calCreateSpecialFunction"?  I don't see a public argument for it.  Otherwise it just puts the category as "User Defined Skill Functions", not even "Special Functions" as you'd expect.

I already tried defining a new category by simply adding it to the "category" section of a function template but that didn't work.

-Curtis

Re-evaluate results with ADEXL

$
0
0

Hello,

I can re-run simulations from the terminal after they've bugged for some reason. The corresponding results are then accessible from the results browser, but unfortunatelly when I click on the "Re-evaluate results" button (in the ADEXL results panel), the expressions of the test are not updated... (espacially if I've previously cancelled the simulation before rerunning from the terminal) 

I'm wondering if there is a simple way of forcing ADEXL to re-evaluate results from the data base in such a case.

Any idea?

Many Thanks

Cedric.

Round off in VerilogA

$
0
0

How do I truncate a value in VerilogA ? I want to control the significant digits of a voltage value inside the VerilogA model. Please help me with this. 

Thanks. 

Regards,

Aishwarya

Most efficient nested data structure?

$
0
0

I'm writing a script to port a design between processes, and I need some kind of data structure that describes how to make the conversion for every primitive instance of the old process. This would include things like the library and cell name of the equivalent instance in the new process, mapping between symbol terminals, mapping between cdf properties, cdf callbacks to run, and any custom functions that need to be called during the conversion process. (I'd include custom functions as strings and use evalstring(), unless there's a better option). This entire structure would be static and loaded from a file. Since there are so many libraries and cells, I need something that can be searched quickly. I realize that the actual conversion process will probably take significantly more time than finding the instructions, but I think the efficiency still matters since it will add up.

There seem to be some tradeoffs between associative tables, disembodied property lists, and defstructs, depending on the number of elements. My understanding is that associative tables are best for long structures, and the defstructs might be better for shorter structures (or maybe DPL's, but the documentation doesn't suggest they're any good). I'm not sure what the tradeoffs between defstructs and associative lists are, but it seems like associative lists are better for things where the keys are unknown, and defstructs for things where the keys are known.

My first thought was:

  • Assoc Table: libraries[]
    • Keys: library names of cells to be converted
    • Values: Assoc Tables cells[]
  • Assoc table: cells[]
    • Keys: cell names of cells to be converted
    • Values: Defstruct cellmap
  • Defstruct: cellmap
    • ?libname - String, library name of new cell
    • ?cellname - String, cell name of new cell
    • ?termmap - Assoc list, keys are old terminal names, values are new terminal names
    • ?propmap - Defstruct, An assoc list similar to termmap except for property names, and a string for callbacks to be executed/custom functions to run on the property value

      Any thoughts?

How to use variable port width in VerilogA?

$
0
0

Hi all, 

  Recently I am writing a simple verilog-A ADC and using variable-port width for the output bits. After I use "parameter integer nbit=7" in the verilog-A file and finish the verilog-A parsing, I can only see bit<0> in the generated symbol. After reading  https://community.cadence.com/cadence_technology_forums/f/custom-ic-skill/33720/solved-verilog--ams-pcell-with-variable-bus-width and https://support.cadence.com/wps/mypoc/cos?uri=deeplinkmin:ViewSolution;solutionNumber=11696480#attachment_link I start to build my symbol with SKILL. After loading the SKILL I can observe the port now can change with nbit parameter. But again, during spectre netlisting it throws out an error saying the verilog-A view is now synchronised with the symbol. After updating the symbol from verilog-A, the variable-port width again becomes bit<0> only. 

  I think this issue must have been reported and discussed before. But can anyone provide some references to it? Thanks in advance. 

  PS: Attached are my verilog-A and SKILL code.

community.cadence.com/.../VerilogA.txt community.cadence.com/.../SKILL.txt


How to launch function after select lib/cell/view with ddsSyncWithForm() then press Close button ?

$
0
0

Hi All,

https://support.cadence.com/apex/ArticleAttachmentPortal?id=a1Od0000000nanAEAQ&pageName=ArticleContent&sq=005d0000005nIGZAA2_201711106162892

It's  a example from https://support.cadence.com ,

I want to launch my own function after press 'Close' .

exampleLibName = hiCreateStringField(
    ?name 'exampleLibName
    ?prompt "Library Name"
    ?value ""
    ?callback "ddsUpdateSyncWithForm( )"
)
exampleCellName = hiCreateStringField(
    ?name 'exampleCellName
    ?prompt "Cell Name"
    ?callback "ddsUpdateSyncWithForm( )"
)
exampleViewName = hiCreateStringField(
    ?name 'exampleViewName
    ?prompt "View Name"
    ?callback "ddsUpdateSyncWithForm( )"
)
exampleBrowser = hiCreateButtonBoxField(
    ?name 'exampleBrowser
    ?prompt " "
    ?choices '(" Browse ")
    ?callback list("exampleBrowser( )")
)
hiCreateForm(
    'exampleOpenForm "Synched Form Example"
    "exampleOpenForm( )"
    list( exampleLibName exampleCellName exampleViewName exampleBrowser )
    ""
)
procedure( exampleBrowser( )
    ddsSyncWithForm( exampleOpenForm 'browse 'exampleLibName 'exampleCellName 'exampleViewName )
)

procedure( exampleOpenForm( )
    ddsSyncWithForm( exampleOpenForm 'other 'exampleLibName 'exampleCellName 'exampleViewName )
hiDisplayForm( 'exampleOpenForm )
)
 
ddsEndSyncWithForm() 

Thank you,

Charley

detect and optional remove dangling/floating schematic lines?

$
0
0

Anyone have a good skill approach to detecting and removing floating or dangling schematic lines?  For example, consider a schematic which had a bunch of 3 terminal resistors which were replaced with 2 terminal resistors.  Now there are little stubs that used to connect to the 3rd terminal.  These may be lines which are a single segment with a label on it or they may be wires that route some distance and connect to a net.

I can think of some hacks involving a while loop that calls mks = setof(X cv~>markers X~>parent~>objType =="line") and then deletes lines and then schCheck(cv) to update the markers but that seems a bit ugly.

Thanks

-Dan

Convert a complex list to a string, and back

$
0
0

Hello,

Since cdf can't handle list, the solution is to convert this to a string.

But how do you convert a list of this type to a string, and back??

example = list("example")

example->values = list("values")

example->values->num1 = "one"

example->values->num2 = '("t" "w" "o")

example->values->num3 = 3

example->char = list("char")

example->char->char1 = "A"

example->char->char2 = '("B" "C")

Plot expression after ADE-XL run

$
0
0

Hello,

I have adopted this piece of art from Andrew's post in this thread:

historyName=axlGetHistoryName(abXLRunAfterSimGetHistory())
    ; example of getting the resDB in this script
    resDB=axlReadHistoryResDB(historyName)
    foreach(point resDB->points()
        foreach(corner point->corners()
            printf("CORNER: %L\n" corner->name)
            foreach(test corner->tests()
                printf("TEST: %L\n" test->name)
                foreach(output test->outputs()
                    printf("  %s: %L\n" output->name||"" output->value)
                )
            )
        )
    )


This code works fine, except for the expressions values which are considered to be "wave". I would like to plot these waves using ViVa, so I edited the code:
historyName=axlGetHistoryName(abXLRunAfterSimGetHistory())
    ; example of getting the resDB in this script
    resDB=axlReadHistoryResDB(historyName)
    foreach(point resDB->points()
        foreach(corner point->corners()
            printf("CORNER: %L\n" corner->name)
            foreach(test corner->tests()
                printf("TEST: %L\n" test->name)
                foreach(output test->outputs()
when(output->value == "wave")
awvPlotWaveform(newWindow() list(output->valueAsString))
) printf(" %s: %L\n" output->name||"" output->value) ) ) ) )

The problem is with expressions in particular, which seem to be not view-able outside ADE-XL. So I get the warning:
*Warning* Wavenil is not a waveform object that can be displayed and will be DELETED automatically.

Is there a work-around for this? Any insight would be highly appreciated.

Best regards,
Karam

Bounding Hierarchical pCell Field's values

$
0
0

Hello,

I wrote a  hierarchical, SKILL based pCell. The hierarchical pCell includes a child cell, with few parameters, and a parent cell.

I bounded the child pCell numerical parameters fields using the field's CallBack option. This works OK and when the child pCell is instantiated, it's fields are bounded accordingly within a specific range.

Yet, when using the parent cell, the child pCell fields are losing their boundaries and accept any value.

Below please find a sample code to demonstrate the issue. If the child cell is called, it's fields are bounded properly, but under the parent cell, they lose their boundaries.

The fields to be bound to specific ranges are: w and l.

l is bounded within a range of 10 to 100, if not within this range make default: 25, 2 Digits after decimal point.

?callback "cdfgData->l->value=sprintf(nil \"%.2fu\" atof(cdfgData->l->value)) if(atof(cdfgData->l->value) < 10 || atof(cdfgData->l->value) > 100 then cdfgData->l->value = \"25.0u\")"

w is bounded within a range of 0.095 to 1 , If not within this range make default 0.25, 2 digits after decimal point.

?callback "cdfgData->w->value=sprintf(nil \"%.2fu\" atof(cdfgData->w->value)) if(atof(cdfgData->w->value) < 0.095 || atof(cdfgData->w->value) > 1 then cdfgData->w->value = \"0.25u\")"

Here is the complete sample code that is based on Cadence Hierarchical pCell sample:

***************************************************************
SCLAIMER: The following code is provided for Cadence customers *
* to use at their own risk. The code may require modification to *
* satisfy the requirements of any user. The code and any *
* modifications to the code may not be compatible with current or *
* future versions of Cadence products. *
* THE CODE IS PROVIDED "AS IS" AND WITH NO WARRANTIES, INCLUDING *
* WITHOUT LIMITATION ANY EXPRESS WARRANTIES OR IMPLIED WARRANTIES *
* OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. *
********************************************************************/

/***************************************************************
* *
* Child pcell *
* *
***************************************************************/
pcDefinePCell(
;--------------------------------------------------------------------
; Identify target cellView
;--------------------------------------------------------------------
list(ddGetObj("DannyR_Tests") "childCell" "layout")
;--------------------------------------------------------------------
; Define the formal parameter names
;--------------------------------------------------------------------
(
(l 1.0)
(w 1.0)
(metal1Layer "MET1")
(metal1Purpose "drawing")
(metal2Layer "MET2")
(metal2Purpose "drawing")
(overlap 0.1)
)
;--------------------------------------------------------------------
; The code itself
;--------------------------------------------------------------------
let((r1 r2)
r1=rodCreateRect(
?layer list(metal1Layer metal1Purpose)
?width w
?length l
)
r2=rodCreateRect(
?layer list(metal2Layer metal2Purpose)
?width w+overlap*2.0
?length l+overlap*2.0
)
rodAlign(
?alignObj r1
?alignHandle 'centerCenter
?refObj r2
?refHandle 'centerCenter
)
) ; let

; Creating teh CDF parameters

let( (cellId cdfId)
when(cellId = ddGetObj("DannyR_Tests" "childCell")
;; if the cell CDF already exists, delete it
when( cdfId = cdfGetBaseCellCDF(cellId)
cdfDeleteCDF(cdfId)
)
;; create the base cell CDF
cdfId = cdfCreateBaseCellCDF(cellId)
;; create the parameters
cdfCreateParam( cdfId
?name "w"
?prompt "w"
?defValue "0.25u"
?type "string"
?display "t"
?callback "cdfgData->w->value=sprintf(nil \"%.2fu\" atof(cdfgData->w->value)) if(atof(cdfgData->w->value) < 0.095 || atof(cdfgData->w->value) > 1 then cdfgData->w->value = \"0.25u\")"
)

cdfCreateParam( cdfId
?name "l"
?prompt "l"
?defValue "25.0u"
?type "string"
?display "t"
?callback "cdfgData->l->value=sprintf(nil \"%.2fu\" atof(cdfgData->l->value)) if(atof(cdfgData->l->value) < 10 || atof(cdfgData->l->value) > 100 then cdfgData->l->value = \"25.0u\")"
)

)

)
) ; end of pcDefinePCell
/***************************************************************
* *
* The parent cellView *
* *
***************************************************************/
pcDefinePCell(
;--------------------------------------------------------------------
; Identify target cellView
;--------------------------------------------------------------------
list(ddGetObj("DannyR_Tests") "parentCell" "layout")
;--------------------------------------------------------------------
; Define the formal parameter names
;--------------------------------------------------------------------
(
(l 25.0)
(w 0.25.0)
(numX 2)
(numY 2)
(metal1Layer "MET1")
(metal1Purpose "drawing")
(metal2Layer "MET2")
(metal2Purpose "drawing")
(overlap 0.1)
)
;--------------------------------------------------------------------
; The code itself
;--------------------------------------------------------------------
let((dummy bBox width height mosaic master childParamList)
;----------------------------------------------------------------
; Work out the parameter list to pass to the child pcell
;----------------------------------------------------------------
childParamList=
list(
list("l" "float" l)
list("w" "float" w)
list("metal1Layer" "string" metal1Layer)
list("metal1Purpose" "string" metal1Purpose)
list("metal2Layer" "string" metal2Layer)
list("metal2Purpose" "string" metal2Purpose)
list("overlap" "float" overlap)
)
;----------------------------------------------------------------
; Create a dummy instance first, so that we can measure it
;----------------------------------------------------------------
master=dbOpenCellViewByType("DannyR_Tests" "childCell" "layout")
dummy=dbCreateParamInst(
pcCellView
master
"" 0:0 "R0"
1
childParamList
) ; create the dummy instance

;----------------------------------------------------------------
; Figure out the bBox
; probably would be more complex than this in reality; he we're
; just looking at the bBox directly.
;----------------------------------------------------------------
bBox=dummy~>master~>bBox
width=xCoord(upperRight(bBox))-xCoord(lowerLeft(bBox))
height=yCoord(upperRight(bBox))-yCoord(lowerLeft(bBox))
;----------------------------------------------------------------
; Now delete the dummy instance
;----------------------------------------------------------------
dbDeleteObject(dummy)
;----------------------------------------------------------------
; Now create the parameterized cell
;----------------------------------------------------------------
mosaic=dbCreateSimpleMosaic(
pcCellView
master
"" 0:0 "R0"
; note rows then columns
numY numX
height width
)
;----------------------------------------------------------------
; Then update the parameters
; NOTE: dbReplacePropList doesn't re-trigger the pcell evaluation
; (it should - PCR 715526 is for a function to do this cleanly).
; As a workaround, I use dbReplaceProp with one of the
; parameters in the list in order to trigger an eval.
; Also note, you need to replace the parameters on the first
; instance in the mosaic, since it is a simple mosaic of just
; one instance type. This will be better when a function (something
; like) dbCreateSimpleParamMosaic gets created
;----------------------------------------------------------------
dbReplacePropList(
car(mosaic~>instanceList)
childParamList
)
dbReplaceProp(
car(mosaic~>instanceList)
car(car(childParamList))
cadr(car(childParamList))
caddr(car(childParamList))
)
;----------------------------------------------------------------
; Now close the master that was used to create the dummy and
; the mosaic
;----------------------------------------------------------------
dbClose(master)
) ; let
) ; end of pcDefinePCell

Any tip would be greatly appreciated.

Thanks,

Danny

Trying to write skill code to return a layer's color

$
0
0

Hi,

I'm trying to write code to get each layer's color.
The documentation indicates that there is a "fillColors" attribute for a layer, but I don't see that attribute in a sample that I have.

techFileID = techGetTechFile(cv)
nth( 16 techFileID->layers )->??

OUTPUTS THIS:
(db:0x1773e42a objType "physicalLayer" prop
(db:0x1773d831 db:0x1773d82f db:0x1773d834 db:0x1773d832)
groupMembers nil number 34 name
"Metal2" abbrev "Metal2" lps
(db:0x21714f50 db:0x21715070 db:0x21715190 db:0x217152b0 db:0x21718f70
db:0x2171b7f0 db:0x21722750 db:0x21725ec0 db:0x21725fe0 db:0x217293d0
db:0x217294f0 db:0x21729610
)
incompatibleLayerNames nil backside nil material
"metal" valid t allowSetToValid t
allowSetToValidInSession t
)

nth( 16 techFileID->layers )->fillColors

OUTPUTS THIS:
nil

nth( 16 techFileID->layers )->outlineColors

OUTPUTS THIS:
nil

But the layer is visible.
Can someone tell me what I need to do to get a layer's rgb color?

defstruct being re-cast as array in procedure called within procedure

$
0
0

I have three procedures: portDesign(), portCellview(), and loadPortMap().

portDesign() is the "top level" procedure

loadPortMap() is called within portDesign(), converts a DPL to a 2D association table whose elements are defstructs, and returns that.

portCellview() is called within portDesign() and uses the 2D association table. However, when portCellView() attempts to access one of these defstruct elements, I get a get/getq error of "first arg must be either symbol, list, defstruct or usertype - array@0x12345678".

If I pp(associationTable[0][0]) in portDesign, it prints defstruct_name@0x12345678. if I pp(associationTable[0][0]) in portCellview, it prints array@0x12345678. It seems that its pointing to the right location, but somehow is confusing the variable type.

Any idea what's going on here and how to fix it? (See some psuedo code below)

I suspect it may be a scoping issue. Note: If I put the assocTable in portDesign()'s prog(), and pass the variable to portCellView(), I still observe the same behavior.

procedure(portDesign()
prog(()
assocTable = loadPortMap()
pprint(assocTable[0][0]) ;prints ds@0x...
portCellView(); throws error
))

procedure(portCellView()
prog((dummy)
pp(assocTable[0][0]) ;prints array@0x... (same address as above)
dummy = assocTable[0][0]->ds_ele ;throws error
))

procedure(loadPortMap()
prog((assocTable)
assocTable = makeTable("assoc1"
)assocTable[0] = makeTable("assoc2")
assocTable[0][0] = make_ds(?ds_ele 1)
return(assocTable)
))

defstruct(ds ds_ele)

Change default VIA definition

$
0
0

Hi,

I change the default via for AP to M9 with:

viaSetDefaultValidViaDefs("tsmcN40" "virtuosoDefaultSetup" list("AP_M9_3x3") nil)

However when I try to draw a via using:

viaGenerateViasInArea(cvId points myViaOptions)

no vias are drawn. Without changing the default value vias are drawn as expected.

When I open the Create Via form in Layout I can see the default changed to the correct value. Any help on why no vias are being drawn?

dbGetNeighbor question

$
0
0

I am using the dbGetNeighbor function it returns the correct shape and distance for rectangles, but if the object is a polygon it returns the upper edge rather than the closest edge. Example a L shaped polygon turned counter clockwise. 

Is there a way to get the lower edge distance without shape manipulation or stepping points to see in point is in fig, leIsPointInsideFig.

Paul

find long nest on layout

$
0
0

Hi all,

Im about to write a skill that find long nets on  a big layout, that filter from the interface down.

the purpose is to detect long nets that goes around( or  through vias), until they go into an instance. if the total length is over a specified threshold , than the net label should be print out.

i assume the correct way here is to flat the all design ( which is possible - the design is check out), and than select nets that cross the interface and follow them.

the main question is how to account for the via crossing into a new layer , and than continue follow the net on the new layer??

can any one share some experience or ideas?

thx

meny

SpiceIn terminal name mapping

$
0
0

We need to use SpiceIn to build a Cadence schematic from a CDL netlist that was generated from a different schematic entry tool.  Terminal names for primitive devices are not always the same between the netlist generated from the other tool and the existing Cadence symbol.

For example, the rsicr30k Cadence symbol has terminals 'PLUS' and 'MINUS'.  In the other schematic entry tool and in the netlist it generates which we want to read in to Cadence using spiceIn, the terminal names are 'T1' and 'T2'.

CDF provides for this in the termMapping field, but, it does not look like the SpiceIn Device Map file provides for terminal name mapping.  It seems like we could do this by modifying the CDF, but we would need to do so temporarily, i.e. discard these CDF terminal mapping changes after SpiceIn is complete.  Is there an easy way to accomplish this terminal name mapping, preferably without touching the CDF?

How to dynamic change the number to format ( Writes formatted output to a port.) ?

$
0
0

Hi All,

How to dynamic change the number  10 ==> 15 ?  ( Writes formatted output to a port.)

I want 10s is not fixed , it dependents on a interger variable (e.g. a = 10 , a= 15)

fprintf( op "%10s\n" line)  => fprintf( op "%15s\n" line)

Thank you,

Charley

Viewing all 5068 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>