summaryrefslogtreecommitdiff
path: root/tests/various/muxcover.ys
blob: 7ac460f13e1591b4ecf9e451fdfbfbb194d73774 (plain)
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
read_verilog -formal <<EOT
    module gate (input [2:0] A, B, C, D, X, output reg [2:0] Y);
        always @*
            (* parallel_case *)
            casez (X)
                3'b??1: Y = A;
                3'b?1?: Y = B;
                3'b1??: Y = C;
                3'b000: Y = D;
            endcase
    endmodule
EOT


## Examle usage for "pmuxtree" and "muxcover"

proc
pmuxtree
techmap
muxcover -mux4

splitnets -ports
clean
# show


## Equivalence checking

read_verilog -formal <<EOT
    module gold (input [2:0] A, B, C, D, X, output reg [2:0] Y);
        always @*
            casez (X)
                3'b001: Y = A;
                3'b010: Y = B;
                3'b100: Y = C;
                3'b000: Y = D;
		default: Y = 'bx;
            endcase
    endmodule
EOT

proc
splitnets -ports
techmap -map +/simcells.v t:$_MUX4_

equiv_make gold gate equiv
hierarchy -top equiv
equiv_simple -undef
equiv_status -assert