return data
-class Flterm:
+class LiteXTerm:
def __init__(self, kernel_image, kernel_address):
self.kernel_image = kernel_image
self.kernel_address = kernel_address
elif reply == sfl_ack_crcerror:
retry = 1
else:
- print("[FLTERM] Got unknown reply '{}' from the device, aborting.".format(reply))
+ print("[TERM] Got unknown reply '{}' from the device, aborting.".format(reply))
return 0
return 1
def upload(self, filename, address):
data = get_file_data(filename)
- print("[FLTERM] Uploading {} ({} bytes)...".format(filename, len(data)))
+ print("[TERM] Uploading {} ({} bytes)...".format(filename, len(data)))
current_address = address
position = 0
length = len(data)
data = []
end = time.time()
elapsed = end - start
- print("[FLTERM] Upload complete ({0:.1f}KB/s).".format(length/(elapsed*1024)))
+ print("[TERM] Upload complete ({0:.1f}KB/s).".format(length/(elapsed*1024)))
return length
def boot(self):
- print("[FLTERM] Booting the device.")
+ print("[TERM] Booting the device.")
frame = SFLFrame()
frame.length = 4
frame.cmd = sfl_cmd_jump
return False
def answer_magic(self):
- print("[FLTERM] Received firmware download request from the device.")
+ print("[TERM] Received firmware download request from the device.")
if os.path.exists(self.kernel_image):
self.write_exact(sfl_magic_ack)
self.upload(self.kernel_image, self.kernel_address)
self.boot()
- print("[FLTERM] Done.");
+ print("[TERM] Done.");
def reader(self):
try:
self.writer_thread.join()
def start(self):
- print("[FLTERM] Starting....")
+ print("[TERM] Starting....")
self.start_reader()
self.start_writer()
def main():
args = _get_args()
- flterm = Flterm(args.kernel, args.kernel_adr)
- flterm.open(args.port, args.speed)
- flterm.start()
+ term = LiteXTerm(args.kernel, args.kernel_adr)
+ term.open(args.port, args.speed)
+ term.start()
try:
- flterm.join(True)
+ term.join(True)
except KeyboardInterrupt:
pass