You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To help enable the other changes and refactoring being done to support non-1 SAVEPER values in #291, I'm proposing to change the code gen to emit 3 accessors/getters for INITIAL TIME, FINAL TIME, and SAVEPER. These values are needed by the runtime and runtime-async packages when allocating the buffers that will hold the output values. The generated C code would look like this:
Once these are available, we'll be able to simplify the build and runtime packages:
Currently the build package expects the developer to provide the initial/final times in the sde.config.js file, but this is error prone (because they can get out of sync with the actual values in the mdl) and also just redundant configuration. It shouldn't be necessary to pass these in as long as we can read them from the generated model.
Once these accessors are available, the runtime package can read them after initializing the wasm module, and crucially, we'll have access to the SAVEPER value so that we can fix the few other places that are currently assuming it to be 1.
I have the code gen changes set up such that it expects INITIAL TIME and FINAL TIME to be constant values, and SAVEPER can either be a constant numeric value or equal to TIME STEP (which is also expected to be constant). I think these are valid assumptions given the way the rest of the native code works.
The text was updated successfully, but these errors were encountered:
To help enable the other changes and refactoring being done to support non-1
SAVEPER
values in #291, I'm proposing to change the code gen to emit 3 accessors/getters forINITIAL TIME
,FINAL TIME
, andSAVEPER
. These values are needed by theruntime
andruntime-async
packages when allocating the buffers that will hold the output values. The generated C code would look like this:Once these are available, we'll be able to simplify the
build
andruntime
packages:build
package expects the developer to provide the initial/final times in thesde.config.js
file, but this is error prone (because they can get out of sync with the actual values in the mdl) and also just redundant configuration. It shouldn't be necessary to pass these in as long as we can read them from the generated model.runtime
package can read them after initializing the wasm module, and crucially, we'll have access to theSAVEPER
value so that we can fix the few other places that are currently assuming it to be 1.I have the code gen changes set up such that it expects
INITIAL TIME
andFINAL TIME
to be constant values, andSAVEPER
can either be a constant numeric value or equal toTIME STEP
(which is also expected to be constant). I think these are valid assumptions given the way the rest of the native code works.The text was updated successfully, but these errors were encountered: