Понятно! Сначала приведу map-файл не полной программы, пытался ее разбить на части
map-файл:
******************************************************************************
TMS320C6x Linker PC v7.0.3
******************************************************************************
>> Linked Tue Jun 05 22:30:25 2012
OUTPUT FILE NAME: <C6457.out>
ENTRY POINT SYMBOL: "_c_int00" address: 00846820
MEMORY CONFIGURATION
name origin length used unused attr fill
---------------------- -------- --------- -------- -------- ---- --------
L2 00800000 00200000 00047352 001b8cae RWIX
L1P 00e00000 00008000 00000000 00008000 RWIX
L1D 00f00000 00008000 00000000 00008000 RWIX
SECTION ALLOCATION MAP
output attributes/
section page origin length input sections
-------- ---- ---------- ---------- ----------------
.stack 0 00800000 00030000 UNINITIALIZED
00800000 00000008 rts64plus.lib : boot.obj (.stack)
00800008 0002fff8 --HOLE--
.bss 0 00800000 00000000 UNINITIALIZED
.data 0 00800000 00000000 UNINITIALIZED
.sysmem 0 00830000 00010000 UNINITIALIZED
00830000 00000008 rts64plus.lib : memory.obj (.sysmem)
00830008 0000fff8 --HOLE--
.text 0 00840000 00006bc0
00840000 00000680 rts64plus.lib : divd.obj (.text:__divd)
00840680 00000480 : _printfi.obj (.text:__setfield)
00840b00 00000440 : _printfi.obj (.text:__getarg_diouxp)
00840f40 000003a0 : _printfi.obj (.text:__printfi)
008412e0 00000300 : _printfi.obj (.text:_ecvt)
008415e0 00000300 : _printfi.obj (.text:_fcvt)
008418e0 00000300 : fputs.obj (.text:_fputs)
00841be0 00000300 : log.obj (.text:_log)
00841ee0 000002e0 : _printfi.obj (.text:__pproc_fge)
008421c0 000002e0 : _printfi.obj (.text:__pproc_fwp)
008424a0 000002a0 : _printfi.obj (.text:__pconv_e)
00842740 00000280 : memory.obj (.text:_free)
008429c0 00000260 : imath64.obj (.text:__divull)
00842c20 00000260 : mpyd.obj (.text:__mpyd)
00842e80 00000220 : addd.obj (.text:__addd)
008430a0 00000220 : _printfi.obj (.text:__pproc_diouxp)
008432c0 00000220 : _printfi.obj (.text:__pproc_str)
008434e0 00000200 : frcaddd.obj (.text:__frcaddd)
008436e0 000001e0 : frcmpyd_div.obj (.text:__frcmpyd_div)
008438c0 000001c0 : _printfi.obj (.text:__mcpy)
00843a80 000001a0 : trgdrv.obj (.text:_HOSTrename)
00843c20 000001a0 : imath40.obj (.text:__divul)
00843dc0 000001a0 : frexp.obj (.text:_frexp)
00843f60 000001a0 : setvbuf.obj (.text:_setvbuf)
00844100 00000180 : _printfi.obj (.text:__pconv_g)
00844280 00000180 : memory.obj (.text:_malloc)
00844400 00000140 : fputc.obj (.text:_fputc)
00844540 00000140 : lowlev.obj (.text:_getdevice)
00844680 00000120 : _printfi.obj (.text:__pproc_fflags)
008447a0 00000120 : fclose.obj (.text:_fclose)
008448c0 00000100 : trgdrv.obj (.text:_HOSTlseek)
008449c0 00000100 : frcmpyd.obj (.text:__frcmpyd)
00844ac0 00000100 : _printfi.obj (.text:__ltostr)
00844bc0 00000100 : _io_perm.obj (.text:__wrt_ok)
00844cc0 000000e0 : trgdrv.obj (.text:_HOSTopen)
00844da0 000000e0 : autoinit.obj (.text:__auto_init)
00844e80 000000e0 : cmpd.obj (.text:__cmpd)
00844f60 000000e0 : atoi.obj (.text:_atoi)
00845040 000000e0 : lowlev.obj (.text:_close)
00845120 000000e0 : exit.obj (.text:_exit)
00845200 000000e0 : memset.obj (.text:_memset)
008452e0 000000c0 : trgdrv.obj (.text:_HOSTread)
008453a0 000000c0 : trgdrv.obj (.text:_HOSTunlink)
00845460 000000c0 : trgdrv.obj (.text:_HOSTwrite)
00845520 000000c0 : fopen.obj (.text:__cleanup)
008455e0 000000c0 : _printfi.obj (.text:__div)
008456a0 000000c0 : divu.obj (.text:__divu)
00845760 000000c0 : fflush.obj (.text:__doflush)
00845820 000000c0 : fseek.obj (.text:_fseek)
008458e0 000000c0 : lowlev.obj (.text:_lseek)
008459a0 000000c0 : ltoa.obj (.text:_ltoa)
00845a60 000000c0 : lowlev.obj (.text:_write)
00845b20 000000a0 : trgdrv.obj (.text:_HOSTclose)
00845bc0 000000a0 : cvtdf.obj (.text:__cvtdf)
00845c60 000000a0 : imath40.obj (.text:__divli)
00845d00 000000a0 : _printfi.obj (.text:__ecpy)
00845da0 000000a0 : _printfi.obj (.text:__fcpy)
00845e40 000000a0 : fixdli.obj (.text:__fixdli)
00845ee0 000000a0 : _printfi.obj (.text:__pconv_f)
00845f80 000000a0 : lowlev.obj (.text:_finddevice)
00846020 000000a0 : memcpy64.obj (.text:_memcpy)
008460c0 000000a0 : memory.obj (.text:_minsert)
00846160 000000a0 : memory.obj (.text:_mremove)
00846200 000000a0 prob.obj (.text)
008462a0 00000080 rts64plus.lib : fixdi.obj (.text:__fixdi)
00846320 00000080 : fltlid.obj (.text:__fltlid)
008463a0 00000080 : llshift.obj (.text:__llshl)
00846420 00000080 : renormd.obj (.text:__renormd)
008464a0 00000080 : log10.obj (.text:_log10)
00846520 00000080 : printf.obj (.text:_printf)
008465a0 00000080 : trgmsg.obj (.text:_readmsg)
00846620 00000080 : lowlev.obj (.text:_unlink)
008466a0 00000060 : cvtfd.obj (.text:__cvtfd)
00846700 00000060 : fltid.obj (.text:__fltid)
00846760 00000060 : llshift.obj (.text:__llshru)
008467c0 00000060 : imath64.obj (.text:__subcull)
00846820 00000060 : boot.obj (.text:_c_int00)
00846880 00000060 : memccpy.obj (.text:_memccpy)
008468e0 00000060 : trgmsg.obj (.text:_writemsg)
00846940 00000040 : isinf.obj (.text:___isinf)
00846980 00000040 : _printfi.obj (.text:___isnan)
008469c0 00000040 : divd.obj (.text:___isnan)
00846a00 00000040 : args_main.obj (.text:__args_main)
00846a40 00000040 : negd.obj (.text:__negd)
00846a80 00000040 : imath40.obj (.text:__remli)
00846ac0 00000040 : subd.obj (.text:__subd)
00846b00 00000020 : negll.obj (.text:__negll)
00846b20 00000020 : _lock.obj (.text:__nop)
00846b40 00000020 : printf.obj (.text:__outc)
00846b60 00000020 : printf.obj (.text:__outs)
00846b80 00000020 : exit.obj (.text:_abort)
00846ba0 00000020 : remove.obj (.text:_remove)
.far 0 00846bc0 00000390 UNINITIALIZED
00846bc0 00000194 rts64plus.lib : defs.obj (.far)
00846d54 00000004 : errno.obj (.far)
00846d58 000000d0 : trgdrv.obj (.far)
00846e28 000000cc : lowlev.obj (.far)
00846ef4 00000004 : fopen.obj (.far)
00846ef8 00000030 : log.obj (.far)
00846f28 0000000c : exit.obj (.far)
00846f34 00000008 : _lock.obj (.far)
00846f3c 00000004 --HOLE--
00846f40 00000008 : divd.obj (.far)
00846f48 00000008 : memory.obj (.far)
.cinit 0 00846f50 000001b4
00846f50 0000005c rts64plus.lib : defs.obj (.cinit)
00846fac 00000004 --HOLE-- [fill = 0]
00846fb0 0000005c : lowlev.obj (.cinit)
0084700c 00000004 --HOLE-- [fill = 0]
00847010 00000040 : log.obj (.cinit)
00847050 0000002c : exit.obj (.cinit)
0084707c 00000004 --HOLE-- [fill = 0]
00847080 0000002c : memory.obj (.cinit)
008470ac 00000004 --HOLE-- [fill = 0]
008470b0 0000001c : _lock.obj (.cinit)
008470cc 00000004 --HOLE-- [fill = 0]
008470d0 00000010 : divd.obj (.cinit)
008470e0 0000000c : errno.obj (.cinit)
008470ec 00000004 --HOLE-- [fill = 0]
008470f0 0000000c : fopen.obj (.cinit)
008470fc 00000004 --HOLE-- [fill = 0]
00847100 00000004 (.pad.cinit) [fill = 0]
.const 0 00847108 0000012e
00847108 00000101 rts64plus.lib : ctype.obj (.const:__ctypes_)
00847209 00000023 : _printfi.obj (.const:.string)
0084722c 00000008 prob.obj (.const:.string)
00847234 00000002 rts64plus.lib : fputs.obj (.const:.string)
.cio 0 00847238 00000120 UNINITIALIZED
00847238 00000120 rts64plus.lib : trgmsg.obj (.cio)
GLOBAL SYMBOLS: SORTED ALPHABETICALLY BY Name
address name
-------- ----
00800000 $bss
00800000 .bss
00800000 .data
00840000 .text
00846b80 C$$EXIT
00846938 C$$IO$$
00845b20 _HOSTclose
008448c0 _HOSTlseek
00844cc0 _HOSTopen
008452e0 _HOSTread
00843a80 _HOSTrename
008453a0 _HOSTunlink
00845460 _HOSTwrite
00847238 __CIOBUF_
00830000 __STACK_END
00030000 __STACK_SIZE
00010000 __SYSMEM_SIZE
00000001 __TI_args_main
00846f30 ___TI_enable_exit_profile_output
ffffffff ___TI_pprof_out_hndl
ffffffff ___TI_prof_data_size
ffffffff ___TI_prof_data_start
ffffffff ___binit__
00800000 ___bss__
ffffffff ___c_args__
00846f50 ___cinit__
00800000 ___data__
00800000 ___edata__
00800000 ___end__
00846bc0 ___etext__
00846940 ___isinf
ffffffff ___pinit__
00840000 ___text__
00842e80 __addd
00846a00 __args_main
00844da0 __auto_init
008456a0 __c6xabi_divu
00845520 __cleanup
00846f28 __cleanup_ptr
00844e80 __cmpd
00847108 __ctypes_
00845bc0 __cvtdf
008466a0 __cvtfd
00840000 __divd
00845c60 __divli
008456a0 __divu
00843c20 __divul
008429c0 __divull
00845760 __doflush
00846f2c __dtors_ptr
008462a0 __fixdi
00845e40 __fixdli
00846700 __fltid
00846320 __fltlid
008434e0 __frcaddd
008449c0 __frcmpyd
008436e0 __frcmpyd_div
00846d50 __ft_end
00846bc0 __ftable
008463a0 __llshl
00846760 __llshru
00846f34 __lock
00842c20 __mpyd
00846a40 __negd
00846b00 __negll
00846b20 __nop
00840f40 __printfi
00846a80 __remli
00846420 __renormd
00800000 __stack
008467c0 __subcull
00846ac0 __subd
00830000 __sys_memory
00846cb0 __tmpnams
00846f38 __unlock
00844bc0 __wrt_ok
00846b80 _abort
00844f60 _atoi
00846820 _c_int00
00846200 _calculations
00845040 _close
00846d54 _errno
00845120 _exit
008447a0 _fclose
00844400 _fputc
008418e0 _fputs
00842740 _free
00843dc0 _frexp
00845820 _fseek
00841be0 _log
008464a0 _log10
008458e0 _lseek
008459a0 _ltoa
00846268 _main
00844280 _malloc
00846880 _memccpy
00846020 _memcpy
00845200 _memset
00846520 _printf
00844400 _putc
008465a0 _readmsg
00846ba0 _remove
00843f60 _setvbuf
00846620 _unlink
00845a60 _write
008468e0 _writemsg
ffffffff binit
00846f50 cinit
00800000 edata
00800000 end
00846bc0 etext
ffffffff pinit
GLOBAL SYMBOLS: SORTED BY Symbol Address
address name
-------- ----
00000001 __TI_args_main
00010000 __SYSMEM_SIZE
00030000 __STACK_SIZE
00800000 $bss
00800000 .bss
00800000 .data
00800000 ___bss__
00800000 ___data__
00800000 ___edata__
00800000 ___end__
00800000 __stack
00800000 edata
00800000 end
00830000 __STACK_END
00830000 __sys_memory
00840000 .text
00840000 ___text__
00840000 __divd
00840f40 __printfi
008418e0 _fputs
00841be0 _log
00842740 _free
008429c0 __divull
00842c20 __mpyd
00842e80 __addd
008434e0 __frcaddd
008436e0 __frcmpyd_div
00843a80 _HOSTrename
00843c20 __divul
00843dc0 _frexp
00843f60 _setvbuf
00844280 _malloc
00844400 _fputc
00844400 _putc
008447a0 _fclose
008448c0 _HOSTlseek
008449c0 __frcmpyd
00844bc0 __wrt_ok
00844cc0 _HOSTopen
00844da0 __auto_init
00844e80 __cmpd
00844f60 _atoi
00845040 _close
00845120 _exit
00845200 _memset
008452e0 _HOSTread
008453a0 _HOSTunlink
00845460 _HOSTwrite
00845520 __cleanup
008456a0 __c6xabi_divu
008456a0 __divu
00845760 __doflush
00845820 _fseek
008458e0 _lseek
008459a0 _ltoa
00845a60 _write
00845b20 _HOSTclose
00845bc0 __cvtdf
00845c60 __divli
00845e40 __fixdli
00846020 _memcpy
00846200 _calculations
00846268 _main
008462a0 __fixdi
00846320 __fltlid
008463a0 __llshl
00846420 __renormd
008464a0 _log10
00846520 _printf
008465a0 _readmsg
00846620 _unlink
008466a0 __cvtfd
00846700 __fltid
00846760 __llshru
008467c0 __subcull
00846820 _c_int00
00846880 _memccpy
008468e0 _writemsg
00846938 C$$IO$$
00846940 ___isinf
00846a00 __args_main
00846a40 __negd
00846a80 __remli
00846ac0 __subd
00846b00 __negll
00846b20 __nop
00846b80 C$$EXIT
00846b80 _abort
00846ba0 _remove
00846bc0 ___etext__
00846bc0 __ftable
00846bc0 etext
00846cb0 __tmpnams
00846d50 __ft_end
00846d54 _errno
00846f28 __cleanup_ptr
00846f2c __dtors_ptr
00846f30 ___TI_enable_exit_profile_output
00846f34 __lock
00846f38 __unlock
00846f50 ___cinit__
00846f50 cinit
00847108 __ctypes_
00847238 __CIOBUF_
ffffffff ___TI_pprof_out_hndl
ffffffff ___TI_prof_data_size
ffffffff ___TI_prof_data_start
ffffffff ___binit__
ffffffff ___c_args__
ffffffff ___pinit__
ffffffff binit
ffffffff pinit
[112 symbols]
C-код:
#include <csl_ddr2.h>
#include <stdio.h>
#include <math.h>
void calculations(){
int i; float s=0.;
for(i=0;i<20;i++){
s=log10((double)i+1.);
//s+=1.0;
//printf("i=%li",i);
printf("s=%f\n",s);
}
}
int main()
{
int a=8, b=9;
b+=a;
calculations();
return 0;
}
В этой программке и вычисление логарифма лажает, при 10 под знаком логарифма у него не 1. а 0.95 результат, который не меняется и при 11.
Это был только кусок программы, а вся она с двумя примерами из приведенных в модуле по записи в DDR2 и чтению значений из нее.
Вот ее map-файл:
******************************************************************************
TMS320C6x Linker PC v7.0.3
******************************************************************************
>> Linked Tue Jun 05 22:50:16 2012
OUTPUT FILE NAME: <C6457.out>
ENTRY POINT SYMBOL: "_c_int00" address: 00847900
MEMORY CONFIGURATION
name origin length used unused attr fill
---------------------- -------- --------- -------- -------- ---- --------
L2 00800000 00200000 00048827 001b77d9 RWIX
L1P 00e00000 00008000 00000000 00008000 RWIX
L1D 00f00000 00008000 00000000 00008000 RWIX
SECTION ALLOCATION MAP
output attributes/
section page origin length input sections
-------- ---- ---------- ---------- ----------------
.stack 0 00800000 00030000 UNINITIALIZED
00800000 00000008 rts64plus.lib : boot.obj (.stack)
00800008 0002fff8 --HOLE--
.data 0 00800000 00000000 UNINITIALIZED
.sysmem 0 00830000 00010000 UNINITIALIZED
00830000 00000008 rts64plus.lib : memory.obj (.sysmem)
00830008 0000fff8 --HOLE--
.text 0 00840000 00007da0
00840000 00000900 prob.obj (.text)
00840900 00000680 rts64plus.lib : divd.obj (.text:__divd)
00840f80 00000480 : _printfi.obj (.text:__setfield)
00841400 00000440 : _printfi.obj (.text:__getarg_diouxp)
00841840 000003a0 : _printfi.obj (.text:__printfi)
00841be0 00000300 : _printfi.obj (.text:_ecvt)
00841ee0 00000300 : _printfi.obj (.text:_fcvt)
008421e0 00000300 : fputs.obj (.text:_fputs)
008424e0 00000300 : log.obj (.text:_log)
008427e0 000002e0 : _printfi.obj (.text:__pproc_fge)
00842ac0 000002e0 : _printfi.obj (.text:__pproc_fwp)
00842da0 000002a0 : _printfi.obj (.text:__pconv_e)
00843040 000002a0 csl_c6457.lib : csl_ddr2HwSetup.o (.text:csl_section:ddr2:_CSL_ddr2HwSetup)
008432e0 00000280 rts64plus.lib : memory.obj (.text:_free)
00843560 00000260 : imath64.obj (.text:__divull)
008437c0 00000260 : mpyd.obj (.text:__mpyd)
00843a20 00000220 : addd.obj (.text:__addd)
00843c40 00000220 : _printfi.obj (.text:__pproc_diouxp)
00843e60 00000220 : _printfi.obj (.text:__pproc_str)
00844080 00000200 : frcaddd.obj (.text:__frcaddd)
00844280 000001e0 : frcmpyd_div.obj (.text:__frcmpyd_div)
00844460 000001c0 : _printfi.obj (.text:__mcpy)
00844620 000001c0 : fopen.obj (.text:__openfile)
008447e0 000001a0 : trgdrv.obj (.text:_HOSTrename)
00844980 000001a0 : imath40.obj (.text:__divul)
00844b20 000001a0 : frexp.obj (.text:_frexp)
00844cc0 000001a0 : setvbuf.obj (.text:_setvbuf)
00844e60 00000180 : _printfi.obj (.text:__pconv_g)
00844fe0 00000180 : memory.obj (.text:_malloc)
00845160 00000180 : lowlev.obj (.text:_open)
008452e0 00000140 : fputc.obj (.text:_fputc)
00845420 00000140 : lowlev.obj (.text:_getdevice)
00845560 00000120 : _printfi.obj (.text:__pproc_fflags)
00845680 00000120 : fclose.obj (.text:_fclose)
008457a0 00000100 : trgdrv.obj (.text:_HOSTlseek)
008458a0 00000100 : frcmpyd.obj (.text:__frcmpyd)
008459a0 00000100 : _printfi.obj (.text:__ltostr)
00845aa0 00000100 : fopen.obj (.text:__search_fp)
00845ba0 00000100 : _io_perm.obj (.text:__wrt_ok)
00845ca0 000000e0 : trgdrv.obj (.text:_HOSTopen)
00845d80 000000e0 : autoinit.obj (.text:__auto_init)
00845e60 000000e0 : cmpd.obj (.text:__cmpd)
00845f40 000000e0 : atoi.obj (.text:_atoi)
00846020 000000e0 : lowlev.obj (.text:_close)
00846100 000000e0 : exit.obj (.text:_exit)
008461e0 000000e0 : memset.obj (.text:_memset)
008462c0 000000c0 : trgdrv.obj (.text:_HOSTread)
00846380 000000c0 : trgdrv.obj (.text:_HOSTunlink)
00846440 000000c0 : trgdrv.obj (.text:_HOSTwrite)
00846500 000000c0 : fopen.obj (.text:__cleanup)
008465c0 000000c0 : _printfi.obj (.text:__div)
00846680 000000c0 : divu.obj (.text:__divu)
00846740 000000c0 : fflush.obj (.text:__doflush)
00846800 000000c0 : fseek.obj (.text:_fseek)
008468c0 000000c0 : lowlev.obj (.text:_lseek)
00846980 000000c0 : ltoa.obj (.text:_ltoa)
00846a40 000000c0 : lowlev.obj (.text:_write)
00846b00 000000a0 : trgdrv.obj (.text:_HOSTclose)
00846ba0 000000a0 : cvtdf.obj (.text:__cvtdf)
00846c40 000000a0 : imath40.obj (.text:__divli)
00846ce0 000000a0 : _printfi.obj (.text:__ecpy)
00846d80 000000a0 : _printfi.obj (.text:__fcpy)
00846e20 000000a0 : fixdli.obj (.text:__fixdli)
00846ec0 000000a0 : _printfi.obj (.text:__pconv_f)
00846f60 000000a0 : lowlev.obj (.text:_finddevice)
00847000 000000a0 : memcpy64.obj (.text:_memcpy)
008470a0 000000a0 : memory.obj (.text:_minsert)
00847140 000000a0 : memory.obj (.text:_mremove)
008471e0 000000a0 : lowlev.obj (.text:_tabinit)
00847280 00000080 : fixdi.obj (.text:__fixdi)
00847300 00000080 : fltlid.obj (.text:__fltlid)
00847380 00000080 : llshift.obj (.text:__llshl)
00847400 00000080 : renormd.obj (.text:__renormd)
00847480 00000080 : fprintf.obj (.text:_fprintf)
00847500 00000080 : log10.obj (.text:_log10)
00847580 00000080 : printf.obj (.text:_printf)
00847600 00000080 : trgmsg.obj (.text:_readmsg)
00847680 00000080 : lowlev.obj (.text:_unlink)
00847700 00000080 csl_c6457.lib : csl_ddr2Open.o (.text:csl_section:ddr2:_CSL_ddr2Open)
00847780 00000060 rts64plus.lib : cvtfd.obj (.text:__cvtfd)
008477e0 00000060 : fltid.obj (.text:__fltid)
00847840 00000060 : llshift.obj (.text:__llshru)
008478a0 00000060 : imath64.obj (.text:__subcull)
00847900 00000060 : boot.obj (.text:_c_int00)
00847960 00000060 : fopen.obj (.text:_fopen)
008479c0 00000060 : memccpy.obj (.text:_memccpy)
00847a20 00000060 : trgmsg.obj (.text:_writemsg)
00847a80 00000040 : isinf.obj (.text:___isinf)
00847ac0 00000040 : _printfi.obj (.text:___isnan)
00847b00 00000040 : divd.obj (.text:___isnan)
00847b40 00000040 : args_main.obj (.text:__args_main)
00847b80 00000040 : negd.obj (.text:__negd)
00847bc0 00000040 : imath40.obj (.text:__remli)
00847c00 00000040 : subd.obj (.text:__subd)
00847c40 00000040 csl_c6457.lib : csl_ddr2GetBaseAddress.o (.text:csl_section:ddr2:_CSL_ddr2GetBaseAddress)
00847c80 00000020 rts64plus.lib : negll.obj (.text:__negll)
00847ca0 00000020 : _lock.obj (.text:__nop)
00847cc0 00000020 : fprintf.obj (.text:__outc)
00847ce0 00000020 : printf.obj (.text:__outc)
00847d00 00000020 : fprintf.obj (.text:__outs)
00847d20 00000020 : printf.obj (.text:__outs)
00847d40 00000020 : exit.obj (.text:_abort)
00847d60 00000020 : remove.obj (.text:_remove)
00847d80 00000020 csl_c6457.lib : csl_ddr2Init.o (.text:csl_section:ddr2:_CSL_ddr2Init)
.const 0 00847da0 0000041f
00847da0 00000298 prob.obj (.const:.string)
00848038 00000101 rts64plus.lib : ctype.obj (.const:__ctypes_)
00848139 00000002 : fputs.obj (.const:.string)
0084813b 00000001 --HOLE-- [fill = 0]
0084813c 00000060 prob.obj (.const)
0084819c 00000023 rts64plus.lib : _printfi.obj (.const:.string)
.far 0 008481c0 00000390 UNINITIALIZED
008481c0 00000194 rts64plus.lib : defs.obj (.far)
00848354 00000004 : errno.obj (.far)
00848358 000000d0 : trgdrv.obj (.far)
00848428 000000cc : lowlev.obj (.far)
008484f4 00000004 : fopen.obj (.far)
008484f8 00000030 : log.obj (.far)
00848528 0000000c : exit.obj (.far)
00848534 00000008 : _lock.obj (.far)
0084853c 00000004 --HOLE--
00848540 00000008 : divd.obj (.far)
00848548 00000008 : memory.obj (.far)
.cinit 0 00848550 000001b4
00848550 0000005c rts64plus.lib : defs.obj (.cinit)
008485ac 00000004 --HOLE-- [fill = 0]
008485b0 0000005c : lowlev.obj (.cinit)
0084860c 00000004 --HOLE-- [fill = 0]
00848610 00000040 : log.obj (.cinit)
00848650 0000002c : exit.obj (.cinit)
0084867c 00000004 --HOLE-- [fill = 0]
00848680 0000002c : memory.obj (.cinit)
008486ac 00000004 --HOLE-- [fill = 0]
008486b0 0000001c : _lock.obj (.cinit)
008486cc 00000004 --HOLE-- [fill = 0]
008486d0 00000010 : divd.obj (.cinit)
008486e0 0000000c : errno.obj (.cinit)
008486ec 00000004 --HOLE-- [fill = 0]
008486f0 0000000c : fopen.obj (.cinit)
008486fc 00000004 --HOLE-- [fill = 0]
00848700 00000004 (.pad.cinit) [fill = 0]
.bss 0 00848704 00000004 UNINITIALIZED
00848704 00000004 prob.obj (.bss)
.cio 0 00848708 00000120 UNINITIALIZED
00848708 00000120 rts64plus.lib : trgmsg.obj (.cio)
GLOBAL SYMBOLS: SORTED ALPHABETICALLY BY Name
address name
-------- ----
00848704 $bss
00848704 .bss
00800000 .data
00840000 .text
00847d40 C$$EXIT
00847a78 C$$IO$$
00847c40 _CSL_ddr2GetBaseAddress
00843040 _CSL_ddr2HwSetup
00847d80 _CSL_ddr2Init
00847700 _CSL_ddr2Open
00846b00 _HOSTclose
008457a0 _HOSTlseek
00845ca0 _HOSTopen
008462c0 _HOSTread
008447e0 _HOSTrename
00846380 _HOSTunlink
00846440 _HOSTwrite
00848708 __CIOBUF_
00830000 __STACK_END
00030000 __STACK_SIZE
00010000 __SYSMEM_SIZE
00000001 __TI_args_main
00848530 ___TI_enable_exit_profile_output
ffffffff ___TI_pprof_out_hndl
ffffffff ___TI_prof_data_size
ffffffff ___TI_prof_data_start
ffffffff ___binit__
00848704 ___bss__
ffffffff ___c_args__
00848550 ___cinit__
00800000 ___data__
00800000 ___edata__
00848708 ___end__
00847da0 ___etext__
00847a80 ___isinf
ffffffff ___pinit__
00840000 ___text__
00843a20 __addd
00847b40 __args_main
00845d80 __auto_init
00846680 __c6xabi_divu
00846500 __cleanup
00848528 __cleanup_ptr
00845e60 __cmpd
00848038 __ctypes_
00846ba0 __cvtdf
00847780 __cvtfd
00840900 __divd
00846c40 __divli
00846680 __divu
00844980 __divul
00843560 __divull
00846740 __doflush
0084852c __dtors_ptr
00847280 __fixdi
00846e20 __fixdli
008477e0 __fltid
00847300 __fltlid
00844080 __frcaddd
008458a0 __frcmpyd
00844280 __frcmpyd_div
00848350 __ft_end
008481c0 __ftable
00847380 __llshl
00847840 __llshru
00848534 __lock
008437c0 __mpyd
00847b80 __negd
00847c80 __negll
00847ca0 __nop
00841840 __printfi
00847bc0 __remli
00847400 __renormd
00800000 __stack
008478a0 __subcull
00847c00 __subd
00830000 __sys_memory
008482b0 __tmpnams
00848538 __unlock
00845ba0 __wrt_ok
00847d40 _abort
00845f40 _atoi
00847900 _c_int00
00840000 _calculations
00846020 _close
00840090 _ddr2ReadWrite
00840494 _ddr2_readWrite
00848354 _errno
00846100 _exit
00845680 _fclose
00847960 _fopen
00847480 _fprintf
008452e0 _fputc
008421e0 _fputs
008432e0 _free
00844b20 _frexp
00846800 _fseek
00848704 _hDdr2
008424e0 _log
00847500 _log10
008468c0 _lseek
00846980 _ltoa
00840068 _main
00844fe0 _malloc
008479c0 _memccpy
00847000 _memcpy
008461e0 _memset
00845160 _open
00847580 _printf
008452e0 _putc
00847600 _readmsg
00847d60 _remove
00844cc0 _setvbuf
00847680 _unlink
00846a40 _write
00847a20 _writemsg
ffffffff binit
00848550 cinit
00800000 edata
00848708 end
00847da0 etext
ffffffff pinit
GLOBAL SYMBOLS: SORTED BY Symbol Address
address name
-------- ----
00000001 __TI_args_main
00010000 __SYSMEM_SIZE
00030000 __STACK_SIZE
00800000 .data
00800000 ___data__
00800000 ___edata__
00800000 __stack
00800000 edata
00830000 __STACK_END
00830000 __sys_memory
00840000 .text
00840000 ___text__
00840000 _calculations
00840068 _main
00840090 _ddr2ReadWrite
00840494 _ddr2_readWrite
00840900 __divd
00841840 __printfi
008421e0 _fputs
008424e0 _log
00843040 _CSL_ddr2HwSetup
008432e0 _free
00843560 __divull
008437c0 __mpyd
00843a20 __addd
00844080 __frcaddd
00844280 __frcmpyd_div
008447e0 _HOSTrename
00844980 __divul
00844b20 _frexp
00844cc0 _setvbuf
00844fe0 _malloc
00845160 _open
008452e0 _fputc
008452e0 _putc
00845680 _fclose
008457a0 _HOSTlseek
008458a0 __frcmpyd
00845ba0 __wrt_ok
00845ca0 _HOSTopen
00845d80 __auto_init
00845e60 __cmpd
00845f40 _atoi
00846020 _close
00846100 _exit
008461e0 _memset
008462c0 _HOSTread
00846380 _HOSTunlink
00846440 _HOSTwrite
00846500 __cleanup
00846680 __c6xabi_divu
00846680 __divu
00846740 __doflush
00846800 _fseek
008468c0 _lseek
00846980 _ltoa
00846a40 _write
00846b00 _HOSTclose
00846ba0 __cvtdf
00846c40 __divli
00846e20 __fixdli
00847000 _memcpy
00847280 __fixdi
00847300 __fltlid
00847380 __llshl
00847400 __renormd
00847480 _fprintf
00847500 _log10
00847580 _printf
00847600 _readmsg
00847680 _unlink
00847700 _CSL_ddr2Open
00847780 __cvtfd
008477e0 __fltid
00847840 __llshru
008478a0 __subcull
00847900 _c_int00
00847960 _fopen
008479c0 _memccpy
00847a20 _writemsg
00847a78 C$$IO$$
00847a80 ___isinf
00847b40 __args_main
00847b80 __negd
00847bc0 __remli
00847c00 __subd
00847c40 _CSL_ddr2GetBaseAddress
00847c80 __negll
00847ca0 __nop
00847d40 C$$EXIT
00847d40 _abort
00847d60 _remove
00847d80 _CSL_ddr2Init
00847da0 ___etext__
00847da0 etext
00848038 __ctypes_
008481c0 __ftable
008482b0 __tmpnams
00848350 __ft_end
00848354 _errno
00848528 __cleanup_ptr
0084852c __dtors_ptr
00848530 ___TI_enable_exit_profile_output
00848534 __lock
00848538 __unlock
00848550 ___cinit__
00848550 cinit
00848704 $bss
00848704 .bss
00848704 ___bss__
00848704 _hDdr2
00848708 __CIOBUF_
00848708 ___end__
00848708 end
ffffffff ___TI_pprof_out_hndl
ffffffff ___TI_prof_data_size
ffffffff ___TI_prof_data_start
ffffffff ___binit__
ffffffff ___c_args__
ffffffff ___pinit__
ffffffff binit
ffffffff pinit
[122 symbols]
C- код:
#include <csl_ddr2.h>
#include <stdio.h>
#include <math.h>
/** Result - Passed */
#define DATA_MATCH_SUCCESS 1
/** Result - Failed */
#define DATA_MATCH_FAIL 0
/** Data count(number write/readbacks) */
#define DATA_CNT 10
#define EMIFB_CE0_BASE_ADDR (0xE0000000u)
#define SDRAM_REFRESH_RATE (0x0000079Eu)
/* Handle for the DDR2 instance */
CSL_Ddr2Handle hDdr2;
/* Forwards declarations */
void ddr2ReadWrite(void);
void ddr2_readWrite (void);
void calculations(){
int i; float s=0.;
for(i=0;i<20;i++){
s=log10((double)i+1.);
//s+=1.0;
//printf("i=%li",i);
printf("s=%f\n",s);
}
}
int main()
{
int a=8, b=9;
b+=a;
calculations();
ddr2ReadWrite();
ddr2_readWrite();
return 0;
}
void ddr2ReadWrite (
void
)
{
volatile Uint32 result/*, index*/ ;
int index;
Uint32 tempData;
CSL_Ddr2Obj ddr2Obj;
CSL_Status status;
CSL_Ddr2HwSetup hwSetup ;
CSL_Ddr2Timing1 tim1 = CSL_DDR2_TIMING1_DEFAULTS;
CSL_Ddr2Timing2 tim2 = CSL_DDR2_TIMING2_DEFAULTS;
CSL_Ddr2Settings set = CSL_DDR2_SETTING_DEFAULTS;
/* Pointer that points to SDRAM start area */
Uint32 *pDdr2Data = (Uint32 *)EMIFB_CE0_BASE_ADDR ;
FILE *ft;
/* Clear local data structures */
memset(&ddr2Obj, 0, sizeof(CSL_Ddr2Obj));
memset(&hwSetup, 0, sizeof(CSL_Ddr2HwSetup));
tim1.trfc = 0x1F;
tim1.trp = 0x3;
tim1.trcd = 0x3;
tim1.twr = 0x3;
tim1.tras = 0x9;
tim1.trc = 0xd;
tim1.trrd = 0x2;
tim1.twtr = 0x1;
tim2.todt = 0x1;
tim2.tsxnr = 0x22;
tim2.tsxrd = 0x31;
tim2.trtp = 0x1;
tim2.tcke = 0x2;
/* setup the hardware parameters */
hwSetup.refreshRate = SDRAM_REFRESH_RATE;
hwSetup.readLatncy = 0x5;
hwSetup.timing1Param = &tim1;
hwSetup.timing2Param = &tim2;
set.narrowMode = CSL_DDR2_NORMAL_MODE;
set.casLatncy = CSL_DDR2_CAS_LATENCY_4;
set.ddr2En = 0x1;
set.ddrEn = 0x1;
set.ibank = CSL_DDR2_8_SDRAM_BANKS;
set.pageSize = CSL_DDR2_1024WORD_10COL_ADDR;
set.sdramEn = 0x1;
set.ddr2Ddqs = CSL_DDR2_SINGLE_ENDED_DQS;
set.ddr2Term0 = 0x1;
set.ddr2Term1 = 0x0;
set.ddrDisDll = 0x0;
set.sdramDrive0 = CSL_DDR2_SDRAM_NORMAL;
hwSetup.setParam = &set;
/* Initialize DDR2 CSL module */
status = CSL_ddr2Init(NULL);
if (status != CSL_SOK) {
printf("DDR2 EMIF: Initialization error.\n");
printf("\tReason: CSL_ddr2Init [status = 0x%x].\n", status);
return;
}
else {
printf("DDR2 EMIF: Module Initialized.\n");
}
/* Opening the DDR2 instance */
hDdr2 = CSL_ddr2Open(&ddr2Obj, CSL_DDR2, NULL, &status);
if ((status != CSL_SOK) || (hDdr2 == NULL)) {
printf("DDR2 EMIF: Error opening the instance. [status = 0x%x, hDdr2 = \
0x%x]\n", status, hDdr2);
return;
}
else {
printf("DDR2 EMIF: Module instance opened.\n");
}
/* Setting up configuration parameter using HwSetup */
status = CSL_ddr2HwSetup(hDdr2, &hwSetup);
if (status != CSL_SOK) {
printf("DDR2 EMIF: Error in HW Setup.\n");
printf("Read write operation fails\n");
return;
}
else {
printf("DDR2 EMIF: Module Hardware setup is successful.\n");
}
/* Write 'invalid' values into DDR2 SDRAM area. This is to overwrite the
* previous valid values
*/
tempData = 0x00000000;
for (index = 0; index < DATA_CNT; index++) {
//*(pDdr2Data) = tempData;
pDdr2Data[index] = tempData;
//pDdr2Data+=1;
}
ft=fopen("res.dat","w");
tempData = 0xdeadbeef;
for (index = 0; index < DATA_CNT; index++) {
pDdr2Data[index] = tempData;
fprintf(ft,"0x%lx\n", pDdr2Data[index]);
//fprintf(ft,"0x ");
//fprintf(ft,"%llX", pDdr2Data[index]);
//printf(ft," \n");
}
fprintf(ft,"\n");
/* Write **valid** values into SDRAM area. */
tempData = 0x56780000;
for (index = 0; index < DATA_CNT; index++) {
pDdr2Data[index] = tempData + index ;
//fprintf(ft,"0x ");
fprintf(ft,"0x%lx\n", pDdr2Data[index]);
//fprintf(ft," \n");
}
/* Verify that the data was indeed written */
result = DATA_MATCH_SUCCESS;
for (index = 0; index < DATA_CNT; index++) {
if (pDdr2Data[index] != (tempData + index)) {
result = DATA_MATCH_FAIL;
break ;
}
}
/* Print the appropriate message based on result */
if (result == DATA_MATCH_SUCCESS) {
printf("\nWrite to and Read from DDR2 SDRAM is Successful\n");
fprintf(ft,"\nWrite to and Read from DDR2 SDRAM is Successful\n");
}
else {
printf("\nWrite to and Read from DDR2 SDRAM is NOT Successful\n");
printf("\tError in data read.[status = 0x%x]\n", status);
}
fclose(ft);
}
void ddr2_readWrite (void)
{
volatile Uint32 result, index ;
Uint16 tempData;
CSL_Ddr2Obj ddr2Obj;
CSL_Status status;
CSL_Ddr2HwSetup hwSetup ;
CSL_Ddr2Timing1 tim1 = CSL_DDR2_TIMING1_DEFAULTS;
CSL_Ddr2Timing2 tim2 = CSL_DDR2_TIMING2_DEFAULTS;
CSL_Ddr2Settings set = CSL_DDR2_SETTING_DEFAULTS;
/* Pointer that points to SDRAM start area */
Uint16 *pDdr2Data = (Uint16 *)EMIFB_CE0_BASE_ADDR ;
FILE *ft;
/* Clear local data structures */
memset(&ddr2Obj, 0, sizeof(CSL_Ddr2Obj));
memset(&hwSetup, 0, sizeof(CSL_Ddr2HwSetup));
tim1.trfc = 0x1F;
tim1.trp = 0x3;
tim1.trcd = 0x3;
tim1.twr = 0x3;
tim1.tras = 0x9;
tim1.trc = 0xd;
tim1.trrd = 0x2;
tim1.twtr = 0x1;
tim2.todt = 0x1;
tim2.tsxnr = 0x22;
tim2.tsxrd = 0x31;
tim2.trtp = 0x1;
tim2.tcke = 0x2;
/* setup the hardware parameters */
hwSetup.refreshRate = SDRAM_REFRESH_RATE;
hwSetup.readLatncy = 0x5;
hwSetup.timing1Param = &tim1;
hwSetup.timing2Param = &tim2;
set.narrowMode = CSL_DDR2_NARROW_MODE;
set.casLatncy = CSL_DDR2_CAS_LATENCY_4;
set.ddr2En = 0x1;
set.ddrEn = 0x1;
set.ibank = CSL_DDR2_8_SDRAM_BANKS;
set.pageSize = CSL_DDR2_1024WORD_10COL_ADDR;
set.sdramEn = 0x1;
set.ddr2Ddqs = CSL_DDR2_SINGLE_ENDED_DQS;
set.ddr2Term0 = 0x1;
set.ddr2Term1 = 0x0;
set.ddrDisDll = 0x0;
set.sdramDrive0 = CSL_DDR2_SDRAM_NORMAL;
hwSetup.setParam = &set;
/* Initialize DDR2 CSL module */
status = CSL_ddr2Init(NULL);
if (status != CSL_SOK) {
printf("DDR2 EMIF: Initialization error.\n");
printf("\tReason: CSL_ddr2Init [status = 0x%llx].\n", status);
return;
}
else {
printf("DDR2 EMIF: Module Initialized.\n");
}
/* Opening the DDR2 instance */
hDdr2 = CSL_ddr2Open(&ddr2Obj, CSL_DDR2, NULL, &status);
if ((status != CSL_SOK) || (hDdr2 == NULL)) {
printf("DDR2 EMIF: Error opening the instance. [status = 0x%llx, hDdr2 = \
0x%llx]\n", status, hDdr2);
return;
}
else {
printf("DDR2 EMIF: Module instance opened.\n");
}
/* Setting up configuration parameter using HwSetup */
status = CSL_ddr2HwSetup(hDdr2, &hwSetup);
if (status != CSL_SOK) {
printf("DDR2 EMIF: Error in HW Setup.\n");
printf("Read write operation fails\n");
return;
}
else {
printf("DDR2 EMIF: Module Hardware setup is successful.\n");
}
/* Write 'invalid' values into DDR2 SDRAM area. This is to overwrite the
* previous valid values
*/
ft=fopen("res1.dat", "w");
tempData = 0xdead;
for (index = 0; index < DATA_CNT; index++) {
pDdr2Data[index] = tempData;
fprintf(ft,"%li",index);
printf("%i",index);
fprintf(ft,"%lx",pDdr2Data[index]);
fprintf(ft," \n");
printf("\n");
}
fprintf(ft,"\n");
/* Write **valid** values into SDRAM area. */
tempData = 0x5678;
for (index = 0; index < DATA_CNT; index++) {
pDdr2Data[index] = tempData;
fprintf(ft,"%i ",index);
fprintf(ft,"%lx",pDdr2Data[index]);
fprintf(ft," \n");
}
/* Verify that the data was indeed written */
result = DATA_MATCH_SUCCESS;
for (index = 0; index < DATA_CNT; index++) {
if (pDdr2Data[index] != tempData) {
result = DATA_MATCH_FAIL;
break ;
}
}
/* Print the appropriate message based on result */
if (result == DATA_MATCH_SUCCESS) {
printf("\nWrite to and Read from DDR2 SDRAM is Successful\n");
fprintf(ft,"\nWrite to and Read from DDR2 SDRAM is Successful\n");
}
else {
printf("\nWrite to and Read from DDR2 SDRAM is NOT Successful\n");
printf("\tError in data read.[status = 0x%x]\n", status);
}
fclose(ft);
}
Все сюда вывалил, мне не разрешено такие файлы почему-то на форуме загружать в виде просто выкладываемых файлов.
при i=9, и при i=10 значение s=0.9542425 и меняется только при i=11 (s=1.079181). Явная ошибка, с чем связано не понимаю. Вывод s на консоль результаты дает каждый раз разные. Последние:
s=
s=
s=
s=0.60
s=
s=
s=
s=
s=
s=
s=0s=1s=
s=1.06 111
s=
s=1.06
s=
s=
s=1.06
s=1.// ///
Можно ли в cmd-файле сразу указывать адресное пространство DDR2? У меня все данные чисто в память процессора не поместятся. Само изображение в разжатом виде до 6 Mb может занимать.