コード例 #1
0
def main(argv):
    args = parser.parse_args(argv[1:])
    if not path.exists(args.fld):
        os.mkdir(args.fld)
    commit_hash = database.get_db_commit()
    build_dt = time.strftime('%Y-%m-%d %H:%M:%S')
    docs_toc = ""
    for fam, fam_data in sorted(devices.families.items()):
        fdir = path.join(args.fld, fam)
        if not path.exists(fdir):
            os.mkdir(fdir)
        docs_toc += "<h3>{} Family</h3>".format(fam)
        docs_toc += "<ul>"
        for dev in fam_data["devices"]:
            ddir = path.join(fdir, dev)
            if not path.exists(ddir):
                os.mkdir(ddir)
            generate_device_docs(fam, dev, ddir)
            docs_toc += '<li><a href="{}">{} Documentation</a></li>'.format(
                '{}/{}/index.html'.format(fam, dev), dev)
        docs_toc += "</ul>"
    index_html = Template(trellis_docs_index).substitute(datetime=build_dt,
                                                         commit=commit_hash,
                                                         docs_toc=docs_toc)
    with open(path.join(args.fld, "index.html"), 'w') as f:
        f.write(index_html)
コード例 #2
0
ファイル: html_all.py プロジェクト: TechnoMancer/prjtang
def main():
    devices = database.get_devices()
    shutil.rmtree("work_html", ignore_errors=True)
    os.mkdir("work_html")
    commit_hash = database.get_db_commit()
    build_dt = time.strftime('%Y-%m-%d %H:%M:%S')

    docs_toc = ""
    for architecture in sorted(devices["architectures"].keys()):
        docs_toc += "<h3>{} Architecture</h3>".format(architecture.upper())
        docs_toc += "<h4>Bitstream Documentation</h4>"
        docs_toc += "<ul>"
        for part in sorted(
                devices["architectures"][architecture]["parts"].keys()):
            docs_toc += '<li><a href="{}">{} Documentation</a></li>'.format(
                '{}.html'.format(part), part.upper())
            html_tilegrid.main([
                "html_tilegrid", architecture, part,
                path.join("work_html", part + ".html")
            ])
        docs_toc += "</ul>"
    index_html = Template(tang_docs_index).substitute(datetime=build_dt,
                                                      commit=commit_hash,
                                                      docs_toc=docs_toc)
    with open(path.join("work_html", "index.html"), 'w') as f:
        f.write(index_html)
コード例 #3
0
def main():
	devices = database.get_devices()
	shutil.rmtree("work_html", ignore_errors=True)
	os.mkdir("work_html")
	commit_hash = database.get_db_commit()
	build_dt = time.strftime('%Y-%m-%d %H:%M:%S')

	docs_toc = ""
	for family in sorted(devices["families"].keys()):
		print("Family: " + family)
		docs_toc += "<h3>{} Family</h3>".format(family.upper())
		docs_toc += "<h4>Bitstream Documentation</h4>"
		docs_toc += "<ul>"
		for device in sorted(devices["families"][family]["devices"].keys()):
			print("Device: " + device)
			docs_toc += '<li><a href="{}">{} Documentation</a></li>'.format('{}.html'.format(device),device.upper())
			html_tilegrid.main(["html_tilegrid", family,  device, path.join("work_html",device + ".html")])
		docs_toc += "</ul>"
	index_html = Template(tang_docs_index).substitute(
		datetime=build_dt,
		commit=commit_hash,
		docs_toc=docs_toc
	)
	with open(path.join("work_html", "index.html"), 'w') as f:
		f.write(index_html)
コード例 #4
0
def main(argv):
    args = parser.parse_args(argv[1:])
    if not path.exists(args.fld):
        os.mkdir(args.fld)
    commit_hash = database.get_db_commit()
    build_dt = time.strftime('%Y-%m-%d %H:%M:%S')
    docs_toc = ""
    pytrellis.load_database(database.get_db_root())
    for fam, fam_data in sorted(database.get_devices()["families"].items()):
        fdir = path.join(args.fld, fam)
        if not path.exists(fdir):
            os.mkdir(fdir)
        thdir = path.join(fdir, "tilehtml")
        if not path.exists(thdir):
            os.mkdir(thdir)
        docs_toc += "<h3>{} Family</h3>".format(fam)
        docs_toc += "<ul>"
        tiles = get_device_tiles(fam, fam_data["devices"])
        for dev, devdata in sorted(fam_data["devices"].items()):
            if devdata["fuzz"]:
                ddir = path.join(fdir, dev)
                if not path.exists(ddir):
                    os.mkdir(ddir)
                print(
                    "********* Generating documentation for device {}".format(
                        dev))
                generate_device_docs(fam, dev, ddir)
                if (fam, dev) in tiles:
                    for tile in tiles[fam, dev]:
                        print(
                            "*** Generating documentation for tile {}".format(
                                tile))
                        generate_tile_docs(fam, dev, tile, thdir)
                docs_toc += '<li><a href="{}">{} Documentation</a></li>'.format(
                    '{}/{}/index.html'.format(fam, dev), dev)

        docs_toc += "</ul>"

    index_html = Template(trellis_docs_index).substitute(datetime=build_dt,
                                                         commit=commit_hash,
                                                         docs_toc=docs_toc)
    with open(path.join(args.fld, "index.html"), 'w') as f:
        f.write(index_html)
コード例 #5
0
ファイル: html_all.py プロジェクト: xobs/prjtrellis
def main(argv):
    args = parser.parse_args(argv[1:])
    if not path.exists(args.fld):
        os.mkdir(args.fld)
    commit_hash = database.get_db_commit()
    build_dt = time.strftime('%Y-%m-%d %H:%M:%S')
    docs_toc = ""
    pytrellis.load_database(database.get_db_root())
    for fam, fam_data in sorted(database.get_devices()["families"].items()):
        if fam == "MachXO2":
            continue
        fdir = path.join(args.fld, fam)
        if not path.exists(fdir):
            os.mkdir(fdir)
        thdir = path.join(fdir, "tilehtml")
        if not path.exists(thdir):
            os.mkdir(thdir)
        docs_toc += "<h3>{} Family</h3>".format(fam)
        docs_toc += "<h4>Bitstream Documentation</h4>"
        docs_toc += "<ul>"
        tiles = get_device_tiles(fam, fam_data["devices"])
        for dev, devdata in sorted(fam_data["devices"].items()):
            if devdata["fuzz"]:
                ddir = path.join(fdir, dev)
                if not path.exists(ddir):
                    os.mkdir(ddir)
                print(
                    "********* Generating documentation for device {}".format(
                        dev))
                generate_device_docs(fam, dev, ddir)
                if (fam, dev) in tiles:
                    for tile in tiles[fam, dev]:
                        print(
                            "*** Generating documentation for tile {}".format(
                                tile))
                        generate_tile_docs(fam, dev, tile, thdir)
                docs_toc += '<li><a href="{}">{} Documentation</a></li>'.format(
                    '{}/{}/index.html'.format(fam, dev), dev)

        docs_toc += "</ul>"
        docs_toc += "<h4>Cell Timing Documentation</h4>"
        docs_toc += "<ul>"
        for spgrade in ["6", "7", "8", "8_5G"]:
            tdir = path.join(fdir, "timing")
            if not path.exists(tdir):
                os.mkdir(tdir)
            docs_toc += '<li><a href="{}">Speed Grade -{}</a></li>'.format(
                '{}/timing/cell_timing_{}.html'.format(fam, spgrade), spgrade)
            cell_html.make_cell_timing_html(
                timing_dbs.cells_db_path(fam, spgrade), fam, spgrade,
                path.join(tdir, 'cell_timing_{}.html'.format(spgrade)))
        docs_toc += "</ul>"
        docs_toc += "<h4>Interconnect Timing Documentation</h4>"
        docs_toc += "<ul>"
        for spgrade in ["6", "7", "8", "8_5G"]:
            tdir = path.join(fdir, "timing")
            if not path.exists(tdir):
                os.mkdir(tdir)
            docs_toc += '<li><a href="{}">Speed Grade -{}</a></li>'.format(
                '{}/timing/interconn_timing_{}.html'.format(fam, spgrade),
                spgrade)
            interconnect_html.make_interconn_timing_html(
                timing_dbs.interconnect_db_path(fam, spgrade), fam, spgrade,
                path.join(tdir, 'interconn_timing_{}.html'.format(spgrade)))
        docs_toc += "</ul>"

    index_html = Template(trellis_docs_index).substitute(datetime=build_dt,
                                                         commit=commit_hash,
                                                         docs_toc=docs_toc)
    with open(path.join(args.fld, "index.html"), 'w') as f:
        f.write(index_html)
コード例 #6
0
def main(argv):
    args = parser.parse_args(argv[1:])
    if not path.exists(args.fld):
        os.mkdir(args.fld)
    commit_hash = database.get_db_commit()
    build_dt = time.strftime('%Y-%m-%d %H:%M:%S')
    gen_docs_toc = ""
    gdir = path.join(args.fld, "general")
    if not path.exists(gdir):
        os.mkdir(gdir)
    for mdfile in glob.glob(path.join(database.get_oxide_root(), "docs", "general", "*.md")):
        with open(mdfile, "r") as f:
            if f.read(1) != "#":
                continue
            title = f.readline().strip()
        htmlfn = path.basename(mdfile).replace(".md", ".html")
        htmlfile = path.join(gdir, htmlfn)
        with open(htmlfile, "w") as f:
            f.write(libpyprjoxide.md_file_to_html(mdfile))
        gen_docs_toc += '<li><a href="general/{}">{}</a></li>\n'.format(htmlfn, title)
    docs_toc = ""
    for fam, fam_data in sorted(database.get_devices()["families"].items()):
        fdir = path.join(args.fld, fam)
        if not path.exists(fdir):
            os.mkdir(fdir)
        thdir = path.join(fdir, "tilehtml")
        if not path.exists(thdir):
            os.mkdir(thdir)
        bhdir = path.join(fdir, "belhtml")
        if not path.exists(bhdir):
            os.mkdir(bhdir)
        docs_toc += "<h3>{} Family</h3>".format(fam)
        docs_toc += "<h4>Generated Bitstream Documentation</h4>"
        docs_toc += "<ul>"
        tiles = get_device_tiles(fam, fam_data["devices"])
        for dev, devdata in sorted(fam_data["devices"].items()):
            if devdata["fuzz"]:
                ddir = path.join(fdir, dev)
                if not path.exists(ddir):
                    os.mkdir(ddir)
                print("********* Generating documentation for device {}".format(dev))
                generate_device_docs(fam, dev, ddir)
                if (fam, dev) in tiles:
                    for tile in tiles[fam, dev]:
                        print("*** Generating documentation for tile {}".format(tile))
                        generate_tile_docs(fam, dev, tile, fdir)
                docs_toc += '<li><a href="{}">{} Documentation</a></li>'.format(
                    '{}/{}/index.html'.format(fam, dev),
                    dev
                )

        docs_toc += "</ul>"

    index_html = Template(oxide_docs_index).substitute(
        datetime=build_dt,
        commit=commit_hash,
        docs_toc=docs_toc,
        gen_docs_toc=gen_docs_toc,
    )
    with open(path.join(args.fld, "index.html"), 'w') as f:
        f.write(index_html)