Changeset 9185e42 in mainline
- Timestamp:
- 2017-01-22T10:52:17Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 61b208f
- Parents:
- bfa4ffa
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/ew.py
rbfa4ffa r9185e42 80 80 return '-cpu 4Kc' 81 81 82 def platform_to_qemu_options(platform, machine ):82 def platform_to_qemu_options(platform, machine, processor): 83 83 if platform == 'amd64': 84 84 return 'system-x86_64', pc_options(64) … … 95 95 return 'system-ppc', '-m 256' 96 96 elif platform == 'sparc64': 97 return 'system-sparc64', '--prom-env boot-args="console=devices/\\hw\\pci0\\00:03.0\\com1\\a"' 97 if machine != 'generic': 98 raise Exception 99 if processor == 'us': 100 return 'system-sparc64', '-M sun4u --prom-env boot-args="console=devices/\\hw\\pci0\\00:03.0\\com1\\a"' 101 elif processor == 'sun4v': 102 default_path = '/usr/local/opensparc/image/' 103 try: 104 if os.path.exists(default_path): 105 opensparc_bins = default_path 106 elif os.path.exists(os.environ['OPENSPARC_BINARIES']): 107 opensparc_bins = os.environ['OPENSPARC_BINARIES'] 108 else: 109 raise Exception 110 except: 111 print("Cannot find OpenSPARC binary images!") 112 print("Either set OPENSPARC_BINARIES environment variable accordingly or place the images in %s." % (default_path)) 113 raise Exception 114 115 return 'system-sparc64', '-M niagara -m 256 -L %s' % (opensparc_bins) 116 98 117 99 118 def hdisk_mk(): … … 148 167 def qemu_run(platform, machine, processor): 149 168 cfg = cfg_get(platform, machine, processor) 150 suffix, options = platform_to_qemu_options(platform, machine )169 suffix, options = platform_to_qemu_options(platform, machine, processor) 151 170 cmd = 'qemu-' + suffix 152 171 … … 168 187 elif cfg['image'] == 'image.boot': 169 188 cmdline += ' -kernel image.boot' 189 else: 190 cmdline += ' ' + cfg['image'] 170 191 171 192 if ('console' in cfg.keys()) and not cfg['console']: … … 175 196 if machine != '': 176 197 title += ' on ' + machine 198 if 'expect' in cfg.keys(): 199 cmdline = 'expect -c \'spawn %s; expect "%s" { send "%s" } timeout exp_continue; interact\'' % (cmdline, cfg['expect']['src'], cfg['expect']['dst']) 177 200 run_in_console(cmdline, title) 178 201 else: … … 190 213 def spike_run(platform, machine, processor): 191 214 run_in_console('spike image.boot', 'HelenOS/risvc64 on Spike') 192 193 def gem5_console_thread():194 # Wait a little bit so that gem5 can create the port195 time.sleep(1)196 term = os.environ['M5_PATH'] + '/gem5/util/term/m5term'197 port = 3457198 run_in_console('expect -c \'spawn %s %d; expect "ok " { send "boot\n" } timeout exp_continue; interact\'' % (term, port), 'HelenOS/sun4v on gem5')199 200 def gem5_run(platform, machine, processor):201 try:202 gem5 = os.environ['M5_PATH'] + '/gem5/build/SPARC/gem5.fast'203 if not os.path.exists(gem5):204 raise Exception205 except:206 print("Did you forget to set M5_PATH?")207 raise208 209 thread.start_new_thread(gem5_console_thread, ())210 211 cmdline = gem5 + ' ' + os.environ['M5_PATH'] + '/configs/example/fs.py --disk-image=' + os.path.abspath('image.iso')212 213 print(cmdline)214 if not is_override('dry_run'):215 subprocess.call(cmdline, shell = True)216 215 217 216 emulators = { … … 270 269 }, 271 270 'sun4v' : { 272 'run' : gem5_run, 271 'run' : qemu_run, 272 'image' : '-drive if=pflash,readonly=on,file=image.iso', 273 'audio' : False, 274 'console' : False, 275 'net' : False, 276 'usb' : False, 277 'expect' : { 278 'src' : 'ok ', 279 'dst' : 'boot\n' 280 }, 273 281 } 274 282 }
Note:
See TracChangeset
for help on using the changeset viewer.