File size: 1,383 Bytes
9667105
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
63
64
65
66
67
68
69
70
read_verilog <<EOT
module final_auto_wide(
	input [31:0] a, b, c, d,
	output [31:0] y
);
	assign y = a + b + c + d;
endmodule
EOT
hierarchy -auto-top
proc
equiv_opt -assert arith_tree -final auto
design -load postopt
select -assert-count 1 t:$add
select -assert-count 2 t:$fa
select -assert-none t:$_AND_
select -assert-none 1 t:$_XOR_
design -reset

read_verilog <<EOT
module final_auto_narrow(
	input [7:0] a, b, c, d,
	output [7:0] y
);
	assign y = a + b + c + d;
endmodule
EOT
hierarchy -auto-top
proc
equiv_opt -assert arith_tree -final auto
design -load postopt
select -assert-count 1 t:$add
select -assert-count 2 t:$fa
select -assert-count 0 t:$add a:adder_arch %i
select -assert-none t:$_AND_ t:$_OR_ %u
design -reset

read_verilog <<EOT
module final_ripple(
	input [31:0] a, b, c, d,
	output [31:0] y
);
	assign y = a + b + c + d;
endmodule
EOT
hierarchy -auto-top
proc
equiv_opt -assert arith_tree
design -load postopt
select -assert-count 1 t:$add
select -assert-count 0 t:$add a:adder_arch %i
select -assert-none t:$_AND_ t:$_OR_ %u
design -reset

read_verilog <<EOT
module final_prefix_narrow(
	input [7:0] a, b, c, d,
	output [7:0] y
);
	assign y = a + b + c + d;
endmodule
EOT
hierarchy -auto-top
proc
equiv_opt -assert arith_tree -final prefix
design -load postopt
select -assert-none t:$add
select -assert-min 1 t:$_AND_
select -assert-min 1 t:$_XOR_
design -reset