-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdiv_pipe.v
50 lines (39 loc) · 1.18 KB
/
div_pipe.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
// synopsys translate_off
`include "/afs/eos.ncsu.edu/dist/synopsys2013/syn/dw/sim_ver/DW_fp_div.v" //link to designware module for Floating Point Divider
//synopsys translate_on
module div_pipe( inst_a, inst_b, z6, overflow, clock );
parameter sig_width = 23;
parameter exp_width = 8;
parameter ieee_compliance = 0;
input [sig_width+exp_width : 0] inst_a;
input [sig_width+exp_width : 0] inst_b;
input clock;
output [sig_width+exp_width : 0] z6;
output overflow;
wire [sig_width+exp_width : 0] z_inst;
reg [sig_width+exp_width : 0] z2;
reg [sig_width+exp_width : 0] z1;
reg [sig_width+exp_width : 0] z3;
reg [sig_width+exp_width : 0] z4;
reg [sig_width+exp_width : 0] z5;
reg [sig_width+exp_width : 0] z6;
//wire [7 : 0] status_inst;
wire [7:0] status_inst0;
reg overflow;
always@(posedge clock)
begin
z1 <= z_inst;
z2 <= z1;
z3 <= z2;
z4 <= z3;
z5 <= z4;
z6 <= z5;
//status_inst0 <= status_inst;
if(inst_b ==32'h0)
overflow <= 1'b1;
else
overflow <= 1'b0;
end
// Instance of DW_fp_div
DW_fp_div #(sig_width, exp_width, ieee_compliance) U1 ( .a(inst_a), .b(inst_b), .rnd(3'b0), .z(z_inst), .status(status_inst0) );
endmodule