Commit 1dd1963b authored by clehr's avatar clehr
Browse files

updated container file, modified and updated scripts

parent 990ce5b0
Showing with 165 additions and 83 deletions
+165 -83
......@@ -50,8 +50,8 @@ RUN apt-get update && apt-get install -y git openjdk-8-jdk gitk cmake make g++ t
# Step 9: Set download link
# Quartus 20.1 does not work good with patmos, hello_puts example ends with an exception
# additonal version 20.1 has a very slow fitting process 7s vs 17 minutes using version 19.1 on my 5800X
ARG URL=https://download.altera.com/akdlm/software/acdsinst/20.1std.1/720/ib_tar/Quartus-lite-20.1.1.720-linux.tar
#ARG URL=http://download.altera.com/akdlm/software/acdsinst/19.1std/670/ib_tar/Quartus-lite-19.1.0.670-linux.tar
#ARG URL=https://download.altera.com/akdlm/software/acdsinst/20.1std.1/720/ib_tar/Quartus-lite-20.1.1.720-linux.tar
ARG URL=http://download.altera.com/akdlm/software/acdsinst/19.1std/670/ib_tar/Quartus-lite-19.1.0.670-linux.tar
# Step 10: Downlaod and install Quartus
# curl -O $URL && \
......@@ -126,21 +126,5 @@ RUN cd /opt/t-crest/misc && \
sed -i "s/BUILDSH_TARGETS=\"gold llvm newlib compiler-rt pasim poseidon aegean\"/BUILDSH_TARGETS=\"patmos\"/" ./build.cfg && \
cd .. && ./misc/build.sh && \
rm -rf patmos
########################
# Setup verilator
########################
# Verilator needs to be above version 4.103 as there are issues with chisel3
# Step 10: Prepare Verialtor for installation
RUN apt-get purge -y verilator
RUN cd ~ && git clone https://github.com/verilator/verilator && \
cd verilator && \
git checkout stable
# Step 11: Build and install verilator
RUN cd ~/verilator && \
export VERILATOR_ROOT=`pwd` && \
unset VERILATOR_ROOT && \
autoconf && \
./configure && \
make -j5 && make install
#!/bin/bash
podman run --rm --name patmos-development-container -v /dev/ttyUSB0:/dev/ttyUSB0 -v /dev/usbblaster/:/dev/usbblaster/ -v ./patmos:/opt/t-crest/patmos --network host --privileged \
--workdir /opt/t-crest/patmos -t -i --group-add keep-groups docker.io/lehrchristoph/patmos-dev-container:v1 bash -lc "make BOOTAPP=bootable-bootloader tools gen synth"
usage() { echo "Usage: $0 -p <patmos directory> -j <jtag programmer>" 1>&2; exit 1; }
while getopts "j:p:" o; do
case "${o}" in
j)
j=${OPTARG}
;;
p)
p=${OPTARG}
;;
*)
usage
;;
esac
done
shift $((OPTIND-1))
if [ -z "${j}" ] || [ -z "${p}" ]; then
usage
fi
podman run --rm --name patmos-development-container -v ${j}:/dev/jtag --network host --privileged \
-v ${p}:/opt/t-crest/patmos --workdir /opt/t-crest/patmos -t -i --group-add keep-groups \
docker.io/lehrchristoph/patmos-dev-container:v1 bash -lc "make BOOTAPP=bootable-bootloader tools gen synth config"
#!/bin/bash
usage() { echo "Usage: $0 -a <app name> " 1>&2; exit 1; }
while getopts "a:" o; do
case "${o}" in
a)
a=${OPTARG}
;;
*)
usage
;;
esac
done
shift $((OPTIND-1))
if [ -z "${a}" ]; then
usage
fi
podman run --rm --name patmos-development-container -v /dev/ttyUSB0:/dev/ttyUSB0 -v /dev/usbblaster/:/dev/usbblaster/ -v ./patmos:/opt/t-crest/patmos --network host --privileged \
--workdir /opt/t-crest/patmos -t -i --group-add keep-groups docker.io/lehrchristoph/patmos-dev-container:v1 bash -lc "make BOOTAPP=bootable-bootloader tools gen synth app APP=${a} comp config download"
#!/bin/bash
usage() { echo "Usage: $0 -a <app name> -j <jtag programmer> -s <serial interface> " 1>&2; exit 1; }
usage() { echo "Usage: $0 -p <patmos directory> -a <app name>" 1>&2; exit 1; }
while getopts "a:j:s:" o; do
while getopts "a:p:" o; do
case "${o}" in
a)
a=${OPTARG}
;;
j)
j=${OPTARG}
;;
s)
s=${OPTARG}
;;
*)
a=${OPTARG}
;;
p)
p=${OPTARG}
;;
*)
usage
;;
esac
done
shift $((OPTIND-1))
if [ -z "${a}" ] || [ -z "${j}" ] || [ -z "${s}" ]; then
if [ -z "${a}" ] || [ -z "${p}" ]; then
usage
fi
podman run --rm --name patmos-development-container -v ${s}:/dev/ttyUSB0 -v ${j}:/dev/jtag -v ./patmos:/opt/t-crest/patmos --network host --privileged \
--workdir /opt/t-crest/patmos -t -i --group-add keep-groups docker.io/lehrchristoph/patmos-dev-container:v1 bash -lc "make APP=${a} tools comp config download"
podman run --rm --name patmos-development-container --network host --privileged \
-v ${p}:/opt/t-crest/patmos --workdir /opt/t-crest/patmos -t -i \
docker.io/lehrchristoph/patmos-dev-container:v1 bash -lc "make APP=${a} comp"
#!/bin/bash
usage() { echo "Usage: $0 -p <patmos directory> -j <jtag programmer>" 1>&2; exit 1; }
while getopts "j:p:" o; do
case "${o}" in
j)
j=${OPTARG}
;;
p)
p=${OPTARG}
;;
*)
usage
;;
esac
done
shift $((OPTIND-1))
if [ -z "${j}" ] || [ -z "${p}" ]; then
usage
fi
podman run --rm --name patmos-development-container -v ${j}:/dev/jtag --network host --privileged \
-v ${p}:/opt/t-crest/patmos --workdir /opt/t-crest/patmos -t -i --group-add keep-groups \
docker.io/lehrchristoph/patmos-dev-container:v1 bash -lc "make config"
#!/bin/bash
usage() { echo "Usage: $0 -p <patmos directory> -a <app name> -j <jtag programmer> -s <serial interface> " 1>&2; exit 1; }
while getopts "a:j:p:s:" o; do
case "${o}" in
a)
a=${OPTARG}
;;
j)
j=${OPTARG}
;;
p)
p=${OPTARG}
;;
s)
s=${OPTARG}
;;
*)
usage
;;
esac
done
shift $((OPTIND-1))
if [ -z "${a}" ] || [ -z "${j}" ] || [ -z "${s}" ] || [ -z "${p}" ]; then
usage
fi
podman run --rm --name patmos-development-container -v ${s}:/dev/ttyUSB0 -v ${j}:/dev/jtag --network host --privileged \
-v ${p}:/opt/t-crest/patmos --workdir /opt/t-crest/patmos -t -i --group-add keep-groups \
docker.io/lehrchristoph/patmos-dev-container:v1 bash -lc "make APP=${a} config download"
#!/bin/bash
usage() { echo "Usage: $0 -p <patmos directory> -a <app name> -j <jtag programmer> -s <serial interface> " 1>&2; exit 1; }
while getopts "a:j:p:s:" o; do
case "${o}" in
a)
a=${OPTARG}
;;
j)
j=${OPTARG}
;;
p)
p=${OPTARG}
;;
s)
s=${OPTARG}
;;
*)
usage
;;
esac
done
shift $((OPTIND-1))
if [ -z "${a}" ] || [ -z "${j}" ] || [ -z "${s}" ] || [ -z "${p}" ]; then
usage
fi
podman run --rm --name patmos-development-container -v ${s}:/dev/ttyUSB0 -v ${j}:/dev/jtag --network host --privileged \
-v ${p}:/opt/t-crest/patmos --workdir /opt/t-crest/patmos -t -i --group-add keep-groups \
docker.io/lehrchristoph/patmos-dev-container:v1 bash -lc "make BOOTAPP=bootable-bootloader APP=${a} tools gen synth config download"
......@@ -3,42 +3,52 @@
# Setup up container and environment
###########################################################
usage() { echo "Usage: $0 -p <patmos directory> -u (udev and user setup)" 1>&2; exit 1; }
while getopts "p:u" o; do
case "${o}" in
p)
p=${OPTARG}
;;
u)
u=$TRUE
;;
*)
usage
;;
esac
done
shift $((OPTIND-1))
if [ -z "${p}" ] ; then
usage
fi
# Setup udev rules
sudo cp ./50-usbblaster.rules /etc/udev/rules.d/
sudo udevadm control --reload
sudo udevadm trigger
if $u ; then
script_dir=$(dirname $0)
sudo cp $script_dir/../misc/50-usbblaster.rules /etc/udev/rules.d/
sudo udevadm control --reload
sudo udevadm trigger
# Add user to dialout and tty group
sudo usermod -a -G tty $USER
sudo usermod -a -G dialout $USER
# Add user to dialout and tty group
sudo usermod -a -G tty $USER
sudo usermod -a -G dialout $USER
fi
# Clone Patmos repository for development
git clone https://github.com/t-crest/patmos.git patmos
git clone https://github.com/t-crest/patmos.git ${p}
# Download image
echo "Pulling image, this may take some minutes, get a coffee"
podman pull docker.io/lehrchristoph/patmos-dev-container:v1
# Finish preparation of patmos
#podman run --rm --name patmos-development-container -v ./patmos:/opt/t-crest/patmos --network host \
# --workdir /opt/t-crest/patmos -t -i docker.io/lehrchristoph/patmos-dev-container:v1 bash -lc "\
# cd /opt/t-crest/misc && \
# cp build.cfg.dist build.cfg && \
# sed -i "s/BUILDSH_TARGETS=\"gold llvm newlib compiler-rt pasim poseidon aegean\"/BUILDSH_TARGETS=\"patmos\"/" ./build.cfg && \
# cd .. && ./misc/build.sh"
# cp /opt/t-crest/patmos/tools/scripts/build/config_altera /opt/t-crest/local/bin && \
# cp /opt/t-crest/patmos/tools/scripts/build/config_xilinx /opt/t-crest/local/bin && \
# cp /opt/t-crest/patmos/tools/scripts/build/patserdow /opt/t-crest/local/bin && \
# cp /opt/t-crest/patmos/tools/scripts/build/patex /opt/t-crest/local/bin"
# Initial Build of Patmos Microprocessor
echo "Building patmos Microprocessor"
podman run --rm --name patmos-development-container -v /dev/ttyUSB0:/dev/ttyUSB0 -v /dev/usbblaster/:/dev/usbblaster/ -v ./patmos:/opt/t-crest/patmos --network host --privileged \
--workdir /opt/t-crest/patmos -t -i --group-add keep-groups docker.io/lehrchristoph/patmos-dev-container:v1 bash -lc "make BOOTAPP=bootable-bootloader tools gen synth"
podman run --rm --name patmos-development-container -v ${p}:/opt/t-crest/patmos --workdir /opt/t-crest/patmos \
--network host --privileged -t -i --group-add keep-groups docker.io/lehrchristoph/patmos-dev-container:v1 \
bash -lc "make BOOTAPP=bootable-bootloader tools gen synth"
# -v /dev/ttyUSB0:/dev/ttyUSB0 -v /dev/usbblaster:/dev/usbblaster
#patmos-quartus_20.1 bash -lc "make BOOTAPP=bootable-bootloader APP=hello_puts gen synth config download"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment