Professional Documents
Culture Documents
2)
VHDL offers several advantages to the system level designer.Some of them are Standard
language Fully expressive language Hierarchical Configurable Tool availability Consistency
and completeness checks automatic Tight coupling to lower levels of design Supports hybrid
modeling Portable.
Disadvantages VHDL is verbose, complicated and confusing Many
different ways of saying the same thing Constructs that have similar purpose have very
different syntax (case vs.
select) Constructs that have similar syntax have very different semantics (variables vs
signals) Hardware that is synthesized is not always obvious (when is a signal a flip-flop vs
latch vs combinational)
CHAPTER 2)-
Introduction to
Digital Concepts
Analog Representation
In analog representation a quantity is represented by a voltage,
current, or meter movement that is proportional to the value of that
quantity. Analog quantities such as those cited above have an
important characteristic: they can vary over a continuous range of
values.
Digital Representation
In digital representation the quantities are represented not by proportional quantities but by symbols
called digits. As an example, consider the digital watch, which provides the time of day in the form of
decimal digits which represent hours and minutes (and sometimes seconds). As we know, the time of
day changes continuously, but the digital watch reading does not change continuously; rather, it
changes in steps of one per minute (or per second).
Most
CHAPTER 3)
VHDL Basics:VHDL is an acronym for VHSlC Hardware Description Language (VHSIC is an acronym for Very High Speed Integrated
Circuits). It is a hardware description language that can be used to model a digital system at many levels of abstraction
ranging from the algorithmic level to the gate level. The complexity of the digital system being modeled could vary from
that of a simple gate to a complete digital electronic system, or anything in between. The digital system can also be described
hierarchically. Timing can also be explicitly modeled in the same description.
The VHDL language can be regarded as an integrated amalgamation of the following languages:
sequential language +
concurrent language +
net-list language +
timing specifications +
waveform generation language => VHDL
Therefore, the language has constructs that enable you to express the concurrent or sequential behavior of a digital system
with or without timing. It also allows you to model the system as an interconnection of components. Test waveforms can also
be generated using the same constructs. All the above constructs may be combined to provide a comprehensive description
of the system in a single model.
IntroductionofHardwareDescriptionlanguage.(VHDL)
WhatdoesHDLstandfor?
HDLisshortforHardwareDescriptionLanguage
VHDLVeryHighSpeedIntegrated
CircuitHardwareDescriptionLanguage
WhyweuseHDL?
Bydescribingthedesigninahighlevel(=easytounderstand)language,we
cansimulateour
designbeforewemanufactureit.Thisallowsustocatchdesignerrors,i.e.,
thatthedesigndoes
notworkaswethoughtitwould.
Simulationguaranteesthatthedesignbehavesasitshould
Thedesignprocessisa6stepcycle:
Definethedesignrequirement
DescribethedesigninVHDLcode
Simulatethesourcecode
Synthesize,optimize,andfitthedesign
Simulatethedesign
Implementthedesign
VHDLusesasimulationcycletomodelthestimulusandresponsenatureof
digitalhardware
EveryVHDLdesigndescriptionconsistsofatleastoneentity/architecture
pair,oroneentity
withmultiplearchitectures.
TheentitysectionisusedtodeclareI/Oportsofthecircuit.Thearchitecture
portiondescribes
thecircuitsbehavior.
Abehavioralmodelissimilartoablackbox.
Standardizeddesignlibrariesareincludedbeforeentitydeclaration.
Includelibraryieee;beforeentitydeclaration.
ieee.std_logic_1164definesastandardfordesignerstouseindescribing
interconnectiondata
typesusedinVHDLmodeling.
ieee.std_logic_arithprovidesasetofarithmetic,conversion,comparison
functionsforsigned,
unsigned,std_ulogic,std_logic,std_logic_vector.
Ieee.std_logic_unsignedprovidesasetofunsignedarithmetic,conversion,
andcomparison
functionsforstd_logic_vector.
Page 9
Anentitydeclarationdescribestheinterfaceofthecomponent.Avoidusing
Alterasprimitive
nameswhichcanbefoundat
c:/altera/91/quartus/common/help/webhelp/master.htm#
PORTclauseindicatesinputandoutputports.
Anentitycanbethoughtofasasymbolforacomponent.
PORTdeclarationestablishestheinterfaceoftheobjecttotheoutsideworld.
ThreepartsofthePORTdeclaration
Name
Anyidentifierthatisnotareservedword.
Mode
Modes:Therearefourdefaultmodesin
VHDL
in:inputintotheentity(unidirectional)
out:outputfromtheentity(unidirectional)
inout:inputandoutputtoandfromtheentity(bidirectionalsignals)
buffer:behavesinasimilarwayasinout,butthesourceofthebuffered
signalisalways
determinedbythedrivingvalueoftheport.
Datatype
Anydeclaredorpredefineddatatype.
SamplePORTdeclarationsyntax
Architecturedeclarationsdescribetheoperationofthecomponent.
Manyarchitecturesmayexistforoneentity,butonlyonemaybeactiveata
time.
Anarchitectureissimilartoaschematicofthecomponent.
Page 10
ModelingStyles:
Therearethreemodelingstyles:
Behavioral(Sequential)
Dataflow
Structural
VHDLprovidestwodifferenttypesofexecution:sequentialandconcurrent.
Differenttypesofexecutionareusefulformodelingofrealhardware.
Supportsvariouslevelsofabstraction.
Sequentialstatementsviewhardwarefromaprogrammerapproach.
Concurrentstatementsareorderindependentandasynchronous
DataTypes
Therearescalarandarraydatatypesin
VHDL.
arraytypesexample
string
abc
bit_vector1001
charactera
bit
10
std_logic0forcing0
1forcing1
xforcingunknown
zhighimpedance
Page 11
dontcare
Lweak0
Hweak1
Uuninitialized
boolean
truefalse
real
2.351.0E+38
DataflowStyle:
SequentialStyle:
StructuralStyle:
Hardware Abstraction
VHDL is used to describe a model for a digital hardware device. This model specifies the external view of the device and
one or more internal views. The internal view of the device specifies the functionality or structure, while the external view
specifies the interface of the device through which it communicates with the other models in its environment. Figure I.I
shows the hardware device and the corresponding software model.
The device to device model mapping is strictly a one to many. That is, a hardware device may have many device models. For
example, a device modeled at a high leyel of abstraction may not have a clock as one of its inputs, since the clock may not
have been used in the description. Also the data transfer at the interface may be treated in terms of say, integer values,
instead of logical values. In VHDL, each device model is treated as a distinct representation of a unique device, called an
entity in this text. Figure 1.2 shows the VHDL view of a hardware device that has multiple device models, with each device
model representing one entity. Even though entity I through N represent N different entities from the VHDL point of view, in
reality they represent the same hardware device.
CHAPTER 4)
IntroductionofsimulatorsoftwareQuartusII
Theory:
1.Creatingaproject
2.SynthesizingacircuitfromVHDLcodeusingtheQuartosIIIntegratedSynthesistool
3.FittingasynthesizedcircuitintoanAlteraFPGA
4.Examiningthereportontheresultsoffittingandtiminganalysis
5,examiningthesynthesizedcircuitintheformofaschematicdiagramgeneratedbythe
RTLViewertool
6.MakingsimpletimingassignmentsintheQuartosIIsoftware
Creatingaproject
Eachlogiccircuit,orsubcircuit,beingdesignedwiththeQuartusIIsoftwareiscalleda
project
SelectFile>NewProjectWizardtoreachawindowthatindicatesthecapabilityofthis
wizard.PressNexttogetthewindow.
2.Settheworkingdirectorytobequartus_tutorial;ofcourse,youcanuseadirectorynameof
yourchoice.
Theprojectmusthaveaname,whichisusuallythesameasthetopleveldesignentitythat
willbeincludedintheproject.
Chooseaddersubtractorasthenameforboththeprojectandthetoplevelentity
PressNext.
Page 13
Thiswindowmakesiteasytospecifywhichexistingfiles(ifany)shouldbeincludedinthe
project.AssumingThatwedonothaveanyexistingfiles,clickNext,whichleadstothe
window.
Inthiswindow,wecanspecifythetypeofdeviceinwhichthedesignedcircuitwillbe
implemented.
ChoosetheStratixmenuitemasthetargetdevicefamily.WecanlettheQuartusII
softwareselectaspecificdevicein
Page 14
thefamily,orwecanchoosethedeviceexplicitly.Wewilltakethelatterapproach.Fromthe
listofavailable
devices,choosethedevicecalledEP1S10F484C5.PressNext,whichopensthewindow.
Inthiswindowonecanspecifyanythirdpartytoolsthatshouldbeused.Acommonlyused
termforCAD
softwareforelectroniccircuitsisEDAtools,wheretheacronymstandsforelectronicdesign
automation.This
termisusedintheQuartusIImessagesthatrefertothirdpartytools,whicharethetools
developedand
marketedbycompaniesotherthanAltera;othertutorialsshowhowsuchtoolsmaybeused.
Sincewewillrely
solelyontheQuartusIItools,wewillnotchooseanyothertools.PressNext.Now,a
summaryofthechosen
settingsappearsinthescreenshowninFigure9.PressFinish,whichreturnstothemain
QuartusIIwindow,but
withaddersubtractorspecifiedasthenewproject,inthedisplaytitlebar,asindicated.
Page 15
UsingtheQuartusIITextEditor
ThissectionshowshowtousetheQuartusIITextEditor.Youcanskipthissectionifyou
prefertousesome
othertexteditortocreatetheaddersubtractor.vhdfile,orifyouhavechosentocopythefile
fromthe
qdesigns<versionnumber>\vhdl_verilog_tutorialdirectory.
1.SelectFile>NewtogetthewindowinFigure13,chooseVHDLFile,andclickOK.This
openstheText
Editorwindow.
Page 16
2.Thefirststepistospecifyanameforthefilethatwillbecreated.SelectFile>SaveAsto
openthepopup
boxdepicted.IntheboxlabeledSaveastypechooseVHDLFile.IntheboxlabeledFilename
typeaddersubtractor.PutacheckmarkintheboxAddfiletocurrentproject.ClickSave,
whichputsthefile
intothedirectoryquartus_tutorialandleadstotheTextEditorwindow.
3.MaximizetheTextEditorwindowandentertheVHDLcodeintoit.Savethefileby
typing
File>Save,orbytypingtheshortcutCtrls.
4.CompilingtheVHDLCode
TheVHDLcodeisprocessedbyseveralQuartusIItoolsthatanalyzethecodeandgenerate
animplementation
ofitforthetargetchip.Thesetoolsarecontrolledbytheapplicationprogramcalledthe
Compiler.
1.RuntheCompilerbyselectingProcessing>StartCompilation,orbyusingthetoolbaricon
.Asthe
compilationmovesthroughvariousstages,itsprogressisreportedinthewindowontheleft
side.Successful(or
unsuccessful)compilationisindicatedinapopupbox.AcknowledgeitbyclickingOK,
whichleadstothe
QuartusIIdisplay,inwhichwehaveexpandedtheEntityhierarchyinthetopleftcornerto
showallentitiesintheaddersubtractordesign.Inthemessagewindow,atthebottom,various
messagesaredisplayed.Incaseoferrors,therewillbeappropriatemessagesgiven.
Page 17
Whenthecompilationisfinished,acompilationreportisproduced.Awindowshowingthis
report,isopenedautomatically.Thewindowcanberesized,maximized,orclosedinthe
normalway,andit
canbeopenedatanytimeeitherbyselectingProcessing>CompilationReportorbyclicking
ontheicon.The
reportincludesanumberofsectionslistedontheleftsideofitswindow.Figure19displays
theCompilerFlow
Summarysection,whichindicatesthatonlyaminisculeamountofchipresourcesareneeded
toimplementthis
tinycircuitontheselectedFPGAchip.
5UsingtheRTLViewer
TheQuartusIIsoftwareincludesatoolthatcandisplayaschematicdiagramofthedesigned
circuit.The
display
isattheRegisterTransferLevelofdetail,andthetooliscalledtheRTLViewer.
CHAPTER 6)
VHDL CODE FOR UP/DOWN COUNTERS &
RESULTS:UP-DOWN counter
Figure shows how to build an up-down counter. The flip flops outputs are connected to
steering networks. An UP control signal produces either down counting or up counting. If the UP
signal is low, Q2, Q1 and Q0 are transmitted to the clock inputs; this results in a down counter. On
the other hand, when the UP is high, Q2, Q1 and Q0 drive the clock inputs and the circuit becomes
an up counter.
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity Counter_VHDL is
port( Number: in std_logic_vector(0 to 3);
Clock: in std_logic;
Load: in std_logic;
Reset: in std_logic;
Direction: in std_logic;
Output: out std_logic_vector(0 to 3) );
end Counter_VHDL;
architecture Behavioral of Counter_VHDL is
CODE LISTING:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity counter is
port(C, CLR, up_down : in std_logic;
Q : out std_logic_vector(3 downto 0));
end counter;
architecture archi of counter is
signal tmp: std_logic_vector(3 downto 0);
begin
process (C, CLR)
begin
if (CLR='1') then
else
tmp <= tmp - 1;
end if;
end if;
end process;
Q <= tmp;
end archi;
end process;
Q <= tmp;
end archi;
end process;
Q <= tmp;
end archi;
CHAPTER 5:
Steps to design and implement a circuit specified by
using VHDL Code.
END arch1;
Processing > Start> Start Ana/&i/abo.
10. Compile the saved file (logic gate)
Select Start Analysis and Elaboration to check syntax, if any ;
Click Ok
11. After compilation, we need a vector waveform file to simulate out design
files.
FUNCTIONAL SIMULATION
12. To check the correctness of our logic operation of the synthesised circuit.
select assignment> setting> from dropdown> select simulation options>
simulation mode>
run simulation > click ok
13. >processing
>functional simulation Net list new window opens
Functional simulation Net list generation was successful
> click OK
14. Now we can run functional simulation
>Processing>Start simulation
Note: new window opens showing simulation waveform output.
VHDL is an important part of VLSI. VLSI which is known as very large scale integration is a field,
which deals with the integration of large designs in a single silicon chip. VLSI Has basically two
areas, that is FRONTEND and BACKEND.
FRONTEND deals with the designing of our hardware and testing it. But this designing and testing is
done by writing a program or coding it in VHDL. We generally code the behavior of our design and
observe its functionality. There are many other constraints that we observe in FRONTEND DESIGN,
these are timing analysis, area, speed. We can also optimize our design. All these things are
accomplished through VHDL. FRONTEND design is used for Digital designing and simulation.
BACKEND deals with the fabrication section. But before fabrication. But before sending to
fabrication we optimize our design. This optimization is different from FRONTEND optimization.
This optimization is for the transistors. The design which has come from FRONTEND, its internal
schematic is observed in BACKEND. So the optimization of the analog components is also must and
important.
WHY VHDL?
In todays world every device is automated and automatic. Take for example a stepper motor, even
a stepper motor can be controlled through an IC. Also every electronic device has a microprocessor.
So the IC has become a common thing in every circuit.
IC is made by a process called FABRICATION. The average time for FABRICATION is about 3 months.
Also the cost involvement in fabrication is too high.
Suppose if a particular IC doesnt give you the desired results, then your money and time goes
waste. So the only thing that we can do is to do a through verification of our design before sending
it to FABRICATION.
The whole designing process starts from FRONTEND. This is where VHDL comes to play. Through
VHDL we can model design with higher level of abstraction. VHDL has the capability to test any
circuit and we can even select our test vectors for worst conditions to understand its performance.
Also the importance of VHDL is high due to many reasons. Firstly all semiconductor companies
spend 70% time for verification and verification is simply impossible without VHDL. Also through
VHDL we can edit our design for better performance. This saves a lot of time. For testing small
circuits we used to use bread boards, but when it comes to microprocessor it becomes impossible
to test and analyze it and also we waste a lot of time.
This semiconductor industry is a fast growing industry and with unbelievable future aspects. In
INDIA only verification is done and all designing work is done in abroad.
So the requirement and demand for good verification engineers is high.
BIBLIOGRAPHY:
. VHDL basics by Jayaram Bhaskar
. Digital Circuits by Anand Kumar
. Quartus II designed by altera
.www.google.com
.www.wikipedia.com
CONCLUSION:
Many VHDL constructs, although useful for simulation
and other stages in the design process, are not relevant
to synthesis. A sub-set of VHDL only can be used for
synthesis.
A construct may be fully supported, ignored, or
unsupported.
Ignored means that the construct will be allowed in the
VHDL file but will be ignored by the synthesis tool.
Unsupported means that the construct is not allowed