Forum Discussion
Altera_Forum
Honored Contributor
12 years ago --- Quote Start --- There is no no extra resource request from FPGA. j --- Quote End --- Adding TCM or simply adding the TC ports on Nios DOES require extra resources from FPGA, since the additional logic related to the TC controller has to be implemented. --- Quote Start --- So how do i put TCM in my project ? Is adding these two in sopc is not sufficient...? Do we need to add something in code too..? --- Quote End --- No. Adding those blocks in sopc is not enough. You also need to instruct the compiler to use them. You can either change the linker settings in bsp, or move single functions/variables into TCM with code directives. In the bsp linker settings you can move a whole code section into the desired memory: in your case you must change the setting from ddr2_bot to tcm. Code defaults to .text section, but it's generally unlikely it can all fit in TCM, which is very small compared to ddr2. So you'd need to add a new code memory section to be mapped to TCM and you place here only the time critical code. In case you only have a few well defined time critical functions, it's easier to map them singularly using the an attribute directive just after the function definition: For example: int tcm_function(int p) __attribute__ ((section (".tightly_coupled_code"))); would place tcm_function in the specified memory (replace "tightly_coupled_code" with the actual memory name you used in sopc) The same applies to data: either change the .rwdata mapping in linker settings or place the attribute directive after each variable you want to move to tcm.