Date post: | 17-Dec-2015 |
Category: |
Documents |
Upload: | ananthcjayan |
View: | 215 times |
Download: | 0 times |
Introduction to VHDLDr. Adnan Shaout
The University of Michigan-Dearborn
Intro to VHDL
Adnan ShaoutIntro to VHDL*ObjectiveQuick introduction to VHDLbasic language conceptsbasic design methodologyexamples
Intro to VHDL
Adnan ShaoutIntro to VHDL*VHDL
Very Hard Difficult Language
Intro to VHDL
Adnan ShaoutIntro to VHDL*jk -- VHDLVHSIC HardwareDescription Language--------------------------------------
VHSIC --Very High Speed Integrated Circuits
Intro to VHDL
Adnan ShaoutIntro to VHDL*Modeling Digital SystemsVHDL is for coding models of a digital system...Reasons for modelingrequirements specificationdocumentationtesting using simulationformal verificationsynthesisclass assignments Goalmost reliable design process, with minimum cost and timeavoid design errors!
Intro to VHDL
Adnan ShaoutIntro to VHDL*Basic VHDL ConceptsInterfaces -- i.e. portsBehaviorStructureTest BenchesAnalysis, simulationSynthesis
Intro to VHDL
Adnan ShaoutIntro to VHDL*VHDL -- VHDL is a programming language that allows one to model and develop complex digital systems in a dynamic envirornment.
Object Oriented methodology for you C people can be observed -- modules can be used and reused.
Allows you to designate in/out ports (bits) and specify behavior or response of the system.
Intro to VHDL
Adnan ShaoutIntro to VHDL*VHDL Intro.--Oh yeah, For all you C people --forget everything you know...
Well, not EVERYTHING ...
But VHDL is NOT C ... There are some similarities, as with any programming language, but syntax and logic are quite different; so get over it !! -obviously, this was a painful transition for me.
Intro to VHDL
Adnan ShaoutIntro to VHDL*3 ways to DO IT -- the VHDL wayDataflowBehavioralStructural
Kindof BORING sounding huh?? well, it gets more exciting with the details !!:)
Intro to VHDL
Adnan ShaoutIntro to VHDL*Jumping right in to a Model -- e.g. 1lets look at a d - flip-flop model -- doing it the dataflow way..... ignore the extra junk for now --
entity dff_flow is port ( d :in bit;prn:in bit;clrn:in bit;q:out bit;qbar:out bit; );end dff_flow;architecture arch1 of dff_flow isbeginq
Adnan ShaoutIntro to VHDL*
-------Dr. Adnan Shaoutlibrary ieee; use ieee.std_logic_1164.all;
entity fulladd isport(A1,A2,Cin: IN std_logic;Sum, Cout: OUT std_logic);end fulladd;
Architecture a of fulladd isBeginprocess(A1,A2,Cin)Begin Sum
Adnan ShaoutIntro to VHDL*Modeling InterfacesEntity declarationdescribes the input/output ports of a moduleentity reg4 is port ( d0, d1, d2, d3, en, clk : in bit; q0, q1, q2, q3 : out bit ); end entity reg4;entity nameport namesport mode (direction)port typereserved wordspunctuation
Intro to VHDL
Adnan ShaoutIntro to VHDL*Modeling the Behavior wayArchitecture bodydescribes an implementation of an entitymay be several per entityBehavioral architecturedescribes the algorithm performed by the modulecontainsprocess statements, each containingsequential statements, includingsignal assignment statements andwait statements
Intro to VHDL
Adnan ShaoutIntro to VHDL*VHDL -- goofy syntax to know..Omit entity at end of entity declarationOmit architecture at end of architecture bodyOmit is in process statement headerarchitecture behav of reg4 is beginprocess (d0, ... ) ... begin ... end process ;end behav;entity reg4 is port ( d0, d1, d2 : in bit d3, en, clk : in bit; q0, q1, q2, q3 : out bit ); end reg4;
Intro to VHDL
Adnan ShaoutIntro to VHDL*Modeling the Structurural wayStructural architectureimplements the module as a composition of subsystemscontainssignal declarations, for internal interconnectionsthe entity ports are also treated as signalscomponent instancesinstances of previously declared entity/architecture pairsport maps in component instancesconnect signals to component ports
Intro to VHDL
Adnan ShaoutIntro to VHDL*Structural way -- e.g. 3
Intro to VHDL
d_latch
d
clk
q
bit0
q
clk
d
d_latch
bit1
q
clk
d
d_latch
bit2
q
clk
d
d_latch
bit3
y
b
a
and2
gate
int_clk
d0
d1
d2
d3
en
clk
q0
q1
q2
q3
Adnan ShaoutIntro to VHDL*Structural way cont..First declare D-latch and and-gate entities and architecturesentity d_latch is port ( d, clk : in bit; q : out bit ); end entity d_latch;
architecture basic of d_latch is beginprocess (clk, d) begin if clk = 1 then q
Adnan ShaoutIntro to VHDL*Structural way...Declare corresponding components in register architecture bodyarchitecture struct of reg4 iscomponent d_latch port ( d, clk : in bit; q : out bit ); end component;component and2 port ( a, b : in bit; y : out bit ); end component;signal int_clk : bit;...
Intro to VHDL
Adnan ShaoutIntro to VHDL*Structural way..Now use them to implement the register...beginbit0 : d_latch port map ( d0, int_clk, q0 );bit1 : d_latch port map ( d1, int_clk, q1 );bit2 : d_latch port map ( d2, int_clk, q2 );bit3 : d_latch port map ( d3, int_clk, q3 );gate : and2 port map ( en, clk, int_clk );end struct;
Intro to VHDL
Adnan ShaoutIntro to VHDL*Mixed Behavior and StructureAn architecture can contain both behavioral and structural partsprocess statements and component instancescollectively called concurrent statementsprocesses can read and assign to signalsExample: register-transfer-level (RTL) Modeldata path described structurallycontrol section described behaviorally
Intro to VHDL
Adnan ShaoutIntro to VHDL*Mixed Example
Intro to VHDL
shift_reg
reg
shift_
adder
control_
section
multiplier
multiplicand
product
Adnan ShaoutIntro to VHDL*Mixed Exampleentity multiplier is port ( clk, reset : in bit; multiplicand, multiplier : in integer; product : out integer ); end multiplier;
architecture mixed of mulitplier issignal partial_product, full_product : integer; signal arith_control, result_en, mult_bit, mult_load : bit;beginarith_unit : entity work.shift_adder(behavior) port map ( addend => multiplicand, augend => full_product, sum => partial_product, add_control => arith_control );result : entity work.reg(behavior) port map ( d => partial_product, q => full_product, en => result_en, reset => reset );...
Intro to VHDL
Adnan ShaoutIntro to VHDL*Test Bench your ModelTesting a design by simulationUse a test bench modela Model that uses your Modelapply test sequences to your inputsmonitors values on output signalseither using simulatoror with a process that verifies correct operationor logic analyzer
Intro to VHDL
Adnan ShaoutIntro to VHDL*AnalysisCheck for syntax and logic errorssyntax: grammar of the languagelogic: how your Model responds to stimuliAnalyze each design unit separatelyentity declarationarchitecture bodyput each design unit in a separate file -- helps a lot.Analyzed design units are placed in a librarymake sure your Model is truly OOP
Intro to VHDL
Adnan ShaoutIntro to VHDL*SimulationDiscrete event simulationtime advances in discrete stepswhen signal values changeevents occurA processes is sensitive to events on input signalsspecified in wait statementsresumes and schedules new values on output signalsschedules transactionsevent on a signal if value changes
Intro to VHDL
Adnan ShaoutIntro to VHDL*Simulation AlgorithmInitialization phaseeach signal is given its initial valuesimulation time set to 0for each processactivateexecute until a wait statement, then suspendexecution usually involves scheduling transactions on signals for later times
Intro to VHDL
Adnan ShaoutIntro to VHDL*Simulation AlgorithmSimulation cycleadvance simulation time to time of next transactionfor each transaction at this timeupdate signal valueevent if new value is different from old valuefor each process sensitive to any of these events, or whose wait for time-out has expiredresumeexecute until a wait statement, then suspendSimulation finishes when there are no further scheduled transactions
Intro to VHDL
Adnan ShaoutIntro to VHDL*Basic Design Methodology
Intro to VHDL
Adnan ShaoutIntro to VHDL*VHDL -- conclusion...Thats it !! in review -- replay presentaion
Now for first asignment design a computerMemory accessprocessordata/address busdisplay
Always remember to use this knowledge for GOOD...
Intro to VHDL
***