Creating Packages

In order to create subcircuit "chips" we need:
- Package files.
- Subcircuit file.
- Add entry to .xml file.

Since 0.3.12 the proccess to create subcircuits have been automated a bit more, adding a new graphical way to create packages.

For this, there is a new component "Package" in "Other" section, at the end of the component list.
When you add it to the circuit there is just a blue box, that's an empty package ready to be configured:



From here you can load an existing package file to edit it or create a new package.
In the component properties you can set the size of the package in circuit cells. default size is 4x8 cells.
There is also a property to set the type of package:  Chip or Logic Symbol.



Creating new Pins:


If you hover the mouse pointer along the package edges whiles pressing "Shift Key" you will see a gray fake pin.
Then by mouse left-Click a dialog appear to set the properties of the pin.
Once you press OK a new pin will be created at that position with the given name and properties.


  • Pin Name: This is the name that appears in the package.
  • Pin Id: Unique Pin Id.
  • Invert Pin: Pin Shows as inverted.
  • Unused Pin: Inactive Pin





Editing Pins:


You can edit existing pins by right-clicking on the edge of the package at the pin position.
A context menu will appear with pin options:

  • Move: Click and move Pin.
  • Edit: Opens Edit Pin widget.
  • Delete: Remove Pin.



Package types:


There are 2 possible package types: Chip and Logic Symbol.
It is possible to have both options for the same component and switch betwen them:




There are some considerations to have in mind when you create both Chip and Logic Symbol packages for the same component. Both Packages must be Pin-compatible in order to work with the same subcircuit file:

- All active Pins must exist in both packages ( doesn't aply to unused pins).
- Same Pin must have same Id in both packages.

Note that There is an "Id" and a "Label"  for each pin, so a pin can have diferent label in both packages while the Id must be the same.
As an example in the image above, for 74HC74  some pins have slightly different labels: !RD1 vs RD1 for example.

Some of this differences are kind of automated in the package creation, like extra spaces and inverted pins.
For inverted pins you can either use "!" as the first character of the label or set the pin as inverted, in both cases simulide will set the Id as: "!PinName".
It is recomended to use "!PinName" for Chip packages and "PinName"+invert-Pin for Logic Symbol packages, but in some cases you can use "!PinName" for both, for example "!Qn" outputs in 74HC74 package above.


There is a video about creating Logic Symbol Package for 74HC194:
https://youtu.be/E40qK870Df4




Creating Subcircuit:


To create subcircuits just connect your circuit to Fixed Voltage component for inputs and Probe for outputs.
Then Set the names of these inputs & outputs the same as the Pin Ids in the Packages.
Right-click on any empty part os the circuit and click "Create Subcircuit" to get the subcircuit file.

You can do all in one Circuit, as in the image below, with both Chip and Logic Symbol packages and subcircuit.
In this case when you click "Create Subcircuit", 3 files will be created:
- file.package
- file_LS.package
- file.subcircuit




Add entry to .xml file:


These files are located at: share/simulide/data
You can add an entry to an existing xml file or create your own.
Please have a look to ic74.xml to get an idea.

Each entry describes subcircuit name and file location:
    <item name="name"  package="path/to/package_file" subcircuit="path/to/subcircuit_file" ></item>

Subcircuit and package files are ussually located in folders inside data folder, but this is not a must.
Path to these files are relative to "data" folder.