VHDL Lecture 1 Megan Peck EECS 443 Spring 08.

Slides:



Advertisements
Similar presentations
Tutorial 2 Sequential Logic. Registers A register is basically a D Flip-Flop A D Flip Flop has 3 basic ports. D, Q, and Clock.
Advertisements

1/8/ VerilogCopyright Joanne DeGroat, ECE, OSU1 Verilog Overview An overview of the Verilog HDL.
VHDL in digital circuit synthesis (tutorial) dr inż. Miron Kłosowski EA 309
Sequential Design ELEC 311 Digital Logic and Circuits Dr. Ron Hayne
Lecture #24 Page 1 EE 367 – Logic Design Lecture #24 Agenda 1.State Machines Review Announcements 1.n/a.
CMSC 611: Advanced Computer Architecture
COE 405 VHDL Basics Dr. Aiman H. El-Maleh Computer Engineering Department King Fahd University of Petroleum & Minerals Dr. Aiman H. El-Maleh Computer Engineering.
VHDL Programming in CprE 381 Zhao Zhang CprE 381, Fall 2013 Iowa State University Last update: 9/15/2013.
Introduction To VHDL for Combinational Logic
Synchronous Sequential Logic
ECE C03 Lecture 131 Lecture 13 VHDL Structural Modeling Hai Zhou ECE 303 Advanced Digital Design Spring 2002.
Fundamental Concepts 大同大學 資訊工程系 副教授
Lecture #28 Page 1 ECE 4110– Sequential Logic Design Lecture #28 Agenda 1.Counters Announcements 1.HW #13 assigned 2.Next: Test #2 Review.
© 1998, Peter J. AshendenVHDL Quick Start1 Basic VHDL Concepts Interfaces Behavior Structure Test Benches Analysis, elaboration, simulation Synthesis.
Multiplexers Section 3-7 Mano & Kime. Multiplexers & Demultiplexers Multiplexers (Selectors) Lab 1 – Behavioral VHDL -- Multiplexers MUX as a Universal.
Digital Logic with VHDL EE 230 Digital Systems Fall 2006 (10/17/2006)
LECTURE 4: The VHDL N-bit Adder
1 EE24C Digital Electronics Project Theory: Sequential Logic (part 2)
VHDL Structural Architecture ENG241 Week #5 1. Fall 2012ENG241/Digital Design2 VHDL Design Styles Components and interconnects structural VHDL Design.
1 VLSI DESIGN USING VHDL Part II A workshop by Dr. Junaid Ahmed Zubairi.
Registers VHDL Tutorial R. E. Haskell and D. M. Hanna T2: Sequential Logic Circuits.
6/27/20061 Sequence Detectors Lecture Notes – Lab 5 Sequence detection is the act of recognizing a predefined series of inputs A sequence detector is a.
6/12/20151 Sequence Detectors Lecture Notes – Lab 4 Sequence detection is the act of recognizing a predefined series of inputs A sequence detector is a.
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.
ECE C03 Lecture 141 Lecture 14 VHDL Modeling of Sequential Machines Hai Zhou ECE 303 Advanced Digital Design Spring 2002.
Introduction to VHDL (part 2)
Advanced FPGA Based System Design Lecture-9 & 10 VHDL Sequential Code By: Dr Imtiaz Hussain 1.
Sequential Logic in Verilog
L16 – Testbenches for state machines. VHDL Language Elements  More examples HDL coding of class examples Testbench for example  Testing of examples.
VHDL Project I: Introduction to Testbench Design Matthew Murach Slides Available at:
VHDL Introduction. V- VHSIC Very High Speed Integrated Circuit H- Hardware D- Description L- Language.
1/8/ L20 Project Step 8 - Data Path Copyright Joanne DeGroat, ECE, OSU1 State Machine Design with an HDL A methodology that works for documenting.
L16 – VHDL for State Machines with binary encoding.
Modern VLSI Design 4e: Chapter 8 Copyright  2008 Wayne Wolf Topics VHDL register-transfer modeling: –basics using traffic light controller; –synthesis.
Electrical and Computer Engineering University of Cyprus LAB 1: VHDL.
Introduction to VLSI Design – Lec01. Chapter 1 Introduction to VLSI Design Lecture # 11 High Desecration Language- Based Design.
11/17/2007DSD,USIT,GGSIPU1 RTL Systems References: 1.Introduction to Digital System by Milos Ercegovac,Tomas Lang, Jaime H. Moreno; wiley publisher 2.Digital.
Introduction to VHDL Simulation … Synthesis …. The digital design process… Initial specification Block diagram Final product Circuit equations Logic design.
Hardware Description Languages Digital Logic Design Instructor: Kasım Sinan YILDIRIM.
Hardware languages "Programming"-language for modelling of (digital) hardware 1 Two main languages: VHDL (Very High Speed Integrated Circuit Hardware Description.
Assignment write a short notes on 1.Manufacturing Testing. 2.Functional Testing. 3.Files and Text I/O. 4.Differentiate the cpld and fpga architecture.
VHDL – Behavioral Modeling and Registered Elements ENGIN 341 – Advanced Digital Design University of Massachusetts Boston Department of Engineering Dr.
 Seattle Pacific University EE Logic System DesignCounters-1 Shift Registers DQ clk DQ DQ ShiftIn Q3Q3 Q2Q2 DQ Q1Q1 Q0Q0 A shift register shifts.
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.
Introduction to VHDL Coding Wenchao Cao, Teaching Assistant Department of EECS University of Tennessee.
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.
Sequential statements (1) process
LAB #6 Sequential Logic Design (Flip Flops, Shift Registers)
B e h a v i o r a l to R T L Coding
Part II A workshop by Dr. Junaid Ahmed Zubairi
Introduction Introduction to VHDL Entities Signals Data & Scalar Types
CHAPTER 17 VHDL FOR SEQUENTIAL LOGIC
Using CAD Tools to implement Digital Circuits
Sequential-Circuit Building Blocks
VHDL Hierarchy in XILINX
VHDL VHSIC Hardware Description Language VHSIC
RTL Style در RTL مدار ترتيبي به دو بخش (تركيبي و عناصر حافظه) تقسيم مي شود. مي توان براي هر بخش يك پروسس نوشت يا براي هر دو فقط يك پروسس نوشت. مرتضي صاحب.
VHDL Discussion Subprograms
VHDL Structural Architecture
Behavioral Modeling of Sequential-Circuit Building Blocks
Sequntial-Circuit Building Blocks
VHDL Discussion Subprograms
ECE 331 – Digital System Design
Sequntial-Circuit Building Blocks
4-Input Gates VHDL for Loops
System Controller Approach
(Sequential-Circuit Building Blocks)
Presentation transcript:

VHDL Lecture 1 Megan Peck EECS 443 Spring 08

Modeling Digital Systems We use VHDL to implement system models For this class you will use simulation to test the correctness of models The design process will be: Develop a design to meet the problem specification Implement the design using VHDL Implement a simulation testbench to test the correctness of your design and implementation

Entity Declaration Say we want to design a 4-bit register, with enable and clock. We could do this 2 different ways: 1 2 4 4 d0 q0 d q d1 q1 d2 q2 d3 q3 en en clk clk

Design 1: entity reg4 is Design 2: port(d0,d1,d2,d3,en,clk: in std_logic; q0,q1,q2,q3 : out std_logic); end entity reg4; Design 2: port(d : in std_logic_vector(3 downto 0); en, clk : in std_logic; q : out std_logic_vector(3 downto 0));

Architectures The architecture contains the implementation for the entity There can be multiple architectures per entity Behavioral Architecture--Description of the algorithm They are made up of processes, which contain sequential statements Sequential statements include signal assignments and wait statements

Behavioral Architecture for Design 1 architecture beh of reg4 is begin update: process (d0,d1,d2,d3,en,clk) is -- if register is enabled, and rising-edge clock, update outputs if en=‘1’ and clk=‘1’ and clk’event then q0<=d0; q1<=d1; q2<=d2; q3<=d3; end if; end process update; end architecture beh;

Notes on Behavioral Architectures Signals – wires; concurrent assignment q0<=d0; -- these happen at the same time q1<=d1; -- Variables – State; sequential assignment var1:=d0; -- these happen sequential var2:=var1 or ‘1’; -- there is state (memory) associated with -- the variables Internal signals declared at top of architecture Internal variables declared at top of process

Structural Architectures Think of this as building an architecture using existing building-blocks, and connecting the signals. We could make our 4-bit register out of 4 flip-flops: Can you think of ways using gates to implement enable? What if we wanted to add a reset? do d q clk qo d1 d q clk q1 d2 q2 d q clk d3 q3 d q clk clk

Structural Architecture implementation Say we have already implemented the entity d_latch with architecture beh (with input bits d,clk; output bit q), We also have the entitiy and2 (an and gate), with architecture beh. We will and the clock with enable to send to the clk input of each gate (note: it is not an ideal design to send your clock through logic gates).

architecture struct of reg4 is signal internal_clk : std_logic; -- Note: no direction(in/out) for internal signals begin bit0: entity work.d_latch(beh) port map(d0,int_clk,q0); bit1: entity work.d_latch(beh)) port map(d1,int_clk,q1) clock: entity work.and2 port map(clk,en,int_clk); end struct;

Notes on Structural Architectures There should be NO processes The port maps tell you what signals in your structural architecture gets mapped to the signals in the entities. You may be mapping port signals or internal signals. Make sure you order them correctly. Let’s look at the latch entity compared to the first instantiations of a latch in the architecture: d_latch entity declaration: entity d_latch is port (d,clk : in std_logic; q : out std_logic); end entity d_latch; d_latch instantiation bit0: entity work.d_latch(beh) port map(d0,int_clk,q0); So, here we are saying d0 goes to the input d, int_clk goes to the input clk, and q0 goes to the ouput q.

Mixed Behavioral and Structural A mixed architecture will have instantiated components and behavioral processes.

Test Benches Test benches help determine the correctness of a design. The steps of a testbench are: Instantiate the component(s) to be tested Drive the components’ signals Wait Look at the waveforms generated by the testbench to determine if the design is correct (note: some problems might be with the testbench, and not the original design)

Example Testbench entity tb is -- Note: there are no signal ports end entity tb; architecture test_reg4 of tb is -- all port signals from component under test are now internal signals signal d0,d1,d2,d3,en,clk,q0,q1,q2,q3: std_logic; begin -- instantiate component(s) under test -- (dut stands for device under test - name doesn’t matter) dut: entity work.reg4(beh) -- this means pick the beh architecture to test port map(d0,d1,d2,d3,en,clk,q0,q1,q2,q3); drive: process is d0<='1'; d1<='1'; d2<='1'; d3<='1'; wait for 20 ns; -- nothing changes, because en!=‘1’ en <= '1'; d0<='0'; d1<='1'; d2<='0'; d3<='1'; wait for 20 ns; -- output should change now d0<='1'; d1<='0'; d2<='1'; d3<='0'; wait for 20 ns; wait; -- This wait is very important. This is what will stop your simulation. -- It should be at the end of every testbench process end process drive; clock: process is for i in 0 to 10 loop clk <= '0'; wait for 5 ns; clk <= '1'; wait for 5 ns; end loop; wait; end process clock; end test_reg4;

Simulation of the Testbench