EECS150 Lab Lecture 2 Design Verification

Similar documents
Lab 3: Simulation and Testing

EECS150 Lab Lecture 0

EECS150 Lab Lecture 5 Introduction to the Project

Lab 3 Verilog Simulation Mapping

Lab 4: List Processor and Chipscope

Don t expect to be able to write and debug your code during the lab session.

Lab 3: Simulation and Testing

Lab 1: FPGA Physical Layout

EECS150 Fall 2013 Checkpoint: DVI Test Pattern

LAB 9 The Performance of MIPS

LAB 9 The Performance of MIPS

LAB 6 Testing the ALU

University of California, Davis Department of Electrical and Computer Engineering. EEC180B DIGITAL SYSTEMS Spring Quarter 2018

E85: Digital Design and Computer Engineering Lab 2: FPGA Tools and Combinatorial Logic Design

Verilog Simulation Mapping

EECS150 - Digital Design Lecture 6 - Logic Simulation

EECS 150 Fall 2013 Checkpoint 1: Pipelined MIPS Processor

CPEN 230L: Introduction to Digital Logic Laboratory Lab 7: Multiplexers, Decoders, and Seven Segment Displays

Lab 6 : Introduction to Verilog

EECS 151/251A Fall 2017 Digital Design and Integrated Circuits. Instructor: John Wawrzynek and Nicholas Weaver. Lecture 13 EE141

ECE 353 Lab 3. MIDI Note Number Display. Lab Info. Electrical and Computer Engineering

1. Introduction EE108A. Lab 1: Combinational Logic: Extension of the Tic Tac Toe Game

Lab 6 Debugging. Objective. Introduction. Prelab

ECE/CS Computer Design Lab Lab 1 - Completion by Sept 13. Lab 2 will be assigned during the 2nd week of September.

EECS 150 Fall 2012 Checkpoint 1: Pipelined MIPS Processor

Lab 1 FPGA CAD Tools

Final Project: MIPS-like Microprocessor

Lab 2 Designing with Verilog

CS150 Project Final Report

Lab 2 Verilog Synthesis & Logic Optimization

LAB 9 The Performance of MIPS

CPEN 230L: Introduction to Digital Logic Laboratory Lab #6: Verilog and ModelSim

Tutorial: Working with the Xilinx tools 14.4

Hardware Description Languages: Verilog. Quick History of HDLs. Verilog/VHDL. Design Methodology. Verilog Introduction. Verilog.

Hardware Description Languages: Verilog

Quartus II Tutorial. September 10, 2014 Quartus II Version 14.0

Circuit Design and Simulation with VHDL 2nd edition Volnei A. Pedroni MIT Press, 2010 Book web:

Quartus II Version 14.0 Tutorial Created September 10, 2014; Last Updated January 9, 2017

EECS150: Lab 1, FPGA CAD Tools

AccelDSP tutorial 2 (Matlab.m to HDL for Xilinx) Ronak Gandhi Syracuse University Fall

Assembly Programming

Lab 7 (All Sections) Prelab: Verilog Review and ALU Datapath and Control

CSE 141L Computer Architecture Lab Fall Lecture 3

University of California at Berkeley College of Engineering Department of Electrical Engineering and Computer Science. EECS 150 Spring 2000

Lab Assignment 2. Implementing Combinational and Sequential Logic in VHDL

EECS150 - Digital Design Lecture 6 - Logic Simulation. Encoder Example

EE108a Lab 0: Introduction to Verilog and the EE108a tool chain, version 1.01

EEM 486: Computer Architecture. Lecture 2. MIPS Instruction Set Architecture

ENSC 350 ModelSim Altera Tutorial

Programmable Machines

CS/EE 3710 Computer Architecture Lab Checkpoint #2 Datapath Infrastructure

EE 4755 Digital Design Using Hardware Description Languages

LAB 5 Implementing an ALU

FPGA Design Tutorial

ECE 353 Lab 4. Verilog Review. Professor Daniel Holcomb UMass Amherst Fall 2017

CS2630: Computer Organization Project 2, part 1 Register file and ALU for MIPS processor Due July 25, 2017, 11:59pm

Programmable Machines

Xilinx Schematic Entry Tutorial

ECE 353 Lab 4. Verilog Review. Professor Daniel Holcomb With material by Professor Moritz and Kundu UMass Amherst Fall 2016

Experiment VERI: FPGA Design with Verilog (Part 2) (webpage: /)

ECE 473 Computer Architecture and Organization Project: Design of a Five Stage Pipelined MIPS-like Processor Project Team TWO Objectives

University of California at Berkeley College of Engineering Department of Electrical Engineering and Computer Science

CS 61C: Great Ideas in Computer Architecture Intro to Assembly Language, MIPS Intro

Assignment 01 Computer Architecture Lab ECSE

CSE140L: Components and Design Techniques for Digital Systems Lab

CS 61C: Great Ideas in Computer Architecture. Lecture 11: Datapath. Bernhard Boser & Randy Katz

Using Project Navigator

ECE 587 Hardware/Software Co-Design Lecture 11 Verification I

! ISP (circa 1977) - research project at CMU " Simulation, but no synthesis

CS352H: Computer Systems Architecture

Verilog Synthesis and FSMs. UCB EECS150 Fall 2010 Lab Lecture #3

Welcome to CS250 VLSI Systems Design

Project BIOS Documentation EECS Fall 2012

CSE140L: Components and Design

University of California, Davis Department of Electrical and Computer Engineering. Lab 1: Implementing Combinational Logic in the MAX10 FPGA

Synthesizable Verilog

CS2630: Computer Organization Project 2, part 1 Register file and ALU for MIPS processor

ECE/CS 552: Introduction to Computer Architecture ASSIGNMENT #3 Due Date: At the beginning of lecture, October 20 th, 2010

Boolean Unit (The obvious way)

Introduction. Overview. Top-level module. EE108a Lab 3: Bike light

VHDL for Synthesis. Course Description. Course Duration. Goals

structure syntax different levels of abstraction

Here is a list of lecture objectives. They are provided for you to reflect on what you are supposed to learn, rather than an introduction to this

Lecture Topics. Announcements. Today: Single-Cycle Processors (P&H ) Next: continued. Milestone #3 (due 2/9) Milestone #4 (due 2/23)

CS 61c: Great Ideas in Computer Architecture

EE 101 Homework 4 Redekopp Name: Due: See Blackboard

ELEC 4200 Lab#0 Tutorial

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

EECS150 - Digital Design Lecture 10- CPU Microarchitecture. Processor Microarchitecture Introduction

University of California at Berkeley College of Engineering Department of Electrical Engineering and Computer Science

EECS150 - Digital Design Lecture 5 - Verilog Logic Synthesis

CS 61C: Great Ideas in Computer Architecture Intro to Assembly Language, MIPS Intro

EE183 LAB TUTORIAL. Introduction. Projects. Design Entry

ANADOLU UNIVERSITY DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING. EEM Digital Systems II

Review of Last lecture. Review ALU Design. Designing a Multiplier Shifter Design Review. Booth s algorithm. Today s Outline

EECS 150 Fall 2012 Checkpoint 2: Cache Integration

1. Choose a module that you wish to implement. The modules are described in Section 2.4.

CS 61C: Great Ideas in Computer Architecture. MIPS CPU Datapath, Control Introduction

361 datapath.1. Computer Architecture EECS 361 Lecture 8: Designing a Single Cycle Datapath

Applications Note. HDL Simulation FPGA Design Methodology. October 15, Revision 1.0

Transcription:

EECS150 Lab Lecture 2 Design Verification Vincent Lee Electrical Engineering and Computer Sciences University of California, Berkeley 9/7/2012 EECS150-Fa12-lab1 1

Lab Logistics T minus three weeks-ish until the project starts We re getting closer to Dan Garcia s hand of God For this lab, you will not be synthesizing your design = not using FPGA Grades for Lab 0 have been uploaded to bspace so check to make sure you have a score Labs are due by the last lab section of the week after they are assigned 9/7/2012 EECS150-Fa12-lab1 2

Agenda Testing Methodologies What we forgot to cover last week Xilinx Report Tools and Design Flow: Where are we? Software Simulation and Navigating Modelsim This Week s Lab: ALU and verification Parsing Register Transfer Level (RTL) Descriptions Tips, Tricks, Miscellaneous Things to Know 9/7/2012 EECS150-Fa12-lab1 3

The Xilinx Report Generator We tried to go over this with everyone after check off Xilinx will generate a report file every time you try to run synthesis to bit stream generation Can open the report by running make report command from same path as Makefile Contains resource utilization, timing information, and more Also displays list of errors and/or warnings 9/7/2012 EECS150-Fa12-lab1 4

Xilinx Report 9/7/2012 EECS150-Fa12-lab1 5

Errors, Warnings, Infos 9/7/2012 EECS150-Fa12-lab1 6

A Note on Errors and Warning Errors are bad Fix them Warnings Some generated by Xilinx tools nothing you can do about it Can be generated by your HDL code may or may not need to be fixed Good practice to always check for warnings coming from you code Don t always have to fix but May give hints as to why your synthesized design isn t working There s usually a reason why the tools are complaining about your code 9/7/2012 EECS150-Fa12-lab1 7

Testing Methodologies Exhaustive testing Throw every possible input at the circuit (for CL anyways) Ideal and covers everything including edge cases (100% coverage) Scales very poorly Random testing Uniform sampling of input space Edge cases randomly sampled (limited coverage) Scales better than exhaustive testing May combine with some target vectors 9/7/2012 EECS150-Fa12-lab1 8

Testing Methodologies Button-up approach Unit test most primitive modules first Work your way up by running integration tests when modules interact with each other For complex systems, very effective verification method Top-down approach Start at top level module and work your way down through submodules Stub modules that aren t implemented Good if problems tend to occur towards top 9/7/2012 EECS150-Fa12-lab1 9

For this lab and class Recommend button-up approach Project will have many small modules that compose a very large complex system Single bug will cripple your project Random testing for ALU and system with many inputs Supplement hardcoded test vectors to cover edge cases and frequently used cases 9/7/2012 EECS150-Fa12-lab1 10

For this lab and class We will only provide basic test cases Your job to fill in the gaps the real world is 50%+ testing and 50%- everything else In general, groups who write more/most test cases finish the project faster Don t count on us giving you a solution if you fall behind You need to understand your code to do the next checkpoint We cannot write testbenches for modules that you designed 9/7/2012 EECS150-Fa12-lab1 11

Digital Design Development Cycle 9/7/2012 EECS150-Fa12-lab1 12

Where We Are in the Development Flow 9/7/2012 EECS150-Fa12-lab1 13

Software Simulation Tool that simulates behavior of HDL code before synthesis Gives design feedback as waveforms or test messages Requires explicit simulation test cases which usually aren t synthesized Sometimes may differ from actual synthesis since tools infer logic upon synthesis Hopefully irons out most/all bugs before synthesis 9/7/2012 EECS150-Fa12-lab1 14

Motivation Behind Software Simulation Synthesis takes FOREVER want to be able to do verification quickly in software Enhances visibility by allowing access to every signal Testing is important A broken product isn t worth anything (also not worth credit) Entire teams in industry devoted to verification and DFT Systems are complicated Easy to make mistake in 1000s to millions of lines of code Modules may work separately but not together NRE costs are expensive one bug can cost the entire design 9/7/2012 EECS150-Fa12-lab1 15

Modelsim Simulation Tool 9/7/2012 EECS150-Fa12-lab1 16

Navigating the Tools Modelsim can be invoked by the vsim command Waveform colors Green waveforms usually good (all values defined) Red waveforms usually bad (undefined values) Blue waveforms usually bad (undriven values) Radix (hex, decimal, etc.) Right click signal -> Radix -> Selected Radix 9/7/2012 EECS150-Fa12-lab1 17

Navigating the Tools Use + or - to zoom in or out Toggling leafs on and off - removes excess file path description 9/7/2012 EECS150-Fa12-lab1 18

This Week s Lab Objectives: Become familiar with module test harnesses and testbenches Learn how to use Modelsim to simulate in software and debug your modules before synthesis Pre-lab requirements: Write verilog for ALU before lab Check off requirements: Functional ALU and testbenches Answers to checkoff questions Due Thursday 9/20 @ 8PM 9/7/2012 EECS150-Fa12-lab1 19

This Week s Lab You will be provided the skeletal files for: ALU testbench (ALUTestbench.v) ALU test vector harness (ALUTestVectorTestbench.v) ALU Decoder (ALUdec.v) ALU file (ALU.v) You will NOT be synthesizing the design (no makefile on top level) Instead you will be verifying your design by using Modelsim (makefile in /sim directory) READ THE DOCUMENT AND RTL SPECIFICATION 9/7/2012 EECS150-Fa12-lab1 20

ALU Decoder and ALU Controller for the ALU Takes instruction Opcode and Func Deduces appropriate ALUOp ALU Takes ALUOp and operands Performs operation specified on operands 9/7/2012 EECS150-Fa12-lab1 21

ALU Decoder and ALU Simulation Test Harness ALU Decoder and ALU are Devices Under Test (DUTs) Equivalent block diagram for simulation: 9/7/2012 EECS150-Fa12-lab1 22

Register Transfer Level (RTL) Descriptions SEXT(*) = sign extend value of * ZEXT(*) = zero extend value of * PC = memory address of instruction >>> = shift right arithmetic (A? B : C) = if A, then evaluate to B, else evaluate to C BMEM(*) = byte memory at * HMEM(*) = half memory at * WMEM(*) = word memory at * 9/7/2012 EECS150-Fa12-lab1 23

RTL Example: Load Byte (I-Type) 9/7/2012 EECS150-Fa12-lab1 24

RTL Example: Branch on Less Than or Equal (J-Type) 9/7/2012 EECS150-Fa12-lab1 25

Lab Tips and Tricks Read the lab document and understand the specification before you start Watch for signed and unsigned operations they are different Unsigned comparisons Unsigned loads Watch source field ordering order is important Watch order for SLLV, SRLV, and SRAV R[$rt] >> R[$rs] vs. R[$rs] << R[$rt] This will make your ALU fail the testbench Shift right logical (SRL) and shift right arithmetic (SRA) are different Watch operation binding strength 9/7/2012 EECS150-Fa12-lab1 26

Running Simulation To run simulation, cd to /sim directory Run make in directory Simulation output will fill the screen for each testbench you are running Simulator looks in /sim/tests for.do files each file specifies one test case simulation Simulation generates /results directory with transcript and waveform file (.wlf) Waveform can be viewed with Modelsim or calling./viewwave 9/7/2012 EECS150-Fa12-lab1 27

Macro Files Macro files help define variables so that you don t have to hardcode: Indicated by.vh file Use macros in verilog by using tick mark ` Two macro files included in /src directory ALUop.vh contains ALU operation code macros Opcode.vh contains MIPS ISA opcode macros 9/7/2012 EECS150-Fa12-lab1 28

Lab Assignment Prelab assignment: Write code for ALU and ALU decoder Lab assignment: Complete testbenches and add appropriate test cases Write hardcoded tests and manually add testcases to file Yes we want you to type in the 1s and 0s to the testvector file Simulate and verify that ALU and decoder works correctly Checkoff Demonstrate functional ALU and ALU Decoder 9/7/2012 EECS150-Fa12-lab1 29

Next Week s Lab Next week s lab lecture: Overview of Chipscope Next week s lab: List Processor and Chipscope Datapath and Controller Design What to do when simulation works but synthesis fails oh dear 9/7/2012 EECS150-Fa12-lab1 30

Questions, comments, or concerns? 9/7/2012 EECS150-Fa12-lab1 31