init uv, use nix for synthesized picorv32
This commit is contained in:
1 parent
9b9e4e8c4c
commit
18070f6537
8 files changed
+82
-3
No files matched your search
+1
-1
@@ -3,5 +3,5 @@
|
||||
url = https://git.vlab.cse.kyutech.ac.jp/stefan/kyupy.git
|
||||
branch = devel
|
||||
[submodule "circuits/picorv32"]
|
||||
path = circuits/picorv32
|
||||
path = picorv32
|
||||
url = git@github.com:s-holst/picorv32.git
|
||||
@@ -0,0 +1 @@
|
||||
3.12
|
||||
Submodule circuits/picorv32 deleted from d438ffd490.
+1
-1
Submodule kyupy updated: f0b55eed27...c4aecbd6c9.
@@ -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()
|
||||
Submodule
+1
Submodule picorv32 added at cf92946d63.
@@ -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
|
||||
];
|
||||
}) {}
|
||||
Reference in new issue
Block a user