ROSS
st-instrumentation.c
Go to the documentation of this file.
1#include <ross.h>
2#include <sys/stat.h>
3
5char g_st_stats_path[4096] = {0};
10
13
15int g_st_num_gvt = 10;
16
20
21double g_st_vt_interval = 1000000;
23
24
25
26static const tw_optdef inst_options[] = {
27 TWOPT_GROUP("ROSS Instrumentation"),
28 TWOPT_UINT("engine-stats", g_st_engine_stats, "Collect sim engine level stats; 0 don't collect, 1 GVT-sampling, 2 RT sampling, 3 VT sampling, 4 All sampling modes"),
29 TWOPT_UINT("model-stats", g_st_model_stats, "Collect model level stats (requires model-level implementation); 0 don't collect, 1 GVT-sampling, 2 RT sampling, 3 VT sampling, 4 all sampling modes"),
30 TWOPT_UINT("num-gvt", g_st_num_gvt, "number of GVT computations between GVT-based sampling points"),
31 TWOPT_ULONGLONG("rt-interval", g_st_rt_interval, "real time sampling interval in ms"),
32 TWOPT_DOUBLE("vt-interval", g_st_vt_interval, "Virtual time sampling interval"),
33 TWOPT_DOUBLE("vt-samp-end", g_st_sampling_end, "End time for virtual time sampling (if different from g_tw_ts_end)"),
34 TWOPT_UINT("pe-data", g_st_pe_data, "Turn on/off collection of sim engine data at PE level"),
35 TWOPT_UINT("kp-data", g_st_kp_data, "Turn on/off collection of sim engine data at KP level"),
36 TWOPT_UINT("lp-data", g_st_lp_data, "Turn on/off collection of sim engine data at LP level"),
37 TWOPT_UINT("event-trace", g_st_ev_trace, "collect detailed data on all events for specified LPs; 0, no trace, 1 full trace, 2 only events causing rollbacks, 3 only committed events"),
38 TWOPT_CHAR("stats-prefix", g_st_stats_out, "prefix for filename(s) for stats output"),
39 TWOPT_CHAR("stats-path", g_st_stats_path, "path to directory to save instrumentation output"),
40 TWOPT_UINT("buffer-size", g_st_buffer_size, "size of buffer in bytes for stats collection"),
41 TWOPT_UINT("buffer-free", g_st_buffer_free_percent, "percentage of free space left in buffer before writing out at GVT"),
42 TWOPT_UINT("disable-output", g_st_disable_out, "used for perturbation analysis; buffer never dumped to file when 1"),
43 TWOPT_END()
44};
45
47{
48 return inst_options;
49}
50
51void st_inst_init(void)
52{
54
56 return;
57
58 // setup appropriate flags for various instrumentation modes
59 // set up files and buffers for necessary instrumentation modes
61 {
64 }
66 {
69 }
70
75
77 {
80 }
81
82 if (g_st_ev_trace)
86}
87
104
106{
110 {
111 // collect data one final time to account for time between last sample and sim end time
114 }
115 if (g_st_ev_trace)
121
122}
static tw_clock tw_clock_read(void)
Definition aarch64.h:8
uint64_t tw_clock
Definition aarch64.h:6
int g_st_lp_data
@ GVT_STATS
@ ALL_STATS
#define INST_MAX_LENGTH
tw_clock g_st_rt_samp_start_cycles
int g_st_model_stats
int g_st_buffer_free_percent
@ ANALYSIS_LP
@ EV_TRACE
@ GVT_COL
@ MODEL_COL
double g_st_vt_interval
void st_collect_engine_data(tw_pe *me, int col_type)
double g_st_sampling_end
int g_st_gvt_sampling
tw_clock g_st_rt_interval
int g_st_kp_data
void st_buffer_init(int type)
int g_st_engine_stats
int g_st_ev_trace
int g_st_disable_out
int g_st_buffer_size
int g_st_rt_sampling
char g_st_stats_out[4096]
char g_st_stats_path[4096]
int g_st_num_gvt
int g_st_pe_data
void specialized_lp_run()
void st_buffer_write(int end_of_sim, int type)
void st_buffer_finalize(int type)
int g_st_use_analysis_lps
unsigned long long g_tw_clock_rate
#define TWOPT_UINT(n, v, h)
Definition tw-opts.h:33
#define TWOPT_GROUP(h)
Definition tw-opts.h:30
#define TWOPT_ULONGLONG(n, v, h)
Definition tw-opts.h:32
#define TWOPT_END()
Definition tw-opts.h:39
#define TWOPT_CHAR(n, v, h)
Definition tw-opts.h:36
#define TWOPT_DOUBLE(n, v, h)
Definition tw-opts.h:35
void st_inst_finalize(tw_pe *me)
void st_inst_init(void)
static const tw_optdef inst_options[]
void st_inst_dump()
const tw_optdef * st_inst_opts(void)
Holds the entire PE state.
Definition ross-types.h:416