ECE 368 Exam 1 Flashcards
What is VHDL?
▸VHSIC (Very High Speed Integrated Circuit) Hardware Description Language.
▸Describes the behavior or structure of an electronic circuit or system, from which the physical circuit or system can then be inferred/ implemented by a compiler.
Once you have VHDL, you can:
▸Implement the circuit in a programmable device (CPLD/FPGA – complex programmable logic device/field programmable gate array).
▸Layout/mask generation for ASIC (application specific integrated circuit) Fabrication.
What does VHDL do?
▸ VHDL is intended for circuit synthesis as well as circuit simulation.
▸ Synthesis: translation of a source code into a hardware structure that implements the intended functionality (converting a higher-level form of a design into a lower-level implementation).
▸ Simulation: a testing procedure to ensure that such functionality is indeed achieved by the synthesized circuit.
All statements in VHDL are…
Parallel
Optimization
is performed on the gate-level netlist for speed or for area.
▸The design can be simulated at this stage.
Place & Route
will generate the physical layout for
an FPGA chip or will generate the
masks for an ASIC.
Entity
Specifies the I/O ports of the circuit, plus (optional) generic constants.
Architecture
Contains the VHDL code proper, which describes how the circuit behaves, from which a compliant hardware is inferred.
Rules to name Identifiers (names that can be given by the user)?
▸ Must start with an alphabetic letter.
▸ Can contain alphabetic letters, decimal digits and underline character “”.
▸ Cannot end with “”.
▸ Cannot contain successive “__”.
Library Declarations
lists all libraries and respective packages needed in the design (the most commonly used libraries are IEEE, STD, WORK. STD and WORK are made visible by default).
Three fundamental sections that
comprise a piece of VHDL code:
Entity, Architecture, Library Declarations
Library
is a collection of
commonly used pieces of code.
Placing them inside a library
allows the code to be reused and
shared by other designs.
Within VHDL we can describe
the logic in three different
manners. These three different
architectures are:
‣ Dataflow
‣ Structural
‣ Behavioral
‣ Concurrent
‣ Sequential
Data Flow Style
Describes how the data flows from the
inputs to the output most often using NOT,
AND and OR operations.
Structural VHDL allows the designer to represent…
a system in terms of components and their interconnections.
Basic structural modeling includes:
‣ Design ENTITY modeled as a set of interconnected components.
‣ Components are
‣ Declared using component declaration.
‣ Instantiated using component instantiation statements.
‣ Interconnected using signals.
Component Declaration
Defines kind of module used, specifies external interface to component in terms of generic constants and ports.
Component declaration uses:
‣ The same name of component as entity of the component module.
‣ The same port declaration as module entity declared as component.
Component Instantiation
‣ Specifies usage of module in design.
‣ Inside architecture body (after BEGIN).
‣ Note, components can be described either structurally or behaviorally in separate entities treating these components as independent designs (subsystems).
Port Position - By Name
‣ Order of listed component ports in port map irrelevant.
‣ Need to specify explicitly names of component port and its corresponding design port.
‣ Assignment by “=>”, left would be the declared component port name, right would be the entity port name or the signal.
Port Position - By Position
‣ Order of component ports in port map important.
‣ Explicitly assumed to be the same as in component declaration – no need to mention component names!
‣ Order is important!
VHDL Objects
- An object is a named item of a specific type that has a value of a type.
- Objects constitute the means through which values are passed around.
- Such VHDL objects are CONSTANT, SIGNAL, VARIABLE, and FILE.
CONSTANT
▸ An object whose value cannot be changed.
▸ Simplified syntax for the declaration of constants is: CONSTANT constant_name: constant_type := constant_value;
▸ Name can be essentially any word, except reserved words.
▸ Type can be any VHDL type
▸ Value can be a constant or an expression involving constants.
▸ Make the code more readable; avoid using numeric values; and prevent errors when the value of a constant must be modified.
Deferred CONSTANT:
a constant declared without its value is said to be a deferred constant. Such a declaration
is allowed in a PACKAGE, but then the complete specification including the value must appear in the corresponding PACKAGE BODY.
Keyword OTHERS:
it is a useful keyword for making assignments. It represents all index value thatwere left unspecified.
SIGNAL
▸ Passes values in and out of the circuit, as well as between its internal units.
▸ A signal represents circuit interconnects (wires)
▸ All ports of an entity are signals by default.
▸ Signal declarations can be made in the declarative part.
▸ Signal declarations are not allowed in sequential code (i.e., PROCESS and subprograms), but signals can be used
there (its update is not immediate).
▸ A simplified syntax for signal declarations is:
SIGNAL signal_name: signal_type[range] [:= default_value];
▸ If default value is optional; if not included, an implicit value is assumed, which is the type’s leftmost value
▸ For integers, it is the range’s left bound
▸ For enumeration types, it is the first element in the list
VARIABLE
▸ VARIABLE represents only local information
▸ It can only be seen and modified inside the sequential unit
(i.e., PROCESS or subprogram) where it was created.
▸ Its update is immediate, so the new value can be promptly used in the next line of code. And multiple assignments to the same variable are fine.
▸ A simplified syntax for variable declarations is: VARIABLE variable_name: variable_type[range] [:= default_value];
FILE
▸ Not for synthesis but for simulation.
▸ File declarations make a file available for use to a design.
▸ To declare an object of FILE, a FILE type must first be created.
FILE TYPE
▸ FILE type: contains the name chosen to represent the type and the type of the data contained in the file (only one type is allowed).
TYPE type_name IS FILE OF type_in_file
FILE OBJECT
▸ FILE object: contains an identifier chosen to represent that object, followed by the type name, then the optional keyword OPEN with
the corresponding file-open mode (read_mode, write_mode, or append_mode, defined in the package standard of the library std). The expression at the end is a file name between double quotes.
FILE file_identifier: type_name [[OPEN open_mode] IS expression];
Predefined data type
defined in the provided VHDL packages
User-defined data type
defined by the user to handle specific situations.
▸A scalar type is declared using…
the keyword type.