Lines Matching refs:program

20     def serialize(self, serializer, program):  argument
22 assert isinstance(program, ebpfProgram.EbpfProgram)
28 self.serializeOperation(serializer, op, program)
31 self.parser.branch_to, program)
35 def serializeSelect(self, selectVarName, serializer, branch_on, program): argument
39 assert isinstance(program, ebpfProgram.EbpfProgram)
50 ebpfStack = program.getStackInstance(instance.base_name)
63 ebpfHeader = program.getInstance(instance.name)
72 fieldReference = (program.headerStructName + "." + name +
82 switchValue = self.currentReferenceAsString(e, program)
92 program.config.uprefix,
96 def generatePacketLoad(self, startBit, width, alignment, program): argument
129 readtype = program.config.uprefix + str(loadSize)
131 load, program.packetName, program.offsetVariableName, startBit)
140 def currentReferenceAsString(self, tpl, program): argument
153 minIndex, totalWidth, 0, program) # alignment is 0
156 def serializeCases(self, selectVarName, serializer, branch_to, program): argument
159 assert isinstance(program, ebpfProgram.EbpfProgram)
187 label = program.getLabel(value)
208 "{0} = p4_pe_unhandled_select;", program.errorName)
214 def serializeBranch(self, serializer, branch_on, branch_to, program): argument
216 assert isinstance(program, ebpfProgram.EbpfProgram)
221 name = program.getLabel(dest)
225 tmpvar = program.generateNewName("tmp")
226 self.serializeSelect(tmpvar, serializer, branch_on, program)
227 self.serializeCases(tmpvar, serializer, branch_to, program)
232 def serializeOperation(self, serializer, op, program): argument
234 assert isinstance(program, ebpfProgram.EbpfProgram)
238 self.serializeExtract(serializer, op[1], program)
240 self.serializeMetadataSet(serializer, op[1], op[2], program)
246 index, field, alignment, program): argument
252 assert isinstance(program, ebpfProgram.EbpfProgram)
260 "{0}.{1} = 1;", program.headerStructName, fieldToExtractTo)
265 program.packetName,
266 program.offsetVariableName, width)
270 program.errorName)
279 load = self.generatePacketLoad(0, width, alignment, program)
282 program.headerStructName,
302 program.headerStructName,
304 program.config.uprefix)
306 method, program.packetName,
307 program.offsetVariableName, i, shift)
310 program.config.uprefix, width % 8)
316 program.offsetVariableName, width)
319 def serializeExtract(self, serializer, headerInstance, program): argument
322 assert isinstance(program, ebpfProgram.EbpfProgram)
325 ebpfStack = program.getStackInstance(headerInstance.base_name)
335 program.errorName)
351 ebpfHeader = program.getHeaderInstance(headerInstance.name)
361 index, field, alignment, program)
367 ebpfStack = program.getStackInstance(headerInstance.base_name)
375 def serializeMetadataSet(self, serializer, field, value, program): argument
377 assert isinstance(program, ebpfProgram.EbpfProgram)
380 dest = program.getInstance(field.instance.name)
400 program.metadataStructName, dest.name, destField.name)
409 source = self.currentReferenceAsString(value, program)
411 source = program.getInstance(value.instance.name)
413 sourceStruct = program.metadataStructName
415 sourceStruct = program.headerStructName