I'm using Matlab coder to generate C code for my project so that I can put it through HLS. As I know, Matlab has an HDL coder toolbox to implement algorithm in Matlab and Simulink for HDL programming. However, my project requires to add some other modification in the HDL level with the use of Vivado HLS. Thus, I need to manually modify and redefine the C code generated by Matlab Coder. Right now, I have some trouble with the hierachy of the generated C code, and causes my a lot of troubles in debugging. Below is my Matlab code hierachy:
It means that I have a file named as Rk_4.m that is calling a lower level file (IS_dynamics.m) mutiple times during the execution. After using Matlab coder for Rk_4.m file, I noticed that the generated C code in Rk_4.c didn't make any call to the function IS_dynamics as it did in Matlab. Instead, it generates C code for IS_dynamics.m file and places inside the Rk_4.c, which creates a complicated and hard to keep track c code file. Hopefully, the picture below can explain more what my problem is:
Thus, I want to ask, If there is an option in Matlab coder that I can generate my RK_4.c file so that It will call the function IS_dynamics (maybe from the file IS_dynamics.c) instead of extracting IS_dynamic.m directly inside RK_4.c.