mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
tools/litex_client: Fix read/write when address is directly specified.
This commit is contained in:
parent
8f63a64a86
commit
17b6f792c7
1 changed files with 6 additions and 6 deletions
|
@ -229,17 +229,17 @@ def main():
|
|||
dump_registers(csr_csv=csr_csv, port=port, filter=args.filter)
|
||||
|
||||
if args.read:
|
||||
if isinstance(args.read, str):
|
||||
addr = reg2addr(csr_csv, args.read)
|
||||
else:
|
||||
try:
|
||||
addr = int(args.read, 0)
|
||||
except ValueError:
|
||||
addr = reg2addr(csr_csv, args.read)
|
||||
read_memory(csr_csv=csr_csv, port=port, addr=addr, length=int(args.length, 0))
|
||||
|
||||
if args.write:
|
||||
if isinstance(args.write[0], str):
|
||||
addr = reg2addr(csr_csv, args.write[0])
|
||||
else:
|
||||
try:
|
||||
addr = int(args.write[0], 0)
|
||||
except ValueError:
|
||||
addr = reg2addr(csr_csv, args.write[0])
|
||||
write_memory(csr_csv=csr_csv, port=port, addr=addr, data=int(args.write[1], 0))
|
||||
|
||||
if args.gui:
|
||||
|
|
Loading…
Reference in a new issue