def mkMadd():
    x = dataflow.Variable('xd', valid='xv', signed=True)
    y = dataflow.Variable('yd', valid='yv', signed=True)
    vreset = dataflow.Variable('vreset_data', valid='vreset', width=1)

    xy = x * y

    z = dataflow.Iadd(xy, signed=True, initval=0, reset=vreset)

    z.output('zd', valid='zv')
    df = dataflow.Dataflow(z)
    m = df.to_module('madd')

    return m
Exemple #2
0
def mkMain():
    # input variiable
    x = dataflow.Variable('xdata', valid='xvalid', ready='xready')

    # dataflow definition
    z = dataflow.Iadd(x, initval=0)

    # set output attribute
    z.output('zdata', valid='zvalid', ready='zready')

    df = dataflow.Dataflow(z)
    m = df.to_module('main')
    #df.draw_graph()

    return m
def mkMain():
    # input variiable
    x = dataflow.Variable('xdata', valid='xvalid', ready='xready')
    y = dataflow.Variable('ydata', valid='yvalid', ready='yready')
    reset = dataflow.Variable('resetdata',
                              valid='resetvalid',
                              ready='resetready',
                              width=1)

    # dataflow definition
    v = x * y
    z = dataflow.Iadd(v, initval=0, reset=reset)

    # set output attribute
    z.output('zdata', valid='zvalid', ready='zready')

    df = dataflow.Dataflow(z)
    m = df.to_module('main')
    #df.draw_graph()

    return m