aboutsummaryrefslogtreecommitdiff
path: root/qtmips_machine/qtmipsmachine.cpp
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/qtmipsmachine.cpp
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/qtmipsmachine.cpp')
-rw-r--r--qtmips_machine/qtmipsmachine.cpp19
1 files changed, 2 insertions, 17 deletions
diff --git a/qtmips_machine/qtmipsmachine.cpp b/qtmips_machine/qtmipsmachine.cpp
index f2683fb..c60cdce 100644
--- a/qtmips_machine/qtmipsmachine.cpp
+++ b/qtmips_machine/qtmipsmachine.cpp
@@ -14,25 +14,10 @@ QtMipsMachine::QtMipsMachine(const MachineConfig &cc) : QObject(), mcnf(&cc) {
regs = new Registers();
mem = new Memory(*mem_program_only);
- MemoryAccess *coremem;
- switch (cc.cache()) {
- case MachineConfig::CCT_NONE:
- cch = nullptr;
- coremem = mem;
- break;
- case MachineConfig::CCT_ASSOCIATIVE:
- // TODO
- coremem = mem;
- //coremem = cch = new CacheAssociative();
- break;
- default:
- throw QTMIPS_EXCEPTION(Sanity, "Trying to configure unknown cache type", "");
- }
-
if (cc.pipelined())
- cr = new CorePipelined(regs, coremem);
+ cr = new CorePipelined(regs, mem);
else
- cr = new CoreSingle(regs, coremem, cc.delay_slot());
+ cr = new CoreSingle(regs, mem, cc.delay_slot());
run_t = new QTimer(this);
set_speed(0); // In default run as fast as possible