CAD - WalkThruh
CAD - WalkThruh
CAD - WalkThruh
Steps Involved:
1.
Creating the (a) schematic or (b) HDL model using CAD software,
2.
Synthesizing the circuit for the FPGA (analogous to compiling a software program),
3.
4.
5.
Page 1
Last updated : Wednesday, October 08, 2008
Page 2
Last updated : Wednesday, October 08, 2008
Under Project Name type primeDetector, under Project Location click on the elipse and browse to the
project directory primeDetector you created above. Finally, select Schematic from the drop down
list under Top-Level Module Type:
Click Next.
Page 3
Last updated : Wednesday, October 08, 2008
Do not change any of the settings in the bottom section. The default setting will suffice.
Click Next.
Click on the New Source button. The following window will open
In the left half of the window, click on Schematic. Then, type primeDet_top for the Filename. Do not
change the location of the file. This is the top level schematic.
Page 4
Last updated : Wednesday, October 08, 2008
Click Next. Since we do not have any existing schematics to add to this project, click Next again.
Finally, the project summary is shown. Click finish and your project will be set up.
Page 5
Last updated : Wednesday, October 08, 2008
Toolbar
Pane
Sources
Pane
Processes
Pane
Working
Pane
Information
Pane
Double click on the primeDet_top.sch item in the Sources pane. An empty schematic sheet will open
in the Working pane.
You have now formed the basis structure of your project.
To periodically save all your work, click on the Save All button.
Page 6
Last updated : Wednesday, October 08, 2008
Now the student will add the gate symbols to make up the circuit.
Page 7
Last updated : Wednesday, October 08, 2008
Page 8
Last updated : Wednesday, October 08, 2008
Page 9
Last updated : Wednesday, October 08, 2008
You are now ready to begin connecting the AND gates to the OR gate.
Left click on the Wire Drawing tool
Page 10
Last updated : Wednesday, October 08, 2008
Page 11
Last updated : Wednesday, October 08, 2008
Page 12
Last updated : Wednesday, October 08, 2008
Page 13
Last updated : Wednesday, October 08, 2008
Continue with this process, of naming wires, until all the wires are named as shown in the following
figure. Note: there are d(x) and dn(x). Also, note that the output is named prime.
Page 14
Last updated : Wednesday, October 08, 2008
Page 15
Last updated : Wednesday, October 08, 2008
Move your mouse cursor over the d(3:0) label you just created and click. An input marker will appear
over the bus name.
The IOMarker tool is still selected. So, move the cursor to the output prime connected to the OR
gate output and click on the end of the wire.
Page 16
Last updated : Wednesday, October 08, 2008
In order to use this model in the top-level schematic we need to create a schematic symbol. The IO
Markers will show up as inputs and outputs on the new symbol. This process is discussed in the next
section.
Click Save All button on the toolbar.
Page 17
Last updated : Wednesday, October 08, 2008
This process must be repeated if changes to the schematic effect the IO of the model you created.
You will use this same set of steps to create the schematic symbol for the VHDL model. Just select
the source you want to make the symbol for and double-click Create Schematic Symbol.
Page 18
Last updated : Wednesday, October 08, 2008
Page 19
Last updated : Wednesday, October 08, 2008
Place the cursor on line 39 of the figure above and tab over once, then type the following text.
Page 20
Last updated : Wednesday, October 08, 2008
Save all.
Create the schematic symbol for primeDet_VHDL using the procedures described for the schematic
above.
Close all the tabs in the Working pane by clicking on the small x below the main window close button
(in this case the red x). Repeat until all the tabs are closed.
Page 21
Last updated : Wednesday, October 08, 2008
Page 22
Last updated : Wednesday, October 08, 2008
Save All.
There is no need to make a symbol for the top-level schematic.
After you have saved the project the two models you created will show up as levels below the toplevel schematic in the Sources pane.
Making a model then placing it into a schematic is referred to as a Hierarchical structure. You can
nest models as deep as you please. The idea is to break the design into manageable pieces.
Page 23
Last updated : Wednesday, October 08, 2008
In this case we have a warning that is not hazardous to the model functionality. An
unconnected source pen. The software is thinking (rather the software designers) that you
went to the trouble of creating a source and you are not using it must be a problem. Well
its not this sometimes happens when using busses. Be assured that this will not affect your
circuits operation.
If a red X appears then the synthesizer could not complete the task. Errors can be viewed in
the Errors tab in the Information pane.
If the information in the Warning or Error tabs is not sufficient to determine the corrective
action (if one is required), then click on the Console tab and scroll through the text that was
generated during the synthesis process.
Once the circuit synthesizes, we will move on to the Simulation (or test) phase of the process.
Page 24
Last updated : Wednesday, October 08, 2008
Page 25
Last updated : Wednesday, October 08, 2008
If all goes well you should have a new source that will automatically open in the Working pane. See
figure below.
Page 26
Last updated : Wednesday, October 08, 2008
Page 27
Last updated : Wednesday, October 08, 2008
Page 28
Last updated : Wednesday, October 08, 2008
Notice the time scale at the bottom. The view defaults to a very small slice of the end of the
simulation results.
Click on the Zoom Full button on the toolbar to
see all the simulation results.
Page 29
Last updated : Wednesday, October 08, 2008
Verify your circuit is working by observing the outputs for each of the input combinations.
o
The outputs should be high for the prime numbers 1, 2, 3, 5, 7, 11 & 13.
The outputs should be low for non-prime numbers 0, 4, 6, 8, 9, 10, 12, 14 & 15.
If errors are encountered, then close Modelsim and trace through the schematics. Trace through the
blocks associated with the errors. Re-Synthesize the whole circuit and start the simulator up again,
check your outputs as indicated above. Repeat if necessary until the correct outputs are obtained.
Page 30
Last updated : Wednesday, October 08, 2008
Page 31
Last updated : Wednesday, October 08, 2008
Page 32
Last updated : Wednesday, October 08, 2008
Step 4b Creating the .bit file. The .bit file will be loaded into the FPGA to achieve the desired
operation.
Select the top-level file in the Sources pane.
Page 33
Last updated : Wednesday, October 08, 2008
Page 34
Last updated : Wednesday, October 08, 2008
Page 35
Last updated : Wednesday, October 08, 2008
Value
(decimal)
d(3:0)
(binary)
Expected LD0
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
1010
1011
1100
1101
1110
1111
Off
On
On
On
Off
On
Off
On
Off
Off
Off
On
Off
On
Off
Off
Actual LD0
Expected LD7
Actual LD7
Off
On
On
On
Off
On
Off
On
Off
Off
Off
On
Off
On
Off
Off
Example for the value of 13 the switches should be set as SW0 UP; SW1 DOWN; SW2 UP; &
SW3 UP. Both LD0 and LD7 will be illuminated.
Page 36
Last updated : Wednesday, October 08, 2008