Commit f69289e1 authored by Guillaume REMBERT's avatar Guillaume REMBERT

Automatic development environment setup scripts

parent e1a1903d
#!/bin/bash
################################
# Project: EurySPACE CCSDS RX/TX
# Design Name: euryspacectl
# Version: 1.0.0
# Description:
# EurySPACE management tool
# Validated on CentOS 7
# TODO: Ubuntu 16 LTS
################################
# Author(s):
# Guillaume REMBERT
################################
# Licence:
# MIT
################################
# Changes list:
# 2017/09/04: initial release
################################
#Conf for sources / builds
#Install environment (dev / prod) + all / only sub-parts
#############
# FUNCTIONS #
#############
function show_help {
echo "EurySPACE control tool"
echo "Usage example:"
echo "euryspacectl -a ACTION [-d DESTINATION] [-e ENVIRONMENT] [-o OPERATING_SYSTEM] [-t TARGET] [-u USER]"
echo "ACTION: install"
echo "DESTINATION: destination folder (default: /home/euryspace)"
echo "ENVIRONMENT: dev|development, prod|production (default value)"
echo "OPERATING_SYSTEM: centos7 (default value), ubuntu16"
echo "TARGET: all (default value), space|space_segment, ground|ground_segment, user|user_segment"
echo "USER: user used to start (default: astronaut)"
}
START_TIME=$(date +%s)
####################
# SCRIPT VARIABLES #
####################
EURYSPACE_PRODUCTION=true
EURYSPACE_OPERATING_SYSTEM="centos7"
EURYSPACE_USER="astronaut"
#########################
# SCRIPT INITIALISATION #
#########################
#Check script is run as root
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
exit 1
fi
#Get configuration variables and functions
SCRIPT_COMMAND=$(readlink -f "$0")
SCRIPT_PATH=$(dirname "$SCRIPT_COMMAND")
#Should not be changed except if you changed sw folder layout
SCRIPT_CONF_PATH=$SCRIPT_PATH/cfg/sw/euryspace.conf
#Get input parameters
while getopts :a:e:ht: ARGUMENT
do
case "${ARGUMENT}" in
a) SCRIPT_ACTION=${OPTARG}
case "${SCRIPT_ACTION}" in
install)
;;
*)
echo "Unknown action: ${SCRIPT_ACTION}" 1>&2
show_help
exit 1
;;
esac
;;
d) EURYSPACE_DESTINATION=${OPTARG}
;;
e) ENVIRONMENT=${OPTARG}
case "${ENVIRONMENT}" in
dev|development)
EURYSPACE_PRODUCTION=false
;;
prod|production)
echo "Production environment is not yet managed" 1>&2
exit 1
;;
*)
echo "Unknown enviroment: ${ENVIRONMENT}" 1>&2
show_help
exit 1
esac
;;
h)
show_help
exit 0
;;
o) EURYSPACE_OPERATING_SYSTEM=${OPTARG}
case "${EURYSPACE_OPERATING_SYSTEM}" in
ubuntu16|centos7)
;;
*)
echo "Unmanaged operating system: ${EURYSPACE_OPERATING_SYSTEM}" 1>&2
show_help
exit 1
esac
;;
t) TARGET=${OPTARG}
;;
u) EURYSPACE_USER=${OPTARG}
;;
?)
echo "Unknown argument: ${OPTARG}" 1>&2
show_help
exit 1
;;
esac
done
case "${SCRIPT_ACTION}" in
install)
$SCRIPT_PATH/sw/src/tools/euryspace_install.sh ${EURYSPACE_OPERATING_SYSTEM} ${EURYSPACE_PRODUCTION} ${EURYSPACE_USER} ${EURYSPACE_DESTINATION}
;;
esac
This diff is collapsed.
#NOTES A NETTOYER
#GHDL HINTS
#generate libs
#ghdl -i *.vhd
#analyse and compile
#ghdl -a *.vhd
#build
#ghdl -e ccsds_rxtx_top
#run
#ghdl -r ccsds_rxtx_top --vcd=test.vcd
#./ccsds_rxtx_top --vcd=test.vcd
#display
#ghdl -d
# TESTS WITH QEMU
#qemu-system-or32
#-net none
#-nographic
#-m 32M
#-kernel /monfichierelf
#-append 'rw init=/bin/sh panic=1 PATH=/bin:/sbin root=/dev/sda console=ttyAMA0'
#-initrd /monfichierinitramfs
#-serial tcp::10000,server
#OR1K HINTS
# Build for simulation
#or1k-elf-gcc hello.c -o hello.elf.sim
# Build for specific SoC
#or1k-elf-gcc hello.c -o hello.elf.de0_nano -mboard=de0_nano
# Test in or1ksim
#or1k-elf-sim -f /or1k/linux/arch/openrisc/or1ksim.cfg /or1k/app_baremetal/hello.elf.sim
# Test in qemu-system-or32
#qemu-system-or32 -serial mon:stdio -net none -nographic -m 32M -kernel /or1k/app_baremetal/hello.elf.de0_nano
#LINUX HINTS
# Test in or1ksim
#or1k-elf-sim -f /or1k/linux/arch/openrisc/or1ksim.cfg /or1k/linux/vmlinux
# Test: console access through telnet / Result: Linux shell
#telnet localhost 10084
# Test in qemu-system-or32
#qemu-system-or32 -serial stdio -net none -nographic -m 32M -kernel /or1k/vmlinux
#-S: freeze cpu on startup (resume with c when debugging)
#-s: wait for gdb connection (on 1234 local socket)
#or1k-elf-gdb /or1k/linux/vmlinux -ex 'target remote localhost:1234'
#readelf -e /or1k/linux/vmlinux.elf.
# Build SoC*
# *: FIXME - DOESN'T WORK WITHOUT INTERNET CONNEXION + DESCRIBE WHAT IT DOES (analysing, synthesis, fitting, assembling)
#fusesoc build de0_nano
# Simulate RTL SoC
#fusesoc sim --force euryspace --elf-load /or1k/app_baremetal/hello.elf.sim --vcd
#fusesoc --verbose sim --force --testbench euryspace_tb euryspace --elf-load /or1k/app_baremetal/hello.elf.de0_nano --vcd
# Display and analyse results
#gtkwave build_socs/build/euryspace/sim-icarus/testlog.vcd &
# Flash FPGA
#[ROOT]
#killall jtagd
#/home/altera/15.0/quartus/bin/jtagd
#[USER]
#fusesoc pgm de0_nano
# Connect to JTAG debug
#[ROOT]
#openocd -f /or1k/openocd/tcl/interface/altera-usb-blaster.cfg -f /or1k/openocd/tcl/board/or1k_generic.cfg
#[USER]
# Connect to openocd-bridge
#telnet localhost 4444
# Test SoC
#or1200.cpu curstate
# Start SoC
#reset
###### EMULATOR ######
#git submodule update --init dtc
#./configure
#make -j10
#make install
###### CREATE A BOOTLOADER ######
#export ARCH=openrisc
#export CROSS_COMPILE=or1k-elf-
#make openrisc-generic_defconfig
#make menuconfig
# LOAD SOFTWARE
# OPENOCD
halt; load_image /or1k/linux/vmlinux; reg npc 0x100; reset
halt; load_image /vmlinux-de0_nano; reg npc 0x100; reset
halt; load_image /euryspace/tests/testouille/src/testouille; reg npc 0x100; reset
# DEBUG/ GDB THROUGH OPENOCD GDBSERVER
or1k-elf-gdb /euryspace/linux/vmlinux
target remote localhost:3333
load
jump *0x100
continue
spr npc 0x100
or1k-elf-gdb /or1k/linux/vmlinux -ex 'target remote localhost:3333'
#Inspect stack in nice view
layout split
#display code
l hello.c:1
# add breakpoints
b 6
# display
n
#TEST SOC + LINUX
--> pb de drivers non OK
Pour tester le soc:
Pour avoir la sortie tty:
[ROOT]* fixme / permission for user to be done
minicom -D /dev/ttyUSB0
screen /dev/ttyUSB0 115200
#TO TUNE THE WISHBONE INTERCO / NEED TO REGENERATE THE INTERCO MATRIX AFTER TUNING A CONFIGURATION FILE
#SPECIFIC TOOL
./orpsoc-cores/cores/wb_intercon/sw/wb_intercon_gen ./orpsoc-cores/systems/euryspace/data/wb_intercon.conf ./orpsoc-cores/systems/euryspace/rtl/verilog/wb_intercon.v
#PERMANENT FLASH SOC + SOFT (UBOOT ∕ PGR)
# ADD TO PATH UBOOT TOOLS
/or1k/u-boot/tools
# GO TO orpsoc-cores/systems/de0_nano/utils
./flash_helper.sh /or1k/build_socs/build/de0_nano/bld-quartus/de0_nano.sof /or1k/app_baremetal/hello.elf.de0_nano
quartus_pgm --mode=jtag -o pi\;de0_nano.jic
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