Skip to content

Commit

Permalink
[build system] use circt#main, chisel#sequencer/t1
Browse files Browse the repository at this point in the history
- circt is not released yet for DPI, use main branch instead.
- merge chipsalliance/chisel#4205 and chipsalliance/chisel#4205 in my
  chisel branch for T1.
  • Loading branch information
sequencer committed Jul 5, 2024
1 parent 81907a5 commit 1982489
Show file tree
Hide file tree
Showing 5 changed files with 96 additions and 10 deletions.
22 changes: 21 additions & 1 deletion nix/overlay.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,27 @@ rec {

# Override "nixpkgs" circt with "nixpkgs-for-circt".
# To update the "nixpkgs-for-circt" input, run `nix flake lock --update-input nixpkgs-for-circt`.
circt = self.inputs.nixpkgs-for-circt.legacyPackages."${final.system}".circt;
circt = self.inputs.nixpkgs-for-circt.legacyPackages."${final.system}".circt.overrideAttrs (old: rec {
version = "nightly";
src = final.fetchFromGitHub {
owner = "llvm";
repo = "circt";
rev = "1f6c29fb6465877d86c65d9ac2c6eeaa8f1e9044";
sha256 = "sha256-1tfClDKtVAp8j0+Aku5+2QTriqmsr3sjIReg7ekKZx0=";
fetchSubmodules = true;
};
preConfigure = ''
find ./test -name '*.mlir' -exec sed -i 's|/usr/bin/env|${final.coreutils}/bin/env|g' {} \;
substituteInPlace cmake/modules/GenVersionFile.cmake --replace "unknown git version" "nightly"
'';
patches = [
(final.fetchpatch {
url = "https://patch-diff.githubusercontent.com/raw/llvm/circt/pull/7210.diff";
sha256 = "sha256-eAWIcBgn+TDfZN/mi2IdoKNa9j6In864lTu88rFv2/o=";
})
./pkgs/revert-llvm-bump.patch
];
});
espresso = final.callPackage ./pkgs/espresso.nix { };
dramsim3 = final.callPackage ./pkgs/dramsim3.nix { };
libspike = final.callPackage ./pkgs/libspike.nix { };
Expand Down
66 changes: 66 additions & 0 deletions nix/pkgs/revert-llvm-bump.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
commit 0c621a4d56d10a12d54a4a163611ec1ddfb354b0
Author: Jiuyang Liu <[email protected]>
Date: Thu Jun 20 01:49:37 2024 +0800

Revert "Bump llvm (#7167)"

This reverts commit f32a5a196cda8fcd11fbd95f2347d6ece31facb0.

diff --git a/lib/Conversion/HandshakeToDC/HandshakeToDC.cpp b/lib/Conversion/HandshakeToDC/HandshakeToDC.cpp
index cbc0171eb..8cd287872 100644
--- a/lib/Conversion/HandshakeToDC/HandshakeToDC.cpp
+++ b/lib/Conversion/HandshakeToDC/HandshakeToDC.cpp
@@ -605,7 +605,7 @@ public:
TypeConverter::SignatureConversion result(moduleRegion.getNumArguments());
(void)getTypeConverter()->convertSignatureArgs(
TypeRange(moduleRegion.getArgumentTypes()), result);
- rewriter.applySignatureConversion(hwModule.getBodyBlock(), result);
+ rewriter.applySignatureConversion(&moduleRegion, result);
}

rewriter.eraseOp(op);
diff --git a/lib/Conversion/LLHDToLLVM/LLHDToLLVM.cpp b/lib/Conversion/LLHDToLLVM/LLHDToLLVM.cpp
index 8d88faa44..ee85c1b77 100644
--- a/lib/Conversion/LLHDToLLVM/LLHDToLLVM.cpp
+++ b/lib/Conversion/LLHDToLLVM/LLHDToLLVM.cpp
@@ -623,7 +623,7 @@ struct EntityOpConversion : public ConvertToLLVMPattern {
std::array<Type, 3>({voidPtrTy, voidPtrTy, voidPtrTy}));
for (size_t i = 0, e = entityOp.getNumArguments(); i < e; ++i)
intermediate.addInputs(i, voidTy);
- rewriter.applySignatureConversion(entityOp.getBodyBlock(), intermediate,
+ rewriter.applySignatureConversion(&entityOp.getBody(), intermediate,
typeConverter);

OpBuilder bodyBuilder =
@@ -646,7 +646,7 @@ struct EntityOpConversion : public ConvertToLLVMPattern {
final.remapInput(i + 3, gep.getResult());
}

- rewriter.applySignatureConversion(entityOp.getBodyBlock(), final,
+ rewriter.applySignatureConversion(&entityOp.getBody(), final,
typeConverter);

// Get the converted entity signature.
@@ -718,7 +718,7 @@ struct ProcOpConversion : public ConvertToLLVMPattern {
intermediate.addInputs(procArgTys);
for (size_t i = 0, e = procOp.getNumArguments(); i < e; ++i)
intermediate.addInputs(i, voidTy);
- rewriter.applySignatureConversion(&procOp.getBlocks().front(), intermediate,
+ rewriter.applySignatureConversion(&procOp.getBody(), intermediate,
typeConverter);

// Get the final signature conversion.
diff --git a/lib/Dialect/HW/ConversionPatterns.cpp b/lib/Dialect/HW/ConversionPatterns.cpp
index 7f1452de0..3e1fecbbc 100644
--- a/lib/Dialect/HW/ConversionPatterns.cpp
+++ b/lib/Dialect/HW/ConversionPatterns.cpp
@@ -85,8 +85,7 @@ LogicalResult circt::doTypeConversion(Operation *op, ValueRange operands,
newRegion->getArgumentTypes(), result)))
return rewriter.notifyMatchFailure(op->getLoc(),
"type conversion failed");
- if (failed(rewriter.convertRegionTypes(newRegion, *typeConverter, &result)))
- return failure();
+ rewriter.applySignatureConversion(newRegion, result, typeConverter);
}
rewriter.finalizeOpModification(newOp);

8 changes: 4 additions & 4 deletions nix/t1/_sources/generated.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
},
"chisel": {
"cargoLocks": null,
"date": "2024-06-20",
"date": "2024-07-04",
"extract": null,
"name": "chisel",
"passthru": null,
Expand All @@ -73,11 +73,11 @@
"name": null,
"owner": "chipsalliance",
"repo": "chisel",
"rev": "0baa8fdf9b3688236d81797f5105bed45e06bdb5",
"sha256": "sha256-EQnlT4aB5XPa+fDTosVEHMjC/MhcC3I7cnfv0Ixzcx8=",
"rev": "b5fdc91dd2ec53afbb5c626835d8799baeffc4eb",
"sha256": "sha256-5McfF4y0Yrd32oelGYITAtcUjz+ddnubs2rCaa0iyTI=",
"type": "github"
},
"version": "0baa8fdf9b3688236d81797f5105bed45e06bdb5"
"version": "b5fdc91dd2ec53afbb5c626835d8799baeffc4eb"
},
"chisel-interface": {
"cargoLocks": null,
Expand Down
8 changes: 4 additions & 4 deletions nix/t1/_sources/generated.nix
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@
};
chisel = {
pname = "chisel";
version = "0baa8fdf9b3688236d81797f5105bed45e06bdb5";
version = "b5fdc91dd2ec53afbb5c626835d8799baeffc4eb";
src = fetchFromGitHub {
owner = "chipsalliance";
repo = "chisel";
rev = "0baa8fdf9b3688236d81797f5105bed45e06bdb5";
rev = "b5fdc91dd2ec53afbb5c626835d8799baeffc4eb";
fetchSubmodules = false;
sha256 = "sha256-EQnlT4aB5XPa+fDTosVEHMjC/MhcC3I7cnfv0Ixzcx8=";
sha256 = "sha256-5McfF4y0Yrd32oelGYITAtcUjz+ddnubs2rCaa0iyTI=";
};
date = "2024-06-20";
date = "2024-07-04";
};
chisel-interface = {
pname = "chisel-interface";
Expand Down
2 changes: 1 addition & 1 deletion nix/t1/nvfetcher.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ fetch.github = "chipsalliance/rocket-chip-inclusive-cache"

[chisel]
src.git = "https://github.com/chipsalliance/chisel"
src.branch = "main"
src.branch = "sequencer/t1"
fetch.github = "chipsalliance/chisel"

[chisel-interface]
Expand Down

0 comments on commit 1982489

Please sign in to comment.