-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdecode.h
42 lines (33 loc) · 848 Bytes
/
decode.h
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
#ifndef DECODE_H
#define DECODE_H
#include "fetch.h"
/**
* Out-bucket for the decode phase, in-bucket for the execute phase.
* Contains the values stored in the relevant registers, as well as enough
* information to tell the later phases what to do (opcode, funct code,
* destination, I think that's it..._
*/
typedef struct {
int ready;
short opcode;
long rs;
long rt;
long rtval;
short rd;
short shamt;
short funct;
long imm;
} DecodeExecute;
typedef struct {
int count;
FetchDecode *inBucket;
DecodeExecute *outBucket;
long *reg;
} Decode;
Decode *DecodeInit(long *reg, FetchDecode *inBucket, DecodeExecute *outBucket);
/**
* Decode phase splits instruction into it's corresponding sections and looks
* up register values in the register file.
*/
void DecodePhase(Decode *decode);
#endif