Exemplo n.º 1
0
  def construct( s, MsgType, ncols, nrows, src_msgs, sink_msgs,
                 src_initial, src_interval, sink_initial, sink_interval,
                 arrival_time=None ):

    MeshPos = mk_mesh_pos( ncols, nrows )
    s.num_routers = ncols * nrows
    s.dut = MeshNetworkRTL( MsgType, MeshPos, ncols, nrows, 0)
    cmp_fn = lambda a, b : a.payload == b.payload

    s.srcs  = [ TestSrcRTL   ( MsgType, src_msgs[i],  src_initial,  src_interval  )
                for i in range ( s.dut.num_routers ) ]
    if arrival_time != None:
      s.sinks = [ TestNetSinkRTL( MsgType, sink_msgs[i], sink_initial,
                  sink_interval, arrival_time[i], cmp_fn=cmp_fn )
                  for i in range ( s.dut.num_routers ) ]
    else:
      s.sinks = [ TestNetSinkRTL  ( MsgType, sink_msgs[i], sink_initial,
                  sink_interval, cmp_fn=cmp_fn )
                  for i in range ( s.dut.num_routers ) ]

    # Connections

    for i in range ( s.dut.num_routers ):
      s.srcs[i].send //= s.dut.recv[i]
      s.dut.send[i]  //= s.sinks[i].recv
Exemplo n.º 2
0
    def construct(
        s,
        MsgType=None,
        src_msgs=[],
        sink_msgs=[],
        ncols=2,
        nrows=2,
        pos_x=0,
        pos_y=0,
    ):

        MeshPos = mk_mesh_pos(ncols, nrows)
        s.nrouters = ncols * nrows
        match_func = lambda a, b : a.src_x == a.src_x and a.src_y == b.src_y and \
                                   a.dst_x == b.dst_x and a.dst_y == b.dst_y and \
                                   a.opaque == b.opaque and a.payload == b.payload
        s.dut = MeshRouterCL(MsgType, MeshPos)

        s.srcs = [TestSrcCL(MsgType, src_msgs[i]) for i in range(5)]
        s.sinks = [
            TestSinkCL(MsgType, sink_msgs[i], match_func=match_func)
            for i in range(5)
        ]

        # Connections

        for i in range(s.dut.num_outports):
            s.srcs[i].send //= s.dut.recv[i]
            s.dut.send[i] //= s.sinks[i].recv

        s.dut.pos //= MeshPos(pos_x, pos_y)
Exemplo n.º 3
0
    def construct(s, PktType, ncols, nrows, src_msgs, sink_msgs, src_initial,
                  src_interval, sink_initial, sink_interval):

        s.nrouters = ncols * nrows

        MeshPos = mk_mesh_pos(ncols, nrows)
        match_func = lambda a, b: a == b
        s.dut = MeshNetworkCL(PktType, MeshPos, ncols, nrows, 0)

        s.srcs = [
            TestSrcCL(PktType, src_msgs[i], src_initial, src_interval)
            for i in range(s.nrouters)
        ]
        s.sinks = [
            TestNetSinkCL(PktType,
                          sink_msgs[i],
                          sink_initial,
                          sink_interval,
                          match_func=match_func) for i in range(s.nrouters)
        ]

        # Connections
        for i in range(s.nrouters):
            s.srcs[i].send //= s.dut.recv[i]
            s.dut.send[i] //= s.sinks[i].recv
Exemplo n.º 4
0
  def construct( s,
                 MsgType       = None,
                 ncols         = 2,
                 nrows         = 2 ,
                 pos_x         = 0,
                 pos_y         = 0,
                 src_msgs      = [],
                 sink_msgs     = [],
                 src_initial   = 0,
                 src_interval  = 0,
                 sink_initial  = 0,
                 sink_interval = 0,
                 arrival_time  =[None, None, None, None, None]
               ):

    MeshPos = mk_mesh_pos( ncols, nrows )
    s.dut = MeshRouterRTL( MsgType, MeshPos, InputUnitType = InputUnitRTL,
                           RouteUnitType = DORYMeshRouteUnitRTL )
    cmp_fn  = lambda a, b : a.payload == b.payload

    s.srcs  = [ TestSrcRTL    ( MsgType, src_msgs[i],  src_initial,  src_interval  )
                for i in range  ( s.dut.num_inports ) ]
    s.sinks = [ TestNetSinkRTL( MsgType, sink_msgs[i], sink_initial,
                cmp_fn=cmp_fn ) for i in range ( s.dut.num_outports ) ]

    # Connections

    for i in range ( s.dut.num_outports ):
      s.srcs[i].send //= s.dut.recv[i]
      s.dut.send[i]  //= s.sinks[i].recv

    s.dut.pos //= MeshPos( pos_x, pos_y )
Exemplo n.º 5
0
def _mk_mesh_net(opts):
    ncols = opts.ncols
    nrows = opts.nrows
    nports = opts.ncols * opts.nrows
    payload_nbits = opts.channel_bw
    channel_lat = opts.channel_lat

    Pos = mk_mesh_pos(ncols, nrows)
    Pkt = mk_mesh_pkt(ncols, nrows, vc=1, payload_nbits=payload_nbits)
    if hasattr(opts, 'cl') and opts.cl:
        cl_net = MeshNetworkCL(Pkt, Pos, ncols, nrows, channel_lat)
        net = CLNetWrapper(Pkt, cl_net, nports)
    else:
        net = MeshNetworkRTL(Pkt, Pos, ncols, nrows, channel_lat)
    return net
Exemplo n.º 6
0
def _mk_torus_net(opts):
    ncols = opts.ncols
    nrows = opts.nrows
    payload_nbits = opts.channel_bw
    channel_lat = opts.channel_lat

    Pos = mk_mesh_pos(ncols, nrows)
    Pkt = mk_mesh_pkt(ncols, nrows, vc=2, payload_nbits=payload_nbits)
    net = TorusNetworkRTL(Pkt,
                          Pos,
                          ncols,
                          nrows,
                          channel_lat,
                          vc=2,
                          credit_line=2)
    return net
Exemplo n.º 7
0
    def construct(s, PktType, ncols, nrows, src_msgs, sink_msgs):

        s.nrouters = ncols * nrows
        MeshPos = mk_mesh_pos(ncols, nrows)
        cmp_fn = lambda a, b: a.payload == b.payload

        s.srcs = [TestSrcRTL(PktType, src_msgs[i]) for i in range(s.nrouters)]
        s.dut = TorusNetworkRTL(PktType, MeshPos, ncols, nrows, 0)
        s.sinks = [
            TestNetSinkRTL(PktType, sink_msgs[i], cmp_fn=cmp_fn)
            for i in range(s.nrouters)
        ]

        # Connections
        for i in range(s.nrouters):
            s.srcs[i].send //= s.dut.recv[i]
            s.dut.send[i] //= s.sinks[i].recv
Exemplo n.º 8
0
def _mk_cmesh_net(opts):
    ncols = opts.ncols
    nrows = opts.nrows
    payload_nbits = opts.channel_bw
    channel_lat = opts.channel_lat
    router_ninports = opts.nterminals_each + 4
    router_noutports = opts.nterminals_each + 4

    Pos = mk_mesh_pos(ncols, nrows)
    Pkt = mk_cmesh_pkt(ncols,
                       nrows,
                       router_ninports,
                       router_noutports,
                       vc=1,
                       payload_nbits=payload_nbits)
    net = CMeshNetworkRTL(Pkt, Pos, ncols, nrows, opts.nterminals_each,
                          channel_lat)
    return net
  def construct( s, PktType, src_msgs, sink_msgs, ncols=2, nrows=2, pos_x=0, pos_y=0 ):

    outports = 5
    MeshPos = mk_mesh_pos( ncols, nrows )

    cmp_fn = lambda a, b : a.src_x == b.src_x and a.src_y == b.src_y and \
                               a.dst_y == b.dst_y and a.payload == b.payload


    s.src   = TestSrcRTL( PktType, src_msgs )
    s.dut   = DORYTorusRouteUnitRTL( PktType, MeshPos, ncols=ncols, nrows=nrows )
    s.sinks = [ TestNetSinkRTL( PktType, sink_msgs[i], cmp_fn=cmp_fn )
                for i in range ( outports ) ]

    # Connections
    s.src.send  //= s.dut.recv

    for i in range ( outports ):
      s.dut.send[i] //= s.sinks[i].recv

    s.dut.pos //= MeshPos( pos_x, pos_y )
Exemplo n.º 10
0
    def construct(
        s,
        PktType=None,
        src_msgs=[],
        sink_msgs=[],
        ncols=2,
        nrows=2,
        pos_x=0,
        pos_y=0,
    ):

        MeshPos = mk_mesh_pos(ncols, nrows)

        cmp_fn= lambda a, b : a.src_x == b.src_x and a.src_y == b.src_y and \
                                   a.dst_y == b.dst_y and a.payload == b.payload

        s.srcs = [TestSrcRTL(PktType, src_msgs[i]) for i in range(5)]
        s.dut = TorusRouterRTL(PktType, MeshPos, ncols=ncols, nrows=nrows)
        s.sinks = [
            TestNetSinkRTL(PktType, sink_msgs[i], cmp_fn=cmp_fn)
            for i in range(5)
        ]

        s.src_adapters = [
            RecvRTL2CreditSendRTL(PktType, vc=2) for _ in range(5)
        ]
        s.sink_adapters = [
            CreditRecvRTL2SendRTL(PktType, vc=2) for _ in range(5)
        ]

        # Connections
        for i in range(5):
            s.srcs[i].send //= s.src_adapters[i].recv
            s.src_adapters[i].send //= s.dut.recv[i]
            s.dut.send[i] //= s.sink_adapters[i].recv
            s.sink_adapters[i].send //= s.sinks[i].recv

        s.dut.pos //= MeshPos(pos_x, pos_y)