Reply by Richard Williams April 5, 20092009-04-05
venkat,

The easiest way I know of to locate data at specific addresses (same technique
works for functions also)

IN the source file,
#pragma the name to be used in the linker command file, immediately followed by
the data definition.

in the linker command file
locate a section of memory (for data, in the data page)
I.E.
in section:
mydatasection origin=xxxx, length=yyyy
in memory section
(using name from #pragma)
pragmaname : > mydatasection, page=0

r. williams

---------- Original Message -----------
From: "Venkat Rajagopalan"
To: c...
Sent: Sun, 15 Mar 2009 06:43:56 -0000
Subject: [c6x] Does C6X linker command file accept words instead of actual addresses

> Hi,
> Does C6X linker command file accept words instead of actual addresses
> and size values in hexadecimal numbers?
>
> This way if the same address is have many memory sections in my linker
> command, and a base address, I can use #defines for them, that compute
> the memory map and the sections can be apportioned to appropriate
> addresses represented as letters in linker command file, but #defined
> in some other file.
>
> I am using make files to compile.
>
> BTW When I post replies to other queries, I do not see them. Do they
> get moderated before they are posted ?
------- End of Original Message -------

_____________________________________
Reply by Michael Dunn March 22, 20092009-03-22
Venkat,

On Sun, Mar 22, 2009 at 1:44 PM, rvsasi wrote:
> Mike,
> Thanks for your reply.
>
> You cannot use symbols for addresses in the LCF unless it was added to
> a very recent compiler update.
> As far as I know, the primary reason for address changes would be
> hardware related [external or internal memory size or location
> differences.
>>> yes especially when we experiment with data or program cache
>>> optimization. This becomes an invaluable tool. Not clear why TI does not
>>> support this feature. We need to have separate perl scripts to do the
>>> translation and we need to maintain them.
>
>
> I do not understand what you want to.
> What I meant is
>
> SECTION A: orig:SECA_START_ADDR,size=SECA_SIZE
> SECTION B: orig:SECB_START_ADDR,size=SECB_SIZE
>
> Now my placement could be such that seca_start_addr could be prior to secb
> or after that, depending upon my needs.
>
> so I would have another header file, where they will all be related to a
> base address.
>
> #define BASE_ADDR_EXTRAM 0x1000000
> #define PMEM_OFFSET 0x400000
> #define SECA_START_ADDR BASE_ADDR_RAM + FIXED_OFFSET
> #define SECB_START_ADDR SECA_START_ADDR + SECA_SIZE
>
> In this way all the addresses values are computed based on the relationshios
> established between them,as required


FYI - a comment - your 'fixed relationship model' does not work with
you previous statement about reordering.

Others have solved this problem in different ways.
1. Use header files and the C preprocessor to generate a custom LCF
before invoking the compiler. I would not suggest this unless you are
comfortable with using the C preprocessor.
2. Use a scripting language like perl or python to generate a custom
LCF from a spec file.
3. Manually create a unique LCF for each device. In normal use [2-3
devices], this might be the most prudent unless you are doing a lot of
experimentation.

mikedunn
>
> On my issue with my replies
>
> I will check on my replies, as suggested
> Regards
> --- On Sun, 3/15/09, Michael Dunn wrote:
>
> Venkat,
>
> On Sun, Mar 15, 2009 at 1:43 AM, Venkat Rajagopalan
> wrote:
>> Hi,
>> Does C6X linker command file accept words instead of actual addresses and
>> size values in hexadecimal numbers?
>
>
> You cannot use symbols for addresses in the LCF unless it was added to
> a very recent compiler update.
> As far as I know, the primary reason for address changes would be
> hardware related [external or internal memory size or location
> differences.
>
>>
>> This way if the same address is have many memory sections in my linker
>> command, and a base address, I can use #defines for them, that compute the
>> memory map and the sections can be apportioned to appropriate addresses
>> represented as letters in linker command file, but #defined in some other
>> file.
>
>
> I do not understand what you want to.
>>
>> I am using make files to compile.
>>
>> BTW When I post replies to other queries, I do not see them. Do they get
>> moderated before they are posted ?
>
>
> This is a moderated group but all 'on topic content' is posted. Also
> check your 'sent mailbox' if you have one,
>
Reply by rvsasi March 22, 20092009-03-22
Mike,
Thanks for your reply.



You cannot use symbols for addresses in the LCF unless it was added to

a very recent compiler update.

As far as I know, the primary reason for address changes would be

hardware related [external or internal memory size or location

differences.
>> yes especially when we experiment with data or program cache optimization. This becomes an invaluable tool. Not clear why TI does not support this feature. We need to have separate perl scripts to do the translation and we need to maintain them.


I do not understand what you want to.
What I meant is

SECTION A: orig:SECA_START_ADDR,size=SECA_SIZE
SECTION B: orig:SECB_START_ADDR,size=SECB_SIZE

Now my placement could be such that seca_start_addr could be prior to secb or after that, depending upon my needs.

so I would have another header file, where they will all be related to a base address.

#define BASE_ADDR_EXTRAM 0x1000000
#define PMEM_OFFSET 0x400000
#define SECA_START_ADDR BASE_ADDR_RAM + FIXED_OFFSET
#define SECB_START_ADDR SECA_START_ADDR + SECA_SIZE

In this way all the addresses values are computed based on the relationshios established between them,as required

On my issue with my replies

I will check on my replies, as suggested
Regards
--- On Sun, 3/15/09, Michael Dunn wrote:

Venkat,

On Sun, Mar 15, 2009 at 1:43 AM, Venkat Rajagopalan wrote:

> Hi,

> Does C6X linker command file accept words instead of actual addresses and

> size values in hexadecimal numbers?



You cannot use symbols for addresses in the LCF unless it was added to

a very recent compiler update.

As far as I know, the primary reason for address changes would be

hardware related [external or internal memory size or location

differences.
>

> This way if the same address is have many memory sections in my linker

> command, and a base address, I can use #defines for them, that compute the

> memory map and the sections can be apportioned to appropriate addresses

> represented as letters in linker command file, but #defined in some other

> file.



I do not understand what you want to.

>

> I am using make files to compile.

>

> BTW When I post replies to other queries, I do not see them. Do they get

> moderated before they are posted ?



This is a moderated group but all 'on topic content' is posted. Also

check your 'sent mailbox' if you have one,

Note: If you do a simple "reply" with your email client, only the author of

this message will receive your answer. You need to do a "reply all" if you

want your answer to be distributed to the entire group.

mikedunn

>

>

--

www.dsprelated. com/blogs- 1/nf/Mike_ Dunn.php
Reply by Michael Dunn March 15, 20092009-03-15
Venkat,

On Sun, Mar 15, 2009 at 1:43 AM, Venkat Rajagopalan wrote:
> Hi,
> Does C6X linker command file accept words instead of actual addresses and
> size values in hexadecimal numbers?


You cannot use symbols for addresses in the LCF unless it was added to
a very recent compiler update.
As far as I know, the primary reason for address changes would be
hardware related [external or internal memory size or location
differences.
>
> This way if the same address is have many memory sections in my linker
> command, and a base address, I can use #defines for them, that compute the
> memory map and the sections can be apportioned to appropriate addresses
> represented as letters in linker command file, but #defined in some other
> file.


I do not understand what you want to.
>
> I am using make files to compile.
>
> BTW When I post replies to other queries, I do not see them. Do they get
> moderated before they are posted ?


This is a moderated group but all 'on topic content' is posted. Also
check your 'sent mailbox' if you have one,
Reply by Venkat Rajagopalan March 15, 20092009-03-15
Hi,
Does C6X linker command file accept words instead of actual addresses and size values in hexadecimal numbers?

This way if the same address is have many memory sections in my linker command, and a base address, I can use #defines for them, that compute the memory map and the sections can be apportioned to appropriate addresses represented as letters in linker command file, but #defined in some other file.

I am using make files to compile.

BTW When I post replies to other queries, I do not see them. Do they get moderated before they are posted ?

_____________________________________