5#ifndef FRONTENDS_P4_METRICS_METRICSSTRUCTURE_H_
6#define FRONTENDS_P4_METRICS_METRICSSTRUCTURE_H_
11#include "lib/cstring.h"
12#include "lib/ordered_map.h"
17 unsigned numOperations = 0;
18 unsigned totalSize = 0;
29 unsigned variables = 0;
32 unsigned conditionals = 0;
34 unsigned functions = 0;
35 unsigned parameters = 0;
41 result.variables = (variables > other.variables) ? (variables - other.variables) : 0;
42 result.states = (states > other.states) ? (states - other.states) : 0;
43 result.enums = (enums > other.enums) ? (enums - other.enums) : 0;
45 (conditionals > other.conditionals) ? (conditionals - other.conditionals) : 0;
46 result.actions = (actions > other.actions) ? (actions - other.actions) : 0;
47 result.functions = (functions > other.functions) ? (functions - other.functions) : 0;
48 result.parameters = (parameters > other.parameters) ? (parameters - other.parameters) : 0;
49 result.returns = (returns > other.returns) ? (returns - other.returns) : 0;
55 unsigned externFunctions = 0;
56 unsigned externStructures = 0;
57 unsigned externFunctionUses = 0;
58 unsigned externStructUses = 0;
63 std::vector<cstring> beforeActions;
64 std::vector<cstring> afterActions;
65 std::vector<cstring> beforeVariables;
66 std::vector<cstring> afterVariables;
70 unsigned numTables = 0;
76 unsigned totalKeys = 0;
77 unsigned totalKeySizeSum = 0;
78 double avgKeySize = 0;
79 double avgKeysPerTable = 0.0;
80 unsigned maxKeysPerTable = 0;
82 unsigned totalActions = 0;
83 double avgActionsPerTable = 0.0;
84 unsigned maxActionsPerTable = 0;
89 double avgNestingDepth = 0.0;
90 unsigned maxNestingDepth = 0;
95 unsigned totalStates = 0;
99 unsigned uniqueOperators = 0;
100 unsigned uniqueOperands = 0;
101 unsigned totalOperators = 0;
102 unsigned totalOperands = 0;
103 unsigned vocabulary = 0.0;
104 unsigned length = 0.0;
105 double difficulty = 0.0;
108 double deliveredBugs = 0.0;
112 unsigned numHeaders = 0;
113 double avgFieldsNum = 0.0;
114 double avgFieldSize = 0.0;
121 unsigned linesOfCode = 0;
122 unsigned inlinedActions = 0;
Definition ordered_map.h:32
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:24
Definition metricsStructure.h:54
Definition metricsStructure.h:98
Definition metricsStructure.h:69
Definition metricsStructure.h:120
Definition metricsStructure.h:87
Definition metricsStructure.h:16
Definition metricsStructure.h:93
Definition metricsStructure.h:61
Definition metricsStructure.h:28