def __init__(self, hlircounter, program):
        assert isinstance(hlircounter, p4_counter)
        assert isinstance(program, ebpfProgram.EbpfProgram)

        self.name = hlircounter.name
        self.hlircounter = hlircounter

        width = hlircounter.min_width
        # ebpf counters only work on 64-bits
        if width <= 64:
            self.valueTypeName = program.config.uprefix + "64"
        else:
            raise NotSupportedException(
                "{0}: Counters with {1} bits", hlircounter, width)

        self.dataMapName = self.name

        if ((hlircounter.binding is None) or 
            (hlircounter.binding[0] != P4_DIRECT)):
            raise NotSupportedException(
                "{0}: counter which is not direct", hlircounter)

        self.autoIncrement = (hlircounter.binding != None and
                              hlircounter.binding[0] == P4_DIRECT)

        if hlircounter.type is P4_COUNTER_BYTES:
            self.increment = "{0}->len".format(program.packetName)
        else:
            self.increment = "1"
dataset/ETHPy150Open iovisor/bcc/src/cc/frontends/p4/compiler/ebpfCounter.py/EbpfCounter.__init__/original