next up previous contents
Next: Automatic creation of symbols Up: Generation of symbols Previous: Generation of symbols

     
Generation of symbols from scratch

First, leave SPICECAD and start it again typing
Spice 1 -
> cad -s firstsymbol

The '-s' tells SPICECAD that you want to edit a symbol instead of a schematic, and that the name of the symbol is 'firstsymbol'.

A symbol is made up of graphics primitives like lines, polylines, circles, rectangles and text. All these primitives can be placed wherever you want. What is needed , additionally, are contacts to provide connections to the underlying schematic levels which the symbol represents.

 

There is one graphics primitive that has a special meaning. It is a text object, and the textstring has to be '@prop'. If such an object appears at the list of objects, the symbol name and symbol properties will be drawn at the (x,y)-coordinate of the text object. The text object itself will be hidden. If you don't place such a text object, the coordinate where the symbol name and properties will be printed are chosen by default, which more often then doesen't look too great.

If you have forgotten to place this text object, you can do it afterwards, this does not corrupt the database integrity.

 

So now, you know how to create a symbol. Now, we'll connect the symbol to the underlying schematic.     For each contact in the symbol, there has to be a port ( SPICECAD version < 1.7.4 : named pin ) on the corresponding schematic level.

So, if you have finished painting your symbol, don't forget to place an appropriate number of contacts with appropriate names using the edit property- command.

After saving the symbol (CONTROL s or save symbol as), let's call it 'firstsymbol' , in the file 'firstsymbol.sym', this file has to be edited by hand if you want to add local properties to the symbol.

 

What are local properties?

Local properties are useful in a design which contains several symbols of the same type. For example, consider a MOS inverter chain wherein the widths of the transistors increase by a constant factor from stage to stage.

Now, you have two possibilities.

First, you can create as many different inverter symbols as you need for the chain, each of them having different transistor property values. Second, you create an inverter symbol with local symbols 'wpmos' and 'wnmos'. You place this symbol as often as you need it and edit the local symbol properties afterwards.

 

The property syntax inside the symbol definition file (*.sym) is as follows (Example): .
.
.
stop
{wn}
{ln}
{wp}
{lp}
(none)
 

When using the command add symprop inside the symbol menu, you can add as many local properties to the symbol as you like during a symbol editing session.

To give your symbol local properties by hand, you need to add the lines after 'stop' in the symbol file. The number of lines is unlimited, but don't forget to add '(none)' at the end of the local property section. You can increase this number afterwards inside the symbol file. During loading, when SPICECAD sees a difference in the number of local properties and a the number of local properties which have been stored inside the schematic file, only these local properties which have already been defined in the schematics file will be set. All undefined local properties will be set to '(none)'. During netlisting, netlisting will convert '(none)' to 0.0, so, if your simulation results look strange afterwards, please check for local properties which are set to '(none)'.


next up previous contents
Next: Automatic creation of symbols Up: Generation of symbols Previous: Generation of symbols
Martin Maschmann
1999-10-10