-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert Yosys fork into Yosys plugin plus other cleanup (#4)
* Add old churchroad content * Lots of deleting and moving * Update workflow * Cut down Dockerfile * Fix command * Run workflow on GitHub runners * Move lakeroad-egglog files to top level * Fix test script; dump README * Rename project * Fix breakages after egglog updates * Add files * Build Yosys in Dockerfile * Add ARG * Build Yosys plugin * Fix path * Run plugin tests * Update Yosys * Delete file * Remove Yosys dependency; move test * Update PATH * Add readme * Make `lit` binary * Point to llvm-config * Try to enable caching with cargo build * Change how format check works * Title * Fix fmt.sh * Install lit via pip * Undo use of cargo chef for now Going to see if just ADDing files more intelligently clears up caching issue. * Add .dockerignore * Add files more intelligently * Take into account the weird behavior of ADD * Fix weird issue with trying to run " bash" binary * Expect a CHURCHROAD_DIR env var to be set * Load plugin in tests * Add yosys files to test files * Add env template * ignore file * Fix * Improve testing of the Yosys plugin Specifically, add an overridable YOSYS environment variable. * Add YOSYS env var to .env.template * Fix test * Whoops, wasn't FileChecking * Add TODO * Fix command * Delete comments * Fix command * Newline * Delete .gitmodules * ADD all files in the end, plus git dir, for fmt reasons * Format .cfg file * Format * Status instead of diff, shows more info for debug * ignore file * Remove other .gitignore * Update actions * Rename and reword workflow file * Update .env.template with documentation
- Loading branch information
1 parent
0138888
commit cc0070f
Showing
20 changed files
with
2,303 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
*.dep | ||
*.zo | ||
|
||
.vscode/* | ||
.lit_test_times.txt | ||
**/Output | ||
|
||
**/.DS_Store | ||
**/.lit_test_times.txt | ||
**/Output/ | ||
**/__pycache__ | ||
|
||
target | ||
Cargo.lock | ||
.env | ||
|
||
**/*.so* | ||
**/*.d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
# User should set these variables. | ||
# | ||
# Optional environment variables which you opt not to set should be | ||
# deleted/commented out. | ||
# | ||
# OPTIONAL: Path to llvm-config binary. Only needed if LLVM's `llvm-config` and | ||
# `FileCheck` binaries are not in the PATH. | ||
export LLVM_CONFIG="/path/to/llvm-config" | ||
# OPTIONAL: Path to Yosys binary. Only needed if the `yosys` binary is not | ||
# available on your path, or if you want to use a specific version of Yosys. | ||
export YOSYS="/path/to/yosys" | ||
|
||
|
||
# Do not modify below this line. | ||
SCRIPTPATH="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" | ||
export CHURCHROAD_DIR=$SCRIPTPATH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,7 @@ | |
|
||
target | ||
Cargo.lock | ||
.env | ||
|
||
**/*.so* | ||
**/*.d |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,15 @@ | ||
# Churchroad | ||
|
||
:letsgo3: | ||
|
||
## Yosys Plugin | ||
|
||
[`./yosys-plugin/](./yosys-plugin/) | ||
|
||
We provide a Yosys plugin, | ||
which can output Churchroad IR | ||
from Yosys. | ||
Please see the README | ||
in that directory | ||
for information on building | ||
and using the plugin. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/sh | ||
# This script exports a number of variables that help to pin the versions of | ||
# various Churchroad dependencies. | ||
# | ||
# To use, source this script before running relevant commands e.g. in a | ||
# Dockerfile. | ||
# | ||
# This is just one possible way to implement dependency tracking. Some of the | ||
# other options are: | ||
# - No tracking at all. E.g. in the Dockerfile, we could clone Yosys at a | ||
# specific commit, using a "magic constant" commit hash. This isn't ideal, | ||
# because if we use Yosys elsewhere (e.g. in the evaluation) we have to make | ||
# sure we keep the commit hashes in sync. | ||
# - Git submodules. This is very similar to what we've chosen to do, but it's | ||
# more directly supported by Git. However, it's a bit overkill to add a full | ||
# repository as a submodule when we only need the resulting binary. | ||
# | ||
# This option is essentially a lighter-weight version of submodules. We track | ||
# the commit hashes of the dependencies we need, but nothing additional is | ||
# cloned on a `git clone --recursive`. | ||
|
||
export YOSYS_COMMIT_HASH="f8d4d7128cf72456cc03b0738a8651ac5dbe52e1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
black==24.2.0 | ||
lit==15.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,6 @@ | |
|
||
set -e | ||
|
||
cargo test | ||
cargo test | ||
|
||
./yosys-plugin/run_tests.sh |
Submodule yosys
deleted from
316e2b
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
churchroad.so: churchroad.cc | ||
$(CXX) $(shell yosys-config --cxxflags --ldflags) -shared -o $@ churchroad.cc -lboost_filesystem | ||
|
||
clean: | ||
rm -rfv *.d *.o churchroad.so* | ||
|
||
-include *.d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Churchroad Backend Plugin for Yosys | ||
|
||
We provide a plugin | ||
for Yosys | ||
which produces Churchroad code. | ||
|
||
## Note on Building | ||
|
||
Yosys plugins are simply shared libraries | ||
that can be loaded into Yosys at runtime. | ||
As a result, | ||
you are required to build | ||
a Yosys plugin using the same | ||
build environment | ||
as your `yosys` binary. | ||
The easiest way to ensure this | ||
is to simply build Yosys | ||
from source. | ||
If you prefer to use | ||
a prebuilt Yosys binary, | ||
Yosys provides a Docker image | ||
which sets up the appropriate | ||
environment: | ||
<https://github.com/YosysHQ-GmbH/tabby-cad-plugin-build> | ||
We don't yet support | ||
using this option easily. | ||
If you would like this feature, | ||
please open an issue. | ||
Until then, all plugin users should build Yosys | ||
from source. |
Oops, something went wrong.