Performance issue in code

Reply

Join Date: Sep 2007
Posts: 6
Reputation: cbalu is an unknown quantity at this point 
Solved Threads: 1
cbalu cbalu is offline Offline
Newbie Poster

Performance issue in code

 
0
  #1
Apr 9th, 2009
I am working on a embedded board with MIPS architecture and i have a requirement to initialize the 128MB RAM by writing zero's onto the memory. I have coded the following thing

  1. // RAM initialization part
  2. li t2, 0x80000000 //RAM starting address
  3. li t3, 0x02000000 //(RAM size/0x04) ( 0x08000000(128MB)/0x04 )
  4. li t4, 0x00000000 //Value we need to initialize
  5. ram_init:
  6. sw t4, 0(t2)
  7. addi t2, t2, 0x00000004
  8. addi t3, t3, -0x00000004
  9. bgtz t3, ram_init
  10. nop

But with this code i am getting a performance issue where the above code takes about 70 to 80 seconds to write zero's onto the memory location. Is there any better way to do the same operation so that the time taken can be reduced to less than 5 seconds.

-BalaC-
Last edited by cbalu; Apr 9th, 2009 at 10:19 am. Reason: Included code syntax
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC