17#ifndef BACKENDS_TC_INTROSPECTION_H_
18#define BACKENDS_TC_INTROSPECTION_H_
20#include "frontends/p4/parseAnnotations.h"
21#include "frontends/p4/parserCallGraph.h"
24#include "lib/nullstream.h"
26#include "tcAnnotations.h"
39 schemaVersion =
nullptr;
40 pipelineName =
nullptr;
42 void initIntrospectionInfo(IR::TCPipeline *tcPipeline) {
43 schemaVersion =
"1.0.0"_cs;
44 pipelineName = tcPipeline->pipelineName;
54 unsigned int bitwidth;
74 unsigned int dataType;
75 unsigned int bitwidth;
83enum ActionScope { TableOnly, DefaultOnly, TableAndDefault };
96 scope = TableAndDefault;
106 unsigned int tentries;
107 unsigned int numMask;
108 unsigned int keysize;
114 permissions =
nullptr;
142 permissions =
nullptr;
149 IR::TCPipeline *tcPipeline;
159 : tcPipeline(tcPipeline), refMap(refMap), typeMap(typeMap) {}
160 void postorder(
const IR::P4Table *t);
166 void collectTableInfo();
167 void collectExternInfo();
168 void collectKeyInfo(
const IR::Key *k,
struct TableAttributes *tableinfo);
169 void collectActionInfo(
const IR::ActionList *actionlist,
struct TableAttributes *tableinfo,
170 const IR::P4Table *p4table,
const IR::TCTable *table);
173 bool serializeIntrospectionJson(std::ostream &destination);
174 std::optional<cstring> checkValidTcType(
const IR::StringLiteral *sl);
The Declaration interface, representing objects with names.
Definition declaration.h:26
Class used to encode maps from paths to declarations.
Definition referenceMap.h:66
This pass generates introspection JSON into user specified file.
Definition introspection.h:148
Definition ordered_map.h:32
Definition safe_vector.h:27
This file defines functions for the pass to generate the introspection file.
Definition tc/backend.cpp:24
Definition introspection.h:85
Definition introspection.h:71
Definition introspection.h:65
Definition introspection.h:135
Definition introspection.h:123
Definition introspection.h:35
Definition introspection.h:48
Definition introspection.h:102