Constructive Computer Architecture Tutorial 3 Debugging BSV Andy Wright 6.175 TA September12, 2014http://csg.csail.mit.edu/6.175T01-1.

Slides:



Advertisements
Similar presentations
Slide 1CPU Emulator Tutorial This program is part of the software suite that accompanies the book The Digital Core, by Noam Nisan and Shimon Schocken 2003,
Advertisements

Chapter 3: Editing and Debugging SAS Programs. Some useful tips of using Program Editor Add line number: In the Command Box, type num, enter. Save SAS.
Lab6 – Debug Assembly Language Lab
Programming in Verilog CPSC 321 Computer Architecture Andreas Klappenecker.
Verilog Lab This presentation includes some material that is selected from BUCKNELL VERILOG HANDBOOK. Instructor: Dr. Charles Liu Prepared by John Ren.
Decimal Addition What is going on? (carry) (subtract the base)
Constructive Computer Architecture: FIFO Lab Comments Revisiting CF FIFOs Andy Wright TA October 20, 2014http://csg.csail.mit.edu/6.175L14-1.
Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 | Last Updated: July 2005 Slide 1 Introduction To Computers.
Homework Reading –Finish K&R Chapter 1 (if not done yet) –Start K&R Chapter 2 for next time. Programming Assignments –DON’T USE and string library functions,
Design Verification Design Profiler Course 8. All materials updated on: September 30, Design Profiler Design Profiler is a tool integrated within.
Guest Lecture by Ben Magstadt CprE 281: Digital Logic.
Constructive Computer Architecture Tutorial 4: SMIPS on FPGA Andy Wright 6.S195 TA October 7, 2013http://csg.csail.mit.edu/6.s195T04-1.
1 Integrated Development Environment Building Your First Project (A Step-By-Step Approach)
Guest Lecture by Ben Magstadt CprE 281: Digital Logic.
Intro. to Game Programming Want to program a game?
Homework Reading Programming Assignments
© Janice Regan, CMPT 128, Jan CMPT 128 Introduction to Computing Science for Engineering Students Creating a program.
Compiling & Debugging Quick tutorial. What is gcc? Gcc is the GNU Project C compiler A command-line program Gcc takes C source files as input Outputs.
Programming Concept Chapter I Introduction to Java Programming.
Python From the book “Think Python”
Active-HDL Interfaces Debugging C Code Course 10.
Active-HDL Interfaces Building VHPI Applications C Compilation Course 9.
Interfaces to External EDA Tools Debussy Denali SWIFT™ Course 12.
Constructive Computer Architecture Tutorial 3: Debugging SMIPS Andy Wright 6.S195 TA October 4, 2013http://csg.csail.mit.edu/6.s195T03-1.
Program Errors and Debugging Week 10, Thursday Lab.
MIPS Project -- Simics Yang Diyi Outline Introduction to Simics Simics Installation – Linux – Windows Guide to Labs – General idea Score Policy.
Oct 2, 2014T01-1http://csg.csail.mit.edu/6.175 Constructive Computer Architecture Tutorial 1 BSV Sizhuo Zhang TA.
Debugging Computer Networks Sep. 26, 2007 Seunghwan Hong.
Constructive Computer Architecture Tutorial 2 Advanced BSV Sizhuo Zhang TA Oct 9, 2015T02-1http://csg.csail.mit.edu/6.175.
CS Computer Science I. BCPL was developed in 1967 as a language for writing operating systems and software compilers In 1970, the creators of the.
Using Simulator With Undertow Suite. Source environment variables For example, envsource has all the environment variables set up. You can change the.
Constructive Computer Architecture Tutorial 4 Debugging Sizhuo Zhang TA Oct 23, 2015T04-1http://csg.csail.mit.edu/6.175.
Application Debugging. Debugging methodical process of finding and reducing the number of bugs, or defects, in a computer program or a piece of electronic.
SUNY-New Paltz Computer Simulation Lab Electrical and Computer Engineering Department SUNY – New Paltz “Lecture 12”
Lab Exercise Management Steven P. Levitan, University of Pittsburgh Design Automation Conference Sunday, June 9, 2002.
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 4: Testing, Dataflow Modeling Spring 2009.
CSE/CoE 535 : Attig 1 ModelSim Tutorial for CSE 535 Michael Attig
Constructive Computer Architecture Tutorial 4: Running and Debugging SMIPS Andy Wright TA October 10, 2014http://csg.csail.mit.edu/6.175T04-1.
Data Representation. How is data stored on a computer? Registers, main memory, etc. consists of grids of transistors Transistors are in one of two states,
Teaching Digital Logic courses with Altera Technology
Lecture1 Instructor: Amal Hussain ALshardy. Introduce students to the basics of writing software programs including variables, types, arrays, control.
Lab 9 Department of Computer Science and Information Engineering National Taiwan University Lab9 - Debugging I 2014/11/4/ 28 1.
CODING VOCABULARY.  Binary  A number system based on 2  Hexadecimal  A number system based on 16  Domain  An internet location registered with the.
CMSC 2021 Software Development. CMSC 2022 Software Development Life Cycle Five phases: –Analysis –Design –Implementation –Testing –Maintenance.
Scheduling Blocks: simulating their execution Andy Biggs (ESO, Garching)
CprE 281: Verilog Tutorial Ben Magstadt – Master’s Student Electrical Engineering.
Object Oriented Programming COP3330 / CGS5409.  Compiling with g++  Using Makefiles  Debugging.
1 VHDL & Verilog Simulator. Modelsim. 2 Change the directory to where your files exist (All of the files must be in a same folder). Modelsim.
CSCI 161 Lecture 3 Martin van Bommel. Operating System Program that acts as interface to other software and the underlying hardware Operating System Utilities.
Tutorial for Modelsim 1 Installation Download the Modelsim Student Edition: Follow the.
COMPREHENSIVE Excel Tutorial 12 Expanding Excel with Visual Basic for Applications.
Hex Editing using HxD Nick Fogal & Lindsay Shaffer.
Number Systems.
14 Compilers, Interpreters and Debuggers
Debugging with gdb gdb is the GNU debugger on our CS machines.
TRANSLATORS AND IDEs Key Revision Points.
Programming Languages
Progress Report Chester Liu 2014/03/18.
Constructive Computer Architecture: Lab Comments & RISCV
BSV Types Constructive Computer Architecture Tutorial 1 Andy Wright
6.375 Tutorial 2 Guards and Scheduling Ming Liu
Debugging BSV and Typeclasses. Constructive Computer Architecture
Introduction to Computer Programming
Doing the VCS Assignment
Code Generation Tips Tricks Pitfalls 5/4/2019 A.Symons CiTR Pty Ltd.
Scratch Programming Lesson 7 Debugging.
Debugging.
By Hugues Leger / Intro to GDB debugger By Hugues Leger / 11/16/2019.
Presentation transcript:

Constructive Computer Architecture Tutorial 3 Debugging BSV Andy Wright TA September12, 2014http://csg.csail.mit.edu/6.175T01-1

Review Last Tutorial: Scheduling Typeclasses Recent Lectures: SMIPS ISA September12, 2014L03-2http://csg.csail.mit.edu/6.175

Software Debugging Print Statements See a bug, not sure what causes it Add print statements Recompile Run Still see bug, but you have narrowed it down to a smaller portion of code Repeat with more print statements… Find bug, fix bug, and remove print statements September12, 2014L03-3http://csg.csail.mit.edu/6.175

BSV Debugging Display Statements See a bug, not sure what causes it Add display statements Recompile Run Still see bug, but you have narrowed it down to a smaller portion of code Repeat with more display statements… Find bug, fix bug, and remove display statements September12, 2014L03-4http://csg.csail.mit.edu/6.175

BSV Display Statements The $display() command is an action that prints statements to the simulation console Examples: $display(“Hello World!”); $display(“The value of x is %d”, x); $display(“The value of y is “, fshow(y)); September12, 2014L03-5http://csg.csail.mit.edu/6.175

Ways to Display Values Format Specifiers %d – decimal %b – binary %o – octal %h – hexadecimal %0d, %0b, %0o, %0h Show value without extra whitespace padding September12, 2014L03-6http://csg.csail.mit.edu/6.175

Ways to Display Values fshow fshow is a function in the FShow typeclass It can be derived for enumerations and structures Example: typedef emun {Red, Blue} Colors deriving(FShow); Color c = Red; $display(“c is “, fshow(c)); September12, 2014L03-7http://csg.csail.mit.edu/6.175 Prints “c is Red”

BSV Debugging Waveform Viewer Simulation executables can dump VCD waveforms./simMyTest –V test.vcd Produces test.vcd containing the values of all the signals used in the simulator Not the same as normal BSV signals VCD files can be viewed by a waveform viewer Such as gtkwave The signal names and values in test.vcd can be hard to understand Especially for structures and enumerations September12, 2014L03-8http://csg.csail.mit.edu/6.175

BSV Debugging Example Using the Bluespec GUI and the GTKWave waveform viewer September12, 2014L03-9http://csg.csail.mit.edu/6.175

Step 1 Generate VCD File Run./simTestName -V test.vcd September12, 2014L03-10http://csg.csail.mit.edu/6.175

Step 2 Open Bluespec GUI Run “bluespec fifo.bspec” September12, 2014L03-11http://csg.csail.mit.edu/6.175 Note, to run the GUI remotely, you need to SSH into the servers with the “ssh –X” command For the fifo lab, fifo.bspec can be found in

Step 3 Set top module name Open project options September12, 2014L03-12http://csg.csail.mit.edu/6.175

Step 3 Set top module name Set the top module name to match the compiled module in TestBench.bsv September12, 2014L03-13http://csg.csail.mit.edu/6.175

Step 4 Open Module Viewer September12, 2014L03-14http://csg.csail.mit.edu/6.175

Step 4 Open Module Viewer September12, 2014L03-15http://csg.csail.mit.edu/6.175

Step 5 Open Wave Viewer September12, 2014L03-16http://csg.csail.mit.edu/6.175

Step 5 Open Wave Viewer September12, 2014L03-17http://csg.csail.mit.edu/6.175

September12, 2014L03-18http://csg.csail.mit.edu/6.175 Step 6 Open Wave Viewer

Step 6 Add Some Signals September12, 2014L03-19http://csg.csail.mit.edu/6.175

Step 6 Add Some Signals September12, 2014L03-20http://csg.csail.mit.edu/6.175 Module Hierarchy Signals

Step 7 Look at the Waveforms September12, 2014L03-21http://csg.csail.mit.edu/6.175

Step 7 Look at the Waveforms September12, 2014L03-22http://csg.csail.mit.edu/6.175 Types Human readable value names

Step 7 Look at the Waveforms September12, 2014L03-23http://csg.csail.mit.edu/6.175

Step 8 Add Some More Signals September12, 2014L03-24http://csg.csail.mit.edu/6.175

Step 8 Add Some More Signals September12, 2014L03-25http://csg.csail.mit.edu/6.175

Step 9 Add Rules Too September12, 2014L03-26http://csg.csail.mit.edu/6.175

Step 9 Add Rules Too September12, 2014L03-27http://csg.csail.mit.edu/6.175