DOC PREVIEW
Berkeley COMPSCI 150 - Lecture 10 – Logic Synthesis

This preview shows page 1-2 out of 5 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 5 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 5 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 5 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

1Spring 2003 EECS150 – Lec8-synthesisPage 1EECS150 - Digital DesignLecture 10 – Logic SynthesisFebruary 13, 2003John WawrzynekSpring 2003 EECS150 – Lec8-synthesisPage 2Logic Synthesis • Verilog and VHDL started out as simulation languages, but quickly people wrote programs to automatically convert Verilog code into low-level circuit descriptions (netlists).• Synthesis converts Verilog (or other HDL) descriptions to implementation technology specific primitives:– For FPGAs: LUTs, flip-flops, and RAM blocks– For ASICs: standard cell gate and flip-flop libraries, and memory blocks.SynthesisToolVerilogHDLcircuitnetlistSpring 2003 EECS150 – Lec8-synthesisPage 3Why Logic Synthesis?1. Automatically manages many details of the design process:⇒ Fewer bugs⇒ Improved productivity2. Abstracts the design data (HDL description) from any particular implementation technology.– Designs can be re-synthesized targeting different chip technologies. Ex: first implement in FPGA then later in ASIC.3. In some cases, leads to a more optimal design than could be achieved by manual means (ex: logic optimization)Why Not Logic Synthesis?1. May lead to non-optimal designs in some cases.Spring 2003 EECS150 – Lec8-synthesisPage 4How does it work?• A variety of general and ad-hoc (special case) methods:– Instantiation: maintains a library of primitive modules (AND, OR, etc.) and user defined modules.– “macro expansion” / substitution: a large set of language operators (+, -, Boolean operators, etc.) and constructs (if-else, case) expand into special circuits.– Inference: special patterns are detected in the language description and treated specially (ex: inferring memory blocks from variable declaration and read/write statements, FSM detection and generation from “always @ (posedge clk)” blocks).– Logic optimization: Boolean operations are grouped and optimized with logic minimization techniques.– Structural reorganization: advanced techniques including sharing of operators, and retiming of circuits (moving FFs), and others?2Spring 2003 EECS150 – Lec8-synthesisPage 5Simple Examplemodule foo (a,b,s0,s1,f);input [3:0] a;input [3:0] b;input s0,s1;output [3:0] f;reg f;always @ (a or b or s0 or s1)if (‘s0 && s1 || s0) f=a; else f=b;endmodule• Should expand if-else into 4-bit wide multiplexor and optimize the control logic:abs0s1f10Spring 2003 EECS150 – Lec8-synthesisPage 6Module Templatemodule <top_module_name>(<port list>);/* Port declarations. followed by wire, reg, integer, task and function declarations *//* Describe hardware with one or more continuous assignments, always blocks, module instantiations and gate instantiations */// Continuous assignmentwire <result_signal_name>;assign <result_signal_name> = <expression>;// always blockalways @(<event expression>)begin// Procedural assignments// if statements// case, casex, and casez statements// while, repeat and for loops// user task and user function callsend// Module instantiation<module_name> <instance_name> (<port list>);// Instantiation of built-in gate primitivegate_type_keyword (<port list>);endmodule• The order of these statements is irrelevant, all execute concurrently.• The statements between the beginand end in an always block execute sequentially from top to bottom. (However, beware of blocking versus non-blocking assignment)• Statements within a fork-join statement in an always block execute concurrently.Synthesis tools expects to find modules in this format.Spring 2003 EECS150 – Lec8-synthesisPage 7Procedural Assignments• Verilog has two types of assignments within always blocks:• Blocking procedural assignment “=“– The RHS is executed and the assignment is completed before the next statement is executed. Example:Assume A holds the value 1 … A=2; B=A; A is left with 2, B with 2.• Non-blocking procedural assignment “<=“– The RHS is executed and assignment takes place at the end of the current time step (not clock cycle). Example:Assume A holds the value 1 … A<=2; B<=A; A is left with 2, B with 1.• The notion of the “current time step” is tricky in synthesis, so to guarantee that your simulation matches the behavior of the synthesized circuit, follow these rules:i. Use blocking assignments to model combinational logic within an always block.ii. Use non-blocking assignments to implement sequential logic.iii. Do not mix blocking and non-blocking assignments in the same always block.iv. Do not make assignments to the same variable from more than one always block.Spring 2003 EECS150 – Lec8-synthesisPage 8Supported Verilog Constructs–Net types: wire, tri, supply1, supply0; register types: reg, integer, time (64 bit reg); arrays of reg.– Continuous assignments.– Gate primitive and module instantiations.–always blocks, user tasks, user functions.– inputs, outputs, and inouts to a module.– All operators (+, -, *, /, %, <, >, <=, >=, ==, !=, ===, !==, &&, ||, !, ~, &, ~&, |, ~|, ^~, ~^, ^, <<, >>, ?:, { }, {{ }}) [Note: / and % are supported for compile-time constants and constant powers of 2.]– Procedural statements: if-else-if, case,casex, casez, for, repeat, while, forever, begin, end, fork, join.– Procedural assignments: blocking assignments =, nonblockingassignments <= (Note: <= cannot be mixed with = for the same register).– Compiler directives: `define, `ifdef, `else, `endif, `include, `undef– Miscellaneous:• Integer ranges and parameter ranges.• Local declarations to begin-end block.• Variable indexing of bit vectors on the left and right sides of assignments.3Spring 2003 EECS150 – Lec8-synthesisPage 9Unsupported Language Constructs•Net types:trireg, wor, trior, wand,triand, tri0, tri1, and charge strength; • register type: real.• Built-in unidirectional and bidirectionalswitches, and pull-up, pull-down.• Procedural statements: assign (different from the “continuous assignment”), deassign, wait.• Named events and event triggers.• UDPs (user defined primitives) and specify blocks.•force, release, and hierarchical net names (for simulation only).• delay, delay control, and drive strength.• scalared, vectored.• initial block.• Compiler directives (except for `define, `ifdef, `else, `endif, `include, and `undef, which are supported).• Calls to system tasks and system functions (they are only for simulation).Generate error and halt synthesis Simply ignoredSpring 2003 EECS150 – Lec8-synthesisPage


View Full Document

Berkeley COMPSCI 150 - Lecture 10 – Logic Synthesis

Documents in this Course
Lab 2

Lab 2

9 pages

Debugging

Debugging

28 pages

Lab 1

Lab 1

15 pages

Memory

Memory

13 pages

Lecture 7

Lecture 7

11 pages

SPDIF

SPDIF

18 pages

Memory

Memory

27 pages

Exam III

Exam III

15 pages

Quiz

Quiz

6 pages

Problem

Problem

3 pages

Memory

Memory

26 pages

Lab 1

Lab 1

9 pages

Memory

Memory

5 pages

Load more
Download Lecture 10 – Logic Synthesis
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lecture 10 – Logic Synthesis and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lecture 10 – Logic Synthesis 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?