1 - ECpE 583 (Reconfigurable Computing): State Machines (Part 2) Iowa State University (Ames) ECpE 583 Reconfigurable Computing Lect 5: Tues 9/9/2008 (State.

Slides:



Advertisements
Similar presentations
VHDL 5 FINITE STATE MACHINES (FSM) Some pictures are obtained from FPGA Express VHDL Reference Manual, it is accessible from the machines in the lab at.
Advertisements

TOPIC : Finite State Machine(FSM) and Flow Tables UNIT 1 : Modeling Module 1.4 : Modeling Sequential circuits.
ECE 353 Computer Systems Lab II VHDL AND LABORATORY TOOLS TUTORIAL Professors Maciej Ciesielski & T. Baird Soules.
CS 151 Digital Systems Design Lecture 37 Register Transfer Level
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.
Digital System Design by Verilog University of Maryland ENEE408C.
Dr. Turki F. Al-Somani VHDL synthesis and simulation – Part 3 Microcomputer Systems Design (Embedded Systems)
Give qualifications of instructors: DAP
George Mason University ECE 448 – FPGA and ASIC Design with VHDL Finite State Machines State Diagrams, State Tables, Algorithmic State Machine (ASM) Charts,
1 - ECpE 583 (Reconfigurable Computing): Tools overview Iowa State University (Ames) CPRE 583 Reconfigurable Computing (Tools overview) Instructor: Dr.
Sequential Logic in Verilog
1 - ECpE 583 (Reconfigurable Computing): Placing Applications onto FPGAs, Part II Iowa State University (Ames) ECpE 583 Reconfigurable Computing Lecture.
1 - ECpE 583 (Reconfigurable Computing): Course overview Iowa State University (Ames) CPRE 583 Reconfigurable Computing Lecture 1: Wed 8/24/2011 (Course.
L16 – Testbenches for state machines. VHDL Language Elements  More examples HDL coding of class examples Testbench for example  Testing of examples.
Chapter 11: System Design Methodology Digital System Designs and Practices Using Verilog HDL and 2008, John Wiley11-1 Ders 8: FSM Gerçekleme ve.
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.
George Mason University ECE 545 – Introduction to VHDL ECE 545 Lecture 5 Finite State Machines.
CprE / ComS 583 Reconfigurable Computing
Copyright © 1997 Altera Corporation & 提供 What is VHDL Very high speed integrated Hardware Description Language (VHDL) –is.
1 CSE370, Lecture 19 Lecture 19 u Logistics n Lab 8 this week to be done in pairs íFind a partner before your lab period íOtherwise you will have to wait.
1 - CPRE 583 (Reconfigurable Computing): VHDL to FPGA: A Tool Flow Overview Iowa State University (Ames) CPRE 583 Reconfigurable Computing Lecture 5: 9/7/2011.
CSIE.NCTU, DL-6-1 Basic Design Approach of FSM Six Step Process 1. Understand the statement of the Specification 2. Obtain an abstract specification of.
DLD Lecture 26 Finite State Machine Design Procedure.
1 - CPRE 583 (Reconfigurable Computing): Reconfiguration Management Iowa State University (Ames) CPRE 583 Reconfigurable Computing Lecture 11: Wed 9/28/2011.
1 - CPRE 583 (Reconfigurable Computing): Reconfigurable Computing HW, VHDL 2 Iowa State University (Ames) CPRE 583 Reconfigurable Computing (VHDL Overview.
VHDL Discussion Finite State Machines
Finite state machines Modelling FSM in VHDL. Types of automata (FSM) A sequential automaton has: –Inputs –States (a finite number of states) –Outputs.
VHDL Discussion Finite State Machines IAY 0600 Digital Systems Design Alexander Sudnitson Tallinn University of Technology 1.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Logic Design Dr. Oliver Faust.
1 - CPRE 583 (Reconfigurable Computing): System Architectures Iowa State University (Ames) CPRE 583 Reconfigurable Computing Lecture 13: Fri 10/8/2010.
Digital System Design using VHDL
1 - CPRE 583 (Reconfigurable Computing): System Architectures Iowa State University (Ames) CPRE 583 Reconfigurable Computing Lecture 21: Fri 11/4/2011.
1 ASIC 120: Digital Systems and Standard-Cell ASIC Design Tutorial 2: Introduction to VHDL February 1, 2006.
1 - ECpE 583 (Reconfigurable Computing): CoreGen Overview Iowa State University (Ames) CPRE 583 Reconfigurable Computing Lecture 18: Wed 10/26/2011 (CoreGen.
Chapter 11: System Design Methodology Digital System Designs and Practices Using Verilog HDL and 2008, John Wiley11-1 Chapter 11: System Design.
ECE 448 Lecture 6 Finite State Machines State Diagrams vs. Algorithmic State Machine (ASM) Charts.
ECE DIGITAL LOGIC LECTURE 21: FINITE STATE MACHINE Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2015, 11/24/2015.
Lecture #10 Page 1 Lecture #10 Agenda 1.VHDL : Concurrent Signal Assignments 2.Decoders using Structural VHDL Announcements 1.HW #4 due 2.HW #5 assigned.
1 - CPRE 583 (Reconfigurable Computing): Streaming Applications Iowa State University (Ames) CPRE 583 Reconfigurable Computing Lecture 10: Fri 11/13/2009.
1 - ECpE 583 (Reconfigurable Computing): Midterm Overview Iowa State University (Ames) CPRE 583 Reconfigurable Computing Lecture 17: Wed 10/21/2011 (Midterm.
Algorithmic State Machine (ASM) Charts: VHDL Code & Timing Diagrams
1 - CPRE 583 (Reconfigurable Computing): VHDL overview 1 Iowa State University (Ames) CPRE 583 Reconfigurable Computing Lecture 2: 8/26/2011 (VHDL Overview.
State Machine Design with an HDL
George Mason University Finite State Machines Refresher ECE 545 Lecture 11.
ECE 448 Lecture 6 Finite State Machines State Diagrams, State Tables, Algorithmic State Machine (ASM) Charts, and VHDL Code.
Introduction Introduction to VHDL Entities Signals Data & Scalar Types
CHAPTER 17 VHDL FOR SEQUENTIAL LOGIC
Some VHDL Details 10/8/08 ECE Lecture 8.
CPRE 583 Reconfigurable Computing Instructor: Dr. Phillip Jones
Instructor: Dr. Phillip Jones
CPRE 583 Common VHDL mistakes “It works perfect in simulation,
CPRE 583 Reconfigurable Computing
ECE 448 Lecture 6 Finite State Machines State Diagrams vs. Algorithmic State Machine (ASM) Charts.
CPRE 583 Reconfigurable Computing (VHDL Overview )
Algorithmic State Machine (ASM) Charts: VHDL Code & Timing Diagrams
CPRE 583 Reconfigurable Computing
Instructor: Dr. Phillip Jones
CPRE 583 Reconfigurable Computing
CPRE 583 Reconfigurable Computing
CPRE 583 Reconfigurable Computing Instructor: Dr. Phillip Jones
State Machine Design with an HDL
Advanced FPGA Based System Design
CPRE 583 Reconfigurable Computing
Instructor: Dr. Phillip Jones
The Verilog Hardware Description Language
ECE 448 Lecture 6 Finite State Machines State Diagrams, State Tables, Algorithmic State Machine (ASM) Charts, and VHDL Code.
ECE 448 Lecture 6 Finite State Machines State Diagrams, State Tables, Algorithmic State Machine (ASM) Charts, and VHDL code ECE 448 – FPGA and ASIC Design.
Instructor: Alexander Stoytchev
ECE 448 Lecture 6 Finite State Machines State Diagrams vs. Algorithmic State Machine (ASM) Charts.
Presentation transcript:

1 - ECpE 583 (Reconfigurable Computing): State Machines (Part 2) Iowa State University (Ames) ECpE 583 Reconfigurable Computing Lect 5: Tues 9/9/2008 (State Machines: Part 2) Instructor: Dr. Phillip Jones Reconfigurable Computing Laboratory Iowa State University Ames, Iowa, USA (coming soon) (temporary)

2 - ECpE 583 (Reconfigurable Computing): State Machines (Part 2) Iowa State University (Ames) Class videos available (WebCT) Staff still working on installing Xilinx Hardware development tools Updated schedule Suggested readings: –FSM “good practices” paper (Note: in Verilog) – The Fundamentals of Efficient Synthesizable Finite State Machine (2002)The Fundamentals of Efficient Synthesizable Finite State Machine Synthesizable Finite State Machine Design Techniques (2003)Synthesizable Finite State Machine Design Techniques –Models of computation paper Design Patterns for Reconfigurable Computing – Class Announcements

3 - ECpE 583 (Reconfigurable Computing): State Machines (Part 2) Iowa State University (Ames) Revisit some concepts from last lecture Continue State Machine Design Outline

4 - ECpE 583 (Reconfigurable Computing): State Machines (Part 2) Iowa State University (Ames) VHDL: Sequential Statements In a process –Typically when dealing with variables – Signals are updated in parallel (concurrently)

5 - ECpE 583 (Reconfigurable Computing): State Machines (Part 2) Iowa State University (Ames) VHDL: Synthesizable vs. Non-Synthesizable Examples of non-synthesizable constructs –Code that specifies delays wait for 2ns –File operations Tools give error messages??

6 - ECpE 583 (Reconfigurable Computing): State Machines (Part 2) Iowa State University (Ames) Finite State Machines What types of applications are they well suited –Streaming pattern recognition –Sequential event based control logic Allow hardware designer to reason about things in small pieces

7 - ECpE 583 (Reconfigurable Computing): State Machines (Part 2) Iowa State University (Ames) Alert!! Streaming Network application (MP1) Process UDP packet headers (event driven) Detect patterns in payload (e.g. “Corn”) Modify payload based on header information FSM Send Alert !nroClengthdest port

8 - ECpE 583 (Reconfigurable Computing): State Machines (Part 2) Iowa State University (Ames) Moore and Mealy FSMs Moore: Output is only a function of the current state Mealy: Output is a function of the current state and input (“Mealy is more”) –That is more things determine the output –Same computational power as Moore Any Mealy machine has an equivalent Moore –Mealy can make better use of resources

9 - ECpE 583 (Reconfigurable Computing): State Machines (Part 2) Iowa State University (Ames) Moore FSM Moore: Output is only a function of the current state Example detect every occurrence of “1010” Start (0) 0 (0) (0) (0) (1)

10 - ECpE 583 (Reconfigurable Computing): State Machines (Part 2) Iowa State University (Ames) Moore FSM Moore: Output is only a function of the current state Example: vending machine –Events (assume all items cost 1 coin): Insert Coin Make selection Start (0) Coin (0) Insert Coin Snack (1) Make selection Insert Coin Make selection Return (0) Insert Coin Make selection

11 - ECpE 583 (Reconfigurable Computing): State Machines (Part 2) Iowa State University (Ames) Moore FSM Moore: Output is only a function of the current state Example: vending machine –Events (assume all items cost 1 coin): Insert Coin Make selection Return Coin Start (0) Coin (0) Insert Coin Snack (1) Make selection Insert Coin Make selection Return (0) Return Coin

12 - ECpE 583 (Reconfigurable Computing): State Machines (Part 2) Iowa State University (Ames) Moore FSM Moore: Output is only a function of the current state Example: vending machine –Events (assume all items cost 1 coin): Insert Coin Make selection Return Coin Start (0) Coin (0) Insert Coin Snack (1) Make selection Insert Coin Make selection Return (0) Return Coin Make selection Return coin Insert Coin Return Coin

13 - ECpE 583 (Reconfigurable Computing): State Machines (Part 2) Iowa State University (Ames) Moore FSM Moore: Output is only a function of the current state Example: vending machine –Events (assume all items cost 1 coin): Insert Coin Make selection Start (0) Coin (0) Insert Coin Snack (1) Make selection Insert Coin Make selection Return (0) Insert Coin Make selection Make Coin a snack option

14 - ECpE 583 (Reconfigurable Computing): State Machines (Part 2) Iowa State University (Ames) Mealy FSM Moore: Output a function of the current state, and input Example detect every occurrence of “1011” State Name

15 - ECpE 583 (Reconfigurable Computing): State Machines (Part 2) Iowa State University (Ames) Mealy FSM 1/0 0/ Input output Moore: Output a function of the current state, and input Example detect every occurrence of “1011” Start

16 - ECpE 583 (Reconfigurable Computing): State Machines (Part 2) Iowa State University (Ames) Mealy FSM 1/0 0/ Mealy: Output a function of the current state, and input Example detect every occurrence of “1011” 1/0 0/0 1/1 0/0 Start 1/0

17 - ECpE 583 (Reconfigurable Computing): State Machines (Part 2) Iowa State University (Ames) Let: –X be inputs –Z be outputs –State(t) be the state of the FSM at the current time –State(t+1) be the next state of the FSM –δ be the transition between states State(t+1) = δ(State(t), X) Output –Moore: Z(State(t)) –Mealy: Z(State(t), X) FSM: General Circuit Architecture x=1/z=0 0/1 S1S2 1/0 0/0 z=0

18 - ECpE 583 (Reconfigurable Computing): State Machines (Part 2) Iowa State University (Ames) FSM: General Circuit Architecture Combinational Logic Inputs: X Z(State(t)) Z(State(t),X) Outputs Moore Mealy State Storage DFF State(t) State(t+1) = δ(State(t), X) Next State

19 - ECpE 583 (Reconfigurable Computing): State Machines (Part 2) Iowa State University (Ames) VHDL: IF and CASE constructs IF THEN ELSE can be mapped to a 2:1 Multiplexer (Mux) 2:1 Mux sel = b“0” x”C” x”D” in_0 in_1 x”C” IF (sel = ‘0’) THEN out_1 <= in_0; ELSE out_1 <= in_1 END IF; out_1

20 - ECpE 583 (Reconfigurable Computing): State Machines (Part 2) Iowa State University (Ames) VHDL: IF and CASE constructs 4:1 Mux sel = b“10” x”C” x”D” x”2” x”7” in_0 in_1 in_2 in_3 x”7” Mapping a CASE statement to a 4:1 Mux out_1 CASE sel is WHEN “00” => out_1 <= in_0; WHEN “01” => out_1 <= in_1; WHEN “10” => out_1 <= in_2; WHEN “11” => out_1 <= in_3 WHEN OTHERS => out_1 <= in_0; END CASE; Why do we need others here?

21 - ECpE 583 (Reconfigurable Computing): State Machines (Part 2) Iowa State University (Ames) CASE state is WHEN state_1 => IF (sel = ‘0’) THEN mux_out <= ‘1’; ELSE mux_out <= ‘0’; END IF; WHEN state_11 => -- similar code WHEN state_011 => IF (sel = ‘0’) THEN mux_out <= ‘0’; ELSE mux_out <= ‘1’; WHEN state_1011 => --similar code END CASE; VHDL: IF and CASE constructs State = {state_1, state_11, state_011, state_1011} = {“00”, ”01”, ”10”, ”11”} Enumerated Type Mapping a CASE statement to a 1:4 Decoder 1:4 Decoder 2 out_0 out_1 out_2 out_3 state “10” on 2:1 Mux off 2:1 Mux off 2:1 Mux off 2:1 Mux

22 - ECpE 583 (Reconfigurable Computing): State Machines (Part 2) Iowa State University (Ames) CASE state is WHEN state_1 => IF (sel = ‘0’) THEN mux_out <= ‘1’; ELSE mux_out <= ‘0’; END IF; WHEN state_11 => -- similar code WHEN state_011 => IF (sel = ‘0’) THEN mux_out <= ‘0’; ELSE mux_out <= ‘1’; WHEN state_1011 => --similar code END CASE; VHDL: IF and CASE constructs State = {state_1, state_11, state_011, state_1011} = {“00”, ”01”, ”10”, ”11”} Enumerated Type Mapping a CASE statement to a 1:4 Decoder 1:4 Decoder 2 out_0 out_1 out_2 out_3 state “00” on 2:1 Mux off 2:1 Mux off 2:1 Mux off 2:1 Mux

23 - ECpE 583 (Reconfigurable Computing): State Machines (Part 2) Iowa State University (Ames) FSM: General Circuit Architecture Combinational Logic Inputs: X Z(State(t)) Z(State(t),X) Outputs Moore Mealy State Storage DFF State(t) State(t+1) = δ(State(t), X) Next State

24 - ECpE 583 (Reconfigurable Computing): State Machines (Part 2) Iowa State University (Ames) -- Store the “state” Update_State: process(clk) begin if(clk’event and clk=‘1’) then state <= next_state; end if; end process Update_State; VHDL for Mealy (“1011”) Example DFF next_state state

25 - ECpE 583 (Reconfigurable Computing): State Machines (Part 2) Iowa State University (Ames) -- Compute combinational logic Combinational: process(x, state) begin case state is when state_1 => if(x = ‘0’) then z <= ‘0‘; next_state <= state_1; else z <= ‘0‘; next_state <= state_11; end if; when state_11 => if(x = ‘0’) then z <= ‘0’; next_state <= state_1; else z <= ‘0‘; next_state <= state_011 ; end if; VHDL for Mealy (“1011”) Example 1/0 0/ /0 0/0 1/1 0/0 Start 1/0 Compute output Compute next_state

26 - ECpE 583 (Reconfigurable Computing): State Machines (Part 2) Iowa State University (Ames) when state_011 => if(x = ‘0’) then z <= ‘0‘; next_state <= state_1011; else z <= ‘0‘; next_state <= state_011; end if; when state_1011 => if(x = ‘0’) then z <= ‘0’; next_state <= state_1; else z <= ‘1‘; next_state <= state_11; end if; end case; end process Combinational; VHDL for Mealy (“1011”) Example 1/ /0 0/0 1/1 0/0 1/0

27 - ECpE 583 (Reconfigurable Computing): State Machines (Part 2) Iowa State University (Ames) Show using Xilinx ISE tools (Note: first open project from scratch) Simulation of Mealy (“1011”) Example

28 - ECpE 583 (Reconfigurable Computing): State Machines (Part 2) Iowa State University (Ames) Next Lecture UDP Network Processing example Modular and Hierarchical Design Mapping Logic to FPGAs Remote MP0 Demo

29 - ECpE 583 (Reconfigurable Computing): State Machines (Part 2) Iowa State University (Ames) Questions/Comments/Concerns Write down –Main point of lecture –One thing that’s still not quite clear –If everything is clear, then give an example of how to apply something from lecture OR