Skip to content

Commit

Permalink
Use new action
Browse files Browse the repository at this point in the history
The GitHub FuseSoC action is revamped and able to run openlane
examples created by us (still needs more generalization).
  • Loading branch information
wallento authored and olofk committed May 15, 2021
1 parent 47fb80a commit 6fcc2f8
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 6 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ jobs:
steps:
- name: Checkout subservient
uses: actions/checkout@v2
- name: Build with Openlane
uses: librecores/ci-fusesoc-action@migrate-dockerized
with:
path: subservient
- run: echo "EDALIZE_LAUNCHER='eda-container-wrapper --split-cwd-tail=1 --non-interactive openlane --'" >> $GITHUB_ENV
- run: pip3 install fusesoc eda-container-wrapper
- run: fusesoc library add serv https://github.com/olofk/serv
- run: fusesoc library add subservient $GITHUB_WORKSPACE/subservient
- run: fusesoc run --target=sky130 subservient
libraries: https://github.com/olofk/serv
core: subservient
target: sky130
tool: openlane

38 changes: 38 additions & 0 deletions openlane_runner.py
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:]))

0 comments on commit 6fcc2f8

Please sign in to comment.