Controlling netlisting parameters

242 views
Skip to first unread message

analog_match

unread,
Jul 12, 2012, 8:30:05 PM7/12/12
to electr...@googlegroups.com
I have been trying to find a way to control parameters to be output in a spice netlist, in addition to the standard parameters that Electric outputs. For example, Electric outputs resistance value for resistors in the spice netlist. But I want to netlist resistor length, width and number of modules. How can I control this? If anyone has done this before, I'd appreciate giving me a clue about where to look and if possible an example.
Thanks

Mitesh Khadgi

unread,
Jul 12, 2012, 11:49:49 PM7/12/12
to electr...@googlegroups.com
Which tool version you are using?

On Fri, Jul 13, 2012 at 6:00 AM, analog_match <ymatch...@gmail.com> wrote:
I have been trying to find a way to control parameters to be output in a spice netlist, in addition to the standard parameters that Electric outputs. For example, Electric outputs resistance value for resistors in the spice netlist. But I want to netlist resistor length, width and number of modules. How can I control this? If anyone has done this before, I'd appreciate giving me a clue about where to look and if possible an example.
Thanks

--
You received this message because you are subscribed to the Google Groups "Electric VLSI Editor" group.
To view this discussion on the web visit https://groups.google.com/d/msg/electricvlsi/-/bH-g48KP5poJ.
To post to this group, send email to electr...@googlegroups.com.
To unsubscribe from this group, send email to electricvlsi...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/electricvlsi?hl=en.



--
Best Regards
Mitesh Khadgi
IIT Madras
Electrical Engineering
EE06B069

Yusuf Matcheswala

unread,
Jul 13, 2012, 9:54:15 AM7/13/12
to electr...@googlegroups.com
I am using Electric v9.02.

analog_match

unread,
Jul 17, 2012, 9:39:49 AM7/17/12
to electr...@googlegroups.com


If any one has found a way to control netlisting parameters please let me know soon. I need this urgently.
Thanks

Steven Rubin

unread,
Jul 17, 2012, 10:08:45 AM7/17/12
to electr...@googlegroups.com
This can be done in a number of ways:

(1) Build your own components and use them instead of the built-in
primitives. For example, instead of using the Resistor primitive in
the schematics technology, create a schematic cell called
"my-resistor" (and an icon cell of the same name that has a resistor
symbol in it). Then add a Spice Template to the schematic cell, which
has an arbitrary line of Spice code in it. This will work for simple objects.

(2) For more complex situations, you can create Spice parameters that
consist of code (either Spice code or Java code). These parameters
can compute arbitrary values based on the context of the cell, etc.
To see examples of such complex cells, look at the logical effort
libraries that come with Electric, and define schematic symbols with
code in them.

-Steven Rubin

Jim Holmes

unread,
Jul 18, 2012, 11:37:01 AM7/18/12
to electr...@googlegroups.com
I have had good luck using this approach:

Independently of electric, create a SPICE subcircuit for the resistor such that it any special parameter processing is done within the subcircuit.  I like this approach because it places parametric calculations under the auspices of SPICE, such that I am not debugging calculations with a netlister in the loop. For example, a spice file called "myres.spi"  could have a SPICE resistor subcircuit that looks like this: (I don't validate its syntax or electrical fidelity):

.subsckt MYRES PLUS MINUS WIDTH=10u LENGTH=1u segments=1 cornertype=0
.param mysheetres=10m
.param mytotalres='segments*(1+cornertype*0.3)*mysheetres*w/l'
r0 PLUS MINUS mytotalres
.ends MYRES

This approach allows you to have a very simple Spice Template for the resistor icon in Electric that works for a wide variety of SPICEs.  The morphology of SPICE is largely in the parameter syntax.  So you could have a different resistor subcircuit tweaked for SPICE3f5 or HSPICE or LTSPICE, but your resistor icon would work for all three flavors.

You can add any arbitrary parameter to the cell (views of the same name), it will be available to the icon, schematic and layout views for use within their corresponding Spice Template strings.  The Spice Templates activate a string replacement mechanism in the netlister.  In this example the cell parameters "segments, and "cornertype" where added to the cell using:

Cell-->Properties--> Cell Parameters

Then a Spice Template was added while editing the icon view:
Tools-->Simulation(SPICE)-->Set Generic SPICE Template)
In this dialogue I suggest you check "Multiline" so that the <Enter> key does not close the dialogue

xmyres_$(node_name) $(PLUS) $(MINUS) MYRES
+WIDTH=$(width)
+LENGTH=$(length)
+SEGMENTS=$(segments)
+CORNERTYPE=$(cornertype)

A few notes:
The "x" at the beginning of the line  is the SPICE letter for a subcircuit
The $(node_name) is the name of the icon instance once it is placed (changes with each instance)
the subcircuit name is MYRES
the $PLUS and $MINUS are the port names of the resistor icon, the netlister replaces these with the instance node names.
the "+" is SPICE's way of doing a line continuation

All that is left to do is add a SPICE declaration in your test bench to include the resistor subcircuit.
While editing your test bench schematic:

Components-->Misc.-->Spice Declaration

.inc ~/wherever/you/keep/your/spice/models/myres.spi

Resistance is a fascinating concept in Electric, since you can attribute resistance to arcs and nodes through the parasitic extraction tool.  So, for the same cell, you'll probably end up with a different Spice Template for the icon (includes contact resistance) view from the layout view (excludes contact resistance) since the contact node will carry its own resistance.

Best Regards,
Jim

analog_match

unread,
Jul 28, 2012, 6:51:52 AM7/28/12
to electr...@googlegroups.com


................. look at the logical effort
libraries that come with Electric, and define schematic symbols with
code in them.

    -Steven Rubin


Hi Steve,

The logical effort libraries you mention.....is this the samples library? How do I see the associated code? Is there aa way to to a text dump of the code attached to the cell?

Thanks

Yusuf 

Steven Rubin

unread,
Jul 28, 2012, 11:33:38 AM7/28/12
to electr...@googlegroups.com
The logical effort libraries can be loaded with Tools / Logical Effort / Logical Effort libraries (Purple, Red, Orange).

This loads three libraries for a generic 180nm technology. Look at one of the Purple schematic cells and you will see all sorts of parameters (accessible from the "Edit / Properties / Cell Parameters..." command).

The "S" parameter is Java code.

If you want to dume this in a readable format, just save the library as a JELIB somewhere. JELIB files are text-readable, and you will be able to see everything in the library (including code). It's a bit difficult to read, but the JELIB file format is documented in the user manual.

  -Steve
--
You received this message because you are subscribed to the Google Groups "Electric VLSI Editor" group.
To view this discussion on the web visit https://groups.google.com/d/msg/electricvlsi/-/4ePqtpInscoJ.

analog_match

unread,
Aug 17, 2012, 8:52:19 AM8/17/12
to electr...@googlegroups.com
Thanks Steve and Jim,
I have been using the suggestions you guys described here and both ideas have been working well. I use 
Edit->Properties->Cell Parameters to add a parameter on a device. The spice template then allows me to netlist this parameter. 

But there are a few bugs:

1. The Edit->Properties->Cell Parameters feature allows me to add only one parameter. Once I add the first parameter the "Create New" button becomes disabled and I cannot add any more parameters.

2. Just as Jim suggested, my spice template has an expression that evaluates resistance value from sheetrho, L and W. However, that expression never seems to get actually passed on to the resistor so the sim results are not correct. Here is my netlist from Electric. I am using ngspice to simulate it:

.param sheetrho = 100.0
.param W=5.0u
.param rval={sheetrho*5.0u/W}
Ryres@0 vin  vout rval TC1=0.002
.param sheetrho = 100.0
.param W=5.0u
.param rval={sheetrho*10.0u/W}
Ryres@1 vout  gnd rval TC1=0.002

* Spice Code nodes in cell cell 'R_divider{sch}'
vin vin 0 DC 1
.tran 1u 5m
.END


Theoretically my vout should be 2/3V per the above netlist. However when I actually run the sim, ngspice reports vout as 1/2V. The vout voltage stays 1/2V for any value of L I choose.

Any further help you can provide for these two issues will be highly appreciated.

Yusuf

Steven Rubin

unread,
Aug 17, 2012, 10:00:16 AM8/17/12
to electr...@googlegroups.com
At 08:52 AM 8/17/2012, you wrote:
>Thanks Steve and Jim,
>I have been using the suggestions you guys described here and both
>ideas have been working well. I use
>Edit->Properties->Cell Parameters to add a parameter on a device.
>The spice template then allows me to netlist this parameter.
>
>But there are a few bugs:
>
>1. The Edit->Properties->Cell Parameters feature allows me to add
>only one parameter. Once I add the first parameter the "Create New"
>button becomes disabled and I cannot add any more parameters.

Type a different parameter name into the field, and the "Create New"
button will be available again.

-Steve

analog_match

unread,
Aug 17, 2012, 12:16:04 PM8/17/12
to electr...@googlegroups.com
Thanks once again Steve. I was able to add the new parameter as per your suggestion. 

Also, for the second part of my question I figured out the mistake I was making. I have been now able to get the correct result. 

Thanks for helping out with these issue and providing detailed feedback.
Reply all
Reply to author
Forward
0 new messages