cwd = os.getcwd()
    os.chdir("ipstools")
    execute("git pull", silent=True)
    execute("git checkout verilator")
    os.chdir(cwd)
    import ipstools
else:
    execute(
        "git clone [email protected]:pulp-tools/IPApproX ipstools -b verilator"
    )
    import ipstools
execute("mkdir -p vsim/vcompile/ips")
execute("rm -rf vsim/vcompile/ips/*")

# creates an IPApproX database
ipdb = ipstools.IPDatabase(ips_dir="./ips", rtl_dir="./rtl", vsim_dir="./vsim")
# generate ModelSim/QuestaSim compilation scripts
ipdb.export_vsim(script_path="vsim/vcompile/ips", target_tech='umc65')
# generate vsim.tcl with ModelSim/QuestaSim "linking" script
ipdb.generate_vsim_tcl("vsim/tcl_files/config/vsim_ips.tcl")
# generate script to compile all IPs for ModelSim/QuestaSim
ipdb.generate_vcompile_libs_csh("vsim/vcompile/vcompile_ips.csh")

# generate Vivado compilation scripts
ipdb.export_vivado(script_path="fpga/pulpino/tcl/ips_src_files.tcl",
                   alternatives=['riscv'])
# generate Vivado add_files.tcl
ipdb.generate_vivado_add_files("fpga/pulpino/tcl/ips_add_files.tcl",
                               alternatives=['riscv'])
# generate Vivado inc_dirs.tcl
ipdb.generate_vivado_inc_dirs("fpga/pulpino/tcl/ips_inc_dirs.tcl",
Beispiel #2
0
if os.path.exists("ipstools") and os.path.isdir("ipstools"):
    cwd = os.getcwd()
    os.chdir("ipstools")
    execute("git pull origin verilator", silent=True)
    os.chdir(cwd)
    import ipstools
else:
    # try to find the ipstools repository
    if "http" in remote:
        if execute("git clone %s/IPApproX.git ipstools -b verilator" %
                   (remote)) != 0:
            execute(
                "git clone %s/pulp-tools/IPApproX.git ipstools -b verilator" %
                (server))
    else:
        if execute("git clone %s/IPApproX.git ipstools -b verilator" %
                   (remote)) != 0:
            execute(
                "git clone %s:pulp-tools/IPApproX.git ipstools -b verilator" %
                (server))

    import ipstools

# creates an IPApproX database
ipdb = ipstools.IPDatabase(ips_dir="./ips", skip_scripts=True)
# updates the IPs from the git repo
ipdb.update_ips(remote=remote)

# launch generate-ips.py
execute("./generate-scripts.py")

# download IPApproX tools in ./ipstools and import them
if os.path.exists("ipstools") and os.path.isdir("ipstools"):
    cwd = os.getcwd()
    os.chdir("ipstools")
    execute("git pull origin master", silent=True)
    os.chdir(cwd)
    import ipstools
else:
    execute(
        "git clone [email protected]:pulp-tools/IPApproX.git ipstools -b master"
    )
    import ipstools
execute("mkdir -p vcompile/rtl")
execute("rm -rf vcompile/rtl/*")

# creates an IPApproX database
ipdb = ipstools.IPDatabase(rtl_dir='./')
# generate ModelSim/QuestaSim compilation scripts
ipdb.export_make(script_path="vcompile/rtl",
                 target_tech='gf22',
                 source='rtl',
                 local=True)
# generate vsim.tcl with ModelSim/QuestaSim "linking" script
ipdb.generate_vsim_tcl("vsimulate/config/vsim_rtl.tcl", source='rtl')
# generate script to compile all IPs for ModelSim/QuestaSim
ipdb.generate_makefile("vcompile/rtl.mk", source='rtl')

print tcolors.OK + "Generated new scripts for IPs!" + tcolors.ENDC