Skip to content

Commit

Permalink
Minimum reaction and event queue size is 1
Browse files Browse the repository at this point in the history
  • Loading branch information
erlingrj committed Nov 28, 2024
1 parent bfa8a74 commit 044d6ae
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import org.lflang.unreachable
import org.lflang.util.FileUtil
import java.nio.file.Path
import java.time.LocalDateTime
import kotlin.math.max

class UcCmakeGenerator(private val main: Reactor, private val targetConfig: TargetConfig, private val fileConfig: FileConfig) {
private val S = '$' // a little trick to escape the dollar sign with $S
Expand Down Expand Up @@ -49,8 +50,8 @@ class UcCmakeGenerator(private val main: Reactor, private val targetConfig: Targ
|cmake_minimum_required(VERSION 3.5)
|project(${fileConfig.name} VERSION 0.0.0 LANGUAGES C)
|set(PLATFORM POSIX CACHE STRING "Target platform")
|set(REACTION_QUEUE_SIZE ${main.getReactionQueueSize()} CACHE STRING "Size of the reaction queue")
|set(EVENT_QUEUE_SIZE ${main.getEventQueueSize()} CACHE STRING "Size of the event queue")
|set(REACTION_QUEUE_SIZE ${max(main.getReactionQueueSize(), 1)} CACHE STRING "Size of the reaction queue")
|set(EVENT_QUEUE_SIZE ${max(main.getEventQueueSize(), 1)} CACHE STRING "Size of the event queue")
|
|set(LF_MAIN_TARGET ${fileConfig.name})
|set(SOURCES
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import org.lflang.target.property.BuildTypeProperty
import org.lflang.toUnixString
import java.nio.file.Path
import java.time.LocalDateTime
import kotlin.math.max

class UcMakeGenerator(private val main: Reactor, private val targetConfig: TargetConfig, private val fileConfig: FileConfig) {
private val S = '$' // a little trick to escape the dollar sign with $S
Expand All @@ -19,8 +20,8 @@ class UcMakeGenerator(private val main: Reactor, private val targetConfig: Targe
| # Makefile genrated for ${fileConfig.name}
|LF_SOURCES = \
${" | "..sources.joinWithLn { it.toUnixString() + " \\ "}}
|REACTION_QUEUE_SIZE = ${main.getReactionQueueSize()}
|EVENT_QUEUE_SIZE = ${main.getEventQueueSize()}
|REACTION_QUEUE_SIZE = ${max(main.getReactionQueueSize(), 1)}
|EVENT_QUEUE_SIZE = ${max(main.getEventQueueSize(), 1)}
|
""".trimMargin()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ class UcReactorGenerator(private val reactor: Reactor, fileConfig: UcFileConfig,
res += reactions.size
return res
}

}


Expand Down

0 comments on commit 044d6ae

Please sign in to comment.