5#ifndef FRONTENDS_P4_METRICS_METRICSSTRUCTURE_H_
6#define FRONTENDS_P4_METRICS_METRICSSTRUCTURE_H_
10#include "lib/cstring.h"
11#include "lib/ordered_map.h"
16 unsigned numOperations = 0;
17 unsigned totalSize = 0;
28 unsigned variables = 0;
31 unsigned conditionals = 0;
33 unsigned functions = 0;
34 unsigned parameters = 0;
40 result.variables = (variables > other.variables) ? (variables - other.variables) : 0;
41 result.states = (states > other.states) ? (states - other.states) : 0;
42 result.enums = (enums > other.enums) ? (enums - other.enums) : 0;
44 (conditionals > other.conditionals) ? (conditionals - other.conditionals) : 0;
45 result.actions = (actions > other.actions) ? (actions - other.actions) : 0;
46 result.functions = (functions > other.functions) ? (functions - other.functions) : 0;
47 result.parameters = (parameters > other.parameters) ? (parameters - other.parameters) : 0;
48 result.returns = (returns > other.returns) ? (returns - other.returns) : 0;
54 unsigned externFunctions = 0;
55 unsigned externStructures = 0;
56 unsigned externFunctionUses = 0;
57 unsigned externStructUses = 0;
62 std::vector<cstring> beforeActions;
63 std::vector<cstring> afterActions;
64 std::vector<cstring> beforeVariables;
65 std::vector<cstring> afterVariables;
69 unsigned numTables = 0;
75 unsigned totalKeys = 0;
76 unsigned totalKeySizeSum = 0;
77 double avgKeySize = 0;
78 double avgKeysPerTable = 0.0;
79 unsigned maxKeysPerTable = 0;
81 unsigned totalActions = 0;
82 double avgActionsPerTable = 0.0;
83 unsigned maxActionsPerTable = 0;
88 double avgNestingDepth = 0.0;
89 unsigned maxNestingDepth = 0;
94 unsigned totalStates = 0;
98 unsigned uniqueOperators = 0;
99 unsigned uniqueOperands = 0;
100 unsigned totalOperators = 0;
101 unsigned totalOperands = 0;
102 unsigned vocabulary = 0.0;
103 unsigned length = 0.0;
104 double difficulty = 0.0;
107 double deliveredBugs = 0.0;
111 unsigned numHeaders = 0;
112 double avgFieldsNum = 0.0;
113 double avgFieldSize = 0.0;
120 unsigned linesOfCode = 0;
121 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:53
Definition metricsStructure.h:97
Definition metricsStructure.h:68
Definition metricsStructure.h:119
Definition metricsStructure.h:86
Definition metricsStructure.h:15
Definition metricsStructure.h:92
Definition metricsStructure.h:60
Definition metricsStructure.h:27