⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 adsp-21535.ldf

📁 在blankfin中 实现src 的程序
💻 LDF
字号:
/*
** LDF for ADSP-21535.
** 
** This LDF defines an example layout for a system which contains 256K
** of L2 SRAM, with the available L1 SRAM left unused. It does
** not assume the presence of any external memory. See below for
** memory map descriptions.
** 
** There are a number of configuration options that can be specified
** either by compiler flags, or by linker flags directly. The options are:
** 
** USE_PROFILER0
** 	Enabled by -p. Link in profiling library, and write results to
** 	both stdout and mon.out.
** USE_PROFILER1
** 	Enabled by -p1. Only write profiling data to mon.out.
** USE_PROFILER2
** 	Enabled by -p2. Only write profiling data to stdout.
** USE_PROFILER
** 	Equivalent to USE_PROFILER0.
** USE_FILEIO
** 	Link in support for file I/O (fopen, etc). Also necessary
** 	for argc/argv handling.
** LOW64K
** 	Place all code and data in the 0x0000-0xFFFF area of memory.
** 	This option is disabled by default, because that region of
** 	the memory map is external memory, which may not exist.
** CMDLINE
** 	Link exit routines suitable for use with the command-line
** 	simulator ccblkfn, rather than the VisualDSP++ debugger.
** CRT
** 	Link in C/C++ Runtime.
** USERMODE
**	Set up event handlers and go to usermode.
** 
** Memory map.
** 
** The known memory spaces are as follows:
** 
** 0xFFE00000 - 0xFFFFFFFF		Core MMR registers (2MB)
** 0xFFC00000 - 0xFFDFFFFF		System MMR registers (2MB)
** 0xFFB04000 - 0xFFBFFFFF		Reserved
** 0xFFB00000 - 0xFFB00FFF		Scratch SRAM (4K)
** 0xFFA04000 - 0xFFAFFFFF		Reserved
** 0xFFA00000 - 0xFFA03FFF		Code SRAM (16K)
** 0xFF904000 - 0xFF9FFFFF		Reserved
** 0xFF900000 - 0xFF903FFF		Data Bank B SRAM (16K)
** 0xFF804000 - 0xFF8FFFFF		Reserved
** 0xFF800000 - 0xFF803FFF		Data Bank A SRAM (16K)
** 0xF0040000 - 0xFF7FFFFF		Reserved RAM
** 0xF0000000 - 0xF003FFFF		L2 SRAM (256K)
** 0xEF000400 - 0xEFFFFFFF		Reserved ROM
** 0xEF000000 - 0xEF0003FF		Boot ROM (1K)
** 0x00000000 - 0xEEFFFFFF		unpopulated
** 
** The memory sections defined below assume that only L1 and L2 SRAM
** are available. We use L2, and leave L1 for explicit programmer use.
** The file VisualDSP/Blackfin/lib/src/libc/basiccrt.s contains example
** startup code which could be used to initialise the L1 SRAM as cache
** for L2.
** 
*/

ARCHITECTURE(ADSP-21535)

SEARCH_DIR( $ADI_DSP\Blackfin\lib )

/* Moving to primIO means that we must always include the FileIO support,
** so that printf() will work.
*/

#ifndef USE_FILEIO	/* { */
	#define USE_FILEIO
#endif	/* } */

#ifdef USE_PROFILER	/* { */
	#define USE_PROFILER0
#endif	/* } */

#ifdef USE_PROFILER0	/* { */
	#define PROFFLAG prfflg0_535.doj
	// The profiler needs File I/O to write its results.
	#define USE_FILEIO
	#ifndef USE_PROFILER	/* { */
		#define USE_PROFILER
	#endif	/* } */
#endif	/* } */

#ifdef USE_PROFILER1	/* { */
	#define PROFFLAG prfflg1_535.doj
	#define USE_FILEIO
	#ifndef USE_PROFILER	/* { */
		#define USE_PROFILER
	#endif	/* } */
#endif	/* } */

#ifdef USE_PROFILER2	/* { */
	#define PROFFLAG prfflg2_535.doj
	#define USE_FILEIO
	#ifndef USE_PROFILER	/* { */
		#define USE_PROFILER
	#endif	/* } */
#endif	/* } */

#ifdef CMDLINE	/* { */
	#define OMEGA halt535.doj
#else
	#define OMEGA idle.doj
#endif	/* } */

#ifdef USERMODE	/* { */
	#define LIBSMALL
#else
	#define LIBSMALL libsmall535.dlb,
#endif	/* } */

#ifdef M3_RESERVED	/* { */
	#define LIBM3 libm3res535.dlb
	#define LIBDSP libdspm3res535.dlb
#else
	#define LIBM3 libm3free535.dlb
	#define LIBDSP libdsp535.dlb
#endif	/* } */

#define LIBS LIBSMALL libc535.dlb, LIBM3, libevent535.dlb, libio535.dlb, libsftflt535.dlb, libcpp535.dlb, libcpprt535.dlb, LIBDSP, OMEGA
#if defined(USE_FILEIO) || defined(USE_PROFGUIDE)
$LIBRARIES = LIBS, librt_fileio.dlb;
#else
$LIBRARIES = LIBS, librt535.dlb;
#endif	/* } */

// Libraries from the command line are included in COMMAND_LINE_OBJECTS.

#ifdef USE_PROFILER	/* { */
	#ifdef USERMODE	/* { */
		#ifdef USE_FILEIO	/* { */
			#define CRT crtfpc535.doj, libprofile535.dlb, PROFFLAG
		#else
			#define CRT crtcp535.doj, libprofile535.dlb, PROFFLAG
		#endif  /* USE_FILEIO */	/* } */
	#else	/* USERMODE */
		#ifdef USE_FILEIO	/* { */
			#define CRT crtsfpc535.doj, libprofile535.dlb, PROFFLAG
		#else
			#define CRT crtscp535.doj, libprofile535.dlb, PROFFLAG
		#endif  /* USE_FILEIO */	/* } */
	#endif	/* USERMODE */	/* } */
#else
	#ifdef USERMODE	/* { */
		#ifdef USE_FILEIO	/* { */
			#define CRT  crtcf535.doj
		#else
			#define CRT  crtc535.doj
		#endif  /* USE_FILEIO */	/* } */
	#else
		#ifdef USE_FILEIO	/* { */
			//#define CRT  crtsfc535.doj
			#define CRT  basiccrt.doj
		#else
			#define CRT  crtsc535.doj
		#endif  /* USE_FILEIO */	/* } */
	#endif	/* USERMODE */	/* } */
#endif  /* USE_PROFILER */	/* } */

#define ENDCRT , crtn535.doj

$OBJECTS = CRT, $COMMAND_LINE_OBJECTS ENDCRT;

MEMORY
{
#ifdef LOW64K	/* { */
#error Low64k option requires manual configuration of the LDF file.
#ifdef __EZKIT_LICENSE_RESTRICTION_Blackfin__	/* { */
#error Low64K option not compatible with initial EZ-Kit Licences.
#endif	/* } */
/*
** The LOW64K option is intended for mapping the code and data into
** the lowest 64K of memory. The compiler's -Oz option uses LOW64K.
** There must be suitable external memory available in the range
** 0x0000 - 0xFFFF for this option to be used. Please modify the
** PROGRAM ranges accordingly, if you wish to use LOW64K, and have
** a suitable hardware configuration.
*/
#endif	/* } */
#ifdef __EZKIT_LICENSE_RESTRICTION_Blackfin__	/* { */
MEM_PROGRAM     { TYPE(RAM) START(0xF0000000) END(0xF0017FFF) WIDTH(8) }
MEM_HEAP        { TYPE(RAM) START(0xF0018000) END(0xF001BFFF) WIDTH(8) }
MEM_STACK       { TYPE(RAM) START(0xF001C000) END(0xF001DFFF) WIDTH(8) }
MEM_SYSSTACK    { TYPE(RAM) START(0xF001E000) END(0xF001FDFF) WIDTH(8) }
MEM_ARGV        { TYPE(RAM) START(0xF001FE00) END(0xF001FEFF) WIDTH(8) }
#else

MEM_PROGRAM     { TYPE(RAM) START(0xF0000000) END(0xF002FFCF) WIDTH(8) }
MEM_USB_IO      { TYPE(RAM) START(0xF0030000) END(0xF00307FF) WIDTH(8) }
//MEM_HEAP        { TYPE(RAM) START(0xF0030800) END(0xF0037FFF) WIDTH(8) }
MEM_HEAP        { TYPE(RAM) START(0x00000010) END( 0x003FFFFF) WIDTH(8) }
MEM_SDRAM        { TYPE(RAM) START(0x00400000) END(0x01000000) WIDTH(8) }
MEM_STACK       { TYPE(RAM) START( 0xF0038000) END(0xF003DFFF) WIDTH(8) }
MEM_SYSSTACK    { TYPE(RAM) START(0xF003E000) END(0xF003FDFF) WIDTH(8) }

MEM_ARGV        { TYPE(RAM) START(0xF003FED0) END(0xF003FFCF) WIDTH(8) }
MEM_PCI_IO      { TYPE(RAM) START(0xF003FFD0) END(0xF003FFFF) WIDTH(8) }

#endif	/* } */
MEM_L1_DATA_A   { TYPE(RAM) START(0xFF800000) END(0xFF803FFF) WIDTH(8) }
MEM_L1_DATA_B   { TYPE(RAM) START(0xFF900000) END(0xFF903FFF) WIDTH(8) }
MEM_L1_CODE     { TYPE(RAM) START(0xFFA00000) END(0xFFA03FFF) WIDTH(8) }
MEM_L1_SCRATCH  { TYPE(RAM) START(0xFFB00000) END(0xFFB00FFF) WIDTH(8) }
}


PROCESSOR p0
{
    OUTPUT( $COMMAND_LINE_OUTPUT_FILE )

	/* Following address must match start of MEM_PROGRAM */
//	RESOLVE(start,0xF0000000)
//	KEEP(start,_main)

    SECTIONS
    {
        program
        {
            // Align all code sections on 2 byte boundary
            INPUT_SECTION_ALIGN(4)
            INPUT_SECTIONS( $OBJECTS(program) $LIBRARIES(program))
            INPUT_SECTIONS( $OBJECTS(Program_CDMP3))
            
            INPUT_SECTIONS( $OBJECTS(Data_CDMP3))
            
//            INPUT_SECTIONS( $OBJECTS(data1) $LIBRARIES(data1))
            INPUT_SECTIONS( $OBJECTS(constdata) $LIBRARIES(constdata)) 
#ifdef __EZKIT_LICENSE_RESTRICTION_Blackfin__	/* { */
	    INPUT_SECTIONS( $LIBRARIES(pci_io))
#endif	/* } */

            INPUT_SECTIONS( $OBJECTS(ctor) $LIBRARIES(ctor) )
        } >MEM_PROGRAM

        L1_code
        {
            // Align all code sections on 2 byte boundary
            INPUT_SECTION_ALIGN(2)
            INPUT_SECTIONS( $OBJECTS(L1_code) $LIBRARIES(L1_code))
	} >MEM_L1_CODE

        L1_data_a
        {
            INPUT_SECTION_ALIGN(1)
            INPUT_SECTIONS( $OBJECTS(L1_data_a) $LIBRARIES(L1_data_a))
	} >MEM_L1_DATA_A

        L1_data_b
        {
            INPUT_SECTION_ALIGN(1)
            INPUT_SECTIONS( $OBJECTS(L1_data_b) $LIBRARIES(L1_data_b))
	} >MEM_L1_DATA_B

        sdram
        {
            INPUT_SECTION_ALIGN(4)
            INPUT_SECTIONS( $OBJECTS(data1) $LIBRARIES(data1))
	} >MEM_SDRAM
	
#ifndef __EZKIT_LICENSE_RESTRICTION_Blackfin__	/* { */
	pci_io
	{
	    INPUT_SECTION_ALIGN(4)
	    INPUT_SECTIONS( $LIBRARIES(pci_io))
	} >MEM_PCI_IO
#endif	/* } */

	usb_io
	{
	    INPUT_SECTION_ALIGN(4)
	    INPUT_SECTIONS( $OBJECTS(usb_io) $LIBRARIES(usb_io))
        INPUT_SECTIONS( $OBJECTS(data1) $LIBRARIES(data1))
        INPUT_SECTIONS( $OBJECTS(constdata) $LIBRARIES(constdata)) 

	} >MEM_USB_IO


        stack
        {
	    	INPUT_SECTION_ALIGN(4)        	
            ldf_stack_space = .;
            ldf_stack_end = ldf_stack_space + MEMORY_SIZEOF(MEM_STACK);
        } >MEM_STACK

        sysstack
        {
            ldf_sysstack_space = .;
            ldf_sysstack_end = ldf_sysstack_space + MEMORY_SIZEOF(MEM_SYSSTACK);
        } >MEM_SYSSTACK

        heap
        {
        	INPUT_SECTION_ALIGN(4)        	
            // Allocate a heap for the application
            ldf_heap_space = .;
            ldf_heap_end = ldf_heap_space + MEMORY_SIZEOF(MEM_HEAP) - 1;
            ldf_heap_length = ldf_heap_end - ldf_heap_space;        
        } >MEM_HEAP

        argv
        {
            // Allocate argv space for the application
            ldf_argv_space = .;
            ldf_argv_end = ldf_argv_space + MEMORY_SIZEOF(MEM_ARGV) - 1;
            ldf_argv_length = ldf_argv_end - ldf_argv_space;        
        } >MEM_ARGV
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -