Creating a Component and a Hierarchical Schematic


1. What you will learn

    1.1 How to create a more complex schematic using multiple components and internal nets in Design Architect .
    1.2 How to create a symbol for the schematic you've created using Design Architect .
    1.3 How to instantiate this symbol in another schematic to construct a larger system.
    1.4 How to simulate the resulting hierarchical design using Quicksim II .

2. Create a schematic for a half adder

    2.1 Be sure you are still in your tutorials directory and start DA :

>> da &

    2.2 Open a new schematic sheet for a component called ha (half adder) and create a schematic like the one below using parts from the gen_lib library:

    Note that portin and portout components have been placed on the inputs and the outputs of the schematic. When the portin and portout components are placed, they have a generic name of net . This is simply a property that can easily be changed to the required value by placing the cursor on top of the name and pressing the <shift> and <F7> keys simultaneously, and typing the new name in the New Value field of the Change Property Value dialog box the comes up, as you did in lab 1. Be sure to change the rise and fall times for the xor2 and and2 components as shown also.

    2.3 Use the Check->Sheet and File->Save Sheet menu items to check and save the sheet as you have done before. There should be no errors or warnings. Close the Check sheet window.

3. Create a symbol for the half adder component

    3.2 Add Comp and Inst properties to the symbol. Use the View->Zoom Out menu item to make the symbol smaller in the window, and select the body of the symbol (the box) by clicking on it with the left mouse button.

    Use the Add->Properties->Repeat Adding Single Properties...->Use Current Selection... item in the pop-up, Symbol Body & Pins context sensitive menu to bring up the Add Property dialog box. Select the COMP item in the Existing Property Name field, and type HA in the Property Value field and click OK . A ghost image of the HA property appears in the symbol window when the cursor is placed in. Move the HA property into the center of the symbol and place it there using the left mouse button.

    Note that the Add Property dialog box comes up again. This time, select INST in the Existing Property Name field, and type ? in the Property Value field and click OK . Place the ? property below the symbol body.

    This time, when the Add Property dialog box reappears, close it by clicking Cancel . The symbol should now look like the one below.

    3.3 Check the symbol using the Check-With Defaults menu item. You can ignore the warnings about the pins and properties not being on the interface. This simply means that the pins and properties have not been added to the interface file that ties the schematic and its associated symbol together (the part file). You always get this warning when you initial create a symbol because the interface has not been created. If you later came back and modified or added pins or properties to the symbol, you would get the same types of warnings.You should always be careful in modifying a symbol for a component that already exists, as you can create a mismatch between the symbol and schematic that will make the component impossible to simulate.

    Close the Check Symbol transcript window.

    3.4 Use the File->Save Symbol menu item to save the symbol and close the symbol window. You should now be back to the original ha schematic.

    3.5 Once you have created a symbol for a schematic, you should always check to insure that the schematic matches the symbol (pins and properties are the same and have the same names). You do this by using the Check->Schematic menu item when checking the schematic instead of the Check->Sheet menu item. Check-> Schematic not only checks the schematic sheet, but checks the schematic's interface to the symbol. Select the Check->Schematic menu item now and notice how, in the Check Schematic transcript window, you not only have the normal checks listed, but 4 new "Check Schematic..." items are listed. There should be no warnings or errors in this Check Schematic window. Close it and close the HA schematic window as well.

4. Create a full adder schematic using the previously design HA component

5. Simulate the full adder using Quicksim

    5.1 Start Quicksim on the fa component:

>> quicksim -tim typ fa &

    The default Quicksim window should appear.

    5.2 Open the sheet as you did before in Quicksim and use the Select->Area->Nets item in the pop-up menus in the sheet window to bring up the Select Area dialog box. Draw a box around the entire schematic and all of the nets will be selected. Use the Add->Traces->Selected item in the pop-up menus to add all of the signals to a trace window. Unselect all of the signals using the Unselect->All item from the pop-up menus.

    Note that you can trace signals in lower level components such as the half adders. Select the ha1 component by clicking on it and use the Open->Down item from the pop-up menu. Notice that the schematic sheet for the ha component appears in another window with the label ha1 . Select the B signal in that window by clicking on it and use the Add->Traces->Selected item from the pop-up menu to add the signal to the trace window. The signal will be labeled /ha1/B in the trace window. Note that the /ha1 portion of the label indicates the instance name of the component who's signal this is. If the B signal from the ha2 component had been added, it would be labeled /ha2/B . That's why its important to add instance names that you'll recognize to each component on a schematic!

    5.3 Select each of the A , B , and CI signals and use the Force->Multiple Values... item from the pop-up menus to add the following forces to each (note that an NC entry means to retain the previous value - don't add a force to that input at that time):

    Time (ns)

    A

    B

    CI

    0

    0

    0

    0

    20

    1

    1

    NC

    40

    0

    NC

    NC

    60

    NC

    NC

    1

    80

    1

    0

    0

    100

    NC

    NC

    1

    120

    0

    NC

    NC

    140

    NC

    NC

    0

    160

    1

    1

    1

    5.4 Run the simulation for 180 ns by typing run 180 in the Quicksim window and hitting a <CR> .

    Make the traces window the active window and use the View->All menu item to expand the simulation results. The resulting trace window should look something like the one below (the order the signals appear in your trace window may be different - you can select each one and use the Edit->Move item from the pop-up menu in the trace window to move them):

    5.5 Exit Quicksim as you have before.

6. Modify the ha component to allow customized rise and fall times (optional)

>> da &

    Open the symbol by clicking on the button. When the Open Symbol dialog box comes up, click on the Navigator... button and select the ha component and click OK . The symbol for the ha component should appear in a symbol window.

    6.2 Add the rise and fall properties for the S and CO outputs. Select the "wire" leading out the S pin by clicking on it. Use the Properties->Add->Repeat Adding Single Properties->Use Current Selection... item from the pop-up menu to bring up the Add Property dialog box. Type srise in the New Property Name field and 0 in the Property Value field and click OK . Place the property below the S output and add another property called sfall with value 0 below it. Click Cancel in the Add Property box when it comes up the third time to remove it.

    Notice that the property text is fairly large. This is fine from a functionality standpoint, but you might want to make it smaller for aesthetics. Unselect the wire and use the Select->Area->Property: item from the pop-up menus to bring up the Select Area dialog box. Draw a box around the srise and sfall properties (the two 0s) to select them. Use the Change Height->0.5 X Pins Spacing item from the pop-up menu to make the property text smaller. You can also adjust their position by selecting each one individually and using the Move->Selected item from the pop-up menus.

    Add corise and cofall properties to the "wire" leading to the CO output in a similar manner. Your symbol for the ha component should now look like the one below:

      6.3 Check the symbol using the Check->With Defaults item from the DA window menus. You can ignore the warnings about the srise , corise , sfall and cofall properties not being on the interface.

      6.4 Save the symbol using the File->Save Symbol item from the DA window menus. Close the symbol window.

      6.5 You will now modify the schematic so that the rise times and fall times for the gates that drive the S and CO outputs derive their rise and fall times from the new properties that you've added to the ha symbol. Open the schematic sheet for the ha component. Place the cursor over the rise property for the xor2 gate that drives the S output (the top property that currently has the value of 6) and press <Shift> <F7> to bring up the Change Property Value dialog box. Type in (srise) in the New Value field, and use the down arrow button in the Type field to set its value to expression . Click OK . Setting the value to (srise) and the type to expression tells the Mentor tools that the value for this property comes from the srise property on the symbol for this schematic sheet. Set the value for the fall property of the xor2 gate to (sfall) with type expression in a similar manner. Finally, set the rise and fall properties of the and2 component driving the CO output to values of (corise) and (cofall) with type expression as well. Your ha schematic should now look like this:

      6.6 Check the sheet using Check->Schematic from the DA window menus. No errors or warnings should appear in the transcript window. Note that if you had made an error in typing one of the names of the property values, you would have gotten an error in the Check Schematic area that said that the property value didn't match an existing property on the symbol. That's why its important to use Check->Schematic instead of Check->Sheet when checking schematics of designs that have a corresponding symbol.

      Close the transcript window and use File->Save Sheet to save the sheet. Close the ha schematic window.

7. Update the fa schematic to use the new version of the ha component (optional)

    7.2 Check and save the fa sheet. Close DA .

    7.3 Use Quicksim to simulate the fa design as before and notice how the new delays affect the timing of the outputs.