Embedded firmware might not be exactly the same when cross-comiled to run on the modelling workstation.
We may need to recompile the hardware/software interface when compiling for TLM model as compared to the actual firmware.
Typically, differences are minor and can implemented in C preprocessor. For instance:
#ifdef ACTUAL_FIRMWARE #define UART_WRITE(A, D) (*(uart_base+A*4)) = (D) #else #define UART_WRITE(A, D) uart.write(A, D) #endif
It is also possible to use the workstation VM system to trap calls from natively-compiled firmware to hardware: this requires the memory map of the embedded system to resemble that of the workstation and does not give good performance.