Andes Workshop

It is currently Thu Mar 28, 2024 7:11 pm

All times are UTC + 8 hours [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Read/write memory code for RTL simulation
PostPosted: Fri Jun 06, 2014 2:49 pm 
Offline
User avatar

Joined: Fri Mar 04, 2011 9:36 pm
Posts: 500
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
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 13 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