You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
685 B
24 lines
685 B
#!/usr/bin/env -S uv run |
|
|
|
from pathlib import Path |
|
from kyupy import verilog |
|
from kyupy.techlib import SKY130 |
|
|
|
def path_for(circuit: str): |
|
import subprocess |
|
return Path(subprocess.check_output( |
|
["nix", "build", "--print-out-paths", "--no-link", |
|
f"github:s-holst/benchmark-circuits#{circuit}" ], |
|
text=True, |
|
).strip()) |
|
|
|
def verilog_nl_path_for(circuit: str): |
|
return next(path_for(circuit).glob("*/nl/*.nl.v")) |
|
|
|
def main(): |
|
c = verilog.load(verilog_nl_path_for("picorv32-sky130"), tlib=SKY130) |
|
c.resolve_tlib_cells(SKY130) |
|
for kind, count in sorted(c.stats.items()): print(f'{kind:10s} {count}') |
|
|
|
if __name__ == "__main__": |
|
main()
|
|
|