文档介绍:ASICs...THE COURSE (1 WEEK)
SIMULATION 13
Key terms and concepts: Engineers used to prototype systems to check designs •
Breadboarding is feasible for systems constructed from a few TTL parts • It is impractical for an
ASIC • Instead engineers turn to simulation
Types of Simulation
Key terms and concepts: simulation modes (high-level to low-level simulation–high-level is
more abstract, low-level more detailed): Behavioral simulation • Functional simulation • Static
timing analysis • Gate-level simulation • Switch-level simulation • Transistor-level or circuit-level
simulation
parator/MUX Example
Key terms and concepts: using input vectors to test or exercise a behavioral model • simu-
lation can only prove a design does not work; it cannot prove that hardware will work
// //1
p_mux(a, b, outp); input [2:0] a, b; output [2:0] outp; //2
function [2:0] compare; input [2:0] ina, inb; //3
begin if (ina <= inb) compare = ina; pare = inb; end //4
endfunction //5
assign outp = compare(a, b); //6
endmodule //7
// //1
p_mux_testbench; //2
integer i, j; //3
reg [2:0] x, y, smaller; wire [2:0] z; //4
always @(x) $display("t x y actual calculated"); //5
initial $monitor("%4g",$time,,x,,y,,z,,,,,,,smaller); //6
initial $dumpvars; initial #1000 $finish; //7
initial //8
1
2 SECTION 13 SIMULATION ASICS... THE COURSE
begin //9
for (i = 0; i <= 7; i = i + 1) //10
begin //11
for (j = 0; j <= 7; j = j + 1) //12
begin //13
x = i; y = j; smaller = (x <= y) ? x : y; //14
#1 if (z != smaller) $display("error"); //15
end //16
end //17
end //18
comp_mux v_1 (x, y, z); //19
endmodule //20
Structural Simulation
Key terms and concepts: logic synthesis produces a structural model from a behavioral model •
reference model • derived model • vector-based simulation (or dynamic simulation)
`timescale 1ns / 10ps // //1
p_mux_o (a, b, outp); //2
input [2:0] a; input [2:0] b; //3
output [2:0]