aboutsummaryrefslogtreecommitdiff
path: root/qtmips_machine/machineconfig.cpp
blob: 0947e22f8bccb032e7273ef330b8b257f594f624 (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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include "machineconfig.h"

using namespace machine;

MachineConfig::MachineConfig() {
    pipeline = false;
    delayslot = true;
    cache_type = CCT_NONE;
    elf_path = QString("");
}

MachineConfig::MachineConfig(MachineConfig *cc) {
    pipeline = cc->pipelined();
    delayslot = cc->delay_slot();
    cache_type = cc->cache();
    elf_path = cc->elf();
}

void MachineConfig::set_pipelined(bool v) {
    pipeline = v;
}

void MachineConfig::set_delay_slot(bool v) {
    delayslot = v;
    if (!delayslot)
        pipeline = false;
}

void MachineConfig::set_cache(enum CacheType cc) {
    cache_type = cc;
}

void MachineConfig::set_elf(QString path) {
    elf_path = path;
}

bool MachineConfig::pipelined() const {
    return pipeline;
}

bool MachineConfig::delay_slot() const {
    return delayslot;
}

enum MachineConfig::CacheType MachineConfig::cache() const {
    return cache_type;
}

QString MachineConfig::elf() const {
    return elf_path;
}