[2] | 1 | /* Author : Rick van der Zwet
|
---|
| 2 | * S-number : 0433373
|
---|
| 3 | * Version : $Id: README.txt 365 2007-12-03 08:54:04Z rick $
|
---|
| 4 | * Copyright : FreeBSD Licence
|
---|
| 5 | * Description : MIPS simulator. Main module
|
---|
| 6 | */
|
---|
| 7 |
|
---|
| 8 | = Note =
|
---|
| 9 | * The delivered C program does compile, but does _not_ deliver a answer,
|
---|
| 10 | the memory handlers is catching a exception, but I cannot find the
|
---|
| 11 | problem. I will need to write a number of different use cases in order
|
---|
| 12 | to track the problem, cause I cannot find it using global search :-(
|
---|
| 13 |
|
---|
| 14 | = Intro =
|
---|
| 15 | * I choose to write the code with the FreeBSD style guide in mind
|
---|
| 16 | * I choose global variables where ever possible to limit the calls
|
---|
| 17 | between the functions and make live a bit more easy
|
---|
| 18 | * Most of the data is implemented dynamic, but the decode tables do have
|
---|
| 19 | some limitations due fact we are masking and not full matching
|
---|
| 20 | * I change between hexidecimal and decimal assignments to make the
|
---|
| 21 | meaning of the code more clear
|
---|
| 22 | * enum and stucts are used to make the code readable
|
---|
| 23 | * the code is not optimized on space
|
---|
| 24 | * Output is written as same way as input
|
---|
| 25 |
|
---|
| 26 |
|
---|
| 27 | = Structure =
|
---|
| 28 | + sim
|
---|
| 29 | ++ datapath
|
---|
| 30 | +++ memory
|
---|
| 31 | +++ constant
|
---|
| 32 | +++ alu
|
---|
| 33 | +++ imm
|
---|
| 34 | ++ control
|
---|
| 35 |
|
---|
| 36 |
|
---|
| 37 | = Differences between normal implementation =
|
---|
| 38 | I choose to have a constant and imm component, both are really easy to
|
---|
| 39 | implement do the fact that they are just functions and not buffer like
|
---|
| 40 | types.
|
---|
| 41 |
|
---|
| 42 |
|
---|
| 43 | = Files =
|
---|
| 44 | Makefile = Enhanced version `make help` will show options
|
---|
| 45 | README.txt = Reading right now
|
---|
| 46 | alu.c = Component ALU
|
---|
| 47 | alu.h = --header
|
---|
| 48 | constant.c = Component Constant
|
---|
| 49 | constant.h = --header
|
---|
| 50 | control.c = Microprogram control
|
---|
| 51 | control.h = --header
|
---|
| 52 | datapath.c = Datapath (like buffers)
|
---|
| 53 | datapath.h = --header
|
---|
| 54 | imm.c = Component IMM
|
---|
| 55 | imm.h = --header
|
---|
| 56 | memory.c = Component Memory
|
---|
| 57 | memory.h = --header
|
---|
| 58 | sim.c = Main simulator
|
---|
| 59 | sim.h = --header (contains general declarations)
|
---|