Getting started with Mentor^{1}

CS/ECE 552-2 Prof: Guri Sohi TA: Bhavesh Mehta

Fall 2003

1 Introduction

The Mentor Graphics system is a complete, integrated package for digital system design, simulation and IC layout. In addition, it has a variety of tools related to Printed Circuit Board (PCB) design and analysis.

For purposes of CS552, we are interested in the schematic capture and simulation of digital circuits capabilities of Mentor. The components of the system we are going to use are:

• Design Manager (dmgr)

• Design Architect (da)

• QuicksimII (quicksim)

• MGC Online Help (mgc acro)

We will be using the nova UltraSPARC 10s in the Computer Sciences building. The sol machines will execute the Mentor Graphics software very slowly.

2 Setting up your environment

Put the following at the end of your .cshrc.local file in your home directory:

1See the acknowledgements at the back of this document for its history.

     setenv MGC HOME /s/mentor/
     setenv MGC WD $HOME/mentor
     setenv MGC LOCATION MAP $HOME/mentor/.location
     set path = ($path /s/mentor/bin)

Now type the following to your shell (start in your home directory):

     source .cshrc (for the first time only)
     mkdir mentor
     cd mentor
     cp ~cs552-2/public/Mentor/.location .location

Edit your .location file and replace the last line with the path to your mentor directory. Mentor applications use the .location file (called location map) to determine the location in the file system of the libraries they may need.

3 Design Manager

Design Manager or dmgr for short, is the tool for managing your designs. It provides for:

• Navigation through the filesystem.

• Manipulation (copy/move) of design objects.

• Launching of the various mentor tools.

Dmgr is the tool you should run first and normally you would like to invoke all other tools through it.

To invoke Design Manager type dmgr on your shell prompt. You should make sure that you are in your ~/mentor directory when running dmgr.

After dmgr starts up, you will see three windows and a menu bar at the top. The leftmost window is the tools window where each icon represents a mentor tool. We are interested in the design arch and the QuicksimII icons. Icons appear alphabeticaly and it should not be hard to locate them. Use the scroll bars located on the right side of the Tools window to move up and down. Double-clicking on an icon launches that tool.

The window at the center is the navigator window which you can use to browse the filesystem. Since Mentor uses files to store the objects of your designs these appear as icons in the Navigator window.

Finally the window on the right side provides shortcuts to various menu options. Depending on which window is currently active it will provide shortcuts to the actions available. If either the Tools or the Navigator window does not show up you can click at the corresponding icons to open a copies of them.

Pressing the mouse’s right button opens a menu whose options depend on where the cursor is located. For example you can turn on the scroll bars of the Tools window using the corresponding option. The left mouse button is used to perform actions. For example, in the Tools window, double clicking on a tool icon invokes that tool. We will explain the use of the middle button when talking about Design Architect.

Do not use shell commands to move or copy design objects! Use dmgr to do it when it is necessary.

4 MGC Online Help

Mgc acro is the online help system of Mentor graphics. All of the documentation for the Mentor tools can be accessed through this tool. To access these documents you have to launch the built in Acrobat reader: either double click on the “mgc acro” icon in the Tools window or select the “Help” option from the menu bar. To open the documents from the browser, pull down the MCG menu and choose “View ... Bookcases” Select the bookcase on the tool or topic that you are interested in from the pop-up list. After selecting a bookcase, a menu of documents that falls into that catagory will be displayed.

The following documents are useful:

• “Getting Started with the Falcon Framework Training Workbook” in the \underline{Falcon Framework} book. This includes information about the Design Manager and using the Bold Browser to access the on-line documentation. Most of the important information here is also contained in “Design Architect Training Workbook.”

• “Design Architect Training Workbook” in the \underline{Design Creation} book. This includes information about using the help system and creating individual circuits and circuit hierarchies.

• “Getting Started with Design Architect Trainging Workbook” in the \underline{Design Creation} book. This is a less complete and shorter version of “Design Architect Training Workbook.”

• “QuickSim II Training Workbook” in the \underline{Digital Simulation} book. This covers the use of QuickSimII, including setting up input signals and creating traces.

• “Getting Started with QuickSimII” in the \underline{Digital Simulation} book. This is a less complete and shorter version of “QuickSim II Training Workbook.”

• “Design Architect User’s Manual” and “Design Architect Reference Manual” in the \underline{Design Creation} book. Use these as a reference by looking at the index.

• “QuickSim II User’s Manual” in the \underline{Digital Simulation} book. Use this as a reference by looking at the index.

Other useful documents appear in the books listed above. You can identify what will be useful to you by looking through the bookcase entries for each tool. There are also some Quick Reference cards available online.

5 Design Architect

Design Architect or da for short, is the schematic capture tool. To get started find the “design arch” icon in the Tools window in dmgr and launch it by double clicking on it. Alternatively you can invoke it directly from a shell by typing in da.

Here are few points regarding da.

• Once da is open you will a see a menu bar at the top, on the left side a large blank window, on the right two smaller windows, and at the bottom a series of boxes marked F1 to F12 which describe the binding of the keyboard’s function keys. Under the function keys description boxes there is an empty row which da uses to provide information or report error messages.

• The top right window is called the Symbol Window. It is used to display objects you can place in your schematic. The window at the bottom right is called the Session Pallette. While you are working with da, various menus will appear within this window. The window at the left, which initially will be empty, is used to display the active design and is called the Context Window.

• You can select which windows will be opened each time you run da through the MGC > Setup > Session options.

5.1 Opening a new schematic sheet

The first thing you need to do if you have not already created a schematic sheet is to open a new one. To do so click on the Open Sheet icon in the session window or alternatively do File > Open > Sheet. Note that while the cursor is over the session window you can use the right mouse button to add scroll bars etc. Due to some bug in the software you might find the Session window blank. To fix this problem, press the right mouse button in the window and select Show Scroll Bars or Hide Scroll Bars.

You will be asked to provide a name for your design in the dialogue box that appears. Enter the name in the Component box (see the Overview file for an explanation of the relations between components and sheets). Include your full path in the name, i. e. if you want to name your design as and gate then type your home path/mentor/and gate in the component

box (e. g. /u/b/s/bsmehta/mentor/and gate).

Then a new window will appear titled:

     Schematic#1 and gate sheet1

This is the window in which you will do the actual drawing. Note also that the session pallette has changed to schematic add route which provides shortcuts to various commands that are used in drawing schematics. There are more icons available. To access them press the mouse’s right button while the cursor is on the pallette and turn on the scrollbars.

5.2 Commands

Commands are available from the Session pallette icons or through the menu bar. Common commands include:

Undo : Click on the Undo icon or Edit>Undo.

Redo : Edit>Redo.

Zoom : Zoom in/out icon, or View > Zoom In /View > Zoom Out.

View : • Viewing the whole schematic: View > All.

• Viewing a selected area: View > Area.

Note that all these commands can be activated using function keys also.

5.3 Instantiating Components

To place a component like an AND gate in your design you must first select a library that contains it. For our purposes gen lib (generic library) is the most useful one. You can see what libraries are available and open them by clicking on the library icon in session pallette. Alternatively, you can see the available libraries by doing Libraries > MGC Digital Libraries > Display Libraries Pallette.

The session pallette changes title to “MGC Digital Libraries.” Again you have to activate the scrollbars. Using the vertical one search for the “gen lib ”option. Note that library names appear in alphabetical order. Click once on the “gen lib” option and the session pallette will change to “gen lib” providing you with access to the various components of “gen lib.”

To instantiate a component, for instance and2, choose it from the session pallette by clicking it. Move the cursor to the schematic window and click the mouse’s left button to place the component.

5.4 Connecting Components

We will now draw the wires for our simple design. To draw a wire you have to access the “Add” menu. Go over the schematic window and click the right button. A menu titled INSTANCE will pop up. Walk down the “Other Menus” option and select the “Add Menu” option. In place of the “instance” menu a new one called “Add” will appear.

To connect the components choose Add > Wire option. Click on a pin ( with mouse’s left button) to start the net, and click once to place a vertex, or to connect to another pin. Double click to end the net. Alternately, you can use function key F3 to start the net.

After drawing, press ESC or click on cancel to stop drawing wires.

5.5 Selecting / Unselecting

This will be helpful in making corrections like deleting objects, moving them around etc. To select an object click (mouse’s left button) on it once and to remove it from to the current selection click on it again. To add other objects to the current selection click on them once.

Selected objects are indicated by being drawn with white dashed line segments.

You can select all objcts within an area by dragging out a rectangle with the left button.

Edit > Unselect > All is very useful for unselecting everything. Function key F2 does the same.

5.6 Editing objects

You can delete by: Edit > Edit Commands > Edit operations > Delete or using the Delete icon of the session pallette. Similarly you can copy or move objects by : Edit > Edit commands > Edit operations > Copy(or Move) and drag to the new location. You can also use the Copy/Move icons in the session pallette.

5.7 Ports and Net names

To complete our design we have to specify its inputs and outputs. To do so we have to use the “gen lib” parts “portin” and “portout”. You can also access them through the menu in the symbol window: Active Symbol Window > Symbol History [c-H] > List. Alternately, you can get them from “gen lib”( see Instantiating Components).

You will notice that each “portin” and “portout” has a text label which reads “NET” for every instance. These need to be changed to unique names. To do this open the Schematic menu (right button over the schematic window) and do a Other Menus > Property/Text Menu > Change Values. A Dialog box will appear. Enter as many net names as there are portins and portouts. When you click OK, you will be prompted to click on the nets one at a time. Click on the first label (“NET”) to rename it to the first signal name you typed into the dialog box. Continue doing this until all “NET”s have been converted to the names you specified.

5.8 Checking for Errors

You can check if there are any errors in your schematic by doing a Check > Sheet > With Defaults. A new window will appear after a while reporting what the automatic checker has found. This is called a Report window. If your schematic is ok then you should get “ 0 Errors, 0 Warnings”. Otherwise information about what is incorrect will be available. Close this window by clicking twice on the small rectangle on the upper left corner.

5.9 Saving the schematic sheet

Now that your design is complete you have to save it. For saving the sheet choose File > Save Sheet. If this option is not available then make the schematic window active by clicking once on it.

5.10 Printing

To print the currently active window (the topmost window with cyan borders) in da or QuickSimII choose: File > Print Sheet.

You will be asked to enter a printer name. Use mgc-laser. Otherwise you will get a bunch of meaningless pages as printout.

5.11 Closing your schematic

Pull down the menu on the left side of the title bar of the schematic window (box with a line in it) and select “Close.”

5.12 Closing Design Architect

Pull down the menu on the left side of the title bar of the Design Architect window and select “Close.”

6 QuickSimII

QuickSimII, qs for short, is a simulator for digital circuits. You can simulate your Design Architect schematics to validate their correctness. You add “traces” to watch signals change in a graphical “logic analyzer” format, and add “forces” to apply stimuli to different networks in your design.

6.1 Starting QuickSimII

Find the QuickSimII icon in the Tools window of dmgr and double-click on it. A dialog box will pop up and you will be asked to enter the name of the component to be simulated. Again, you have to enter the full path name e. g. /u/b/s/bsmehta/mentor/and gate. Alternatively, you can select a design object in the Navigator window (such as your “and gate” project) and press the right mouse button. Choosing the Open > QuicksimII will invoke QuickSimII on that design.

6.2 Opening a sheet

From the Setup window click on the “OPEN SHEET” icon or alternatively choose File > Open Sheet. A dialog box will appear with a selection of available sheets. Select your “and gate” sheet by clicking on it so to to inverse the colors and then click on the OK button.

A new window will appear with your schematic in it.

6.3 Adding traces

To prepare to view signals you have to specify which of them interest you. You can select a signal by clicking on the wire leading into the port. When you’ve finished making your selection choose Add > Traces > Selected from the menu accessed through the right button while in the Schematic window. This will cause a Trace window to appear at the bottom of the screen.

Alternatively you can choose Add > Traces > Specified then click on the “Named Signals” button of the dialog box that will appear. You will be then asked to type the names of the signals you are interested in.

6.4 Adding Forces

Traces correspond to probes placed in your design. Signal stimuli are called “Forces” in QSII. To add a single force, choose Force > Single Value… by pressing the right button in the Schematic window. Enter the signal name that you want to stimulate, and specify the value that it should take (0 or 1), and enter the start and stop times ( by default in nanoseconds) to indicate when it should take the aforementioned values. You can force multiple values onto a signal by choosing the Force > Multiple Values… menu. Once again, enter the signal name and a list of force values and “times”. The time specifies the instant at which the corresponding force value should be applied. Alternately, you can click on the “Stimulus” button in the Session window and then use the ADD FORCE icon to add forces to signals.

You can force clock on a signal by choosing Force > Clock. Once again, you enter the signal which you want to put a clock waveform onto. Enter the period of the clock, and the two transition times and values within the clock period. For instance, for a 100ns clock with 50% duty cycle, enter 100 as period, value 1 at time 0 and value 0 at time 50. Clock are alternating signals.

6.5 Running the simulation

Now that you have traces and forces set up, you are ready to run the simulation. This is done by either clicking on the “Run” button of the Session window or by Run > Simulation, and specifying how many nanoseconds to run the simulation. Alternately, you can simply type “run nnn” with cursor inside the QSII window, where nnn is the number of nanoseconds to run the simulation. You will see traces appear in the trace window.

6.6 Resetting the Simulator

Choose the Run > Reset… menu. Click on the “State” button to reset the state of the simulator back to time=0. If you do not want the results to be saved then uncheck the Save “results… ” button. Click OK to reset.

6.7 Saving your forces

You can save any forces you have entered in one of two ways: as a Waveform Data Base (WDB) or as a Force File. A WBD is a compact, binary representation of any set of waveforms. A Force File is human-readable text file which describes what signals are stimulated at what time. You can also create a Force File using any text editor and load it with Force > From File. …

To save your forces choose File > Save > Waveform DB. From the dialog box that will appear you can choose the type of the file that is going to be saved.

6.8 Printing

For printing choose: File > Print > Active Window. Use mgc-laser as the printer name. If your are printing a Trace window you need to specify from what time to print out.

6.9 Quitting the simulator

When you are done simulating, you can quit QSII by pulling down the menu in the title bar (box on the upper left corner) and choosing “Close.”

7 Hierarchical design: Creating and using symbols

Hierarchical design is a technique used to simplify the design of the large circuits. For example, to build a 32 bit adder it is easier to construct the adder using 32 full adders. In this section we discuss how to create a symbol for a part that you have designed and then use that symbol to build large circuits.

7.1 Creating a symbol

• Start Design Architect.

• Open the schematic that you want to make into a symbol

• Choose: Miscellaneous − > Generate Symbol

• Choosing OK will generate a symbol with the same name as the open schematic

• Check the symbol: Check − > With Defaults.

• Save the symbol: File − > Save Symbol.

7.2 Instantiating a symbol

Suppose you have created a symbol of a full adder and want to use it as the building block when designing the schematic for the 32 bit adder. This can be done by selecting the Choose Symbol icon in the session palette of the Design Architect. Select the symbol you want to instantiate and press OK.

8 Creating and ripping buses

Buses let you represent multiple signal lines without drawing each one of them. This helps in efficient design creation and representation.

8.1 Creating a bus

• Select Net > Add Bus to draw the bus. It is similar to adding wires.

• The only thing that differentiates a bus from a wire is its Property value. The property value for the bus is of the form “bus net name (msb:lsb)” e. g. “sum(3:0)” for a 4 bit wide bus. Unselect the bus and select a single vertex of the bus. To fix the property value of the bus, select Net > Name Nets. Enter the property value (e. g. “sum(3:0)”) in the Property Value box of the dialog box. Click OK and place the text in the schematic by clicking on the left mouse button.

8.2 Ripping a bus

On a schematic sheet, you may be required to run individual lines from the bus to either another bus or a component. The easiest way to do this is to just connect the named bus to another wire or bus as normal. A box will prompt you for the bits you want to rip. Enter that value. Doing this takes advantage of the Automatic Ripper. To do the same thing by hand, you nee a component called a bus ripper . This component is available in “gen lib” under the submenu “rip”. To connect individual lines of an n bit wide bus you have to use the nX1 ripper. After instantiating the ripper you can go back to the “gen lib” menu by selecting “Back” in the palette window.

To connect the ripper to the bus follow the steps below:

• Flip/Rotate the ripper so that the wire ends of the ripper face the wires of the circuit you want to connect them to.

• Use the Net > Add Wire choice to connect the wire ends of the ripper to the appropriate nets/pins.

• Note that each of the wire ends has a “R” near it. This is the Rule Property of the wire end and stands for the line of the bus that is connected to that wire. For example, to connect line 2 of the bus to a wire, you have to change the corresponding “R” to “2”. Since all the “R”s will have to be changed to sequential numbers you can do this in one step. Select Text > Sequence Text. Type “0” in the Beginning Index Number and “1” in the Step By text box and click OK. Click on the “R”s one after another to change them to “0,” “1,” “2” and so on until you have done all the “R”s.

• Connect the bundle (thick) end of the ripper to the bus using the usual Net > Add Bus menu choice. Note that you do not have to perform any special actions here.

9 Mouse’s Middle Button

Mentor uses the middle button in an very interesting way. Go over any window and press it. While keeping it pressed try to draw a question mark without a dot. You should see a red line that follows your trace. A help window should pop up...

10 Acknowledgements

This file is based on a previous text written by Ashish Thusoo (for CS552 Fall ’97), Phil Atkinson (for CS552 Fall ’96 and Spring ’97), Avinash Sodani (for CS552 Fall ’95 and Spring ’96), Andreas Moshovos(for CS552 Spring ’94), Subbarao Palacharla (for ECE552 Fall ’94), Todd Bezenek (for CS552, Spring ’98, Fall’98 and Spring ’99), Raghav Kaushik (Fall 99), and Sonny Pham.