Beruflich Dokumente
Kultur Dokumente
ECNG 2004
LABORATORY & PROJECT DESIGN II
http://myelearning.sta.uwi.edu/course/view.php?id=1678
Semester I, 2009/2010
1. GENERAL INFORMATION
DIGLAB1
Lab #:
Name of the Lab:
Lab Weighting:
Delivery mode:
Lecture
Online
; Lab
Other
Electronics Laboratory
Lab Dependencies2
Recommended
prior knowledge
and skills3:
None
Course Staff
Position/Role
Estimated total
study hours1:
E-mail
Phone
Office
Marcus.George@uwi.sta.edu ext3164 Electronics
Lab Office
Office
Hours
Fridays
10am - 1pm
Cognitive
Level
C
C
3. PRE-LAB
Due Date:
Submission
Procedure:
Estimated time to
completion:
Students must have completed the pre-lab exercise in advance of the inlab exercise.
N/A
30 minutes
4. IN-LAB
Allotted Completion 3 hours
Time:
1 printed copy of the DIGLAB1 manual (students must bring this copy to
Required lab
the lab)
Equipment:
1 Computer
Spartan 3 Development board (including J-Tag cable & adaptor)
4.1. Introduction
You can build moderately complex logic circuits of up to several hundred gates wiring the SSI and
MSI ICs. Logic synthesis programs are often used in digital system design. The logic circuit can
input a truth table, a circuit schematic (best for smaller circuits), or use a hardware description
language (HDL). Operation of the circuit is then simulated to make sure the logic design is correct.
The next step is typically to either design a custom VLSI IC (usually only justified for high volume
applications or applications with specialized requirements), or programmed into either a field
programmable gate array (FPGA) or a complex programmable logic device (CPLD). In this lab,we
will learn how to use the Xilinx ISE Tools to implement and simulate logic circuit designs from a
schematic.
4.2.2.
In the New Project Wizard dialog box, enter the project name My_4bit_Adder_ in the
diagram below. You can browse to the desired directory using the browse button next to
the Project Location field.
4.2.3.
4.2.4.
In the New Project Wizard Device and Design Flow dialog box, use the pull-down arrow
to select the Value for each Property Name. Click in the field to access the pull down list.
Device: xc3s400/xc3s1000
Package: ft256
Speed Grade: -5
Simulator: Modelsim
4.2.5.
Click Next
4.2.6.
In the New Source dialog box select Schematic from the list. Name the file as
MyFullAdder in the File Name field. Verify that the Add to project check box is
selected.
4.2.7.
window). A blank sheet opens in an ECS schematic window. In ECS, you can create a
schematic diagram from scratch.
Select Logic in the Categories window. Only logic gates in the Symbols window will be
displayed. From the Filter window add an OR2 gate along with two AND2 gates onto your
workspace. Also grab two XOR2 gates.
10
4.3.2.
Click on the lead of one gate then on the lead of the next and a wire will be drawn that
connects the two together. Note that
S=ABC
Cout = (A B) C + AB
Note the use of the following symbols:
After the wires have been connected your circuit should look as follows. Make sure to add
wires to outputs S and Cout.
Now we need to add I/O Markers. These markers will help Xilinx determine where the
inputs/outputs are when it converts this schematic into a macro.
11
4.3.3.
Your schematic should look like this with the markers in place. Xilinx automatically assigns names
to the markers, but remembering the names can get confusing really fast. For clarity, change the
names. Right click on the marker and rename. Alternatively, you can select the pointer tool
and
double click on the marker you wish to rename. In the Object properties dialog box change the
name of the marker by changing the name in the Value field. Click Ok. Similarly rename all
your markers. When you are done the schematic will appear as follow.
12
13
Click Next!
14
A dialog box with the input and output ports of the schematic open up. Click Add Pin in order to
add pin to macro. Check whether the input and output ports are defined as you intended.
Click Next!
In this dialog box you can change some appearance properties of the symbol being created.
Click Next!
You can see your symbol in a symbol wizard dialog box. Click Finish!
15
16
Click/highlight any of the VHDL or schematic files in the source window so that you see
the corresponding process window.
4.4.2.
In the process window double click on Create Schematic Symbol (refer to screen-shot
below). This creates the schematic symbol corresponding to the VHDL code created and
adds it to the library so you can use it in your designs. Create Schematic Symbol
creates macros using default settings. You can use it instead of using the symbol editor.
4.4.3.
Now close the Symbol editor. Close the schematic we had just been working on, and return
to the project navigator.
17
4.4.4.
Now we will create a new Schematic. Right click on the Device (xc3s400-5 ft 256), then
select New Source
4.4.5.
Select Schematic from the list and name it My_4bit_Adder_Chip. Next click Finish
18
4.4.6.
Now select the symbols tab and look in the Categories Window. You will realize that a
new category named <E:/./My_4bit_Adder> has been added. In this category the full
adder created previously can be found.
19
4.5. Mini-Exercise
Use the new schematic previously created named My_4bit_Adder_Chip and the fulladder macro created previously to create a 4-bit adder. You can select copies of this adder from
the new category created and connect them together as shown in the diagram below. The
resulting macro must look like the 4-bit adder macro shown in the next diagram.
21
Click Next!
22
Attach the test bench waveform file to the top level schematic module My_4bit_Adder_Chip
and click Next! Then click Finish!
Set the test bench waveform with the following test cases as shown in the table below.
A3
0
0
0
1
A2
0
1
0
0
A1
1
0
0
0
A0
1
0
1
0
B3
0
0
0
1
B2
0
0
0
0
B1
0
1
0
0
B0
1
0
0
0
Cin
0
0
1
0
23
Timing Simulation
The timing simulation will give you detailed information about the time it takes for a signal to
pass from one gate to the other (gate delay) and gives information on the circuit worst-case
conditions. The total delay of a complete circuit will depend on the number of gates the signal
sees and on the way the gates have been placed in the FPGA or CPLD. Thus timing information
can only be obtained after the design has been implemented. If we want to perform a timing
simulation we just double click on Simulate Post-Place & Route VHDL Model in the Xilinx
6.3i/7.1i process window.
24
Verify that the system is functional by thoroughly analyzing the timing diagram generated.
Repeat the simulation using Simulate Post-Place and Route VHDL Model.
25
Ensure that the implementation constraint file created is connected to the top level schematic
My_4bit_Adder_Chip as shown in diagram below. Then click Next. Then click Finish.
26
We then double click the Implementation Constraints File from the Module View and then
assign package pins using the table below.
Before you create the Implementation constraints file students are advised to utilize the
datasheet of the Spartan 3 Toolkit (SBOARD.pdf) to locate the switches, pushbuttons and
LEDs to be used in this laboratory exercise. If you are having problems doing this please call
the attention of a TA.
27
Design Port
A3
A2
A1
A0
B3
B2
B1
B0
Cin
S3
S2
S1
S0
Cout
(FPGA switch)
(FPGA switch)
(FPGA switch)
(FPGA switch)
(FPGA switch)
(FPGA switch)
(FPGA switch)
(FPGA switch)
(FPGA Pushbutton)
(FPGA LED)
(FPGA LED)
(FPGA LED)
(FPGA LED)
(FPGA LED)
After assigning package pins, save the changes made and double click Configure Device
iMPACT under the Generate Programming File tab from the Process Window as shown in the
diagram below.
28
Click Next!
Click Finish!
29
Click OK!
Click Open!
You are now prompted for a PROM programming file as shown in the figure below. We are not
programming the PROM at this time, therefore select Bypass.
30
Finally, you will reach the point shown in Figure 1.31. iMPACT is ready to program the FPGA.
Select the FPGA icon in the window and then use the right mouse button to activate the menu as
shown and select the Program option.
31
After programming the Spartan 3 FPGA development boards please perform on-board testing
using the test cases of Table 1 above in addition to the switches, pushbuttons and LEDs of the
Spartan 3 development board. Show your TA your functional system.
32
5. POST-LAB
A signed plagiarism declaration form must be submitted with your assignment.
Due Date:
Submission
Procedure:
Deliverables:
N/A
N/A
N/A
33