520 likes | 647 Views
Hardware description languages: introduction intellectual property (IP) introduction to VHDL and Verilog entities and architectural bodies behavioral, structural, and dataflow views examples.
E N D
Hardware description languages: introduction • intellectual property (IP) • introduction to VHDL and Verilog • entities and architectural bodies • behavioral, structural, and dataflow views • examples
hardware description languages (HDL's): HDL is a language to describe hardware, just like it says; typically a HDL tries to use programming-language-type syntax and constructs to describe hardware, allowing the user to avoid the use of schematics
Some things HDL's must deal with: parallel activity (e.g., in a half adder, both the XOR and AND gates receive inputs simultaneously) vector inputs (e.g., in an 8-bit adder, the inputs are each 8 bits and the output is 9 bits) timing--both sequential and combinational logic (e.g., in a register the interaction between the clock input and the state changes must be described) levels of abstraction ideally will support both analysis and synthesis for hardware components/systems
intellectual property (IP): HDL's are an effective way to describe components in which the internal workings ("intellectual property") are proprietary but the interface to other components must be public "popular" HDL's: VHDL, Verilog Both have “AMS” (Analog and Mixed Signal) extensions
Two main HDLs: VHDL / Verilog VHDL--Very High Speed Integrated Circuit (VHSIC) Hardware Description Language Standards--IEEE 1076-1987;1076-1993; Ada-like language Additions--VHDL-AMS--Analog & Mixed Signal Verilog—1985; proprietary to Cadence until 1990 (“open Verilog”) C-like language Additions—Verilog-AMS—Analog & Mixed Signal NOTE: this course is NOT designed to make you a VHDL or Verilog expert! The Altera tools (as well as other synthesis tools) work best with simpler HDL constructs (e.g., structural representations, modest levels of nesting)
VHDL and Verilog: Behavioral, Structural, and “Dataflow" views supported Physical views generally not supported --descriptions do not encompass the low-level physical details of a design --in particular descriptions can be "technology independent"; this supports REUSABILITY --for simulation, may add details of a particular technology [this quarter—HDL designs are tied to the specific technology of the chosen Altera device] Both languages allow for “testbenches” to aid simulaton (altera does not support the testbench concept; best-supported simulation is through graphical waveforms)
what can HDLs be used for? design entry simulation ("analysis"): simulators are examples of "discrete event simulators" E1 E11 E2 E12 E22 E3 E4 E111 E41 synthesis: HDL description can be turned into a circuit layout by powerful "silicon compilers" time
VHDL *entity—interface to the outside world *architectural body—functionality *one entity can be paired with several architectural bodies, for example a structural body and a behavioral body
Verilog: Much of the following is taken from the introduction by Dan Hyde at: http://www.eg.bucknell.edu/~cs320/1995-fall/verilog-manual.html Other references can be found at: http://www.verilog.net/docs.html Architectural, behavioral, gate, and switch levels supported Gate level: logic elements (structural) Switch level: transistor level Verilog program can be used for design, simulation, synthesis Basic construct: module Verilog program consists of interconnected modules Usually a “top” module encapsulates all the others NOTE: Altera does not allow simulation statements
Verilog: a C-like language Basic parts of a Verilog module: fig_A1_01 fig_A1_01
Another example of a structural module in Verilog: fig_A1_09 fig_A1_09
Some simple examples of combinational logic: // NAND gate (behavioral model) module NAND(in1, in2, out); input in1, in2; output out; assign out = ~(in1 & in2); endmodule //AND gate (structural module) module AND(in1, in2, out); input in1, in2; output out; wire w1; NAND NAND1(in1, in2, w1); NAND NAND2(w1, w1, out); endmodule
fig_A1_02 Typical declarations (“vectors”): fig_A1_02
fig_A1_03 Verilog computation and initialization examples: (myWires[2] is output, and gate is named a1) fig_A1_03
fig_A1_07 Verilog combinational functions-structural primitives: fig_A1_07
table_A1_00 table_A1_00
table_A1_01 table_A1_01
fig_A1_10 Modeling delays: fig_A1_10
fig_A1_11 fig_A1_11
fig_A1_12 fig_A1_12
fig_A1_13 fig_A1_13
fig_A1_14 fig_A1_14
fig_A1_15 fig_A1_15
Dataflow: continuous assignment Syntax: Assign destination = source *Destination cannot be a register or a function *any change in rhs forces a change in lhs—assignment is “always active” Examples:
fig_A1_16 (delays added) Inputs / outputs: fig_A1_16
fig_A1_19 Rise and fall times can also be added fig_A1_19
Dataflow models of sequential logic can be constructed: fig_A1_21 fig_A1_21
Behavioral level: In C or C++, execution is sequential In Verilog execution is concurrent *Program is a collection of initial or always blocks; *Each block is a separate flow of control, independent of the others *Each block is defined by begin and end statements *Blocks cannot be nested Two types of procedural assignment: Blocking: sequential: A = B; Nonblocking: parallel: A <= B; Both can have delays added Example:
Additional examples from text: fig_A1_24 fig_A1_24
fig_A1_25 fig_A1_25
fig_A1_26 fig_A1_26
fig_A1_27 fig_A1_27