程序代写代做代考 mips assembly clock Simulator Instructions

Simulator Instructions

The simulator should implement the no pipelined MIPS 32-bit ISA to provide the execution of the following instructions. It must process instructions at machine code (or binary) level. You must use the starter circuit provided.
• LW
• SW
• BEQ
• ADD
• SUB
• AND
• OR
• SLT


The circuit provided includes a main and 7 sub-circuits: an ALU, Registers, Reg8, DataMemory, Control, ALUControl, and InstructionSplitter. It’s important to test each sub circuit before moving on to the next. Draw out the logic on paper before wiring.
Control Unit: You should read the control signals from a small ROM. The control unit based on the opcode figures out which signals. For example: when opcode is ADD (000000), RegDst = 1, Branch = 0, MemRead = 0, MemToReg = 0, ALUOp = 10, MemWrite = 0, ALUSrc = 0, RegWrite = 1. For 000000, 100010001 control bits are generated.

ALU Control: ALUOp bits are input by the Control unit, the function bits are used to generate the ALU controls bits if it is an R-type instruction. Your sub circuit must generate the bits shown below. 

opcode
ALUOp
Operation
funct
ALU function
ALU control
lw
00
load word
XXXXXX
add
0010
sw
00
store word
XXXXXX
add
0010
beq
01
branch equal
XXXXXX
subtract
0110
R-type
10
add
100000
add
0010

subtract
100010
subtract
0110

AND
100100
AND
0000

OR
100101
OR
0001

set-on-less-than
101010
set-on-less-than
0111

ALU: The ALU should do all possible calculations and let a mux choose the output.

Data Memory: You will need a RAM. They come with different interfaces, so
under “Data Interface” you should choose “Separate load and store ports”

Registers: There are 32 registers. You will have to either hook up 32 different registers or if you prefer, you can create a sub circuit. A sub circuit is already provided that will manage 8 of the 32 registers. Reuse this to create the 32 registers.

Testing

A few test files are included, but you should make up your own which must be submitted with the finished circuit. To run the MIPS machine, you must:

• Load the program memory with machine instructions
• Load the data memory with your initial variable/constant data set the clock to off
• Set the PC to 0
• Initialize a base register as needed

To create test materials using MARS,
• Compile some test assembly code that uses only the approved instructions listed above
• Under File, use Dump Memory to
• save the text memory segment (the code)
• save the data memory segment (the data)
• choose “Hexadecimal Text” as the format in each case
• Open each of the two files you just created and add
• v2.0 raw as a new line at the top of the file.
• Logisim expects your files to start with that label. You can then use those files to initialize the program and data memories (“Load Image”).

Memory

Your program memory and data memory should each be at least 256 bytes big and the addresses 0 through 255 must be usable. (We actually only use addresses for words. Since words are aligned, all addresses will be multiples of 4.) 

MARS/Mips automatically loads instructions at 0x400000, but the code can easily be relocated, so we will load it at address 0x0 in program memory. Therefore the PC must initially be 0.

MARS/Mips loads data starting at 0x10010000. We could place this data at address 0x0 in data memory, but that would suggest a base register value of 0.

To give the base register a more realistic value, we will put data at some more interesting address in data memory. For the two tests programs released initially, the data dump has been modified to push the data to address 0x40. Therefore the base register $at must be manually initialized to x40 to run the test programs.

Submission guidelines: Submit your .circ file, test files on Canvas in a zip format. The tests files should be documented as to what they are testing. You may include a README file that explains the files and any comments useful for testing your circuit (with your test files). Name it uwnetid1uwnetid2MIPSSimulator.zip or uwnetidMIPSSimulator.zip. Please see Syllabus for late work guidelines. 

Grading Criteria: This project is worth 50 points and will be graded using the rubric below.


Points
• LW
• SW
• BEQ
• ADD
• SUB
• AND
• OR
• SLT

Each instruction is 3 points each for a total of 24 points.
Test files provided to test each individual instruction with helpful documentation
Each test is 2 points each for a total of 16 points.
Programs that the instructor provided run correctly

5 Points
Starter circuit used and all components labeled for ease of understanding

5 Points