FAQs - Q. Where do I get the information about SPIM? A....

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Q. Where do I get the information about SPIM? A. Appendix A, and also http://www.cs.wisc.edu/~larus/spim.html Some of the files to be downloaded are pcspim.zip, which contains pcspim.exe as well as setup.exe Q. Is memory supposed to be an array of words, or an array of bytes? As in. mem[1] = 32 bit word mem[4] = 32 bit word mem[8] = 32 bit word Or if it's an array of bytes mem[0] = 8 bit byte mem[1] = 8 bit byte mem[2] = 8 bit byte mem[3] = 8 bit byte mem[4] = 8 bit byte //the first byte of a new word. So if we want to read in an instruction from memory we would read it in 4 8 bit chunks. A. Functions that require it are instruction_fetch and rw_memory and the array Mem is passed as an argument. The little table from the first page of the spec gives the answer: Notice the “Mem[0]” in the first row, so the memory goes like this Mem[0] = 0x0000 - 0x0003 Mem[1] = 0x0004 - 0x0007 ... Mem[16384] = 0xFFFC - 0xFFFF (65532 - 65536) It also says that all program starts at memory location 0x4000 (see def of PCINIT in spimcore.c) which corresponds to Mem[4096]. (4096 = 0x1000) The trick is to test for word alignment while it is still in address form, then reference the proper index in the Mem array by shifting the address right twice. Q. What are the inputs and outputs of the program? A. Most of the functionality of this simulator is provided by spimcore. The only input that you need to provide to spimcore is a text file with extension .asc, which should contain the 32-bit instructions as ASCII in hexadecimal format (see the example in the project description). You can write a sequence of instructions manually in your .asc file, or optionally write a simple assembler to do that for you (i.e. convert a program to its hex sequence).
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
There is no output. Spimcore takes care of the simulation. But you need to make sure that the datapath/control are working correctly. For your convenience, the diagram in Figure 2 of the project description color-codes each function to be implemented with dotted lines. Q. How does
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 08/22/2010 for the course CDA 3101 taught by Professor Staff during the Fall '07 term at University of Central Florida.

Page1 / 4

FAQs - Q. Where do I get the information about SPIM? A....

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online