Andes Workshop

Software overlay demo code (refine)
Page 1 of 1

Author:  HuJin [ Tue Dec 15, 2015 5:08 pm ]
Post subject:  Software overlay demo code (refine)

AndesCore supports both software overlay and hardware overlay. For hardware overlay, please refer to get sample code, it needs OSC IP. For software overlay, the original sample code can be get from: 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:
sag.png [ 27.7 KiB | Viewed 5228 times ]

Please note that Andes SAG tool specifies each function's VMA & LMA to a table "_ovly_table":
.nds32.ovly.tbl   :   AT(LOADADDR (.dynamic) + SIZEOF (.dynamic))
      _ovly_table = .;
      _novlys = .;
      LONG((_novlys - _ovly_table) / 16);
      . = ALIGN(8);

In ovlymgr.c, define the external table:
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:
overlay ()

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

  OverlayLoad (1);
  overlay1 ();

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

  OverlayLoad (3);
  overlay3 ();

We get technical article to show the principle of software overlay :
Attachment: [305.25 KiB]
Downloaded 350 times

Page 1 of 1 All times are UTC + 8 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group