summaryrefslogtreecommitdiff
path: root/gui/worker.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gui/worker.cc')
-rw-r--r--gui/worker.cc14
1 files changed, 9 insertions, 5 deletions
diff --git a/gui/worker.cc b/gui/worker.cc
index a912e06..df6ebd2 100644
--- a/gui/worker.cc
+++ b/gui/worker.cc
@@ -6,7 +6,7 @@ void Worker::doWork()
{
qDebug() << "Initializing...";
this->d = new Dram(0);
- this->c = new Cache(this->d, 5, 0, 0);
+ this->c = new Cache(this->d, 8, 0, 0);
this->if_stage = new IF(nullptr);
this->id_stage = new ID(if_stage);
this->ex_stage = new EX(id_stage);
@@ -16,7 +16,7 @@ void Worker::doWork()
emit clock_cycles(this->ct->get_clock_cycle(), this->ct->get_pc());
emit dram_storage(this->d->view(0, 32));
- emit cache_storage(this->c->view(0, 7));
+ emit cache_storage(this->c->view(0, 256));
emit register_storage(this->ct->get_gprs());
std::vector<signed int> p;
@@ -84,6 +84,10 @@ Worker::~Worker()
delete this->c;
}
+void Worker::loadProgram(std::vector<signed int> p) {
+ this->d->load(p);
+}
+
void Worker::refreshDram()
{
qDebug() << "Refreshing Dram";
@@ -93,7 +97,7 @@ void Worker::refreshDram()
void Worker::refreshCache()
{
qDebug() << "Refreshing Dram";
- emit cache_storage(this->c->view(24, 31));
+ emit cache_storage(this->c->view(0, 256));
}
void Worker::refreshRegisters()
@@ -107,7 +111,7 @@ void Worker::runSteps(int steps)
qDebug() << "Running for steps: " << steps;
this->ct->run_for(steps);
emit dram_storage(this->d->view(0, 256));
- emit cache_storage(this->c->view(0, 7));
+ emit cache_storage(this->c->view(0, 256));
emit register_storage(this->ct->get_gprs());
emit clock_cycles(this->ct->get_clock_cycle(), this->ct->get_pc());
emit if_info(this->if_stage->stage_info());
@@ -122,7 +126,7 @@ void Worker::runStep()
qDebug() << "Running for 1 step ";
this->ct->run_for(1);
emit dram_storage(this->d->view(0, 256));
- emit cache_storage(this->c->view(24, 8));
+ emit cache_storage(this->c->view(0, 256));
emit register_storage(this->ct->get_gprs());
emit clock_cycles(this->ct->get_clock_cycle(), this->ct->get_pc());
emit if_info(this->if_stage->stage_info());