3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2026-04-05 03:09:02 +00:00
yosys/tests/pyosys/test_ecp5_addsub.py
2026-03-30 15:23:27 +01:00

18 lines
653 B
Python

from pathlib import Path
from pyosys import libyosys as ys
__file_dir__ = Path(__file__).absolute().parent
add_sub = __file_dir__.parent / "arch" / "common" / "add_sub.v"
base = ys.Design()
ys.run_pass(f"read_verilog {add_sub}", base)
ys.run_pass("hierarchy -top top", base)
ys.run_pass("proc", base)
ys.run_pass("equiv_opt -assert -map +/ecp5/cells_sim.v synth_ecp5", base)
postopt = ys.Design()
ys.run_pass("design -load postopt", postopt)
ys.run_pass("cd top", postopt)
ys.run_pass("select -assert-min 11 t:LUT4", postopt)
ys.run_pass("select -assert-count 2 t:PFUMX", postopt)
ys.run_pass("select -assert-none t:LUT4 t:PFUMX %% t:* %D", postopt)