Академический Документы
Профессиональный Документы
Культура Документы
Overview
VHDL review 1
Highly recommend VHDL tutorial
120 pages with a LOT of examples
http://courseware.ee.calpoly.edu/~bmealy/shock_awe_vhdl_adobe.pdf
Quick reference
http://hapssupportnet.synplicity.com/download/VHDL-Handbook.pdf (quick ref)
HW 1 overview
VHDL basics
VHDL: (V)HSIC (H)ardware (D)escription (L)anguage VHSIC: (V)ery (H)igh (S)peed (I)ntegrated (C)ircuit It is NOT a programming language!!!
VHDL example
VHDL example
VHDL example
VHDL example
VHDL example
VHDL example
Snap shot after input change A <= B + C X <= Y + Z Ans <= A + X Simulates in parallel ever delta time step
VHDL example
VHDL example
Different
VHDL example
Snap shot after input change A <= B + C X <= Y + Z Ans <= A + X Simulates in parallel ever delta time step
VHDL example
VHDL example
VHDL example
Corresponding circuit
VHDL example
Initially: A,B,C,X,Y,Z,Ans =1 A <= B + C X <= Y + Z Ans <= A + X Simulates in parallel ever delta time step
Corresponding circuit
VHDL example
Initially: A,B,C,X,Y,Z,Ans =1 A <= B + C X <= Y + Z Ans <= A + X Simulates in parallel ever delta time step
B(1)
C(1)
Y(1) Z(1)
+ +
A(1)
+
X(1)
Ans(1)
Corresponding circuit
VHDL example
Initially: A,B,C,X,Y,Z,Ans =1 A <= B + C X <= Y + Z Ans <= A + X Simulates in parallel ever delta time step
B(1)
C(1)
Y(1) Z(1)
+ +
A(2)
+
X(2)
Ans(2)
Corresponding circuit
VHDL example
Initially: A,B,C,X,Y,Z,Ans =1 A <= B + C X <= Y + Z Ans <= A + X Simulates in parallel ever delta time step
B(1)
C(1)
Y(1) Z(1)
+ +
A(2)
+
X(2)
Ans(4)
B(1)
C(1)
Y(1) Z(1)
+
2ns
A(1)
+
X(1) 2ns
Ans(1)
+
2ns
B(1)
C(1)
Y(1) Z(1)
+
2ns
A(2)
+
X(2) 2ns
Ans(2)
+
2ns
B(1)
C(1)
Y(1) Z(1)
+
2ns
A(2)
+
X(2) 2ns
Ans(4)
+
2ns
Declare internal ARCHITECTURE structure OF test_circuit IS signal A : std_logic_vector(7 downto 0); signals, signal X : std_logic_vector(7 downto 0); components BEGIN
Process
Process provide a level serialization in VHDL (e.g. variables, clocked processes) Help separate and add structure to VHDL design
Process Example
BEGIN My_process_1 : process (A,B,C,X,Y,Z) Begin Sensitivity list: specify inputs to the A <= B + C; process. Process is updated when X <= Y + Z; a specified input changes Ans <= A + X; End My_process_1; My_process_2 : process (B,X,Y,Ans1) Begin A <= B + 1; X <= B + Y; Ans2 <= Ans1 + X; End My_process_2; END;
26 - CPRE 583 (Reconfigurable Computing): VHDL overview 1
A signal can only be Driven (written) by one process. But can be read by many Compile or simulator may give a multiple driver Error or Warning message
or
C()
and or
Z()
Ans()
or
C()
and or
Z()
Ans()
or
C()
and or
Z()
Ans()
xor
C()
xor or
Z()
Ans()
xor
C()
xor or
Z()
Ans()
VHDL Constructs
Entity Process Signal, Variable, Constants, Integers Array, Record
std_logic, std_logic_vector
Very common data types std_logic Single bit value Values: U, X, 0, 1, Z, W, H, L, Example: signal A : std_logic;
A <= 1;
Std_logic_vector: is an array of std_logic Example: signal A : std_logic_vector (4 downto 0); A <= x00Z001
L : weak 0
Time step 0
38 - CPRE 583 (Reconfigurable Computing): VHDL overview 1
L : weak 0
Time step 0
39 - CPRE 583 (Reconfigurable Computing): VHDL overview 1
L : weak 0
Time step 1
40 - CPRE 583 (Reconfigurable Computing): VHDL overview 1
L : weak 0
Time step 2
41 - CPRE 583 (Reconfigurable Computing): VHDL overview 1
L : weak 0
Time step 3
42 - CPRE 583 (Reconfigurable Computing): VHDL overview 1
L : weak 0
0
1
Time step 3
43 - CPRE 583 (Reconfigurable Computing): VHDL overview 1
L : weak 0
0
1
Time step 3
44 - CPRE 583 (Reconfigurable Computing): VHDL overview 1
1
Iowa State University (Ames)
L : weak 0
0
0
Time step 3
45 - CPRE 583 (Reconfigurable Computing): VHDL overview 1
1
Iowa State University (Ames)
L : weak 0
1 Pull-up resistor
Time step 0
46 - CPRE 583 (Reconfigurable Computing): VHDL overview 1
L : weak 0
1 Pull-up resistor
Time step 0
47 - CPRE 583 (Reconfigurable Computing): VHDL overview 1
L : weak 0
1 Pull-up resistor
Time step 1
48 - CPRE 583 (Reconfigurable Computing): VHDL overview 1
L : weak 0
1 Pull-up resistor
Resolution(H,0) = 0
0 1
Time step 2
49 - CPRE 583 (Reconfigurable Computing): VHDL overview 1
BEGIN My_process_1 : process (clk) Begin IF (clkevent and clk = 1) THEN flag_1 <= flag_in; flag_2 <= flag_1; flag_3 <= flag_2; END IF; End My_process_1; flag_out <= flag_3 END;
BEGIN My_process_1 : process (clk) Begin IF (clkevent and clk = 1) THEN flag_1 <= flag_in; flag_2 <= flag_1; flag_20 <= flag_19; END IF; End My_process_1; flag_out <= flag_20 END;
type flag_reg_array is array (DELAY-1 downto 0) of std_logic; signal flag_reg : flag_reg_array; BEGIN My_process_1 : process (clk) Begin IF (clkevent and clk = 1) THEN flag_reg(flag_reg'high downto 0) <= flag_reg(flag_reg'high-1 downto 0) & flag_in; END IF; End My_process_1; flag_out <= flag_reg(flag_reg'high); END;
flag_in 1 0
flag(0) 0
flag(1) 1
flag(2) flag_out
flag_in 1
flag(0) 0
flag(1) 0
flag(2) flag_out
HW1
Questions/Comments/Concerns