Hardware Synthesis from Bluespec

Size: px
Start display at page:

Download "Hardware Synthesis from Bluespec"

Transcription

1 Hardware Synthesis from Bluespec Silvina Hanono Wachman Computer Science & Artificial Intelligence Lab. Massachusetts Institute of Technology Happy! Day! L11-1

2 Guarded interfaces Modules with guarded interfaces are a new way of expressing sequential circuits Every method has a guard ( wire) For some methods guard is always true The value returned by a method is meaningful only if its guard is true Every action method has an enable signal (en wire) and it can be invoked (en can be set to true) only if its guard is true Every method can have input data Value and ActionValue methods have output data interface Fifo#(numeric type size, type t); method Action enq(t x); notice, en and method Action deq; wires are method t first; implicit endinterface en en enq deq first FIFO L11-2

3 GCD Interface interface GCD; method Action start (Bit#(32) a, Bit#(32) b); method ActionValue#(Bit#(32)) getresult; endinterface a b en start GCD getresult en module mkgcd (GCD); Reg#(Bit#(32)) x <- mkreg(0); Reg#(Bit#(32)) y <- mkreg(0); Reg#(Bool) busy_flag <- mkreg(false); rule gcd; if (x >= y) begin x <= x y; end //subtract else if (x!= 0) begin x <= y; y <= x; end //swap endrule method Action start(bit#(32) a, Bit#(32) b) if(!busy_flag); x <= a; y <= b; busy_flag <= True; method ActionValue#(Bit#(32)) getresult if(busy_flag&&(x==0)); busy_flag <= False; return y; endmodule L11-3

4 Power of Abstraction: Another GCD implementation start turni start start gcd1 gcd2 getresult getresult turno getresult A GCD module with the same interface but with twice the throughput; uses two gcd modules in parallel turni is used by the start method to direct the input to the gcd whose turn it is and then turni is flipped Similarly, turno is used by getresult to get the output from the appropriate gcd, and then turno is flipped interface GCD; method Action start (Bit#(32) a, Bit#(32) b); method ActionValue#(Bit#(32)) getresult; endinterface L11-4

5 High-throughput GCD code module mkmultigcd (GCD); GCD gcd1 <- mkgcd(); GCD gcd2 <- mkgcd(); Reg#(Bool) turni <- mkreg(false); Reg#(Bool) turno <- mkreg(false); method Action start(bit#(32) a, Bit#(32) b); if (turni) gcd1.start(a,b); else gcd2.start(a,b); turni <=!turni; method ActionValue (Bit#(32)) getresult; Bit#(32) y; if (turno) y <- gcd1.getresult else y <- gcd2.getresult; turno <=!turno return y; endmodule interface GCD; method Action start (Bit#(32) a, Bit#(32) b); method ActionValue#(Bit#(32)) getresult; endinterface L11-5 start turni start start gcd1 gcd2 getresult getresult turno getresult

6 Hardware Synthesis How is Bluespec code synthesized into hardware? March 14, 2019 MIT Spring 2019 L11-6

7 A new mux-like structure to deal with multiple sources x1 v1 x2 v2 x = (v1 & x1) (v2 & x2) v = v1 v2 x v x1 v1 x2 v2 x If x is n bits, this structure is repeated n times v xi has a meaningful value only if its corresponding vi is true Compiler has to ensure that at most one vi input to the mux is true at any given time; the circuit will behave unpredictably if multiple input signals are valid L11-7

8 FIFO Circuit module mkfifo (Fifo#(1, t)); Reg#(t) d <- mkregu; Reg#(Bool) v <- mkreg(false); method Action enq(t x) if (!v); v <= True; d <= x; method Action deq if (v); v <= False; method t first if (v); return d; endmodule I/O: Interface Instantiate state For every register with multiple assignments, insert a mux Compile enq Compile deq Compile first enq deq first True False interface Fifo#(numeric type size, type t); method Action enq(t x); method Action deq; method t first; endinterface L11-8 d v

9 Redrawing the FIFO Circuit enq.data d first.data enq.en deq.en True False v enq. deq. first. A module is a sequential circuit with input and output wires corresponding to its interface methods This is a sequential circuit because it has state elements; however, it has no cycles L11-9

10 Next state transition Partial Truth Table An aside next inputs state state outputs enq. en enq. data deq. en d t v t d t+1 v t+1 enq. deq. first. 0 x 0 x 0 x d 0 x 0 d x 0 d 1 d d 0 x 1 d d first. data Illegal inputs Tedious! L11-10

11 Streaming a function: Circuit inq f outq rule stream; outq.enq(f(inq.first)); inq.deq; endrule This is a sequential machine too! enq deq first inq f outq enq deq first Connect the datapath Collect the ready signals Enable the called methods Notice that enq.en cannot be True unless enq. is true; deq.en cannot be True unless deq. is true L11-11

12 Redrawing the sequential circuit Input wires deq enq deq inq outq first deq enq first deq f Notice: Output wires All input wires are red and blue All output wires are green and blue enq enq L11-12

13 Hierarchical sequential circuits sequential circuits containing modules Each module represents a sequential machine Module 1 Module 2 Module n Declared in the module Input Combinational logic (no cycles, no clock) Output Defined by the Module type (Interface) Defined by the rules and methods of the module L11-13

14 Hardware Synthesis High-level idea Every module represents a sequential machine Register is a primitive module its implementation is outside the language Register bit width is derived from its type Each Register and module is instantiated explicitly Input/Output wires of a module are derived from its interface, i.e., type Rules and methods define the combinational logic to connect registers and modules The resulting hardware is a collection of sequential machines, which itself behaves like a sequential machine L11-14

15 Register: The Primitive module interface Reg#(type t); method Action _write(t x); method t _read; endinterface en Implementation is defined outside the language A register is created using mkreg or mkregu The guards of _write and _read are always true and not generated Special syntax x <= e instead of x._write(e) x instead of x._read in expressions _write Reg _read Always true L11-15

16 Interface defines input/output wires Inputs and outputs are defined by the type of the module, i.e., its interface definition Each method has a output ready wire Each method may have 0 or more input data wires Each Action method and ActionValue method has an input enable wire Each value method and ActionValue method has an output data wire An Action method has no output data wire interface GCD; method Action start (Bit#(32) a,bit#(32) b); method ActionValue(Bit#(32)) getresult; endinterface en start GCD getresult en L11-16

17 Compiling Guards Bluespec design specifies the guard for each method and rule The guard may be stated explicitly; If there is no guard then it is assumed to be true But the guard also implicitly inherits the guards of the called methods The compiler generates the ready signal from these explicit and implicit guards L11-17

18 Guards define the ready signals module mkfifo (Fifo#(1, t)); Reg#(t) d <- mkregu; Reg#(Bool) v <- mkreg(false); method Action enq(t x) if (!v); v <= True; d <= x; method Action deq if (v); v <= False; method t first if (v); return d; endmodule enq deq True False d v first L11-18

19 Combined Guards start turni multigcd start start gcd1 gcd2 getresult getresult turno getresult method Action start(bit#(32) a, Bit#(32) b); if (turni) gcd1.start(a,b); else gcd2.start(a,b); Implicit guard turni <=!turni; turni gcd1.start. gcd2.start. multigcd.start. L11-19

20 Generating enable signals and associated data Bluespec design implicitly specifies the enable signal for each of the called Action and ActionValue method It does so by propagating the incoming enable signals of the calling method or rule body for each called method guard L11-20

21 Rules and methods define the combinational logic and enables module mkex1 (...); Reg#(t) x <- mkregu; method Action f(t a); x <= e; endmodule module mkex2 (...); Reg#(t) x <- mkregu; method Action f(t a); if (b) x <= e; endmodule a f.en a f.en f f e e b x.data x.en x.data x.en x x module mkex3 (...); Reg#(t) x <- mkregu; method Action f(t a); if (b) x <= e1; else x <= e2; endmodule Not shown: f. = True a f.en f e1 e2 b T F x.data x.en x L11-21

22 Synthesis of multiple sources for register assignments module mkex4 (...); Reg#(t) x <- mkregu; method Action f(t a); x <= e1; method Action g(t a); x <= e2; endmodule f.data f.en g.data g.en f g e1 e2 x Compiler has to ensure that both f and g can t be enabled together This information is provided by the compiler in the form of a conflict matrix (CM) for each module L11-22

23 Conflict Matrix for an Interface Conflict Matrix (CM) defines which methods of a module can be called concurrently CM for a register: reg.r reg.w reg.r CF < reg.w > C Two reads can be performed concurrently (CF Conflict Free) Two concurrent writes conflict (C) and are not permitted A read and a write can be performed concurrently and it behaves as if the read happened before the write (r<w) CM of a register is used systematically to derive the CM for the interface of a module CM can also be defined for any set of rules L11-23

24 One-Element FIFO module mkfifo (Fifo#(1, t)); Reg#(t) d <- mkregu; Reg#(Bool) v <- mkreg(false); method Action enq(t x) if (!v); v <= True; d <= x; method Action deq if (v); v <= False; method t first if (v); return d; endmodule We don t care about conflicts between mutually exclusive rules or methods because they can never be ready at the same time L11-24 enq deq first n n enq deq first FIFO enq deq first C ME ME ME C < ME > CF ME = mutually exclusive a<b = a precedes b

25 Take-home problem: Draw the circuit for this GCD interface GCD; method Action start (Bit#(32) a,bit#(32) b); method ActionValue(Bit#(32)) getresult; endinterface module mkgcd (GCD); Reg#(Bit#(32)) x <- mkreg(0); Reg#(Bit#(32)) y <- mkreg(0); Reg#(Bool) busy <- mkreg(false); rule gcd; if (x >= y) begin x <= x y; end //subtract Assume b!= 0 else if (x!= 0) begin x <= y; y <= x; end //swap endrule method Action start(bit#(32) a, Bit#(32) b) if (!busy); x <= a; y <= b; busy <= True; method ActionValue (Bit#(32)) getresult if (busy && (x==0)); busy <= False; return y; endmodule en start GCD getresult en L11-25

Sequential Circuits as Modules with Interfaces. Arvind Computer Science & Artificial Intelligence Lab M.I.T.

Sequential Circuits as Modules with Interfaces. Arvind Computer Science & Artificial Intelligence Lab M.I.T. Sequential Circuits as Modules with Interfaces Arvind Computer Science & Artificial Intelligence Lab M.I.T. L07-1 Shortcomings of the current hardware design practice Complex hardware is viewed as a bunch

More information

Elastic Pipelines and Basics of Multi-rule Systems. Elastic pipeline Use FIFOs instead of pipeline registers

Elastic Pipelines and Basics of Multi-rule Systems. Elastic pipeline Use FIFOs instead of pipeline registers Elastic Pipelines and Basics of Multi-rule Systems Arvind Computer Science & Artificial Intelligence Lab Massachusetts Institute of Technology L05-1 Elastic pipeline Use FIFOs instead of pipeline registers

More information

Well formed BSV programs

Well formed BSV programs Constructive Computer Architecture: Well formed BSV programs Arvind Computer Science & Artificial Intelligence Lab. Massachusetts Institute of Technology http://csg.csail.mit.edu/6.175 L07-1 Are these

More information

Well formed BSV programs

Well formed BSV programs Constructive Computer Architecture: Well formed BSV programs Arvind Computer Science & Artificial Intelligence Lab. Massachusetts Institute of Technology September 17, 2014 http://csg.csail.mit.edu/6.175

More information

Sequential Circuits. Combinational circuits

Sequential Circuits. Combinational circuits ecoder emux onstructive omputer Architecture Sequential ircuits Arvind omputer Science & Artificial Intelligence Lab. Massachusetts Institute of Technology L04-1 ombinational circuits A 0 A 1 A n-1 Sel...

More information

Module Interfaces and Concurrency

Module Interfaces and Concurrency Module Interfaces and Concurrency Arvind Computer Science and Artificial Intelligence Laboratory M.I.T. L12-1 Design Alternatives: Latency and Throughput Combinational (C) Pipeline (P) Folded: Reuse a

More information

Bypassing and EHRs. Arvind Computer Science and Artificial Intelligence Laboratory M.I.T. L23-1

Bypassing and EHRs. Arvind Computer Science and Artificial Intelligence Laboratory M.I.T. L23-1 Bypassing and EHRs Arvind Computer Science and Artificial Intelligence Laboratory M.I.T. L23-1 Bypassing F D RF bypass E/WB Bypassing is a technique to reduce the number of stalls (that is, the number

More information

Lab 1: Hello World, Adders, and Multipliers

Lab 1: Hello World, Adders, and Multipliers Lab 1: Hello World, Adders, and Multipliers Andy Wright acwright@mit.edu Updated: December 30, 2013 1 Hello World! 1 interface GCD#(numeric type n); method Action computegcd(uint#(n) a, UInt#(n) b); method

More information

Simple Inelastic and

Simple Inelastic and Simple Inelastic and Folded Pipelines Arvind Computer Science & Artificial Intelligence Lab Massachusetts Institute of Technology L04-1 Pipelining a block C f1 f2 f3 Combinational P f1 f2 f3 Pipeline FP

More information

6.375 Tutorial 1 BSV. Ming Liu. Overview. Parts of a BSV module Lab 2 topics More types in BSV

6.375 Tutorial 1 BSV. Ming Liu. Overview. Parts of a BSV module Lab 2 topics More types in BSV 6.375 Tutorial 1 BSV Ming Liu T01-1 Overview Parts of a BSV module Lab 2 topics More types in BSV T01-2 1 Modules Interfaces Methods provide a way for the outside world to interact with the module State

More information

Architecture exploration in Bluespec

Architecture exploration in Bluespec Architecture exploration in Bluespec Arvind Computer Science & Artificial Intelligence Lab Massachusetts Institute of Technology Guest Lecture 6.973 (lecture 7) L-1 Chip design has become too risky a business

More information

IP Lookup block in a router

IP Lookup block in a router P Lookup Arvind Computer Science & Artificial ntelligence Lab Massachusetts nstitute of Technology L07-1 P Lookup block in a router Packet Processor S (lookup table) P Lookup Line Card (LC) Control Processor

More information

Arvind (with the help of Nirav Dave) Computer Science & Artificial Intelligence Lab Massachusetts Institute of Technology

Arvind (with the help of Nirav Dave) Computer Science & Artificial Intelligence Lab Massachusetts Institute of Technology Stmt FSM Arvind (with the help of Nirav Dave) Computer Science & Artificial Intelligence Lab Massachusetts Institute of Technology March 10, 2010 http://csg.csail.mit.edu/snu L9-1 Motivation Some common

More information

Lab5 : Sequential Logic Computation Structures Spring 2019

Lab5 : Sequential Logic Computation Structures Spring 2019 Due date: Thursday March 21st 11:59:59pm EST. Getting started: To create your initial Lab 5 repository, please visit the repository creation page at https://6004.mit.edu/web/spring19/user/labs/lab5. Once

More information

Elastic Pipelines: Concurrency Issues

Elastic Pipelines: Concurrency Issues Elastic Pipelines: Concurrency Issues Arvind Computer Science & Artificial Intelligence Lab Massachusetts Institute of Technology L09-1 Inelastic vs Elastic Pipelines In a Inelastic pipeline: pp typically

More information

1 /8_ 2 /12 3 /12 4 /25 5 /12 6 /15 7 /16

1 /8_ 2 /12 3 /12 4 /25 5 /12 6 /15 7 /16 M A S S A C H U S E T T S I N S T I T U T E O F T E C H N O L O G Y DEPARTMENT OF ELECTRICAL ENGINEERING AND COMPUTER SCIENCE 6.S084 Computation Structures Spring 2018 Practice Quiz #1 1 /8_ 2 /12 3 /12

More information

structure syntax different levels of abstraction

structure syntax different levels of abstraction This and the next lectures are about Verilog HDL, which, together with another language VHDL, are the most popular hardware languages used in industry. Verilog is only a tool; this course is about digital

More information

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

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 This and the next lectures are about Verilog HDL, which, together with another language VHDL, are the most popular hardware languages used in industry. Verilog is only a tool; this course is about digital

More information

Bluespec for a Pipelined SMIPSv2 Processor

Bluespec for a Pipelined SMIPSv2 Processor Bluespec for a Pipelined SMIPSv2 Processor 6.375 Laboratory 2 February 14, 2008 The second laboratory assignment is to implement a pipelined SMIPSv2 in Bluespec SystemVerilog. As with Lab One, your deliverables

More information

Combinational circuits

Combinational circuits omputer Architecture: A onstructive Approach Sequential ircuits Arvind omputer Science & Artificial Intelligence Lab. Massachusetts Institute of Technology Revised February 21, 212 (Slides from #16 onwards)

More information

Lab 4: N-Element FIFOs 6.175: Constructive Computer Architecture Fall 2014

Lab 4: N-Element FIFOs 6.175: Constructive Computer Architecture Fall 2014 Lab 4: N-Element FIFOs Due: Wednesday October 8, 2014 1 Introduction This lab focuses on the design of various N-element FIFOs including a conflict-free FIFO. Conflict-free FIFOs are an essential tool

More information

Sizhuo Zhang TA

Sizhuo Zhang TA Constructive Computer Architecture Tutorial 2 Advanced BSV Sizhuo Zhang 6.175 TA T02-1 EHR and Scheduling Design example Up/down counter interface Counter; Bit#(8) read; Action increment(bit#(8) x); Action

More information

6.175: Constructive Computer Architecture. Tutorial 1 Bluespec SystemVerilog (BSV) Sep 30, 2016

6.175: Constructive Computer Architecture. Tutorial 1 Bluespec SystemVerilog (BSV) Sep 30, 2016 6.175: Constructive Computer Architecture Tutorial 1 Bluespec SystemVerilog (BSV) Quan Nguyen (Only crashed PowerPoint three times) T01-1 What s Bluespec? A synthesizable subset of SystemVerilog Rule-based

More information

Multiple Clock Domains

Multiple Clock Domains Multiple Clock Domains Arvind Computer Science & Artificial Intelligence Lab Massachusetts Institute of Technology Based on material prepared by Bluespec Inc L13-1 Why Multiple Clock Domains Arise naturally

More information

Lecture 14. Synthesizing Parallel Programs IAP 2007 MIT

Lecture 14. Synthesizing Parallel Programs IAP 2007 MIT 6.189 IAP 2007 Lecture 14 Synthesizing Parallel Programs Prof. Arvind, MIT. 6.189 IAP 2007 MIT Synthesizing parallel programs (or borrowing some ideas from hardware design) Arvind Computer Science & Artificial

More information

Elastic Pipelines: Concurrency Issues

Elastic Pipelines: Concurrency Issues Elastic Pipelines: Concurrency Issues Arvind Computer Science & Artificial Intelligence Lab Massachusetts Institute of Technology L08-1 Inelastic vs Elastic Pipelines In a Inelastic pipeline: pp typically

More information

Transmitter Overview

Transmitter Overview Multiple Clock Domains Arvind Computer Science & Artificial Intelligence Lab Massachusetts Institute of Technology Based on material prepared by Bluespec Inc L12-1 802.11 Transmitter Overview headers Controller

More information

Bluespec. Lectures 3 & 4 with some slides from Nikhil Rishiyur at Bluespec and Simon Moore at the University of Cambridge

Bluespec. Lectures 3 & 4 with some slides from Nikhil Rishiyur at Bluespec and Simon Moore at the University of Cambridge Bluespec Lectures 3 & 4 with some slides from Nikhil Rishiyur at Bluespec and Simon Moore at the University of Cambridge Course Resources http://cas.ee.ic.ac.uk/~ssingh Lecture notes (Power Point, PDF)

More information

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

ECE 2300 Digital Logic & Computer Organization. More Sequential Logic Verilog ECE 2300 Digital Logic & Computer Organization Spring 2018 More Sequential Logic Verilog Lecture 7: 1 Announcements HW3 will be posted tonight Prelim 1 Thursday March 1, in class Coverage: Lectures 1~7

More information

IP Lookup block in a router

IP Lookup block in a router P Lookup: Some subtle concurrency issues Arvind Computer Science & Artificial ntelligence Lab Massachusetts nstitute of Technology L06-1 P Lookup block in a router Packet Processor S (lookup table) P Lookup

More information

Multicycle processors. Arvind Computer Science & Artificial Intelligence Lab. Massachusetts Institute of Technology

Multicycle processors. Arvind Computer Science & Artificial Intelligence Lab. Massachusetts Institute of Technology Multicycle processors Arvind Computer Science & Artificial Intelligence Lab. Massachusetts Institute of Technology L12-1 Single-Cycle RISC Processor As an illustrative example, we use a subset of RISC-V

More information

IBM Power Multithreaded Parallelism: Languages and Compilers. Fall Nirav Dave

IBM Power Multithreaded Parallelism: Languages and Compilers. Fall Nirav Dave 6.827 Multithreaded Parallelism: Languages and Compilers Fall 2006 Lecturer: TA: Assistant: Arvind Nirav Dave Sally Lee L01-1 IBM Power 5 130nm SOI CMOS with Cu 389mm 2 2GHz 276 million transistors Dual

More information

The Pipeline Lab Copyright Bluespec Inc

The Pipeline Lab Copyright Bluespec Inc The Pipeline Lab Hello Bluespec! This lab will lead you through basic aspects of the BSV (Bluespec SystemVerilog) language and the usage of the Bluespec compiler (bsc) for Bluesim and Verilog simulations.

More information

Bluespec SystemVerilog Design Example TLMDMA

Bluespec SystemVerilog Design Example TLMDMA Bluespec SystemVerilog Design Example TLMDMA TLMDMA.bsv DMA based on TLM interfaces TLM slave receives read/write requests towards the configuration registers TLM master initiates a DMA transaction (read/write

More information

Overview. BSV reviews/notes Guard lifting EHRs Scheduling Lab Tutorial 2 Guards and Scheduling. Ming Liu

Overview. BSV reviews/notes Guard lifting EHRs Scheduling Lab Tutorial 2 Guards and Scheduling. Ming Liu 6.375 Tutorial 2 Guards and Scheduling Ming Liu T02-1 Overview BSV reviews/notes Guard lifting EHRs Scheduling Lab 3 T02-2 1 Expressions vs. Actions Expressions Have no side effects (state changes) Can

More information

Small Router Design Using. Bluespec SystemVerilog

Small Router Design Using. Bluespec SystemVerilog Small Router Design Using Bluespec SystemVerilog Daian Sova M. Filip Master AAC SBT Router Design 1 1. SBT Router Block Description The SBT Router is a simple router which has one input port (8 bits wide)

More information

Combinational Circuits and Simple Synchronous Pipelines

Combinational Circuits and Simple Synchronous Pipelines Combinational Circuits and Simple Synchronous Pipelines Arvind Computer Science & Artificial Intelligence Lab Massachusetts Institute of Technology L061 Bluespec: TwoLevel Compilation Bluespec (Objects,

More information

Multiple Clock Domains

Multiple Clock Domains Multiple Clock Domains (MCD) Arvind with Nirav Dave Computer Science & Artificial Intelligence Lab Massachusetts Institute of Technology March 15, 2010 http://csg.csail.mit.edu/6.375 L12-1 Plan Why Multiple

More information

Pipelining combinational circuits

Pipelining combinational circuits Pipelining combinational circuits Arvind Computer Science & Artificial Intelligence Lab. Massachusetts Institute of Technology February 20, 2013 http://csg.csail.mit.edu/6.375 L05-1 Combinational IFFT

More information

Multicycle processors. Arvind Computer Science & Artificial Intelligence Lab. Massachusetts Institute of Technology

Multicycle processors. Arvind Computer Science & Artificial Intelligence Lab. Massachusetts Institute of Technology Multicycle processors Arvind Computer Science & Artificial Intelligence Lab. Massachusetts Institute of Technology L14-1 Single-Cycle RISC Processor As an illustrative example, we use a subset of RISC-V

More information

1 /10 2 /12 3 /16 4 /30 5 /12 6 /20

1 /10 2 /12 3 /16 4 /30 5 /12 6 /20 M A S S A C H U S E T T S I N S T I T U T E O F T E C H N O L O G Y DEPARTMENT OF ELECTRICAL ENGINEERING AND COMPUTER SCIENCE 6.004 Computation Structures Fall 2018 Practice Quiz #1 1 /10 2 /12 3 /16 4

More information

Composable Building Blocks to Open up Processor Design

Composable Building Blocks to Open up Processor Design Composable Building Blocks to Open up Processor Design Sizhuo Zhang, Andrew Wright, Thomas Bourgeat, Arvind Computer Science and Artificial Intelligence Laboratory Massachusetts Institute of Technology

More information

Memory System Implementation

Memory System Implementation Memory System Implementation Silvina Hanono Wachman Computer Science & Artificial Intelligence Lab Massachusetts Institute of Technology L14-1 Best Wishes from Japan October 25, 2018 MIT 6.004 Fall 2018

More information

Synthesizable Verilog

Synthesizable Verilog Synthesizable Verilog Courtesy of Dr. Edwards@Columbia, and Dr. Franzon@NCSU http://csce.uark.edu +1 (479) 575-6043 yrpeng@uark.edu Design Methodology Structure and Function (Behavior) of a Design HDL

More information

A Tutorial Introduction 1

A Tutorial Introduction 1 Preface From the Old to the New Acknowledgments xv xvii xxi 1 Verilog A Tutorial Introduction 1 Getting Started A Structural Description Simulating the binarytoeseg Driver Creating Ports For the Module

More information

Lecture 06: Rule Scheduling

Lecture 06: Rule Scheduling Bluespec SystemVerilog Training Lecture 06: Rule Scheduling Copyright Bluespec, Inc., 2005-2008 Lecture 06: Rule Scheduling A rule has no internal sequencing Untimed rule semantics are one-rule-at-a-time

More information

Hardware Description Languages (HDLs) Verilog

Hardware Description Languages (HDLs) Verilog Hardware Description Languages (HDLs) Verilog Material from Mano & Ciletti book By Kurtulus KULLU Ankara University What are HDLs? A Hardware Description Language resembles a programming language specifically

More information

Constructive Computer Architecture. Tutorial 1 BSV Types. Andy Wright TA. September12, 2014

Constructive Computer Architecture. Tutorial 1 BSV Types. Andy Wright TA. September12, 2014 Constructive Computer Architecture Tutorial 1 BSV Types Andy Wright 6.175 TA T01-1 Bit#(numeric type n) The most important type in BSV We ll go into the details later L03-2 Bit#(numeric type n) Literal

More information

or Arvind goes commercial Joe Stoy, May

or Arvind goes commercial Joe Stoy, May or Arvind goes commercial Joe Stoy, May 18 2007 Bluespec, Inc., 2006 Network evolution: IP Sprawl Managed Switch/Router Professional Park ADM Metropolitan Area or Regional Area Service Provider ADM ADM

More information

Non-pipelined Multicycle processors

Non-pipelined Multicycle processors Non-pipelined Multicycle processors Arvind Computer Science & Artificial Intelligence Lab. Massachusetts Institute of Technology Code for the lecture is available on the course website under the code tab

More information

Programming in the Brave New World of Systems-on-a-chip

Programming in the Brave New World of Systems-on-a-chip Programming in the Brave New World of Systems-on-a-chip Arvind Computer Science & Artificial Intelligence Lab Massachusetts Institute of Technology The 25th International Workshop on Languages and Compilers

More information

Super Advanced BSV* Andy Wright. October 24, *Edited for Tutorial 6. Andy Wright Super Advanced BSV* October 24, / 25

Super Advanced BSV* Andy Wright. October 24, *Edited for Tutorial 6. Andy Wright Super Advanced BSV* October 24, / 25 Super Advanced BSV* Andy Wright October 24, 2014 *Edited for 6.175 Tutorial 6 Andy Wright Super Advanced BSV* October 24, 2014 1 / 25 Super Advanced BSV Scheduling! Andy Wright Super Advanced BSV* October

More information

Hardware description language (HDL)

Hardware description language (HDL) Hardware description language (HDL) A hardware description language (HDL) is a computer-based language that describes the hardware of digital systems in a textual form. It resembles an ordinary computer

More information

Introduction. Purpose. Intended Audience. Conventions. Close

Introduction. Purpose. Intended Audience. Conventions. Close Introduction Introduction Verilog-XL is a simulator that allows you to test the logic of a design. The process of logic simulation in Verilog-XL is as follows: 1. Describe the design to Verilog-XL. 2.

More information

Introduction to Verilog/System Verilog

Introduction to Verilog/System Verilog NTUEE DCLAB Feb. 27, 2018 Introduction to Verilog/System Verilog Presenter: Yao-Pin Wang 王耀斌 Advisor: Prof. Chia-Hsiang Yang 楊家驤 Dept. of Electrical Engineering, NTU National Taiwan University What is

More information

Simple Inelastic and

Simple Inelastic and Simple Inelastic and Folded Pipelines Arvind Computer Science & Artificial Intelligence Lab Massachusetts Institute of Technology For taking noted during the lecture L3-1 Pipelining a block C inq f1 f2

More information

Combinational Circuits in

Combinational Circuits in Combinational Circuits in Bluespec Arvind Computer Science & Artificial Intelligence Lab Massachusetts Institute of Technology L031 Bluespec: TwoLevel Compilation Bluespec (Objects, Types, Higherorder

More information

Combinational Circuits in

Combinational Circuits in Combinational Circuits in Bluespec Arvind Computer Science & Artificial Intelligence Lab Massachusetts Institute of Technology L031 Bluespec: TwoLevel Compilation Bluespec (Objects, Types, Higherorder

More information

EPC6055 Digital Integrated Circuits EXAM 1 Fall Semester 2013

EPC6055 Digital Integrated Circuits EXAM 1 Fall Semester 2013 EPC6055 Digital Integrated Circuits EXAM 1 Fall Semester 2013 Print Here Student ID Signature This is a closed book exam. The exam is to be completed in one-hundred ten (110) minutes. Don t use scratch

More information

Constructive Computer Architecture. September 9, T01-1. Was everyone added to the class?

Constructive Computer Architecture. September 9, T01-1. Was everyone added to the class? Constructive Computer Architecture Tutorial 1 Andy Wright 6.S195 TA T01-1 Administrative Stuff Piazza Was everyone added to the class? Lab 1 (Due Friday) Has everyone tried logging onto vlsifarm? What

More information

ENGR 3410: Lab #1 MIPS 32-bit Register File

ENGR 3410: Lab #1 MIPS 32-bit Register File ENGR 3410: Lab #1 MIPS 32-bit Register File Due: October 12, 2005, beginning of class 1 Introduction The purpose of this lab is to create the first large component of our MIPS-style microprocessor the

More information

Lecture 09: More on Module Interfaces

Lecture 09: More on Module Interfaces Bluespec SystemVerilog Training Lecture 09: More on Module Interfaces Copyright Bluespec, Inc., 2005-2008 Lecture 09: More on Module Interfaces Packages and Libraries Interfaces: raising the level of abstraction

More information

Modular Refinement - 2. Successive refinement & Modular Structure

Modular Refinement - 2. Successive refinement & Modular Structure Modular Refinement - 2 Arvind Computer Science & Artificial Intelligence Lab Massachusetts Institute of Technology L10-1 Successive refinement & Modular Structure pc rf fetch decode execute memory writeback

More information

CSE140L: Components and Design Techniques for Digital Systems Lab. Verilog HDL. Instructor: Mohsen Imani UC San Diego. Source: Eric Crabill, Xilinx

CSE140L: Components and Design Techniques for Digital Systems Lab. Verilog HDL. Instructor: Mohsen Imani UC San Diego. Source: Eric Crabill, Xilinx CSE140L: Components and Design Techniques for Digital Systems Lab Verilog HDL Instructor: Mohsen Imani UC San Diego Source: Eric Crabill, Xilinx 1 Hardware description languages Used to describe & model

More information

FPGA Design Challenge :Techkriti 14 Digital Design using Verilog Part 1

FPGA Design Challenge :Techkriti 14 Digital Design using Verilog Part 1 FPGA Design Challenge :Techkriti 14 Digital Design using Verilog Part 1 Anurag Dwivedi Digital Design : Bottom Up Approach Basic Block - Gates Digital Design : Bottom Up Approach Gates -> Flip Flops Digital

More information

EN164: Design of Computing Systems Lecture 06: Lab Foundations / Verilog 2

EN164: Design of Computing Systems Lecture 06: Lab Foundations / Verilog 2 EN164: Design of Computing Systems Lecture 06: Lab Foundations / Verilog 2 Professor Sherief Reda http://scaleenginbrownedu Electrical Sciences and Computer Engineering School of Engineering Brown University

More information

Lab 1: A Simple Audio Pipeline

Lab 1: A Simple Audio Pipeline Lab 1: A Simple Audio Pipeline 6.375 Laboratory 1 Assigned: February 2, 2011 Due: February 11 2011 1 Introduction This lab is the beginning of a series of labs in which we will design the hardware for

More information

Pipelining combinational circuits

Pipelining combinational circuits Constructive Computer Architecture: Pipelining combinational circuits Arvind Computer Science & Artificial Intelligence Lab. Massachusetts Institute of Technology September 18, 2013 http://csg.csail.mit.edu/6.s195

More information

Bluespec-4: Rule Scheduling and Synthesis. Synthesis: From State & Rules into Synchronous FSMs

Bluespec-4: Rule Scheduling and Synthesis. Synthesis: From State & Rules into Synchronous FSMs Bluespec-4: Rule Scheduling and Synthesis Arvind Computer Science & Artificial Intelligence Lab Massachusetts Institute of Technology Based on material prepared by Bluespec Inc, January 2005 March 2, 2005

More information

This Lecture. Some components (useful for the homework) Verilog HDL (will continue next lecture)

This Lecture. Some components (useful for the homework) Verilog HDL (will continue next lecture) Last Lecture The basic component of a digital circuit is the MOS transistor Transistor have instrinsic resistance and capacitance, so voltage values in the circuit take some time to change ( delay ) There

More information

Programmable Logic Devices Verilog VII CMPE 415

Programmable Logic Devices Verilog VII CMPE 415 Synthesis of Combinational Logic In theory, synthesis tools automatically create an optimal gate-level realization of a design from a high level HDL description. In reality, the results depend on the skill

More information

ECEN 468 Advanced Logic Design

ECEN 468 Advanced Logic Design ECEN 468 Advanced Logic Design Lecture 28: Synthesis of Language Constructs Synthesis of Nets v An explicitly declared net may be eliminated in synthesis v Primary input and output (ports) are always retained

More information

Course Topics - Outline

Course Topics - Outline Course Topics - Outline Lecture 1 - Introduction Lecture 2 - Lexical conventions Lecture 3 - Data types Lecture 4 - Operators Lecture 5 - Behavioral modeling A Lecture 6 Behavioral modeling B Lecture 7

More information

Bluespec SystemVerilog TM Training. Lecture 05: Rules. Copyright Bluespec, Inc., Lecture 05: Rules

Bluespec SystemVerilog TM Training. Lecture 05: Rules. Copyright Bluespec, Inc., Lecture 05: Rules Bluespec SystemVerilog Training Copyright Bluespec, Inc., 2005-2008 Rules: conditions, actions Rule Untimed Semantics Non-determinism Functional correctness: atomicity, invariants Examples Performance

More information

Verilog. What is Verilog? VHDL vs. Verilog. Hardware description language: Two major languages. Many EDA tools support HDL-based design

Verilog. What is Verilog? VHDL vs. Verilog. Hardware description language: Two major languages. Many EDA tools support HDL-based design Verilog What is Verilog? Hardware description language: Are used to describe digital system in text form Used for modeling, simulation, design Two major languages Verilog (IEEE 1364), latest version is

More information

Combinational Logic II

Combinational Logic II Combinational Logic II Ranga Rodrigo July 26, 2009 1 Binary Adder-Subtractor Digital computers perform variety of information processing tasks. Among the functions encountered are the various arithmetic

More information

The Verilog Language COMS W Prof. Stephen A. Edwards Fall 2002 Columbia University Department of Computer Science

The Verilog Language COMS W Prof. Stephen A. Edwards Fall 2002 Columbia University Department of Computer Science The Verilog Language COMS W4995-02 Prof. Stephen A. Edwards Fall 2002 Columbia University Department of Computer Science The Verilog Language Originally a modeling language for a very efficient event-driven

More information

ECE Digital System Design & Synthesis Exercise 1 - Logic Values, Data Types & Operators - With Answers

ECE Digital System Design & Synthesis Exercise 1 - Logic Values, Data Types & Operators - With Answers ECE 601 - Digital System Design & Synthesis Exercise 1 - Logic Values, Data Types & Operators - With Answers Fall 2001 Final Version (Important changes from original posted Exercise 1 shown in color) Variables

More information

The Verilog Hardware Description Language

The Verilog Hardware Description Language Donald Thomas Philip Moorby The Verilog Hardware Description Language Fifth Edition 4y Spri nnger Preface From the Old to the New Acknowledgments xv xvii xxi 1 Verilog A Tutorial Introduction Getting Started

More information

Performance Specifications. Simple processor pipeline

Performance Specifications. Simple processor pipeline Performance Specifications Arvind Computer Science & Artificial Intelligence Lab Massachusetts Institute of Technology L11-1 Simple processor pipeline RF Bz? Bz? IF Dec Exe Mem Wb imem bf bd dmem Functional

More information

Verilog Fundamentals. Shubham Singh. Junior Undergrad. Electrical Engineering

Verilog Fundamentals. Shubham Singh. Junior Undergrad. Electrical Engineering Verilog Fundamentals Shubham Singh Junior Undergrad. Electrical Engineering VERILOG FUNDAMENTALS HDLs HISTORY HOW FPGA & VERILOG ARE RELATED CODING IN VERILOG HDLs HISTORY HDL HARDWARE DESCRIPTION LANGUAGE

More information

Motivation State Machines

Motivation State Machines Motivation State Machines Generating test cases for complex behaviour Textbook Reading: Chapter 7 We are interested in testing the behaviour of object-oriented software systems Behaviour: Interactions

More information

Synthesis of Combinational and Sequential Circuits with Verilog

Synthesis of Combinational and Sequential Circuits with Verilog Synthesis of Combinational and Sequential Circuits with Verilog What is Verilog? Hardware description language: Are used to describe digital system in text form Used for modeling, simulation, design Two

More information

Verilog 1 - Fundamentals

Verilog 1 - Fundamentals Verilog 1 - Fundamentals FA FA FA FA module adder( input [3:0] A, B, output cout, output [3:0] S ); wire c0, c1, c2; FA fa0( A[0], B[0], 1 b0, c0, S[0] ); FA fa1( A[1], B[1], c0, c1, S[1] ); FA fa2( A[2],

More information

Nikhil Gupta. FPGA Challenge Takneek 2012

Nikhil Gupta. FPGA Challenge Takneek 2012 Nikhil Gupta FPGA Challenge Takneek 2012 RECAP FPGA Field Programmable Gate Array Matrix of logic gates Can be configured in any way by the user Codes for FPGA are executed in parallel Configured using

More information

Pipelined RISC-V Processors

Pipelined RISC-V Processors Due date: Tuesday November 20th 11:59:59pm EST Getting started: To create your initial Lab 7 repository, please visit the repository creation page at https://6004.mit.edu/web/fall18/user/labs/lab7. Once

More information

Lecture 12 VHDL Synthesis

Lecture 12 VHDL Synthesis CPE 487: Digital System Design Spring 2018 Lecture 12 VHDL Synthesis Bryan Ackland Department of Electrical and Computer Engineering Stevens Institute of Technology Hoboken, NJ 07030 1 What is Synthesis?

More information

VHDL for Synthesis. Course Description. Course Duration. Goals

VHDL for Synthesis. Course Description. Course Duration. Goals VHDL for Synthesis Course Description This course provides all necessary theoretical and practical know how to write an efficient synthesizable HDL code through VHDL standard language. The course goes

More information

CS232 VHDL Lecture. Types

CS232 VHDL Lecture. Types CS232 VHDL Lecture VHSIC Hardware Description Language [VHDL] is a language used to define and describe the behavior of digital circuits. Unlike most other programming languages, VHDL is explicitly parallel.

More information

State-Based Testing Part B Error Identification. Generating test cases for complex behaviour

State-Based Testing Part B Error Identification. Generating test cases for complex behaviour State-Based Testing Part B Error Identification Generating test cases for complex behaviour Reference: Robert V. Binder Testing Object-Oriented Systems: Models, Patterns, and Tools Addison-Wesley, 2000,

More information

FPGA: FIELD PROGRAMMABLE GATE ARRAY Verilog: a hardware description language. Reference: [1]

FPGA: FIELD PROGRAMMABLE GATE ARRAY Verilog: a hardware description language. Reference: [1] FPGA: FIELD PROGRAMMABLE GATE ARRAY Verilog: a hardware description language Reference: [] FIELD PROGRAMMABLE GATE ARRAY FPGA is a hardware logic device that is programmable Logic functions may be programmed

More information

Contents. Appendix D Verilog Summary Page 1 of 16

Contents. Appendix D Verilog Summary Page 1 of 16 Appix D Verilog Summary Page 1 of 16 Contents Appix D Verilog Summary... 2 D.1 Basic Language Elements... 2 D.1.1 Keywords... 2 D.1.2 Comments... 2 D.1.3 Identifiers... 2 D.1.4 Numbers and Strings... 3

More information

Modeling Processors. Arvind Computer Science & Artificial Intelligence Lab Massachusetts Institute of Technology

Modeling Processors. Arvind Computer Science & Artificial Intelligence Lab Massachusetts Institute of Technology Modeling Processors Arvind Computer Science & Artificial Intelligence Lab Massachusetts Institute of Technology L07-1 The Plan Non-pipelined processor Two-stage synchronous pipeline Two-stage asynchronous

More information

BeiHang Short Course, Part 2: Description and Synthesis

BeiHang Short Course, Part 2: Description and Synthesis BeiHang Short Course, Part 2: Operation Centric Hardware Description and Synthesis J. C. Hoe, CMU/ECE/CALCM, 2014, BHSC L2 s1 James C. Hoe Department of ECE Carnegie Mellon University Collaborator: Arvind

More information

Modular Refinement. Successive refinement & Modular Structure

Modular Refinement. Successive refinement & Modular Structure Modular Refinement Arvind Computer Science & Artificial Intelligence Lab Massachusetts Institute of Technology L09-1 Successive refinement & Modular Structure pc rf fetch decode execute memory writeback

More information

A Parameterized Model of a Crossbar Switch In Bluespec SystemVerilog (TM) June 30, Copyright Bluespec, Inc., 2005, All Rights Reserved

A Parameterized Model of a Crossbar Switch In Bluespec SystemVerilog (TM) June 30, Copyright Bluespec, Inc., 2005, All Rights Reserved Introduction A Parameterized Model of a Crossbar Switch In Bluespec SystemVerilog (TM) June 30, 2005 Copyright Bluespec, Inc., 2005, All Rights Reserved This document describes the design of a highly parameterized,

More information

Verilog 1 - Fundamentals

Verilog 1 - Fundamentals Verilog 1 - Fundamentals FA FA FA FA module adder( input [3:0] A, B, output cout, output [3:0] S ); wire c0, c1, c2; FA fa0( A[0], B[0], 1 b0, c0, S[0] ); FA fa1( A[1], B[1], c0, c1, S[1] ); FA fa2( A[2],

More information

Modeling of a Memory Interface Using Modeling Language

Modeling of a Memory Interface Using Modeling Language Modeling of a Memory Interface Using Modeling Language *Akitoshi Matsuda 1, Shinichi Baba 2 1 Dept. of Automotive Science, Kyushu University, Japan 2 Kyushu Embedded Forum, Japan 1 matsuda_aki@slrc.kyushu-u.ac.jp,

More information

Bluespec SystemVerilog Known Problems and Solutions

Bluespec SystemVerilog Known Problems and Solutions Bluespec SystemVerilog Known Problems and Solutions Revision: 17 January 2012 Copyright c 2000 2012 Bluespec, Inc. All rights reserved 1 Contents Table of Contents 2 Problem #001: Mutually-exclusive uses

More information

Verilog Design Entry, Synthesis, and Behavioral Simulation

Verilog Design Entry, Synthesis, and Behavioral Simulation ------------------------------------------------------------- PURPOSE - This lab will present a brief overview of a typical design flow and then will start to walk you through some typical tasks and familiarize

More information