diff options
author | bd <bdunahu@operationnull.com> | 2025-04-26 03:39:28 -0400 |
---|---|---|
committer | bd <bdunahu@operationnull.com> | 2025-04-26 03:39:28 -0400 |
commit | a78163745b43a0c420ae4ea5792def30a94420eb (patch) | |
tree | 9cc23cfec1a7e524822d604e95e237034b31a95e /gui/gui.cc | |
parent | c98a0c26c4ccb5c4ae0e9f5810be910a7b299037 (diff) |
Partial cache size generation, full cache display
Diffstat (limited to 'gui/gui.cc')
-rw-r--r-- | gui/gui.cc | 26 |
1 files changed, 15 insertions, 11 deletions
@@ -20,10 +20,11 @@ #include "dynamicwaysentry.h" #include "messages.h" #include "storageview.h" +#include "util.h" +#include <QHeaderView> #include <QPixmap> #include <QString> #include <QTableView> -#include <QHeaderView> GUI::GUI(QWidget *parent) : QMainWindow(parent), ui(new Ui::GUI) { @@ -332,6 +333,8 @@ void GUI::on_config_clicked() else this->set_status(get_initialize, "happy"); + this->curr_cache_levels = ways.size(); + emit sendConfigure(ways, this->p, is_pipelined); make_tabs(2 + ways.size()); } @@ -339,31 +342,32 @@ void GUI::on_config_clicked() void GUI::make_tabs(int num) { int i; - QStringList xTra; StorageView *e; QTableView *t; QString n; - xTra = {"Registers", "DRAM"}; - ui->storage->clear(); this->tab_boxes.clear(); qDeleteAll(this->tab_boxes); for (i = 0; i < num; ++i) { - e = new StorageView(10, this); + // make the name + if (i == 0) { + n = "Registers"; + e = new StorageView(0, this); + } else if (i == 1) { + n = "DRAM"; + e = new StorageView(MEM_LINES, this); + } else { + n = QString("L%1").arg(i - 1); + e = new StorageView(cache_size_mapper(this->curr_cache_levels, i), this); + } t = new QTableView; t->setModel(e); t->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); - // make the name - if (i < xTra.size()) - n = xTra[i]; - else - n = QString("L%1").arg(i - 1); - ui->storage->addTab(t, n); this->tab_boxes.push_back(e); } |