forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

SPIM

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development
View previous topic :: View next topic  
Author Message
modman



Joined: 12 Feb 2005
Posts: 31
Location: Philadelphia, PA

PostPosted: Tue Feb 15, 2005 1:04 am    Post subject: SPIM Reply with quote

Anyone use this before?

I'm trying to get myself back into "assembly mode", and was just wondering if this would be usefull:

http://www.cs.wisc.edu/~larus/spim.html

??

It says that the new version supports the MIPS32 architecture.

I used this before in my Computer Organization class; but I never really got into the simulator.

I've always liked practical programming more i.e. x86 with MASM or NASM.
_________________
SCPH-50001/N
HD SCPH-20401 U
Eyetoy SLEH-00031
Network Adaptor SCPH-10281
Logitech Z680 via FIber w00t!
Sony Wega TV + USB Keyboard
http://staff.philau.edu/barberej/
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
DracoLacertae



Joined: 13 Jul 2004
Posts: 22
Location: Berkeley, CA

PostPosted: Tue Feb 15, 2005 4:01 am    Post subject: Reply with quote

SPIM is great for starting out or practicing MIPS code. But for PS2 stuff, keep in mind the memory, IO and all that type of stuff will be different. I used SPIM in school to practice MIPS, and it's pretty good. There is a slight difference with load delay slots: I think in SPIM the value you load is available immediately while in a MIPS processor you need to wait one clock; I'm not sure I haven't had to deal with delay slots since we had to implement a mips processor.

I'll definetely be looking into more asm programming soon though, because I need it is for my project as well.
Back to top
View user's profile Send private message Visit poster's website
Guest






PostPosted: Tue Feb 15, 2005 4:57 am    Post subject: Reply with quote

DracoLacertae wrote:
There is a slight difference with load delay slots: I think in SPIM the value you load is available immediately while in a MIPS processor you need to wait one clock; I'm not sure I haven't had to deal with delay slots since we had to implement a mips processor.


There are reasons it may not have even mattered.

Modern MIPS cpu's implement interlock on the registers affected by the delay slot. If you do not fill the delay slot appropriately, interlock occurs such that the next instruction is forced to wait it out anyhow, if it is accessing a register being written by the previous instruction within the delay slot boundries.
Back to top
modman



Joined: 12 Feb 2005
Posts: 31
Location: Philadelphia, PA

PostPosted: Tue Feb 15, 2005 6:17 am    Post subject: Reply with quote

Thank you for the good overview DracoLacertae and gorim!

I did not recall load delay slots from my class... must have been dreaming of getting my PS2 back then :-)

I found a good explaination of delay slots on MIPS here: http://www.go-ecs.com/mips/miptek1.htm

So does the instruction in the delay slot actually see the data in the register used by the previous instruction, or does it wait it out? It seems from the link above that you can actually write code without taking into account the delay slot; but if you want your code to be optimized you should plan accordingly. Any thoughts?
_________________
SCPH-50001/N
HD SCPH-20401 U
Eyetoy SLEH-00031
Network Adaptor SCPH-10281
Logitech Z680 via FIber w00t!
Sony Wega TV + USB Keyboard
http://staff.philau.edu/barberej/
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
Guest






PostPosted: Tue Feb 15, 2005 6:30 am    Post subject: Reply with quote

modman wrote:
Thank you for the good overview DracoLacertae and gorim!

I did not recall load delay slots from my class... must have been dreaming of getting my PS2 back then :-)

I found a good explaination of delay slots on MIPS here: http://www.go-ecs.com/mips/miptek1.htm

So does the instruction in the delay slot actually see the data in the register used by the previous instruction, or does it wait it out? It seems from the link above that you can actually write code without taking into account the delay slot; but if you want your code to be optimized you should plan accordingly. Any thoughts?


Absolutely correct. The delay slot is an opporuntity for another independant instruction to do something whilst another would otherwise have to wait.

Nowadays, scheduling of instructions into the delay slot is normally done by the assembler, but if you are getting into learning assembly, it never hurts to write the code with an eye towards some efficiency. Just keep in mind that, whatever you do, unless you direct an optimizing assembler to do otherwise, it may automatically reorder your instructions to take advantage of delays slots. But unless you disassemble the result, you also may never know.
Back to top
DracoLacertae



Joined: 13 Jul 2004
Posts: 22
Location: Berkeley, CA

PostPosted: Tue Feb 15, 2005 7:55 pm    Post subject: Reply with quote

Oh yeah I forgot about the interlocks. We didn't study interlocks that much. The original MIPS stood for Microprocessor without Interlocked Pipeline Stages. (Well that's what Prof. Patterson told us.)
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group