blob: 559ad2e548e373874dde5459edb5a620260a1c1b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
#include "if.h"
#include "accessor.h"
#include "instrDTO.h"
#include "response.h"
#include "stage.h"
IF::IF(Stage *stage) : Stage(stage) { this->id = FETCH; }
Response IF::advance(InstrDTO &i)
{
Response r;
signed int bits;
r = this->storage->read_word(this->id, this->pc, bits);
if (r == OK) {
++this->pc;
i.set_time_of(this->id, this->clock_cycle);
i.set_instr_bits(bits);
}
return r;
}
|