From e9c163920855901461396bd1009584b897c18dd0 Mon Sep 17 00:00:00 2001 From: parth-27 Date: Wed, 9 Dec 2020 21:23:25 +0530 Subject: [PATCH] added option for running multiple cpus --- tools/ew.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/ew.py b/tools/ew.py index f56684d89d..52f0c41139 100755 --- a/tools/ew.py +++ b/tools/ew.py @@ -256,6 +256,9 @@ def qemu_run(platform, machine, processor): suffix, options = platform_to_qemu_options(platform, machine, processor) cmd = 'qemu-' + suffix + if cpus: + cmd += ' -smp cpus=' + cpus + ' ' + cmdline = cmd if 'qemu_path' in overrides.keys(): cmdline = overrides['qemu_path'] + cmd @@ -418,8 +421,9 @@ def spike_run(platform, machine, processor): def usage(): print("%s - emulator wrapper for running HelenOS\n" % os.path.basename(sys.argv[0])) - print("%s [-d] [-h] [-net e1k|rtl8139|ne2k|virtio-net] [-hdd ata|virtio-blk] [-nohdd] [-nokvm] [-nonet] [-nosnd] [-nousb] [-noxhci] [-notablet]\n" % + print("%s [$] [-d] [-h] [-net e1k|rtl8139|ne2k|virtio-net] [-hdd ata|virtio-blk] [-nohdd] [-nokvm] [-nonet] [-nosnd] [-nousb] [-noxhci] [-notablet]\n" % os.path.basename(sys.argv[0])) + print("$\t to run multiple($) cpus") print("-d\tDry run: do not run the emulation, just print the command line.") print("-h\tPrint the usage information and exit.") print("-nohdd\tDisable hard disk, if applicable.") @@ -441,6 +445,8 @@ def run(): expect_nic = False expect_hdd = False expect_qemu = False + global cpus + cpus = '' for i in range(1, len(sys.argv)): @@ -481,6 +487,8 @@ def run(): elif sys.argv[i] == '-h': usage() exit() + elif sys.argv[i].isdigit(): + cpus = sys.argv[i] elif sys.argv[i] == '-d': overrides['dryrun'] = True elif sys.argv[i] == '-net' and i < len(sys.argv) - 1: