Professional Documents
Culture Documents
ECNG 3016 Advanced Digital Electronics: Eneral Nformation
ECNG 3016 Advanced Digital Electronics: Eneral Nformation
ECNG 3016
ADVANCED DIGITAL ELECTRONICS
http://myelearning.sta.uwi.edu/course/view.php?id=686
Semester II 2009
1.
GENERAL INFORMATION
Lab #:
Name of the Lab:
3 Part A
Xilinx Tool Flow Lab
Lab Weighting:
0%
Delivery mode:
Lecture
Online
Lab
Other
Microprocessor Laboratory
Lab Dependencies2
Recommended
prior knowledge
and skills3:
Course Staff
Lucien Ngalamou
Marcus George
Position/Role
Lecturer
Instructor
Estimated total
study hours1:
E-mail
lucien.ngalamou@sta.uwi.tt
marcus.george@sta.uwi.tt
Phone
Office
Office
Hours
room 202
room 203
2.
Upon successful completion of the lab assignment, students will be able to:
1. Describe general FPGA architectures and the Xilinx design flow
3.
Cognitive
Level
C
C, Ap
C, Ap
Ap
C
PRE-LAB
Due Date:
Submission
Procedure:
Estimated time to
completion:
4.
IN-LAB
Introduction
This instructor-led demonstration introduces the ISE software.
Objectives
After participating in this demonstration, you will be able to:
Step through the FPGA design flow
Identify the features of the Digilent Spartan-3 board
List the features of the PicoBlaze 8-bit controller
Procedure
This demonstration comprises four primary steps: you will create a new project, add design
files to the project, simulate the design, and finally implement the design. Below each general
instruction for a given procedure, you will find accompanying step-by-step directions and
illustrated figures that provide more detail for performing the general instruction. If you feel
confident about a specific instruction, feel free to skip the step-by-step directions and move on to
the next general instruction in the procedure.
Note: If you wish to review the demonstration at a later time, you can download the files from
the Xilinx University Program site at http://www.xilinx.com/univ
This section attempts to provide a brief overview of the PicoBlaze microcontroller. Throughout the
lab sessions, you will use PicoBlaze to create designs that illustrate certain features of the ISE
Foundation software and Digilent Spartan-3 board. These labs are by no means developed to train
on the PicoBlaze micro-controller. Detailed information can be found in the user guide and
documentation, which you can use as a reference when completing the labs. The information below
are exerts taken from the user guide.
PicoBlaze is a Free Download
PicoBlaze is a free downloadable 8-bit microcontroller: refer to the PicoBlaze web site at
http://www.xilinx.com/products/design_resources/proc_central/grouping/picoblaze.htm .The
PicoBlaze files are provided with this distribution for convenience, which can be found in the
KCPSM3 sub-directory and include:
PicoBlaze Source Code (VHDL and Verilog)
UART Real-Time Clock reference design (VHDL and Verilog)
Assembler
JTAG loader
Refer to User Guide and manuals for technical details, reference designs, and for answers to
questions such as
- Why the PicoBlaze MicroController?
- Why use a Microcontroller within an FPGA?
PicoBlaze Features
PicoBlaze is a fully embedded 8-bit microcontroller macro for the Virtex and Spartan series of
FPGAs and CoolRunner-II CPLDs. The PicoBlaze reference designs support 57 to 59 different
16- or 18-bit instructions, 8 to 32 general-purpose byte-wide registers, up to 256 directly and
indirectly addressable ports, reset, and a maskable interrupt. The PicoBlaze controller for Spartan-3,
Virtex-4, Virtex-II, and Virtex-II Pro also include 64 bytes of scratchpad RAM.
As shown in figure 1-2 (taken from from user guide), the PicoBlaze microcontroller supports the
following features:
16-byte wide general-purpose data registers
1K-instructions of programmable on-chip program store, automatically loaded during FPGA
configuration
Byte-wide ALU with CARRY and ZERO indicator flags
64-byte internal scratchpad RAM
256 input and 256 output ports for easy expansion and enhancement
Automatic 31-location CALL/RETURN stack
Predictable performance, always 2 clock cycles per instruction, up to 200 MHz or 100 MIPs in a
Virtex-II Pro FPGA
Fast interrupt response; worst-case 5 clock cycles
Assembler, instruction-set simulator support
Figure 1-3 illustrates the top-level interface signals of the PicoBlaze microcontroller along with
example applications.
Development Environments
There are three primary development environments for creating PicoBlaze application code, as
summarized in Table 10-1 of the user guide. Xilinx offers two PicoBlaze environments. The
PicoBlaze reference design includes the KCPSM3 command-line assembler that executes in a
Windows DOS box or command window. The Xilinx System Generator for DSP development
environment includes both a PicoBlaze assembler and a simulation model for the Math Works
MATLAB/Simulink environment. The Mediatronix pBlazIDE software is a graphical development
environment including an assembler and full-featured instruction-set simulator(ISS).
In this workshop, you will use the KCPSM3 command-line assembler to compile assembly code.
The assembler is provided as a simple DOS executable file together with three template files.
Programs are best written with either the standard Notepad or Wordpad tools available on most
Windows computers. However, any PC-format text editor is sufficient. Save the PicoBlaze
assembly program with a PSM file extension that has an eight-character name limit.
If the source program is free of errors, the KCPSM3 assembler generates an object code output,
formatted for a variety of design flows, based on the initial template files. These output files
generate the code ROM, instantiated as block RAM, and properly initialized with the PicoBlaze
object code. The assembler also generates equivalent raw decimal and hexadecimal files for other
utilities.
Step 1
Launch the ISE Project Navigator and create a new design project.
For Project Location, use the button to browse to one of the following directories,
and then click <OK>
Verilog users: C:\lab1\labs\verilog\lab1
VHDL users: C:\lab1\labs\vhdl\lab1
Click Next
The Device and Design Flow dialog will appear (Figure 1-6)
10
The Create New Source dialog will appear (Figure 1-7). You can use this dialog to
create a new HDL source file by defining the module name and ports. All of the source
files have been created for you in this project.
Click Next
The Add Existing Sources dialog appears (Figure 1-8).
11
Step 2
Select the VHDL/Verilog files kcpsm3_int_test and kcpsm3 files and click Open.
A Choose Source Type box opens for each Verilog file (Figure 1-9). Choose VHDL or
Verilog Design File for each of the HDL files and click OK.
Note: You should see a module called int_test listed in the hierarchy view with a red
question mark. This module is a BlockRAM that will contain the instructions for the
PicoBlaze controller.
Step 3
An example PSM file called init_test.psm is included with the PicoBlaze distribution. You
will
assemble this file to generate the instruction ROM that will be integrated with the PicoBlaze
microcontroller.
Open up Windows Explorer and browse to the Assembler provided in the KCPSM3 subdirectory (C:\lab1\KCPSM3\Assembler)
Note: The KCPSM3.exe assembler and ROM_form* template files along with two
example PSM files (refer to figure 1- ) should reside in this directory. Keep in mind
that the assembled output files will be generated in the directory containing the
assembler and template files. It may be beneficial to copy the assembler and
template files to your project directory. For the workshop, we will keep the files in
the current location.
12
Figure 1-11. Command Window
Enter the following command at the command prompt to assemble the code and generate
the output program ROM files
> kcpsm3 int_test.psm
13
Note: You should now see several files in the Assembler sub-directory starting with
init_test*, including VHDL (int_test.vhd) and Verilog (int_test.v) program ROM
files.
In the ISE Project Navigator, go to Project Add Source and browse to the
int_test.vhd or int_test.v file in the C:\lab1\KCPSM3\Assembler directory path.
Step 4
Add the testbench testbench.vhd/.v and review the code. Then run a behavioral simulation
using the Xilinx iSIM simulator and examine the results.
15
With the testbench selected, expand the Xilinx ISE Simulator toolbox in the Processes
for Source window, right-click on Simulate Behavioral Model, and select Properties.
Enter the value of 10000 for the Simulation Run Time and click <OK>
Note: the design counts the number of interrupts detected. Refer to the software code
for further detail.
Close the simulator windows. Click Yes to confirm that you want to end the simulation
Step 4
Implement the design. During implementation, some reports will be created. You will look
more closely at some of these reports in the next module.
In the Sources in Project window, select the top-level design file kcpsm3_int_test.vhd/v
In the Processes for Source window, double-click Implement Design (Figure 1-)
Notice that the tools run all of the processes required to implement the design. In this
case, the tools run Synthesis before going into Implementation.
After each stage is completed, a symbol will appear next to each stage:
8. Green check mark for successful
9. Yellow exclamation point for warnings
10. Red X for errors
For this particular design, there may be a yellow exclamation point (warnings) for some
steps. The warnings here are okay to ignore.
Read some of the messages in the message window located across the bottom of the
Project Navigator window.
17
Conclusion
In this demonstration, you completed the major stages of the ISE design flow: creating a
project, adding source files, simulating the design, and implementing the design.
In the next module, you will examine some of the software reports, determine how the design
was implemented, and determine whether or not your design goals for area and performance were
met.
18
19
5.
POST-LAB
5.1. Assignment:
20
21