Skip to content

Commit

Permalink
Merge pull request #69 from mithro/update-tools
Browse files Browse the repository at this point in the history
scripts: Move the GCC toolchain to 8.2.0
  • Loading branch information
mithro committed Sep 30, 2018
2 parents 7b3a3cf + e5f57ca commit 3fb4e7c
Show file tree
Hide file tree
Showing 17 changed files with 104 additions and 40 deletions.
29 changes: 27 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ jobs:
- env: C=lm32 P=neso T="base"
- env: C=lm32 P=basys3 T="base"
- env: C=lm32 P=cmod_a7 T="base"
- env: C=vexriscv.lite P=tinyfpga_bx F=stub T="base"
- env: C=picorv32 P=tinyfpga_bx F=stub T="base"

include:
#--------------------------------------------
Expand Down Expand Up @@ -128,6 +130,29 @@ jobs:
- stage: Targets
env: C=or1k P=pipistrello T="base"

# vexriscv Base targets
- stage: Targets
env: C=vexriscv P=arty T="base net"

- stage: Targets
env: C=vexriscv P=mimasv2 T="base"

- stage: Targets
env: C=vexriscv P=opsis T="base net"

# picorv32 Base targets
- stage: Targets
env: C=picorv32 P=arty T="base net"

- stage: Targets
env: C=picorv32 P=mimasv2 T="base"

- stage: Targets
env: C=picorv32 P=opsis T="base net"

- stage: Targets
env: C=picorv32 P=tinyfpga_bx F=stub T="base"

# Linux Targets
#--------------------------------------------
- stage: Targets
Expand All @@ -151,8 +176,8 @@ jobs:
#- stage: Targets
# env: C=lm32 P=netv2 T="video"

- stage: Targets
env: C=lm32 P=nexys_video T="video"
#- stage: Targets
# env: C=lm32 P=nexys_video T="video"

- stage: Targets
env: C=lm32 P=opsis T="video"
Expand Down
38 changes: 26 additions & 12 deletions .travis/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,37 @@ function filelist() {
}

function build() {
export FULL_PLATFORM=$1
export TARGET=$2
export FULL_CPU=$3
SPLIT_REGEX="^\([^.]*\)\.\?\(.*\)\$"

if [ x"$4" != x"" ]; then
FIRMWARE=$4
else
unset $FIRMWARE
if [ -z "$1" -o -z "$2" -o -z "$3" ]; then
echo "usage: setup FULL_PLATFORM TARGET FULL_CPU FIRMWARE"
echo " got: setup '$1' '$2' '$3' '$4'"
return 1
fi
export FIRMWARE

if [ -z "$FULL_PLATFORM" -o -z "$TARGET" -o -z "$FULL_CPU" ]; then
echo "usage: build FULL_PLATFORM TARGET FULL_CPU FIRMWARE"
echo " got: build '$FULL_PLATFORM' '$TARGET' '$FULL_CPU' '$FIRMWARE'"
return 1
#export FULL_PLATFORM=$1
export PLATFORM="$(echo $1 | sed -e"s/$SPLIT_REGEX/\1/")"
export PLATFORM_EXPANSION="$(echo $1 | sed -e"s/$SPLIT_REGEX/\2/")"

export TARGET="$2"

#export FULL_CPU=$3
export CPU="$(echo $3 | sed -e"s/$SPLIT_REGEX/\1/")"
export CPU_VARIANT="$(echo $3 | sed -e"s/$SPLIT_REGEX/\2/")"

if [ x$4 != x ]; then
FIRMWARE="$4"
else
unset FIRMWARE
fi

echo "--"
echo "PLATFORM=$PLATFORM PLATFORM_EXPANSION=$PLATFORM_EXPANSION"
echo "TARGET=$TARGET"
echo "CPU=$CPU CPU_VARIANT=$CPU_VARIANT"
echo "FIRMWARE=$FIRMWARE"
echo "--"

(
# Imports TARGET, PLATFORM, CPU and TARGET_BUILD_DIR from Makefile
source scripts/enter-env.sh || exit 1
Expand Down
4 changes: 2 additions & 2 deletions .travis/run.inc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ if [ -z "$PLATFORMS" ]; then
PLATFORMS=$(ls targets/ | grep -v ".py" | grep -v "common" | grep -v "$SKIP_PLATFORMS" | sed -e"s+targets/++")
else
PLATFORMS="$PLATFORM"
unset PLATFORM
fi
fi
echo "Running with PLATFORMS='$PLATFORMS'"

if [ -z "$CPUS" ]; then
if [ -z "$CPU" ]; then
#CPUS="lm32 or1k riscv32"
CPUS="lm32 or1k"
CPUS="lm32 or1k picorv32 vexriscv"
else
CPUS="$CPU"
unset CPU
Expand Down
35 changes: 25 additions & 10 deletions .travis/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,36 @@ set -e
./.travis/fixup-git.sh

function setup() {
export FULL_PLATFORM=$1
export TARGET=$2
export FULL_CPU=$3
SPLIT_REGEX="^\([^.]*\)\.\?\(.*\)\$"

if [ -z "$1" -o -z "$2" -o -z "$3" ]; then
echo "usage: setup FULL_PLATFORM TARGET FULL_CPU FIRMWARE"
echo " got: setup '$1' '$2' '$3' '$4'"
return 1
fi

#export FULL_PLATFORM=$1
export PLATFORM="$(echo $1 | sed -e"s/$SPLIT_REGEX/\1/")"
export PLATFORM_EXPANSION="$(echo $1 | sed -e"s/$SPLIT_REGEX/\2/")"

export TARGET="$2"

#export FULL_CPU=$3
export CPU="$(echo $3 | sed -e"s/$SPLIT_REGEX/\1/")"
export CPU_VARIANT="$(echo $3 | sed -e"s/$SPLIT_REGEX/\2/")"

if [ x$4 != x ]; then
FIRMWARE=$4
FIRMWARE="$4"
else
unset $FIRMWARE
unset FIRMWARE
fi

if [ -z "$FULL_PLATFORM" -o -z "$TARGET" -o -z "$FULL_CPU" ]; then
echo "usage: setup FULL_PLATFORM TARGET FULL_CPU FIRMWARE"
echo " got: setup '$FULL_PLATFORM' '$TARGET' '$FULL_CPU' '$FIRMWARE'"
return 1
fi
echo "--"
echo "PLATFORM=$PLATFORM PLATFORM_EXPANSION=$PLATFORM_EXPANSION"
echo "TARGET=$TARGET"
echo "CPU=$CPU CPU_VARIANT=$CPU_VARIANT"
echo "FIRMWARE=$FIRMWARE"
echo "--"

DF_BEFORE_DOWNLOAD="$(($(stat -f --format="%a*%S" .)))"
(
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ help:
@echo " (current: $(TARGET), default: $(DEFAULT_TARGET))"
@echo ""
@echo " CPU describes which soft-CPU to use on the FPGA."
@echo " CPU=lm32 OR or1k"
@echo " CPU=lm32 OR or1k OR picorv32 OR vexriscv"
@echo " (current: $(CPU), default: $(DEFAULT_CPU))"
@echo ""
@echo " CPU_VARIANT describes which soft-CPU variant to use on the FPGA."
Expand Down
3 changes: 3 additions & 0 deletions firmware/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ firmware.elf: $(FIRMWARE_DIRECTORY)/$(LINKER_LD) $(OBJECTS)
boot-helper-$(CPU).S: $(BIOS_DIRECTORY)/boot-helper-$(CPU).S
cp $< $@

boot-helper-$(CPU).o: boot-helper-$(CPU).S
$(assemble)

%.o: $(FIRMWARE_DIRECTORY)/%.c
$(compile)

Expand Down
3 changes: 3 additions & 0 deletions firmware/stub/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ firmware.elf: $(STUB_DIRECTORY)/$(LINKER_LD) $(OBJECTS)
boot-helper-$(CPU).S: $(BIOS_DIRECTORY)/boot-helper-$(CPU).S
cp $< $@

boot-helper-$(CPU).o: boot-helper-$(CPU).S
$(assemble)

%.o: $(STUB_DIRECTORY)/%.c
$(compile)

Expand Down
10 changes: 5 additions & 5 deletions scripts/build-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ fi
# Get linux-litex is needed
LINUX_SRC="$TOP_DIR/third_party/linux"
LINUX_LOCAL="$LINUX_GITLOCAL" # Local place to clone from
LINUX_REMOTE="${LINUX_REMOTE:-https://github.com/mithro/linux-litex.git}"
LINUX_REMOTE_NAME=mithro-linux-litex
LINUX_REMOTE="${LINUX_REMOTE:-https://github.com/timvideos/linux-litex.git}"
LINUX_REMOTE_NAME=timvideos-linux-litex
LINUX_REMOTE_BIT=$(echo $LINUX_REMOTE | sed -e's-^.*://--' -e's/.git$//')
LINUX_CLONE_FROM="${LINUX_LOCAL:-$LINUX_REMOTE}"
LINUX_BRANCH=${LINUX_BRANCH:-litex-minimal}
LINUX_BRANCH=${LINUX_BRANCH:-master}
(
# Download the Linux source for the first time
if [ ! -d "$LINUX_SRC" ]; then
Expand Down Expand Up @@ -93,9 +93,9 @@ LINUX_BRANCH=${LINUX_BRANCH:-litex-minimal}

# Get litex-devicetree
LITEX_DT_SRC="$TOP_DIR/third_party/litex-devicetree"
LITEX_DT_REMOTE="${LITEX_DT_REMOTE:-https://github.com/mithro/litex-devicetree.git}"
LITEX_DT_REMOTE="${LITEX_DT_REMOTE:-https://github.com/timvideos/litex-devicetree.git}"
LITEX_DT_REMOTE_BIT=$(echo $LITEX_DT_REMOTE | sed -e's-^.*://--' -e's/.git$//')
LITEX_DT_REMOTE_NAME=mithro-litex-devicetree
LITEX_DT_REMOTE_NAME=timvideos-litex-devicetree
LITEX_DT_BRANCH=master
(
# Download the Linux source for the first time
Expand Down
2 changes: 1 addition & 1 deletion scripts/download-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ echo "---------------------------------------"
if [ "$CPU" = "lm32" -o "$CPU" = "or1k" ]; then
CPU_ARCH=$CPU
elif [ "$CPU" = "vexriscv" -o "$CPU" = "picorv32" ]; then
CPU_ARCH=riscv32-unknown
CPU_ARCH=riscv32
fi

# binutils for the target
Expand Down
2 changes: 1 addition & 1 deletion scripts/enter-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ echo "---------------------------------------"
if [ "$CPU" = "lm32" -o "$CPU" = "or1k" ]; then
CPU_ARCH=$CPU
elif [ "$CPU" = "vexriscv" -o "$CPU" = "picorv32" ]; then
CPU_ARCH=riscv32-unknown
CPU_ARCH=riscv32
fi

# binutils for the target
Expand Down
4 changes: 4 additions & 0 deletions scripts/settings.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ HEXFILE_VERSION=0.1

# Conda package versions
BINUTILS_VERSION=2.31.1
if [ "$CPU" != "or1k" ]; then
GCC_VERSION=8.2.0
else
GCC_VERSION=5.4.0
fi
SDCC_VERSION=3.5.0
OPENOCD_VERSION=0.10.0

Expand Down
2 changes: 1 addition & 1 deletion targets/arty/net.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class NetSoC(BaseSoC):

def __init__(self, platform, *args, **kwargs):
# Need a larger integrated ROM on or1k to fit the BIOS with TFTP support.
if 'integrated_rom_size' not in kwargs and kwargs.get('cpu_type', 'lm32') == 'or1k':
if 'integrated_rom_size' not in kwargs and kwargs.get('cpu_type', 'lm32') != 'lm32':
kwargs['integrated_rom_size'] = 0x10000

BaseSoC.__init__(self, platform, *args, **kwargs)
Expand Down
2 changes: 1 addition & 1 deletion targets/atlys/net.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class NetSoC(BaseSoC):

def __init__(self, platform, *args, **kwargs):
# Need a larger integrated ROM on or1k to fit the BIOS with TFTP support.
if 'integrated_rom_size' not in kwargs and kwargs.get('cpu_type', 'lm32') == 'or1k':
if 'integrated_rom_size' not in kwargs and kwargs.get('cpu_type', 'lm32') != 'lm32':
kwargs['integrated_rom_size'] = 0x10000

BaseSoC.__init__(self, platform, *args, **kwargs)
Expand Down
2 changes: 1 addition & 1 deletion targets/nexys_video/net.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class NetSoC(BaseSoC):

def __init__(self, platform, *args, **kwargs):
# Need a larger integrated ROM on or1k to fit the BIOS with TFTP support.
if 'integrated_rom_size' not in kwargs and kwargs.get('cpu_type', 'lm32') == 'or1k':
if 'integrated_rom_size' not in kwargs and kwargs.get('cpu_type', 'lm32') != 'lm32':
kwargs['integrated_rom_size'] = 0x10000

BaseSoC.__init__(self, platform, *args, **kwargs)
Expand Down
2 changes: 1 addition & 1 deletion targets/opsis/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def __init__(self, platform, **kwargs):
if 'integrated_rom_size' not in kwargs:
kwargs['integrated_rom_size']=0x8000
if 'integrated_sram_size' not in kwargs:
kwargs['integrated_sram_size']=0x4000
kwargs['integrated_sram_size']=0x8000

clk_freq = 50*1000000

Expand Down
2 changes: 1 addition & 1 deletion targets/opsis/net.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class NetSoC(BaseSoC):

def __init__(self, platform, *args, **kwargs):
# Need a larger integrated ROM on or1k to fit the BIOS with TFTP support.
if 'integrated_rom_size' not in kwargs and kwargs.get('cpu_type', 'lm32') == 'or1k':
if 'integrated_rom_size' not in kwargs and kwargs.get('cpu_type', 'lm32') != 'lm32':
kwargs['integrated_rom_size'] = 0x10000

BaseSoC.__init__(self, platform, *args, **kwargs)
Expand Down
2 changes: 1 addition & 1 deletion targets/sim/net.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class NetSoC(BaseSoC):

def __init__(self, *args, **kwargs):
# Need a larger integrated ROM on or1k to fit the BIOS with TFTP support.
if 'integrated_rom_size' not in kwargs and kwargs.get('cpu_type', 'lm32') == 'or1k':
if 'integrated_rom_size' not in kwargs and kwargs.get('cpu_type', 'lm32') != 'lm32':
kwargs['integrated_rom_size'] = 0x10000

BaseSoC.__init__(self, *args, **kwargs)
Expand Down

0 comments on commit 3fb4e7c

Please sign in to comment.