Simulating a TFLM inference on ModelSim

Skip to first unread message

Joan Mihali

Oct 11, 2021, 10:05:17 AM10/11/21
to SIG Micro
Hello everybody,

I am currently working on the development of a MCU architecture that is based on the CV32E40P core. In the process, we are simulating example applications using the QuestaSim simulator.

At the moment, we are trying to simulate a simple Tensorflow-Lite Micro inference program on the system. For that, I would like to compile TFLM as a static library, in order to link it to the object of the inference program and create an ELF executable. The ELF will be read during the simulation and provide the inputs to the system.

The question is, how do I compile TFLM as a static library? Online I found some instructions on how to compile TFLM as a shared library, but a shared library would make our task too complicated.


Advait Jain

Oct 15, 2021, 2:05:02 PM10/15/21
to Joan Mihali, SIG Micro
Hi Joan,

You can compile a static library via the microlite target.

For example:
make -f tensorflow/lite/micro/tools/make/Makefile microlite
will create a static lib for x86:

Having said that, TFLM does not have any notion of public headers. So, to use this static library, you would likely have to also import the full TFLM tree.

My guess is that you might have more success building TFLM from source for your specific target by following the new platform support documentation.


You received this message because you are subscribed to the Google Groups "SIG Micro" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit
Reply all
Reply to author
0 new messages