EEL4712 Digital Design.

Slides:



Advertisements
Similar presentations
1 VLSI DESIGN USING VHDL Part II A workshop by Dr. Junaid Ahmed Zubairi.
Advertisements

Ring Counter Discussion D5.3 Example 32. Ring Counter if rising_edge(CLK) then for i in 0 to 2 loop s(i)
Generic Multiplexers: Parameters Discussion D2.5 Example 8.
Sequential-Circuit Building Blocks
4-to-1 Multiplexer: case Statement Discussion D2.3 Example 6.
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.
Simple Testbenches Behavioral Modeling of Combinational Logic
Lecture #6 Page 1 Lecture #6 Agenda 1.VHDL - Architecture 2.VHDL - Packages Announcements 1.HW #3 assigned ECE 4110– Sequential Logic Design.
ECE 545 Lecture 7 Behavioral Modeling of Sequential-Circuit Building Blocks Mixing Design Styles Modeling of Circuits with a Regular Structure.
1 Data Object Object Types A VHDL object consists of one of the following: –Signal, Which represents interconnection wires that connect component instantiation.
ECE 332 Digital Electronics and Logic Design Lab Lab 5 VHDL Design Styles Testbenches.
ECE 448: Spring 12 Lab Midterm Exam Review. Part 1: Detailed discussion of a selected midterm from Spring Part 2: Review & discussion of common.
Data Flow Modeling of Combinational Logic Simple Testbenches
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 Project I: Introduction to Testbench Design Matthew Murach Slides Available at:
7/10/2007DSD,USIT,GGSIPU1 Basic concept of Sequential Design.
VHDL in 1h Martin Schöberl. AK: JVMHWVHDL2 VHDL /= C, Java,… Think in hardware All constructs run concurrent Different from software programming Forget.
Language Concepts Ver 1.1, Copyright 1997 TS, Inc. VHDL L a n g u a g e C o n c e p t s Page 1.
1 ECE 545 – Introduction to VHDL ECE 545 Lecture 4 Behavioral & Structural Design Styles.
George Mason University Modeling of Circuits with a Regular Structure Aliases, Attributes, Packages Mixing Design Styles ECE 545 Lecture 7.
VHDL for Combinational Circuits. VHDL We Know Simple assignment statements –f
Introduction to VHDL Spring EENG 2920 Digital Systems Design Introduction VHDL – VHSIC (Very high speed integrated circuit) Hardware Description.
Mixed Style RTL Modeling
ECE 332 Digital Electronics and Logic Design Lab Lab 6 Concurrent Statements & Adders.
(1) Basic Language Concepts © Sudhakar Yalamanchili, Georgia Institute of Technology, 2006.
George Mason University Simple Testbenches ECE 545 Lecture 4.
George Mason University Behavioral Modeling of Sequential-Circuit Building Blocks ECE 545 Lecture 6 Mixing Design Styles.
4-to-1 Multiplexer: Module Instantiation Discussion D2.2 Example 5.
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)
VHDL Discussion Subprograms IAY 0600 Digital Systems Design Alexander Sudnitson Tallinn University of Technology 1.
ECE 332 Digital Electronics and Logic Design Lab Lab 5 VHDL Design Styles Testbenches Concurrent Statements & Adders.
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.
EGRE 6311 LHO 04 - Subprograms, Packages, and Libraries EGRE 631 1/26/09.
Combinational logic circuit
Basic Language Concepts
Describing Combinational Logic Using Processes
Dataflow Style Combinational Design with VHDL
Part IV: VHDL CODING.
Combinational Circuits Using VHDL
ECE 545 Lecture 9 Modeling of Circuits with a Regular Structure Aliases, Attributes, Packages.
Sequential-Circuit Building Blocks
ECE 448 Lecture 6 Modeling of Circuits with a Regular Structure Aliases, Constants, Packages Mixing Design Styles ECE 448 – FPGA and ASIC Design with.
VHDL (VHSIC Hardware Description Language)
VHDL Discussion Subprograms
VHDL Structural Architecture
ECE 545 Lecture 6 Behavioral Modeling of Sequential-Circuit Building Blocks Mixing Design Styles Modeling of Circuits with a Regular Structure.
Concurrent vs Sequential
Behavioral Modeling of Sequential-Circuit Building Blocks
Sequntial-Circuit Building Blocks
VHDL Discussion Subprograms
ECE 331 – Digital System Design
Data Flow Description of Combinational-Circuit Building Blocks
Modeling of Circuits with a Regular Structure
UNIT 6: Mixed-Type Description
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
ECE 545 Lecture 5 Simple Testbenches.
Modeling of Circuits with Regular Structure
CprE / ComS 583 Reconfigurable Computing
Sequntial-Circuit Building Blocks
4-Input Gates VHDL for Loops
디 지 털 시 스 템 설 계 UP2 Kit를 이용한 카운터 설계
Digital Logic with VHDL
(Sequential-Circuit Building Blocks)
(Simple Testbenches & Arithmetic Operations)
Presentation transcript:

EEL4712 Digital Design

Aliases

Aliases Example: Syntax: ALIAS name : type := expression; signal IR : std_logic_vector(31 downto 0); alias IR_opcode : std_logic_vector(5 downto 0) is IR(31 downto 26); alias IR_reg1_addr : std_logic_vector(4 downto 0) is IR(25 downto 21); alias IR_reg2_addr : std_logic_vector(4 downto 0) is IR(20 downto 16);

Constants

Constants Examples: Syntax: CONSTANT name : type := value; CONSTANT init_value : STD_LOGIC_VECTOR(3 downto 0) := "0100"; CONSTANT ANDA_EXT : STD_LOGIC_VECTOR(7 downto 0) := X"B4"; CONSTANT counter_width : INTEGER := 16; CONSTANT buffer_address : INTEGER := 16#FFFE#; CONSTANT clk_period : TIME := 20 ns; CONSTANT strobe_period : TIME := 333.333 ms;

Constants - Features Constants can be declared in a PACKAGE, ENTITY, ARCHITECTURE When declared in a PACKAGE, the constant is truly global, for the package can be used in several entities. When declared in an ARCHITECTURE, the constant is local, i.e., it is visible only within this architecture. When declared in an ENTITY declaration, the constant can be used in all architectures associated with this entity.

Packages

Explicit Component Declaration versus Package Explicit component declaration is when you declare components in main code When have only a few component declarations, this is fine When have many component declarations, use packages for readability Packages also help with portability and sharing of libraries among many users in a company Remember, the actual instantiations always take place in main code Only the declarations can be in main code or package

METHOD #2: Package component declaration Components declared in package Actual instantiations and port maps always in main code

Packages Instead of declaring all components can declare all components in a PACKAGE, and INCLUDE the package once This makes the top-level entity code cleaner It also allows that complete package to be used by another designer A package can contain Components Functions, Procedures Types, Constants

Package – example (1) LIBRARY ieee ; USE ieee.std_logic_1164.all ; PACKAGE GatesPkg IS 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 ) ;

Package – example (2) COMPONENT dec2to4 PORT (w : IN STD_LOGIC_VECTOR(1 DOWNTO 0) ; En : IN STD_LOGIC ; y : OUT STD_LOGIC_VECTOR(0 TO 3) ) ; END COMPONENT ; COMPONENT regn GENERIC ( N : INTEGER := 8 ) ; PORT ( D : IN STD_LOGIC_VECTOR(N-1 DOWNTO 0) ; Enable, Clock : IN STD_LOGIC ; Q : OUT STD_LOGIC_VECTOR(N-1 DOWNTO 0) ) ;

Package – example (3) constant ADDAB : std_logic_vector(3 downto 0) := "0000"; constant ADDAM : std_logic_vector(3 downto 0) := "0001"; constant SUBAB : std_logic_vector(3 downto 0) := "0010"; constant SUBAM : std_logic_vector(3 downto 0) := "0011"; constant NOTA : std_logic_vector(3 downto 0) := "0100"; constant NOTB : std_logic_vector(3 downto 0) := "0101"; constant NOTM : std_logic_vector(3 downto 0) := "0110"; constant ANDAB : std_logic_vector(3 downto 0) := "0111"; END GatesPkg;

Package usage (1) LIBRARY ieee ; USE ieee.std_logic_1164.all ; USE work.GatesPkg.all; ENTITY priority_resolver1 IS PORT (r : IN STD_LOGIC_VECTOR(5 DOWNTO 0) ; s : IN STD_LOGIC_VECTOR(1 DOWNTO 0) ; clk : IN STD_LOGIC; en : IN STD_LOGIC; t : OUT STD_LOGIC_VECTOR(3 DOWNTO 0) ) ; END priority_resolver1; ARCHITECTURE structural OF priority_resolver1 IS SIGNAL p : STD_LOGIC_VECTOR (3 DOWNTO 0) ; SIGNAL q : STD_LOGIC_VECTOR (1 DOWNTO 0) ; SIGNAL z : STD_LOGIC_VECTOR (3 DOWNTO 0) ; SIGNAL ena : STD_LOGIC ;

Package usage (2) BEGIN u1: mux2to1 PORT MAP ( w0 => r(0) ,w1 => r(1),s => s(0), f => p(0)); 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); u5: regn GENERIC MAP ( N => 4) PORT MAP ( D => z , Enable => En ,Clock => Clk, Q => t ); p(1) <= r(2); p(2) <= r(3); END structural;

Mixing Design Styles Inside of an Architecture

VHDL Design Styles

Mixed Style Modeling architecture ARCHITECTURE_NAME of ENTITY_NAME is Here you can declare signals, constants, types, etc. Component declarations begin Concurrent statements: Concurrent simple signal assignment Conditional signal assignment Selected signal assignment Generate statement Component instantiation statement Process statement inside process you can use only sequential statements end ARCHITECTURE_NAME; Concurrent Statements

PRNG Example (1) library IEEE; use IEEE.STD_LOGIC_1164.all; use work.prng_pkg.all; ENTITY PRNG IS PORT( Coeff : in std_logic_vector(4 downto 0); Load_Coeff : in std_logic; Seed : in std_logic_vector(4 downto 0); Init_Run : in std_logic; Clk : in std_logic; Current_State : out std_logic_vector(4 downto 0)); END PRNG; ARCHITECTURE mixed OF PRNG is signal Ands : std_logic_vector(4 downto 0); signal Sin : std_logic; signal Coeff_Q : std_logic_vector(4 downto 0); signal Shift5_Q : std_logic_vector(4 downto 0);

PRNG Example (2) library IEEE; use IEEE.STD_LOGIC_1164.all; use work.prng_pkg.all; ENTITY PRNG IS PORT( Coeff : in std_logic_vector(4 downto 0); Load_Coeff : in std_logic; Seed : in std_logic_vector(4 downto 0); Init_Run : in std_logic; Clk : in std_logic; Current_State : out std_logic_vector(4 downto 0)); END PRNG; ARCHITECTURE mixed OF PRNG is signal Ands : std_logic_vector(4 downto 0); signal Sin : std_logic; signal Coeff_Q : std_logic_vector(4 downto 0); signal Shift5_Q : std_logic_vector(4 downto 0);

References https://ece.gmu.edu/coursewebpages/ECE/ECE545/F18/viewgraphs/ECE545_lecture_8_regular.pdf

Questions?