L10: Major/Minor FSMs, Lab 3, and RAM/ROM Instantiation

Similar documents
L11: Major/Minor FSMs

Memories: a practical primer

Memory Controller. System Integration Issues. Encoding numbers 1GB RAM FSM. Communicating FSMs Clocking, theory and practice. Combinational Logic

Lab 4: Register File and Memory 50 points Instructor: Yifeng Zhu Due: One week

ECE 437 Computer Architecture and Organization Lab 6: Programming RAM and ROM Due: Thursday, November 3

MASSACHUSETTS INSTITUTE OF TECHNOLOGY Department of Electrical Engineering and Computer Sciences

Designing with ESBs in APEX II Devices

Laboratory Exercise 8

ECE 2300 Digital Logic & Computer Organization. More Sequential Logic Verilog

1 MALP ( ) Unit-1. (1) Draw and explain the internal architecture of 8085.

Introduction the Serial Communications Huang Sections 9.2, 10.2 SCI Block User Guide SPI Block User Guide

CS429: Computer Organization and Architecture

History and Basic Processor Architecture

Graduate Institute of Electronics Engineering, NTU Design of Datapath Controllers

Using Library Modules in Verilog Designs. 1 Introduction. For Quartus II 13.0

Programmable machines

FSM Design Problem (10 points)

On-Chip Memory Implementations

One and a half hours. Section A is COMPULSORY

White Paper Using the MAX II altufm Megafunction I 2 C Interface

2. TriMatrix Embedded Memory Blocks in Stratix II and Stratix II GX Devices

MAX 10. Memory Modules

The Itanium Bit Microprocessor Report

CSE140 L. Instructor: Thomas Y. P. Lee. March 1, Agenda. Computer System Design. Computer Architecture. Instruction Memory design.

Graduate Institute of Electronics Engineering, NTU. Lecturer: Chihhao Chao Date:

Chapter Operation Pinout Operation 35

a, b sum module add32 sum vector bus sum[31:0] sum[0] sum[31]. sum[7:0] sum sum overflow module add32_carry assign

PARALLEL COMMUNICATIONS

Laboratory Exercise 9

Synthesizable Verilog

Using Library Modules in Verilog Designs

Verilog Coding Guideline

In the previous lecture, we examined how to analyse a FSM using state table, state diagram and waveforms. In this lecture we will learn how to design

In the previous lecture, we examined how to analyse a FSM using state table, state diagram and waveforms. In this lecture we will learn how to design

ENGN 1630: CPLD Simulation Fall ENGN 1630 Fall Simulating XC9572XLs on the ENGN1630 CPLD-II Board Using Xilinx ISim

EE178 Lecture Verilog FSM Examples. Eric Crabill SJSU / Xilinx Fall 2007

ECEN 468 Advanced Logic Design

Verilog HDL: Behavioral Counter

BUILDING BLOCKS OF A BASIC MICROPROCESSOR. Part 1 PowerPoint Format of Lecture 3 of Book

Verilog introduction. Embedded and Ambient Systems Lab

MICROPROCESSOR AND MICROCONTROLLER BASED SYSTEMS

Laboratory Exercise 5

These three counters can be programmed for either binary or BCD count.

VHDL And Synthesis Review

Laboratory Exercise 7

EE251: Tuesday December 4

Implementing Double Data Rate I/O Signaling in Stratix & Stratix GX Devices. Introduction. DDR I/O Elements. Input Configuration

Problem Set 10 Solutions

VHDL: RTL Synthesis Basics. 1 of 59

EE 3170 Microcontroller Applications

ECEN : Microprocessor System Design Department of Electrical and Computer Engineering Texas A&M University. Homework #1 Solutions

One and a half hours. Section A is COMPULSORY UNIVERSITY OF MANCHESTER SCHOOL OF COMPUTER SCIENCE

3. Memory Blocks in the Cyclone III Device Family

82C54 CHMOS PROGRAMMABLE INTERVAL TIMER

CSCB58 - Lab 3. Prelab /3 Part I (in-lab) /2 Part II (in-lab) /2 TOTAL /8

Final Exam Solution Sunday, December 15, 10:05-12:05 PM

Microcomputers. Outline. Number Systems and Digital Logic Review

Module 2. Embedded Processors and Memory. Version 2 EE IIT, Kharagpur 1

Infineon C167CR microcontroller, 256 kb external. RAM and 256 kb external (Flash) EEPROM. - Small single-board computer (SBC) with an

In this lecture, we will focus on two very important digital building blocks: counters which can either count events or keep time information, and

Pin Description, Status & Control Signals of 8085 Microprocessor

Computer Organization

UNIVERSITY OF TORONTO FACULTY OF APPLIED SCIENCE AN:p ENGINEERING. ECE241F - Digital Syst~ms Final Examination

Using the DSP Blocks in Stratix & Stratix GX Devices

Tutorial 3. Appendix D. D.1 Design Using Verilog Code. The Ripple-Carry Adder Code. Functional Simulation

problem maximum score 1 10pts 2 8pts 3 10pts 4 12pts 5 7pts 6 7pts 7 7pts 8 17pts 9 22pts total 100pts

CSE 140L Final Exam. Prof. Tajana Simunic Rosing. Spring 2008

Control Unit: The control unit provides the necessary timing and control Microprocessor resembles a CPU exactly.

Chapter 1: Basics of Microprocessor [08 M]

LCD Display. Other I/O. LCD display Flash ROM SPI EPROM Keyboard (PS/2) UART connectors DAC ADC. 2-line, 16 character LCD display

ECEN 651: Microprogrammed Control of Digital Systems Department of Electrical and Computer Engineering Texas A&M University

Scheme G. Sample Test Paper-I

Quick Introduction to SystemVerilog: Sequental Logic

ECE2029: Introduction to Digital Circuit Design Lab 5 Using Sequential Logic Circuits A Digital Stop Watch

University of Toronto Faculty of Applied Science and Engineering Edward S. Rogers Sr. Department of Electrical and Computer Engineering

EPC6055 Digital Integrated Circuits EXAM 1 Fall Semester 2013

! Program logic functions, interconnect using SRAM. ! Advantages: ! Re-programmable; ! dynamically reconfigurable; ! uses standard processes.

EECS Components and Design Techniques for Digital Systems. Lec 20 RTL Design Optimization 11/6/2007

Introduction to Computer Design

CSE140L: Components and Design Techniques for Digital Systems Lab

ECE 4514 Digital Design II. Spring Lecture 15: FSM-based Control

Problem Set 1 Solutions

8254 is a programmable interval timer. Which is widely used in clock driven digital circuits. with out timer there will not be proper synchronization

ECE 2300 Digital Logic & Computer Organization. More Verilog Finite State Machines

Generic Serial Flash Interface Intel FPGA IP Core User Guide

SPI 3-Wire Master (VHDL)

RTL Design (Using ASM/SM Chart)

SECTION 2 SIGNAL DESCRIPTION

Configurable Generic Library

Digital Systems Design

Introduction. ECE/CS 5780/6780: Embedded System Design. Memory-Mapped I/O. Isolated I/O. Expanded Mode. Multiplexed Address and Data Lines

XSB Board SDRAM Controller

Exercise 4-1. DSP Peripherals EXERCISE OBJECTIVES

Computer Organization. Structure of a Computer. Registers. Register Transfer. Register Files. Memories

ECE 2300 Digital Logic & Computer Organization. More Verilog Finite State Machines

EE251: Thursday November 30

EECS 151/251A: SRPING 2017 MIDTERM 1

Today (1) N64 Controller (Project Checkpoint#1) Today (2) Administrative Info (1)

CSE140L: Components and Design

Exp#8: Designing a Programmable Sequence Detector

Transcription:

L10: Major/Minor FSMs, Lab 3, and RAM/ROM Instantiation Acknowledgements: Rex Min 1

Toward FSM Modularity Consider the following abstract FSM: S 0 S 1 S S 3 S 4 S 5 S 6 S 7 S S 9 a 1 d 1 a d a 3 d 3 b 1 c 1 b c b 3 c 3 Suppose that each set of states a x...d x is a sub-fsm that produces exactly the same outputs. Can we simplify the FSM by removing equivalent states? No! The outputs may be the same, but the next-state transitions are not. This situation closely resembles a procedure call or function call in software...how can we apply this concept to FSMs?

The Major/Minor FSM Abstraction A A Minor FSM A RESET CLK Major FSM B B Minor FSM B RESET CLK Subtasks are encapsulated in minor FSMs with common reset and clock Simple communication abstraction: : tells the minor FSM to begin operation (the call) : tells the major FSM whether the minor is done (the return) The major/minor abstraction is great for... Modular designs (always a good thing) Tasks that occur often but in different contexts Tasks that require a variable/unknown period of time Event-driven systems 3

Inside the Major FSM... S 1 S S 3 S 4 1. Wait until the minor FSM is ready. Trigger the minor FSM (and make sure it s started) 3. Wait until the minor FSM is done Major FSM State S 1 S S S 3 S 3 S 3 S 4 CLK 4

Inside the Minor FSM 1. Wait for a trigger from the major FSM T 1 T T 3 T 4 3. Signal to the major FSM that work is done. Do some useful work Major FSM State CLK Minor FSM State S 1 S S S 3 S 3 S 3 S 4 T 1 T 1 T T 3 T 4 T 1 T 1 can we speed this up? 5

Optimizing the Minor FSM Good idea: de-assert one cycle early T 1 T T 3 T 4 Bad idea #1: T 4 may not immediately return to T 1 Bad idea #: never asserts! T 1 T T 3 T 4 T 1 T 6

A Four-FSM FSM Example TICK Major FSM A A B B C C Minor FSM A Minor FSM B Minor FSM C Operating Scenario: Major FSM is triggered by TICK Minors A and B are started simultaneously Minor C is started once both A and B complete TICKs arriving before the completion of C are ignored TICK IDLE Assume that A and B both rise before either minor FSM completes. Otherwise, we loop forever! TICK A + B ST AB A B A B A + B WT AB A B C WT C C ST C C C C 7

Four-FSM FSM Sample Waveform TICK A A Minor FSM A Major FSM B B Minor FSM B C C Minor FSM C state tick IDLE IDLE ST AB ST AB WT AB WT AB WT AB ST C ST C WT C WT C WT C IDLE IDLE ST AB A A B B C C

Lab3 Block Diagram A/D AD 670 RESET status control(ce, CS, R/W) Synchronizer MAJOR FSM MINOR FSM 1 CONTROL UNIT MINOR FSM... Must choose a shared bus for the A/D and DA A/D output in twos complement and ROM in sign/magnitude D/A AD 55 control (CE, CS) CLK Bidirectional I/O Q D/A Reg LD D LD A/D Reg D Q LE_DAC LE_DAC LE_ADC SRAM Bypass RAM Control and Address ALU ROM CONTROL Control and Address SW Impulse Response ROM Use on-chip SRAM and ROM Sample rate is fixed at 0kHz Must use a memory based approach to FIR, not tapped delay line (i.e., registers) Switches SW Arithmetic Unit (MAC) Must use Major/Minor FSM structure 9

Control Flow for Lab3 Wait for a fixed time interval. Reset Initialize Output what was computed on the last sample. Store the previous A/D sample into memory. Start the next A/D conversion. Sample Wait Output Computed Sample to DAC Store A/D Sample Sample Do the FIR filter algorithm which is a convolution. Go back for more... Initiate A/D Convolve 10

Use LPM to Create ROM/RAM Click on File MegaWizard Plug-In Manager This starts up a series of windows so that you can specify parameters of the LPM module. You can choose ROM RAM dp - Dual Ported dq - Separate Inputs and Outputs io - TriState Inputs and Outputs (like the 664) You choose the number of address bits and the word size. You should specify a file to set the values of the ROM. You can choose registered or unregistered inputs, outputs, and addresses. 11

ROM Contents Prepare a.dat file. You can type this in, write a computer program, get it from another application (speech or graphics, etc.) This has numbers separated by white space. The default base is HEX but you can use binary or decimal if you include the following statement (before the numbers). # BASE = BINARY; Insert, # SET_ADDRESS = 0; (specifies that data should start at address 0) Run datntl on Athena to format your.dat file into Intel HEX for details, after setup 6.111 type man datntl datntl <filename>.dat <filename>.ntl romx.dat: # SET_ADDRESS = 0; 7 6 5 4 3 1 0 datntl tool on athena address romx.ntl: :0000000070605040300100DC :00000001FF 1 3 ROM See http://web.mit.edu/6.111/www/s004/software.html for.mif format (memory initialization format) data

romx.v (generated automatically) //============================================= // File Name: romx.v // Megafunction Name(s): // lpm_rom //============================================= module romx ( address, q); input [:0] address; output [7:0] q; Example: deep by bits wide 3 wire [7:0] sub_wire0; wire [7:0] q = sub_wire0[7:0]; endmodule lpm_rom lpm_rom_component ( defparam.address (address),.q (sub_wire0)); lpm_rom_component.lpm_width =, lpm_rom_component.lpm_widthad = 3, lpm_rom_component.lpm_address_control = "UNREGISTERED", lpm_rom_component.lpm_outdata = "UNREGISTERED", lpm_rom_component.lpm_file = romx.ntl"; Path to location of Rom data ROM delay 13

ram4x.v // megafunction wizard: %LPM_RAM_DQ% module ram4x ( address, we, data, q); input [1:0] address; input we; input [1:0] data; output [1:0] q; address data we RAM q wire [1:0] sub_wire0; wire [1:0] q = sub_wire0[1:0]; lpm_ram_dqlpm_ram_dq_component (.address (address),.data (data),.we (we),.q (sub_wire0)); defparam lpm_ram_dq_component.lpm_width =, lpm_ram_dq_component.lpm_widthad =, lpm_ram_dq_component.lpm_indata = "UNREGISTERED", lpm_ram_dq_component.lpm_address_control = "UNREGISTERED", lpm_ram_dq_component.lpm_outdata = "UNREGISTERED", lpm_ram_dq_component.lpm_hint = "USE_EAB=ON"; endmodule 14

Asynchronous RAM Simulation module ram4x ( address, we, data, q); input [1:0] address; input we; input [1:0] data; output [1:0] q; address data we RAM q endmodule Latch interface: Data must be setup and held around the falling edge of the clock. Address must be setup before rising edge and held after falling edge 15

SRAM with Registered Address and Data (Synchronous) Register interface: Address, data and we should be setup and held on the rising edge of clock If we=1 on the rising edge, a write operation takes place If we=0 on the rising edge, a read operation takes place 16