aboutsummaryrefslogtreecommitdiff
path: root/qtmips_machine/machineconfig.h
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2018-01-15 13:13:56 +0100
committerKarel Kočí <cynerd@email.cz>2018-01-15 13:13:56 +0100
commit5241e1d9733ea69a91d3f497bc794ce881ad49fd (patch)
treeed941cd505a82f81f9b39004a70087c5b900dc06 /qtmips_machine/machineconfig.h
parent4dc4726c80bab8192abfb2d881a69ef9f490754f (diff)
downloadqtmips-5241e1d9733ea69a91d3f497bc794ce881ad49fd.tar.gz
qtmips-5241e1d9733ea69a91d3f497bc794ce881ad49fd.tar.bz2
qtmips-5241e1d9733ea69a91d3f497bc794ce881ad49fd.zip
Change how we configure cache and configure hazard unit
Diffstat (limited to 'qtmips_machine/machineconfig.h')
-rw-r--r--qtmips_machine/machineconfig.h42
1 files changed, 32 insertions, 10 deletions
diff --git a/qtmips_machine/machineconfig.h b/qtmips_machine/machineconfig.h
index c55228a..10b8458 100644
--- a/qtmips_machine/machineconfig.h
+++ b/qtmips_machine/machineconfig.h
@@ -5,38 +5,60 @@
namespace machine {
+class MachineConfigCache {
+public:
+ MachineConfigCache();
+ MachineConfigCache(const MachineConfigCache *cc);
+
+ // TODO
+
+ bool operator ==(const MachineConfigCache &c) const;
+ bool operator !=(const MachineConfigCache &c) const;
+
+private:
+ // TODO
+};
+
class MachineConfig {
public:
MachineConfig();
MachineConfig(const MachineConfig *cc);
- enum CacheType {
- CCT_NONE,
- CCT_ASSOCIATIVE,
- // TODO
+ enum HazardUnit {
+ HU_NONE,
+ HU_STALL,
+ HU_STALL_FORWARD
};
// Configure if CPU is pipelined
// In default disabled.
void set_pipelined(bool);
- // Configure if we want to do jump prediction
+ // Configure if cpu should simulate delay slot in non-pipelined core
// In default enabled. When disabled it also automatically disables pipelining.
void set_delay_slot(bool);
- // Configure cache type
- // In default CCT_NONE is used.
- void set_cache(enum CacheType);
// Set path to source elf file. This has to be set before core is initialized.
void set_elf(QString path);
+ // Configure cache
+ void set_cache_program(const MachineConfigCache&);
+ void set_cache_data(const MachineConfigCache&);
+ // Hazard unit
+ void set_hazard_unit(enum HazardUnit);
bool pipelined() const;
bool delay_slot() const;
- enum CacheType cache() const;
QString elf() const;
+ MachineConfigCache cache_program() const;
+ MachineConfigCache cache_data() const;
+ enum HazardUnit hazard_unit() const;
+
+ bool operator ==(const MachineConfig &c) const;
+ bool operator !=(const MachineConfig &c) const;
private:
bool pipeline, delayslot;
- enum CacheType cache_type;
QString elf_path;
+ MachineConfigCache cch_program, cch_data;
+ enum HazardUnit hunit;
};
}