{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

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

Info icon This 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).
Image of page 1

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

View Full Document Right 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.
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern