Skip to content

Commit a9aa250

Browse files
Marti Bolivarnashif
authored andcommitted
scripts: west: clean up intel_s1000 runner
Make the flake8 linter happy, spell the board name with the correct case in the module docstring, and keep the usual camel case naming convention used for classes. Signed-off-by: Marti Bolivar <[email protected]>
1 parent bc587d9 commit a9aa250

File tree

1 file changed

+32
-23
lines changed

1 file changed

+32
-23
lines changed

scripts/meta/west/runner/intel_s1000.py

Lines changed: 32 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,24 @@
22
#
33
# SPDX-License-Identifier: Apache-2.0
44

5-
'''Runner for debugging and flashing Intel_s1000 devices'''
5+
'''Runner for debugging and flashing intel_s1000 devices'''
66
from os import path
77
from .core import ZephyrBinaryRunner
88
import time
99
import signal
1010

1111
DEFAULT_XT_GDB_PORT = 20000
1212

13-
class intel_s1000BinaryRunner(ZephyrBinaryRunner):
13+
14+
class IntelS1000BinaryRunner(ZephyrBinaryRunner):
1415
'''Runner front-end for Intel_s1000.'''
1516

1617
def __init__(self,
1718
board_dir, xt_ocd_dir,
1819
ocd_topology, ocd_jtag_instr, gdb_flash_file,
1920
elf_name, gdb,
2021
gdb_port=DEFAULT_XT_GDB_PORT, debug=False):
21-
super(intel_s1000BinaryRunner, self).__init__(debug=debug)
22+
super(IntelS1000BinaryRunner, self).__init__(debug=debug)
2223
self.board_dir = board_dir
2324
self.xt_ocd_dir = xt_ocd_dir
2425
self.ocd_topology = ocd_topology
@@ -37,29 +38,37 @@ def do_add_parser(cls, parser):
3738
# Required
3839

3940
# Optional
40-
parser.add_argument('--gdb-port', default=DEFAULT_XT_GDB_PORT,
41-
help='xt-gdb port, defaults to 20000')
42-
parser.add_argument('--xt-ocd-dir', default='/opt/Tensilica/xocd-12.0.4/xt-ocd',
43-
help='ocd-dir, defaults to /opt/Tensilica/xocd-12.0.4/xt-ocd')
44-
parser.add_argument('--ocd-topology', default='topology_dsp0_flyswatter2.xml',
45-
help='ocd-topology, defaults to topology_dsp0_flyswatter2.xml')
46-
parser.add_argument('--ocd-jtag-instr', default='dsp0_gdb.txt',
47-
help='ocd-jtag-instr, defaults to dsp0_gdb.txt')
48-
parser.add_argument('--gdb-flash-file', default='load_elf.txt',
49-
help='gdb-flash-file, defaults to load_elf.txt')
41+
parser.add_argument(
42+
'--gdb-port', default=DEFAULT_XT_GDB_PORT,
43+
help='xt-gdb port, defaults to 20000')
44+
parser.add_argument(
45+
'--xt-ocd-dir', default='/opt/Tensilica/xocd-12.0.4/xt-ocd',
46+
help='ocd-dir, defaults to /opt/Tensilica/xocd-12.0.4/xt-ocd')
47+
parser.add_argument(
48+
'--ocd-topology', default='topology_dsp0_flyswatter2.xml',
49+
help='ocd-topology, defaults to topology_dsp0_flyswatter2.xml')
50+
parser.add_argument(
51+
'--ocd-jtag-instr', default='dsp0_gdb.txt',
52+
help='ocd-jtag-instr, defaults to dsp0_gdb.txt')
53+
parser.add_argument(
54+
'--gdb-flash-file', default='load_elf.txt',
55+
help='gdb-flash-file, defaults to load_elf.txt')
5056

5157
@classmethod
5258
def create_from_args(command, args):
53-
return intel_s1000BinaryRunner(
59+
return IntelS1000BinaryRunner(
5460
args.board_dir, args.xt_ocd_dir,
5561
args.ocd_topology, args.ocd_jtag_instr, args.gdb_flash_file,
5662
args.kernel_elf, args.gdb,
5763
gdb_port=args.gdb_port, debug=args.verbose)
5864

5965
def do_run(self, command, **kwargs):
60-
kwargs['ocd-topology'] = path.join(self.board_dir, 'support', self.ocd_topology)
61-
kwargs['ocd-jtag-instr'] = path.join(self.board_dir, 'support', self.ocd_jtag_instr)
62-
kwargs['gdb-flash-file'] = path.join(self.board_dir, 'support', self.gdb_flash_file)
66+
kwargs['ocd-topology'] = path.join(self.board_dir, 'support',
67+
self.ocd_topology)
68+
kwargs['ocd-jtag-instr'] = path.join(self.board_dir, 'support',
69+
self.ocd_jtag_instr)
70+
kwargs['gdb-flash-file'] = path.join(self.board_dir, 'support',
71+
self.gdb_flash_file)
6372

6473
if command == 'flash':
6574
self.flash(**kwargs)
@@ -75,8 +84,8 @@ def flash(self, **kwargs):
7584

7685
self.print_gdbserver_message(self.gdb_port)
7786
server_cmd = [self.xt_ocd_dir,
78-
'-c', topology_file,
79-
'-I', jtag_instr_file]
87+
'-c', topology_file,
88+
'-I', jtag_instr_file]
8089

8190
# Start the server
8291
# Note that XTOCD always fails the first time. It has to be
@@ -107,8 +116,8 @@ def do_debug(self):
107116
raise ValueError('Cannot debug; no gdb specified')
108117

109118
gdb_cmd = [self.gdb_cmd,
110-
'-ex', 'target remote :{}'.format(self.gdb_port),
111-
self.elf_name]
119+
'-ex', 'target remote :{}'.format(self.gdb_port),
120+
self.elf_name]
112121

113122
# The below statement will consume the "^C" keypress ensuring
114123
# the python main application doesn't exit. This is important
@@ -128,8 +137,8 @@ def debugserver(self, **kwargs):
128137

129138
self.print_gdbserver_message(self.gdb_port)
130139
server_cmd = [self.xt_ocd_dir,
131-
'-c', topology_file,
132-
'-I', jtag_instr_file]
140+
'-c', topology_file,
141+
'-I', jtag_instr_file]
133142

134143
# Note that XTOCD always fails the first time. It has to be
135144
# relaunched the second time to work.

0 commit comments

Comments
 (0)