Andes Workshop

It is currently Thu Mar 28, 2024 8:12 pm

All times are UTC + 8 hours [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Software overlay demo code (refine)
PostPosted: Tue Dec 15, 2015 5:08 pm 
Offline

Joined: Fri May 04, 2012 6:49 am
Posts: 17
AndesCore supports both software overlay and hardware overlay. For hardware overlay, please refer http://forum.andestech.com/viewtopic.php?f=16&t=861&view=previous to get sample code, it needs OSC IP. For software overlay, the original sample code can be get from:http://forum.andestech.com/viewtopic.php?f=25&t=827&view=previous. Now we refine the sample code to support all AndesCores and all Andes platforms, it is based on demo-printf and also ways to run is same.
As the demo code is configured to run on N968A + AG101P FPGA with XIP Mode. the sag file "nds32-xip.sag" is:
Attachment:
sag.png
sag.png [ 27.7 KiB | Viewed 16457 times ]

Please note that Andes SAG tool specifies each function's VMA & LMA to a table "_ovly_table":
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];

Please also note that every time you want to run overlay function, please call our API to load the function (from LMA to VMA). The demo code is:
Code:
void
overlay ()
{

  puts("/* Enter overlay Root portion */\n\r");
  OverlayLoad (0);
  OverlayLoad (4);
  overlay0 ();

  OverlayLoad (1);
  overlay1 ();

  OverlayLoad (2);
  OverlayLoad (5);
  overlay2 ();

  OverlayLoad (3);
  overlay3 ();
  return;
}

We get technical article to show the principle of software overlay : http://image.edntaiwan.com/140110_Tech_Paper_from_Andes.pdf
Attachment:
demo-printf-overlay.zip [305.25 KiB]
Downloaded 1136 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 10 guests


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