Commit b2220c57 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

WIP: simulation support

parent 616b99b9
Pipeline #2190 failed with stage
in 7 minutes and 50 seconds
......@@ -15,6 +15,8 @@ all: air
@@END_IF@@
simulate:
# Configure gprbuild to use GCC toolchain even if LLVM is installed
gprconfig --batch --config=Ada,,default,,GNAT --config=C,,default,,GCC --config=C++,,default,,G++ || :
@@TABLE@@
gprbuild -p -P @_Partition_Names_@_simulator.gpr -XCFG="Debug" -cargs:C -DSTATIC=""
@@END_TABLE@@
......@@ -41,6 +43,8 @@ air:
@@END_TABLE@@
release_native:
# Configure gprbuild to use GCC toolchain even if LLVM is installed
gprconfig --batch --config=Ada,,default,,GNAT --config=C,,default,,GCC --config=C++,,default,,G++ || :
@@TABLE@@
gprbuild -p -P @_LOWER:Partition_Names_@.gpr -XCFG="Release" -cargs:C -DSTATIC=""
@@END_TABLE@@
......
......@@ -32,18 +32,11 @@
@@-- @_Out_Port_Type_Name_@ : |_ corresponding parameter type name (optional)
-- Node name : @_Name_@
-- Execution platform : @_CPU_Platform_@
@@-- Not all systems use Ada so we must not always include Ada dataview folder
@@TABLE@@
@@IF@@ @_LOWER:Block_Languages_@ = sdl or @_LOWER:Block_Languages_@ = ada
@@SET@@ Need_Ada = TRUE
@@END_IF@@
@@END_TABLE@@
library project @_CAPITALIZE:Name_@_Simulator is
for Library_Name use "@_LOWER:Name_@";
for Library_Dir use "../../simulation";
for Library_Kind use "dynamic";
@@IF@@ @_Need_Ada_@
-- In order to get the libinit and libfinal functions:
for Library_Standalone use "encapsulated";
for Library_Options use ("-lrt", "-lm");
......@@ -56,7 +49,6 @@ library project @_CAPITALIZE:Name_@_Simulator is
@@END_IF@@
@@END_TABLE@@
"adaasn1rtl.ads");
@@END_IF@@
type Build_Type is ("Debug", "Release");
Build : Build_Type := external ("CFG", "Debug");
......@@ -68,9 +60,8 @@ library project @_CAPITALIZE:Name_@_Simulator is
"../DriversConfig",
@@END_IF@@
"../../dataview/C",
@@IF@@ @_Need_Ada_@ = TRUE
"../../dataview/Ada",
@@END_IF@@
"../../dataview/iterators",
@@TABLE@@
@@IF@@ @_LOWER:Block_Languages_@ = sdl
"../../@_LOWER:Block_Names_@/SDL/code",
......@@ -92,11 +83,7 @@ library project @_CAPITALIZE:Name_@_Simulator is
for Object_Dir use "@_LOWER:Name_@_simu_obj";
-- for Exec_Dir use "../../binaries";
@@IF@@ @_Need_Ada_@ = TRUE
for Languages use ("Ada", "C", "C++");
@@ELSE@@
for Languages use ("C", "C++");
@@END_IF@@
-- for Main use ("main.c");
......
@@-- The up to date list of tags available for this template is available here:
@@-- https://taste.tuxfamily.org/wiki/index.php?title=Kazoo_Templates_Documentation#templates.2Fskeletons.2Fmakefile.tmplt
@@-- If you are using vim, go over the URL and pres gx in to follow the link
@@-- If you have no internet access you can also use (with vim) Ctrl-W-f then Ctrl-W-L (or gf)
@@-- in vim to open the doc: $HOME/tool-inst/share/kazoo/doc/templates_skeletons_makefile.ascii
@@--
# MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
MAKEFILE_PATH := $(lastword $(MAKEFILE_LIST))
OUTDIR := $(dir $(MAKEFILE_PATH))
@@IF@@ @_Target_@ /= SIMU
ASN1_FILES := @_REPLACE_ALL(,/):ASN1_Files_@
@@ELSE@@
ASN1_FILES := @_REPLACE_ALL(,/):ASN1_Files_@ ${OUTDIR}/build/simulation.asn
@@END_IF@@
CP_FILES := @_REPLACE_ALL(,/):CP_Files_@ # Context parameters
DATAVIEW_PATH := ${OUTDIR}/dataview
DATAVIEW_UNIQ := ${DATAVIEW_PATH}/dataview-uniq.asn
......@@ -20,11 +26,14 @@ DATAVIEW_AADLV2 := ${DATAVIEW_PATH}/dataview_aadlv2.aadl
# Project cache folder is used to speed up all ASN.1-related processing
export PROJECT_CACHE=${HOME}/.taste_AST_cache
@@IF@@ @_Target_@ /= SIMU
all: build-default
@@ELSE@@
# Build a simulator of the system
simu: aadl2glueC build/system_config.h ${DATAVIEW_PATH}/built build/deploymentview_final/Makefile
all: aadl2glueC build/system_config.h ${DATAVIEW_PATH}/built build/deploymentview_final/Makefile
cd dataview && taste-asn1-iterators --raw dataview-uniq.asn
$(MAKE) -j -C build -f Makefile.taste simu
@@END_IF@@
@@-- global check to check which dataviews are neeeded
@@TABLE@@
......@@ -36,7 +45,12 @@ simu: aadl2glueC build/system_config.h ${DATAVIEW_PATH}/built build/deploymentvi
@@SET@@ Has_GUI=TRUE
@@END_IF@@
@@END_TABLE@@
@@--
@@-- for pure simulation target, force the generation of the Ada dataview
@@IF@@ @_Target_@ = SIMU
@@SET@@ Need_Ada = TRUE
@@END_IF@@
@@--
# Generate the language-specific data view needed before editing user code
@@IF@@ not @_Need_Ada_@ and not @_Other_DataViews_@
dataview: dataview/C/built
......
......@@ -25,6 +25,12 @@ c: # Polyorb_HI_C output
cp simple_c_function/*.c work/simple_c_function/C/src
$(MAKE) -C work
simu:
rm -rf work
$(KAZOO) -t SIMU -c DeploymentView_Native.aadl -p -g --gw --glue -o work
cp simple_c_function/*.c work/simple_c_function/C/src
$(MAKE) -C work
rtems:
rm -rf output.rtems
$(KAZOO) -c DeploymentView_Leon3.aadl -p --gw --glue -o output.rtems
......
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