Pin
CONTROLLER_REGIONS

Controller for "regions" that are specified using instruction counts. Use -regions:in regions.csv

regions.csv files will be an alternative to PinPoints files. The main goal is to separate warm-up specification from region description. Another major goal is the simplicity of implementation.

Regions are specified using a text file with the records of the form: comment,thread-id,region-id,simulation-region-start-icount, simulation-region-end-icount,region-weight

[ fields after the first six are ignored, so are lines beginning with '#' ]

Knobs:

-regions:in foo.csv : input file -regions:warmup N : use N instructions for warmup -regions:prolog N : use N instructions for prolog -regions:epilog N : use N instructions for epilog -regions:verbose : for getting informed about regions/events -regions:overlap-ok : allow overlap among multiple regions. -regions:out : Output file for regions skipped due to overlap (if overlap is not ok) The idea is to feed this file with "-regions:in" to the next invocation of the tool to process skipped regions. If this knob is specified but no regions are skipped, the output file will be empty.

Region working with the controller:

  1. IREGION class reads region data from file.
  2. Region events are sorted according to icount and type.
  3. Each region event is translated into controller event string like: start:icount:100:tid0
  4. The events will be triggered by the controller ICOUNT alarms mechanism.
  5. The controller will notify IREGION class of the events.
  6. Modify driver not to allow IREGION events and controller events.

Region processing:

The overall regions picture looks as follows: WARMUP–PROLOG–(SIM)REGION–EPILOG

each sub-region has a start and end event. So there are eight events possible (some coinciding e.g. warmup-end and prolog-start) EVENT_WARMUP_START : Beginning of warmup region EVENT_WARMUP_STOP : End of warmup region EVENT_PROLOG_START : Beginning of prolog region EVENT_PROLOG_STOP : End of prolog region EVENT_START : Beginning of interval EVENT_STOP : End of interval EVENT_EPILOG_START : Beginning of epilog region EVENT_EPILOG_STOP : End of epilog region

Using the warmup/prolog/epilog knobs provided to the controller, the region boundaries for the four sub-regions above are computed for each record in the regions.csv file.

If overlap is not allowed (-regions:overlap-ok is zero), any record that has any of its 4 sub-regions overapping with any sub-region of previously processed records will be ignored. If -regions:out knob is specified, the skipped records will be output to a file. The idea is to feed the skipped region records to another invocation of the tool involved iteratively till all the records are processed.

As regions are processed, an event list containing tuples of the form (icount, event-type, region-pointer) is created per thread. There is one tuple for each of the possible 8 events for four sub-regions.