P4C
The P4 Compiler
Loading...
Searching...
No Matches
backends/bmv2/simple_switch/options.h
1/*
2 * SPDX-FileCopyrightText: 2013 Barefoot Networks, Inc.
3 * Copyright 2013-present Barefoot Networks, Inc.
4 *
5 * SPDX-License-Identifier: Apache-2.0
6 */
7
8#ifndef BACKENDS_BMV2_SIMPLE_SWITCH_OPTIONS_H_
9#define BACKENDS_BMV2_SIMPLE_SWITCH_OPTIONS_H_
10
11#include "backends/bmv2/common/options.h"
12#include "backends/bmv2/simple_switch/midend.h"
13
14namespace P4::BMV2 {
15
16class SimpleSwitchOptions : public BMV2Options {
17 public:
18 SimpleSwitchOptions() {
19 registerOption(
20 "--listMidendPasses", nullptr,
21 [this](const char *) {
22 listMidendPasses = true;
23 loadIRFromJson = false;
24 SimpleSwitchMidEnd midEnd(*this, outStream);
25 exit(0);
26 return false;
27 },
28 "[SimpleSwitch back-end] Lists exact name of all midend passes.\n");
29 }
30};
31
32using SimpleSwitchContext = P4CContextWithOptions<SimpleSwitchOptions>;
33
34} // namespace P4::BMV2
35
36#endif /* BACKENDS_BMV2_SIMPLE_SWITCH_OPTIONS_H_ */
bool loadIRFromJson
Read from json.
Definition backends/bmv2/common/options.h:25
Definition bmv2/simple_switch/midend.h:19
Definition parser_options.h:170
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition action.cpp:9