Docsity

Logic Simulation - Functional Verification - Lecture Slides, Slides of Computer Science

Partial preview of the text

Download Logic Simulation - Functional Verification - Lecture Slides and more Slides Computer Science in PDF only on Docsity!

Logic Simulation :

Languages, Algorithms, Simulators

Docsity.com

Outline

 Hardware Design Languages

 Modeling Levels - A Taxonomy of HDL Constructs

 General Purpose HDL Simulators - Event-Driven Sim

 Improving Simulator Performance

 Synchronous Design Methodology and Cycle-Based Sim

 Let's Design a Cycle-Based Simulator

Docsity.com

Modeling Levels - Highest Level : Interface

 Let's look at the common constructs we use to specify the

functionality of a piece of hardware:

Model

inputs outputs

t

input behavior over time

output behavior over time

Docsity.com

Modeling Levels - Major Dimensions (I)

 Temporal Dimension:

 continous (analog)  gate delay (psec?)  clock cycle  instruction cycle  events

 Data Abstraction:

 continuous (analog)  bit : multiple values  bit : binary  abstract value  composite value ("struct")

discrete time

discrete value

Docsity.com

Modeling Levels - Major Dimensions (III)

Continuous Gate Delay Clock Cycle Instruction Cycle Events

Continuous Multivalue Bit^ Bit^ abstract value^ "struct"

Continous Switch Level Boolean Logic Algorithmic Abstract Mathematical

Single Black Box Functional Blocks

Detailed Component Hierarchy

Temporal

Data

Functional

Structural

Docsity.com

Coverage of Modeling Levels - Verilog

Continuous Gate Delay Clock Cycle Instruction Cycle Events

Continuous Multivalue Bit^ Bit^ abstract value^ "struct"

Continous Switch Level Boolean Logic Algorithmic Abstract Mathematical

Single Black Box Functional Blocks

Detailed Component Hierarchy

Temporal

Data

Functional

Structural

Docsity.com

In HDL Terms

 VHDL, Verilog were both defined as simulation languages

 Big emphasis on the structural refinement

 VHDL: entity/architecture/component/port/signal
 Verilog: module/instance/port/signal/reg

 Specification of function

 General: programming language constructs

 VHDL : user-defined data type, package, procedure, function, sequential code
 Verilog: function, task, sequential code

 Parallelism:

 VHDL : process, signal update, wait
 Verilog: "always" block, fork/join, wait, event construct

 Special purpose H/W constructs

 VHDL : concurrent assignment, delayed assignment, signal, Boolean logic
 Verilog : continuous assignment, 4-value Boolean logic, switch-level support

Docsity.com

General HDL Simulators

 Before we can look at architectures of simulators we need

to understand the execution model that the HDLs imply:

 VHDL's execution model is defined in detail in the IEEE

LRM (Language Reference Manual)

 Verilog's execution model is defined by Cadence's

Verilog-XL simulator ("reference implementation")

Event-Driven Execution

Docsity.com

A more hardware-oriented example

s(0) <= a(0) xor b(0) after 2ns; c(0) <= a(0) and b(0) after 1ns;

s(1) <= a(1) xor b(1) xor c(0) after 2ns; c(1) <= (a(1) and b(1)) or (b(1) and c(0)) or (c(0) and a(1)) after 1ns;

sum_out(1 to 0) <= s(1 to 0); carry_out <= c(1);

and

a

b

and

xor

s(0)

c(0)

xor xor =>

s(1)

sum_out(1)

and

and or

or

=>

=>

sum_out(0)

carry_out

Docsity.com

A more hardware-oriented example

s(0) <= a(0) xor b(0) after 2ns; c(0) <= a(0) and b(0) after 1ns;

s(1) <= a(1) xor b(1) xor c(0) after 2ns; c(1) <= (a(1) and b(1)) or (b(1) and c(0)) or (c(0) and a(1)) after 1ns;

sum_out(1 to 0) <= s(1 to 0); carry_out <= c(1);

and

a

b

and

xor

s(0)

c(0)

xor xor =>

s(1)

sum_out(1)

and

and or

or

=>

=>

sum_out(0)

carry_out

Let's simulate: a= b= Time = 0ns (step1)

Red Boxes : evaluate in current step

1

1

1

0

Docsity.com

A more hardware-oriented example

s(0) <= a(0) xor b(0) after 2ns; c(0) <= a(0) and b(0) after 1ns;

s(1) <= a(1) xor b(1) xor c(0) after 2ns; c(1) <= (a(1) and b(1)) or (b(1) and c(0)) or (c(0) and a(1)) after 1ns;

sum_out(1 to 0) <= s(1 to 0); carry_out <= c(1);

and

a

b

and

xor

s(0)

c(0)

xor xor =>

s(1)

sum_out(1)

and

and or

or

=>

=>

sum_out(0)

carry_out

Let's simulate:

a= b= Time = 0ns (step3)

1

1

1

0 1 1

Docsity.com

A more hardware-oriented example

s(0) <= a(0) xor b(0) after 2ns; c(0) <= a(0) and b(0) after 1ns;

s(1) <= a(1) xor b(1) xor c(0) after 2ns; c(1) <= (a(1) and b(1)) or (b(1) and c(0)) or (c(0) and a(1)) after 1ns;

sum_out(1 to 0) <= s(1 to 0); carry_out <= c(1);

and

a

b

and

xor

s(0)

c(0)

xor xor =>

s(1)

sum_out(1)

and

and or

or

=>

=>

sum_out(0)

carry_out

Let's simulate:

a= b= Time = 0ns (step4)

1

1

1

0 1 1 1

Docsity.com

A more hardware-oriented example

s(0) <= a(0) xor b(0) after 2ns; c(0) <= a(0) and b(0) after 1ns;

s(1) <= a(1) xor b(1) xor c(0) after 2ns; c(1) <= (a(1) and b(1)) or (b(1) and c(0)) or (c(0) and a(1)) after 1ns;

sum_out(1 to 0) <= s(1 to 0); carry_out <= c(1);

and

a

b

and

xor

s(0)

c(0)

xor xor =>

s(1)

sum_out(1)

and

and or

or

=>

=>

sum_out(0)

carry_out

Let's simulate:

a= b= Time = 1ns (step2)

1

1

1

0 1 0 1

1

1

1

1

1

Docsity.com

A more hardware-oriented example

s(0) <= a(0) xor b(0) after 2ns; c(0) <= a(0) and b(0) after 1ns;

s(1) <= a(1) xor b(1) xor c(0) after 2ns; c(1) <= (a(1) and b(1)) or (b(1) and c(0)) or (c(0) and a(1)) after 1ns;

sum_out(1 to 0) <= s(1 to 0); carry_out <= c(1);

and

a

b

and

xor

s(0)

c(0)

xor xor =>

s(1)

sum_out(1)

and

and or

or

=>

=>

sum_out(0)

carry_out

Let's simulate:

a= b= Time = 1ns (step3)

1

1

1

0 1 0 0

1

1

1

1

1

1

Docsity.com