Add interactivity option to simulation
This commit is contained in:
parent
246142256b
commit
8ef7353fe5
|
@ -155,12 +155,12 @@ def _compile_sim(build_name, verbose):
|
||||||
if verbose:
|
if verbose:
|
||||||
print(output)
|
print(output)
|
||||||
|
|
||||||
def _run_sim(build_name, as_root=False):
|
def _run_sim(build_name, as_root=False, interactive=True):
|
||||||
run_script_contents = "sudo " if as_root else ""
|
run_script_contents = "sudo " if as_root else ""
|
||||||
run_script_contents += "obj_dir/Vsim"
|
run_script_contents += "obj_dir/Vsim"
|
||||||
run_script_file = "run_" + build_name + ".sh"
|
run_script_file = "run_" + build_name + ".sh"
|
||||||
tools.write_to_file(run_script_file, run_script_contents, force_unix=True)
|
tools.write_to_file(run_script_file, run_script_contents, force_unix=True)
|
||||||
if sys.platform != "win32":
|
if sys.platform != "win32" and interactive:
|
||||||
import termios
|
import termios
|
||||||
termios_settings = termios.tcgetattr(sys.stdin.fileno())
|
termios_settings = termios.tcgetattr(sys.stdin.fileno())
|
||||||
try:
|
try:
|
||||||
|
@ -169,7 +169,7 @@ def _run_sim(build_name, as_root=False):
|
||||||
raise OSError("Subprocess failed")
|
raise OSError("Subprocess failed")
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
if sys.platform != "win32":
|
if sys.platform != "win32" and interactive:
|
||||||
termios.tcsetattr(sys.stdin.fileno(), termios.TCSAFLUSH, termios_settings)
|
termios.tcsetattr(sys.stdin.fileno(), termios.TCSAFLUSH, termios_settings)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue