3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-24 01:25:33 +00:00

Added $equiv cell type

This commit is contained in:
Clifford Wolf 2015-01-19 11:55:05 +01:00
parent 3a58b8d5b5
commit e13a45ae61
4 changed files with 33 additions and 2 deletions

View file

@ -1160,12 +1160,34 @@ module \$assert (A, EN);
input A, EN;
`ifndef SIMLIB_NOCHECKS
always @* begin
if (A !== 1'b1 && EN === 1'b1) begin
$display("Assertation failed!");
$finish;
$stop;
end
end
`endif
endmodule
// --------------------------------------------------------
module \$equiv (A, B, Y);
input A, B;
output Y;
assign Y = (A !== 1'bx && A !== B) ? 1'bx : A;
`ifndef SIMLIB_NOCHECKS
always @* begin
if (A !== 1'bx && A !== B) begin
$display("Equivalence failed!");
$stop;
end
end
`endif
endmodule