- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
From your bsp I see you are actually not using TCM in your project; everything is still in ddr2. So your code stopped working after you simply added TCM ports.
At first glance I can't see any flaw in the design itself. Did you check if the extra resources requested from fpga caused gave rise to any timing problems?- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello There,
There is no no extra resource request from FPGA. just figurung out how to use tightly coupled instruction and data memory to speed up the performance. 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..? Regards kaushal- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- 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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As I said before, it's very unlikely your code can wholly fit into onchip memory. Using stdio and other lib functions brings to big code size, even if you write a basic "Hello world" application. You should map into TCM only time critical functions and data.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page