Why Johnny Can’t Code Preparing Engineers for Billion Gate Designs

Slides:



Advertisements
Similar presentations
Digital System Design-II (CSEB312)
Advertisements

Recap : Always block module and_gate (out, in1, in2); inputin1, in2; outputout; regout; or in2) begin out = in1 & in2; end endmodule zAlways.
FSM and Efficient Synthesizable FSM Design using Verilog
Verilog Fundamentals Shubham Singh Junior Undergrad. Electrical Engineering.
//HDL Example 8-2 // //RTL description of design example (Fig.8-9) module Example_RTL (S,CLK,Clr,E,F,A);
Counters Discussion D8.3.
Traffic light contoller using FSM
1 COMP541 More on State Machines and Video Scanout Montek Singh Feb 13, 2007.
Verilog in transistor level using Microwind
CDA 3100 Recitation Week 11.
Sequential Logic in Verilog
Synchronous Sequential Logic
Multiplication and Division
Table 7.1 Verilog Operators.
COE 405 Design and Synthesis of DataPath Controllers Dr. Aiman H. El-Maleh Computer Engineering Department King Fahd University of Petroleum & Minerals.
ECE 551 Digital System Design & Synthesis Lecture 06 Loops Non-synthesizable Constructs File I/O.
CSE 201 Computer Logic Design * * * * * * * Verilog Modeling
//HDL Example 5-1 // //Description of D latch (See Fig.5-6) module D_latch (Q,D,control); output Q; input.
Verilog. 2 Behavioral Description initial:  is executed once at the beginning. always:  is repeated until the end of simulation.
Give qualifications of instructors: DAP
//HDL Example 6-1 // //Behavioral description of //Universal shift register // Fig. 6-7 and Table 6-3 module shftreg.
How to get a Circuit in verilog converted to hspice, connected to the micron package models, and simulating in hspice and hsimplus.
Registers and Counters. Register Register is built with gates, but has memory. The only type of flip-flop required in this class – the D flip-flop – Has.
Latches and Flip-Flops Discussion D8.1 Section 13-9.
 HDLs – Verilog and Very High Speed Integrated Circuit (VHSIC) HDL  „ Widely used in logic design  „ Describe hardware  „ Document logic functions.
Project 4 A Simple Taximeter Design Yuqi Wang & Suhuai Song.
FSM examples.
Pulse-Width Modulated DAC
OUTLINE Introduction Basics of the Verilog Language Gate-level modeling Data-flow modeling Behavioral modeling Task and function.
ELEN 468 Lecture 81 ELEN 468 Advanced Logic Design Lecture 8 Behavioral Descriptions II.
Ring Counter Discussion 11.3 Example 32.
Arbitrary Waveform Discussion 12.2 Example 34. Recall Divide-by-8 Counter Use q2, q1, q0 as inputs to a combinational circuit to produce an arbitrary.
Counters Discussion 12.1 Example 33. Counters 3-Bit, Divide-by-8 Counter 3-Bit Behavioral Counter in Verilog Modulo-5 Counter An N-Bit Counter.
Prepared by : Indra Tj Assignment V ENGLISH FOR ARCHITECT & CIVIL ENGINEERING I.
A/D Converter Datapaths Discussion D8.4. Analog-to-Digital Converters Converts analog signals to digital signals –8-bit: 0 – 255 –10-bit: 0 – 1023 –12-bit:
COE 202 Introduction to Verilog Computer Engineering Department College of Computer Sciences and Engineering King Fahd University of Petroleum and Minerals.
Registers and Shift Registers Discussion D8.2. D Flip-Flop X 0 Q 0 ~Q 0 D CLK Q ~Q D gets latched to Q on the rising edge of the clock. Positive.
Lessons from last lab: 1.Many had the “# skipping” problem 2.Most assumed there was something wrong with their code 3.How does one check their code? 4.SIMULATE!!
D Flip-Flops in Verilog Discussion 10.3 Example 27.
Verilog Intro: Part 2. Procedural Blocks There are two types of procedural blocks in Verilog. – initial for single-pass behavior : initial blocks execute.
Introduction Verilog is a HARDWARE DESCRIPTION LANGUAGE (HDL) A hardware description language is a language or means used to describe or model a digital.
Traffic Lights Discussion D8.3a. Recall Divide-by-8 Counter Use Q2, Q1, Q0 as inputs to a combinational circuit to produce an arbitrary waveform. s0 0.
Brief Verilog.
Why segregate blocking and non-blocking assignments to separate always blocks? always blocks start when triggered and scan their statements sequentially.
Figure 7.6. Gated SR latch. (a) Circuit Q Q R S R S R Clk Q Q S Time (c) Timing diagram Clk ? ? SR xx Q(t) (no change) 0 1.
1 Arithmetic, ALUs Lecture 9 Digital Design and Computer Architecture Harris & Harris Morgan Kaufmann / Elsevier, 2007.
M.Mohajjel. Objectives Learn How to write synthesizable Verilog code Common mistakes and how to avoid them What is synthesized for what we code Digital.
Lab for Cell-Based IC Design
Student Interviews with Veterans October 22, 2014 and January 21, 2015.
1 University of Jordan Computer Engineering Department CPE 439: Computer Design Lab.
Lottery Speaker: Tsung-Yi Wu.
ASSIGNMENT NO.-2.
AH 101 Innovative Education-- snaptutorial.com
IO 6500 Enthusiastic Study/snaptutorial.com
IO 6600 Enthusiastic Studysnaptutorial.com
ITS 1103 Enthusiastic Study/snaptutorial.com
PSY 405 ArgCompetitive Success/snaptutorial.com
RES 745 Enthusiastic Study/snaptutorial.com
PSY 405 Education for Service/tutorialrank.com
HDL Compiler Unsupport (Do NOT use in your verilog code)
ENGINEERING OF PROCESS STATION
FSM MODELING MOORE FSM MELAY FSM. Introduction to DIGITAL CIRCUITS MODELING & VERIFICATION using VERILOG [Part-2]
Verilog.

© 2006, Mike Murach & Associates, Inc.
Advanced Computer Architecture Lecture 1
Engine Part ID Part 1.
Engine Part ID Part 2.
Engine Part ID Part 2.
Introduction to Digital IC Design
Presentation transcript:

Why Johnny Can’t Code Preparing Engineers for Billion Gate Designs Mike Keating

2x the processes = 2x the complexity Interview Question A D C B 2x the processes = 2x the complexity clk assign D = A && B; always @ (posedge clk) begin C <= D; end always @ (posedge clk) begin C <= A && B; end

Why Code Size Matters Designers inject approx. 1 defect per 10 lines of code Excellent code ships with ~1 defect per KLOC 100M LOC

Typical RTL Code

Unstructured Verilog Code assign … always @(*) … always_ff @ (posedge clk …) …

Unstructured Verilog Code assign … always @(*) … // get packet always_ff @ (posedge clk …) … // send packet It’s like majoring in assembly language programming with emphasis on the “goto” statement

Model of Structured Code function f (); … endfunction task get_packet (); my_var2 <= g (…); endtask task send_packet (); my_var1 <= f (…); always_ff @ (posedge clk …) begin get_packet (); send_packet (); end void bar () { f1 (); } void foo () { bar (); main () { foo (); class bar_class () { …; } class foo_class () { … main () { constructors for classes … module bar_module (); …; endmodule module foo_module (); … top_module (); instantiate modules … Too much code? Acts as “main”

Code Size Counts – DCT Example Verilog 95 Lines of code 1541 Files 9 Sequential processes 6 Assign statements 149 Combinational processes Tasks Functions

Code Size Counts – DCT Example Verilog 95 SystemVerilog Lines of code 1541 280 Files 9 1 Sequential processes 6 Assign statements 149 Combinational processes 2 Tasks 4 Functions 8

Code Size Counts – DCT Example Verilog 95 SystemVerilog Synthesizable C Lines of code 1541 280 263 Files 9 1 Sequential processes 6 Assign statements 149 Combinational processes 2 Tasks 4 Functions 8

Real-time reactive designs (USB, PCI Express) require a more sophisticated form of structured design

Structured Sequential Code - FSMs + { f (state, inputs) } State machine along with a set of combinational functions

Set of Arithmetic Functions High Level Synthesis #include<stdio.h> #include<stdlib.h> int block[8][8]; void dct(){ int y,x,u,v; int reg[8]; /* Horizontal */ for(y=0;y<8;y++){ for(x=0;x<8;x++) reg[x]=0; for(x=0;x<8;x++){ for(u=0;u<8;u++){ v=block[y][x]*c[x][u]; v+=2048; v>>=12; if(s[x][u]) v=-v; reg[u]+=v; } Set of Arithmetic Functions State Machine

Hierarchical State Machines + { f (state, inputs) } Hierarchical State machine along with a set of combinational functions

Hardware Model of Structured Code function f (); … endfunction function g (); always_ff @ (posedge clk …) case (state) IDLE: …; S0: begin if (f(input_x)) doit_x(); if (doit_x_done) state<= S2; end endcase task doit_x(); doit_x_done = 0; case (doit_x_state) S0: … Sn: begin … doit_x_done = 1; doit_x_state = S0; end endcase } Sub_state Machines

USB Example – DMA Processing About 28 pages – too big! Verilog 2k Lines of code 1600 Files 1 Sequential processes 7 Assign statements 30 Combinational processes 10 Tasks Functions State Space 256 Massive Concurrency Impossibly large state space

USB Example – DMA Processing Verilog 2k SystemVerilog Lines of code 1600 1100 Files 1 Sequential processes 7 2 Assign statements 30 Combinational processes 10 Tasks Functions 19 State Space 256 16 1/3 smaller Much Less Concurrency Dramatically smaller state space

Improving RTL Code

What Students Need to Know How to use structure to reduce code size and design complexity SystemVerilog Structs, enumerated types, interfaces Functions, tasks How to measure state space and understand cost of verifying complex designs How to design and code hierarchical state machines to minimize state space

What EDA needs to Do

More Interview Questions No good encapsulation mechanism always @ (posedge clk …) begin W <= ……..; end X <= ……..; Y <= ……..; Z <= ……..; A C E Silly B D Where’s the latch? always @ (*) begin C = A && B; E = C && D; end Silly Does not model hardware (System)Verilog is not a good hardware design language – just better than VHDL or SystemC

Domain Specific Languages

(System)Verilog is NOT Domain Specific for Design wires reg’s (which are not registers) SystemVerilog bit logic Both: whether a variable is a flop, latch or logic gate is determined by how it is used bit_ff bit_comb state_machine reg d; always_comb d = a | b;

Raising Abstraction of Design General Purpose, High Level Modeling Languages C++/SystemC Gap is too big language, methodology, tools Design-specific language for multiple levels of abstraction SystemVerilog General Purpose Simulation Language

It’s All Mission Critical

It’s all about Code Thank You Source: IBS Design Implementation 7/09