def mk_pkt(offchip,
           dst_x,
           dst_y,
           payload=[],
           fbits=0,
           mtype=0,
           mshr=0,
           opt1=0):
    chipid = b14(1) << 13 if offchip else b14(0)
    plen = len(payload)
    header = PitonNoCHeader(chipid, dst_x, dst_y, fbits, plen, mtype, mshr,
                            opt1)
    header_bits = header.to_bits()
    flits = [header_bits] + payload
    return Packet(PitonNoCHeader, flits)
def mk_pkt(src_offchip,
           src_x,
           src_y,
           dst_offchip,
           dst_x,
           dst_y,
           payload=[],
           fbits=0,
           mtype=0,
           mshr=0,
           opt1=0):
    chipid = b14(1) << 13 if dst_offchip else b14(0)
    plen = len(payload)
    header = PitonNoCHeader(chipid, dst_x, dst_y, fbits, plen, mtype, mshr,
                            opt1)
    header_bits = header.to_bits()
    flits = [header_bits] + payload
    pkt = Packet(PitonNoCHeader, flits)
    pkt.src_offchip = src_offchip
    pkt.src_x = src_x
    pkt.src_y = src_y
    return pkt
def mk_pkt(src, dst, payload=[], opaque=0):
    plen = len(payload)
    header = TestHeader(src, dst, opaque, plen)
    header_bits = header.to_bits()
    flits = [header_bits] + payload
    return Packet(TestHeader, flits)
def mk_pkt(dst_x, dst_y, payload=[], src_x=0, src_y=0, opaque=0):
    plen = len(payload)
    header = TestHeader(opaque, plen, src_x, src_y, dst_x, dst_y)
    header_bits = header.to_bits()
    flits = [header_bits] + payload
    return Packet(TestHeader, flits)