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 DEFAULT_KEY_MASK_EXACT = 1;
25inline constexpr auto PORTID_BITWIDTH = 32;
26inline constexpr auto DEFAULT_KEY_ID = 1;
27inline constexpr auto DEFAULT_METADATA_ID = 1;
28inline constexpr auto BITWIDTH = 32;
29inline constexpr auto DEFAULT_TIMER_PROFILES = 4;
30
31// Default Access Permissons
32inline constexpr auto DEFAULT_TABLE_CONTROL_PATH_ACCESS = "CRUDPS";
33inline constexpr auto DEFAULT_TABLE_DATA_PATH_ACCESS = "RX";
34inline constexpr auto DEFAULT_ADD_ON_MISS_TABLE_CONTROL_PATH_ACCESS = "CRUDPS";
35inline constexpr auto DEFAULT_ADD_ON_MISS_TABLE_DATA_PATH_ACCESS = "CRXP";
36inline constexpr auto DEFAULT_EXTERN_CONTROL_PATH_ACCESS = "RUPS";
37inline constexpr auto DEFAULT_EXTERN_DATA_PATH_ACCESS = "RUXP";
38
39// Supported data types.
40inline constexpr auto BIT_TYPE = 0;
41inline constexpr auto DEV_TYPE = 1;
42inline constexpr auto MACADDR_TYPE = 2;
43inline constexpr auto IPV4_TYPE = 3;
44inline constexpr auto IPV6_TYPE = 4;
45inline constexpr auto BE16_TYPE = 5;
46inline constexpr auto BE32_TYPE = 6;
47inline constexpr auto BE64_TYPE = 7;
48
49inline constexpr auto PARAM_INDEX_0 = 0;
50inline constexpr auto PARAM_INDEX_1 = 1;
51inline constexpr auto PARAM_INDEX_2 = 2;
52inline constexpr auto PARAM_INDEX_3 = 3;
53
54inline constexpr auto SET = 1;
55inline constexpr auto RESET = 0;
56
57// PNA parser metadata fields.
58inline constexpr auto PARSER_RECIRCULATED = 0;
59inline constexpr auto PARSER_INPUT_PORT = 1;
60
61// PNA input metadata fields.
62inline constexpr auto INPUT_RECIRCULATED = 0;
63inline constexpr auto INPUT_TIMESTAMP = 1;
64inline constexpr auto INPUT_PARSER_ERROR = 2;
65inline constexpr auto INPUT_CLASS_OF_SERVICE = 3;
66inline constexpr auto INPUT_INPUT_PORT = 4;
67
68// PNA output metadata fields.
69inline constexpr auto OUTPUT_CLASS_OF_SERVICE = 0;
70
71// Kernel metadata fields.
72inline constexpr auto UNDEFINED = 0;
73inline constexpr auto UNSUPPORTED = 1;
74inline constexpr auto SKBREDIR = 2;
75inline constexpr auto SKBIIF = 3;
76inline constexpr auto SKBTSTAMP = 4;
77inline constexpr auto SKBPRIO = 5;
78
79inline constexpr auto MAX_PNA_PARSER_META = 2;
80inline constexpr auto MAX_PNA_INPUT_META = 5;
81inline constexpr auto MAX_PNA_OUTPUT_META = 1;
82
83inline constexpr auto TABLEDEFAULT = 0;
84inline constexpr auto TABLEONLY = 1;
85inline constexpr auto DEFAULTONLY = 2;
86
87inline constexpr auto EXACT_TYPE = 0;
88inline constexpr auto LPM_TYPE = 1;
89inline constexpr auto TERNARY_TYPE = 2;
90
91inline constexpr auto NONE = 0;
92inline constexpr auto IN = 1;
93inline constexpr auto OUT = 2;
94inline constexpr auto INOUT = 3;
95} // namespace P4::TC
96
97#endif /* BACKENDS_TC_TC_DEFINES_H_ */
This file defines functions for the pass to generate the introspection file.
Definition tc/backend.cpp:24