예제 #1
0
def dump_to_p4_P4ControlFunction(self, hlir):
    call_sequence = [
        statement.dump_to_p4(hlir) for statement in self.statements
    ]
    g_control_flow = p4_control_flow(hlir,
                                     self.name,
                                     filename=self.filename,
                                     lineno=self.lineno,
                                     call_sequence=call_sequence)
    g_control_flow._pragmas = self._pragmas.copy()
예제 #2
0
def dump_to_p4_P4ControlFunction(self, hlir):
    call_sequence = [statement.dump_to_p4(hlir) for statement in self.statements]
    g_control_flow = p4_control_flow(
        hlir,
        self.name,
        filename = self.filename,
        lineno = self.lineno,
        call_sequence = call_sequence
    )
    g_control_flow._pragmas = self._pragmas.copy()
예제 #3
0
def dump_to_p4_P4ControlFunction(self, hlir, program_version=0):
    # for statement in self.statements:
    #     print 'DBG==========================0011 statement:', statement
    # DBG note: type can be P4ControlFunctionApplyAndSelect.

    call_sequence = [
        statement.dump_to_p4(hlir, program_version=program_version)
        for statement in self.statements
    ]
    for statement in self.statements:
        print 'DBG|HLIR|frontend|dump ctl func|statement:', statement, type(
            statement)  # p4_hlir.frontend.ast.P4ControlFunctionApply object
    print 'DBG|HLIR|frontend|dump ctr func|call_sequence:', call_sequence
    # print 'DBG|HLIR|fontend|dump ctr func|p4 tables:', hlir.p4_tables
    g_control_flow = p4_control_flow(hlir,
                                     self.name,
                                     filename=self.filename,
                                     lineno=self.lineno,
                                     call_sequence=call_sequence)
    g_control_flow._pragmas = self._pragmas.copy()