February 14, 2007L04-1http://csg.csail.mit.edu/6.375/ Bluespec-1: Design methods to facilitate rapid growth of SoCs Arvind Computer Science & Artificial.

Slides:



Advertisements
Similar presentations
ECE Synthesis & Verification - Lecture 2 1 ECE 667 Spring 2011 ECE 667 Spring 2011 Synthesis and Verification of Digital Circuits High-Level (Architectural)
Advertisements

An EHR based methodology for Concurrency management Arvind (with Asif Khan) Computer Science & Artificial Intelligence Lab Massachusetts Institute of Technology.
March 2007http://csg.csail.mit.edu/arvindSemantics-1 Scheduling Primitives for Bluespec Arvind Computer Science & Artificial Intelligence Lab Massachusetts.
Prof. John Nestor ECE Department Lafayette College Easton, Pennsylvania ECE VLSI System Design Lecture 4 - Advanced Verilog.
Constructive Computer Architecture Tutorial 4: SMIPS on FPGA Andy Wright 6.S195 TA October 7, 2013http://csg.csail.mit.edu/6.s195T04-1.
Stmt FSM Richard S. Uhler Computer Science & Artificial Intelligence Lab Massachusetts Institute of Technology (based on a lecture prepared by Arvind)
On “Control Adaptivity”: how to sell the idea of Atomic Transactions to the HW design community Rishiyur Nikhil Bluespec, Inc. WG 2.8 meeting, June 16,
Asynchronous Pipelines: Concurrency Issues Arvind Computer Science & Artificial Intelligence Lab Massachusetts Institute of Technology October 13, 2009http://csg.csail.mit.edu/koreaL12-1.
February 21, 2007http://csg.csail.mit.edu/6.375/L07-1 Bluespec-4: Architectural exploration using IP lookup Arvind Computer Science & Artificial Intelligence.
March, 2007http://csg.csail.mit.edu/arvindIPlookup-1 IP Lookup Arvind Computer Science & Artificial Intelligence Lab Massachusetts Institute of Technology.
September 24, L08-1 IP Lookup: Some subtle concurrency issues Arvind Computer Science & Artificial Intelligence Lab.
IP Lookup: Some subtle concurrency issues Arvind Computer Science & Artificial Intelligence Lab Massachusetts Institute of Technology February 22, 2011L06-1.
IP Lookup: Some subtle concurrency issues Arvind Computer Science & Artificial Intelligence Lab Massachusetts Institute of Technology March 4, 2013
December 10, 2009 L29-1 The Semantics of Bluespec Arvind Computer Science & Artificial Intelligence Lab Massachusetts Institute.
Computer Architecture: A Constructive Approach Sequential Circuits Arvind Computer Science & Artificial Intelligence Lab. Massachusetts Institute of Technology.
ASIC/FPGA design flow. FPGA Design Flow Detailed (RTL) Design Detailed (RTL) Design Ideas (Specifications) Design Ideas (Specifications) Device Programming.
February 22, 2005http://csg.csail.mit.edu/6.884/L07-1 Bluespec-1: Design Affects Everything Arvind Computer Science & Artificial Intelligence Lab Massachusetts.
Some Course Info Jean-Michel Chabloz. Main idea This is a course on writing efficient testbenches Very lab-centric course: –You are supposed to learn.
ECE 551 Digital System Design & Synthesis Fall 2011 Midterm Exam Overview.
Lecture 9. MIPS Processor Design – Instruction Fetch Prof. Taeweon Suh Computer Science Education Korea University 2010 R&E Computer System Education &
Copyright © Bluespec Inc Bluespec SystemVerilog™ Design Example A DMA Controller with a Socket Interface.
September 3, 2009L02-1http://csg.csail.mit.edu/korea Introduction to Bluespec: A new methodology for designing Hardware Arvind Computer Science & Artificial.
Introduction to Bluespec: A new methodology for designing Hardware Arvind Computer Science & Artificial Intelligence Lab. Massachusetts Institute of Technology.
March, 2007Intro-1http://csg.csail.mit.edu/arvind Design methods to facilitate rapid growth of SoCs Arvind Computer Science & Artificial Intelligence Lab.
March 6, 2006http://csg.csail.mit.edu/6.375/L10-1 Bluespec-4: Rule Scheduling and Synthesis Arvind Computer Science & Artificial Intelligence Lab Massachusetts.
Electrical and Computer Engineering University of Cyprus LAB 1: VHDL.
An Overview of Hardware Design Methodology Ian Mitchelle De Vera.
Constructive Computer Architecture: Guards Arvind Computer Science & Artificial Intelligence Lab. Massachusetts Institute of Technology September 24, 2014.
September 22, 2009http://csg.csail.mit.edu/koreaL07-1 Asynchronous Pipelines: Concurrency Issues Arvind Computer Science & Artificial Intelligence Lab.
Constructive Computer Architecture Sequential Circuits Arvind Computer Science & Artificial Intelligence Lab. Massachusetts Institute of Technology
CSCI-365 Computer Organization Lecture Note: Some slides and/or pictures in the following are adapted from: Computer Organization and Design, Patterson.
Elastic Pipelines: Concurrency Issues Arvind Computer Science & Artificial Intelligence Lab Massachusetts Institute of Technology February 28, 2011L08-1http://csg.csail.mit.edu/6.375.
Constructive Computer Architecture Sequential Circuits Arvind Computer Science & Artificial Intelligence Lab. Massachusetts Institute of Technology September.
Introduction to Bluespec: A new methodology for designing Hardware Arvind Computer Science & Artificial Intelligence Lab. Massachusetts Institute of Technology.
Constructive Computer Architecture Sequential Circuits - 2 Arvind Computer Science & Artificial Intelligence Lab. Massachusetts Institute of Technology.
Modular Refinement Arvind Computer Science & Artificial Intelligence Lab Massachusetts Institute of Technology March 8,
October 22, 2009http://csg.csail.mit.edu/korea Modular Refinement Arvind Computer Science & Artificial Intelligence Lab Massachusetts Institute of Technology.
Introduction to Bluespec: A new methodology for designing Hardware Arvind Computer Science & Artificial Intelligence Lab. Massachusetts Institute of Technology.
Multiple Clock Domains (MCD) Arvind with Nirav Dave Computer Science & Artificial Intelligence Lab Massachusetts Institute of Technology.
Problem: design complexity advances in a pace that far exceeds the pace in which verification technology advances. More accurately: (verification complexity)
October 20, 2009L14-1http://csg.csail.mit.edu/korea Concurrency and Modularity Issues in Processor pipelines Arvind Computer Science & Artificial Intelligence.
February 28, 2005http://csg.csail.mit.edu/6.884/L09-1 Bluespec-3: Modules & Interfaces Arvind Computer Science & Artificial Intelligence Lab Massachusetts.
Introduction to Bluespec: A new methodology for designing Hardware
Introduction to Bluespec: A new methodology for designing Hardware
Folded “Combinational” circuits
Sequential Circuits - 2 Constructive Computer Architecture Arvind
Sequential Circuits Constructive Computer Architecture Arvind
Sequential Circuits: Constructive Computer Architecture
Introduction to Bluespec: A new methodology for designing Hardware
Stmt FSM Arvind (with the help of Nirav Dave)
Pipelining combinational circuits
Bluespec-1: Design Affects Everything
Constructive Computer Architecture: Guards
Sequential Circuits Constructive Computer Architecture Arvind
Pipelining combinational circuits
Modular Refinement Arvind
Modular Refinement Arvind
Lecture 1.3 Hardware Description Languages (HDLs)
Modules with Guarded Interfaces
Pipelining combinational circuits
Sequential Circuits - 2 Constructive Computer Architecture Arvind
Introduction to Bluespec: A new methodology for designing Hardware
Stmt FSM Arvind (with the help of Nirav Dave)
Constructive Computer Architecture: Guards
GCD: A simple example to introduce Bluespec
Win with HDL Slide 4 System Level Design
Design methods to facilitate rapid growth of SoCs
Introduction to Bluespec: A new methodology for designing Hardware
The Verilog Hardware Description Language
CS295: Modern Systems Bluespec Introduction
Presentation transcript:

February 14, 2007L04-1http://csg.csail.mit.edu/6.375/ Bluespec-1: Design methods to facilitate rapid growth of SoCs Arvind Computer Science & Artificial Intelligence Lab Massachusetts Institute of Technology System-on-a-chip

February 14, 2007 L04-2http://csg.csail.mit.edu/6.375/ The biggest SoC drivers Explosive growth in markets for cell phones game boxes sensors and actuators Functionality and applications are constrained primarily by: - cost - power/energy constrains

February 14, 2007 L04-3http://csg.csail.mit.edu/6.375/ Current Cellphone Architecture Comms. Processing Application Processing WLAN RF WCDMA/GSM RF Complex, High Performance but must not dissipate more than 3 watts Today’s chip becomes a block in tomorrow’s chip IP reuse is essential Hardware/software migration IP = Intellectual Property

February 14, 2007 L04-4http://csg.csail.mit.edu/6.375/ An under appreciated fact If a functionality (e.g. H.264) is moved from a programmable device to a specialized hardware block, the power/energy savings are 100 to 1000 fold but our mind set Software is forgiving Hardware design is difficult, inflexible, brittle, error prone,... Power savings  more specialized hardware

February 14, 2007 L04-5http://csg.csail.mit.edu/6.375/ SoC Trajectory: multicores, heterogeneous, regular,... On-chip memory banks Structured on- chip networks General- purpose processors Can we rapidly produce high-quality chips and surrounding systems and software? Application- specific processing units IBM Cell Processor

February 14, 2007 L04-6http://csg.csail.mit.edu/6.375/ Things to remember Design costs (hardware & software) dominate Within these costs verification and validation costs dominate IP reuse is essential to prevent design- team sizes from exploding design cost = number of engineers x time to design

February 14, 2007 L04-7http://csg.csail.mit.edu/6.375/ Common quotes “Design is not a problem; design is easy” Almost complete reliance on post-design verification for quality Mind set “Verification is a problem” “Timing closure is a problem” “Physical design is a problem”

February 14, 2007 L04-8http://csg.csail.mit.edu/6.375/ The U.S. auto industry Sought quality solely through post-build inspection Planned for defects and rework and U.S. quality was… Through the early 1980s: Defect MakeInspectRework Defect

February 14, 2007 L04-9http://csg.csail.mit.edu/6.375/ … less than world class Adding quality inspectors (“verification engineers”) and giving them better tools, was not the solution The Japanese auto industry showed the way “Zero defect” manufacturing

February 14, 2007 L04-10http://csg.csail.mit.edu/6.375/ New mind set: Design affects everything! A good design methodology Can keep up with changing specs Permits architectural exploration Facilitates verification and debugging Eases changes for timing closure Eases changes for physical design Promotes reuse Design for Correctness  It is essential to

February 14, 2007 L04-11http://csg.csail.mit.edu/6.375/ New ways of expressing behavior to reduce design complexity Decentralize complexity: Rule-based specifications (Guarded Atomic Actions) Lets you think one rule at a time Formalize composition: Modules with guarded interfaces Automatically manage and ensure the correctness of connectivity, i.e., correct-by- construction methodology Bluespec  Smaller, simpler, clearer, more correct code Strong flavor of Unity

February 14, 2007 L04-12http://csg.csail.mit.edu/6.375/ data_in push_req_n pop_req_n clk rstn data_out full empty Reusing IP Blocks Example: Commercially available FIFO IP block These constraints are spread over many pages of the documentation... No machine verification of such informal constraints is feasible

February 14, 2007 L04-13http://csg.csail.mit.edu/6.375/ Bluespec promotes composition through guarded interfaces not full not empty n n rdy enab rdy enab rdy enq deq first FIFO theModuleA theModuleB theFifo.enq(value1); theFifo.deq(); value2 = theFifo.first(); theFifo.enq(value3); theFifo.deq(); value4 = theFifo.first(); theFifo Enqueue arbitration control Dequeue arbitration control Self-documenting interfaces; Automatic generation of logic to eliminate conflicts in use.

February 14, 2007 L04-14http://csg.csail.mit.edu/6.375/ Bluespec What is it? Programming with Rules Example GCD Synthesis of circuits Another Example: Multiplication Bluespec is available in two versions: BSV – Bluespec in System Verilog ESEPro – Bluespec in SystemC These lectures will use BSV syntax 5-minute break to stretch you legs

February 14, 2007 L04-15http://csg.csail.mit.edu/6.375/ Bluespec SystemVerilog (BSV) Power to express complex static structures and constraints Checked by the compiler “Micro-protocols” are managed by the compiler The necessary hardware for muxing and control is generated automatically and is correct by construction Easier to make changes while preserving correctness  Smaller, simpler, clearer, more correct code  not just simulation, synthesis as well

February 14, 2007 L04-16http://csg.csail.mit.edu/6.375/ Bluespec: State and Rules organized into modules All state (e.g., Registers, FIFOs, RAMs,...) is explicit. Behavior is expressed in terms of atomic actions on the state: Rule: condition  action Rules can manipulate state in other modules only via their interfaces. interface module

February 14, 2007 L04-17http://csg.csail.mit.edu/6.375/ Programming with rules: A simple example Euclid’s algorithm for computing the Greatest Common Divisor (GCD): subtract 36 subtract 63 swap 33 subtract 03 subtract answer:

February 14, 2007 L04-18http://csg.csail.mit.edu/6.375/ module mkGCD (I_GCD); Reg#(int) x <- mkRegU; Reg#(int) y <- mkReg(0); rule swap ((x > y) && (y != 0)); x <= y; y <= x; endrule rule subtract ((x <= y) && (y != 0)); y <= y – x; endrule method Action start(int a, int b) if (y==0); x <= a; y <= b; endmethod method int result() if (y==0); return x; endmethod endmodule Internal behavior GCD in BSV External interface State typedef int Int#(32) Assumes x /= 0 and y /= 0 x y swapsub

February 14, 2007 L04-19http://csg.csail.mit.edu/6.375/ rdy enab int rdy start result GCD module int y == 0 implicit conditions interface I_GCD; method Action start (int a, int b); method int result(); endinterface GCD Hardware Module t #(type t) t t tt t In a GCD call t could be Int#(32), UInt#(16), Int#(13),... The module can easily be made polymorphic Many different implementations can provide the same interface: module mkGCD (I_GCD)

February 14, 2007 L04-20http://csg.csail.mit.edu/6.375/ module mkGCD (I_GCD); Reg#(int) x <- mkRegU; Reg#(int) y <- mkReg(0); rule swapANDsub ((x > y) && (y != 0)); x <= y; y <= x - y; endrule rule subtract ((x<=y) && (y!=0)); y <= y – x; endrule method Action start(int a, int b) if (y==0); x <= a; y <= b; endmethod method int result() if (y==0); return x; endmethod endmodule GCD: Another implementation Combine swap and subtract rule Does it compute faster ?

February 14, 2007 L04-21http://csg.csail.mit.edu/6.375/ Bluespec Tool flow Bluespec SystemVerilog source Verilog 95 RTL Verilog sim VCD output Debussy Visualization Bluespec Compiler files Bluespec tools 3 rd party tools Legend RTL synthesis gates C Bluesim Cycle Accurate Blueview

February 14, 2007 L04-22http://csg.csail.mit.edu/6.375/ Generated Verilog RTL: GCD module mkGCD(CLK,RST_N,start_a,start_b,EN_start,RDY_start, result,RDY_result); input CLK; input RST_N; // action method start input [31 : 0] start_a; input [31 : 0] start_b; input EN_start; output RDY_start; // value method result output [31 : 0] result; output RDY_result; // register x and y reg [31 : 0] x; wire [31 : 0] x$D_IN; wire x$EN; reg [31 : 0] y; wire [31 : 0] y$D_IN; wire y$EN;... // rule RL_subtract assign WILL_FIRE_RL_subtract = x_SLE_y___d3 && !y_EQ_0___d10 ; // rule RL_swap assign WILL_FIRE_RL_swap = !x_SLE_y___d3 && !y_EQ_0___d10 ;...

February 14, 2007 L04-23http://csg.csail.mit.edu/6.375/ Generated Hardware next state values predicates x_en y_en x_en = swap? y_en = swap? OR subtract? x y > !(=0) swap?subtract? sub x y  en rdy x rdy start result

February 14, 2007 L04-24http://csg.csail.mit.edu/6.375/ Generated Hardware Module x_en y_en x_en = swap? OR start_en y_en = swap? OR subtract? OR start_en x y > !(=0) swap?subtract? sub x y  en rdy x rdy start result rdy = (y==0) start_en

February 14, 2007 L04-25http://csg.csail.mit.edu/6.375/ GCD: A Simple Test Bench module mkTest (); Reg#(int) state <- mkReg(0); I_GCD gcd <- mkGCD(); rule go (state == 0); gcd.start ( 423, 142 ); state <= 1; endrule rule finish (state == 1); $display (“GCD of 423 & 142 =%d”,gcd.result()); state <= 2; endrule endmodule Why do we need the state variable?

February 14, 2007 L04-26http://csg.csail.mit.edu/6.375/ GCD: Test Bench module mkTest (); Reg#(int) state <- mkReg(0); Reg#(Int#(4)) c1 <- mkReg(1); Reg#(Int#(7)) c2 <- mkReg(1); I_GCD gcd <- mkGCD(); rule req (state==0); gcd.start(signExtend(c1), signExtend(c2)); state <= 1; endrule rule resp (state==1); $display (“GCD of %d & %d =%d”, c1, c2, gcd.result()); if (c1==7) begin c1 <= 1; c2 <= c2+1; state <= 0; end else c1 <= c1+1; if (c2 == 63) state <= 2; endrule endmodule Feeds all pairs (c1,c2) 1 < c1 < 7 1 < c2 < 15 to GCD

February 14, 2007 L04-27http://csg.csail.mit.edu/6.375/ GCD: Synthesis results Original (16 bits) Clock Period: 1.6 ns Area: 4240 m 2 Unrolled (16 bits) Clock Period: 1.65ns Area: 5944 m 2 Unrolled takes 31% fewer cycles on the testbench

February 14, 2007 L04-28http://csg.csail.mit.edu/6.375/ Multiplier Example Simple binary multiplication: // d = 4’d9 // r = 4’d5 // d << 0 (since r[0] == 1) // 0 << 1 (since r[1] == 0) // d << 2 (since r[2] == 1) // 0 << 3 (since r[3] == 0) // product (sum of above) = 45 x What does it look like in Bluespec? d r product One step of multiplication

February 14, 2007 L04-29http://csg.csail.mit.edu/6.375/ module mkMult (I_mult); Reg#(Int#(32)) product <- mkReg(0); Reg#(Int#(16)) d <- mkReg(0); Reg#(Int#(16)) r <- mkReg(0); rule cycle endrule method Action start endmethod method Int#(32) result () endmethod endmodule Multiplier in Bluespec What is the interface I_mult ? rule cycle (r != 0); if (r[0] == 1) product <= product + d; d <= d << 1; r > 1; endrule method Action start (Int#(16)x,Int#(16)y) if (r == 0); d <= signExtend(x); r <= y; endmethod method Int#(32) result () if (r == 0); return product; endmethod

February 14, 2007 L04-30http://csg.csail.mit.edu/6.375/ Summary Market forces are demanding a much greater variety of SoCs The design cost for SoCs has to be brought down dramatically by facilitating IP reuse High-level synthesis tools are essential for architectural exploration and IP development Bluespec is both high-level and synthesizable Next time: Combinational Circuits and Simple pipelines