{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

project description - CDA 3103 Computer Organization...

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

View Full Document Right Arrow Icon
CDA 3103 – Computer Organization Project 1. Introduction In this project, you are asked to write the core part of a mini processor simulator called MinSPIM using C language on a Unix or a PC platform. Your MinSPIM will demonstrate some functions of MIPS processor as well as the principle of the datapath and the control signals of MIPS processor. The MinSPIM simulator should read in a file containing MIPS machine codes (in the format specified below) and simulate what the MIPS does cycle-by-cycle. You are required to implement the MinSPIM with a single-cycle datapath. You are asked to fill in the body of several functions in a given file. 2. Specification of the simulator 2.1. Instructions to be simulated The 14 instructions listed in Figure 1below are to be simulated. Please refer to section A.10 of the textbook for the machine codes of these instructions. Note that you are NOT required to treat situations leading to exception, interrupt or change in the status register (textbook A.7). 2.2. Registers to be handled MinSPIM should handle the 32 general purpose registers (listed in Figure 3.20 of the textbook, p.208). At the start of the program, the registers are initialized to the values specified in spimcore.c 2.3. Memory usage The size of memory of MinSPIM is 64kB (Address 0x0000 to 0xFFFF). The system assumes that all program starts at memory location 0x4000. All instructions are word-aligned in the memory, i.e. the addresses of all instructions are multiple of 4. The simulator (and the MIPS processor itself) treats the memory as one segment. (The division of memory into text, data and stack segments is only done by the compiler/assembler.) At the start of the program, all memory are initialized to zero, except those specified in the “.asc” file, as shown in the provided codes. The memory is in big-endian byte order. The memory is in the following format: e.g. Store a 32-bit number 0x aabbccdd in memory address 0x0 – 0x3. MEM[0] Address 0x0 0x1 0x2 0x3 Content aa bb cc dd 2.4. Conditions that the MinSPIM should halt If one of the following situations is encountered, the global flag Halt is set to 1, and hence the simulation halts. An illegal instruction is encountered. Jumping to an address that is not word-aligned (being multiple of 4) The address of lw or sw is not word-aligned
Background image of page 1

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

View Full Document Right Arrow Icon
Accessing data or jump to address that is beyond the memory. Note: The instructions beyond the list of instructions in Figure 1 are illegal. 2.5. Format of the input machine code file MinSPIM takes hexadecimal formatted machine codes, with filename xxx.asc , as input. An example of .asc file is shown below. Text after “#” on any line is treated as comments.
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.

{[ snackBarMessage ]}