simple.py (11837:17b37f38944a) | simple.py (11851:824055fe6b30) |
---|---|
1# -*- coding: utf-8 -*- 2# Copyright (c) 2015 Jason Power 3# All rights reserved. 4# 5# Redistribution and use in source and binary forms, with or without 6# modification, are permitted provided that the following conditions are 7# met: redistributions of source code must retain the above copyright 8# notice, this list of conditions and the following disclaimer; --- 75 unchanged lines hidden (view full) --- 84 85# get ISA for the binary to run. 86isa = str(m5.defines.buildEnv['TARGET_ISA']).lower() 87 88# Run 'hello' and use the compiled ISA to find the binary 89binary = 'tests/test-progs/hello/bin/' + isa + '/linux/hello' 90 91# Create a process for a simple "Hello World" application | 1# -*- coding: utf-8 -*- 2# Copyright (c) 2015 Jason Power 3# All rights reserved. 4# 5# Redistribution and use in source and binary forms, with or without 6# modification, are permitted provided that the following conditions are 7# met: redistributions of source code must retain the above copyright 8# notice, this list of conditions and the following disclaimer; --- 75 unchanged lines hidden (view full) --- 84 85# get ISA for the binary to run. 86isa = str(m5.defines.buildEnv['TARGET_ISA']).lower() 87 88# Run 'hello' and use the compiled ISA to find the binary 89binary = 'tests/test-progs/hello/bin/' + isa + '/linux/hello' 90 91# Create a process for a simple "Hello World" application |
92process = LiveProcess() | 92process = Process() |
93# Set the command 94# cmd is a list which begins with the executable (like argv) 95process.cmd = [binary] 96# Set the cpu to use the process as its workload and create thread contexts 97system.cpu.workload = process 98system.cpu.createThreads() 99 100# set up the root SimObject and start the simulation 101root = Root(full_system = False, system = system) 102# instantiate all of the objects we've created above 103m5.instantiate() 104 105print "Beginning simulation!" 106exit_event = m5.simulate() 107print 'Exiting @ tick %i because %s' % (m5.curTick(), exit_event.getCause()) | 93# Set the command 94# cmd is a list which begins with the executable (like argv) 95process.cmd = [binary] 96# Set the cpu to use the process as its workload and create thread contexts 97system.cpu.workload = process 98system.cpu.createThreads() 99 100# set up the root SimObject and start the simulation 101root = Root(full_system = False, system = system) 102# instantiate all of the objects we've created above 103m5.instantiate() 104 105print "Beginning simulation!" 106exit_event = m5.simulate() 107print 'Exiting @ tick %i because %s' % (m5.curTick(), exit_event.getCause()) |