aboutsummaryrefslogtreecommitdiff
path: root/qtmips_machine
diff options
context:
space:
mode:
Diffstat (limited to 'qtmips_machine')
-rw-r--r--qtmips_machine/machineconfig.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/qtmips_machine/machineconfig.cpp b/qtmips_machine/machineconfig.cpp
index ea9dc9d..ce0e3d8 100644
--- a/qtmips_machine/machineconfig.cpp
+++ b/qtmips_machine/machineconfig.cpp
@@ -84,17 +84,15 @@ void MachineConfigCache::set_enabled(bool v) {
}
void MachineConfigCache::set_sets(unsigned v) {
- // TODO verify that this is 2^N
- n_sets = v;
+ n_sets = v > 0 ? v : 1;
}
void MachineConfigCache::set_blocks(unsigned v) {
- // TODO even more verifications for 2^N
- n_blocks = v;
+ n_blocks = v > 0 ? v : 1;
}
void MachineConfigCache::set_associativity(unsigned v) {
- d_associativity = v;
+ d_associativity = v > 0 ? v : 1;
}
void MachineConfigCache::set_replacement_policy(enum ReplacementPolicy v) {