P4C
The P4 Compiler
Loading...
Searching...
No Matches
tc_defines.h
1/*
2Copyright (C) 2023 Intel Corporation
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing,
11software distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions
14and limitations under the License.
15*/
16
17#ifndef BACKENDS_TC_TC_DEFINES_H_
18#define BACKENDS_TC_TC_DEFINES_H_
19
20namespace P4::TC {
21
22inline constexpr auto DEFAULT_TABLE_ENTRIES = 1024;
23inline constexpr auto DEFAULT_KEY_MASK = 8;
24inline constexpr auto PORTID_BITWIDTH = 32;
25inline constexpr auto DEFAULT_KEY_ID = 1;
26inline constexpr auto DEFAULT_METADATA_ID = 1;
27inline constexpr auto BITWIDTH = 32;
28inline constexpr auto DEFAULT_TIMER_PROFILES = 4;
29
30// Default Access Permissons
31inline constexpr auto DEFAULT_TABLE_CONTROL_PATH_ACCESS = "CRUDPS";
32inline constexpr auto DEFAULT_TABLE_DATA_PATH_ACCESS = "RX";
33inline constexpr auto DEFAULT_ADD_ON_MISS_TABLE_CONTROL_PATH_ACCESS = "CRUDPS";
34inline constexpr auto DEFAULT_ADD_ON_MISS_TABLE_DATA_PATH_ACCESS = "CRXP";
35inline constexpr auto DEFAULT_EXTERN_CONTROL_PATH_ACCESS = "RUPS";
36inline constexpr auto DEFAULT_EXTERN_DATA_PATH_ACCESS = "RUXP";
37
38// Supported data types.
39inline constexpr auto BIT_TYPE = 0;
40inline constexpr auto DEV_TYPE = 1;
41inline constexpr auto MACADDR_TYPE = 2;
42inline constexpr auto IPV4_TYPE = 3;
43inline constexpr auto IPV6_TYPE = 4;
44inline constexpr auto BE16_TYPE = 5;
45inline constexpr auto BE32_TYPE = 6;
46inline constexpr auto BE64_TYPE = 7;
47
48inline constexpr auto PARAM_INDEX_0 = 0;
49inline constexpr auto PARAM_INDEX_1 = 1;
50inline constexpr auto PARAM_INDEX_2 = 2;
51inline constexpr auto PARAM_INDEX_3 = 3;
52
53inline constexpr auto SET = 1;
54inline constexpr auto RESET = 0;
55
56// PNA parser metadata fields.
57inline constexpr auto PARSER_RECIRCULATED = 0;
58inline constexpr auto PARSER_INPUT_PORT = 1;
59
60// PNA input metadata fields.
61inline constexpr auto INPUT_RECIRCULATED = 0;
62inline constexpr auto INPUT_TIMESTAMP = 1;
63inline constexpr auto INPUT_PARSER_ERROR = 2;
64inline constexpr auto INPUT_CLASS_OF_SERVICE = 3;
65inline constexpr auto INPUT_INPUT_PORT = 4;
66
67// PNA output metadata fields.
68inline constexpr auto OUTPUT_CLASS_OF_SERVICE = 0;
69
70// Kernel metadata fields.
71inline constexpr auto UNDEFINED = 0;
72inline constexpr auto UNSUPPORTED = 1;
73inline constexpr auto SKBREDIR = 2;
74inline constexpr auto SKBIIF = 3;
75inline constexpr auto SKBTSTAMP = 4;
76inline constexpr auto SKBPRIO = 5;
77
78inline constexpr auto MAX_PNA_PARSER_META = 2;
79inline constexpr auto MAX_PNA_INPUT_META = 5;
80inline constexpr auto MAX_PNA_OUTPUT_META = 1;
81
82inline constexpr auto TABLEDEFAULT = 0;
83inline constexpr auto TABLEONLY = 1;
84inline constexpr auto DEFAULTONLY = 2;
85
86inline constexpr auto EXACT_TYPE = 0;
87inline constexpr auto LPM_TYPE = 1;
88inline constexpr auto TERNARY_TYPE = 2;
89
90inline constexpr auto NONE = 0;
91inline constexpr auto IN = 1;
92inline constexpr auto OUT = 2;
93inline constexpr auto INOUT = 3;
94} // namespace P4::TC
95
96#endif /* BACKENDS_TC_TC_DEFINES_H_ */
This file defines functions for the pass to generate the introspection file.
Definition tc/backend.cpp:24