P4C
The P4 Compiler
Loading...
Searching...
No Matches
ubpfRegister.h
1/*
2Copyright 2019 Orange
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
8 http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed 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 and
14limitations under the License.
15*/
16
17#ifndef BACKENDS_UBPF_UBPFREGISTER_H_
18#define BACKENDS_UBPF_UBPFREGISTER_H_
19
20#include "ubpfTable.h"
21#include "ubpfType.h"
22
23namespace P4::UBPF {
24
25class UBPFRegister final : public UBPFTableBase {
26 public:
27 UBPFRegister(const UBPFProgram *program, const IR::ExternBlock *block, cstring name,
28 EBPF::CodeGenInspector *codeGen);
29
30 void emitInstance(EBPF::CodeBuilder *builder);
31 void emitRegisterRead(EBPF::CodeBuilder *builder, const IR::MethodCallExpression *expression);
32 void emitRegisterWrite(EBPF::CodeBuilder *builder, const IR::MethodCallExpression *expression);
33 void emitMethodInvocation(EBPF::CodeBuilder *builder, const P4::ExternMethod *method);
34 void emitKeyInstance(EBPF::CodeBuilder *builder, const IR::MethodCallExpression *expression);
35 cstring emitValueInstanceIfNeeded(EBPF::CodeBuilder *builder, const IR::Argument *arg_value);
36};
37
38} // namespace P4::UBPF
39
40#endif /* BACKENDS_UBPF_UBPFREGISTER_H_ */
Definition ebpf/codeGen.h:33
Definition ebpf/codeGen.h:41
Definition methodInstance.h:168
Definition ubpfProgram.h:37
Definition ubpfRegister.h:25
Definition ubpfTable.h:26
Definition cstring.h:85