Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add nix flake with correct versions #6

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/flakehub-publish-rolling.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: "Publish every Git push to master to FlakeHub"
on:
push:
branches:
- "master"
jobs:
flakehub-publish:
runs-on: "ubuntu-latest"
permissions:
id-token: "write"
contents: "read"
steps:
- uses: "actions/checkout@v3"
- uses: "DeterminateSystems/nix-installer-action@main"
- uses: "DeterminateSystems/flakehub-push@main"
with:
name: "zebreus/ahaHLS"
rolling: true
visibility: "public"
30 changes: 22 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,36 @@

## Project Structure

* [src/](src/) - The source code for scheduling and verilog generation
* [test/scheduling.cpp](test/scheduling.cpp) - Unit tests of the HLS tool
* [test/ll_files/](test/ll_files/) - Example programs that are synthesized in unit tests
- [src/](src/) - The source code for scheduling and verilog generation
- [test/scheduling.cpp](test/scheduling.cpp) - Unit tests of the HLS tool
- [test/ll_files/](test/ll_files/) - Example programs that are synthesized in unit tests

# Dependencies:

* LLVM and clang
* Z3 SMT solver
* Icarus Verilog (to run the unit tests of generated verilog)
- LLVM and clang
- Z3 SMT solver
- Icarus Verilog (to run the unit tests of generated verilog)

# Run ahaHLS

You can simply run ahaHLS without installing it using the nix package manager:

```bash
nix run github:zebreus/ahaHLS
```

# Build and Test Instructions

With the nix package manager you can open a shell with all the dependencies on the correct versions:

```bash
nix develop .
```

Once the dependencies are installed do:

```bash
cmake .
make -j
./all-tests
```
./all-tests
```
49 changes: 49 additions & 0 deletions default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
stdenv,
lib,
fetchFromGitHub,
makeWrapper,
cmake,
llvmPackages_7,
verilog,
z3,
}:

stdenv.mkDerivation {
pname = "ahaHLS";
version = "0.1.0";

src = ./.;

enableParallelBuilding = true;

nativeBuildInputs = [
cmake
makeWrapper
];

buildInputs = [
z3
llvmPackages_7.llvm
llvmPackages_7.clang
verilog
];

installPhase = ''
install -Dm 755 aha-HLS $out/bin/ahaHLS
wrapProgram $out/bin/ahaHLS --prefix PATH ":" ${
lib.makeBinPath [
z3
llvmPackages_7.llvm
llvmPackages_7.clang
verilog
]
}
'';

meta = with stdenv.lib; {
description = "Basic High Level Synthesis System Using LLVM";
homepage = "https://github.com/dillonhuff/ahaHLS/";
license = licenses.mit;
};
}
43 changes: 43 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
description = "A Basic High Level Synthesis System Using LLVM";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-20.03";
flake-utils.url = "github:numtide/flake-utils";
};

outputs =
{
self,
nixpkgs,
flake-utils,
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs { inherit system; };
in
{
name = "ahaHLS";
packages.default = pkgs.callPackage ./default.nix { };
}
);
}
Loading