示例#1
0
def generate_sample_msg_splitter_B100_image(name, defines=config.default_defines):
    message_builddir= os.path.join(config.builddir, 'message')
    inputfiles = generate_sample_msg_splitter_files()
    inputfiles.append(copyfile('message', 'qa_sample_msg_splitter.v'))
    b100.make_make(name, message_builddir, inputfiles, defines)
    for f in inputfiles:
        b100.prefix_defines(f, defines)
    b100.synthesise(name, message_builddir)
示例#2
0
def generate_B100_image(package,
                        name,
                        suffix,
                        defines=config.default_defines,
                        extraargs={}):
    builddir = os.path.join(config.builddir, package)
    outputdir = os.path.join(
        builddir, 'build-B100_{name}{suffix}'.format(name=name, suffix=suffix))
    vdir = os.path.join(
        builddir, 'verilog-B100_{name}{suffix}'.format(name=name,
                                                       suffix=suffix))
    if not os.path.exists(vdir):
        os.makedirs(vdir)
    dependencies = compatibles[package][name]
    included_dependencies = set()
    inputfiles = [os.path.join(pd2fn('uhd', 'u1plus_core_QA.v'))]
    for d in dependencies:
        pck, fn = d2pd(package, d)
        if (pck, fn) not in included_dependencies:
            generate_block(pck, fn, extraargs, included_dependencies,
                           inputfiles)
    new_inputfiles = []
    changed = False
    for f in inputfiles:
        # Prefix the macros to the beginning of each file.
        # FIXME: There has to be a better way to get this working :(.
        assert (f.endswith('.v'))
        bn = os.path.basename(f)
        f2 = os.path.join(vdir, bn[:-2] + '_prefixed.v')
        f3 = os.path.join(vdir, bn[:-2] + '_final.v')
        shutil.copyfile(f, f2)
        b100.prefix_defines(f2, defines)
        # See if any of the produced files are different than what
        # was used last time.
        if (not os.path.exists(f3)) or (not filecmp.cmp(f2, f3)):
            changed = True
            shutil.copyfile(f2, f3)
        new_inputfiles.append(f3)
    image_fn = os.path.join(outputdir, 'B100.bin')
    if changed or not os.path.exists(image_fn):
        b100.make_make(name + suffix, builddir, new_inputfiles, defines)
        return b100.synthesise(name + suffix, builddir)
    else:
        return image_fn
示例#3
0
def generate_B100_image(package, name, suffix, defines=config.default_defines, extraargs={}):
    builddir = os.path.join(config.builddir, package)
    outputdir = os.path.join(builddir, 'build-B100_{name}{suffix}'.format(
            name=name, suffix=suffix))
    vdir = os.path.join(builddir, 'verilog-B100_{name}{suffix}'.format(
            name=name, suffix=suffix))
    if not os.path.exists(vdir):
        os.makedirs(vdir)
    dependencies = compatibles[package][name]
    included_dependencies = set()
    inputfiles = [os.path.join(pd2fn('uhd', 'u1plus_core_QA.v'))]
    for d in dependencies:
        pck, fn = d2pd(package, d)
        if (pck, fn) not in included_dependencies:
            generate_block(pck, fn, extraargs, included_dependencies, inputfiles)
    new_inputfiles= []
    changed = False
    for f in inputfiles:
        # Prefix the macros to the beginning of each file.
        # FIXME: There has to be a better way to get this working :(.
        assert(f.endswith('.v'))
        bn = os.path.basename(f)
        f2 = os.path.join(vdir, bn[:-2] + '_prefixed.v')
        f3 = os.path.join(vdir, bn[:-2] + '_final.v')
        shutil.copyfile(f, f2)
        b100.prefix_defines(f2, defines)
        # See if any of the produced files are different than what
        # was used last time.
        if (not os.path.exists(f3)) or (not filecmp.cmp(f2, f3)):
            changed = True
            shutil.copyfile(f2, f3)
        new_inputfiles.append(f3)
    image_fn = os.path.join(outputdir, 'B100.bin')
    if changed or not os.path.exists(image_fn):
        b100.make_make(name+suffix, builddir, new_inputfiles, defines)
        return b100.synthesise(name+suffix, builddir)
    else:
        return image_fn