# Path: pif_ir/bir/utils/exceptions.py
# class BIRError(Exception):
#     """ a base class for all bir exceptions
#     """
#     def __init__(self, msg="BIR Error!"):
#         self.value = msg


from pif_ir.bir.utils.exceptions import BIRError
            req = packet.metadata[args[1]]
            if self.table:
                resp.reset_values()
                self.table.lookup(req, resp)

        elif op == 'hInsert':
            length = args[0] if len(args) > 0 else len(self.header)
            packet.insert(length, bit_offset)
        elif op == 'hRemove':
            length = args[0] if len(args) > 0 else len(self.header)
            packet.remove(length, bit_offset)
        elif op == 'tInsert':
            mask = args[2] if len(args) > 2 else None
            if self.table:
                self.table.add_entry(args[0], args[1], mask)
        elif op == 'tRemove':
            mask = args[2] if len(args) > 2 else None
            if self.table:
                self.table.remove_entry(args[0], args[1], mask)
        else:
            raise BIRError("unknown build-in function: {}".format(op))

    def _handle_m_call(self, sig, packet, bit_offset):
        if len(sig[1]) != 2:
            raise BIRError("M instructions require 2 arguments")
        op = sig[0]
        data_out = sig[1][0]
        data_in = sig[1][1]

        if op not in self.other_modules.keys():

# Path: pif_ir/bir/utils/exceptions.py
# class BIRError(Exception):
#     """ a base class for all bir exceptions
#     """
#     def __init__(self, msg="BIR Error!"):
#         self.value = msg


# Path: pif_ir/bir/objects/instructions.py
from pif_ir.bir.utils.exceptions import BIRError

            req = packet.metadata[args[1]]
            if self.table:
                resp.reset_values()
                self.table.lookup(req, resp)

        elif op == 'hInsert':
            length = args[0] if len(args) > 0 else len(self.header)
            packet.insert(length, bit_offset)
        elif op == 'hRemove':
            length = args[0] if len(args) > 0 else len(self.header)
            packet.remove(length, bit_offset)
        elif op == 'tInsert':
            mask = args[2] if len(args) > 2 else None
            if self.table:
                self.table.add_entry(args[0], args[1], mask)
        elif op == 'tRemove':
            mask = args[2] if len(args) > 2 else None
            if self.table:
                self.table.remove_entry(args[0], args[1], mask)
        else:
            raise BIRError("unknown build-in function: {}".format(op))

    def _handle_m_call(self, sig, packet, bit_offset):
        if len(sig[1]) != 2:
            raise BIRError("M instructions require 2 arguments")
        op = sig[0]
        data_out = sig[1][0]
        data_in = sig[1][1]

        if op not in self.other_modules.keys():

            raise BIRError("cannot find other_module: {}".format(sig[0]))