Skip to content

Commit dad2e6b

Browse files
committed
Add temporary WARDuino-symbolic submodule and update setup to enable concolic mode
1 parent 30361f6 commit dad2e6b

3 files changed

Lines changed: 28 additions & 14 deletions

File tree

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
[submodule "WARDuino"]
22
path = WARDuino
33
url = git@github.com:TOPLLab/WARDuino.git
4+
[submodule "WARDuino-symbolic"]
5+
path = WARDuino-symbolic
6+
url = git@github.com:TOPLLab/WARDuino.git

WARDuino-symbolic

Submodule WARDuino-symbolic added at d0541f0

build.gradle.kts

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -60,22 +60,24 @@ tasks.register<Jar>("fatJar") {
6060
}
6161
}
6262

63-
val wdcliPath = projectDir.absolutePath + "/WARDuino/build-emu/wdcli"
64-
65-
tasks.register<Exec>("cmakeWARDuino") {
66-
val buildDir = File(File(wdcliPath).parent)
63+
fun cmakeBuildTask(dir: String): String {
64+
val buildDir = File(File(dir).parent)
6765
buildDir.mkdirs()
68-
workingDir(buildDir)
69-
commandLine("sh", "-c", "cmake .. -DBUILD_EMULATOR=ON")
70-
}
7166

72-
tasks.register<Exec>("makeWARDuino") {
73-
dependsOn("cmakeWARDuino")
67+
val name = buildDir.parentFile.name
7468

75-
val buildDir = File(File(wdcliPath).parent)
76-
buildDir.mkdirs()
77-
workingDir(buildDir)
78-
commandLine("sh", "-c", "make")
69+
tasks.register<Exec>("cmake-$name") {
70+
workingDir(buildDir)
71+
commandLine("sh", "-c", "cmake .. -DBUILD_EMULATOR=ON")
72+
}
73+
74+
tasks.register<Exec>("make-$name") {
75+
dependsOn("cmake-$name")
76+
workingDir(buildDir)
77+
commandLine("sh", "-c", "make")
78+
}
79+
80+
return "make-$name"
7981
}
8082

8183
fun setDefaultZephyrWasmBinary() {
@@ -84,9 +86,15 @@ fun setDefaultZephyrWasmBinary() {
8486
File(projectDir.absolutePath + "/examples/binary-counter/upload.wasm.map").copyTo(File(zephyrBuildDir.absolutePath + "/upload.wasm.map"), overwrite = true)
8587
}
8688

89+
val wdcliPath = projectDir.absolutePath + "/WARDuino/build-emu/wdcli"
90+
val wdcliSymbolicPath = projectDir.absolutePath + "/WARDuino-symbolic/build-emu/wdcli"
91+
private val compileWdcliTask = cmakeBuildTask(wdcliPath)
92+
private val compileWdcliSymbolicTask = cmakeBuildTask(wdcliSymbolicPath)
93+
8794
tasks.register<Copy>("setup") {
8895
dependsOn("fatJar")
89-
dependsOn("makeWARDuino")
96+
dependsOn(compileWdcliTask)
97+
dependsOn(compileWdcliSymbolicTask)
9098
setDefaultZephyrWasmBinary()
9199

92100
// Setup configuration file.
@@ -96,6 +104,8 @@ tasks.register<Copy>("setup") {
96104
println("Generating a default configuration file ${file.absolutePath}")
97105
val properties = Properties()
98106
properties.setProperty("wdcli", wdcliPath)
107+
properties.setProperty("wdcli-symbolic", wdcliSymbolicPath)
108+
properties.setProperty("concolic", "true")
99109
properties.store(file.writer(), null)
100110
}
101111
}

0 commit comments

Comments
 (0)