From a56b25212865c57251719a1d4a5d9d6a79b339c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Tue, 6 Mar 2018 21:57:07 +0100 Subject: Implement Cache configuration This commit implements both cache configuration for machine and for gui. --- qtmips_gui/newdialog.h | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) (limited to 'qtmips_gui/newdialog.h') diff --git a/qtmips_gui/newdialog.h b/qtmips_gui/newdialog.h index 5b50a41..79616a2 100644 --- a/qtmips_gui/newdialog.h +++ b/qtmips_gui/newdialog.h @@ -9,12 +9,16 @@ #include "ui_NewDialogCache.h" #include "machineconfig.h" +class NewDialogCacheHandler; + class NewDialog : public QDialog { Q_OBJECT public: NewDialog(QWidget *parent, QSettings *settings); ~NewDialog(); + void switch2custom(); + protected: void closeEvent(QCloseEvent *); @@ -29,9 +33,6 @@ private slots: void mem_protec_exec_change(bool); void mem_protec_write_change(bool); - void cache_data_change(bool); - void cache_program_change(bool); - private: Ui::NewDialog *ui; Ui::NewDialogCache *ui_cache_p, *ui_cache_d; @@ -40,8 +41,33 @@ private: machine::MachineConfig *config; void config_gui(); // Apply configuration to gui + unsigned preset_number(); void load_settings(); void store_settings(); + NewDialogCacheHandler *cache_handler_p, *cache_handler_d; +}; + +class NewDialogCacheHandler : QObject { + Q_OBJECT +public: + NewDialogCacheHandler(NewDialog *nd, Ui::NewDialogCache *ui); + + void set_config(machine::MachineConfigCache *config); + + void config_gui(); + +private slots: + void enabled(bool); + void numsets(); + void blocksize(); + void degreeassociativity(); + void replacement(int); + void writeback(int); + +private: + NewDialog *nd; + Ui::NewDialogCache *ui; + machine::MachineConfigCache *config; }; #endif // NEWDIALOG_H -- cgit v1.2.3