circt: init at 1.43.0

This commit is contained in:
xinyangli 2024-03-12 19:10:16 +08:00
parent 8142717e71
commit 683227eed8
No known key found for this signature in database
3 changed files with 77 additions and 4 deletions

View file

@ -15,7 +15,8 @@ with pkgs;
lib = import ./lib { inherit pkgs; }; # functions
modules = import ./modules; # NixOS modules
overlays = import ./overlays; # nixpkgs overlays
circt143 = callPackage ./pkgs/circt { circtVersion = "v143"; };
nvboard = callPackage ./pkgs/nvboard { };
ieda = callPackage ./pkgs/ieda { };
abstract-machine = callPackage ./pkgs/abstract-machine { };

View file

@ -2,11 +2,11 @@
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1704161960,
"narHash": "sha256-QGua89Pmq+FBAro8NriTuoO/wNaUtugt29/qqA8zeeM=",
"lastModified": 1710222005,
"narHash": "sha256-irXySffHz7b82dZIme6peyAu+8tTJr1zyxcfUPhqUrg=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "63143ac2c9186be6d9da6035fa22620018c85932",
"rev": "9a9a7552431c4f1a3b2eee9398641babf7c30d0e",
"type": "github"
},
"original": {

72
pkgs/circt/default.nix Normal file
View file

@ -0,0 +1,72 @@
{ stdenv
, lib
, fetchFromGitHub
, cmake
, coreutils
, ninja
, git
, circtVersion
, python3
}:
let
pythonEnv = python3.withPackages (ps: [ ps.psutil ]);
versionHash = {
v143 = "sha256-RkjigboswLkLgLkgOGahQLIygCkC3Q9rbVw3LqIzREY=";
};
in
stdenv.mkDerivation rec {
pname = "circt";
version = circtVersion;
src = fetchFromGitHub {
owner = "llvm";
repo = "circt";
rev = "firtool-${version}";
sha256 = versionHash.${circtVersion};
fetchSubmodules = true;
};
requiredSystemFeatures = [ "big-parallel" ];
nativeBuildInputs = [
cmake
ninja
git
pythonEnv
];
cmakeDir = "../llvm/llvm";
cmakeFlags = [
"-DLLVM_ENABLE_BINDINGS=OFF"
"-DLLVM_ENABLE_OCAMLDOC=OFF"
"-DLLVM_BUILD_EXAMPLES=OFF"
"-DLLVM_OPTIMIZED_TABLEGEN=ON"
"-DLLVM_ENABLE_PROJECTS=mlir"
"-DLLVM_EXTERNAL_PROJECTS=circt"
"-DLLVM_EXTERNAL_CIRCT_SOURCE_DIR=.."
"-DCIRCT_LLHD_SIM_ENABLED=OFF"
];
LIT_FILTER_OUT = if stdenv.cc.isClang then "CIRCT :: Target/ExportSystemC/.*\.mlir" else null;
preConfigure = ''
find ./test -name '*.mlir' -exec sed -i 's|/usr/bin/env|${coreutils}/bin/env|g' {} \;
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin
mv bin/{{fir,hls}tool,circt-{as,dis,lsp-server,opt,reduce,translate}} $out/bin
runHook postInstall
'';
doCheck = true;
checkTarget = "check-circt check-circt-integration";
meta = {
description = "Circuit IR compilers and tools";
homepage = "https://circt.org/";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ sharzy ];
platforms = lib.platforms.all;
};
}