Andes Workshop

It is currently Tue Nov 12, 2019 6:05 am

All times are UTC + 8 hours [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: overlay sample code
PostPosted: Fri Apr 04, 2014 3:15 pm 
Offline
User avatar

Joined: Fri Mar 04, 2011 9:36 pm
Posts: 500
The attached is an overlay sample code.

System diagram:
Attachment:
overlay.png
overlay.png [ 69.09 KiB | Viewed 3733 times ]



Note:
In sw-nds32.ld, it specifies LMA and VMA of each function.
Code:
   .nds32.ovly.tbl   :   AT(LOADADDR (.dynamic) + SIZEOF (.dynamic))
   {
      _ovly_table = .;
      LONG(ABSOLUTE(ADDR(.overlay0)));
      LONG(SIZEOF(.overlay0));
      LONG(ABSOLUTE(LOADADDR(.overlay0)));
      LONG(0);
      LONG(ABSOLUTE(ADDR(.overlay1)));
      LONG(SIZEOF(.overlay1));
      LONG(ABSOLUTE(LOADADDR(.overlay1)));
      LONG(0);
      LONG(ABSOLUTE(ADDR(.overlay2)));
      LONG(SIZEOF(.overlay2));
      LONG(ABSOLUTE(LOADADDR(.overlay2)));
      LONG(0);
      LONG(ABSOLUTE(ADDR(.overlay3)));
      LONG(SIZEOF(.overlay3));
      LONG(ABSOLUTE(LOADADDR(.overlay3)));
      LONG(0);
      LONG(ABSOLUTE(ADDR(.overlay4)));
      LONG(SIZEOF(.overlay4));
      LONG(ABSOLUTE(LOADADDR(.overlay4)));
      LONG(0);
      LONG(ABSOLUTE(ADDR(.overlay5)));
      LONG(SIZEOF(.overlay5));
      LONG(ABSOLUTE(LOADADDR(.overlay5)));
      LONG(0);
      _novlys = .;
      LONG((_novlys - _ovly_table) / 16);
      . = ALIGN(8);
   }


In ovlymgr.c, define the external table.
Code:
extern unsigned long _ovly_table[][4];


The sag sample:

Code:
USER_SECTIONS .overlay0, .overlay1, .overlay2, .overlay3, .overlay4, .overlay5
ROM 0x0
{
  RAM 0x0
    {
      STACK = 0x10800000
      * (+RO)
    }
  OVLY0 0x10800000 OVERLAY 0x0
    {
      .overlay0 {* (.overlay0)}
      .overlay1 {* (.overlay1)}
    }
  OVLY1 0x10804000 OVERLAY 0x0
    {
      .overlay2 {* (.overlay2)}
      .overlay3 {* (.overlay3)}
    }
  OVLY2 0x10808000 OVERLAY 0x0
    {
      .overlay4 {* (.overlay4)}
      .overlay5 {* (.overlay5)}
    }
  RAM1 0x10000000
    {
      LOADADDR __data_lmastart
      ADDR __data_start
      * (+RW, +ZI)
    }
}


Reference:
Technical article (in Chinese)
http://image.edntaiwan.com/140110_Tech_ ... _Andes.pdf


Attachments:
overlay-sw2.zip [503.44 KiB]
Downloaded 317 times
Top
 Profile Send private message E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group