Enterprise License Manager
EDWin 2000 ServicePacks
Valor Universal Viewer
PCB Design Services
How to Use the Subcircuit Adapter
The Subcircuit Adapter converts existing SPICE subcircuits into an EDSpice format, that is, a header is added to the subcircuit as SPICE comment lines. This allows a subcircuit to be assigned as a symbol in the Interactive Module, while maintaining compatibility with any other version of SPICE.
Invoking the Subcircuit Adapter
This module may be invoked from Project Explorer in the following ways.
Right click System and select Subcircuits Adapter from the list.
Select Subcircuits Adapter from the Tasklist or from the Task toolbar.
Note: By default, the task toolbar is not displayed. It may be enabled from View menu in the Project Explorer.
Converting and Saving Subcircuits to be used with EDSpice
Select File/ Open and to open the required SPICE netlist file (*.cir) file. The selected SPICE netlist file is opened in the display window Original File.
Subcircuits currently available in the file will be listed in the window Subcircuits. The list will also show the hierarchical relationship between subcircuits, that is, a tree-like structure displaying which subcircuits call the other subcircuits i.e. nesting.
Select a subcircuit from the list by clicking on the name of any subcircuit displayed in the window Subcircuits.
It is must to supply a description for the subcircuit including one for each of the available nodes. The description for each node is entered in the edit box called Node Description. The column ‘Node Type’ allows selecting the node type for the subcircuit. Digital input and digital output nodes can be selected from the dropdown. When this subcircuit is used in a circuit, if required EDSpice will automatically insert proper bridges to the nodes after checking this node type. After giving the proper descriptions, select Edit/ Apply. You can view the file with the strings that are added, in the display window Subcircuit String.
Save the subcircuit to a selected family available in the directory / Eds_SBK. Either the subcircuit may be grouped into a new family or may be saved to the existing one. No special characters are allowed for the family name. The name of the file is made up from the name of the subcircuit appended wi th the extension .SBC. Save option is in File menu.
A circuit block that appears more than once in the overall circuit and consists of SPICE elements can be defined as a subcircuit. The block can be then referenced as a single component, this subcircuit instance, are connected throughout the circuit.
The interactive module of EDSpice allows you to save any circuit as a subcircuit file in a subdirectory on the hard disk specially assigned for this purpose. The format of this file is like any other SPICE netlist. The first line in this file is the .SUBCKT line. Subcircuits stored in one file may in turn call subcircuits stored in other files or these subcircuits may already be grouped in one file. In other words, a single subcircuit file may include several subcircuits that are called by the subcircuit on the highest level. The only thing you cannot have is a recursive subcircuit, that is, a subcircuit cannot call itself.
Following example illustrates the procedure of creating elements in the subcircuit library:
The nominal circuit consists of several 2-input NAND gates and flip-flops. It uses two subcircuits - one performing the logical function of the 2-input NAND and the other performing the function of the flip-flop. The subcircuit containing the flip-flop will make use of the same NAND subcircuit as the nominal circuit. This is known as Nesting, which is commonly used in computer programming.
The first stage is to create a schematic diagram of the circuit performing the function of a NAND gate. This may be done using common circuit elements, simulated by SPICE - NPN transistors, diodes and resistors. The circuit may then be analyzed by the simulator to ensure that it’s properly functioning. When validation is completed, the circuit is stored in a subcircuit subdirectory under a unique name, say 2NAND. This is achieved by defining the subcircuits I/O nodes and saving it as a subcircuit. To save a subcircuit select the Save As Subcircuit option from the File menu of EDSpice Editor.
The next stage is to create a circuit, which executes the function of the flip-flop. This may be done using several 2-input NAND gates. The schematic diagram of the flipflop circuit will contain the required number of components each using the same 2NAND symbol fetched from the Symbol Library. The previously saved 2NAND subcircuit may be linked to this symbol. Its logic function will automatically be assigned to all components (circuit elements) using this symbol for graphical representation on the schematic. When the netlist, for the flip-flop circuit, is generated for simulation, the 2NAND subcircuit is automatically appended to this file. After validation, the flip-flop subcircuit is ready for storage in the library. The resulting file (named for example FLPFLP) will contain two subcircuits - the highest level FLPFLP and appended to it a sub subcircuit, 2NAND. The NAND symbol linked to the 2NAND subcircuit should be stored in the Symbol Library.
Note: Subcircuit names, according to SPICE netlist syntax, ca nnot be longer than 7 characters.
In the final stage, the nominal circuit is created using NAND gates and flip -flops. If the NAND symbol is already linked to its 2NAND subcircuit, it will be recognized automatically while the circuit is preprocessed by the interactive module. The symbol used by the flip-flop components should in turn be linked to the FLPFLP subcircuit. The netlist file for the nominal circuit will contain both FLPFLP and 2NAND subcircuits. The same subcircuit 2NAND is called from the nominal circuit level and from the lower level subcircuit FLPFLP.
Assuming that the nominal circuit is a binary four bit counter, it may be subsequently stored as a subcircuit file in the library. The depth of nesting is practically limited by the size of the memory.
Before a subcircuit is stored in the subcircuit library, you should ensure that there is a proper link to its symbol. The interactive module includes functions that allow you to select nets in the circuit and assign them as input/output nodes of a subcircuit. This information is stored as comment lines in a special format (a header). The general form of the subcircuit header in the EDSpice Subcircuit Library is as follows: -
.SUBCKT subname node1 node2 node3
a. subcircuit description, number of nodes
b. description of node 1
c. description of node 2
The subname must have the same name, as the file name, under which it is stored in the library. The comment lines are automatically added by EDSpice and may then be defined by the user. Node descriptions may be entered while selecting the input/output nodes. The subcircuit description may be added prior to the saving procedure. In the case of the 2NAND subcircuit, mentioned above, the header may look like this:-
.SUBCKT 2NAND 1 2 3
a. Two Input NAND Gate, 3
b. Input 1
c. Input 2
Users who have already used SPICE may have in their possession a number of netlist files containing subcircuits. These subcircuits may be used in EDSpice after small adjustments. There is a feature that allows you to extract subcircuits from netlist files and append them to the subcircuit library. This feature is called the Subcircuits Adapter. The adaptation procedure is necessary as it ensures that each subcircuit stored in the library has a proper header, as described above. Without this header, the link from a subcircuit to its symbol would be impossible.
Note: SPICE netlist containing subcircuits can be simulated by EDSpice without any modification, if you do not want to connect them to a symbol and store them in the subcircuit library. Also, subcircuits taken from the subcircuit library can be used without modification on other SPICE packages.
The adaptation procedure begins with the selection of a subcircuit from a list of subcircuits contained in the file you want appended to the library. Before the selected subcircuit is extracted, the system will prompt you for the necessary information required for the header. This information includes text describing the function of the subcircuit and its input/output nodes. The hea der is automatically inserted in the subcircuit file when it is stored in the library. As mentioned earlier, the header is composed of comment lines, therefore, the simulator ignores it. Headers are used internally by EDSpice to aid the user in linking subcircuits to circuit elements.
Files in the subcircuit library are stored as plain ASCII text files and as such may be appended manually (if required) to any SPICE netlist file for input to other SPICE simulators.
Note: EDSpice assumes that all I/O nodes of a subcircuit is of type analog. So if digital components are used in a subcircuit proper AD/ DA interface has to be used so that all I/ O nodes of subcircuit are analog.
Valor Universal Viewer
Simulation Model Support
Copyright © Visionics Sweden HB. Visionics is a trade name of Visionics Sweden HB. All Rights Reserved.