A platform API was recently added to MLonMCU and it's idea can be described as follows:
Common interface: Platform
Specific platform types/classes:
CompilePlatform: A platform which is able to build target software with given codegen results
TargetPlatform: A platform with the ability to flash/monitor specific (hardware) targets
A certain platform (say espidf or platformio) inherits from one or both of the base classes depending on the implemented features
Platforms can also be seen as a "target registry" as they are able to dynamically create Target instances for supported target names.
This Issue proposes to add another type of platforms: BuildPlatform
This would be a platform which wraps around a backend and should be therefore able to run code generation.
A realistic example of how this might be use would be a microtvm platform as TVM provides a Project API with templates to support large number of target devices. The full flow from building a model over compiling the running the model (using an RPC server) can be handled using the tvmc micro tool.
I am actually not sure if this would be a good idea at some point in time, however it always make sense to think about ways to generalize existing APIs. For this reason this should mainly be documenting the concept which might get picked up at some point.
A platform API was recently added to MLonMCU and it's idea can be described as follows:
Platform
CompilePlatform
: A platform which is able to build target software with given codegen resultsTargetPlatform
: A platform with the ability to flash/monitor specific (hardware) targetsespidf
orplatformio
) inherits from one or both of the base classes depending on the implemented featuresTarget
instances for supported target names.This Issue proposes to add another type of platforms:
BuildPlatform
This would be a platform which wraps around a backend and should be therefore able to run code generation. A realistic example of how this might be use would be amicrotvm
platform as TVM provides aProject API
with templates to support large number of target devices. The full flow from building a model over compiling the running the model (using an RPC server) can be handled using thetvmc micro
tool.I am actually not sure if this would be a good idea at some point in time, however it always make sense to think about ways to generalize existing APIs. For this reason this should mainly be documenting the concept which might get picked up at some point.