self.tftp_dir = None
def get_output(self):
- # wait a bit to give FVP time to listen for a telnet connection
+ # wait a bit to give the simulator time to listen for a telnet connection
if self.child.poll() != None: # Check if child is down
print 'Simulator is down, return code is %d' % self.child.returncode
return None
GEM5_PATH = '/home/netos/tools/gem5/gem5-stable-1604'
# gem5 takes quite a while to come up. If we return right away,
# telnet will be opened too early and fails to connect
-GEM5_START_TIMEOUT = 5 # in seconds
+#
+# SG, 2016-10-07: If this is too high, however, and we have an
+# early-boot bug gem5 will exit before telnet connects, and we do
+# not get the gem5 output at all
+GEM5_START_TIMEOUT = 1 # in seconds
class Gem5MachineBase(ARMSimulatorBase):
imagename = "armv7_a15ve_1_image"
# read a single character, to avoid blocking
# FIXME: there must be a better way to do nonblocking IO!
c = fh.read(1)
- if c == '': # should never see EOF
- raise Exception('read from sub-process returned EOF')
+ # can see EOF if fh is a telnet socket that was closed in the meantime
+ if c == '':
+ raise EOFError('read from sub-process returned EOF')
line += c
return line
yield TEST_TIMEOUT_LINE
debug.verbose("timeout encountered in collect_data");
raise e
+ except EOFError as e:
+ debug.verbose("got EOF from sub-process")
+ break
yield line