Академический Документы
Профессиональный Документы
Культура Документы
Chapter 1: Starting the Design Chapter 2: Simulation with Modelsim Chapter 3: Synthesis Using Leonardo Spectrum Chapter 4: Creating a Schematic Chapter 5: Design Architect and Viewpoint Creation Chapter 6: Simulation in Accusim Chapter 7: IC Station Chapter 8: Parasitic Extraction and Backannotation
1.1 Introduction to the design flow 1.2 Setting up the environment 1.3 Writing the VHDL source
Once the code has been written, you should check it to ensure that it is correct. This step is very similar to debugging a program in any programming language. The tool we will be using for this check is Modelsim, which is the HDL compiler and simulator. The compiled source code will be simulated using it.
After simulation, we come to the synthesis step. Synthesis is the process of synthesizing a schematic or netlist of the
design from the HDL code. The schematic consists of transistors, logic gates or other elements. The tool we will be using for this step is Leonardo Spectrum. It is a sophisticated tool which synthesizes netlists satisfying the specifications you enter. Leonardo has many output file options, but we will take the output in EDIF format for compatibility with the tools we will use later on.
The EDIF files cannot be directly used in the rest of the tools. Hence they should be transferred into EDDM schematics. Firstly, EDIF file will be converted into an EDDM file using a script, and then that file will be converted into a visible schematic using Schematic Generator. The generated EDDM schematic is suitable for all the tools for simulation and layout creation.
Design Architect is the primary tool to draw a schematic using the components in either its own libraries or user defined libraries. It is possible to draw the whole design or some part of it in Design Architect, but this will not be explained in detail. We will just use it to check the generated EDDM schematic and to create a symbol.
The following step is Accusim II, the analog simulation tool. It will be used to simulate the schematic. This simulation can be done by using a digital simulator such as Quicksim, or by both simulators.
The last tool to be used is IC Station, in which the layout of the design will be created and checked.
The last step of our design flow is to backannotate the layout. Backannotation : parasitic capacitance and resistance values will be extracted from the layout and the design will be re-simulated in Accusim with the added parasitic values.
If the design satisfies your specifications after backannotation, your chip is ready for fabrication.
Keep in mind that the flow described above needs going back and forth in most of the steps if undesired simulation results are obtained. You should go one or more steps back and reconsider your design.
Save the above code inside the folder source with the name mycounter.vhd Now we are ready to go one step further. We will compile and simulate mycounter.vhd in the next chapter.
--- file name: mycounter.vhd -LIBRARY ieee; USE ieee.std_logic_1164.all; USE ieee.std_logic_unsigned.all; ENTITY mycounter IS PORT(clock,reset,cnt_up,enable : IN std_logic; Y3,Y2,Y1,Y0 : OUT std_logic); END mycounter; ARCHITECTURE arch OF mycounter IS SIGNAL cnt : std_logic_vector(3 downto 0) := "0000"; BEGIN counting: PROCESS(clock,reset,cnt_up,enable) BEGIN IF (reset = '1') THEN cnt<="0000"; ELSIF (clock'EVENT AND clock = '1') THEN IF (enable = '1') THEN IF (cnt_up = '1') THEN cnt <= cnt + "0001"; ELSE cnt <= cnt - "0001"; END IF; END IF; END IF;
END PROCESS; Y3 Y2 Y1 Y0 <= <= <= <= cnt(3); cnt(2); cnt(1); cnt(0);
$MGC_WD/modelsim # vsim -gui If the Welcome Dialog Box appears you may click Done or close it. We start by creating a new library. Choose Design>Create a New Library pull down menu.
Click OK.
The next step is to compile the source. Modelsim needs the compiled source for simulations. Click on the Compile button on the toolbar or you can do the same by Design>Compile menu item. When the dialog box appears browse for mycounter.vhd choose it and press on Compile.
After compilation is finished, click Done. If there are any errors in the source you may use Edit Source to correct them. Now, select the Load Design button Design>Load New Design pull down menu. on the toolbar or
Choose mycounter and then click on Load. The design is ready for simulation.
2.2 Simulation
Use the View>All pull down menu to see all of the simulation windows. We will not be using all the windows, but it may be useful to view them all sometimes.
In the Signals window you can see all the inputs, outputs and the internal signal cnt.
To see all signals in the Wave window use the menu selection View>Wave>Signals in Region
Now, let us assign values to inputs. In Signals window again select clock and use the menu Edit >Clock. Define the clock as it is in the following figure.
Click OK to the dialog box. Select reset and assign 0 to it from the Edit >Force menu.
Then force enable to 1 and cnt_up to 1 yourself. After all inputs are forced we can run the simulator. i) To run the simulator you can write in the command line >run {runs for 100 ns} >run 550 {runs for 500 ns} ii) you can click the run symbol on toolbars of main window or wave window. The default duration is 100 ns, but any duration can be specified. iii)from main window Run >Run 100ns Then you can press run all for a whole run. You should click break to pause, continue to go on. After the run you should see the wave window as
The input values given above do not contain the all possible inputs, but they are sufficient to get a general idea about the tool. After simulating for enough time, force your own values to inputs and check if the source file is correct. When reset = 1 output should be "0000", when enable = 0 counter should stop, when cnt_up = 0 it should count downwards. If you notice any errors or wrong operation, you can edit the source using the source window. You can add breakpoints on executable lines (shown in green) by just clicking on them. You can examine the variables by stepping over. There are some other windows in Modelsim, but they are not very important at the moment. Now, you are ready to start chapter 3.
Invoke Leonardo by entering the command # leonardo We shall be using Leonardo Spectrum Level 3. Leonardo will be used to synthesize VHDL descriptions and to create ASIC schematics using AMI libraries. It is a very important tool of ADK (Asic Design Kit), it converts technology independent VHDL into technology specific schematics. When Leonardo window appears, click Toggle Advanced FlowTabs button on the toolbar. This will bring you the advanced options. Click on " Technology" and choose ami05_typ.(We could select any technology from the ASIC part.) Press on Load Library.
In the "Input" window you can specify the working directory, folder ~/tutorial/leonardo can be used here. Click the open files button and browse for mycounter.vhd which is inside the folder source then open the file. In the "Input" window again, click the Read button. Go to the "Constraints" window. Specify clock frequency as 200 Mhz inside the Global sub-section. Go to the "Optimize" section. Area, delay and also timing optimizations can be made in here. Let us optimize for delay; click the appropriate options and then press the Optimize button as shown in the following figure.
Go to the "Report" section. You can get both area and delay reports, either written into a file if you enter a filename or displayed on the screen if filename part is left blank. Leonardo can also report you the maximum clock frequency your design can operate at.
If you would like to see the maximum clock frequency just put a tick to the Report Clock Frequency option in the Report Delay sub-section. The last section of Leonardo is the "Output" section. Change the output files format to EDIF. In the EDIF Out Options sub-section change the EDIF GND value to TRUE then Apply.
Go back to the Output Files sub-section shown in the above image and click Write. The EDIF netlist has been written. Our primary goal in using Leonardo was to create that netlist. After finishing synthesis procedure we are now ready to see the schematic of our design. Leonardo provides the RTL Schematic and Technology Schematic of the design and also the Critical Path Schematic showing the longest delay path in the design. Those schematics can be opened by clicking the corresponding icons on the toolbar. You will see the Technology Schematic divided into two sheets as sheet1 and sheet2.
The RTL Schematic and the Critical path schematic will be as shown here.
This much is enough for now. Let us continue with the next chapter.
setup character substitution "<>" "()" -names map path $ADK/parts ami05_fast -external map path $ADK/parts ami05_typ -external map path $ADK/parts ami05_slow -external map path $MGC_WD/ /work map path ami_fast PRIMITIVES map path ami_typ PRIMITIVES map path ami_slow PRIMITIVES
We saved mycounter.edf in the folder ~/tutorial/leonardo/ and assume the command file is in your home folder, our UNIX command will be :
# enread $MGC_WD/leonardo/mycounter.edf -r -rcf ~/configB enread creates a subdirectory named work inside your working directory and saves the created component mycounter inside work. The next step is to generate a schematic for our component mycounter.
Click OK. From the toolbar choose Setup >Symbol >Use Genlib Classifications. Next, press F3 or type generate and press Return. All the Mentor Graphics' tools we will be using from now on allows you to enter commands by typing. When you start typing, a popup command line appears at the location of the mouse pointer and you can enter any command, copy, move, generate, etc. by this way. Type '*'(a star) and then press ( 'Control'-'Shift'-'/ ') at the same time to view the list of all the available commands. After schematic is properly generated save it using File >Save, and exit Schematic Generator. The next step of the flow will be to check the schematic, create a symbol for mycounter and save the component into another directory. Design Architect will be used in the next chapter.
5.1 Opening, Checking and Saving a Schematic in Design Architect 5.2 Generating a Symbol 5.3 Creating Viewpoints
Using the navigator choose sheet1 inside $MGC_WD/work/mycounter/arch/ then click OK to the dialog box.
In Design Architect Open Sheet is used for two purposes: either to open an existing sheet or to create a new one. If you enter a new name for the Component Name field a blank sheet is opened for you to draw your schematic.
When the sheet is opened, use View >View All or write the command view all or press (Shift-F8) to see the whole schematic. As you see there are many alternative ways of doing the same job in Mentor's tools. Now, check the sheet using Check >Sheet >With Defaults. Ignore any warnings, if there are no errors you can save the sheet, if there is any correct the errors. Use File >Save Sheet As option to save into a different location. We do this in order not to overwrite the original schematic. You may need the original schematic sometime and it may not be that easy to regenerate it. Save the sheet inside your working directory with component name mycounter. Click OK.
Specify component name as $MGC_WD/mycounter and schematic name as arch. Enter mycounter in the symbol name field. If you would like to change an existing symbol click Yes to Replace Existing? Press OK to accept the dialog box. Check the symbol : Check >With Defaults. There may be warnings about the I/O pins. If there are no errors that is enough. Save the symbol File >Save Symbol >Default Registration. Close the symbol window. When the schematic window is active, check the schematic Check >Schematic >With Defaults. This option checks the correspondence of the schematic with the symbol. Now let us see some interesting properties of Mentor tools. Pressing the middle mouse button draw a question mark (with a two-button mouse press both buttons at the same
time). This will bring you the help window of strokes. You will see how you can use the middle mouse button to ease your job. Try to get used to the strokes. The strokes exist in many Mentor Graphics tools, but they vary from tool to tool. Simply draw a question mark, if you can and learn the strokes specific to that tool. Exit Design Architect.
We must load a model library to show the simulator which model of FETs are used. Models are technology specific spice parameters. We will be using the AMI05 technology again. After loading the library, click on the Setup Analysis icon in the palette.
In the Setup Analysis Dialog Box click on the Transient button. Enter time step as 1N and stop time as 0.3U. N stands for nanoseconds and U for microseconds.
You do not need to make any other changes. Click OK to the dialog box.
6.2 Simulation
In the schematic window select the input clock by clicking on it. You may need to resize the window or zoom in to be able to select it. Use the Add Force icon in the palette menu to force values to clock. In the Force Dialog Box chose Pulse as the Force Type. We are forcing voltage values and enter 0 for the initial value and 5 for the pulsed value. Units are in volts. Click specify width&period and change pulse width to 5N and period to 10N. You can also specify delay time, fall time and rise time in this dialog box. Accept the dialog box.
Now, force the following values to the other inputs. reset: delay = 50N ; pulse width = 5N ; period = 150N cnt_up: delay = 0 ; pulse width = 150N ; period = 300N enable: delay = 25N ; pulse width = 200N ; period = 225N The above values forced to the inputs do not cover the all possibilities. Since simulation of all possible inputs is a difficult task which may need other programs or long script files, I preferred to enter only few values which are enough to understand the basic operation of the simulator. After finishing the forcing procedure select all the inputs and outputs and press Trace button on the palette. Note that the order of selection of the signals is important. They will be displayed in the trace window in the order of selection, from bottom to up.
When the window named chart appears press Run on the palette menu. This will run the simulation for 0.3 microseconds. Note also that we had previously specified that stop time. The analysis results are shown below. The waveforms are Y3, Y2, Y1, Y0, Enable, Cnt_Up, Reset and Clock from top to bottom. We see from the results that our design is operating correctly. You can check whether the results satisfy the VHDL description. Notice that outputs have sharp transitions and there are no obvious delays between inputs and outputs.
You can save your setup for later use. Go to the File >Simulation>Save Setup Data Only menu. Save the setup inside the accusim folder we previously created with the name mycounter_setup. (any name can be given) Also save your waveform DB with File >Waveform DB >Save. Save the forces WDB into the accusim folder with the name forces.
Accusim is finished. Now, we are ready to create the layout of the design in Chapter 7.
Chapter 7 IC Station
7.1 Creating a cell 7.2 Placement and routing 7.3 Design rule checking (DRC) 7.4 LVS checking
When blank screen is loaded, click on Place & Route in the IC Palettes. This will bring you the Place & Route palette menu. In the Place & Route menu: Click Autofp and then just click OK to the appeared dialog box. IC Station automatically places the floorplan shapes. Now, you should see green lines on the screen. Next thing to do is to place the standard cells (the components used from the AMI library) onto the floorplan. Click StdCel menu item, under Autoplc. Accept the coming dialog box as is.
Now you should see all you standard cells placed, with yellow lines in between. The yellow lines denote the overflows; unconnected nets. The last step of placement is to place our ports. Click on Ports and then press OK in the dialog box, to let IC Station automatically place them. When placement is complete, the overflows should be routed; that is, the unconnected nets should be connected using metal connectors. There are two metal layers in IC Station, metal1 and metal2. You can pass from one layer to another using a via. Let's go back to our job. Click on All under Autorou. Accept the coming dialog box, as we always do. You should see metal paths instead of overflows now. IC Station tries to route all overflows, but sometimes it fails to route a few. You must find out if there is any. Note that you must search for unrouted overflows even if you don't see any; they may not be visible in large designs. Follow the procedure below. Open the Setup Select Filter dialog box from Setup>Select Filter and choose only overflow in the select filter. In the layout window firstly do "unselect all" and then "select all". If "nothing new selected" message appears in the Message Area, there are no overflows left. Otherwise, there are some. Find them and try to route with the OvrFlw command in the place&route palette. If it fails you have to route the overflows manually. After routing is completed open the Setup Select Filter dialog box again and fill the select filter. You can also decrease the area and via count of your chip by using Compct and MinVia commands under PR Edit.
We have technology specific design rules, such as; metal or via widths, spacing between objects, etc. The design rules must be obeyed if you want a working IC. To see if our design passes DRC do the following Click on ICrules in the IC Palettes menu to go to ICrules palette. Click Check and then accept the appeared dialog box. DRC results are displayed in the Message Area. "Total Results" shows the number of errors. Click First under Set Scan To, the type of error is displayed in the Message Area. Use View to zoom to the error location and Next to see the next error. You must correct every error. Repeat this check until you see "Total Results" is zero.
Click on the Setup LVS button. In the Setup LVS form do the following changes and click OK. Ground Names : VSS GND Recognize Gates : Yes
After the check is completed, use Report >LVS to view the results. If there are no errors you should see a tick and a smiling face in the report file. Fix any errors before going to the next chapter.
8.1 Parasitic extraction 8.2 Post layout simulation using Accusim Conclusion
The form is shown above. Click OK to the form. After the BA file is created you can exit IC Station.
Start Accusim without a viewpoint this time. # accusim mycounter Use File >Design >Import Back Annotation menu to import the ascii_ba file we created in IC Station. Specify Ascii BA File as ascii_ba and BA Name as mycounter/ba_vpt ba_vpt is a temporary viewpoint (if you don't save) we are about to create for the post layout simulation.
Click OK in the dialog box. When you see the message "Import/Export Back Annotation is done." you can start simulation. We can use the setup data and WDB we saved previously. Use File > Simulation > Restore Setup data to restore mycounter_setup we saved inside $MGC_WD/accusim/ Also use File >Waveform DB >Load to load our forces. Run the simulator. We can easily see that the post layout analysis results are different from the previous results. In Section 6.2 we saw sharp transitions in the outputs and there were no visible delay, but here we have smoother transitions like a capacitor, and large delays.
There is another thing much worse than delays; the chip is not operating correctly. Look at the Y3 output at time 190ns (just before the second reset comes). It is low, but it must be high, the output decreases from "1000" to "0011". Compare the results with the previous Accusim results. We have just seen the importance of post layout simulation. It would not be a nice thing to find out a fault after fabrication. Although finding a fault in simulations may be very annoying, you still have a chance to correct it.
CONCLUSION
This tutorial is a preliminary version which needs to be developed. Hence, it may contain mistakes. If you encounter any mistakes or if you have any comments about the tutorial, do not hesitate to contact me by e-mail. yildirim@mozart.ee.hacettepe.edu.tr