SlideShare a Scribd company logo
VHDL HIERARCHICAL MODELINNG
Dr.R.P.Rao
To incorporate hierarchy in VHDL we must add component declarations and component
instantiations to the model. In addition, we need to declare internal signals to
interconnect the components. We can also include processes and concurrent statements
in the hierarchical model.
Format for Architecture body (for internal signals & hierarchy):
architecture architecture_name of entity_name is
signal declarations -- for internal signals in model
component decalarations -- for hierarchical models
begin
:
component instantiations
processes
concurrent statements
:
end architecture architecture_name;
Format for component declaration:
component component_name is
generic (generic_name(s): type := initial_value;
:
generic_name(s): type := initial_value);
port (signal_name(s): mode signal_type;
:
signal_name(s): mode signal_type);
end component component_name;
Note that the component_name is the same as the entity_name from the model being
called up. As a result, component declarations look just like the entity statements
(including generics and ports) for the component being declared but with
“component” substituted for “entity”. (In fact, I usually copy the entity from the
component being declared and paste it in the component declaration and do a global
replacement of “component” for “entity”.)
The component instantiation is the actual call to a specific use of the model where a
single component declaration can have multiple instantiations. As a result, each
component instantiation must include a unique name (instantiation_label along with
the component (component_name) being used. Furthermore, the values assigned to
generics in the component instantiation will override any initial values assigned to
the generic in the entity statement or component declaration for that model
(important when a component is called multiple times with different generic values
assigned to each call). There are some other subtle variations (noted in red below) in
the format for a component instantiation compared to an entity or component
declaration. There are two methods (and formats) for connecting signals to the port
of the component: 1) named association (aka, keyword notation) and 2) positional
association (aka, positional notation).
VHDL HIERARCHICAL MODELINNG
Dr.R.P.Rao
Format for component instantiation (keyword notation):
instantiation_label: component_name
generic map (generic_name => value, -- note , at end & not ;
:
generic_name => value) -- note no ; at end
port map (port_name => signal_name, -- note , at end & not ;
:
port_name => signal_name);
Note that port_name is the actual signal_name from the component decalaration (which
is also the same as in the original entity statement). The signal_name given here is
the actual signal in the hierarchical design being connected to that particular
port_name. The order of the generics values and signal_names can be in any order
since each is associated to a unique generic or port by the => operator. The penalty
is more junk to type in the spirit of verbosity.
Format for component instantiation (positional notation):
instantiation_label: component_name
generic map (generic_value, -- note , at end and not ;
:
generic_value) -- note no ; at end
port map (signal_name, -- note , at end and not ;
:
signal_name);
Note that the generic_values and signal_names must appear in the order given in the
component declaration in order to connect to the correct generic_name or
port_name, respecitively. Finding the correct order is no big deal since it is given
above in the component declaration that must also be included in the model
(therefore, positional notation is my personal preference).
Components instantiations are treated as concurrent statements where the inputs to
component represent the sensitivity list such that the component model is evaluated
whenever there is an event on one of its inputs. Therefore, component instantiations
cannot be included in a process.
Note that a constant logic value (i.e., ‘0’ or ‘1’) can be assigned to an unused input in the
component instantiation which will allow most synthesis tools to minimize the logic
associated with the unused input (or feature of the model being instantiated). This
also applies to bit_vectors as well where a string of constant logic values can be
applied. This is a powerful capability when used in conjunction with parameterized
modeling by allowing even more use of a parameterized model.
For example, consider a rising edge triggered N-bit counter with active high synchronous
reset, active high preset, active high parallel load, and active high count enable (with
that order of precedence).
VHDL HIERARCHICAL MODELINNG
Dr.R.P.Rao
entity REG is
generic (N: int := 3);
port (CLK,RST,PRE,LOAD,CEN: in bit;
DATIN: in bit_vector (N-1 downto 0);
DOUT: buffer bit_vector (N-1 downto 0));
end entity REG;
architecture RTL of REG is
begin
process (CLK) begin
if (CLK’event and CLK=’1’) then
if (RST = ‘1’) then DOUT <= (others => ‘0’);
elsif (PRE = ‘1’) then DOUT <= (others => ‘1’);
elsif (LOAD = ‘1’) then DOUT <= DATIN;
elsif (CEN = ‘1’) then DOUT <= DOUT + 1;
end if;
end if;
end process;
end architecture RTL;
Next consider the 3 instances of REG in the following hierarchical use of this model:
entity TOP is
port (CLK,X,Y,Z: in bit;
DIN: in bit_vector(5 downto 0);
Q1: out bit_vector(5 downto 0);
Q2: out bit_vector(4 downto 0);
Q3: out bit_vector(3 downto 0));
end entity TOP;
architecture HIER of TOP is
component REG is
generic (N: int := 3);
port (CLK,RST,PRE,LOAD,CEN: in bit;
DATIN: in bit_vector (N-1 downto 0);
DOUT: buffer bit_vector (N-1 downto 0));
end component REG;
begin
R1: REG generic map (6)
port map (CLK,’0’,’0’,X,’0’,DIN,Q1);
R2: REG generic map (5)
port map (CLK,Y,’0’,’0’,Z,”00000”,Q2);
R3: REG generic map (4)
port map (CLK,’0’,’0’,’1’,’0’,DIN(3 downto 0),Q3);
end architecture HIER;
When we synthesize this circuit, R1 will be a 6-bit register with active high parallel load
signal (not reset, preset, or counter logic), R2 will be a 5 bit counter with active high
reset and active high count enable (no parallel load or preset logic), and R3 will
VHDL HIERARCHICAL MODELINNG
Dr.R.P.Rao
simply be 4 flip-flops without any features, as can be seen in the following synthesis
report from ISE8.2
Performing bidirectional port resolution...
Synthesizing Unit <REG_1>.
Found 6-bit register for signal <DOUT>.
Summary: inferred 6 D-type flip-flop(s).
Synthesizing Unit <REG_2>.
Found 5-bit up counter for signal <DOUT>.
Summary: inferred 1 Counter(s).
Synthesizing Unit <REG_3>.
Found 4-bit register for signal <DOUT>.
Summary: inferred 4 D-type flip-flop(s).
Synthesizing Unit <hier>.
HDL Synthesis Report
Macro Statistics
# Counters : 1
5-bit up counter : 1
# Registers : 2
4-bit register : 1
6-bit register : 1
Advanced HDL Synthesis Report
Macro Statistics
# Counters : 1
5-bit up counter : 1
# Registers : 10
Flip-Flops : 10
Final Register Report
Macro Statistics
# Registers : 15
Flip-Flops : 15
Device utilization summary:
Selected Device : 3s200pq208-5
Number of Slices: 3 out of 1920 0%
Number of Slice Flip Flops: 15 out of 3840 0%
Number of 4 input LUTs: 6 out of 3840 0%
Number of IOs: 25
Number of bonded IOBs: 25 out of 141 17%
IOB Flip Flops: 10
Number of GCLKs: 1 out of 8 12%
Note that only 3 slices and 6 LUTs were used (actually only 5 LUTs in that final design)
for the counter R2 – the other two registers only used flip-flops which already have
clock enable, reset, and preset capabilities (even though none of these features were
used in the case of R3). Otherwise, the design would have required 12 slices and 20
LUTs for implement the three full register designs.

More Related Content

What's hot

answer-model-qp-15-pcd13pcd
answer-model-qp-15-pcd13pcdanswer-model-qp-15-pcd13pcd
answer-model-qp-15-pcd13pcd
Syed Mustafa
 
VHDL- data types
VHDL- data typesVHDL- data types
VHDL- data types
VandanaPagar1
 
Pointers and call by value, reference, address in C
Pointers and call by value, reference, address in CPointers and call by value, reference, address in C
Pointers and call by value, reference, address in C
Syed Mustafa
 
Verilog Lecture5 hust 2014
Verilog Lecture5 hust 2014Verilog Lecture5 hust 2014
Verilog Lecture5 hust 2014
Béo Tú
 
User defined functions in C programmig
User defined functions in C programmigUser defined functions in C programmig
User defined functions in C programmig
Appili Vamsi Krishna
 
FUNCTION IN C PROGRAMMING UNIT -6 (BCA I SEM)
 FUNCTION IN C PROGRAMMING UNIT -6 (BCA I SEM) FUNCTION IN C PROGRAMMING UNIT -6 (BCA I SEM)
FUNCTION IN C PROGRAMMING UNIT -6 (BCA I SEM)
Mansi Tyagi
 
VHDL- gate level modelling
VHDL- gate level modellingVHDL- gate level modelling
VHDL- gate level modelling
VandanaPagar1
 
User defined functions
User defined functionsUser defined functions
User defined functions
Rokonuzzaman Rony
 
Notes: Verilog Part 4- Behavioural Modelling
Notes: Verilog Part 4- Behavioural ModellingNotes: Verilog Part 4- Behavioural Modelling
Notes: Verilog Part 4- Behavioural Modelling
Jay Baxi
 
Functions in c
Functions in cFunctions in c
Functions in c
SunithaVesalpu
 
Recursive Function
Recursive FunctionRecursive Function
Recursive Function
Harsh Pathak
 
Prsentation on functions
Prsentation on functionsPrsentation on functions
Prsentation on functionsAlisha Korpal
 
Verilog Lecture4 2014
Verilog Lecture4 2014Verilog Lecture4 2014
Verilog Lecture4 2014
Béo Tú
 
Recursion in c
Recursion in cRecursion in c
Recursion in c
Saket Pathak
 
Coding verilog
Coding verilogCoding verilog
Coding verilog
umarjamil10000
 
Notes: Verilog Part 1 - Overview - Hierarchical Modeling Concepts - Basics
Notes: Verilog Part 1 - Overview - Hierarchical Modeling Concepts - BasicsNotes: Verilog Part 1 - Overview - Hierarchical Modeling Concepts - Basics
Notes: Verilog Part 1 - Overview - Hierarchical Modeling Concepts - Basics
Jay Baxi
 
C functions
C functionsC functions
RECURSION IN C
RECURSION IN C RECURSION IN C
RECURSION IN C
v_jk
 
Principle source of optimazation
Principle source of optimazationPrinciple source of optimazation
Principle source of optimazation
Siva Sathya
 

What's hot (19)

answer-model-qp-15-pcd13pcd
answer-model-qp-15-pcd13pcdanswer-model-qp-15-pcd13pcd
answer-model-qp-15-pcd13pcd
 
VHDL- data types
VHDL- data typesVHDL- data types
VHDL- data types
 
Pointers and call by value, reference, address in C
Pointers and call by value, reference, address in CPointers and call by value, reference, address in C
Pointers and call by value, reference, address in C
 
Verilog Lecture5 hust 2014
Verilog Lecture5 hust 2014Verilog Lecture5 hust 2014
Verilog Lecture5 hust 2014
 
User defined functions in C programmig
User defined functions in C programmigUser defined functions in C programmig
User defined functions in C programmig
 
FUNCTION IN C PROGRAMMING UNIT -6 (BCA I SEM)
 FUNCTION IN C PROGRAMMING UNIT -6 (BCA I SEM) FUNCTION IN C PROGRAMMING UNIT -6 (BCA I SEM)
FUNCTION IN C PROGRAMMING UNIT -6 (BCA I SEM)
 
VHDL- gate level modelling
VHDL- gate level modellingVHDL- gate level modelling
VHDL- gate level modelling
 
User defined functions
User defined functionsUser defined functions
User defined functions
 
Notes: Verilog Part 4- Behavioural Modelling
Notes: Verilog Part 4- Behavioural ModellingNotes: Verilog Part 4- Behavioural Modelling
Notes: Verilog Part 4- Behavioural Modelling
 
Functions in c
Functions in cFunctions in c
Functions in c
 
Recursive Function
Recursive FunctionRecursive Function
Recursive Function
 
Prsentation on functions
Prsentation on functionsPrsentation on functions
Prsentation on functions
 
Verilog Lecture4 2014
Verilog Lecture4 2014Verilog Lecture4 2014
Verilog Lecture4 2014
 
Recursion in c
Recursion in cRecursion in c
Recursion in c
 
Coding verilog
Coding verilogCoding verilog
Coding verilog
 
Notes: Verilog Part 1 - Overview - Hierarchical Modeling Concepts - Basics
Notes: Verilog Part 1 - Overview - Hierarchical Modeling Concepts - BasicsNotes: Verilog Part 1 - Overview - Hierarchical Modeling Concepts - Basics
Notes: Verilog Part 1 - Overview - Hierarchical Modeling Concepts - Basics
 
C functions
C functionsC functions
C functions
 
RECURSION IN C
RECURSION IN C RECURSION IN C
RECURSION IN C
 
Principle source of optimazation
Principle source of optimazationPrinciple source of optimazation
Principle source of optimazation
 

Similar to Hd6

INTRODUCTION TO VHDL
INTRODUCTION    TO    VHDLINTRODUCTION    TO    VHDL
INTRODUCTION TO VHDL
karthikpunuru
 
Vhdl introduction
Vhdl introductionVhdl introduction
Vhdl introduction
ashokqis
 
VHDL Subprograms and Packages
VHDL Subprograms and PackagesVHDL Subprograms and Packages
VHDL Subprograms and Packages
Ramasubbu .P
 
DSD
DSDDSD
PPT ON VHDL subprogram,package,alias,use,generate and concurrent statments an...
PPT ON VHDL subprogram,package,alias,use,generate and concurrent statments an...PPT ON VHDL subprogram,package,alias,use,generate and concurrent statments an...
PPT ON VHDL subprogram,package,alias,use,generate and concurrent statments an...
Khushboo Jain
 
VHDL
VHDLVHDL
06 chapter03 04_control_logix_tags_memory_structure_fa16
06 chapter03 04_control_logix_tags_memory_structure_fa1606 chapter03 04_control_logix_tags_memory_structure_fa16
06 chapter03 04_control_logix_tags_memory_structure_fa16
John Todora
 
vlsi introduction to hdl and its typesunit-1.pptx
vlsi introduction to hdl and its typesunit-1.pptxvlsi introduction to hdl and its typesunit-1.pptx
vlsi introduction to hdl and its typesunit-1.pptx
iconicyt2
 
Verilog presentation final
Verilog presentation finalVerilog presentation final
Verilog presentation final
Ankur Gupta
 
Verilog Final Probe'22.pptx
Verilog Final Probe'22.pptxVerilog Final Probe'22.pptx
Verilog Final Probe'22.pptx
SyedAzim6
 
VHDL-Behavioral-Programs-Structure of VHDL
VHDL-Behavioral-Programs-Structure of VHDLVHDL-Behavioral-Programs-Structure of VHDL
VHDL-Behavioral-Programs-Structure of VHDL
Revathi Subramaniam
 
Vhdl introduction
Vhdl introductionVhdl introduction
Vhdl introduction
Dhaval Shukla
 
Basic Coding In VHDL COding
Basic Coding In VHDL COdingBasic Coding In VHDL COding
Basic Coding In VHDL COding
anna university
 
Ddhdl 17
Ddhdl 17Ddhdl 17
Ddhdl 17
Akhil Maddineni
 
A Verilog HDL Test Bench Primer
A Verilog HDL Test Bench PrimerA Verilog HDL Test Bench Primer
A Verilog HDL Test Bench Primer
Nicole Heredia
 
Verilog
VerilogVerilog
Verilog
Mohamed Rayan
 
Introduction to C Language - Version 1.0 by Mark John Lado
Introduction to C Language - Version 1.0 by Mark John LadoIntroduction to C Language - Version 1.0 by Mark John Lado
Introduction to C Language - Version 1.0 by Mark John Lado
Mark John Lado, MIT
 
Building Hierarchy
Building HierarchyBuilding Hierarchy
Building Hierarchy
Mohamed Samy
 
C Programming Unit-1
C Programming Unit-1C Programming Unit-1
C Programming Unit-1
Vikram Nandini
 

Similar to Hd6 (20)

INTRODUCTION TO VHDL
INTRODUCTION    TO    VHDLINTRODUCTION    TO    VHDL
INTRODUCTION TO VHDL
 
Vhdl introduction
Vhdl introductionVhdl introduction
Vhdl introduction
 
VHDL Subprograms and Packages
VHDL Subprograms and PackagesVHDL Subprograms and Packages
VHDL Subprograms and Packages
 
DSD
DSDDSD
DSD
 
PPT ON VHDL subprogram,package,alias,use,generate and concurrent statments an...
PPT ON VHDL subprogram,package,alias,use,generate and concurrent statments an...PPT ON VHDL subprogram,package,alias,use,generate and concurrent statments an...
PPT ON VHDL subprogram,package,alias,use,generate and concurrent statments an...
 
VHDL
VHDLVHDL
VHDL
 
06 chapter03 04_control_logix_tags_memory_structure_fa16
06 chapter03 04_control_logix_tags_memory_structure_fa1606 chapter03 04_control_logix_tags_memory_structure_fa16
06 chapter03 04_control_logix_tags_memory_structure_fa16
 
vlsi introduction to hdl and its typesunit-1.pptx
vlsi introduction to hdl and its typesunit-1.pptxvlsi introduction to hdl and its typesunit-1.pptx
vlsi introduction to hdl and its typesunit-1.pptx
 
Verilog presentation final
Verilog presentation finalVerilog presentation final
Verilog presentation final
 
Verilog Final Probe'22.pptx
Verilog Final Probe'22.pptxVerilog Final Probe'22.pptx
Verilog Final Probe'22.pptx
 
VHDL-Behavioral-Programs-Structure of VHDL
VHDL-Behavioral-Programs-Structure of VHDLVHDL-Behavioral-Programs-Structure of VHDL
VHDL-Behavioral-Programs-Structure of VHDL
 
Vhdl introduction
Vhdl introductionVhdl introduction
Vhdl introduction
 
Basic Coding In VHDL COding
Basic Coding In VHDL COdingBasic Coding In VHDL COding
Basic Coding In VHDL COding
 
Ddhdl 17
Ddhdl 17Ddhdl 17
Ddhdl 17
 
A Verilog HDL Test Bench Primer
A Verilog HDL Test Bench PrimerA Verilog HDL Test Bench Primer
A Verilog HDL Test Bench Primer
 
Verilog
VerilogVerilog
Verilog
 
Introduction to C Language - Version 1.0 by Mark John Lado
Introduction to C Language - Version 1.0 by Mark John LadoIntroduction to C Language - Version 1.0 by Mark John Lado
Introduction to C Language - Version 1.0 by Mark John Lado
 
Building Hierarchy
Building HierarchyBuilding Hierarchy
Building Hierarchy
 
C Programming Unit-1
C Programming Unit-1C Programming Unit-1
C Programming Unit-1
 
Crash course in verilog
Crash course in verilogCrash course in verilog
Crash course in verilog
 

More from Prakash Rao

PAL
PALPAL
Digital Signal Processing by Dr. R. Prakash Rao
Digital Signal Processing by Dr. R. Prakash Rao Digital Signal Processing by Dr. R. Prakash Rao
Digital Signal Processing by Dr. R. Prakash Rao
Prakash Rao
 
Electromagnetic Theory and Transmission Lines by Dr. R. Prakash Rao
Electromagnetic Theory and Transmission Lines  by Dr. R. Prakash RaoElectromagnetic Theory and Transmission Lines  by Dr. R. Prakash Rao
Electromagnetic Theory and Transmission Lines by Dr. R. Prakash Rao
Prakash Rao
 
VLSI15
VLSI15VLSI15
VLSI15
Prakash Rao
 
VLSI14
VLSI14VLSI14
VLSI14
Prakash Rao
 
VLSI13
VLSI13VLSI13
VLSI13
Prakash Rao
 
VLSI12
VLSI12VLSI12
VLSI12
Prakash Rao
 
VLSI11
VLSI11VLSI11
VLSI11
Prakash Rao
 
VLSI9
VLSI9VLSI9
VLSI8
VLSI8VLSI8
VLSI7
VLSI7VLSI7
VLSI6
VLSI6VLSI6
VLSI5
VLSI5VLSI5
VLSI4
VLSI4VLSI4
VLSI3
VLSI3VLSI3
VLSI2
VLSI2VLSI2
VLSI DESIGN
VLSI DESIGN VLSI DESIGN
VLSI DESIGN
Prakash Rao
 
VLSI10
VLSI10VLSI10
VLSI10
Prakash Rao
 
BIASING OF BJT
BIASING OF BJT BIASING OF BJT
BIASING OF BJT
Prakash Rao
 

More from Prakash Rao (20)

PAL
PALPAL
PAL
 
Digital Signal Processing by Dr. R. Prakash Rao
Digital Signal Processing by Dr. R. Prakash Rao Digital Signal Processing by Dr. R. Prakash Rao
Digital Signal Processing by Dr. R. Prakash Rao
 
Electromagnetic Theory and Transmission Lines by Dr. R. Prakash Rao
Electromagnetic Theory and Transmission Lines  by Dr. R. Prakash RaoElectromagnetic Theory and Transmission Lines  by Dr. R. Prakash Rao
Electromagnetic Theory and Transmission Lines by Dr. R. Prakash Rao
 
VLSI15
VLSI15VLSI15
VLSI15
 
VLSI14
VLSI14VLSI14
VLSI14
 
VLSI13
VLSI13VLSI13
VLSI13
 
VLSI12
VLSI12VLSI12
VLSI12
 
VLSI11
VLSI11VLSI11
VLSI11
 
VLSI9
VLSI9VLSI9
VLSI9
 
VLSI8
VLSI8VLSI8
VLSI8
 
VLSI7
VLSI7VLSI7
VLSI7
 
VLSI6
VLSI6VLSI6
VLSI6
 
VLSI5
VLSI5VLSI5
VLSI5
 
VLSI4
VLSI4VLSI4
VLSI4
 
VLSI3
VLSI3VLSI3
VLSI3
 
VLSI2
VLSI2VLSI2
VLSI2
 
VLSI DESIGN
VLSI DESIGN VLSI DESIGN
VLSI DESIGN
 
VLSI10
VLSI10VLSI10
VLSI10
 
Fet
FetFet
Fet
 
BIASING OF BJT
BIASING OF BJT BIASING OF BJT
BIASING OF BJT
 

Recently uploaded

block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
Divya Somashekar
 
Automobile Management System Project Report.pdf
Automobile Management System Project Report.pdfAutomobile Management System Project Report.pdf
Automobile Management System Project Report.pdf
Kamal Acharya
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
JoytuBarua2
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation & Control
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
Kamal Acharya
 
Forklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella PartsForklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella Parts
Intella Parts
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Sreedhar Chowdam
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
Amil Baba Dawood bangali
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
R&R Consult
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
VENKATESHvenky89705
 
Courier management system project report.pdf
Courier management system project report.pdfCourier management system project report.pdf
Courier management system project report.pdf
Kamal Acharya
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
Robbie Edward Sayers
 
LIGA(E)11111111111111111111111111111111111111111.ppt
LIGA(E)11111111111111111111111111111111111111111.pptLIGA(E)11111111111111111111111111111111111111111.ppt
LIGA(E)11111111111111111111111111111111111111111.ppt
ssuser9bd3ba
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
Jayaprasanna4
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
AJAYKUMARPUND1
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
Massimo Talia
 

Recently uploaded (20)

block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
 
Automobile Management System Project Report.pdf
Automobile Management System Project Report.pdfAutomobile Management System Project Report.pdf
Automobile Management System Project Report.pdf
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
 
Forklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella PartsForklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella Parts
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
 
Courier management system project report.pdf
Courier management system project report.pdfCourier management system project report.pdf
Courier management system project report.pdf
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
 
LIGA(E)11111111111111111111111111111111111111111.ppt
LIGA(E)11111111111111111111111111111111111111111.pptLIGA(E)11111111111111111111111111111111111111111.ppt
LIGA(E)11111111111111111111111111111111111111111.ppt
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
 

Hd6

  • 1. VHDL HIERARCHICAL MODELINNG Dr.R.P.Rao To incorporate hierarchy in VHDL we must add component declarations and component instantiations to the model. In addition, we need to declare internal signals to interconnect the components. We can also include processes and concurrent statements in the hierarchical model. Format for Architecture body (for internal signals & hierarchy): architecture architecture_name of entity_name is signal declarations -- for internal signals in model component decalarations -- for hierarchical models begin : component instantiations processes concurrent statements : end architecture architecture_name; Format for component declaration: component component_name is generic (generic_name(s): type := initial_value; : generic_name(s): type := initial_value); port (signal_name(s): mode signal_type; : signal_name(s): mode signal_type); end component component_name; Note that the component_name is the same as the entity_name from the model being called up. As a result, component declarations look just like the entity statements (including generics and ports) for the component being declared but with “component” substituted for “entity”. (In fact, I usually copy the entity from the component being declared and paste it in the component declaration and do a global replacement of “component” for “entity”.) The component instantiation is the actual call to a specific use of the model where a single component declaration can have multiple instantiations. As a result, each component instantiation must include a unique name (instantiation_label along with the component (component_name) being used. Furthermore, the values assigned to generics in the component instantiation will override any initial values assigned to the generic in the entity statement or component declaration for that model (important when a component is called multiple times with different generic values assigned to each call). There are some other subtle variations (noted in red below) in the format for a component instantiation compared to an entity or component declaration. There are two methods (and formats) for connecting signals to the port of the component: 1) named association (aka, keyword notation) and 2) positional association (aka, positional notation).
  • 2. VHDL HIERARCHICAL MODELINNG Dr.R.P.Rao Format for component instantiation (keyword notation): instantiation_label: component_name generic map (generic_name => value, -- note , at end & not ; : generic_name => value) -- note no ; at end port map (port_name => signal_name, -- note , at end & not ; : port_name => signal_name); Note that port_name is the actual signal_name from the component decalaration (which is also the same as in the original entity statement). The signal_name given here is the actual signal in the hierarchical design being connected to that particular port_name. The order of the generics values and signal_names can be in any order since each is associated to a unique generic or port by the => operator. The penalty is more junk to type in the spirit of verbosity. Format for component instantiation (positional notation): instantiation_label: component_name generic map (generic_value, -- note , at end and not ; : generic_value) -- note no ; at end port map (signal_name, -- note , at end and not ; : signal_name); Note that the generic_values and signal_names must appear in the order given in the component declaration in order to connect to the correct generic_name or port_name, respecitively. Finding the correct order is no big deal since it is given above in the component declaration that must also be included in the model (therefore, positional notation is my personal preference). Components instantiations are treated as concurrent statements where the inputs to component represent the sensitivity list such that the component model is evaluated whenever there is an event on one of its inputs. Therefore, component instantiations cannot be included in a process. Note that a constant logic value (i.e., ‘0’ or ‘1’) can be assigned to an unused input in the component instantiation which will allow most synthesis tools to minimize the logic associated with the unused input (or feature of the model being instantiated). This also applies to bit_vectors as well where a string of constant logic values can be applied. This is a powerful capability when used in conjunction with parameterized modeling by allowing even more use of a parameterized model. For example, consider a rising edge triggered N-bit counter with active high synchronous reset, active high preset, active high parallel load, and active high count enable (with that order of precedence).
  • 3. VHDL HIERARCHICAL MODELINNG Dr.R.P.Rao entity REG is generic (N: int := 3); port (CLK,RST,PRE,LOAD,CEN: in bit; DATIN: in bit_vector (N-1 downto 0); DOUT: buffer bit_vector (N-1 downto 0)); end entity REG; architecture RTL of REG is begin process (CLK) begin if (CLK’event and CLK=’1’) then if (RST = ‘1’) then DOUT <= (others => ‘0’); elsif (PRE = ‘1’) then DOUT <= (others => ‘1’); elsif (LOAD = ‘1’) then DOUT <= DATIN; elsif (CEN = ‘1’) then DOUT <= DOUT + 1; end if; end if; end process; end architecture RTL; Next consider the 3 instances of REG in the following hierarchical use of this model: entity TOP is port (CLK,X,Y,Z: in bit; DIN: in bit_vector(5 downto 0); Q1: out bit_vector(5 downto 0); Q2: out bit_vector(4 downto 0); Q3: out bit_vector(3 downto 0)); end entity TOP; architecture HIER of TOP is component REG is generic (N: int := 3); port (CLK,RST,PRE,LOAD,CEN: in bit; DATIN: in bit_vector (N-1 downto 0); DOUT: buffer bit_vector (N-1 downto 0)); end component REG; begin R1: REG generic map (6) port map (CLK,’0’,’0’,X,’0’,DIN,Q1); R2: REG generic map (5) port map (CLK,Y,’0’,’0’,Z,”00000”,Q2); R3: REG generic map (4) port map (CLK,’0’,’0’,’1’,’0’,DIN(3 downto 0),Q3); end architecture HIER; When we synthesize this circuit, R1 will be a 6-bit register with active high parallel load signal (not reset, preset, or counter logic), R2 will be a 5 bit counter with active high reset and active high count enable (no parallel load or preset logic), and R3 will
  • 4. VHDL HIERARCHICAL MODELINNG Dr.R.P.Rao simply be 4 flip-flops without any features, as can be seen in the following synthesis report from ISE8.2 Performing bidirectional port resolution... Synthesizing Unit <REG_1>. Found 6-bit register for signal <DOUT>. Summary: inferred 6 D-type flip-flop(s). Synthesizing Unit <REG_2>. Found 5-bit up counter for signal <DOUT>. Summary: inferred 1 Counter(s). Synthesizing Unit <REG_3>. Found 4-bit register for signal <DOUT>. Summary: inferred 4 D-type flip-flop(s). Synthesizing Unit <hier>. HDL Synthesis Report Macro Statistics # Counters : 1 5-bit up counter : 1 # Registers : 2 4-bit register : 1 6-bit register : 1 Advanced HDL Synthesis Report Macro Statistics # Counters : 1 5-bit up counter : 1 # Registers : 10 Flip-Flops : 10 Final Register Report Macro Statistics # Registers : 15 Flip-Flops : 15 Device utilization summary: Selected Device : 3s200pq208-5 Number of Slices: 3 out of 1920 0% Number of Slice Flip Flops: 15 out of 3840 0% Number of 4 input LUTs: 6 out of 3840 0% Number of IOs: 25 Number of bonded IOBs: 25 out of 141 17% IOB Flip Flops: 10 Number of GCLKs: 1 out of 8 12% Note that only 3 slices and 6 LUTs were used (actually only 5 LUTs in that final design) for the counter R2 – the other two registers only used flip-flops which already have clock enable, reset, and preset capabilities (even though none of these features were used in the case of R3). Otherwise, the design would have required 12 slices and 20 LUTs for implement the three full register designs.