aboutsummaryrefslogtreecommitdiff
path: root/qtmips_machine/machineconfig.cpp
blob: 2b4da3457b6df028c8287a5871400b08f81fe254 (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;
    jumppred = false;
    cache_type = CCT_NONE;
    elf_path = QString("");
}

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

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

void MachineConfig::set_jump_prediction(bool v) {
    jumppred = v;
    if (jumppred)
        pipeline = true;
}

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::jump_prediction() const {
    return jumppred;
}

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

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