@@ -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 \t Catch writes to the text segment" );
122122
123+ CommandLine::option_handle MEM_OUTERSPACE
124+ = cmd.addOption (" " , " catch-outerspace" , Arg::None,
125+ " --catch-outerspace \t Catch 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 \t Catch 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 \t Catch 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 \t Catch writes to the outerspace" );
126-
127- CommandLine::option_handle WRITE_MEM_LOWERSPACE
128- = cmd.addOption (" " , " catch-write-lowerspace" , Arg::None,
129- " --catch-write-lowerspace \t Catch writes to the lowerspace" );
138+ " --catch-write-outerspace \t Legacy, see --catch-above-outerspace" );
130139
131140 CommandLine::option_handle TIMEOUT = cmd.addOption (" " , " timeout" , Arg::Required,
132141 " --timeout TIME \t Experiment 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