Professional Documents
Culture Documents
Design requirements:
Design of ANDGate. The pin definitions and numbers are shown in the
functional logic diagram as shown in below figure.
a (in)
c (out)
AND
b(in)
b(in) Gate
The Xilinx Design System is the tool we will use to write our VHDL code and/or
to draw our schematics and simulate them electronically. If we draw a
schematic, the schematic program will generate a VHDL program that includes
all the information in our schematic.
In order to use our Xilinx software and Xilinx FPGA chip, all of our designs
must be made with parts that Xilinx Design Manager recognizes. These parts
are the parts which are included in the Xilinx library.
Click on OK.
• To define your design using VHDL you will have to create a new VHDL
source. To do this, select Project→New Source… and select VHDL
Module.
• A VHDL source file is created and opened in the edit/view window on the
right-hand side of the project navigator. You can now write your VHDL
program for the design. Once completed, save the program.
Building a Circuit
• Open a new project by selecting New Project... from the File menu.
This will pop up the window shown in Figure: New Project
• Give your project a name and location, the Device Family, the Device,
the Package, and the Speed Grade. Make sure the Design Flow is
XST VHDL… as shown in the subsequent screen shots. Then click
FINISH.
The above steps will create a .ise folder which can be used as a skeleton for
any program to be written using VHDL\Verilog for chip designing, as shown
in the screen shot below.
Follow the steps as shown below, to create a New source for appropriate
design method to be used, i.e VHDL module\ Verilog module \ Test bench
etc… Also specify the file name for the same, and click NEXT.
Specify the Entity and Architecture Name used for design then click NEXT
and FINISH.
Space for writing code will be created, with some architecture and library
level coded lines generated automatically.
Declare the variables for input, output or inout ports as required for the
functional block within entity using PORT declaration syntax.
Write necessary code within Architecture declaration.
Points to remember:
• A design will have only one entity declaration and more than one
architecture body for an entity.
• Entity Declaration includes: Port names and indicates whether they are
input, output or in-out ports and also specifies data-type for example: BIT,
STD_LOGIC, Integer etc.
Exa: Entity (
I1: IN std_logic;
O1: OUT std_logic
);
Save the file or else pop-up as shown below will be displayed. If so click on
YES to save it.
Simulation
ModelSim is used to simulate the schematics made in Xilinx. This makes it
possible to simulate your design in Xilinx to verify its operation. You may do
so once your circuit is constructed by the following steps:
1.In Project Navigator highlight the schematic you want to simulate.
2. Double click on Launch ModelSim Simulator from the Xilinx Project
Navigator Window as seen in Figure
Follow the steps as shown to provide values for the input ports in order to
simulate the design.
OR
Right click File Menu and open the existing AndGate source where you saved.
To simulate the design, select work\ filename.vhd in the library window and
select simulate option by right clicking on the filename.
There are various options on running a simulation. The Run toolbar is shown
below.
Restart-This resets the simulation and reassigns all of the inputs and outputs
to U.
Run-Run will cause the simulation to run for the designated about of
picoseconds as shown above.
Continue Run-This is used to restart simulation after breaking or stopping a
simulation.
Run All- This will cause the simulation to go on forever. You must click the
break button to stop it at some point.
Break- Used to stop a simulation from running.
Here are some keyboard shortcuts that may be useful while in the Wave
window:
Zoom In- i I or +
Zoom Out- o O or -
Zoom Full- f or F
Zoom Last- l or L
Zoom Range- r or R
Next Transition- tab
Create Constraints File and Define Pin Assignments . Select the Assign
Package Pins and assign the pins as follows:
To assign the pins, enter the pin number (with a preceding p) in the Design
Object List – I/O Pins window. Once the pins are assigned the window
should look like the following figure:
The corresponding RTL level block will be displayed as shown which indicates
input and output of the block.
To view internal description of the block click on the RTL block then following
structure will be displayed.