-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The GitHub FuseSoC action is revamped and able to run openlane examples created by us (still needs more generalization).
- Loading branch information
Showing
2 changed files
with
45 additions
and
6 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
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,38 @@ | ||
#!/usr/bin/python3 | ||
|
||
#This script is a launcher script for Edalize | ||
#Normally Edalize will launch the EDA tools directly, but if the | ||
#EDALIZE_LAUNCHER environmnet variable is set and points to an executable file, | ||
#this file will be called with the command-line that Edalize would otherwise | ||
#have launched. | ||
# | ||
#This allows us to define a custom launcher, as in this case where we intercept | ||
#the call to flow.tcl (the entry point to the openlane flow) and start up a | ||
#container. If Edalize wants to execute other applications, we just start them | ||
#the normal way | ||
|
||
import os | ||
import subprocess | ||
import sys | ||
|
||
def enverr(e): | ||
print(f"Error: Openlane backend needs environment variable '{e}' to be set") | ||
exit(1) | ||
|
||
if 'flow.tcl' in sys.argv[1]: | ||
pdk_root = os.environ.get('PDK_ROOT') or enverr('PDK_ROOT') | ||
(build_root, work) = os.path.split(os.getcwd()) | ||
|
||
image = "efabless/openlane:v0.12" | ||
|
||
prefix = ["docker", "run", | ||
"-v", f"{pdk_root}:{pdk_root}", | ||
"-v", f"{build_root}:/project", | ||
"-e", f"PDK_ROOT={pdk_root}", | ||
"-u", f"{os.getuid()}:{os.getgid()}", | ||
"-w", f"/project/{work}", | ||
image] | ||
sys.exit(subprocess.call(prefix+sys.argv[1:])) | ||
else: | ||
sys.exit(subprocess.call(sys.argv[1:])) | ||
|