19#ifndef BACKENDS_TOFINO_BF_P4C_BF_P4C_OPTIONS_H_
20#define BACKENDS_TOFINO_BF_P4C_BF_P4C_OPTIONS_H_
22#include "frontends/common/applyOptionsPragmas.h"
23#include "frontends/common/options.h"
24#include "lib/cstring.h"
25#include "lib/exename.h"
26#include "logging/bf_error_reporter.h"
30 bool allowUnimplemented =
false;
31 bool debugInfo =
false;
32 bool no_deadcode_elimination =
false;
33 bool forced_placement =
false;
35 bool no_tagalong =
false;
36 float phv_scale_factor = 1;
37 float max_power = 0.0;
38 bool create_graphs =
false;
40 bool auto_init_metadata =
false;
41 bool disable_parser_state_merging =
false;
42 bool backward_compatible =
false;
43 bool display_power_budget =
false;
44 bool disable_power_check =
false;
45 bool disable_mpr_config =
false;
46 bool force_match_dependency =
false;
47 bool infer_payload_offset =
false;
48 bool parser_timing_reports =
false;
49 bool parser_bandwidth_opt =
false;
50 bool egress_intr_md_opt =
false;
51 bool disable_direct_exit =
false;
52 bool disable_long_branch =
false;
53 bool disable_dark_allocation =
false;
54 bool disable_split_attached =
false;
55 bool disable_table_placement_backfill =
false;
56 bool disable_egress_latency_padding =
false;
57 bool table_placement_in_order =
false;
58 bool table_placement_long_branch_backtrack =
false;
59 bool disable_gfm_parity =
true;
60 int relax_phv_init = 0;
61 bool quick_phv_alloc =
false;
62#ifdef ALT_PHV_ALLOC_DEFAULT
63 bool alt_phv_alloc = ALT_PHV_ALLOC_DEFAULT;
65 bool alt_phv_alloc =
false;
67 int traffic_limit = 100;
68 int num_stages_override = 0;
69 bool enable_event_logger =
false;
70 bool disable_parse_min_depth_limit =
false;
71 bool disable_parse_max_depth_limit =
false;
72 bool alt_phv_alloc_meta_init =
false;
73#if BAREFOOT_INTERNAL || 1
80 std::set<cstring> skipped_pipes;
81 bool no_power_check =
false;
82 bool stage_allocation =
false;
83 bool tof2lab44_workaround =
false;
91 bool allow_pov_aliasing =
false;
93 cstring bfRtSchema =
""_cs;
94 bool p4RuntimeForceStdExterns =
false;
96 cstring outputDir =
nullptr;
101 int v1ModelVersion = 20200408;
106 std::vector<const char *> *
process(
int argc,
char *
const argv[])
override;
114 bool processed =
false;
123 unsigned ghost_pipes = 0;
124 unsigned int inclusive_max_errors_before_enforcing_silence_other_than_the_summary = INT_MAX;
173 void discoverPipes(
const IR::P4Program *,
const IR::ToplevelBlock *);
177 static cstring empty(
"");
178 if (_pipes.count(pipe_id))
return _pipes.at(pipe_id);
183 bool isPipeName(
const cstring &name) {
184 for (
auto pipe : _pipes) {
185 if (pipe.second == name)
return true;
193 bool isRecognizedDiagnostic(cstring diagnostic)
final;
204 std::map<int, cstring> _pipes;
222 std::optional<CommandLineOptions> tryToParse(
const IR::Annotation *annotation)
override;
225 std::optional<CommandLineOptions> parseCompilerOption(
const IR::Annotation *annotation);
Definition bf-p4c-options.h:28
std::vector< const char * > * process(int argc, char *const argv[]) override
Process the command line arguments and set options accordingly.
Definition bf-p4c-options.cpp:673
A CompileContext for bf-p4c.
Definition bf-p4c-options.h:136
static BFNContext & get()
Definition bf-p4c-options.cpp:777
BFN_Options & options() override
Definition bf-p4c-options.cpp:781
void setBackendOptions(BFN_Options *options)
Record options created in the Backend.
Definition bf-p4c-options.cpp:783
void clearBackendOptions()
Clear the backend options.
Definition bf-p4c-options.cpp:789
cstring getOutputDirectory(const cstring &suffix=cstring(), int pipe_id=-1)
Definition bf-p4c-options.cpp:795
void discoverPipes(const IR::P4Program *, const IR::ToplevelBlock *)
identify the pipelines in the program and setup the _pipes map
Definition bf-p4c-options.cpp:829
cstring & getPipeName(int pipe_id)
Return the pipeline name or empty if the program has not been parsed.
Definition bf-p4c-options.h:176
Definition bf-p4c-options.h:220
Definition bf_error_reporter.h:28
Definition applyOptionsPragmas.h:78
The namespace encapsulating IR node classes.
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:24