Tools: add sitl_32bit board type for sim_vehicle & autotests

This commit is contained in:
Josh Henderson 2021-09-07 15:32:24 -04:00 committed by Andrew Tridgell
parent 1019628ae4
commit 27bb200644
5 changed files with 40 additions and 6 deletions

View File

@ -609,9 +609,22 @@ class sitl(Board):
'-fno-slp-vectorize' # compiler bug when trying to use SLP
]
if cfg.options.sitl_32bit:
# 32bit platform flags
env.CXXFLAGS += [
'-m32',
]
env.CFLAGS += [
'-m32',
]
env.LDFLAGS += [
'-m32',
]
def get_name(self):
return self.__class__.__name__
class sitl_periph_gps(sitl):
def configure_env(self, cfg, env):
cfg.env.AP_PERIPH = 1

View File

@ -437,6 +437,7 @@ def run_step(step):
"postype_single": opts.postype_single,
"extra_configure_args": opts.waf_configure_args,
"coverage": opts.coverage,
"sitl_32bit" : opts.sitl_32bit,
}
if opts.Werror:
@ -940,6 +941,11 @@ if __name__ == "__main__":
action="store_true",
dest="ekf_single",
help="force single precision EKF")
group_build.add_option("--sitl-32bit",
default=False,
action='store_true',
dest="sitl_32bit",
help="compile sitl using 32-bit")
parser.add_option_group(group_build)
group_sim = optparse.OptionGroup(parser, "Simulation options")

View File

@ -1220,7 +1220,8 @@ class AutoTest(ABC):
force_ahrs_type=None,
replay=False,
sup_binaries=[],
reset_after_every_test=False):
reset_after_every_test=False,
sitl_32bit=False):
self.start_time = time.time()
global __autotest__ # FIXME; make progress a non-staticmethod
@ -1244,6 +1245,7 @@ class AutoTest(ABC):
self.speedup = self.default_speedup()
self.sup_binaries = sup_binaries
self.reset_after_every_test = reset_after_every_test
self.sitl_32bit = sitl_32bit
self.mavproxy = None
self._mavproxy = None # for auto-cleanup on failed tests

View File

@ -96,7 +96,7 @@ def relwaf():
return "./modules/waf/waf-light"
def waf_configure(board, j=None, debug=False, math_check_indexes=False, coverage=False, ekf_single=False, postype_single=False, extra_args=[]):
def waf_configure(board, j=None, debug=False, math_check_indexes=False, coverage=False, ekf_single=False, postype_single=False, sitl_32bit=False, extra_args=[]):
cmd_configure = [relwaf(), "configure", "--board", board]
if debug:
cmd_configure.append('--debug')
@ -108,6 +108,8 @@ def waf_configure(board, j=None, debug=False, math_check_indexes=False, coverage
cmd_configure.append('--ekf-single')
if postype_single:
cmd_configure.append('--postype-single')
if sitl_32bit:
cmd_configure.append('--sitl-32bit')
if j is not None:
cmd_configure.extend(['-j', str(j)])
pieces = [shlex.split(x) for x in extra_args]
@ -121,8 +123,7 @@ def waf_clean():
def build_SITL(build_target, j=None, debug=False, board='sitl', clean=True, configure=True, math_check_indexes=False, coverage=False,
ekf_single=False, postype_single=False, extra_configure_args=[]):
"""Build desktop SITL."""
ekf_single=False, postype_single=False, sitl_32bit=False, extra_configure_args=[]):
# first configure
if configure:
@ -133,6 +134,7 @@ def build_SITL(build_target, j=None, debug=False, board='sitl', clean=True, conf
ekf_single=ekf_single,
postype_single=postype_single,
coverage=coverage,
sitl_32bit=sitl_32bit,
extra_args=extra_configure_args)
# then clean
@ -148,7 +150,7 @@ def build_SITL(build_target, j=None, debug=False, board='sitl', clean=True, conf
def build_examples(board, j=None, debug=False, clean=False, configure=True, math_check_indexes=False, coverage=False,
ekf_single=False, postype_single=False,
ekf_single=False, postype_single=False, sitl_32bit=False,
extra_configure_args=[]):
# first configure
if configure:
@ -159,6 +161,7 @@ def build_examples(board, j=None, debug=False, clean=False, configure=True, math
ekf_single=ekf_single,
postype_single=postype_single,
coverage=coverage,
sitl_32bit=sitl_32bit,
extra_args=extra_configure_args)
# then clean
@ -184,7 +187,8 @@ def build_replay(board, j=None, debug=False, clean=False):
return True
def build_tests(board, j=None, debug=False, clean=False, configure=True, math_check_indexes=False, coverage=False,
ekf_single=False, postype_single=False, extra_configure_args=[]):
ekf_single=False, postype_single=False, sitl_32bit=False, extra_configure_args=[]):
# first configure
if configure:
waf_configure(board,
@ -194,6 +198,7 @@ def build_tests(board, j=None, debug=False, clean=False, configure=True, math_ch
ekf_single=ekf_single,
postype_single=postype_single,
coverage=coverage,
sitl_32bit=sitl_32bit,
extra_args=extra_configure_args)
# then clean

View File

@ -341,6 +341,9 @@ def do_build(opts, frame_options):
if opts.ekf_single:
cmd_configure.append("--ekf-single")
if opts.sitl_32bit:
cmd_configure.append("--sitl-32bit")
pieces = [shlex.split(x) for x in opts.waf_configure_args]
for piece in pieces:
cmd_configure.extend(piece)
@ -919,6 +922,11 @@ group_build.add_option("--enable-math-check-indexes",
action="store_true",
dest="math_check_indexes",
help="enable checking of math indexes")
group_build.add_option("", "--sitl-32bit",
default=False,
action='store_true',
dest="sitl_32bit",
help="compile sitl using 32-bit")
group_build.add_option("", "--rebuild-on-failure",
dest="rebuild_on_failure",
action='store_true',