0% found this document useful (0 votes)
13 views61 pages

Ece425 L26

The document outlines the RTL to GDS flow in VLSI system design, emphasizing the importance of concurrent design and synthesis, proper documentation, and verification practices. It covers general RTL practices, bad practices, and the use of SystemVerilog for design and verification, including assertions and randomization techniques. Additionally, it discusses synthesis processes, technology libraries, and timing terminology essential for effective VLSI design.

Uploaded by

soumilgupta2
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views61 pages

Ece425 L26

The document outlines the RTL to GDS flow in VLSI system design, emphasizing the importance of concurrent design and synthesis, proper documentation, and verification practices. It covers general RTL practices, bad practices, and the use of SystemVerilog for design and verification, including assertions and randomization techniques. Additionally, it discusses synthesis processes, technology libraries, and timing terminology essential for effective VLSI design.

Uploaded by

soumilgupta2
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 61

Design, Synthesis, Verification

RTL to GDS Flow


ECE 425 – Intro to VLSI System Design

Dong Kai Wang


Department of Electrical and Computer Engineering
University of Illinois at Urbana-Champaign
Overall Flow

ELECTRICAL & COMPUTER ENGINEERING GRAINGER ENGINEERING


General RTL Practices (I)

• Design and Synthesize Concurrently


• Do NOT wait until you’re done w/ RTL design to start synthesis.
• Discover issues early!
• Document your Designs
• /*Comment your code*/
• Label all blocks (e.g., always_comb begin : BlockName … end : BlockName)
• Create block diagrams, module functionality descriptions, specs.
• Isolate Code Blocks for Synthesis and Verification
• Use compiler Macros to isolate non-synthesizable code.
• Bottom-up Approach
• Start with base modules first.

ELECTRICAL & COMPUTER ENGINEERING GRAINGER ENGINEERING


RTL Bad Practices

• What’s wrong here?

Will infer latches!


(cover all conditions)
ELECTRICAL & COMPUTER ENGINEERING GRAINGER ENGINEERING
RTL Bad Practices

• What’s wrong here? (Verilog)

Sensitivity list

ELECTRICAL & COMPUTER ENGINEERING GRAINGER ENGINEERING


General RTL Practices (II)

• Avoid Ambiguity / Unintended Inferences


• Cover all conditions (e.g., case statements should always have default).
• Always statements should specify outputs under all conditions.
• Avoid hi-Z outputs, use multiplexers when possible.
• Design Synchronous Logic
• Avoid unexpected synthesis of latches.
• Avoid asynchronous logic.
• Variable Naming
• Suffix all Module Inputs/Outputs with “_i” and “_o” respectively (e.g., input logic clk_i).
• Prefix all Enum names with “k” (e.g., kopLUI).
• Give meaningful (easy to identify) names to nets, easy to track down in EDA tools.
• Reference Online Material

ELECTRICAL & COMPUTER ENGINEERING GRAINGER ENGINEERING


General Naming Conventions

Adapted from Design Compiler User Guide.

ELECTRICAL & COMPUTER ENGINEERING GRAINGER ENGINEERING


Designing with SystemVerilog

• More complex and powerful than you think!


• Most advanced features used for verification.
• You will likely use a small subset of features.
• Synthesize as you design
• What will each block synthesize to?
• Recommend bottom-up compile strategy.
• Consult the DC user guide.
• Verify as you design Verilog to SystemVerilog feature growth chart.
Adapted from Sutherland and Mills.
• Unit test your modules.
• Document as you design
• Draft a specifications document.

ELECTRICAL & COMPUTER ENGINEERING GRAINGER ENGINEERING


Packages and Macros

• Packages allows different modules to access shared types


• Declare structs and enums in the package.
• Macros are useful to isolate Code Blocks
• Also useful for setting hard constants.
• Parametrize nets and modules where applicable

ELECTRICAL & COMPUTER ENGINEERING GRAINGER ENGINEERING


Packages and Macros

ELECTRICAL & COMPUTER ENGINEERING GRAINGER ENGINEERING


Some Examples

A specifications check on parameters

Printing verbose messages in module

ELECTRICAL & COMPUTER ENGINEERING GRAINGER ENGINEERING


Per-Module Logging Example

ELECTRICAL & COMPUTER ENGINEERING GRAINGER ENGINEERING


Other Useful Features

• Tasks and Functions


• Common / shared subroutines.
• Synthesizable if you avoid things like time delays.
• Classes
• Similar to object-oriented programming.
• Member variables and functions.
• Consult references online.
• Assertions
• Property checking.

ELECTRICAL & COMPUTER ENGINEERING GRAINGER ENGINEERING


Designing for DC: Combinational Paths

• Avoid unnecessary module hierarchy.


• Avoid module-crossing “glue logic” on combinational paths.

Adapted from Design Compiler User Guide.

ELECTRICAL & COMPUTER ENGINEERING GRAINGER ENGINEERING


Designing for DC: Sharing Resources

// A Bad Idea (Why?)


assign Z = CTL ? (A + B) : (C + D);

Adapted from Design Compiler User Guide.

ELECTRICAL & COMPUTER ENGINEERING GRAINGER ENGINEERING


Verification Basics

• Architecture Specifications
• Expected behavior / functionality of design.
• RTL-level Design Verification (DV)
• Checks RTL design against specifications.
• Design engineers vs. verification engineers.
• Verification before synthesis.
• Testbench (TB)
• Assertions (SVA)
• Design under Test (DUT)

ELECTRICAL & COMPUTER ENGINEERING GRAINGER ENGINEERING


Testbench Structure

1. Generate Stimulus (Input Vectors)


• Directed or random tests.
• Catch bugs you expect or didn’t think of.

• Constrained random tests.

2. Apply stimulus to DUT


3. Capture the Response
4. Check for Correctness
▪ Comparison with expected results.
▪ Scoreboard / reference “golden” model.

5. Measure Overall Progress


▪ Functional coverage.

ELECTRICAL & COMPUTER ENGINEERING GRAINGER ENGINEERING


Testbench Structure

1. Generate Stimulus (Input Vectors)


• Directed or random tests.
• Catch bugs you expect or didn’t think of.

• Constrained random tests.

2. Apply stimulus to DUT


3. Capture the Response
4. Check for Correctness
▪ Comparison with expected results.
▪ Scoreboard / reference “golden” model.

5. Measure Overall Progress


▪ Functional coverage.

ELECTRICAL & COMPUTER ENGINEERING GRAINGER ENGINEERING


Useful SystemVerilog Types (I)

• Multidimensional Arrays
• C-style declaration: int array [16][8];
• SV-style declaration: int myarray [15:0][7:0];
• Packed vs unpacked: logic [31:0] myarray [15:0][7:0];
• Printing contents (see example testbench).
• Dynamic Arrays (non-Synthesizable)
• Declare without index range and use the new operator.
• Queues
• Similar to C++ standard library queues, declare with dollar sign: q[$]
• q.insert(); q.delete(); q.pop_front(); q.push_back();

ELECTRICAL & COMPUTER ENGINEERING GRAINGER ENGINEERING


2D Array Example

• This example creates a


4-by-4 array and prints its
contents.

• Output:

ELECTRICAL & COMPUTER ENGINEERING GRAINGER ENGINEERING


Dynamic Array Example

• This example creates a


dynamic array of size 5
and copies its content to
another dynamic array.

• Output:

ELECTRICAL & COMPUTER ENGINEERING GRAINGER ENGINEERING


Useful SystemVerilog Types (II)

• Associative Arrays
• Implements a lookup table (dictionary).
• Good for large arrays range where few elements are accessed.
• Declare using datatype in brackets: int assocarray [int];
• Linked Lists
• Avoid, use queues instead.
• Custom Types
• Declare custom types for your design.
• Example: typedef struct {logic [7:0] r, g, b;} pixel_type;
• pixel_type my_pixel // Declare my_pixel as type pixel_type
• my_pixel.r = 8’b00000000; // Assigning individual member of my_pixel

ELECTRICAL & COMPUTER ENGINEERING GRAINGER ENGINEERING


Useful SystemVerilog Types (III)

• Unions
• Different ways to interpret data (e.g., 32-bit logic could be integer or floating-point).
• Useful when you write data in different formats.
• typedef union { int i, logic [31:0] raw, real f } single_numtype;
• single_numtype my_number;
• my_number.f = 0.0; // Interpret my_number in float format and assign 0;

ELECTRICAL & COMPUTER ENGINEERING GRAINGER ENGINEERING


Union Example

• Union Example.

ELECTRICAL & COMPUTER ENGINEERING GRAINGER ENGINEERING


Routines: Tasks and Functions

• SystemVerilog provides tasks and functions similar in C-style synthax.


• Tasks can have time delays.
• Useful for code reuse, encapsulate common routines in tasks or functions.
• C-style task / function synthax:
• task mytask (input logic [31:0] x, output logic y); … endtask
• Example for resetting the ALU:

ELECTRICAL & COMPUTER ENGINEERING GRAINGER ENGINEERING


General Tips

• You can write verification code directly in design modules.


• Use compiler macros to isolate simulation-only code.
• Use the %m format to print current instance.
• Direct access to local signals.
• Make use of File I/O.
• Reading from files $readmemh.
• Logging files (see example).
• Verify as you design.
• Don’t wait until design is done to start writing your testbench.
• Unit testing is very useful.
• Write individual testbenches for each unit if necessary.

ELECTRICAL & COMPUTER ENGINEERING GRAINGER ENGINEERING


File Logging in Module Example

ELECTRICAL & COMPUTER ENGINEERING GRAINGER ENGINEERING


Input Randomization

• It is best to randomize inputs to your DUT in addition to directed tests.


• e.g., testing a new type of ALU.
• SystemVerilog provides useful features for randomization.
• Which inputs to randomize?
• Device configuration
• Environment configuration
• Input data
• Protocol exceptions
• Errors and violations
• Delays (when uncertain)

ELECTRICAL & COMPUTER ENGINEERING GRAINGER ENGINEERING


SystemVerilog Randomization

• Easiest method: use $random or $urandom to generate a random number.


• my_input = $random(optional_seed)
• Specify a range.
• urandom_range(int unsigned maxval, int unsigned minval = 0);
• To learn more about constraints, distributions, etc. check Canvas resources.

ELECTRICAL & COMPUTER ENGINEERING GRAINGER ENGINEERING


Why Assertions?

• An assertion is a check
against specifications
• Improved Observability
• Check design locally.
• Bugs may not propagate.
• Early Bug Detection
• Write assertions during design.
• Assists Documentation
• Improved Reuse
• Formal Verification

ELECTRICAL & COMPUTER ENGINEERING GRAINGER ENGINEERING


Immediate Assertions

• Think of assert like an if-statement.


• Instead of if-else, we use assert-else.
• Report errors by severity: $warn, $error, $fatal.
• Synthax is simple:
• optional_label: assert (condition) begin {code_if_pass} end
• else begin {code_if_fail} end

ELECTRICAL & COMPUTER ENGINEERING GRAINGER ENGINEERING


Example ALU Circuit

• Check correctness of adder.


• Use an immediate assertion when an add
instruction is encountered.

ELECTRICAL & COMPUTER ENGINEERING GRAINGER ENGINEERING


Immediate Assertions Example

• Example that checks addition result is correct.

ELECTRICAL & COMPUTER ENGINEERING GRAINGER ENGINEERING


Concurrent Assertion

• Immediate assertions can’t express complex properties of design.


• E.g., ALU must output valid output 1 cycle after receiving instruction enable.
• Explicitly declare the expected behavior as a Sequence:
• sequence mySeq; alu_en ##1 valid; endsequence
• Declare a Property that triggers the sequence:
• property myProp; @(posedge clk) instr_en |-> mySeq; endproperty
• Assert the property:
• The property itself isn’t evaluated, needs to be asserted for simulator to check.
• myAssertion: assert property (myProp) $display(“assertion passed at
$stime”); else $error(“assertion failed at …”);

ELECTRICAL & COMPUTER ENGINEERING GRAINGER ENGINEERING


Concurrent Assertion Example

• Concurrent assertion checks


that adder produces a valid
output after a valid (enable)
instruction is seen.

ELECTRICAL & COMPUTER ENGINEERING GRAINGER ENGINEERING


Concurrent Assertion Example

ELECTRICAL & COMPUTER ENGINEERING GRAINGER ENGINEERING


RTL Synthesis

TECH
Design Plan GTECH LIB Gate
High-level diagrams HDL Bool
and schematics NL

Architecture
Functional arch/uarch
description, simulator Synthesis Software
(e.g., Synopsys DC)

Physical Post-Silicon
RTL
Gate Level Implementation Bringup, signal
Structural and
Netlist Floorplan, layout, integrity, functional
behavioral HDL
CTS, PnR validation, perf.

ELECTRICAL & COMPUTER ENGINEERING GRAINGER ENGINEERING


Launching Synopsys DC

• Load the Synopsys module


• module load Synopsys_x86-64/2021
• Launch from your project directory
• Reminder that default initialization scripts are hidden (.synopsys_dc.setup).
• Run: dc_shell or design_vision
• Use script: dc_shell –f my_script.tcl
• Make sure you have X11 forwarding enabled to use GUI.
• Specify libraries
• Target library: library used for technology mapping (NAND gates, NOT gates).
• Symbol library: library used for displaying circuit schematics in DC GUI.
• Link library: library used to reference cells (custom memories, etc.).

ELECTRICAL & COMPUTER ENGINEERING GRAINGER ENGINEERING


Directory Structure

• Bottom-up Synthesis Strategy

Adapted from Design Compiler User Guide

ELECTRICAL & COMPUTER ENGINEERING GRAINGER ENGINEERING


Constraint-driven Synthesis

• Synthesis is constraints-driven.
• You specify design targets via constraints.
• DC performs static timing analysis (STA).
• Checks all timing paths for best/worst-case.

Adapted from Design Compiler User Guide

ELECTRICAL & COMPUTER ENGINEERING GRAINGER ENGINEERING


Synthesis Flow

• What to provide:
• Design files in HDL
• analyze (check synthax)

• elaborate (elaborate to gtech / b. box)

• read_file (analyze + elaborate)


• Technology library
• set_target_library, link, symbol

• Design constraints
• Covered later

• Compile and report:


• compile

• report_area / power / timing Adapted from Design Compiler User Guide

ELECTRICAL & COMPUTER ENGINEERING GRAINGER ENGINEERING


Module Synthesis

Adapted from Design Compiler User Guide

ELECTRICAL & COMPUTER ENGINEERING GRAINGER ENGINEERING


Technology Library

/* --------------- *
* Design : AND2X1 *
* --------------- */
cell (AND2X1) { Cell Name
area : 2.346500; Cell Area
cell_leakage_power : 15.6059;
pin(A) {
direction : input;
capacitance : 0.00229149; Electrical
rise_capacitance : 0.00229149; Characteristics
fall_capacitance : 0.00187144; of Input Pins
}
pin(B) {
direction : input;
capacitance : 0.00234289;
rise_capacitance : 0.00234289;
fall_capacitance : 0.00182664;
}
pin(Y) {
direction : output;
capacitance : 0;
rise_capacitance : 0;
fall_capacitance : 0;
max_capacitance : 0.137429;
Adapted from gscl45nm.lib function : "(A B)"; Pin Y Functionality
ELECTRICAL & COMPUTER ENGINEERING GRAINGER ENGINEERING
DesignWare Library

• DC comes with DesignWare (DW) soft IPs.


• DC can choose from multiple implementation options for operators.
• Will optimize based on your design constraints.

Adapted from Synopsys Website

ELECTRICAL & COMPUTER ENGINEERING GRAINGER ENGINEERING


Timing Terminology

• Clock Period
• 1/F
• Setup and Hold times
• Tsu & Th
• Slack
• Requirement – Arrival Time
• Clock Skew
• Delay from clock propagation
• Transition Time
• Signal transition time (rise / fall)

ELECTRICAL & COMPUTER ENGINEERING GRAINGER ENGINEERING


DC Terminology

• Designs: TOP, REGFILE, ENCODER


• References: ENCODER, REGFILE, INV
• Cells: U1, U2, U3, U4

Adapted from Synopsys Website

ELECTRICAL & COMPUTER ENGINEERING GRAINGER ENGINEERING


DC Terminology

• Designs: TOP, REGFILE, ENCODER


• References: ENCODER, REGFILE, INV
• Cells: U1, U2, U3, U4

Adapted from Synopsys Website

ELECTRICAL & COMPUTER ENGINEERING GRAINGER ENGINEERING


Useful Commands

• get_cells cellname # for example, get_cells *


• get_nets netname
• get_ports portname
• get_clocks clockname # need to create_clock first
• all_inputs # lists all inputs of current design
• all_outputs # lists all outputs of current design

• analyze # basic checks (e.g., SV synthax)


• elaborate # elaborates RTL to generic “black boxes”
• read_file # analyze + elaborate
• current_design # set current design
• check_design # check for issues, e.g., mismatched ports, naming

ELECTRICAL & COMPUTER ENGINEERING GRAINGER ENGINEERING


Specifying Clocks

• Define a Clock.
• Must define clock source, clock period.
• Can also define duty cycle, offset / skew, clock name.
• create_clock -name "CLK" -period 1.000 -waveform { 0.500 1.000 } { clk }
• Use report_clock to see that you have successfully defined a clock.
• Will have separate lecture on multiple clock domains.

Adapted from Synopsys Website

ELECTRICAL & COMPUTER ENGINEERING GRAINGER ENGINEERING


I/O Delays

• Define a Clock. ✓
• Define I/O timing relative to clocks.

Adapted from Synopsys Website

ELECTRICAL & COMPUTER ENGINEERING GRAINGER ENGINEERING


Input Delays

Adapted from Synopsys Website

ELECTRICAL & COMPUTER ENGINEERING GRAINGER ENGINEERING


Input Delays

• Define a Clock. ✓
• Define I/O timing relative to clocks.
• DC calculates time constraints for internal logic.
• Use the set_input_delay command.
• set_input_delay -max 0.2 -clock CLK [get_ports inputA]

Adapted from Synopsys Website

ELECTRICAL & COMPUTER ENGINEERING GRAINGER ENGINEERING


Input Delays

Adapted from Synopsys Website

ELECTRICAL & COMPUTER ENGINEERING GRAINGER ENGINEERING


Output Delays

Adapted from Synopsys Website

ELECTRICAL & COMPUTER ENGINEERING GRAINGER ENGINEERING


Output Delays

• Define a Clock. ✓
• Define I/O timing relative to clocks. ✓
• set_output_delay -max 0.3 -clock CLK [get_ports outputY]

Adapted from Synopsys Website

• Compile: compile -area_effort medium -map_effort medium

ELECTRICAL & COMPUTER ENGINEERING GRAINGER ENGINEERING


More Useful Commands

• report_port –verbose # reports all constraints on all in/output


• report_clock # reports all clock attributes
• reset_design # resets all attributes and constraints
• report_timing # each path is timed twice! rise and fall

• set_clock_uncertainty 0.X clockname # set clock skew (post CTS)


• set_max_transition 0.X port # set signal transition time (slew)
• report_constraint -all_violators

• set_fix_hold clockname # fix hold violations


• list_lib # list libraries currently in DC memory
• report_lib libname # report attributes of library

ELECTRICAL & COMPUTER ENGINEERING GRAINGER ENGINEERING


Timing Report

Adapted from Synopsys Website

ELECTRICAL & COMPUTER ENGINEERING GRAINGER ENGINEERING


Design Vision

• Timing -> Path Slack.

ELECTRICAL & COMPUTER ENGINEERING GRAINGER ENGINEERING


Environment Attributes

• Set operating conditions.


• list_lib
• report_lib libname
• set_operating_conditions –max conditionname
Operating Conditions:

Operating Condition Name : typical


Library : gscl45nm
Process : 1.00
Temperature : 27.00
Voltage : 1.10

ELECTRICAL & COMPUTER ENGINEERING GRAINGER ENGINEERING


Timing Optimization Strategies

• Architectural / Micro-architectural
• E.g., more pipeline stages.
• RTL-level
• See lecture on RTL design for synthesis.
• Resource sharing.
• Operator ordering.
• Flatten design.
• Remove unnecessary glue logic.
• Compile Effort
• Incremental (Bottom-up) Strategy
• Compile + set_dont_touch
• Can individually succeed! Adapted from Synopsys Website

ELECTRICAL & COMPUTER ENGINEERING GRAINGER ENGINEERING

You might also like