p4utils.utils.compiler module¶
-
class
p4utils.utils.compiler.
BF_P4C
(p4_src, sde, sde_install, build_dir=None, build_script='~/tools/p4_build.sh', **kwargs)[source]¶ Bases:
object
This compiler reads the P4 program and generates the configuration files used by Tofinos.
Parameters:
-
class
p4utils.utils.compiler.
P4C
(p4_src, p4c_bin=None, outdir=None, opts='--target bmv2 --arch v1model --std p4-16', p4rt=False, **kwargs)[source]¶ Bases:
object
This compiler reads the P4 program and generates the configuration files used by switches.
Parameters: - p4_src (str) – path of the source P4 file to compile
- p4c_bin (str) – path to the compiler binary
- outdir (str) – directory containing all the output files. If set to None,
then every output is stored in the directory of
p4_src
- opts (str) –
p4c
compilation options - p4rt (bool) – generate the P4Info file used to establish P4Runtime connection
to
simple_switch_grpc