Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allowing running with GUI #233

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion edalize/diamond.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,5 +120,5 @@ def build_main(self):
self._run_tool(tcl, [self.name+'.tcl'], quiet=True)
self._run_tool(tcl, [self.name+'_run.tcl'], quiet=True)

def run_main(self):
def run_main(self, with_gui=False):
pass
6 changes: 3 additions & 3 deletions edalize/edatool.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,10 @@ def build_post(self):
if 'post_build' in self.hooks:
self._run_scripts(self.hooks['post_build'], 'post_build')

def run(self, args={}):
def run(self, args={}, with_gui=False):
logger.info("Running")
self.run_pre(args)
self.run_main()
self.run_main(with_gui)
self.run_post()

def run_pre(self, args=None):
Expand All @@ -214,7 +214,7 @@ def run_pre(self, args=None):
if 'pre_run' in self.hooks:
self._run_scripts(self.hooks['pre_run'], 'pre_run')

def run_main(self):
def run_main(self, with_gui=False):
pass

def run_post(self):
Expand Down
4 changes: 3 additions & 1 deletion edalize/ghdl.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,11 @@ def configure_main(self):
}
)

def run_main(self):
def run_main(self, with_gui=False):
cmd = 'make'
args = ['run']
if with_gui:
logger.warning("GHDL backend has no GUI support, running in CLI")

# GHDL doesn't support Verilog, but the backend used vlogparam since
# edalize didn't support generic at the time. Now that generic support
Expand Down
4 changes: 3 additions & 1 deletion edalize/icarus.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,10 @@ def configure_main(self):
incs = ' '.join(_incs),
srcs = ' '.join(_srcs)))

def run_main(self):
def run_main(self, with_gui=False):
args = ['run']
if with_gui:
logger.warning("Icarus has no GUI support, running in CLI")

# Set plusargs
if self.plusarg:
Expand Down
4 changes: 3 additions & 1 deletion edalize/ise.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,9 @@ def _write_tcl_file(self):
tcl_file.write('project set top "{}"\n'.format(self.toplevel))
tcl_file.close()

def run_main(self):
def run_main(self, with_gui=False):
if with_gui:
logger.warning("No support for ISE GUI, running in CLI")
pgm_file_name = os.path.join(self.work_root, self.name+'.pgm')
self._write_pgm_file(pgm_file_name)
self._run_tool('impact', ['-batch', pgm_file_name])
Expand Down
9 changes: 7 additions & 2 deletions edalize/isim.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,13 @@ def configure_main(self):
isim_options = isim_options,
extra_options = extra_options))

def run_main(self):
args = ['run']
def run_main(self, with_gui=False):
args = []
if with_gui:
args.append('run-gui')
else:
args.append('run')

# Plusargs
if self.plusarg:
_s = '-testplusarg {}={}'
Expand Down
2 changes: 1 addition & 1 deletion edalize/libero.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,5 +191,5 @@ def build_main(self):
logger.warn(
"Libero not found on path, execute manually the script \"" + filePath + "\"")

def run_main(self):
def run_main(self, with_gui=False):
pass
8 changes: 6 additions & 2 deletions edalize/modelsim.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,12 @@ def configure_main(self):
self._write_makefile()
tcl_main.close()

def run_main(self):
args = ['run']
def run_main(self, with_gui=False):
args = []
if with_gui:
args.append('run-gui')
else:
args.append('run')

# Set plusargs
if self.plusarg:
Expand Down
2 changes: 1 addition & 1 deletion edalize/morty.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,5 @@ def build_main(self, target=None):
# Go and do your thing!
self._run_tool('morty', args, quiet=True)

def run_main(self):
def run_main(self, with_gui=False):
logger.warn("Morty does not support running. Use build instead.")
4 changes: 3 additions & 1 deletion edalize/quartus.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,9 @@ def build_main(self):

""" Program the FPGA
"""
def run_main(self):
def run_main(self, with_gui=False):
if with_gui:
logger.warning("No support for Quartus GUI, running in CLI")
args = ['--mode=jtag']
if 'cable' in self.tool_options:
args += ['-c', self.tool_options['cable']]
Expand Down
2 changes: 1 addition & 1 deletion edalize/radiant.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,5 +109,5 @@ def build_main(self):
self._run_tool('radiantc', [self.name+'.tcl'], quiet=True)
self._run_tool('radiantc', [self.name+'_run.tcl'], quiet=True)

def run_main(self):
def run_main(self, with_gui=False):
pass
4 changes: 3 additions & 1 deletion edalize/rivierapro.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,9 @@ def build_main(self):
args = ['-c', '-do', 'do edalize_main.tcl; exit']
self._run_tool('vsim', args, quiet=True)

def run_main(self):
def run_main(self, with_gui=False):
if with_gui:
logger.warning("No support for GUI in RivieraPro, running in CLI")
if not os.getenv('ALDEC_PATH'):
raise RuntimeError("Environment variable ALDEC_PATH was not found. It should be set to Riviera Pro install path. Please source <Riviera Pro install path>/etc/setenv to set it")

Expand Down
4 changes: 3 additions & 1 deletion edalize/symbiflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,5 +163,7 @@ def configure_main(self):
else:
logger.error("VPR is the only P&R tool currently supported in SymbiFlow")

def run_main(self):
def run_main(self, with_gui=False):
if with_gui:
logger.warning("No GUI support for SymbiFlow, running in CLI")
logger.info("Programming")
4 changes: 3 additions & 1 deletion edalize/symbiyosys.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,9 @@ def configure_main(self):
def build_main(self):
pass

def run_main(self):
def run_main(self, with_gui=False):
if with_gui:
logger.warning("No GUI support for SymbiYosys, running in CLI")
tasknames = self.tool_options.get('tasknames', [])
if not isinstance(tasknames, list):
raise RuntimeError('"tasknames" tool option should be '
Expand Down
5 changes: 4 additions & 1 deletion edalize/vcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,11 @@ def _vcs_filelist_filter(src_file):

self.render_template('Makefile.j2', 'Makefile', template_vars)

def run_main(self):
def run_main(self, with_gui=False):
args = ['run']
if with_gui:
logger.warning("No GUI support for VCS, running in CLI")


# Set plusargs
if self.plusarg:
Expand Down
4 changes: 3 additions & 1 deletion edalize/veribleformat.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ def _get_tool_args(self):

return args

def run_main(self):
def run_main(self, with_gui=False):
if with_gui:
logger.warning("No GUI support for VeriblFormat, running in CLI")
(src_files, incdirs) = self._get_fileset_files(force_slash=True)

src_files_filtered = []
Expand Down
4 changes: 3 additions & 1 deletion edalize/veriblelint.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ def _get_tool_args(self):

return args

def run_main(self):
def run_main(self, with_gui=False):
if with_gui:
logger.warning("No GUI support for VeribleLint, running in CLI")
(src_files, incdirs) = self._get_fileset_files(force_slash=True)

src_files_filtered = []
Expand Down
4 changes: 3 additions & 1 deletion edalize/verilator.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,9 @@ def build_main(self):
_s = os.path.join(self.work_root, 'verilator.{}.log')
self._run_tool('make', args, quiet=True)

def run_main(self):
def run_main(self, with_gui=False):
if with_gui:
logger.warning("No GUI support for VeribleLint, running in CLI")
self.check_managed_parser()
self.args = []
for key, value in self.plusarg.items():
Expand Down
4 changes: 3 additions & 1 deletion edalize/vivado.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,9 @@ def build_main(self):
correct FPGA board and then downloads the bitstream. The tcl script is then
executed in Vivado's batch mode.
"""
def run_main(self):
def run_main(self, with_gui=False):
if with_gui:
logger.warning("No GUI support for Vivado, running in CLI")
if 'pnr' in self.tool_options:
if self.tool_options['pnr'] == 'vivado':
pass
Expand Down
4 changes: 3 additions & 1 deletion edalize/vunit.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ def build_main(self):
testrunner = os.path.join(self.work_root, self.testrunner)
self._run_tool(sys.executable, [testrunner, "--compile", "-k"] + vunit_options, quiet=True)

def run_main(self):
def run_main(self, with_gui=False):
if with_gui:
logger.warning("No GUI support for VUnit, running in CLI")
vunit_options = self.tool_options.get("vunit_options", [])
testrunner = os.path.join(self.work_root, self.testrunner)
self._run_tool(sys.executable, [testrunner] + vunit_options)
Expand Down
8 changes: 6 additions & 2 deletions edalize/xcelium.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,12 @@ def configure_main(self):
self._write_makefile()
tcl_main.close()

def run_main(self):
args = ['run']
def run_main(self, with_gui=False):
args = []
if with_gui:
args.append('run-gui')
else:
args.append('run')

# Set plusargs
if self.plusarg:
Expand Down
8 changes: 6 additions & 2 deletions edalize/xsim.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,12 @@ def _write_config_files(self):
with open(os.path.join(self.work_root, 'Makefile'), 'w') as f:
f.write(self.MAKEFILE_TEMPLATE)

def run_main(self):
args = ['run']
def run_main(self, with_gui=False):
args = []
if with_gui:
args.append('run-gui')
else:
args.append('run')
# Plusargs
if self.plusarg:
_s = '--testplusarg {}={}'
Expand Down