Disable remote synthesis functionality: web interface as replacement

parent 1f9d6c35
......@@ -124,7 +124,6 @@ def _action_runner(modules_pool):
elif top_mod.action == "synthesis":
modules_pool.synthesis_project()
modules_pool.synthesis_makefile()
#modules_pool.remote_synthesis()
elif top_mod.action == "qsys_hw_tcl_update":
if not top_mod.manifest_dict["hw_tcl_filename"]:
logging.error("'hw_tcl_filename' manifest variable has to be specified. "
......@@ -135,8 +134,6 @@ def _action_runner(modules_pool):
modules_pool.simulation_makefile()
elif options.command == "make-synthesis":
modules_pool.synthesis_makefile()
elif options.command == "make-remote":
modules_pool.remote_synthesis()
elif options.command == "fetch":
modules_pool.fetch()
elif options.command == "clean":
......@@ -180,7 +177,6 @@ def _get_parser():
manifest_help = subparsers.add_parser("manifest-help", help="print manifest file variables description")
make_simulation = subparsers.add_parser("make-simulation", help="generate simulation makefile")
make_synthesis = subparsers.add_parser("make-synthesis", help="generate synthesis makefile")
make_remote = subparsers.add_parser("make-remote", help="generate remote synthesis makefile")
fetch = subparsers.add_parser("fetch", help="fetch and/or update remote modules listed in Manifest")
clean = subparsers.add_parser("clean", help="remove all modules fetched for direct and indirect children of this module")
......
......@@ -258,44 +258,3 @@ end sdb_meta_pkg;""")
logging.info(name + " project file generated.")
def _check_remote_synthesis(self):
"""Check we have all the variables to run a remote synthesis"""
if not self.top_module.action == "synthesis":
logging.error("action must be equal to \"synthesis\"")
sys.exit("Exiting")
if not self.top_module.manifest_dict["syn_project"]:
logging.error("syn_project must be set in the manifest.")
sys.exit("Exiting")
def remote_synthesis(self):
"""Generate a Makefile that is able to run a remote synthesis"""
self._check_all_fetched_or_quit()
self._check_remote_synthesis()
tool_object = self._load_synthesis_tool()
logging.info("Generating makefile for remote synthesis.")
top_mod = self.get_top_module()
self.env.check_remote_tool(tool_object)
self.env.check_general()
files = self.build_file_set(
self.get_top_module().manifest_dict["syn_top"])
sff = SourceFileFactory()
files.add(sff.new(top_mod.manifest_dict["syn_project"],
module=self.top_module))
tool_object.generate_remote_synthesis_makefile(
files=files, name=top_mod.manifest_dict["syn_project"][:-5],
cwd=top_mod.url, user=self.env["rsynth_user"],
server=self.env["rsynth_server"])
logging.info("Remote synthesis makefile generated.")
......@@ -151,49 +151,6 @@ class Env(dict):
print("Detected " + name +" version %s" % self[version_key])
def check_remote_tool(self, info_class):
if platform.system() == 'Windows': is_windows = True
else: is_windows = False
tool_info = info_class.get_keys()
remote_path_key = 'rsynth_' + tool_info['id'] + '_path'
remote_version_key = 'rsynth_' + tool_info['id'] + '_version'
name = tool_info['name']
print("\n### Remote tool " + name + " environment information ###")
self._report_and_set_hdlmake_var("rsynth_user")
self._report_and_set_hdlmake_var("rsynth_server")
can_connect = False
if self["rsynth_user"] is not None and self["rsynth_server"] is not None:
ssh_cmd = 'ssh -o BatchMode=yes -o ConnectTimeout=5 %s@%s echo ok 2>&1'
ssh_cmd = ssh_cmd % (self["rsynth_user"], self["rsynth_server"])
ssh_out = Popen(ssh_cmd, shell=True, stdin=PIPE, stdout=PIPE, close_fds=not is_windows)
ssh_response = ssh_out.stdout.readlines()[0].strip()
if ssh_response == "ok":
print("Can connect to the remote machine: %s@%s." % (self["rsynth_user"], self["rsynth_server"]))
can_connect = True
else:
print("Can't make a passwordless connection to the remote machine: %s@%s" % (self["rsynth_user"], self["rsynth_server"]))
can_connect = False
self._report_and_set_hdlmake_var(remote_path_key)
if can_connect and self[remote_path_key] is not None:
ssh_cmd = 'ssh -o BatchMode=yes -o ConnectTimeout=5 %s@%s test -e %s 2>&1'
ssh_cmd = ssh_cmd % (self["rsynth_user"], self["rsynth_server"], self[remote_path_key])
ssh_out = Popen(ssh_cmd, shell=True, stdin=PIPE, stdout=PIPE, close_fds=not is_windows)
ssh_response = ssh_out.returncode
if ssh_response == 0:
print("%s found on remote machine under %s." % (name, self[remote_path_key]))
else:
print("Can't find %s on remote machine under %s." % (name, self[remote_path_key]))
self._report_and_set_hdlmake_var("rsynth_use_screen")
if self["rsynth_use_screen"]:
print("Remote execution will use screen.")
else:
print("To use screen, set it to '1'.")
def _report_and_set_hdlmake_var(self, name):
name = name.upper()
val = self._get(name)
......
......@@ -115,9 +115,6 @@ mrproper:
if os.path.exists(f):
self.write("include %s\n" % f)
def generate_remote_synthesis_makefile(
self, files, name, cwd, user, server):
logging.info("Remote Diamond wrapper")
def generate_synthesis_project(
self, update=False, tool_version='', top_mod=None, fileset=None):
......
......@@ -103,106 +103,6 @@ class ToolISE(ActionMakefile):
return ise_version
def generate_remote_synthesis_makefile(
self, files, name, cwd, user, server):
if platform.system() == 'Windows':
is_windows = True
else:
is_windows = False
if name is None:
import random
name = ''.join(random.choice(string.ascii_letters + string.digits)
for _ in range(8))
whoami = Popen(
'whoami',
shell=True,
stdin=PIPE,
stdout=PIPE,
close_fds=not is_windows)
name = whoami.stdout.readlines()[0].strip() + '/' + name
user_tmpl = "USER:={0}"
server_tmpl = "SERVER:={0}"
ise_path_tmpl = "ISE_PATH:={0}"
port_tmpl = "PORT:=22"
remote_name_tmpl = "R_NAME:={0}"
files_tmpl = "FILES := {0}"
user_tmpl = user_tmpl.format(
"$(HDLMAKE_RSYNTH_USER)# take the value from the environment")
test_tmpl = """__test_for_remote_synthesis_variables:
ifeq (x$(USER),x)
\t@echo "Remote synthesis user is not set. \
You can set it by editing variable USER in the makefile or setting env. variable HDLMAKE_RSYNTH_USER." && false
endif
ifeq (x$(SERVER),x)
\t@echo "Remote synthesis server is not set. \
You can set it by editing variable SERVER in the makefile or setting env. variable HDLMAKE_RSYNTH_SERVER." && false
endif
ifeq (x$(ISE_PATH),x)
\t@echo "Remote synthesis server is not set. \
You can set it by editing variable ISE_PATH in the makefile or setting env. variable HDLMAKE_RSYNTH_ISE_PATH." && false
endif
"""
if server is None:
server_tmpl = server_tmpl.format(
"$(HDLMAKE_RSYNTH_SERVER)# take the value from the environment")
else:
server_tmpl = server_tmpl.format(server)
remote_name_tmpl = remote_name_tmpl.format(name)
self.initialize()
self.writeln(user_tmpl)
self.writeln(server_tmpl)
self.writeln(ise_path_tmpl.format("$(HDLMAKE_RSYNTH_ISE_PATH)"))
self.writeln(remote_name_tmpl)
self.writeln(port_tmpl)
self.writeln()
self.writeln(test_tmpl)
self.writeln("CWD := $(shell pwd)")
self.writeln("")
self.writeln(
files_tmpl.format(' \\\n'.join([s.rel_path() for s in files])))
self.writeln("")
self.writeln("#target for running synthesis in the remote location")
self.writeln("remote: remote_bitstream")
self.writeln("__send_back: __do_synthesis")
self.writeln("remote_synthesize: __gen_tcl_synthesize __send")
self.writeln("remote_translate: __gen_tcl_translate __send")
self.writeln("remote_map: __gen_tcl_map __send")
self.writeln("remote_par: __gen_tcl_par __send")
self.writeln("remote_bitstream: __gen_tcl_bitstream __send")
self.writeln("__send: __test_for_remote_synthesis_variables")
self.writeln("")
mkdir_cmd = "ssh $(USER)@$(SERVER) 'mkdir -p $(R_NAME)'"
rsync_cmd = "rsync -e 'ssh -p $(PORT)' -Ravl $(foreach file, $(FILES), $(shell readlink -f $(file))) $(USER)@$(SERVER):$(R_NAME)"
send_cmd = "__send:\n\t\t{0}\n\t\t{1}".format(mkdir_cmd, rsync_cmd)
self.writeln(send_cmd)
self.writeln("")
synthesis_cmd = """remote_{0}:
\t\trsync -e 'ssh -p $(PORT)' -Ravl $(shell readlink -f run_{0}.tcl) $(USER)@$(SERVER):$(R_NAME)
ifeq (x$(HDLMAKE_RSYNTH_USE_SCREEN), x1)
\t\tssh -t $(USER)@$(SERVER) 'screen bash -c "cd $(R_NAME)$(CWD) && $(HDLMAKE_RSYNTH_ISE_PATH)/xtclsh run_{0}.tcl"'
else
\t\tssh $(USER)@$(SERVER) 'cd $(R_NAME)$(CWD) && $(HDLMAKE_RSYNTH_ISE_PATH)/xtclsh run_{0}.tcl'
endif
"""
self.writeln(synthesis_cmd.format('synthesize'))
self.writeln(synthesis_cmd.format('translate'))
self.writeln(synthesis_cmd.format('map'))
self.writeln(synthesis_cmd.format('par'))
self.writeln(synthesis_cmd.format('bitstream'))
self.writeln()
send_back_cmd = "sync: \n\t\tcd .. && rsync -av $(USER)@$(SERVER):$(R_NAME)/$(CWD) . && cd $(CWD)"
self.write(send_back_cmd)
self.write("\n\n")
cln_cmd = "cleanremote:\n\t\tssh $(USER)@$(SERVER) 'rm -rf $(R_NAME)'"
self.writeln("#target for removing stuff from the remote location")
self.writeln(cln_cmd)
self.writeln()
def generate_synthesis_makefile(self, top_mod, tool_path):
makefile_tmplt = string.Template("""PROJECT := ${project_name}
......
......@@ -112,9 +112,6 @@ mrproper:
if os.path.exists(f):
self.write("include %s\n" % f)
def generate_remote_synthesis_makefile(
self, files, name, cwd, user, server):
logging.info("Remote Libero wrapper")
def generate_synthesis_project(
self, update=False, tool_version='', top_mod=None, fileset=None):
......
......@@ -121,9 +121,6 @@ mrproper:
if os.path.exists(f):
self.write("include %s\n" % f)
def generate_remote_synthesis_makefile(
self, files, name, cwd, user, server):
logging.info("Remote PlanAhead wrapper")
def generate_synthesis_project(
self, update=False, tool_version='', top_mod=None, fileset=None):
......
......@@ -124,9 +124,6 @@ mrproper:
if os.path.exists(f):
self.write("include %s\n" % f)
def generate_remote_synthesis_makefile(
self, files, name, cwd, user, server):
logging.info("Remote Quartus wrapper")
def _set_tcl_files(self, mod):
"""Method that checks if the TCL files declared by the module
......
......@@ -118,10 +118,6 @@ mrproper:
if os.path.exists(f):
self.write("include %s\n" % f)
def generate_remote_synthesis_makefile(
self, files, name, cwd, user, server):
logging.info("Remote Vivado wrapper")
def generate_synthesis_project(
self, update=False, tool_version='', top_mod=None, fileset=None):
self.properties = []
......
Markdown is supported
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