P4C
The P4 Compiler
|
A CompileContext for bf-p4c. More...
#include <bf-p4c-options.h>
Public Member Functions | |
void | clearBackendOptions () |
Clear the backend options. | |
void | discoverPipes (const IR::P4Program *, const IR::ToplevelBlock *) |
identify the pipelines in the program and setup the _pipes map | |
cstring | getOutputDirectory (const cstring &suffix=cstring(), int pipe_id=-1) |
cstring & | getPipeName (int pipe_id) |
Return the pipeline name or empty if the program has not been parsed. | |
BFN_Options & | options () override |
void | setBackendOptions (BFN_Options *options) |
Record options created in the Backend. | |
Static Public Member Functions | |
static BFNContext & | get () |
names a pipe in the program. | |
Checks whether the given | |
bool | isPipeName (const cstring &name) |
BfErrorReporter & | errorReporter () override |
A CompileContext for bf-p4c.
|
static |
pipe_id
is not set (-1) return just options.outputDir. No other files except for the manifest should be stored in the root. If suffix
is empty, return options.outputDir + pipename.The structure of the output directory is: options.outputDir / manifest.json for each pipe / pipeName/context.json / pipeName/tofino[x].bin / pipeName/program.bfa / pipeName/program.res.json / pipeName/logs/ / pipeName/graphs/
If the directory does not exists, it is created. If the creation fails print an error message and return an empty string. FIXME: Make this return std::filesystem::path. There are quite a few invocations of this function.
|
override |