Formal verification cells¶
Note
Some front-ends may not support the generic $check
cell, in such cases
calling chformal -lower
will convert each $check
cell into it’s
equivalent. See chformal
for more.
- yosys> help $allconst¶
- Properties:
- Simulation model (verilog)¶
2175module \$allconst (Y); 2176 2177 parameter WIDTH = 0; 2178 2179 output [WIDTH-1:0] Y; 2180 2181 assign Y = 'bx; 2182 2183endmodule
- yosys> help $allseq¶
- Properties:
- Simulation model (verilog)¶
2188module \$allseq (Y); 2189 2190 parameter WIDTH = 0; 2191 2192 output [WIDTH-1:0] Y; 2193 2194 assign Y = 'bx; 2195 2196endmodule
- yosys> help $anyconst¶
- Properties:
- Simulation model (verilog)¶
2128module \$anyconst (Y); 2129 2130 parameter WIDTH = 0; 2131 2132 output [WIDTH-1:0] Y; 2133 2134 assign Y = 'bx; 2135 2136endmodule
- yosys> help $anyinit¶
- Simulation model (verilog)¶
2157module \$anyinit (D, Q); 2158 2159 parameter WIDTH = 0; 2160 2161 input [WIDTH-1:0] D; 2162 output reg [WIDTH-1:0] Q; 2163 2164 initial Q <= 'bx; 2165 2166 always @(`SIMLIB_GLOBAL_CLOCK) begin 2167 Q <= D; 2168 end 2169 2170endmodule
- yosys> help $anyseq¶
- Properties:
- Simulation model (verilog)¶
2141module \$anyseq (Y); 2142 2143 parameter WIDTH = 0; 2144 2145 output [WIDTH-1:0] Y; 2146 2147 assign Y = 'bx; 2148 2149endmodule
- yosys> help $assert¶
- Properties:
- Simulation model (verilog)¶
2047module \$assert (A, EN); 2048 2049 input A, EN; 2050 2051 `ifndef SIMLIB_NOCHECKS 2052 always @* begin 2053 if (A !== 1'b1 && EN === 1'b1) begin 2054 $display("Assertion %m failed!"); 2055 $stop; 2056 end 2057 end 2058 `endif 2059 2060endmodule
- yosys> help $assume¶
- Properties:
- Simulation model (verilog)¶
2065module \$assume (A, EN); 2066 2067 input A, EN; 2068 2069 `ifndef SIMLIB_NOCHECKS 2070 always @* begin 2071 if (A !== 1'b1 && EN === 1'b1) begin 2072 $display("Assumption %m failed!"); 2073 $stop; 2074 end 2075 end 2076 `endif 2077 2078endmodule
- yosys> help $cover¶
- Properties:
- Simulation model (verilog)¶
2101module \$cover (A, EN); 2102 2103 input A, EN; 2104 2105endmodule
- yosys> help $equiv¶
- Properties:
- Simulation model (verilog)¶
2201module \$equiv (A, B, Y); 2202 2203 input A, B; 2204 output Y; 2205 2206 assign Y = (A !== 1'bx && A !== B) ? 1'bx : A; 2207 2208 `ifndef SIMLIB_NOCHECKS 2209 always @* begin 2210 if (A !== 1'bx && A !== B) begin 2211 $display("Equivalence failed!"); 2212 $stop; 2213 end 2214 end 2215 `endif 2216 2217endmodule
- yosys> help $fair¶
- Properties:
- Simulation model (verilog)¶
2092module \$fair (A, EN); 2093 2094 input A, EN; 2095 2096endmodule
- yosys> help $ff¶
- Simulation model (verilog)¶
2298module \$ff (D, Q); 2299 2300 parameter WIDTH = 0; 2301 2302 input [WIDTH-1:0] D; 2303 output reg [WIDTH-1:0] Q; 2304 2305 always @(`SIMLIB_GLOBAL_CLOCK) begin 2306 Q <= D; 2307 end 2308 2309endmodule
- yosys> help $initstate¶
- Properties:
- Simulation model (verilog)¶
2110module \$initstate (Y); 2111 2112 output reg Y = 1; 2113 reg [3:0] cnt = 1; 2114 reg trig = 0; 2115 2116 initial trig <= 1; 2117 2118 always @(cnt, trig) begin 2119 Y <= |cnt; 2120 cnt <= cnt + |cnt; 2121 end 2122 2123endmodule
- yosys> help $live¶
- Properties:
- Simulation model (verilog)¶
2083module \$live (A, EN); 2084 2085 input A, EN; 2086 2087endmodule
Formal support cells¶
- yosys> help $future_ff¶
- Simulation model (verilog)¶
3200module \$future_ff (A, Y); 3201 3202 parameter WIDTH = 0; 3203 3204 input [WIDTH-1:0] A; 3205 output [WIDTH-1:0] Y; 3206 3207 assign Y = A; 3208 3209endmodule
- yosys> help $get_tag¶
- Simulation model (verilog)¶
3159module \$get_tag (A, Y); 3160 3161 parameter TAG = ""; 3162 parameter WIDTH = 0; 3163 3164 input [WIDTH-1:0] A; 3165 output [WIDTH-1:0] Y; 3166 3167 assign Y = A; 3168 3169endmodule
- yosys> help $original_tag¶
- Simulation model (verilog)¶
3186module \$original_tag (A, Y); 3187 3188 parameter TAG = ""; 3189 parameter WIDTH = 0; 3190 3191 input [WIDTH-1:0] A; 3192 output [WIDTH-1:0] Y; 3193 3194 assign Y = A; 3195 3196endmodule
- yosys> help $overwrite_tag¶
- Simulation model (verilog)¶
3173module \$overwrite_tag (A, SET, CLR); 3174 3175 parameter TAG = ""; 3176 parameter WIDTH = 0; 3177 3178 input [WIDTH-1:0] A; 3179 input [WIDTH-1:0] SET; 3180 input [WIDTH-1:0] CLR; 3181 3182endmodule
- yosys> help $set_tag¶
- Simulation model (verilog)¶
3143module \$set_tag (A, SET, CLR, Y); 3144 3145 parameter TAG = ""; 3146 parameter WIDTH = 0; 3147 3148 input [WIDTH-1:0] A; 3149 input [WIDTH-1:0] SET; 3150 input [WIDTH-1:0] CLR; 3151 output [WIDTH-1:0] Y; 3152 3153 assign Y = A; 3154 3155endmodule