Digital Design Using VHDL: Using Xilinx'S Tool For Synthesis and Modelsim For Verification Part Ii
Digital Design Using VHDL: Using Xilinx'S Tool For Synthesis and Modelsim For Verification Part Ii
Using Xilinxs Tool for Synthesis and ModelSim for Verification Part II Ahmed Abu-Hajar, Ph.D. [email protected] Digitavid, Inc San Jose, CA
Delimiter: is a character that is used to separates lexical elements such as: & ( ) * + , - / : ; < = >| Compound delimiter: A sequence of two or more delimiters such as: => ** := /= >= <> -Identifier: Is a reserved word that has special meaning in the language User defined identifiers: words defined by users to name variables, blocks, constants, entities, ect.
Must start with a letter and may include numbers, digits, isolated underline character. All identifiers be distinct and user defined identifiers should be distinct from the reserved identifiers
Signal A : std_logic; -- comments until end of line -- every thing after -- will be ignored by the compiler
The sequence of these characters is string a -- with length 1 -- with length 0 How are you -- with length 11 if the string longer than one line, must use the concatenation operator & . This string is long for one line. Then we& use the concatenation operator
B111101 -- B means Binary (0-1) O 6150 -- O means Octal (0-7) X A8F9 -- X means Hexadecimal (0-F) 111101 -- No letter means Binary Separating the digits for easier readability using underline char _ is allowed only if the base is specified.
B1111_0000 --allowed 1111_0000 -- Not allowed
Abstract Literal: Has numerical values which are integer or real. VHDL divide them into to types
Decimal Literal: Use E letter to give the exponent part, and may use under line char for readability
6, 67_345, 2.680E-8, .
Scalar
FILE
Access
COMPOSIT
Record
Array
Real
Integer
Predefined build in in the VHDL standard libraries: Type Boolean is (FALSE, TRUE); Type Bit is (0,1); Type STD_ULOGIC(U,X, 0,1,Z, W, L,H,-); Type character is uses ASCII 128 charters. Severity Level associated with the assert statement . User defined Enumeration types Type state is (S0, S1, S2); Type color is ( RED, BLUE, GREEN, YELLOW);
The range is bounded over [-2147482647, 2147482647] The type can be in descending or ascending order. type index range 0 to 7; -- ascending type down_counter range 15 downto 0; -- descending type temp range 0.0 to 100.0; -- ascending
Examples
type time is range 0 to 1E20; units fs; ps = 1000 fs; ns = 1000 ps; us = 1000 ns; ms = 1000 ns; s = 1000 ms; min = 60 s; hr = 60 min; end units;
Attributes May be predefined or user defined User define attribute do not affect the simulation
high and low returns most high and most low data. leftof and rightof returns the data the next left or next right symbol
pred and succ gives the preceded and the succeeded values
high and low returns most high and most low data. leftof and rightof returns the data the next left or next right symbol
pred and succ gives the preceded and the succeeded values Attributes for Array: Example: lets define a 32 bit word as an array Type word is array (range 31 downto 0) of bit; wordrange returns range 31 downto 0 wordlength returns 32 wordleft returns 31 wordright returns 0 wordhigh returns 15 wordlow returns 0
Constants
The value of a constant is specified when it is declared. The data type of constants must be defined before declaration A Constant value is specified using := delimiter Examples:
PI A Next_state
Ports in the entity declaration section Intermediate nodes in the signal declaration section of the Architecture. Before the begin statement
Signals are nodes that carry voltage which may change with time. Only port signals my be exposed to other entities Input ports may not be assigned values Signal declaration has the same rules as variables signal x1, x2, x3 : bit; signal Reg1 :std_logic_vector(16 downto 0); signal a, b : std_logic :=0;
Cin
Sum
Cout
Cin
Sum