+ # Path to linker script relative to the .py file where the target is
+ # defined. Defaults to <name>.lds.
+ link_script_path = None
+
+ # Implements dmode in tdata1 as described in the spec. Harts that need
+ # this value set to False are not compliant with the spec (but still usable
+ # as long as running code doesn't try to mess with triggers set by an
+ # external debugger).
+ honors_tdata1_hmode = True
+
+ # Address where a r/w/x block of RAM starts, together with its size.
+ ram = None
+ ram_size = None
+
+ # Number of instruction triggers the hart supports.
+ instruction_hardware_breakpoint_count = 0
+
+ # Defaults to target-<index>
+ name = None
+
+ # When reset, the PC must be at one of the values listed here.
+ # This is a list because on some boards the reset vector depends on
+ # jumpers.
+ reset_vectors = []
+
+ def extensionSupported(self, letter):
+ # target.misa is set by testlib.ExamineTarget
+ if self.misa:
+ return self.misa & (1 << (ord(letter.upper()) - ord('A')))
+ else:
+ return False
+
+class Target(object):
+ # pylint: disable=too-many-instance-attributes
+
+ # List of Hart object instances, one for each hart in the target.
+ harts = []
+
+ # Name of the target. Defaults to the name of the class.
+ name = None
+
+ # GDB remotetimeout setting.
+ timeout_sec = 2
+
+ # Timeout waiting for the server to start up. This is different than the
+ # GDB timeout, which is how long GDB waits for commands to execute.
+ # The server_timeout is how long this script waits for the server to be
+ # ready for GDB connections.
+ server_timeout_sec = 60
+
+ # Path to OpenOCD configuration file relative to the .py file where the
+ # target is defined. Defaults to <name>.cfg.
+ openocd_config_path = None
+
+ # List of commands that should be executed in gdb after connecting but
+ # before starting the test.
+ gdb_setup = []
+
+ # Supports mtime at 0x2004000
+ supports_clint_mtime = True
+
+ # Implements custom debug registers like spike does. It seems unlikely any
+ # hardware will every do that.
+ implements_custom_test = False