summaryrefslogtreecommitdiff
path: root/sim
diff options
context:
space:
mode:
authorAlejandro Soto <alejandro@34project.org>2022-12-07 20:06:56 -0600
committerAlejandro Soto <alejandro@34project.org>2022-12-07 20:06:56 -0600
commitd8d687ad8052809f66c0b5a36d4ca74d0a3b202c (patch)
treee17f38a7be0bc9353054c284ec1659619a66ed9c /sim
parenta7adc0af074826a4c68c7395d2abfd4b931955df (diff)
Make --no-tty optional in sim
Diffstat (limited to '')
-rw-r--r--sim/gdbstub.py2
-rwxr-xr-xsim/sim.py5
2 files changed, 5 insertions, 2 deletions
diff --git a/sim/gdbstub.py b/sim/gdbstub.py
index c01a4a7..8d20f39 100644
--- a/sim/gdbstub.py
+++ b/sim/gdbstub.py
@@ -1,6 +1,7 @@
import sys, socket
cycles = None
+enable_tty = True
start_halted = True
def init():
@@ -77,7 +78,6 @@ def halt():
elif data == b's':
return 'step'
else:
- print('unhandled packet:', data, file=sys.stderr)
out = b''
reply(out)
diff --git a/sim/sim.py b/sim/sim.py
index b0a194a..189ecfc 100755
--- a/sim/sim.py
+++ b/sim/sim.py
@@ -280,12 +280,15 @@ mem_dumps = module_get('mem_dumps', [])
if init := module_get('init'):
init()
-exec_args = [verilated, '--headless', '--no-tty', '--dump-regs']
+exec_args = [verilated, '--headless', '--dump-regs']
cycles = module_get('cycles', 1024)
if cycles is not None:
exec_args.extend(['--cycles', str(cycles)])
+if not module_get('enable_tty', False):
+ exec_args.append('--no-tty')
+
for rng in mem_dumps:
length = rng.stop - rng.start
assert rng.start >= 0 and rng.stop > rng.start \