Skip to content

Commit e457458

Browse files
committed
[generic-experiment] Correct names for argument names
As the outerspace listeners catch read and write accesses, this must be documented in the help message. The old parameter name is now marked as deprecated and can be removed in 2022. Furthmore, the experiment now has the combined command line argument --catch-outerspace, which enables catching accesses below and above the ELF.
1 parent 932530e commit e457458

File tree

1 file changed

+18
-11
lines changed

1 file changed

+18
-11
lines changed

src/experiments/generic-experiment/experiment.cc

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,22 @@ bool GenericExperiment::cb_start_experiment() {
120120
CommandLine::option_handle WRITE_MEM_TEXT = cmd.addOption("", "catch-write-textsegment", Arg::None,
121121
"--catch-write-textsegment \tCatch writes to the text segment");
122122

123+
CommandLine::option_handle MEM_OUTERSPACE
124+
= cmd.addOption("", "catch-outerspace", Arg::None,
125+
"--catch-outerspace \tCatch accesses outside the ELF's memory area");
126+
127+
CommandLine::option_handle MEM_UPPERSPACE
128+
= cmd.addOption("", "catch-upper-outerspace", Arg::None,
129+
"--catch-above-outerspace \tCatch accesses above the ELF's memory area");
130+
131+
CommandLine::option_handle MEM_LOWERSPACE
132+
= cmd.addOption("", "catch-lower-outerspace", Arg::None,
133+
"--catch-lower-outerspace \tCatch accesses below the ELF's memory area");
134+
135+
// FIXME: Deprecated Option, Remove after 2021
123136
CommandLine::option_handle WRITE_MEM_OUTERSPACE
124137
= cmd.addOption("", "catch-write-outerspace", Arg::None,
125-
"--catch-write-outerspace \tCatch writes to the outerspace");
126-
127-
CommandLine::option_handle WRITE_MEM_LOWERSPACE
128-
= cmd.addOption("", "catch-write-lowerspace", Arg::None,
129-
"--catch-write-lowerspace \tCatch writes to the lowerspace");
138+
"--catch-write-outerspace \tLegacy, see --catch-above-outerspace");
130139

131140
CommandLine::option_handle TIMEOUT = cmd.addOption("", "timeout", Arg::Required,
132141
"--timeout TIME \tExperiment timeout in uS");
@@ -228,24 +237,22 @@ bool GenericExperiment::cb_start_experiment() {
228237
}
229238

230239

231-
if (cmd[WRITE_MEM_OUTERSPACE]) {
240+
if (cmd[MEM_OUTERSPACE] || cmd[MEM_UPPERSPACE] || cmd[WRITE_MEM_OUTERSPACE]) {
232241
enabled_mem_outerspace = true;
233242

234243
auto bounds = m_elf->getValidAddressBounds();
235-
m_log << "Catch writes to upper outerspace from " << hex << bounds.second << std::endl;
244+
m_log << "Catch accesses to outerspace above of " << hex << bounds.second << std::endl;
236245

237246
l_mem_outerspace.setWatchAddress(bounds.second);
238247
l_mem_outerspace.setWatchWidth(numeric_limits<guest_address_t>::max() - bounds.second);
239248
}
240249

241-
if (cmd[WRITE_MEM_LOWERSPACE]) {
250+
if (cmd[MEM_OUTERSPACE] || cmd[MEM_LOWERSPACE]) {
242251
enabled_mem_lowerspace = true;
243252

244253
auto bounds = m_elf->getValidAddressBounds();
245-
m_log << "Catch writes to lower outer-space below " << hex << bounds.first << std::endl;
254+
m_log << "Catch accesses to outerspace below " << hex << bounds.first << std::endl;
246255

247-
// FIXME: this might not work if your benchmark uses any devices mapped below the actual ELF
248-
// however, this is not the case for RISC-V and consequently, it is ignored here.
249256
l_mem_lowerspace.setWatchAddress(numeric_limits<guest_address_t>::min());
250257
l_mem_lowerspace.setWatchWidth(bounds.first - numeric_limits<guest_address_t>::min());
251258
}

0 commit comments

Comments
 (0)