yosys/tests/various/abstract.ys

41 lines
476 B
Plaintext
Raw Normal View History

2025-01-30 10:26:23 -06:00
read_verilog <<EOT
module half_clock (CLK, Q);
input CLK;
output reg Q;
reg magic;
always @(posedge CLK)
Q <= ~Q;
endmodule
EOT
proc
2025-01-30 10:52:55 -06:00
# dump
2025-01-30 10:26:23 -06:00
abstract -state -enablen magic
2025-01-30 10:52:55 -06:00
check
# dump
design -reset
read_verilog <<EOT
module half_clock_en (CLK, E, Q);
input CLK;
input E;
output reg Q;
reg magic;
always @(posedge CLK)
if (E)
Q <= ~Q;
endmodule
EOT
proc
opt_expr
opt_dff
2025-01-30 10:26:23 -06:00
# show
2025-01-30 10:52:55 -06:00
# dump
abstract -state -enablen magic
check
# opt_clean
# show