Verification
Verification
Objectives:
Almost all the digital ICs are designed and manufactured by semi-custom IC methodologies.
Typically it refers to Hardware Description Language (HDL) based IC design with automatic
synthesis-place and route by Electronic Design Automation (EDA) tools. Semi-custom IC design
methodology has 3 major categories - (i) Standard cell based Application Specific Integrated
Circuit (ASIC) design (ii) Gate arrays and (iii) FPGA. In ASIC design pre-designed library cells
(preferably tested with Design For Manufacturing (DFM) are used but designer has flexibility in
placement of the cells & routing.
This and the following two labs are basic introduction of ASIC design using CADENCE digital
Front End (FE) and Back End (BE) tools. In top-down ASIC design flow, system level
specification is obtained first from which a high-level behavioral abstraction is created. The
behavioral abstraction is then used as a reference to create and refine a synthesizable register
transfer level (RTL) abstraction that captures the desired functionality required by the design
specification. RTL design is simulated extensively for system level validation of the design.
This lab will use CADENCE Incisive Unified Simulator (IUS) environment for RTL design. It will
also give you an example of a Verilog test bench, so that you can test your design and can go more
easily through the other labs and your project.
Place your mux code in the right side of the window which is the design window. Now play the
testbench code on the left side of the window which is the test window. Select EPwave after run
with tick mark.
// instantiate DUT
mux21 dut (
.a (a),
.b (b),
.s (s),
.y (y));
// apply inputs one at a time
initial begin
//sequential block
a = 0; b = 0; s = 0; #10; //apply inputs, wait 10ns
s = 1; #10;
b = 1; s = 0; #10;
s = 1; #10;
end
// Waveform dumping
initial begin
$dumpfile("dump.vcd");
$dumpvars;
end
endmodule
After your run is completed you will see the following wavform. Verify your design here.
// instantiate DUT
mux21 dut (
.a (a),
.b (b),
.s (s),
.y (y));
// apply inputs one at a time
initial begin
//sequential block
Lab 1-3. Flat Testbench with Self Checking ALU in a flat testbench.
OP FUNCTIONALITY OP FUNCTIONALITY
CODE CODE
0 Addition 8 Bitwise Negation
1 Subtraction 9 Bitwise AND
2 Multiplication 10 Bitwise OR
3 Division 11 Bitwise XOR
4 Modulo Division 12 Left Shift
5 Logical AND 13 Right Shift
6 Logical OR 14 Increment
7 Logical Negation 15 Decrement
// Clock generation
initial
forever #5 clk = ~clk;
// Module instantiation
alu DUT( .clk (clk),
.a (a),
.b (b),
.s (s),
.out (out)
);
initial begin
clk = 1'b0;
a = $random;
b = $random;
s = 4'bx;
#30
s = 0;
#10
result_checker(s,a,b,out);
#10
s = 14;
#10
result_checker(s,a,b,out);
#10
s = $random;
#10
result_checker(s,a,b,out);
$finish;
end
// Task : result_checker
// Task : result_checker
task result_checker(input [3:0] s,input [7:0] a,b,input [15:0]resulted_out);
reg [15:0] expected_out;
begin
if(resulted_out == expected_out)
$display("Passed : a=%d, b=%d, s=%d, resulted_out=%d, expected_out=%d",
a,b,s,resulted_out,expected_out);
else
$display("Failed : a=%d, b=%d, s=%d, resulted_out=%d, expected_out=%d",
a,b,s,resulted_out,expected_out);
end
endtask
// Waveform dumping
initial begin
$dumpfile("dump.vcd");
$dumpvars;
end
endmodule
After your run you will get the following output. Check the expected result.
xcelium> run
./testbench.sv:38 $finish;
xcelium> exit
(total: 00:00:01)
./dump.vcd
Done
Lab 1-4. Flat testbench with testvector in a separate testvector file : MUX Example.
testbench3
xmelab: *W,DSEMEL: This SystemVerilog design will be simulated as per IEEE 1800-2009
SystemVerilog simulation semantics. Use -disable_sem2009 option for turning off SV 2009
simulation semantics.
with IEEE1364.
SystemVerilog simulation semantics. Use -disable_sem2009 option for turning off SV 2009
simulation semantics.
xcelium> run
Scope: testbench3
Time: 0 FS + 0
./testbench.sv:47 $finish;
xcelium> exit
(total: 00:00:01)
Done
S0
Out=0
S2 S1
Out=1 Out=0
parameter S0 = 2’b00;
parameter S1 = 2’b01;
parameter S2 = 2’b10;
//state register
always @posedge clk, reset)
if (reset) state <=S0;
else state <=nextstate;
//next state logic
always @ (*)
case (state)
Now write also a state bench code and then follow the procedure described above and simulate
the FSM test bench and verify its functionality.
Report :
1. Provide the circuit diagram and performance curves of both the above circuits
2. Compare in a table the design specifications with the simulated specifications.
3. Discuss about the discrepancy between the design specifications and the simulated
specifications.
4. Now write behavioural verilog code of your assigned project and Verify its functionality
using IUS. After successful debug show the code and the simulation output and explain
your architecture in the report of the assignment.