-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
41 changed files
with
2,336 additions
and
9 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
basic/test_data_port_periodic_three_domains_CASE/aadl/.system
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
system_impl=top.impl | ||
system_impl_file=test_data_port_periodic_three_domains.aadl | ||
projects=. |
2 changes: 1 addition & 1 deletion
2
basic/test_data_port_periodic_three_domains_CASE/aadl/behavior_code/T1.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
basic/test_data_port_periodic_three_domains_CASE/aadl/behavior_code/T2.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
basic/test_data_port_periodic_three_domains_CASE/aadl/bin/clean.cmd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
::#! 2> /dev/null # | ||
@ 2>/dev/null # 2>nul & echo off & goto BOF # | ||
if [ -z ${SIREUM_HOME} ]; then # | ||
echo "Please set SIREUM_HOME env var" # | ||
exit -1 # | ||
fi # | ||
exec ${SIREUM_HOME}/bin/sireum slang run "$0" "$@" # | ||
:BOF | ||
setlocal | ||
if not defined SIREUM_HOME ( | ||
echo Please set SIREUM_HOME env var | ||
exit /B -1 | ||
) | ||
%SIREUM_HOME%\\bin\\sireum.bat slang run "%0" %* | ||
exit /B %errorlevel% | ||
::!# | ||
// #Sireum | ||
|
||
import org.sireum._ | ||
|
||
val hamrDir: Os.Path = Os.slashDir.up.up / "hamr" | ||
val slangDir = hamrDir / "slang" | ||
val cDir = hamrDir / "c" | ||
|
||
val toKeep = ops.ISZOps(ISZ( | ||
(slangDir / ".idea"), | ||
|
||
(slangDir / "src" / "main" / "component"), | ||
(slangDir / "src" / "test" / "bridge"), | ||
|
||
(cDir / "ext-c/consumer_thread_i_consumer_consumer"), | ||
(cDir / "ext-c/producer_thread_i_producer_producer"), | ||
)) | ||
|
||
|
||
def rec(p: Os.Path, onlyDelAutoGen: B): Unit = { | ||
if(p.isFile) { | ||
if ((!toKeep.contains(p) && !onlyDelAutoGen) || ops.StringOps(p.read).contains("Do not edit")) { | ||
p.remove() | ||
println(s"Removed file: $p") | ||
} | ||
} else { | ||
for (pp <- p.list) { | ||
rec(pp, toKeep.contains(p) || onlyDelAutoGen) | ||
} | ||
if (p.list.isEmpty) { | ||
p.removeAll() | ||
println(s"Removed empty directory: $p") | ||
} | ||
} | ||
} | ||
rec(hamrDir, F) |
91 changes: 91 additions & 0 deletions
91
basic/test_data_port_periodic_three_domains_CASE/aadl/bin/run-hamr.cmd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
::/*#! 2> /dev/null # | ||
@ 2>/dev/null # 2>nul & echo off & goto BOF # | ||
if [ -z ${SIREUM_HOME} ]; then # | ||
echo "Please set SIREUM_HOME env var" # | ||
exit -1 # | ||
fi # | ||
exec ${SIREUM_HOME}/bin/sireum slang run "$0" "$@" # | ||
:BOF | ||
setlocal | ||
if not defined SIREUM_HOME ( | ||
echo Please set SIREUM_HOME env var | ||
exit /B -1 | ||
) | ||
%SIREUM_HOME%\\bin\\sireum.bat slang run "%0" %* | ||
exit /B %errorlevel% | ||
::!#*/ | ||
// #Sireum | ||
|
||
import org.sireum._ | ||
|
||
val aadlDir = Os.slashDir.up | ||
|
||
val sireumBin = Os.path(Os.env("SIREUM_HOME").get) / "bin" | ||
val sireum = sireumBin / (if(Os.isWin) "sireum.bat" else "sireum") | ||
|
||
val osate: Os.Path = Os.env("OSATE_HOME") match { | ||
case Some(s) => Os.path(s) / ( | ||
if (Os.isWin) "osate.exe" | ||
else if (Os.isLinux || Os.kind == Os.Kind.LinuxArm) "osate" | ||
else "Contents/MacOS/osate") | ||
case _ if (Os.isWin) => sireumBin / "win" / "fmide" / "fmide.exe" | ||
case _ if (Os.isMac) => sireumBin / "mac" / "fmide.app" / "Contents" / "MacOS" / "osate" | ||
case _ if (Os.isLinux) => sireumBin / "linux" / "fmide" / "fmide" | ||
case _ => | ||
println("Unsupported operating system") | ||
Os.exit(1) | ||
halt("") | ||
} | ||
|
||
if (!osate.exists) { | ||
eprintln("Please install FMIDE (e.g. '$SIREUM_HOME/bin/install/fmide.cmd') or OSATE (e.g. 'sireum hamr phantom -u')") | ||
Os.exit(1) | ||
halt("") | ||
} | ||
|
||
val osireum = ISZ(osate.string, "-nosplash", "--launcher.suppressErrors", "-data", "@user.home/.sireum", "-application", "org.sireum.aadl.osate.cli") | ||
|
||
if(Os.cliArgs.size > 1) { | ||
eprintln("Only expecting a single argument") | ||
Os.exit(1) | ||
} | ||
|
||
val slangOutputDir = aadlDir.up / "hamr" / "slang" | ||
|
||
val packageName = "base" | ||
|
||
assert (!slangOutputDir.exists || (slangOutputDir / "src" / "main" / "component" / packageName).exists, s"Slang output dir exists but the package name is not $packageName") | ||
|
||
val platform: String = | ||
if(Os.cliArgs.nonEmpty) Os.cliArgs(0) | ||
else "JVM" | ||
|
||
val codegenArgs = ISZ[String]("hamr", "codegen", | ||
"--platform", platform, | ||
"--package-name", packageName, | ||
"--output-dir", (aadlDir.up / "hamr" / "slang").string, | ||
"--output-c-dir", (aadlDir.up / "hamr" / "c").string, | ||
"--run-transpiler", | ||
"--bit-width", "32", | ||
"--max-string-size", "256", | ||
"--max-array-size", "1", | ||
"--exclude-component-impl", | ||
"--verbose", | ||
//"--no-proyek-ive", | ||
"--camkes-output-dir", (aadlDir.up / "hamr" / s"camkes-${platform.string}").string, | ||
"--experimental-options", "GENERATE_DOT_GRAPHS", | ||
"--aadl-root-dir", aadlDir.string, | ||
(aadlDir / ".system").string) | ||
|
||
val results = Os.proc(osireum ++ codegenArgs).console.run() | ||
|
||
// Running under windows results in 23 which is an indication | ||
// a platform restart was requested. Codegen completes | ||
// successfully and the cli app returns 0 so | ||
// not sure why this is being issued. | ||
if(results.exitCode == 0 || results.exitCode == 23) { | ||
Os.exit(0) | ||
} else { | ||
println(results.err) | ||
Os.exit(results.exitCode) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
basic/test_data_port_periodic_three_domains_CASE/hamr/camkes-seL4_Only/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Do not edit this file as it will be overwritten if HAMR codegen is rerun | ||
|
||
cmake_minimum_required(VERSION 3.8.2) | ||
|
||
project (top_impl_Instance C) | ||
|
||
add_definitions(-DCAMKES) | ||
|
||
include(${CMAKE_CURRENT_LIST_DIR}/CMake_CAmkES_VM_Options.cmake) | ||
|
||
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "(C|c?)lang") | ||
add_compile_options("$<$<CONFIG:Release>:-Oz>") | ||
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") | ||
add_compile_options(-fstack-usage) | ||
add_compile_options("$<$<CONFIG:Release>:-Os>") | ||
endif() | ||
|
||
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/types) | ||
|
||
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/components/VM) | ||
|
||
DeclareCAmkESComponent(T1_i_p1_t1 | ||
SOURCES components/T1_i_p1_t1//src/T1.c components/T1_i_p1_t1/src/sb_T1_i.c types/src/sp_int8_t.c | ||
INCLUDES components/T1_i_p1_t1/includes/ types/includes types/includes | ||
) | ||
|
||
DeclareCAmkESComponent(T2_i_p2_t2 | ||
SOURCES components/T2_i_p2_t2//src/T2.c components/T2_i_p2_t2/src/sb_T2_i.c types/src/sp_int8_t.c types/src/sp_int8_t.c | ||
INCLUDES components/T2_i_p2_t2/includes/ types/includes types/includes types/includes | ||
) | ||
|
||
DeclareCAmkESComponent(Pacer | ||
SOURCES components/Pacer/src/Pacer.c | ||
LIBS SB_Type_Library | ||
) | ||
|
||
DeclareCAmkESRootserver(top_impl_Instance.camkes) |
7 changes: 7 additions & 0 deletions
7
...data_port_periodic_three_domains_CASE/hamr/camkes-seL4_Only/CMake_CAmkES_VM_Options.cmake
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
option(BUILD_CROSSVM | ||
"Checkout and configure linux to build crossvm module instead of using pre-configured rootfs" | ||
OFF) | ||
|
||
if("$ENV{BUILD_CROSSVM}" STREQUAL "ON") | ||
set(BUILD_CROSSVM ON) | ||
endif() |
Oops, something went wrong.