FPGA Lecture for LUPO and GTO Vol , 31 August (revised 2013, 19 November) H. Baba

Similar documents
LUPO TimeStamp Module (Ver. 1.2) Hidetada Baba

LUPO IO & Scaler Firmware Rev Oct. 11

Summary of FPGA & VHDL

PINE TRAINING ACADEMY

Today. Comments about assignment Max 1/T (skew = 0) Max clock skew? Comments about assignment 3 ASICs and Programmable logic Others courses

Field Programmable Gate Array (FPGA)

Lab 1: Introduction to Verilog HDL and the Xilinx ISE

HDL Coding Style Xilinx, Inc. All Rights Reserved

Topics. Midterm Finish Chapter 7

Lecture 7. Standard ICs FPGA (Field Programmable Gate Array) VHDL (Very-high-speed integrated circuits. Hardware Description Language)

TRAFFIC LIGHT CONTROLLER USING VHDL

Logic Implementation on a Xilinx FPGA using VHDL WWU Linux platform assumed. rev 11/01/17

FPGAs in a Nutshell - Introduction to Embedded Systems-

Programmable Logic. Simple Programmable Logic Devices

Field Programmable Gate Array

VHDL Testbench. Test Bench Syntax. VHDL Testbench Tutorial 1. Contents

The Virtex FPGA and Introduction to design techniques

Logic Implementation on a Xilinx FPGA using VHDL WWU Linux platform assumed. rev 10/25/16

ECE 545 Lecture 12. FPGA Resources. George Mason University

In our case Dr. Johnson is setting the best practices

Design Problem 3 Solutions

CPE/EE 422/522. Introduction to Xilinx Virtex Field-Programmable Gate Arrays Devices. Dr. Rhonda Kay Gaede UAH. Outline

Lecture 11 Memories in Xilinx FPGAs

Lattice VHDL Training

Control and Datapath 8

Digital System Construction

Introduction to WebPACK 4.1 for FPGAs. Using Xilinx WebPACK Software to Create FPGA Designs for the XSA Board

DIGITAL LOGIC DESIGN VHDL Coding for FPGAs Unit 3

VHDL for Modeling - Module 10

VHDL for Synthesis. Course Description. Course Duration. Goals

DIGITAL LOGIC WITH VHDL (Fall 2013) Unit 1

Concurrent & Sequential Stmts. (Review)

Introduction to VHDL #3

CS/EE Homework 7 Solutions

Introduction to WebPACK 5.2 for FPGAs. Using Xilinx WebPACK Software to Create FPGA Designs for the XSB-300E Board

Two HDLs used today VHDL. Why VHDL? Introduction to Structured VLSI Design

Lecture 12 VHDL Synthesis

Introduction to WebPACK 6.1. Using Xilinx WebPACK Software to Create FPGA Designs for the XSA Board

DIGITAL LOGIC WITH VHDL (Fall 2013) Unit 3

ECE 448 Lecture 13. FPGA Memories. George Mason University

CPE 626 Advanced VLSI Design Lecture 6: VHDL Synthesis. Register File: An Example. Register File: An Example (cont d) Aleksandar Milenkovic

PALMiCE FPGA Probing Function User's Manual

VHDL. VHDL History. Why VHDL? Introduction to Structured VLSI Design. Very High Speed Integrated Circuit (VHSIC) Hardware Description Language

VHDL for Complex Designs

TLL5000 Electronic System Design Base Module. Getting Started Guide, Ver 3.4

EEL 4783: Hardware/Software Co-design with FPGAs

Lab 3 Sequential Logic for Synthesis. FPGA Design Flow.

Lab 3. Advanced VHDL

Asynchronous FIFO Design

Latch Based Design (1A) Young Won Lim 2/18/15

ECOM 4311 Digital Systems Design

XSA Parallel Port Interface

EE178 Lecture Module 2. Eric Crabill SJSU / Xilinx Fall 2007

and 32 bit for 32 bit. If you don t pay attention to this, there will be unexpected behavior in the ISE software and thing may not work properly!

VHDL: Modeling RAM and Register Files. Textbook Chapters: 6.6.1, 8.7, 8.8, 9.5.2, 11.2

Inferring Storage Elements

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

EITF35: Introduction to Structured VLSI Design

Introduction to WebPACK 6.3. Using Xilinx WebPACK Software to Create FPGA Designs for the XSA Board

CPE 626 Advanced VLSI Design Lecture 7: VHDL Synthesis

TLL5000 Electronic System Design Base Module

Laboratory Memory Components

[VARIABLE declaration] BEGIN. sequential statements

Topics. Midterm Finish Chapter 7

CCE 3202 Advanced Digital System Design

Assignment. Last time. Last time. ECE 4514 Digital Design II. Back to the big picture. Back to the big picture

ECE 545 Lecture 6. Behavioral Modeling of Sequential-Circuit Building Blocks. George Mason University

The block diagram representation is given below: The output equation of a 2x1 multiplexer is given below:

EECS150 - Digital Design Lecture 6 - Field Programmable Gate Arrays (FPGAs)

INTRODUCTION TO FPGA ARCHITECTURE

Midterm Exam Thursday, October 24, :00--2:15PM (75 minutes)

CprE 583 Reconfigurable Computing

Timing in synchronous systems

Outline. EECS150 - Digital Design Lecture 6 - Field Programmable Gate Arrays (FPGAs) FPGA Overview. Why FPGAs?

Sign here to give permission for your test to be returned in class, where others might see your score:

Programmable Logic Devices UNIT II DIGITAL SYSTEM DESIGN

Advanced Synthesis Techniques

Problem Set 10 Solutions

Xilinx ISE Synthesis Tutorial

XSV Flash Programming and Virtex Configuration

Lecture 9. VHDL, part IV. Hierarchical and parameterized design. Section 1 HIERARCHICAL DESIGN

Block RAM. Size. Ports. Virtex-4 and older: 18Kb Virtex-5 and newer: 36Kb, can function as two 18Kb blocks

COE Design Process Tutorial

Chip Design with FPGA Design Tools

FSM Components. FSM Description. HDL Coding Methods. Chapter 7: HDL Coding Techniques

Outline. CPE/EE 422/522 Advanced Logic Design L05. Review: General Model of Moore Sequential Machine. Review: Mealy Sequential Networks.

DIGITAL LOGIC DESIGN VHDL Coding for FPGAs Unit 6

HDL. Hardware Description Languages extensively used for:

Drift Chamber Firmware Download Description

Concurrent Signal Assignment Statements (CSAs)

Introduction to Partial Reconfiguration Methodology

PROGRAMMABLE MODULES SPECIFICATION OF PROGRAMMABLE COMBINATIONAL AND SEQUENTIAL MODULES

University of Hawaii EE 361L. Getting Started with Spartan 3E Digilent Basys2 Board. Lab 4.1

Sequential Statement

Constructing VHDL Models with CSA

FPGA design with National Instuments

Synthesis of VHDL Code for FPGA Design Flow Using Xilinx PlanAhead Tool

The CPU Bus : Structure 0

EECS150 - Digital Design Lecture 5 - Verilog Logic Synthesis

Verilog Module 1 Introduction and Combinational Logic

Transcription:

FPGA Lecture for LUPO and GTO Vol. 1 2010, 31 August (revised 2013, 19 November) H. Baba

Contents Basic feature of FPGA Basic usage for LUPO New project Read and Write Basic behavioral VHDL simulation Download firmware

What is FPGA? Field Programmable Gate Array CLB CLB CLB DCM IOB External IO CLB CLB CLB Clock Manager SRAM Wiring Switch CLB CLB CLB Logic Unit Internal RAM

CLB and wiring CLB LUT 0 1 2 3 In Out 0 0 0 0 0 0 0 0 1 1 0 0 1 0 1 0 0 1 1 1 0 1 0 0 0 0 1 0 1 1 0 1 1 1 1 1 0 0 0 0 DFF Clock

About LUPO NIM signals are converted to LVTTL NIM->LVTTL->FPGA FPGA->LVTTL->NIM LVDS ports are direct connection Because of this IOB is 2.5V, this port can be accept 2.5V IO signals 8LED 4NIM IN 16 LVDS IO 32 LVTTL IO 4NIM OUT VME Interface (CPLD) User FPGA (Spartan 3E)

New Project for LUPO Device and Design flow

Design property for GTO

The definition of IO (LUPO) LED : LED A : CAMAC/VME address CLOCK : 50MHz clock INIT : CAMAC Z/C, VME Init? IP : NIM Input 0-3 IP0 : IP0 to GCLK OP : NIM Output 0-3 LVDSn/LVDSp : LVDS IO 0-15 LVDS_CLKn/p : LVDS0 to GCLK RD : Data Read WR : Data Write RD_STRB : Read strobe WR_STRB : Write strobe

Copy the Constraint file (UCF) vlupo.ucf gto.ucf Write constraints for IO and others Association = should be Implementation

Without CAMAC/VME Buses (LUPO) This is enough Edit vlupo.ucf by Edit Constraints(Text) NETs written in UCF are must be written in entity also

Simple case (LUPO) Like this If Synthesize -> Implement Design are passed, it will work

To make the synchronous circuit When you use if, else, you should put values into all signals explicitly Check Warning In this case, created circuit will be asynchronous circuit Should write values in else explicitly

This type works well, usually By using event process, DFF will be used, and values are kept as you had expected Values are changed at the Clock timing

Basically, all lines run in parallel IP(0) e d

Be careful about the loop circuit As this schematic, you can make the Latch circuit, but... Warnings of Combinational loop It will not work, depending on the pulse width, line delay, jitter and so on

Expressly using FF is safe event in the process statement makes DFF, basically As a circuit component, if you use FDCE(=DFF), it will work as you expected

Accessing VME/CAMAC buses(read for LUPO) Latch data during RD_STRB = 1

Accessing VME/CAMAC buses (for LUPO) Data are read from WD at the transition timing of WE_STRB 1 to 0

Example of data readout (LUPO) By using when statement, VME Address (CAMAC AF) is selected During RD_STRB= 1, data must be latched on RD RD <= val; Other cases, RD is unconnected RD <= (others => z ); elsif (WR_STRB = 1 ) then

Example of data write (LUPO) 1. Set a flag at WR_STRB= 1 set <= 1 ; 2. At WR_STRB event and WR_STRB= 0 timing, if flag is 1, set values val <= WR; 3. When WR_STRB= 0, value of set shold be kept set <= set; set is connected to CE (clock enable) of DFF WR set WR_STRB elsif (WR_STRB = 1 ) then val

Make a scaler (counter) By using event, make a synchronous circuit cnt <= cnt + 1 When data readout, data must be latched at the RD_STRB, otherwise you get invalid values, sometimes If cnt value is changed during readout, it is bad There are skew (- 20ps) between all bits

Latching the value of Scaler (Counter) Prepare the vector for readout It is not iq <= cnt; If you this, you get value of cnt - 1

Declare usuful libraries library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; cnt <= cnt + 1 requires ARITH If you simulate with built in libraries such as FDCE, you have to uncomment like this

Do simulation Create the Test Bench

Set initial values Implementation Simulation Switch

Write like this clock part are generated automatically wait for 100ns; means 100ns passing ダブルクリックでシミュレーション開始

ISim Expand Run 1 step

Download firmware to LUPO/GTO Generate Programming File bit file is generated Configure Target Device Launch impact Make file for the flash memory from bit file Load into FPGA First step, PROM = Flash Memory file

Setting of PROM file GTO case, it is xcf02s Choose xcf04s and Add Choose Xilinx Flash/PROM and press

Generate PROM file By the wizard 1. [add a device?] -> Yes 2. Select bit file 3. [any other device?] -> No By double click, file (***.mcs) will be generated

Download firmware For FPGA, cleared by power cycle (bit file) For Flash ROM, non-volatile (mcs file) Load FPGA option is useful, FPGA will be reconfigured when Flash ROM is updated

Ex. mistake case, conv_std_logic_vector Converting to the numerical value of 5000000 to the 24bits vector conv_std_logic_vector(5000000, 24) Good conv_std_logic_vector(24, 5000000) Converting the numerical value of 24 to the 5000000bits vector Synthesize take so long time

downto and to signal a : std_logic_vector(3 downto 0) := 3210 Using vector, downto is usual Writing initial value with bit, it is common that the most right position is 0-th bit type ARINT is array(3 downto 0) of integer; constant b : ARINT := (0,1,2,3); It will be b(0)=3, b(1)=2, b(2)=1,b(3)=0 type ARINT is array(0 to 3) of integer; constant b : ARINT := (0,1,2,3); b(0)=0, b(1)=1, b(2)=2,b(3)=3 Depending on custom,,, when array, to is easier to understand

If you find a warning of black box attribute box_type : string; attribute box_type of FDCE : component is black_box ; Warning will be solved Or, you don t need to declare COMPONENT that are defined in Xilinx Library, simply uncomment these lines

Using LVDS IBUFDS Input OBUFDS Output For input case, write DIFF_TERM = TRUE Terminator is installed

GCLK and BUFG Inputs assigned to GCLK can be used as a Clock (having small Skew and Delay) IP0 and LVDSClockp/n By connecting BUFG, other inputs are also can be used as a Clock (it will be the Clock of many other circuit components) Basically, it is automatically connected at the Place & Route Following declaration is necessary in UCF With larger circuit, please check Place & Route Report In case of Local (not BUFGMUX) and Skew is large, the wiring tuning with PlanAhead is necessary