In this tutorial we will look at some more advanced operations on subcircuit blocks, such as the use of bundle pins and making custom modifications to block symbols. More information on subcircuits can be found in Subcircuits and Hierarchy.
You must also read the section on Bundles for detailed description on bundle pin and signal usage rules.
5.5.1 Creating a Bundle Port Connector
Create a new, empty design using the "New" command in the "File" menu.
In the Options menu, select the Subcircuit sub-menu and then the New Port Connector command.
Click on the Bundle option, then enter the text "L0..5" in the Pin Name or Range box. Make sure this is L, zero, two dots and 5. This specifies a range of numbered pins.
Click the Add Power button to add the pins to the list.
In the Port Name box, type "L".
Click the Place button. This returns us to the schematic diagram in device placing mode.
Use the left and right arrow keys on the keyboard, if necessary, to orient the port connector as shown, and place it to the left on the diagram.
Repeat the above procedure, using the New Port Connector command to create a bundle port with pins "R0..5" and named "R".
Place the new port connector to the right on the diagram, as shown.
L R
5.5.2 Connecting to the Bundle
Click at the end of the pin on the L port connector and extend a short bundle line, as shown.
Right-click anywhere along the bundle line and select the Breakout command. You should see the text "L0..5" already placed in the Pins List box.
Click OK to create the breakout symbol.
Place the breakout as shown, so that it connects with the bundle.
This new breakout symbol will give us access to the individual signals inside the bundle.
Repeat the above procedure for the R port connector, using the Breakout command to create circuit as shown at left. As before, you may need to use the arrow keys on the keyboard to orient the breakout symbol in the right direction.
5.5.3 Adding Circuit Elements
Place circuit elements connecting the two bundles. In this case, we have used the part "R small" for all six lines, but the exact circuit is not important for this tutorial.
Use the Save command in the File menu to save the file as "Tutorial Bundle Subcircuit" in any convenient location. This is only for safekeeping, it is not a necessary part of this procedure, but is useful in case we discover errors later and wish to return.
L R
This movie demonstrates the above steps.
5.5.4 Creating the Subcircuit Block
Use the Select All command in the Edit menu to select all of the items in the circuit we have just created.
Select the Create Subcircuit Block command in the Subcircuit submenu of the Options menu.
Select the Quick Subcircuit option and enter the name "RL" or any other valid name.
Click the Finish button.
L R
DEV1
The Quick Subcircuit option has cut the selected elements from the circuit and placed them in a subcircuit block with a default symbol.
5.5.5 Verifying the Subcircuit Block
Double-click on the block symbol to see its internal circuit and verify our original circuit is there as desired.
Close the subcircuit window again to return to the parent circuit.
Right-click near the end of the R pin on the block symbol and select the "Bundle Info"
command.
Verify that the bundle contains the signals R0 to R5 that we specified.
5.5.6 Modifying Bundle Connections on a Subcircuit Block
Right-click on the R pin, but this time, click close to the symbol body so that we get the pin information menu, as shown.
Select the Bundle Pin Info command.
Click the Add Pins button.
Enter two names, CTRL and SYNC, separated by a blank space, as shown.
Select the Pin Type as Input. NOTE: This selection is important as it determines what type of signals can be attached to this pin.
Click OK.
Click Done on the bundle pin info box.
You will receive a warning that you have made a structural modification to the device. Click OK to confirm the change. If you have not unlocked the subcircuit, it will give you a warning message, but the program will actually automatically unlock the subcircuit.
This operation has actually had a number of effects on the design:
Two new internal pins have been added to the select bundle pin.
Two new signals with the same names have been added to the attached bundle.
The port connector in the internal circuit has had the same two pins added.
The two corresponding signals have been added to the attached bundle in the internal circuit.
The above operation has made the new internal pins available inside the bundle and it is now our job to make whatever connections are needed to these pins inside the internal circuit.
Double-click on the block symbol to open the subcircuit. You will notice that the internal circuit looks exactly the same as before. The above changes have only affected the list of internal signals in the R bundle and have not made any visible circuit change.
Right-click anywhere along the R bundle (but not to close to either the port connect or the breakout symbols) and select the Breakout command. You will see that the default entries in this box now include the CTRL and SYNC signals that we added above.
Delete the text "R0..5" so that we are creating a breakout only for the new signals, then click OK.
Place the new breakout as shown so that it attaches to the R bundle.
This movie demonstrates the above steps.
NOTE: It is important that the new breakout symbol touches the existing R bundle so that it connects to it. If you place the new breakout separately, you have created another, unconnected bundle containing two signals.
If desired, place some circuit elements in the subcircuit and connect to the breakout. In this case, we have added the device PI Control (constant). The exact circuit connections are not important for this tutorial.
Note that since we selected the Input pin type when we added the bundle internal pins, these signals are control inputs to the subcircuit and can only be connected to to control inputs on the attached devices.
Close the subcircuit window to return to the parent design.
5.5.7 Modifying the Symbol for a Block on a Schematic
Right-click on the block symbol in the top-level circuit and select the Edit Symbol command.
This will open the symbol in the symbol editor.
Move the R pin and expand the box so that it appears roughly as shown.
5.5.8 Adding Pins to an Existing Block Symbol
Click on the left-facing pin tool in the symbol editor’s toolbar.
Place a new pin on the left-hand side of the symbol, as shown.
Press the spacebar to terminate pin placement.
Double-click on the new pin in the pin list and change the name to TEST1.
Set the Pin Function to Power, if it isn’t already.
5.5.9 Updating the Symbol on the Schematic
Click the close box (X) in the upper right corner of the symbol editor window and click Yes to confirm that you wish to save your changes to the symbol. The symbol on the schematic will be updated with the new version.
Double-click on the new symbol to open the internal circuit. Note that there is no change to the internal circuit.
Close the internal circuit again. You should receive an error message indicating that the port TEST1 has no matching port connector.
IMPORTANT: Whenever you make manual changes to a block symbol such as this, it is your responsibility to update the internal circuit, adding any necessary port connectors and circuitry needed to make it valid.
5.5.10 Updating the Port Interface
Double-click again on the symbol to reopen the internal circuit.
Select the New Port Connector command in the Subcircuit sub-menu of the Options menu.
Select the Power port type and enter TEST1 for the port name.
Click the Place button and then place the port connector anywhere on the diagram.
L
Close the internal circuit window again. This time you should get no error message.
This procedure could have been also started by adding the port TEST1 in the subcircuit and then modifying the device symbol to account for it.