Commit 1cf6bd00 authored by Thanassis Tsiodras's avatar Thanassis Tsiodras
Browse files

Sync up helper scripts.

parent 20892be1
Pipeline #2845 failed with stage
in 20 minutes and 25 seconds
#!/usr/bin/env python
#!/usr/bin/env python3
import sys
import os
import PySide
from PySide.QtGui import (QApplication,
QMessageBox)
from PySide2.QtGui import *
from PySide2.QtCore import *
from PySide2.QtWidgets import *
from PySide2.QtUiTools import *
def install_gr740_rtems410_gaisler_posix():
""" $ $HOME/tool-src/add-ons/install-gaisler-4.10.sh """
......@@ -18,6 +19,12 @@ def install_gr740_rcc13rc4_posix():
""" $ $HOME/tool-src/add-ons/install-gaisler-rcc-1.3-rc4.sh """
os.system("xterm -e $HOME/tool-src/add-ons/install-gaisler-rcc-1.3-rc4.sh")
def install_msp430_gcc_freertos():
"""$HOME/tool-src/add-ons/install-msp430-gcc.sh
$HOME/tool-src/add-ons/install-freertos.sh"""
os.system("xterm -e $HOME/tool-src/add-ons/install-msp430-gcc.sh")
os.system("xterm -e $HOME/tool-src/add-ons/install-freertos.sh")
def check_gr740_rtems410_gaisler_posix():
if not os.path.isdir("/opt/rtems-4.10"):
raise NotImplementedError(install_gr740_rtems410_gaisler_posix)
......@@ -30,6 +37,12 @@ def check_gr740_rcc13rc4_posix():
if not os.path.isdir("/opt/rcc-1.3-rc4"):
raise NotImplementedError(install_gr740_rcc13rc4_posix)
def check_msp430_freertos():
if not os.path.isdir("/opt/msp430-gcc"):
raise NotImplementedError(install_msp430_gcc_freertos)
if not os.path.isdir("/opt/FreeRTOSv10.2.1"):
raise NotImplementedError()
# When editing, replace dot (.) with underscore (_)
# the TASTE GUI mixes them up if there is more than one underscore
PLATFORMS = { "crazyflie_v2_gnat" : lambda: True,
......@@ -39,7 +52,7 @@ PLATFORMS = { "crazyflie_v2_gnat" : lambda: True,
"leon3_rtems412_posix" : lambda: True,
"gr712_rtems412_posix" : lambda: True,
"gr740_rtems412_posix" : lambda: True,
"gr740_rtems51_posix" :
"gr740_rtems51_posix" :
check_gr740_rtems51_posix,
"gr740_rtems410_gaisler_posix" :
check_gr740_rtems410_gaisler_posix,
......@@ -47,7 +60,8 @@ PLATFORMS = { "crazyflie_v2_gnat" : lambda: True,
check_gr740_rcc13rc4_posix,
"x86_linux" : lambda: True,
"x86_win32" : lambda: True,
"zynqzc706_rtems_posix" : lambda: True
"msp430fr5969_freertos" :
check_msp430_freertos
}
def query_user(platform):
......@@ -93,4 +107,3 @@ def main():
if __name__ == '__main__':
main()
......@@ -13,8 +13,10 @@ echo -e "Welcome to ${COLORON}TASTE${COLOROFF}"
INFO="${COLORON}[INFO]${COLOROFF}"
ERROR="${REDCOLORON}[ERROR]${COLOROFF}"
# Check if there is an interface view in the current folder
if [ -f InterfaceView.aadl ]
# and if the init command is not invoked (to create initial Makefile)
if [ -f InterfaceView.aadl ] && [ "$1" != "init" ]
then
echo -e "${INFO} Opening TASTE project in current folder"
INTERFACEVIEW=InterfaceView.aadl
......@@ -31,8 +33,13 @@ then
EXTRA_CMD+=' --load-deployment-view DeploymentView.aadl '
fi
else
echo -e "${INFO} A new TASTE project folder will be created (use Ctrl-C to cancel)"
read -p "Please enter a name for the new project folder: " new_folder
if [ "$1" == "init" ]
then
new_folder="$2"
else
echo -e "${INFO} A new TASTE project folder will be created (use Ctrl-C to cancel)"
read -p "Please enter a name for the new project folder: " new_folder
fi
if [ "$new_folder" != "" ]
then
if [ -d "$new_folder" ]
......@@ -48,16 +55,23 @@ else
new_folder=.
fi
echo 'KAZOO?=kazoo
# Here you can specify folders containing external code you want to
# compile and link for a specific partition.
# Here you can specify custom compiler/linker flags, and add folders containing
# external code you want to compile and link for a specific partition.
# Use upper case for the partition name:
# export <PARTITION_NAME>_EXTERNAL_SOURCE_PATH=/absolute/path/1:/....
# export <PARTITIONNAME>_USER_CFLAGS=...
# export <PARTITIONNAME>_USER_LDFLAGS=...
# export <PARTITIONNAME>_EXTERNAL_SOURCE_PATH=
all: c
c: work/glue_built
$(MAKE) -C work
# Simulation target (experimental)
simu: InterfaceView.aadl DeploymentView.aadl DataView.aadl ConcurrencyView_Properties.aadl
$(KAZOO) -t SIMU --glue --gw
$(MAKE) -C work
skeletons:
$(MAKE) work/skeletons_built
......@@ -66,7 +80,7 @@ work/skeletons_built: InterfaceView.aadl DataView.aadl
$(MAKE) -C work dataview
touch $@
work/glue_built: InterfaceView.aadl DeploymentView.aadl DataView.aadl
work/glue_built: InterfaceView.aadl DeploymentView.aadl DataView.aadl ConcurrencyView_Properties.aadl
$(KAZOO) -p --glue --gw -o work
touch $@
......@@ -76,7 +90,7 @@ clean:
find work -type d -name "wrappers" -exec rm -rf {} +
find work -type d -name "*_GUI" -exec rm -rf {} +
.PHONY: clean skeletons c
.PHONY: clean skeletons c simu
' > Makefile
# If there is already a dataview, use it, otherwise create one
if [ ! -f DataView.aadl ]
......
#!/bin/bash
xterm -e "./build-script.sh ; read -p 'Press Enter to close'" || exit 1
# Check if the project works with kazoo. If so, skip all the rest
if [[ -f Makefile && $(grep KAZOO Makefile) != "" ]]
then
xterm -e "make ; read -p 'Press Enter to close'" || exit 1
else
xterm -e "./build-script.sh ; read -p 'Press Enter to close'" || exit 1
fi
#!/bin/bash -e
# Run the tracer daemon - make sure only one instance exists at a time
if [ ! -f "$1" ]
then
echo 'Usage: taste-collect-coverage binary'
......@@ -9,7 +8,8 @@ else
"$1" &
pid=$!
sleep 10
kill -SIGUSR2 $pid
#kill -SIGUSR2 $pid
kill -SIGINT $pid
lcov --capture --directory .. --output-file coverage.info
genhtml coverage.info --output-directory coverage
xdg-open coverage/index.html
......
......@@ -73,7 +73,7 @@ engine = create_engine(
'postgresql+psycopg2://taste:tastedb@localhost/${DBNAME}', echo=False)
Base.metadata.create_all(engine)
OEF
python initdb.py
python3 initdb.py
cat > db.info << OEF2
postgresql+psycopg2://taste:tastedb@localhost/${DBNAME}
......
......@@ -15,8 +15,10 @@ fi
INFO="${COLORON}[INFO]${COLOROFF}"
ERROR="${REDCOLORON}[ERROR]${COLOROFF}"
taste-xml-to-aadl || exit 1
if [ $1 != "C" && $1 != "Ada" && $1 != "SDL" && $1 != "CPP" && "$1" != "Blackbox_C" ]
if [[ $1 != "C" && $1 != "Ada" && $1 != "SDL" && $1 != "CPP" && "$1" != "Blackbox_Device" ]]
then
echo -e "${ERROR} First argument must be C, CPP, Ada, SDL or Blackbox_C"
exit 1
......@@ -25,10 +27,10 @@ fi
# Check if the project works with kazoo. If so, use the makefile rule to edit the code
if [[ -f Makefile && $(grep KAZOO Makefile) != "" ]]
then
cd work/"$2"/"$1"
cd work/"${2,,}"/"$1"
make edit
exit 0
else
echo 'You should switch to kazoo...'
echo -e "${ERROR} Code skeleton generation failed"
fi
......@@ -21,7 +21,7 @@ function quit {
except: pass")
if [ ! -z $tailps ]
then
kill $tailps || xterm -e "echo Internal Error in taste-update-data-view"
kill $tailps 2>&1 || xterm -e "echo Internal Error in taste-update-data-view"
fi
exit $1
}
......
......@@ -21,11 +21,11 @@ MSC_FILENAME=$1
echo -e "${INFO} Opening MSC Editor..."
echo -e "${INFO} Filename: ${MSC_FILENAME}"
EDITOR=taste-msc-editor
EDITOR=msceditor
if [ -z $NONINTERACTIVE ]
then
$EDITOR -o $MSC_FILENAME
$EDITOR -m $MSC_FILENAME
fi
......@@ -6,7 +6,7 @@
# Check if the project works with kazoo. If so, skip all the rest
if [[ -f Makefile && $(grep KAZOO Makefile) != "" ]]
then
make skeletons
make skeletons || exit 1
exit 0
fi
......@@ -27,7 +27,7 @@ function quit {
except: pass")
if [ ! -z $tailps ]
then
kill $tailps || xterm -e "echo Internal Error in taste-update-data-view"
kill $tailps 2>&1 || xterm -e "echo Internal Error in taste-update-data-view"
fi
exit $1
}
......
#!/usr/bin/env python
#!/usr/bin/env python3
from __future__ import print_function
import sys
import time
import signal
import os
from collections import deque
import PySide
from PySide import QtGui
from PySide.QtCore import QThread, Signal, QObject, Qt, Slot, QTimer
from PySide2.QtGui import *
from PySide2.QtCore import *
from PySide2.QtWidgets import *
from PySide2.QtUiTools import *
from PySide.QtGui import (QApplication,
QMessageBox,
QDialog,
QPushButton,
QProgressDialog)
log = deque()
class MyThread(QThread, QObject):
''' Thread waiting for data on stdin and sending signals to the prgress
bar in case something came in.
......@@ -89,16 +83,16 @@ class MyThread(QThread, QObject):
class MyDialog(QDialog):
def __init__(self):
super(MyDialog, self).__init__()
self.bar = QtGui.QProgressBar()
self.more_button = QtGui.QPushButton("Details")
self.extension = QtGui.QWidget()
self.log_window = QtGui.QListWidget()
self.label = QtGui.QLabel()
self.bar = QProgressBar()
self.more_button = QPushButton("Details")
self.extension = QWidget()
self.log_window = QListWidget()
self.label = QLabel()
# Layouts
self.top_layout = QtGui.QVBoxLayout()
self.ext_layout = QtGui.QVBoxLayout()
self.main_layout = QtGui.QVBoxLayout()
self.top_layout = QVBoxLayout()
self.ext_layout = QVBoxLayout()
self.main_layout = QVBoxLayout()
self.more_button.setCheckable(True)
self.more_button.hide()
......
......@@ -33,15 +33,22 @@ then
kill -INT "$tracer_pid"
fi
cp ../dataview-uniq.asn .
# In kazoo-based systems, the full dataview is in ../dataview
cp ../dataview/dataview-uniq.asn .
echo '================================================'
echo 'Trace file were generated. You may now run:
taste-edit-msc trace.msc'
# Patch the VCD file (if any)
if [ -f bench.vcd ]
then
taste-patch-vcd.py ../GlueAndBuild/deploymentview_final/"$1"/deployment.h bench.vcd
fi
for f in $(find *.vcd)
do
taste-patch-vcd.py ../build/deploymentview_final/"$1"/deployment.h $f
echo " gtkwave ./$f.new"
done
echo '================================================'
echo 'Trace file were generated. You may now run:
taste-msc-editor -o ./trace.msc
gtkwave ./bench.vcd.new
taste-edit-msc trace.msc
gtkwave ./bench.vcd.new # if a VCD file was generated
'
......@@ -84,13 +84,14 @@ fi
#
# </rant>
if [ $(uname -m) == "x86_64" ] ; then
cd /usr/lib/python3.5
cd /usr/lib/python3.5 > /dev/null
if [ ! -h _sysconfigdata_m.py ] ; then
sudo ln -s plat-x86_64-linux-gnu/_sysconfigdata_m.py
fi
cd -
cd - > /dev/null
fi
# Now, finally, launch GDB
echo -en "tar sim -leon3 -m 4\nload \"$@\"\nrun\nquit\n" | \
/opt/rtems-5.1-2019.07.25/bin/sparc-rtems5-gdb "$@"
/opt/rtems-5.1-2019.07.25/bin/sparc-rtems5-gdb "$@" |& \
sed -u '1,/Starting program/d'
......@@ -2,10 +2,12 @@
echo TASTE Data View Convertor - From ASN.1 to AADLV2
# Initialise the progress bar
# Initialise the progress bar if there is an X server
myfifo=/tmp/$$$RANDOM
mkfifo $myfifo
tail -f $myfifo | taste-progress-dialog.py &
xset q &>/dev/null && (
mkfifo $myfifo
tail -f $myfifo | taste-progress-dialog.py &
)
function quit {
echo '100 Completed' > $myfifo
......@@ -15,12 +17,12 @@ function quit {
except: pass")
if [ ! -z $tailps ]
then
kill $tailps || xterm -e "echo Internal Error in taste-update-data-view"
kill $tailps 2>&1 || xterm -e "echo Internal Error in taste-update-data-view"
fi
exit $1
}
# Install a trap handler to make sure Ctrl-C leads to calling the quit function (trap 2 = SINGINT)
# Install a trap handler to make sure Ctrl-C leads to calling the quit function (trap 2 = SIGINT)
trap 2 quit 1
if [ -t 1 ] ; then
......@@ -97,6 +99,11 @@ fi
DATAVIEW+=" $(taste-config --prefix)/share/taste-types/taste-types.asn"
# Make sure all parameters are unique
DATAVIEW="$(echo ${DATAVIEW} | tr ' ' '\n' | sort | uniq | tr '\n' ' ')"
COMMAND="asn2aadlPlus -f ${DATAVIEW} ${AADL} -aadlv2 2>&1 > >(uniq >&2)"
echo -e "${INFO} Command:
$COMMAND"
# can asn2aadlPlus with a call to uniq to filter out duplicate outputs
# due to multiple calls to the ASN.1 compiler
#asn2aadlPlus $DATAVIEW "$AADL" -aadlv2 2>&1 | uniq >&2
......
Supports Markdown
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