[RFC] [uTVM] Embedded C Runtime Interface

I believe this should function as you’re intending and I do believe this is a valid use-case. My only concern is with relying on the structures matching the arrays memory layout but you’ve articulated a further workaround to that if required. If it becomes cumbersome, this is itself a thin layer over the AOT main and we could toggle a pointer array, or such generic use cases can instead use the packed API?

I did envisage something like:

struct tvmgen_my_model_memory {
  void* sram, 
  void* flash,
  void* params
};

Where-as I believe you want to fine grain the parameters as well:

struct tvmgen_my_model_memory {
  void* sram, 
  void* flash,
  void* param0,
  void* param1
};

I don’t see an issue with breaking down the parameters further so we can set them for individual parts of the model. This could be useful for partial OTA updating :smile_cat:

I think you’d still require a linker script to move the relevant sections to the right memory locations, so it should be possible to generate a linker script to instead move specific symbols and enforce alignment?

I’ve put an example output in the PR, it has struct-level brief such as this, so hopefully that’s good :smile_cat: