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:
parent
3a58b8d5b5
commit
e13a45ae61
4 changed files with 33 additions and 2 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue