-
Notifications
You must be signed in to change notification settings - Fork 0
/
readme
82 lines (76 loc) · 3.58 KB
/
readme
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
CS390 MIPS32 Release 2 Emulator
- An interpreter for a big endian MIPS32 Release 2 processor that
implements most arithmetic, memory, shifting, etc. instructions, as well as
coprocessor 0 support, most exception types, and interrupts. Future plans are
for coprocessor 1 (floating point) support.
Compiling Instructions:
Run 'make' to build mips.x which can then be used to load
mips32r2 big endian elf binaries. E.x. ./mips.x mmon.elf
Run 'make test' to build mips_tests.x which executes various
instruction unit tests.
- Overview of files:
main.cpp - Handles machine startup/shutdown.
ConsoleUI.cpp/h - Handles stdin/stdout and acts as a bridge
between the terminal and emulated UART8250.
FileLoader.cpp/h - Parses argc/argv and executes file related
functions such as ELF and binary file loading.
CPU.cpp/h - Contains the interpreter core loop as well as most
instruction implementations.
PMMU.cpp/h - Contains the memory management unit emulation class
which handles read/write, address translation etc.
Coprocessor0.cpp/h - Contains the control coprocessor registers
as well as functions to operate on them.
COP0Register.cpp/h - Implements coprocessor0 specific register
behavior including per bit software/hardware read/write
locking.
MIPSException.cpp/h - Contains the implementations for all MIPS
exception types.
MMIO_Device.h - Abstract interface for memory-mapped IO devices
in order to attach to the MMU.
SharedQueue.h - Template locking std::queue, primarily for use in
ConsoleUI to receive messages for logging purposes.
UART8250.cpp/h - Partial (no interrupts) implementation of a
UART8250 serial port using memory-mapped IO.
See: ./mips.x mmon.elf for a working example
SharedDefs.h - Contains miscellaneous definitions that need to be
used by multiple components. (E.x. TLB size).
STest:
testmain.cpp - Adds tests to STest interface and starts
STest.
STest.cpp/h - Contains simple unit testing framework as
well as template assertion functions.
MIPS_Tests_Common.cpp/h - Contains class objects and
functions common to all instruction tests.
ArithmeticTests.cpp/h - Contains tests for instructions
from Table 3.1 (pg 34) MIPS32R2 Volume II.
LogicalTests.cpp/h - Contains tests for instructions from
Table 3.5 (pg 36) MIPS32R2 Volume II.
BranchAndJumpTests.cpp/h - Contains tests for instructions
from Table 3.2 (pg 35) MIPS32R2 Volume II.
InstructionControlInstructionTests.cpp/h - Contains tests
for instructions from Table 3.3 (pg 36) MIPS32R2
Volume II.
LoadStoreMemoryControlTests.cpp/h - Contains tests for
instructions from Table 3.4 (pg 36) MIPS32R2
Volume II.
InsertExtractTests.cpp/h - Contains tests for instructions
from Table 3.6 (pg 37) MIPS32R2 Volume II.
MoveTests.cpp/h - Contains tests for instructions from
Table 3.7 (pg 37) MIPS32R2 Volume II.
ShiftTests.cpp/h - Contains tests for instructions from
Table 3.8 (pg 37) MIPS32R2 Volume II.
TrapTests.cpp/h - Contains tests for instructions from
Table 3.9 (pg 38) MIPS32R2 Volume II.
ObsoleteBranchTests.cpp/h - Contains tests for instructions
from Table 3.10 (pg 38) MIPS32R2 Volume II.
PrivilegedInstructionTests.cpp/h - Contains tests for instructions
from Table 3.23 (pg 42) MIPS32R2 Volume II.
Misc:
Contains some miscellaneous things such as benchmark
results.
DispatchTests - Test code used for poster benchmarking.
MIPSTest - Code for basic exception handling, timer interrupt
and context switch testing. (See ./mips.x timer_test.elf)
elfio:
Unmodified elfio library (C) Serge Lamikhov-Center. Used for
loading ELF file formats.