Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added command line option for running multiple cpus #206

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion tools/ew.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.")
Expand All @@ -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)):

Expand Down Expand Up @@ -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:
Expand Down