P4C
The P4 Compiler
Loading...
Searching...
No Matches
targets/tofino/concolic.h
1/*******************************************************************************
2 * Copyright (C) 2024 Intel Corporation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing,
11 * software distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions
14 * and limitations under the License.
15 *
16 *
17 * SPDX-License-Identifier: Apache-2.0
18 ******************************************************************************/
19
20#ifndef BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_TOFINO_CONCOLIC_H_
21#define BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_TOFINO_CONCOLIC_H_
22
23#include <vector>
24
25#include "backends/p4tools/common/lib/model.h"
26#include "ir/ir.h"
27
28#include "backends/p4tools/modules/testgen/lib/concolic.h"
29
30namespace P4::P4Tools::P4Testgen::Tofino {
31
33 private:
37 struct TofinoHashAlgorithm {
38 using Type = enum {
39 identity,
40 random,
41 xor8,
42 xor16,
43 xor32,
44 crc8,
45 crc16,
46 crc32,
47 crc64,
48 custom
49 };
50 };
51
54 static constexpr int HASH_CHUNK_SIZE = 64;
55
57 static const ConcolicMethodImpls::ImplList SharedTofinoConcolicMethodImpls;
58
64 static const IR::ListExpression *evaluateListHashExpr(
65 const std::vector<const IR::Expression *> &exprList, const Model &completedModel,
66 Model::ExpressionMap *resolvedExpressions);
67
68 public:
70 static const ConcolicMethodImpls::ImplList *getSharedTofinoConcolicMethodImpls();
71};
72
73} // namespace P4::P4Tools::P4Testgen::Tofino
74
75#endif /* BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_TOFINO_CONCOLIC_H_ */
Definition backends/p4tools/common/lib/model.h:18
Definition lib/concolic.h:86
Definition targets/tofino/concolic.h:32
static const ConcolicMethodImpls::ImplList * getSharedTofinoConcolicMethodImpls()
Definition targets/tofino/concolic.cpp:173