Skip to content

Commit

Permalink
Merge pull request #48 from The-OpenROAD-Project/staging
Browse files Browse the repository at this point in the history
Merge staging to master
  • Loading branch information
rovinski committed Apr 11, 2020
2 parents c89bf32 + d2865b7 commit 229a1f4
Show file tree
Hide file tree
Showing 103 changed files with 15,959 additions and 1,420 deletions.
56 changes: 54 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,54 @@
tools/
.*/
# Build working directories
/tools/

# Test working directories
flow/results
flow/logs
flow/reports
flow/objects

# Tar archives
flow/*tar.gz
flow/runme.sh
flow/vars.sh
flow/vars.tcl
flow/versions.txt

# Common temp files
flow/pt_shell_command.log
flow/command.log
flow/default.svf
flow/rc_model.bin
flow/*.tif.gz
flow/*.def.v

# yosys temps
flow/_tmp_yosys-abc-*
flow/*_pdn.def
flow/*.plt
flow/run.param
flow/dummy.guide
flow/macrocell.list

# utdBox router temps
flow/layer_*.mps
flow/*.did
flow/*.log
flow/*.met

# FlexRoute
flow/*.opennet

# Platforms
flow/platforms/*
!flow/platforms/nangate45
# network
.nfs*

# core dumps
core
core.*

# git
**/.git
**/.gitignore
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,6 @@ flow/private/*
# network
.nfs*


# core dumps
core
core.*
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ FROM centos:centos7 AS base-dependencies
LABEL maintainer="Abdelrahman Hosny <abdelrahman_hosny@brown.edu>"

RUN yum group install -y "Development Tools" && \
yum update -y && yum install -y libffi-devel python3 tcl-devel which && \
yum localinstall https://www.klayout.org/downloads/CentOS_7/klayout-0.26.3-0.x86_64.rpm -y
yum update -y && yum install -y libffi-devel python3 tcl-devel which time && \
yum localinstall https://www.klayout.org/downloads/CentOS_7/klayout-0.26.4-0.x86_64.rpm -y

WORKDIR /OpenROAD-flow
RUN mkdir -p /OpenROAD-flow
Expand Down
9 changes: 6 additions & 3 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ pipeline {

stages {
stage('Build') {
environment {
OPENROAD_FLOW_NO_GIT_INIT = 1
}
steps {
sh label: 'Build', script: './build_openroad.sh'
}
Expand All @@ -15,7 +18,7 @@ pipeline {
steps {
catchError {
sh label: 'nangate45_gcd', script: '''
docker run -u $(id -u ${USER}):$(id -g ${USER}) openroad/flow bash -c "source setup_env.sh && cd flow && test/test_helper.sh gcd nangate45"'''
docker run --rm -u $(id -u ${USER}):$(id -g ${USER}) openroad/flow bash -c "source setup_env.sh && cd flow && test/test_helper.sh gcd nangate45"'''
}
echo currentBuild.result
}
Expand All @@ -24,7 +27,7 @@ pipeline {
steps {
catchError {
sh label: 'nangate45_aes', script: '''
docker run -u $(id -u ${USER}):$(id -g ${USER}) openroad/flow bash -c "source setup_env.sh && cd flow && test/test_helper.sh aes nangate45"'''
docker run --rm -u $(id -u ${USER}):$(id -g ${USER}) openroad/flow bash -c "source setup_env.sh && cd flow && test/test_helper.sh aes nangate45"'''
}
echo currentBuild.result
}
Expand All @@ -33,7 +36,7 @@ pipeline {
steps {
catchError {
sh label: 'nangate45_tinyRocket', script: '''
docker run -u $(id -u ${USER}):$(id -g ${USER}) openroad/flow bash -c "source setup_env.sh && cd flow && test/test_helper.sh tinyRocket nangate45"'''
docker run --rm -u $(id -u ${USER}):$(id -g ${USER}) openroad/flow bash -c "source setup_env.sh && cd flow && test/test_helper.sh tinyRocket nangate45"'''
}
echo currentBuild.result
}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ the docker build.
```
3. Start an interactive shell in a docker container using your user credentials
```
docker run -u $(id -u ${USER}):$(id -g ${USER}) openroad/flow bash
docker run -it -u $(id -u ${USER}):$(id -g ${USER}) openroad/flow bash
```

### Option 3: Building the tools locally
Expand Down
85 changes: 81 additions & 4 deletions build_openroad.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,101 @@
# Exit on first error
set -e

function usage() {
echo "Usage: $0 [-h|--help] [-l|--latest] [-o|--local] [--or_branch] [--tr_branch]"
echo " -h, --help print this help message"
echo " -l, --latest build using the head of branch 'openroad' for OpenROAD"
echo " and TritonRoute"
echo " -o, --local force local build instead of docker build"
echo " --or_branch BRANCH build using the head of branch BRANCH for OpenROAD"
echo " --tr_branch BRANCH build using the head of branch BRANCH for TritonRoute"

echo "This script builds the openroad tools (OpenROAD, yosys, TritonRoute)"
echo "By default, the tools will be built from the linked submodule hashes"
echo "Using -b or -l will By default, the tools will be built from the linked submodule hashes"
}

# Parse arguments
while (( "$#" )); do
case "$1" in
-h|--help)
usage 2> /dev/null
exit
;;
--or_branch)
OR_BRANCH=$2
shift 2
;;
--tr_branch)
TR_BRANCH=$2
shift 2
;;
-l|--latest)
OR_BRANCH="openroad"
TR_BRANCH="openroad"
shift
break
;;
-o|--local)
BUILD_METHOD="LOCAL"
shift
break
;;
-n|--no_init)
NO_INIT=1
shift
break
;;
-*|--*=) # unsupported flags
echo "[ERROR][FLOW-1000] Unsupported flag $1" >&2
exit 1
;;
*) # preserve positional arguments
PARAMS="$PARAMS $1"
shift
;;
esac
done

# Choose install method
if which docker &> /dev/null; then
echo "INFO: using docker build method. This will create a docker image tagged 'openroad/flow'"
if [ -z ${BUILD_METHOD+x} ] && which docker &> /dev/null; then
echo "[INFO][FLOW-0000] using docker build method. This will create a docker image tagged 'openroad/flow'"
build_method="DOCKER"
else
echo "INFO: using local build method. This will create binaries at tools/build/"
echo "[INFO][FLOW-0000] using local build method. This will create binaries at tools/build/"
build_method="LOCAL"
fi

# Clone repositories
git submodule update --init --recursive
if [ -z ${OPENROAD_FLOW_NO_GIT_INIT+x} ]; then
git submodule update --init --recursive
fi

if [ ! -z ${OR_BRANCH+x} ]; then
(cd tools/OpenROAD && git checkout ${OR_BRANCH} && git pull && git submodule update --init --recursive)
fi
if [ ! -z ${TR_BRANCH+x} ]; then
(cd tools/TritonRoute && git checkout ${TR_BRANCH} && git pull)
fi

if [ -d flow/platforms/gf14 ]; then
if [ -d tools/TritonRoute14 ]; then
git -C tools/TritonRoute14 pull || true
else
git -C tools clone git@github.com:The-OpenROAD-Project/TritonRoute14.git || true
fi
fi

# Docker build
if [ "$build_method" == "DOCKER" ]; then
docker build -t openroad/yosys -f tools/yosys/Dockerfile tools/yosys
docker build -t openroad/tritonroute -f tools/TritonRoute/Dockerfile tools/TritonRoute
docker build -t openroad -f tools/OpenROAD/Dockerfile tools/OpenROAD
docker build -t openroad/flow -f Dockerfile .
if [ -d flow/platforms/gf14 ]; then
docker build -t openroad/tritonroute14 -f tools/TritonRoute14/Dockerfile tools/TritonRoute14
docker build -t openroad/flow14 -f jenkins/docker/14.Dockerfile .
fi

# Local build
elif [ "$build_method" == "LOCAL" ]; then
Expand Down
Loading

0 comments on commit 229a1f4

Please sign in to comment.