EEL4712 Digital Design (Midterm 1 Review).

Slides:



Advertisements
Similar presentations
VHDL Lecture 1 Megan Peck EECS 443 Spring 08.
Advertisements

VHDL Structural Architecture ENG241 Week #5 1. Fall 2012ENG241/Digital Design2 VHDL Design Styles Components and interconnects structural VHDL Design.
Arbitrary Waveform Discussion 5.5 Example 34.
1 VLSI DESIGN USING VHDL Part II A workshop by Dr. Junaid Ahmed Zubairi.
Ring Counter Discussion D5.3 Example 32. Ring Counter if rising_edge(CLK) then for i in 0 to 2 loop s(i)
Sequential-Circuit Building Blocks
Logic Design Fundamentals - 3 Discussion D3.2. Logic Design Fundamentals - 3 Basic Gates Basic Combinational Circuits Basic Sequential Circuits.
FPGAs and VHDL Lecture L12.1. FPGAs and VHDL Field Programmable Gate Arrays (FPGAs) VHDL –2 x 1 MUX –4 x 1 MUX –An Adder –Binary-to-BCD Converter –A Register.
VHDL And Synthesis Review. VHDL In Detail Things that we will look at: –Port and Types –Arithmetic Operators –Design styles for Synthesis.
ECE 545 Lecture 7 Behavioral Modeling of Sequential-Circuit Building Blocks Mixing Design Styles Modeling of Circuits with a Regular Structure.
ECE 332 Digital Electronics and Logic Design Lab Lab 5 VHDL Design Styles Testbenches.
1 H ardware D escription L anguages Modeling Complex Systems.
VHDL Introduction. V- VHSIC Very High Speed Integrated Circuit H- Hardware D- Description L- Language.
VHDL in 1h Martin Schöberl. AK: JVMHWVHDL2 VHDL /= C, Java,… Think in hardware All constructs run concurrent Different from software programming Forget.
Copyright © 1997 Altera Corporation & 提供 What is VHDL Very high speed integrated Hardware Description Language (VHDL) –is.
Copyright(c) 1996 W. B. Ligon III1 Getting Started with VHDL VHDL code is composed of a number of entities Entities describe the interface of the component.
CPE 626 Advanced VLSI Design Lecture 6: VHDL Synthesis Aleksandar Milenkovic
Copyright © 1997 Altera Corporation 11/20/2015 P.1 Beginner VHDL Training Class Danny Mok Altera HK FAE
Copyright © 1997 Altera Corporation & 提供 Beginner VHDL Training Class Danny Mok Altera HK FAE
(1) Basic Language Concepts © Sudhakar Yalamanchili, Georgia Institute of Technology, 2006.
Introduction to VHDL Simulation … Synthesis …. The digital design process… Initial specification Block diagram Final product Circuit equations Logic design.
George Mason University Behavioral Modeling of Sequential-Circuit Building Blocks ECE 545 Lecture 6 Mixing Design Styles.
VHDL – Behavioral Modeling and Registered Elements ENGIN 341 – Advanced Digital Design University of Massachusetts Boston Department of Engineering Dr.
VHDL Discussion Sequential Sytems. Memory Elements. Registers. Counters IAY 0600 Digital Systems Design Alexander Sudnitson Tallinn University of Technology.
1 Part III: VHDL CODING. 2 Design StructureData TypesOperators and AttributesConcurrent DesignSequential DesignSignals and VariablesState Machines A VHDL.
04/26/20031 ECE 551: Digital System Design & Synthesis Lecture Set : Introduction to VHDL 12.2: VHDL versus Verilog (Separate File)
CEC 220 Digital Circuit Design VHDL in Sequential Logic Wednesday, March 25 CEC 220 Digital Circuit Design Slide 1 of 13.
Controllers ENGIN 341 – Advanced Digital Design University of Massachusetts Boston Department of Engineering Dr. Filip Cuckov.
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.
ECE DIGITAL LOGIC LECTURE 20: REGISTERS AND COUNTERS Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2015, 11/19/2015.
George Mason University Behavioral Modeling of Sequential-Circuit Building Blocks ECE 545 Lecture 8.
Registers and Counters Discussion D8.1. Logic Design Fundamentals - 3 Registers Counters Shift Registers.
Sequential statements (1) process
Combinational logic circuit
LAB #6 Sequential Logic Design (Flip Flops, Shift Registers)
Finite State Machines (part 1)
Basic Language Concepts
Systems Architecture Lab: Introduction to VHDL
EMT 351/4 DIGITAL IC DESIGN Week # Synthesis of Sequential Logic 10.
B e h a v i o r a l to R T L Coding
Introduction Introduction to VHDL Entities Signals Data & Scalar Types
CHAPTER 17 VHDL FOR SEQUENTIAL LOGIC
Part IV: VHDL CODING.
Custom Designed Integrated Circuits
Sequential-Circuit Building Blocks
CHAPTER 17 VHDL FOR SEQUENTIAL LOGIC
RTL Style در RTL مدار ترتيبي به دو بخش (تركيبي و عناصر حافظه) تقسيم مي شود. مي توان براي هر بخش يك پروسس نوشت يا براي هر دو فقط يك پروسس نوشت. مرتضي صاحب.
Non-synthesizable VHDL Poor Design Practices
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.
Behavioral Modeling of Sequential-Circuit Building Blocks
Sequntial-Circuit Building Blocks
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.
Modeling of Circuits with Regular Structure
ECE 448 Lecture 6 Finite State Machines State Diagrams vs. Algorithmic State Machine (ASM) Charts.
CprE / ComS 583 Reconfigurable Computing
Sequntial-Circuit Building Blocks
4-Input Gates VHDL for Loops
System Controller Approach
(Sequential-Circuit Building Blocks)
(Simple Testbenches & Arithmetic Operations)
Presentation transcript:

EEL4712 Digital Design (Midterm 1 Review)

VHDL Modeling Styles A dataflow architecture uses only concurrent signal assignments A behavioral architecture uses only process statements A structural architecture uses only component instantiation statements

Sequential Logic Synthesis for Beginners

For Beginners Use processes with very simple structure only to describe - registers - shift registers - counters - state machines. Use examples discussed in class as a template. Create generic entities for registers, shift registers, and counters, and instantiate the corresponding components in a higher level circuit using GENERIC MAP PORT MAP. Supplement sequential components with combinational logic described using concurrent statements.

Sequential Logic Synthesis for Intermediates

For Intermmediates Use Processes with IF and CASE statements only. Do not use LOOPS or VARIABLES. Sensitivity list of the PROCESS should include only signals that can by themsleves change the outputs of the sequential circuit (typically, clock and asynchronous set or reset) Do not use PROCESSes without sensitivity list (they can be synthesizable, but make simulation inefficient)

For Intermmediates (2) Given a single signal, the assignments to this signal should only be made within a single process block in order to avoid possible conflicts in assigning values to this signal. Process 1: PROCESS (a, b) BEGIN y <= a AND b; END PROCESS; Process 2: PROCESS (a, b) y <= a OR b;

Dual-edge triggered register/counter (2) PROCESS (clk) BEGIN IF (clk’EVENT AND clk=‘1’ ) THEN counter <= counter + 1; ELSIF (clk’EVENT AND clk=‘0’ ) THEN END IF; END PROCESS;

Dual-edge triggered register/counter (3) PROCESS (clk) BEGIN IF (clk’EVENT) THEN counter <= counter + 1; END IF; END PROCESS;

Example 1 Identify any error when the following code is synthesized entity test is generic (width : positive := 8); port( clk : in std_logic; rst : in std_logic; in1, in2 : in std_logic_vector(width-1 downto 0); out1, out2 : out std_logic_vector(width-1 downto 0)); end test; architecture BHV of test is begin process(clk, rst) if (rst = '1') then out1 <= (others => '0'); out2 <= (others => '0'); elsif (rising_edge(clk)) then out1 <= in1; end if; end process; out2 <= std_logic_vector(unsigned(in1)+unsigned(in2)); end BHV;

Example 2 entity mult is generic( width : positive := 16); port ( input1, input2 : in std_logic_vector(width-1 downto 0); output : out std_logic_vector(width-1 downto 0); overflow : out std_logic); end mult; architecture BHV4 of mult is begin process(input1, input2) variable temp : unsigned(2*width-1 downto 0); temp := unsigned(input1) * unsigned(input2); output <= std_logic_vector(temp(width-1 downto 0)); if (temp(2*width-1 downto width) /= 0) then overflow <= '1'; end if; end process; end BHV4;

Example 3 The following code is correct and will synthesize to combinational logic, but what suggestion does it not follow? architecture BHV3 of mult is signal temp : unsigned(2*width-1 downto 0) := (others => '0'); begin temp <= unsigned(input1) * unsigned(input2); output <= std_logic_vector(temp(width-1 downto 0)); process(temp) if (temp(2*width-1 downto width) = 0) then overflow <= '0'; else overflow <= '1'; end if; end process; end BHV3; Signals and variables should not be initialized in synthesizable code.

Example 4 Identify any violations of the synthesis coding guidelines for sequential logic process(clk, rst) begin if (rst = '1') then output <= (others => '0'); elsif (rising_edge(clk)) then output <= input; end if; if (en = '1') then output2 <= input; end process; It has been defined outside of If rst Elsif rising_edge(clk) End if

Signals vs Variables If you assign several values to a signal in one process, only the final value is used entity xor_sig is port (A, B, C: in STD_LOGIC; X, Y: out STD_LOGIC); end xor_sig; architecture SIG_ARCH of xor_sig is signal D: STD_LOGIC; begin SIG:process (A,B,C) D <= A; -- ignored !! X <= C xor D; D <= B; -- overrides !! Y <= C xor D; end process; end SIG_ARCH;

Signals vs Variables When you assign a value to a variable, the assignment takes place immediately. A variable maintains its value until you specify a new value. entity xor_var is port (A, B, C: in STD_LOGIC; X, Y: out STD_LOGIC); end xor_var; architecture VAR_ARCH of xor_var is begin VAR:process (A,B,C) variable D: STD_LOGIC; D := A; X <= C xor D; D := B; Y <= C xor D; end process; end VAR_ARCH;

Test bench Given the following entity, specify the widths of each instantiation entity test is generic ( width : positive := 32); port ( in1 : in std_logic_vector(width-1 downto 0); in2 : in std_logic_vector(width-1 downto 0); output : out std_logic_vector(width-1 downto 0)); end test; ----- U_A : entity work.test generic map (width => 16) port map (in1 => in1, in2 => in2, output => output); ---- U_B : entity work.test --- When entity test is used as the top-level entity. 16 32 32

Delays The delay mechanism shows propagation times of described systems. Based on switching time of transistors The information regarding propagation delays are provided in sdo files Delays are specified in signal assignment statements. It is not allowed to specify delays in variable assignments Timing simulations are different than functional simulations

Carry Look Ahead Adders Carry equation: 𝑐 𝑖+1 = 𝒙 𝒊 𝒚 𝒊 + 𝒙 𝒊 + 𝒚 𝒊 𝑐 𝑖 Simplified: 𝑐 𝑖+1 = 𝑔 𝑖 + 𝑝 𝑖 𝑐 𝑖 𝑔 𝑖 = 𝑥 𝑖 𝑦 𝑖 𝑝 𝑖 = 𝑥 𝑖 + 𝑦 𝑖 For example 𝑐 3 = 𝑔 2 + 𝑝 2 𝑐 2 𝑐 3 = 𝑔 2 + 𝑝 2 𝒈 𝟏 + 𝒑 𝟏 𝒈 𝟎 + 𝒑 𝟏 𝒑 𝟎 𝒄 𝟎 𝑐 3 = 𝑔 2 + 𝑝 2 𝑔 1 + 𝑝 2 𝑝 1 𝑔 0 + 𝑝 2 𝑝 1 𝑝 0 𝑐 0

For Generate entity test is architecture STR of test is generic(width : positive := 8); port ( clk, rst, shift, input : in std_logic; output : out std_logic); end test; architecture STR of test is component ff port ( clk, rst, D : in std_logic; Q : out std_logic); end component; component mux2x1 in1, in2, sel : in std_logic; output : out std_logic); -- signal definations begin U_FF0 : --code should be inserted --code should be inserted U_FFS : U_MUX : -- output should be assigned end STR;

Solution begin architecture STR of test is U_FF0 : ff port map ( clk => clk, rst => rst, d => input, q => q(0) ); U_FFS : for i in 1 to width-1 generate U_FF : ff port map ( d => mux_out(i), q => q(i) U_MUX : mux2x1 port map ( in1 => input, in2 => q(i-1), sel => shift, output => mux_out(i) end generate U_FFS; output <= q(width-1); end STR; architecture STR of test is component ff port ( clk, rst, D : in std_logic; Q : out std_logic); end component; component mux2x1 in1, in2, sel : in std_logic; output : out std_logic); signal q : std_logic_vector(width-1 downto 0); signal mux_out : std_logic_vector(width-1 downto 1);

Example Implement the illustrated circuit in VHDL library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; entity example is generic ( width : positive := 16); port ( clk,rst : in std_logic; in1, in2, in3, in4 : in std_logic_vector(width-1 downto 0); out1, out2 : out std_logic_vector(width-1 downto 0)); end example;

Solution architecture BHV of example is signal reg_in1, reg_in2, reg_in3, reg_in4 : unsigned(width-1 downto 0); signal sum_no_reg : unsigned(width-1 downto 0); begin process(clk, rst) if (rst = '1') then reg_in1 <= (others => '0'); reg_in2 <= (others => '0'); reg_in3 <= (others => '0'); reg_in4 <= (others => '0'); out1 <= (others => '0'); out2 <= (others => '0'); elsif (clk'event and clk = '1') then reg_in1 <= unsigned(in1); reg_in2 <= unsigned(in2); reg_in3 <= unsigned(in3); reg_in4 <= unsigned(in4); out1 <= std_logic_vector(reg_in1 + reg_in2); out2 <= std_logic_vector(sum_no_reg + reg_in4); end if; end process; sum_no_reg <= reg_in2 + reg_in3; end BHV;

References https://buzztech.in/vhdl-modelling-styles-behavioral-dataflow-structural/

Questions?