Skip to content
Snippets Groups Projects
Commit 3e5b5b51 authored by Pawel Szostek's avatar Pawel Szostek
Browse files

Fixed a typo and basic pseudo ip-core generation

parent aa701a7a
No related merge requests found
......@@ -88,20 +88,29 @@ def modelsim_ini_path():
vsim_path = os.popen("which vsim").read().strip()
bin_path = os.path.dirname(vsim_path)
return os.path.abspath(bin_path+"/../")
def generate_pseudo_ipcore(fie_deps_dict, filename="ipcore"):
import path
rp = os.path.relpath
f = open("makefile.ipcore", "w")
f.write("file: create_a_file\n")
f.write("create_a_file:\n\t\t@printf \"\" > " + filename)
f.write("file: ")
for file in file_deps_dict:
f.write(rp(file)+"__cat \\\n")
f.write("\n")
for file in file_deps_dict:
f.write(rp(file)+"__cat: ")
f.write(' '.join(rp(x)+"__cat" for x in file_deps_dict[file]))
f.write('\n')
f.write("\t\t@cat "+ file + " >> " + filename + "\n\n")
f.write("\t\t@echo Done.")
def generate_list_makefile(file_deps_dict, filename="Makefile.list"):
from time import gmtime, strftime
import path
date = strftime("%a, %d %b %Y %H:%M:%S", gmtime())
notices = """#######################################################################
# This makefile has been automatically generated by hdl-make
# on """ + date + """
#######################################################################
"""
rp = os.path.relpath
f = open(filename, "w")
f.write(notices)
f.write("file: create_a_file\n")
f.write("create_a_file:\n\t\t@printf \"\" > ise_list \n")
f.write("file: ")
......@@ -112,7 +121,7 @@ def generate_list_makefile(file_deps_dict, filename="Makefile.list"):
f.write(rp(file)+"__print: ")
f.write(' '.join( rp(x)+"__print" for x in file_deps_dict[file]))
f.write('\n')
f.write("\t\t@echo \'"+file_lib_dict[file]+';'+rp(file)+"\' >> ise_list\n\n")
f.write("\t\t@echo \'"+file.library+';'+rp(file)+"\' >> ise_list\n\n")
f.write("\t\t@echo Done.")
def generate_makefile(file_deps_dict, filename="Makefile"):
......
......@@ -42,6 +42,7 @@ def main():
parser.add_option("-l", "--synthesize-locally", dest="local", action="store_true", help="perform a local synthesis")
parser.add_option("-r", "--synthesize-remotelly", dest="remote", action="store_true", help="perform a remote synthesis")
parser.add_option("-v", "--verbose", dest="verbose", action="store_true", default="false", help="verbose mode")
parser.add_option("--ipcore", dest="ipcore", action="store_true", default="false", help="generate a pseudo ip-core")
parser.add_option("--inject", dest="inject", action="store_true", default=None, help="inject file list into ise project")
parser.add_option("--make-list", dest="make_list", action="store_true", default=None, help="make list of project files in ISE format")
parser.add_option("--tcl-file", dest="tcl", help="specify a .tcl file used for synthesis with ISE")
......@@ -56,7 +57,7 @@ def main():
# if no, the look for it in the current directory (python manifest has priority)
file = None
if os.path.exists("manifest.py"):
file = "manfiest.py"
file = "manifest.py"
elif os.path.exitsts("Manifest.py"):
file = "Manifest.py"
......@@ -97,8 +98,14 @@ def main():
generate_makefile()
elif global_mod.options.inject == True:
inject_into_ise()
elif global_mod.options.ipcore == True:
generate_pseudo_ipcore()
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
def generate_pseudo_ipcore():
file_deps_dict = global_mod.generate_deps_for_vhdl_in_modules()
depend.generate_pseudo_ipcore(file_deps_dict)
def fetch():
modules = global_mod.top_module.fetch()
p.vprint("Involved modules:")
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment