Skip to content

Commit c8b337b

Browse files
committed
GUI: do TLBdock statistical values updates only when necessary
This is attempt to find way how to speedup the MMU S and U mode execution. But observed sped did not change too mucha. Signed-off-by: Pavel Pisa <pisa@fel.cvut.cz>
1 parent 75bf27d commit c8b337b

1 file changed

Lines changed: 28 additions & 14 deletions

File tree

src/gui/windows/tlb/tlbdock.cpp

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -110,30 +110,44 @@ void TLBDock::paintEvent(QPaintEvent *event) {
110110
}
111111

112112
void TLBDock::hit_update(unsigned val) {
113-
hit = val;
114-
update();
113+
if (hit != val) {
114+
hit = val;
115+
l_hit->update();
116+
}
115117
}
116118

117119
void TLBDock::miss_update(unsigned val) {
118-
miss = val;
119-
update();
120+
if (miss != val) {
121+
miss = val;
122+
l_miss->update();
123+
}
120124
}
121125

122126
void TLBDock::statistics_update(unsigned stalled_cycles, double speed_improv_v, double hit_rate_v) {
123-
stalled = stalled_cycles;
124-
speed_improv = speed_improv_v;
125-
hit_rate = hit_rate_v;
126-
update();
127+
if (stalled != stalled_cycles) {
128+
stalled = stalled_cycles;
129+
l_stalled->update();
130+
}
131+
if (speed_improv != speed_improv_v) {
132+
speed_improv = speed_improv_v;
133+
l_speed->update();
134+
}
135+
if (hit_rate != hit_rate_v) {
136+
hit_rate = hit_rate_v;
137+
l_hit_rate->update();
138+
}
127139
}
128140

129141
void TLBDock::memory_reads_update(unsigned val) {
130-
memory_reads = val;
131-
l_m_reads->setText(QString::number(memory_reads));
132-
update();
142+
if (memory_reads != val) {
143+
memory_reads = val;
144+
l_m_reads->update();
145+
}
133146
}
134147

135148
void TLBDock::memory_writes_update(unsigned val) {
136-
memory_writes = val;
137-
l_m_writes->setText(QString::number(memory_writes));
138-
update();
149+
if (memory_writes != val) {
150+
memory_writes = val;
151+
l_m_writes->update();
152+
}
139153
}

0 commit comments

Comments
 (0)