8 changed files with 82 additions and 3 deletions
@ -1 +1 @@ |
|||||||
Subproject commit f0b55eed271941db16687dbc625a18ef2e96f25d |
Subproject commit c4aecbd6c94e86a18a3a7faab14789e84af61280 |
||||||
@ -0,0 +1,24 @@ |
|||||||
|
#!/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() |
||||||
@ -0,0 +1,16 @@ |
|||||||
|
[project] |
||||||
|
name = "infield" |
||||||
|
version = "0.1.0" |
||||||
|
description = "Add your description here" |
||||||
|
requires-python = ">=3.12,<3.14" |
||||||
|
dependencies = [ |
||||||
|
"kyupy", |
||||||
|
] |
||||||
|
|
||||||
|
[tool.uv.workspace] |
||||||
|
members = [ |
||||||
|
"kyupy", |
||||||
|
] |
||||||
|
|
||||||
|
[tool.uv.sources] |
||||||
|
kyupy = { workspace = true, editable = true } |
||||||
@ -0,0 +1,38 @@ |
|||||||
|
# |
||||||
|
# This file defines a development shell containing: |
||||||
|
# - hardware synthesis and simulation tools |
||||||
|
# - riscv32 cross-compiling toolchain |
||||||
|
# |
||||||
|
# Enable this shell by calling 'nix-shell' in the same directory as this file. |
||||||
|
# |
||||||
|
|
||||||
|
let |
||||||
|
nixpkgs = fetchTarball "https://github.com/NixOS/nixpkgs/tarball/release-25.11"; |
||||||
|
pkgs = (import nixpkgs {}).pkgsCross.riscv32-embedded; |
||||||
|
in |
||||||
|
|
||||||
|
# callPackage is needed due to https://github.com/NixOS/nixpkgs/pull/126844 |
||||||
|
pkgs.pkgsStatic.callPackage ({ pkgs }: pkgs.mkShell { |
||||||
|
|
||||||
|
# these tools run on the build platform, but are configured to target the host platform |
||||||
|
nativeBuildInputs = with pkgs; [ pkg-config file ]; |
||||||
|
|
||||||
|
# libraries needed for the host platform |
||||||
|
buildInputs = with pkgs; [ zlib ]; |
||||||
|
|
||||||
|
# tools running on build platform and target the build platform |
||||||
|
depsBuildBuild = with pkgs; [ |
||||||
|
python3 |
||||||
|
gcc |
||||||
|
yosys |
||||||
|
sby |
||||||
|
nextpnr |
||||||
|
arachne-pnr |
||||||
|
icestorm |
||||||
|
z3 |
||||||
|
boolector |
||||||
|
yices |
||||||
|
iverilog |
||||||
|
verilator |
||||||
|
]; |
||||||
|
}) {} |
||||||
Loading…
Reference in new issue