P4C
The P4 Compiler
Loading...
Searching...
No Matches
backends/bmv2/psa_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_PSA_SWITCH_OPTIONS_H_
9#define BACKENDS_BMV2_PSA_SWITCH_OPTIONS_H_
10
11#include "backends/bmv2/portable_common/options.h"
12#include "backends/bmv2/psa_switch/midend.h"
13
14namespace P4::BMV2 {
15
16class PsaSwitchOptions : public PortableOptions {
17 public:
18 PsaSwitchOptions() {
19 registerOption(
20 "--listMidendPasses", nullptr,
21 [this](const char *) {
22 listMidendPasses = true;
23 loadIRFromJson = false;
24 PsaSwitchMidEnd midEnd(*this, outStream);
25 exit(0);
26 return false;
27 },
28 "[PsaSwitch back-end] Lists exact name of all midend passes.\n");
29 }
30};
31
32using PsaSwitchContext = P4CContextWithOptions<PsaSwitchOptions>;
33
34} // namespace P4::BMV2
35
36#endif /* BACKENDS_BMV2_PSA_SWITCH_OPTIONS_H_ */
bool loadIRFromJson
Read from json.
Definition backends/bmv2/common/options.h:25
Definition backends/bmv2/portable_common/options.h:16
Definition bmv2/psa_switch/midend.h:15
Definition parser_options.h:170
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition action.cpp:9