Commit 0b48afb5 authored by Federico Vaga's avatar Federico Vaga

sw:tool:dbg: prepare the field for PCI support

It structures the code so that it will be faster to add PCI support
whenever we want to do it and decide how to do it
Signed-off-by: Federico Vaga's avatarFederico Vaga <federico.vaga@cern.ch>
parent 8e0807db
......@@ -707,6 +707,8 @@ def main():
'gdb': cmd_gdb}
parser = argparse.ArgumentParser(description='Low-level debugging interface without driver')
parser.add_argument("-b, --bus", choices=["pci", "vme"],
required=True, dest='bus', help='to select the bus on which there is the Mock Turtle core to access.')
parser.add_argument("-o, --offset", type=auto_int, required=True, dest='offset', default=0,
help='The memory offset to apply to be able to point to the Mock Turtle core. This is strictly dependent on the bus in use.')
parser.add_argument("-v, --verbose", action='store_true',
......@@ -715,7 +717,7 @@ def main():
default=False, dest='keep', help='')
parser.add_argument("-c, --cpu", type=int, default=0, dest='cpu',
help='Select the CPU to use')
parser.add_argument("-b, --no-term", action='store_false',
parser.add_argument("-t, --no-term", action='store_false',
default=False, dest='term',
help='It disable the console during GDB session')
parser.add_argument("cmd", default=False, nargs='+', choices=cmds.keys(),
......@@ -727,10 +729,15 @@ def main():
flag_cpu = args.cpu
flag_term = args.term
try:
if args.bus == "pci":
raise Exception("Not supported yet")
elif args.bus == "vme":
mt_desc = PyUAL.PyUALVME(4, 0x39, 0x80000, args.offset, 1)
csr = PyUAL.PyUAL("vme", mt_desc)
else:
raise Exception("Invalid bus")
try:
csr = PyUAL.PyUAL(args.bus, mt_desc)
for cmd in args.cmd:
cmds[cmd](csr)
except Exception as e:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment