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




On Thursday, July 12, 2012 7:30:05 PM UTC-5, analog_match 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/-/vT96jo8xLGAJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/electricvlsi?hl=en.

Reply via email to