Hello raghurajappa,
Thank you for your interest in understanding how the MBDT generation code works.
Unfortunately, we can only guide you on how to insert custom code to fulfill your requirements. This toolbox, even if it's free is not open source, this being the reason why we provide most of our scripts as p files. I hope you understand.
Now, I don't know how your model looks like but if you are not using one of the toolbox gpio's blocks the tool does not copy the gpio_564xl_library.c in the generating code, so this must be also done. Another issue might be that under the S-Function Builder->Libraries->Include you need to include also the gpio_564xl_library.h file which also must be copied.
There is also another way of inserting custom code in your model, the one presented as my response at your question Including custom code .
Hope this helps,
Marius