DSPRelated.com
Forums

If the WIDTH value is modified in the LDF file, what changes will be in dxe and

Started by chenlovedll November 30, 2005
If the WIDTH value is modified in the LDF file, what changes will be
in dxe and ldr file?
Hi all,
I am a college student currently working on a project using Visual
DSP++ 4.0. I use the Expert Linker to create a LDF file(for
AD21060), and I use the default options to create the LDF file. I
build the project and get some dojs, a dxe file and a ldr file.
1.
There is a command:
seg_dmda { TYPE(DM RAM) START(0x00030000) END(0x00037fff) WIDTH(32) }
in the LDF file,and I try to modify the number 32 to 48, and change
the following command:
seg_heap { TYPE(DM RAM) START(0x00038000) END(0x0003dfff) WIDTH(32) }
to :seg_heap { TYPE(DM RAM) START(0x0003c000) END(0x0003dfff) WIDTH
(32) }
after that, I build the same project again,and get dojs, another dxe
file and another ldr file. I use the elfdump and get the seg_dmda
sections from both dxe files. I thought that if the width was 32,the
bytes alignment would be 4, while the width 48 be 6.To o my
surprise, they are both aligned for 4 bytes, like this:00000009
00000000 02000000...But in fact, that's two variables I defined,with
the value of 9 and 2. So if we split 00000009 00000000 0200 to
0000000900 and 0000000200 we can get their meanings clearly, but why
the alignment is 4 bytes?
2.
I use elfdump,dump the content of the two dxe file and compare them,
and I find some differences about sections offsets and sizes. I also
find that the two ldr files are different. Obviously, the
differences must be caused by my modification of 32 to 48.
As a beginner, I want to know the really meaning of different
WIDTHs? what value can I set? and, what's the ristriction?
3.
I try to link the doj files during which I have to compute the
actual symbol value by adding the the symbol's value to the related
section's start address, after a doj file's combination,I modify the
start address like this: startaddr += (combined section size)/(bytes
number),for seg_pmco section, the bytes number I used is 6, but for
seg_dmda,I have to use 5 to get the correct value.
Can I allaways use 5 for seg_dmda no matter what I set the WIDTH in
LDF file?
and I find that in the ldr file the variable values are all saved as
6 bytes and the byte consequence is reversed,for example, I define a
variable int g_c2 = 0xedbc1234; in the dxe file, it's saved as
edbc123400, but in ldr file, it's saved as:003412bced00.
Why it's 6 bytes in ldr file with reverse consequence? Is there any
relationship between the number set in WIDTH and the ldr file?
If some modification is made, what's the main caused difference?
Thank you very much!
ChenQi


Dear ChenQi,

I am not good at either software nor AD21060 but I hope following point may
help you.

I assume the data bus width of AD21060 is 32bit. So, the restriction is you
can connect only 32bits at a time to an external SDRAM. If you define the
width as 48, then the additional 16bits(48-32) would definitely fit into the
next 32 bit transfer. This all is taken care by the SDRAM controller of
AD21060. You have to see how your SDRAM controller behaves when the
specified data width is not equal to the data bus width(32-bit). The same is
the case with internal memories also.

Regards,
Vikas.

-----Original Message-----
From: adsp@adsp... [mailto:adsp@adsp...]On Behalf Of
chenlovedll
Sent: Thursday, December 01, 2005 7:22 AM
To: adsp@adsp...
Subject: [adsp] If the WIDTH value is modified in the LDF file, what
changes will be in dxe and If the WIDTH value is modified in the LDF file, what changes will be
in dxe and ldr file?
Hi all,
I am a college student currently working on a project using Visual
DSP++ 4.0. I use the Expert Linker to create a LDF file(for
AD21060), and I use the default options to create the LDF file. I
build the project and get some dojs, a dxe file and a ldr file.
1.
There is a command:
seg_dmda { TYPE(DM RAM) START(0x00030000) END(0x00037fff) WIDTH(32) }
in the LDF file,and I try to modify the number 32 to 48, and change
the following command:
seg_heap { TYPE(DM RAM) START(0x00038000) END(0x0003dfff) WIDTH(32) }
to :seg_heap { TYPE(DM RAM) START(0x0003c000) END(0x0003dfff) WIDTH
(32) }
after that, I build the same project again,and get dojs, another dxe
file and another ldr file. I use the elfdump and get the seg_dmda
sections from both dxe files. I thought that if the width was 32,the
bytes alignment would be 4, while the width 48 be 6.To o my
surprise, they are both aligned for 4 bytes, like this:00000009
00000000 02000000...But in fact, that's two variables I defined,with
the value of 9 and 2. So if we split 00000009 00000000 0200 to
0000000900 and 0000000200 we can get their meanings clearly, but why
the alignment is 4 bytes?
2.
I use elfdump,dump the content of the two dxe file and compare them,
and I find some differences about sections offsets and sizes. I also
find that the two ldr files are different. Obviously, the
differences must be caused by my modification of 32 to 48.
As a beginner, I want to know the really meaning of different
WIDTHs? what value can I set? and, what's the ristriction?
3.
I try to link the doj files during which I have to compute the
actual symbol value by adding the the symbol's value to the related
section's start address, after a doj file's combination,I modify the
start address like this: startaddr += (combined section size)/(bytes
number),for seg_pmco section, the bytes number I used is 6, but for
seg_dmda,I have to use 5 to get the correct value.
Can I allaways use 5 for seg_dmda no matter what I set the WIDTH in
LDF file?
and I find that in the ldr file the variable values are all saved as
6 bytes and the byte consequence is reversed,for example, I define a
variable int g_c2 = 0xedbc1234; in the dxe file, it's saved as
edbc123400, but in ldr file, it's saved as:003412bced00.
Why it's 6 bytes in ldr file with reverse consequence? Is there any
relationship between the number set in WIDTH and the ldr file?
If some modification is made, what's the main caused difference?
Thank you very much!
ChenQi