1# -*- coding: utf-8 -*- 2# Copyright (c) 2017 Jason Lowe-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; --- 72 unchanged lines hidden (view full) --- 81system.mem_ctrl.port = system.membus.master 82 83# Connect the system up to the membus 84system.system_port = system.membus.slave 85 86# Create a process for a simple "Hello World" application 87process = Process() 88# Set the command |
89# grab the specific path to the binary 90thispath = os.path.dirname(os.path.realpath(__file__)) 91binpath = os.path.join(thispath, '../../../', 92 'tests/test-progs/hello/bin/x86/linux/hello') |
93# cmd is a list which begins with the executable (like argv) |
94process.cmd = [binpath] |
95# Set the cpu to use the process as its workload and create thread contexts 96system.cpu.workload = process 97system.cpu.createThreads() 98 99# set up the root SimObject and start the simulation 100root = Root(full_system = False, system = system) 101# instantiate all of the objects we've created above 102m5.instantiate() 103 104print("Beginning simulation!") 105exit_event = m5.simulate() 106print('Exiting @ tick %i because %s' % (m5.curTick(), exit_event.getCause())) |