Hi, We have come up with two possible solutions to solve the 20 bit data access problem in m16c targets. We are very grateful for all the suggestions until now on this issue.
Solution 1 is based on the discussion at the following link -: http://gcc.gnu.org/ml/gcc/2007-04/msg00402.html - 2 new attributes "far_data" (to use external memory for data storage) and "far_rodata" will be added. - Non-constant initialized variables specified with the attribute "far_data" will be placed in the section ".fdata" (far memory). - Constant variables specified with the attribute "far_rodata" will be placed in the section ".frodata" (far memory). - Default linker script will be modified for the addition of two new sections ".fdata" and "frodata". - LDE/STE instructions will be used to access the variables specified with the attribute "far_data" and "far_rodata". - Default constant strings (ex. strings in printf) and constant variable without the attribute "far_rodata" will be placed in Section '.rodata' (current implementation). - The section '.rodata' has to be still copied from ROM to RAM (current implementation for M16C devices that does not have Flash in near memory). Solution 2 based on the discussion at the following link -: http://sources.redhat.com/ml/binutils/2007-05/msg00381.html - By default, LDE instructions will be used to access the entire constant variables. - A new target specific option "-mno-far-constdata" will be added. - This option can be used to override default generation of LDE instructions. 'MOV' instruction will be used to access these variables instead (current implementation). - New attribute "far_data" (to use external memory for data storage) will be added. - Non-constant initialized variables specified with the attribute "far_data" will be placed in a section ".fdata" (far memory). - LDE/STE instructions will be used to access the non-constant variables specified with the attribute "far_data". - New attribute "near_rodata" will be added. This attribute will be used for the latest M16C targets that have 4K/8K flash in near Memory. - Constant variables specified with the attribute "near_rodata" will be placed in a section ".nrodata" (near memory). - MOV instructions will be used to access the constant variables specified with the attribute "near_rodata". - Default linker script will be modified for placing the default section '.rodata' in Far Memory. - Default linker script will be modified for the addition of a new section '.fdata' in far memory and "nrodata" in near memory. Please comment on above proposed solutions and also let us know the possibility of acceptance of any of these by FSF. Regards, Naveen.H.S. KPIT Cummins Infosystems Ltd, Pune (INDIA) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Free download of GNU based tool-chains for Renesas' SH, H8, R8C, M16C and M32C Series. The following site also offers free technical support to its users. Visit http://www.kpitgnutools.com for details. Latest versions of KPIT GNU tools were released on June 1, 2007. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~