gem5-shell 554 B

123456789101112131415161718192021222324
  1. #!/usr/bin/env python3
  2. import common
  3. from shell_helpers import LF
  4. class Main(common.LkmcCliFunction):
  5. def __init__(self):
  6. super().__init__(
  7. defaults={
  8. 'emulators': ['gem5'],
  9. },
  10. description='Connect a terminal to a running gem5 instance',
  11. )
  12. def timed_main(self):
  13. return self.sh.run_cmd([
  14. self.env['gem5_m5term'],
  15. 'localhost',
  16. str(self.env['gem5_telnet_port']),
  17. LF,
  18. ])
  19. if __name__ == '__main__':
  20. Main().cli()