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

symbiflow: add toolchain to conda channels #98

Open
wants to merge 1 commit 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
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ env:
- PACKAGE=prjxray
# XXX riscv32 toolchain: disabled as fails to build
# PACKAGE=riscv32/binutils
# symbiflow toolchain
- PACKAGE=symbiflow-toolchain
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

symbiflow-toolchain should just be a metapackage?

- PACKAGE=symbiflow-xc7a50t
# verilog tools
- PACKAGE=icestorm
- PACKAGE=iverilog
Expand Down
19 changes: 19 additions & 0 deletions symbiflow-toolchain/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

set -e
set -x

if [ x"$TRAVIS" = xtrue ]; then
CPU_COUNT=2
fi

wget -qO- https://storage.googleapis.com/symbiflow-arch-defs/artifacts/prod/foss-fpga-tools/symbiflow-arch-defs/continuous/install/15/20200608-212841/symbiflow-arch-defs-install-32defbb3.tar.xz | tar -xJ

BIN_DIR=${PREFIX}/bin
SHARE_DIR=${PREFIX}/share/symbiflow

mkdir -p $SHARE_DIR

cp -r install/share/scripts $SHARE_DIR
cp -r install/share/techmaps $SHARE_DIR
cp -r install/bin/* $BIN_DIR/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is being installed in $BIN_DIR/?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The bash scripts to run VPR and other symbiflow-related stuff.

There is a problem though, that regards some additional python scripts that need to be ported as well (place_constraints.py, io_place.py, etc). These are needed during the flow, but installing them in this way may generate conflicts with the python conda.

The only solution I thought of for now is to extract those scripts and get them into yet another separate repository (e.g. symbiflow-python-library) and install that throug conda pip, and get rid of the python library within the bin folder.

21 changes: 21 additions & 0 deletions symbiflow-toolchain/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{% set version = '%s_%04i_%s'|format(GIT_DESCRIBE_TAG|replace('v','') or '0.X', GIT_DESCRIBE_NUMBER|int, GIT_DESCRIBE_HASH or 'gUNKNOWN') %}

package:
name: symbiflow-toolchain
version: {{ version }}

source:
git_url: https://github.com/SymbiFlow/conda-packages.git
git_rev: master

build:
# number: 201803050325
number: {{ environ.get('DATE_NUM') }}
# string: 20180305_0325
string: {{ environ.get('DATE_STR') }}
script_env:
- CI
- TRAVIS

about:
summary: 'Conda package containing the Symbiflow binary toolchain.'
16 changes: 16 additions & 0 deletions symbiflow-xc7a50t/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

set -e
set -x

if [ x"$TRAVIS" = xtrue ]; then
CPU_COUNT=2
fi

wget -qO- https://storage.googleapis.com/symbiflow-arch-defs/artifacts/prod/foss-fpga-tools/symbiflow-arch-defs/continuous/install/15/20200608-212841/symbiflow-arch-defs-install-32defbb3.tar.xz | tar -xJ
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not extract the tar directly to $SHARE_DIR/arch

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that this requires work from the symbiflow arch defs standpoint. It would be better to have one tarball for each architecture there is, so that we can point to the files we need in each symbiflow-<device> conda package.
Currently the tar needs to be extracted and the xc7a50t device re-packed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should pull the version info from the conda meta.yml


SHARE_DIR=${PREFIX}/share/symbiflow

mkdir -p $SHARE_DIR

cp -r install/share/symbiflow/arch/xc7a50t_test $SHARE_DIR/arch/
21 changes: 21 additions & 0 deletions symbiflow-xc7a50t/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{% set version = '%s_%04i_%s'|format(GIT_DESCRIBE_TAG|replace('v','') or '0.X', GIT_DESCRIBE_NUMBER|int, GIT_DESCRIBE_HASH or 'gUNKNOWN') %}

package:
name: symbiflow-xc7a50t
version: {{ version }}

source:
git_url: https://github.com/SymbiFlow/conda-packages.git
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this URL should probably be symbiflow-arch-defs?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, the only issue is that the version reported in the package (commit has and so) will be different from the tarball version unless we can have the tarball placed in a latest directory in GCS, so that each time the arch-defs HEAD changes, also the tarball does and we get the latest version of the tool.

Currently, there is a huge path to access the tarball from GCS (e.g. https://storage.googleapis.com/symbiflow-arch-defs/artifacts/prod/foss-fpga-tools/symbiflow-arch-defs/presubmit/install/206/20200526-034850/symbiflow-arch-defs-install-97519a47.tar.xz).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The contents should match the version number?

git_rev: master

build:
# number: 201803050325
number: {{ environ.get('DATE_NUM') }}
# string: 20180305_0325
string: {{ environ.get('DATE_STR') }}
script_env:
- CI
- TRAVIS

about:
summary: 'Conda package containing the xc7a50t architecture definition.'