Andes Workshop
http://forum.andestech.com/

Read/write memory code for RTL simulation
http://forum.andestech.com/viewtopic.php?f=25&t=849
Page 1 of 1

Author:  cindy [ Fri Jun 06, 2014 2:49 pm ]
Post subject:  Read/write memory code for RTL simulation

This program is to observe memory read/write on BUS in RTL simulation.
It is quiet simple.

Code:
The data is at 0x68 0x6c 0x70
00000000 <main>:
   0: 46 01 23 45 sethi $r0,#0x12345
   4: 58 00 06 78 ori $r0,$r0,#0x678
   8: 46 f0 00 00 sethi $r15,#0x0
   c: 14 07 80 1a swi $r0,[$r15+#0x68]
  10: 46 f0 00 00 sethi $r15,#0x0
  14: 04 07 80 1a lwi $r0,[$r15+#0x68]
  18: 46 f0 00 00 sethi $r15,#0x0
  1c: 14 07 80 1c swi $r0,[$r15+#0x70]
  20: 46 08 76 54 sethi $r0,#0x87654
  24: 58 00 03 21 ori $r0,$r0,#0x321
  28: 46 f0 00 00 sethi $r15,#0x0
  2c: 14 07 80 1b swi $r0,[$r15+#0x6c]
  30: 46 f0 00 00 sethi $r15,#0x0
  34: 04 07 80 1b lwi $r0,[$r15+#0x6c]
  38: 46 f0 00 00 sethi $r15,#0x0
  3c: 14 07 80 1c swi $r0,[$r15+#0x70]
  40: d5 e0       j8 0 <main>


Code:
int aaa=1;
int bbb=2;
int ccc;

int main(void) __attribute__((no_prologue));

int main(void){

   while(1){
   aaa=0x12345678;
   ccc=aaa;

   bbb=0x87654321;
   ccc=bbb;
   }

   return 0;
}


Attachments:
mem_test2.zip [58.29 KiB]
Downloaded 755 times

Page 1 of 1 All times are UTC + 8 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/