Ejemplo n.º 1
0
def mkMain():
    # input variiable
    x = stream.Variable('xdata')
    y = stream.Variable('ydata')

    # stream definition
    z = x + y

    # set output attribute
    z.output('zdata')

    st = stream.Stream(z)
    m = st.to_module('main')

    return m
Ejemplo n.º 2
0
def mkMain():
    # input variiable
    x = stream.Variable('xdata')
    y = stream.Variable('ydata')

    # stream definition
    z = x + y
    z = stream.Iadd(z)

    # set output attribute
    z.output('zdata')

    st = stream.Stream(z, ivalid='ivalid', ovalid='ovalid')
    m = st.to_module('main')

    return m
Ejemplo n.º 3
0
def mkMain():
    # input variiable
    x = stream.Variable('xdata')
    y = stream.Variable('ydata')

    # stream definition
    z = stream.SraRound(x, y)

    # set output attribute
    z.output('zdata')

    st = stream.Stream(z)
    m = st.to_module('main')

    # st.draw_graph()

    return m, st.pipeline_depth()
Ejemplo n.º 4
0
def mkMain():
    # input variiable
    x = stream.Variable('xdata')
    y = stream.Variable('ydata')

    # stream definition
    z = x + y
    z, v = stream.ReduceAddValid(z, 8)

    # set output attribute
    z.output('zdata')
    v.output('vdata')

    st = stream.Stream(z, v, ivalid='ivalid', ovalid='ovalid')
    m = st.to_module('main')

    return m
Ejemplo n.º 5
0
def mkMain():
    # input variiable
    x = stream.Variable('xdata')
    y = stream.Variable('ydata')
    vars = [x + i for i in range(10)]

    # stream definition
    v = stream.AddTree(*vars)
    z = v + y

    # set output attribute
    z.output('zdata')

    st = stream.Stream(z)
    m = st.to_module('main')

    return m
Ejemplo n.º 6
0
def mkMain():
    # input variiable
    x = stream.Variable('xdata')
    y = stream.Variable('ydata')
    e = stream.Variable('edata')

    # stream definition
    z = x + y
    z, v = stream.RegionAdd(z, 8, enable=e)

    # set output attribute
    z.output('zdata')
    v.output('vdata')

    st = stream.Stream(z, v)
    m = st.to_module('main')

    return m
Ejemplo n.º 7
0
def mkMain():
    # input variiable
    x = stream.Variable('xdata')
    y = stream.Variable('ydata')

    # stream definition
    z = stream.Div(x, y)

    # set output attribute
    z.output('zdata')

    st = stream.Stream(z,
                       ivalid='ivalid',
                       ovalid='ovalid',
                       iready='iready',
                       oready='oready')
    m = st.to_module('main')

    return m
Ejemplo n.º 8
0
def mkMain():
    # input variiable
    x = stream.Variable('xdata')
    y = stream.Variable('ydata')

    x = stream.Cast(x, 64, 8)
    y = stream.Cast(y, 64, 8)

    # stream definition
    z = x + y

    z = stream.Cast(z, 32, 0)

    # set output attribute
    z.output('zdata')

    st = stream.Stream(z)
    m = st.to_module('main')

    return m