simple.py (11851:824055fe6b30) simple.py (12564:2778478ca882)
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;

--- 23 unchanged lines hidden (view full) ---

32See Part 1, Chapter 2: Creating a simple configuration script in the
33learning_gem5 book for more information about this script.
34
35IMPORTANT: If you modify this file, it's likely that the Learning gem5 book
36 also needs to be updated. For now, email Jason <power.jg@gmail.com>
37
38"""
39
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;

--- 23 unchanged lines hidden (view full) ---

32See Part 1, Chapter 2: Creating a simple configuration script in the
33learning_gem5 book for more information about this script.
34
35IMPORTANT: If you modify this file, it's likely that the Learning gem5 book
36 also needs to be updated. For now, email Jason <power.jg@gmail.com>
37
38"""
39
40from __future__ import print_function
41
40# import the m5 (gem5) library created when gem5 is built
41import m5
42# import all of the SimObjects
43from m5.objects import *
44
45# create the system we are going to simulate
46system = System()
47

--- 49 unchanged lines hidden (view full) ---

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
42# import the m5 (gem5) library created when gem5 is built
43import m5
44# import all of the SimObjects
45from m5.objects import *
46
47# create the system we are going to simulate
48system = System()
49

--- 49 unchanged lines hidden (view full) ---

99system.cpu.workload = process
100system.cpu.createThreads()
101
102# set up the root SimObject and start the simulation
103root = Root(full_system = False, system = system)
104# instantiate all of the objects we've created above
105m5.instantiate()
106
105print "Beginning simulation!"
107print("Beginning simulation!")
106exit_event = m5.simulate()
108exit_event = m5.simulate()
107print 'Exiting @ tick %i because %s' % (m5.curTick(), exit_event.getCause())
109print('Exiting @ tick %i because %s' % (m5.curTick(), exit_event.getCause()))