summaryrefslogtreecommitdiff
path: root/src/sim/dum.cc
blob: 76d4acdbfbaf835a8f6f707ae4bfc86caf2aaef0 (plain)
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
#include "dum.h"
#include "accessor.h"
#include "instrDTO.h"
#include "response.h"
#include "stage.h"
#include "utils.h"

DUM::DUM(Stage *stage) : Stage(stage) { this->id = IDLE; }

InstrDTO *DUM::advance(Response p)
{
	InstrDTO *r = nullptr;

	if (this->curr_instr && p == WAIT) {
		this->curr_instr->set_time_of(this->id, this->clock_cycle);
		r = new InstrDTO(*this->curr_instr);
		delete this->curr_instr;
		curr_instr = nullptr;
	}

	return r;
}

void DUM::advance_helper() {}

void DUM::set_curr_instr(InstrDTO *d)
{
	this->curr_instr = d;
}