Minor bootshell tweaks for FPGA Move out/shodan_boot_rom/multihart_boot_rom/multihart_boot_rom.elf up one directory Change-Id: I3f2d479c3fea2d13d2157ce61c2753a9a7875079
diff --git a/bootshell.py b/bootshell.py index f8a18f6..9ec045c 100755 --- a/bootshell.py +++ b/bootshell.py
@@ -13,13 +13,17 @@ class BootromShell(cmd.Cmd): intro = "Welcome to Bootrom Shell" - prompt = "BOOTROM> " + # The bootrom will display its own prompt, no need for one here. + prompt = "" socket = None poller = None pty_in = None pty_out = None connected = False use_pty = False + default_host_name = "Renode" + default_host_addr = ("localhost", 31415) + default_max_retry = 60 ############################################################################ # Network stuff here @@ -85,10 +89,10 @@ if self.use_pty: print(self.pty_in) result = self.pty_in.read(size) - return result - result = self.socket.recv(size) - if len(result) == 0: - self.disconnect() + else: + result = self.socket.recv(size) + if len(result) == 0: + self.disconnect() return result def poll(self, timeout): @@ -207,9 +211,9 @@ def do_connect(self, _=""): """Connects to the Renode server, localhost@31415 by default.""" - host_name = "Renode" - host_addr = ("localhost", 31415) - max_retry = 60 + host_name = self.default_host_name + host_addr = self.default_host_addr + max_retry = self.default_max_retry if self.connect(host_name, host_addr, max_retry): print(f"Connected to {host_name} @ {self.getpeername()}") @@ -229,7 +233,7 @@ if self.wait_for_sync(1000): # Sync seen, turn remote echo off and mute the ack self.send("echo off\n".encode()) - self.wait_for_idle(100, False) + self.wait_for_idle(1000, False) return print("Did not see command prompt from server")
diff --git a/kgdb.sh b/kgdb.sh index 48fc902..efcd2af 100755 --- a/kgdb.sh +++ b/kgdb.sh
@@ -26,7 +26,7 @@ TARGET=riscv32-unknown-elf GDB="${ROOTDIR}"/cache/toolchain/bin/${TARGET}-gdb -PROGRAM=out/shodan_boot_rom/multihart_boot_rom/multihart_boot_rom.elf +PROGRAM=out/shodan_boot_rom/multihart_boot_rom.elf REMOTE=localhost:3333 CANTRIP_OUT=out/cantrip/${TARGET}/debug