Merge pull request #69 from mithro/conda-support

Adding conda environment and simple travis build
This commit is contained in:
enjoy-digital 2018-03-04 19:50:39 +01:00 committed by GitHub
commit 3e7cc2554b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 101 additions and 1 deletions

51
.travis-build-socs.sh Executable file
View File

@ -0,0 +1,51 @@
#!/usr/bin/env bash
set -e
# Some colors, use it like following;
# echo -e "Hello ${YELLOW}yellow${NC}"
GRAY='\033[0;30m'
GREEN='\033[0;32m'
YELLOW='\033[0;33m'
PURPLE='\033[0;35m'
NC='\033[0m' # No Color
SPACER="echo -e ${GRAY} - ${NC}"
travis_fold start "environment.create"
travis_time_start
echo -e "Setting up basic ${YELLOW}conda environment${NC}"
echo "-------------------------------------------------------------------"
conda env create -f environment.yml
source activate litex
echo "-------------------------------------------------------------------"
travis_time_finish
travis_fold end "environment.create"
$SPACER
SOC_FILES=$(find litex/boards/targets -name \*.py | grep -v sim | grep -v "__")
COUNT=4
for SOC_FILE in $SOC_FILES; do
SOC=$(echo $SOC_FILE | sed -e's/\.py$//' -e's-/-.-g')
TARGET=$(echo $SOC | sed -e's/.*\.//')
travis_fold start "$SOC.1"
travis_time_start
echo -e "Building ${GREEN}${TARGET}${NC} (${PURPLE}${SOC}${NC})"
echo "-------------------------------------------------------------------"
python -m $SOC --no-compile-gateware
echo "-------------------------------------------------------------------"
travis_time_finish
travis_fold end "$SOC.1"
travis_fold start "$SOC.2"
echo -e "Output of building ${GREEN}${TARGET}${NC} (${PURPLE}${SOC}${NC})"
echo "-------------------------------------------------------------------"
find soc_*$TARGET* | sort
echo "-------------------------------------------------------------------"
travis_fold end "$SOC.2"
$SPACER
done

19
.travis.yml Normal file
View File

@ -0,0 +1,19 @@
language: python
python:
- "3.6"
install:
- wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
- hash -r
- conda config --set always_yes yes --set changeps1 no
before_script:
- export -f travis_nanoseconds
- export -f travis_fold
- export -f travis_time_start
- export -f travis_time_finish
script:
- ./.travis-build-socs.sh

17
README
View File

@ -64,6 +64,23 @@ very easily!
Migen documentation can be found here: https://m-labs.hk/migen/manual
[> Medium Quick start guide with Conda
-----------------------------------------
0. Get miniconda by following instructions at https://conda.io/miniconda.html
1. Clone LiteX
git clone --recurse-submodules https://github.com/enjoy-digital/litex.git
2. Create a LiteX environment from environment.yml
conda env create -f environment.yml
3. Enter conda environment
conda activate litex
4. Build the target of your board...:
Go to boards/targets and execute the target you want to build
[> Quick start guide (for advanced users)
-----------------------------------------

13
environment.yml Normal file
View File

@ -0,0 +1,13 @@
name: litex
channels:
- timvideos
dependencies:
- python=3.6
- pip
- binutils-lm32-elf
- gcc-lm32-elf-nostdc
- pip:
- git+https://github.com/m-labs/migen.git#egg=migen
- -e .
- git+https://github.com/enjoy-digital/liteeth.git#egg=liteeth
- git+https://github.com/enjoy-digital/litedram.git#egg=litedram