summaryrefslogtreecommitdiff
path: root/src/sim/if.cc
blob: deed8e1a6facb8cc44bd3fc6f4ca9812d254a1b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include "if.h"
#include "accessor.h"
#include "instrDTO.h"
#include "response.h"

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_if_cycle(this->clock_cycle);
		i.set_instr_bits(bits);
	}

	return r;
}