-
Notifications
You must be signed in to change notification settings - Fork 35
/
Test_mult.v
62 lines (52 loc) · 1.53 KB
/
Test_mult.v
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
`timescale 1ns / 1ps
////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 13:36:55 06/27/2013
// Design Name: qmult
// Module Name: I:/Projects/xilinx/FPInterface/Tester/Tran3005/Test_mult.v
// Project Name: Trancendental
// Target Device:
// Tool versions:
// Description:
//
// Verilog Test Fixture created by ISE for module: qmult
//
// Dependencies:
//
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
//
////////////////////////////////////////////////////////////////////////////////
module Test_mult;
// Inputs
reg [31:0] i_multiplicand;
reg [31:0] i_multiplier;
// Outputs
wire [31:0] o_result;
wire ovr;
// Instantiate the Unit Under Test (UUT)
qmult #(19,32) uut (
.i_multiplicand(i_multiplicand),
.i_multiplier(i_multiplier),
.o_result(o_result),
.ovr(ovr)
);
initial begin
$monitor ("%b,%b,%b,%b", i_multiplicand, i_multiplier, o_result, ovr); // Monitor the stuff we care about
// Initialize Inputs
i_multiplicand = 32'b00000000000110010010000111111011; //pi = 3.141592
i_multiplicand[31] = 0; // i_multiplicand sign
i_multiplier[31] = 0; // i_multiplier sign
i_multiplier[30:0] = 0;
// Wait 100 ns for global reset to finish
#100;
#100 i_multiplier[0] = 1; // 1.91E-6
end
// Add stimulus here
always begin
#10 i_multiplier[30:0] = (i_multiplier[30:0] << 1) + 1; // Why not??
end
endmodule