CprE / ComS 583 Reconfigurable Computing

Slides:



Advertisements
Similar presentations
VHDL ELEC 418 Advanced Digital Systems Dr. Ron Hayne Images Courtesy of Thomson Engineering.
Advertisements

Sequential-Circuit Building Blocks
CSCI 660 EEGN-CSCI 660 Introduction to VLSI Design Lecture 3 Khurram Kazi Some of the slides were taken from K Gaj ’ s lecture slides from GMU ’ s VHDL.
Kazi Fall 2006 EEGN 4941 EEGN-494 HDL Design Principles for VLSI/FPGAs Khurram Kazi Some of the slides were taken from K Gaj’s lecture slides from GMU’s.
CSCI 660 EEGN-CSCI 660 Introduction to VLSI Design Lecture 2 Khurram Kazi Some of the slides were taken from K Gaj ’ s lecture slides from GMU ’ s VHDL.
ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448 – FPGA and ASIC Design with VHDL.
George Mason University ECE 448 – FPGA and ASIC Design with VHDL Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448.
Simple Testbenches Behavioral Modeling of Combinational Logic
ECE 545 Lecture 7 Behavioral Modeling of Sequential-Circuit Building Blocks Mixing Design Styles Modeling of Circuits with a Regular Structure.
Data Flow Modeling of Combinational Logic Simple Testbenches
ENG6090 RCS1 ENG6090 Reconfigurable Computing Systems Hardware Description Languages Part 4: Modeling Dataflow.
A.7 Concurrent Assignment Statements Used to assign a value to a signal in an architecture body. Four types of concurrent assignment statements –Simple.
CprE / ComS 583 Reconfigurable Computing Prof. Joseph Zambreno Department of Electrical and Computer Engineering Iowa State University Lecture #17 – Introduction.
VHDL Introduction. V- VHSIC Very High Speed Integrated Circuit H- Hardware D- Description L- Language.
CprE / ComS 583 Reconfigurable Computing
CSET 4650 Field Programmable Logic Devices Dan Solarek VHDL Additional Details & Examples.
1 ECE 545 – Introduction to VHDL ECE 545 Lecture 4 Behavioral & Structural Design Styles.
VHDL for Combinational Circuits. VHDL We Know Simple assignment statements –f
1 ECE 545 – Introduction to VHDL Dataflow Modeling of Combinational Logic Simple Testbenches ECE 656. Lecture 2.
Mixed Style RTL Modeling
ECE 332 Digital Electronics and Logic Design Lab Lab 6 Concurrent Statements & Adders.
George Mason University Behavioral Modeling of Sequential-Circuit Building Blocks ECE 545 Lecture 6 Mixing Design Styles.
George Mason University Data Flow Modeling in VHDL ECE 545 Lecture 7.
CS/EE 3700 : Fundamentals of Digital System Design
04/26/20031 ECE 551: Digital System Design & Synthesis Lecture Set : Introduction to VHDL 12.2: VHDL versus Verilog (Separate File)
ECE 332 Digital Electronics and Logic Design Lab Lab 5 VHDL Design Styles Testbenches Concurrent Statements & Adders.
Data Flow Modeling in VHDL
George Mason University ECE 448 – FPGA and ASIC Design with VHDL VHDL Coding for Synthesis ECE 448 Lecture 12.
CDA 4253 FPGA System Design Sequential Circuit Building Blocks Hao Zheng Dept of Comp Sci & Eng USF.
George Mason University Behavioral Modeling of Sequential-Circuit Building Blocks ECE 545 Lecture 8.
CDA 4253 FPGA System Design Behavioral modeling of Combinational Circuits Hao Zheng Dept of Comp Sci & Eng USF.
VHDL 표현방식.
George Mason University Data Flow Modeling of Combinational Logic ECE 545 Lecture 5.
Data Flow and Behavioral Modeling in VHDL 1 MS EMBEDDED SYSTEMS.
George Mason University ECE 545 – Introduction to VHDL Data Flow & Structural Modeling of Combinational Logic ECE 545 Lecture 2.
Fundamentals of Digital System Design Pradondet Nilagupta Lecture 7: Flip-flops, Registers, Counters Chapter 7.
Combinational logic circuit
Describing Combinational Logic Using Processes
Registers and Counters
Figure 7.1 Control of an alarm system
CHAPTER 17 VHDL FOR SEQUENTIAL LOGIC
ECE 4110–5110 Digital System Design
ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448 – FPGA and ASIC Design with VHDL.
ECE 545 Lecture 9 Modeling of Circuits with a Regular Structure Aliases, Attributes, Packages.
Sequential-Circuit Building Blocks
ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448 – FPGA and ASIC Design with VHDL.
CHAPTER 17 VHDL FOR SEQUENTIAL LOGIC
VHDL Hardware Description Language
ECE 448 Lecture 6 Modeling of Circuits with a Regular Structure Aliases, Constants, Packages Mixing Design Styles ECE 448 – FPGA and ASIC Design with.
ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448 – FPGA and ASIC Design with VHDL.
Data Flow Modeling of Combinational Logic
VHDL (VHSIC Hardware Description Language)
ECE 545 Lecture 6 Behavioral Modeling of Sequential-Circuit Building Blocks Mixing Design Styles Modeling of Circuits with a Regular Structure.
CPE 528: Lecture #5 Department of Electrical and Computer Engineering University of Alabama in Huntsville.
Modeling of Circuits with a Regular Structure
Behavioral Modeling of Sequential-Circuit Building Blocks
Sequntial-Circuit Building Blocks
ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448 – FPGA and ASIC Design with VHDL.
Data Flow Description of Combinational-Circuit Building Blocks
Modeling of Circuits with a Regular Structure
Figure 8.1. The general form of a sequential circuit.
Data Flow Description of Combinational-Circuit Building Blocks
ECE 545 Lecture 9 Behavioral Modeling of Sequential-Circuit Building Blocks Mixing Design Styles Modeling of Circuits with a Regular Structure.
ECE 448 Lecture 4 Modeling of Circuits with a Regular Structure Constants, Aliases, Packages ECE 448 – FPGA and ASIC Design with VHDL.
Modeling of Circuits with a Regular Structure
Modeling of Circuits with Regular Structure
Sequntial-Circuit Building Blocks
디 지 털 시 스 템 설 계 UP2 Kit를 이용한 카운터 설계
(Sequential-Circuit Building Blocks)
Presentation transcript:

CprE / ComS 583 Reconfigurable Computing Prof. Joseph Zambreno Department of Electrical and Computer Engineering Iowa State University Lecture #17 – Introduction to VHDL II

CprE 583 – Reconfigurable Computing Quick Points Midterm course evaluation form available on WebCT HW #4 – VHDL for synthesis Due Thursday, November 2 (12:00pm) Work with your project group October 19, 2006 CprE 583 – Reconfigurable Computing

CprE 583 – Reconfigurable Computing Recap – PROCESS Block List of signals to which the process is sensitive Whenever there is an event on any of the signals in the sensitivity list, the process fires Every time the process fires, it will run in its entirety WAIT statements are NOT allowed in a processes with sensitivity list label: process (sensitivity list) declaration part begin statement part end process; CprE 583 – Reconfigurable Computing October 19, 2006

CprE 583 – Reconfigurable Computing Processes in VHDL Processes describe sequential behavior Processes in VHDL are very powerful statements Allow to define an arbitrary behavior that may be difficult to represent by a real circuit Not every process can be synthesized Use processes with caution in the code to be synthesized Use processes freely in testbenches October 19, 2006 CprE 583 – Reconfigurable Computing

CprE 583 – Reconfigurable Computing Mixed Style Modeling Process Ports Process (clk) if clk’Event and clk=‘1’ then Count <= Count + 1; end if; end process; Component in in Component out Signal out X <= (Y = ‘1’) and (Z = “110”) inout Dataflow Expression October 19, 2006 CprE 583 – Reconfigurable Computing

CprE 583 – Reconfigurable Computing Design Exercise Create the entity declaration for some component of your final project Names, ports, signal types Just the structure ENTITY entity_name IS PORT ( port_name : signal_mode signal_type; …………. port_name : signal_mode signal_type); END entity_name; CprE 583 – Reconfigurable Computing October 19, 2006

CprE 583 – Reconfigurable Computing Outline Recap Dataflow Style Logic Gates Decoders / Encoders Arithmetic Functions A Structural Example Behavioral Style Registers Counters October 19, 2006 CprE 583 – Reconfigurable Computing

CprE 583 – Reconfigurable Computing Dataflow VHDL All concurrent statements Major instructions: Concurrent signal assignment () Conditional concurrent signal assignment (when-else) Selected concurrent signal assignment (with-select-when) Generate scheme for equations (for-generate) October 19, 2006 CprE 583 – Reconfigurable Computing

Dataflow Example – Full Adder ENTITY fulladd IS PORT ( x : IN STD_LOGIC ; y : IN STD_LOGIC ; cin : IN STD_LOGIC ; s : OUT STD_LOGIC ; cout : OUT STD_LOGIC ) ; END fulladd ; ARCHITECTURE dataflow OF fulladd IS BEGIN s <= x XOR y XOR cin ; cout <= (x AND y) OR (cin AND x) OR (cin AND y) ; END dataflow ; CprE 583 – Reconfigurable Computing October 19, 2006

CprE 583 – Reconfigurable Computing Logical Operators AND, OR, NAND, NOR, XOR, NOT, XNOR Only NOT has order of precedence Otherwise, no implied precedence Example: y = ab + cd y <= a AND b or c AND d; -- Equivalent to y <= ((a AND b) OR c) AND d ; -- Equivalent to y = (ab + c)d October 19, 2006 CprE 583 – Reconfigurable Computing

CprE 583 – Reconfigurable Computing Arithmetic Operators For basic arithmetic operators on std_logic types, use the IEEE libraries Standard addition, subtraction, multiplication LIBRARY ieee; USE ieee.std_logic_1164.all; USE ieee.std_logic_unsigned.all; -- or std_logic_signed.all signal A : STD_LOGIC_VECTOR(3 downto 0); signal B : STD_LOGIC_VECTOR(3 downto 0); signal C : STD_LOGIC_VECTOR(3 downto 0); …… C <= A + B; CprE 583 – Reconfigurable Computing October 19, 2006

CprE 583 – Reconfigurable Computing 16-bit Addition LIBRARY ieee ; USE ieee.std_logic_1164.all ; USE ieee.std_logic_unsigned.all ; ENTITY adder16 IS PORT ( Cin : IN STD_LOGIC ; X, Y : IN STD_LOGIC_VECTOR(15 DOWNTO 0) ; S : OUT STD_LOGIC_VECTOR(15 DOWNTO 0) ; Cout : OUT STD_LOGIC ) ; END adder16 ; ARCHITECTURE Dataflow OF adder16 IS SIGNAL Sum : STD_LOGIC_VECTOR(16 DOWNTO 0) ; BEGIN Sum <= ('0' & X) + Y + Cin ; S <= Sum(15 DOWNTO 0) ; Cout <= Sum(16) ; END Dataflow ; October 19, 2006 CprE 583 – Reconfigurable Computing

Conditional Signal Assignment When - Else target_signal <= value1 when condition1 else value2 when condition2 else . . . valueN-1 when conditionN-1 else valueN; Value N Value N-1 Condition N-1 Condition 2 Condition 1 Value 2 Value 1 Target Signal … 1 .… 1 1 CprE 583 – Reconfigurable Computing October 19, 2006

CprE 583 – Reconfigurable Computing 2:1 Multiplexer LIBRARY ieee ; USE ieee.std_logic_1164.all ; ENTITY mux2to1 IS PORT (w0, w1, s : IN STD_LOGIC ; f : OUT STD_LOGIC ) ; END mux2to1 ; ARCHITECTURE dataflow OF mux2to1 IS BEGIN f <= w0 WHEN s = '0' ELSE w1 ; END dataflow ; October 19, 2006 CprE 583 – Reconfigurable Computing

CprE 583 – Reconfigurable Computing Priority Encoder LIBRARY ieee ; USE ieee.std_logic_1164.all ; ENTITY priority IS PORT (w : IN STD_LOGIC_VECTOR(3 DOWNTO 0) ; y : OUT STD_LOGIC_VECTOR(1 DOWNTO 0) ; z : OUT STD_LOGIC ) ; END priority ; ARCHITECTURE dataflow OF priority IS BEGIN y <= "11" WHEN w(3) = '1' ELSE "10" WHEN w(2) = '1' ELSE "01" WHEN w(1) = '1' ELSE "00" ; z <= '0' WHEN w = "0000" ELSE '1' ; END dataflow ; October 19, 2006 CprE 583 – Reconfigurable Computing

Selected Signal Assignment With –Select-When with choice_expression select target_signal <= expression1 when choices_1, expression2 when choices_2, . . . expressionN when choices_N; expression1 choices_1 expression2 choices_2 target_signal expressionN choices_N choice expression October 19, 2006 CprE 583 – Reconfigurable Computing

CprE 583 – Reconfigurable Computing 4:1 Multiplexer LIBRARY ieee ; USE ieee.std_logic_1164.all ; ENTITY mux4to1 IS PORT ( w0, w1, w2, w3 : IN STD_LOGIC ; s : IN STD_LOGIC_VECTOR(1 DOWNTO 0) ; f : OUT STD_LOGIC ) ; END mux4to1 ; ARCHITECTURE dataflow OF mux4to1 IS BEGIN WITH s SELECT f <= w0 WHEN "00", w1 WHEN "01", w2 WHEN "10", w3 WHEN OTHERS ; END dataflow ; October 19, 2006 CprE 583 – Reconfigurable Computing

CprE 583 – Reconfigurable Computing Generate Statements A way to simplify a pattern of concurrent statements Can’t do regular FOR…LOOP in dataflow For - Generate label: FOR identifier IN range GENERATE BEGIN {Concurrent Statements} END GENERATE; October 19, 2006 CprE 583 – Reconfigurable Computing

CprE 583 – Reconfigurable Computing Parity Example xor_out(1) xor_out(2) xor_out(3) xor_out(4) xor_out(5) xor_out(6) xor_out(7) xor_out(0) ARCHITECTURE parity_dataflow OF parity IS SIGNAL xor_out: STD_LOGIC_VECTOR (7 DOWNTO 0); BEGIN xor_out(0) <= parity_in(0); G2: FOR i IN 0 TO 6 GENERATE xor_out(i+1) <= xor_out(i) XOR parity_in(i+1); end generate G2; parity_out <= xor_out(7); END parity_dataflow; CprE 583 – Reconfigurable Computing October 19, 2006

Structural Mapping Example r(1) 1 q(0) w p(1) w y z(0) y q(1) r(2) w 1 p(2) y w z(1) y 1 r(3) w 1 1 2 ena y z z(2) w 2 3 priority r(4) p(3) z(3) y En 3 dec2to4 r(5) 1 s(1) October 19, 2006 CprE 583 – Reconfigurable Computing

Structural Mapping Example (cont.) LIBRARY ieee ; USE ieee.std_logic_1164.all ; ENTITY priority_resolver IS PORT (r : IN STD_LOGIC_VECTOR(5 DOWNTO 0) ; s : IN STD_LOGIC_VECTOR(1 DOWNTO 0) ; z : OUT STD_LOGIC_VECTOR(3 DOWNTO 0) ) ; END priority_resolver; ARCHITECTURE structural OF priority_resolver IS SIGNAL p : STD_LOGIC_VECTOR (3 DOWNTO 0) ; SIGNAL q : STD_LOGIC_VECTOR (1 DOWNTO 0) ; SIGNAL ena : STD_LOGIC ; October 19, 2006 CprE 583 – Reconfigurable Computing

Structural Mapping Example (cont.) COMPONENT mux2to1 PORT (w0, w1, s : IN STD_LOGIC ; f : OUT STD_LOGIC ) ; END COMPONENT ; COMPONENT priority PORT (w : IN STD_LOGIC_VECTOR(3 DOWNTO 0) ; y : OUT STD_LOGIC_VECTOR(1 DOWNTO 0) ; z : OUT STD_LOGIC ) ; COMPONENT dec2to4 PORT (w : IN STD_LOGIC_VECTOR(1 DOWNTO 0) ; En : IN STD_LOGIC ; y : OUT STD_LOGIC_VECTOR(0 TO 3) ) ; October 19, 2006 CprE 583 – Reconfigurable Computing

Structural Mapping Example (cont.) BEGIN u1: mux2to1 PORT MAP (w0 => r(0) , w1 => r(1), s => s(0), f => p(0)); p(1) <= r(2); p(1) <= r(3); u2: mux2to1 PORT MAP (w0 => r(4) , w1 => r(5), s => s(1), f => p(3)); u3: priority PORT MAP (w => p, y => q, z => ena); u4: dec2to4 PORT MAP (w => q, En => ena, y => z); END structural; October 19, 2006 CprE 583 – Reconfigurable Computing

CprE 583 – Reconfigurable Computing Behavioral Latch LIBRARY ieee ; USE ieee.std_logic_1164.all ; ENTITY latch IS PORT ( D, Clock : IN STD_LOGIC ; Q : OUT STD_LOGIC) ; END latch ; ARCHITECTURE Behavior OF latch IS BEGIN PROCESS ( D, Clock ) IF Clock = '1' THEN Q <= D ; END IF ; END PROCESS ; END Behavior; D Q Clock Truth table Q(t+1) Clock D Q(t) – 1 1 1 1 October 19, 2006 CprE 583 – Reconfigurable Computing

CprE 583 – Reconfigurable Computing Behavioral Flip Flop LIBRARY ieee ; USE ieee.std_logic_1164.all ; ENTITY flipflop IS PORT ( D, Clock : IN STD_LOGIC ; Q : OUT STD_LOGIC) ; END flipflop ; ARCHITECTURE Behavior_1 OF flipflop IS BEGIN PROCESS ( Clock ) IF Clock'EVENT AND Clock = '1' THEN Q <= D ; END IF ; END PROCESS ; END Behavior_1 ; D Q Clock Truth table Q(t+1) Clk D   1 1 – Q(t) 1 – Q(t) October 19, 2006 CprE 583 – Reconfigurable Computing

N-bit Register with Reset ENTITY regn IS GENERIC ( N : INTEGER := 16 ) ; PORT ( D : IN STD_LOGIC_VECTOR(N-1 DOWNTO 0) ; Resetn, Clock : IN STD_LOGIC ; Q : OUT STD_LOGIC_VECTOR(N-1 DOWNTO 0) ) ; END regn ; ARCHITECTURE Behavior OF regn IS BEGIN PROCESS ( Resetn, Clock ) IF Resetn = '0' THEN Q <= (OTHERS => '0') ; ELSIF Clock'EVENT AND Clock = '1' THEN Q <= D ; END IF ; END PROCESS ; END Behavior ; N Resetn N D Q Clock regn October 19, 2006 CprE 583 – Reconfigurable Computing

4-bit Up-Counter with Reset LIBRARY ieee ; USE ieee.std_logic_1164.all ; USE ieee.std_logic_unsigned.all ; ENTITY upcount IS PORT ( Clock, Resetn, Enable : IN STD_LOGIC ; Q : OUT STD_LOGIC_VECTOR (3 DOWNTO 0)) ; END upcount ; Enable 4 Q Clock upcount Resetn October 19, 2006 CprE 583 – Reconfigurable Computing

4-bit Up-Counter with Reset (cont.) ARCHITECTURE Behavior OF upcount IS SIGNAL Count : STD_LOGIC_VECTOR (3 DOWNTO 0) ; BEGIN PROCESS ( Clock, Resetn ) IF Resetn = '0' THEN Count <= "0000" ; ELSIF (Clock'EVENT AND Clock = '1') THEN IF Enable = '1' THEN Count <= Count + 1 ; END IF ; END PROCESS ; Q <= Count ; END Behavior ; Enable 4 Q Clock upcount Resetn October 19, 2006 CprE 583 – Reconfigurable Computing

Shift Register With Parallel Load Sin D Q D Q D Q D Q Clock Enable Q(3) Q(2) Q(1) Q(0) October 19, 2006 CprE 583 – Reconfigurable Computing

Shift Register With Load (cont.) LIBRARY ieee ; USE ieee.std_logic_1164.all ; ENTITY shift4 IS PORT ( D : IN STD_LOGIC_VECTOR(3 DOWNTO 0) ; Enable : IN STD_LOGIC ; Load : IN STD_LOGIC ; Sin : IN STD_LOGIC ; Clock : IN STD_LOGIC ; Q : BUFFER STD_LOGIC_VECTOR(3 DOWNTO 0) ) ; END shift4 ; Q Enable Clock shift4 4 D Load Sin CprE 583 – Reconfigurable Computing October 19, 2006

CprE 583 – Reconfigurable Computing Shift Register With Load (cont.) ARCHITECTURE Behavior_1 OF shift4 IS BEGIN PROCESS (Clock) IF Clock'EVENT AND Clock = '1' THEN IF Load = '1' THEN Q <= D ; ELSIF Enable = ‘1’ THEN Q(0) <= Q(1) ; Q(1) <= Q(2); Q(2) <= Q(3) ; Q(3) <= Sin; END IF ; END PROCESS ; END Behavior_1 ; Q Enable Clock shift4 4 D Load Sin October 19, 2006 CprE 583 – Reconfigurable Computing