gem5.git
10 years agoruby: consumer: avoid accessing wakeup times when waking up
Nilay Vaish [Thu, 20 Mar 2014 14:14:14 +0000 (09:14 -0500)]
ruby: consumer: avoid accessing wakeup times when waking up
Each consumer object maintains a set of tick values when the object is supposed
to wakeup and do some processing.  As of now, the object accesses this set both
when scheduling a wakeup event and when the object actually wakes up.  The set
is accessed during wakeup to remove the current tick value from the set.  This
functionality is now being moved to the scheduling function where ticks are
removed at a later time.

10 years agoruby: garnet: convert network interfaces into clocked objects
Nilay Vaish [Thu, 20 Mar 2014 14:14:14 +0000 (09:14 -0500)]
ruby: garnet: convert network interfaces into clocked objects
This helps in configuring the network interfaces from the python script and
these objects no longer rely on the network object for the timing information.

10 years agoruby: slicc: code refactor
Nilay Vaish [Thu, 20 Mar 2014 14:14:14 +0000 (09:14 -0500)]
ruby: slicc: code refactor

10 years agoconfig: ruby: rename _cpu_ruby_ports to _cpu_ports
Nilay Vaish [Thu, 20 Mar 2014 14:14:14 +0000 (09:14 -0500)]
config: ruby: rename _cpu_ruby_ports to _cpu_ports

10 years agoconfig: fs.py: move creating of test/drive systems to functions
Nilay Vaish [Thu, 20 Mar 2014 14:14:08 +0000 (09:14 -0500)]
config: fs.py: move creating of test/drive systems to functions
The code that creates test and drive systems is being moved to separate
functions so as to make the code more readable.  Ultimately the two
functions would be combined so that the replicated code is eliminated.

10 years agoconfig: remove ruby_fs.py
Nilay Vaish [Thu, 20 Mar 2014 13:03:09 +0000 (08:03 -0500)]
config: remove ruby_fs.py

The patch removes the ruby_fs.py file.  The functionality is being moved to
fs.py.  This would being ruby fs simulations in line with how ruby se
simulations are started (using --ruby option).  The alpha fs config functions
are being combined for classing and ruby memory systems.  This required
renaming the piobus in ruby to iobus.  So, we will have stats being renamed
in the stats file for ruby fs regression.

10 years agoruby: no piobus in se mode
Nilay Vaish [Thu, 20 Mar 2014 13:03:09 +0000 (08:03 -0500)]
ruby: no piobus in se mode
Piobus was recently added to se scripts for ruby so that the interrupt
controller can be connected to something (required since the interrupt
controller sends address range messages).  This patch removes the piobus
and instead, the pio port of ruby port will now ignore the range change
messages in se mode.

10 years agoconfig: ruby: remove piobus from protocols
Nilay Vaish [Mon, 17 Mar 2014 22:40:15 +0000 (17:40 -0500)]
config: ruby: remove piobus from protocols
This patch removes the piobus from the protocol config files.  The ports
are now connected to the piobus in the Ruby.py file.

10 years agoruby: remove some of the unnecessary code
Nilay Vaish [Mon, 17 Mar 2014 22:40:14 +0000 (17:40 -0500)]
ruby: remove some of the unnecessary code

10 years agokvm: Clean up signal handling
Andreas Sandberg [Sun, 16 Mar 2014 16:40:58 +0000 (17:40 +0100)]
kvm: Clean up signal handling

KVM used to use two signals, one for instruction count exits and one
for timer exits. There is really no need to distinguish between the
two since they only trigger exits from KVM. This changeset unifies and
renames the signals and adds a method, kick(), that can be used to
raise the control signal in the vCPU thread. It also removes the early
timer warning since we do not normally see if the signal was
delivered.

--HG--
extra : rebase_source : cd0e45ca90894c3d6f6aa115b9b06a1d8f0fda4d

10 years agokvm: x86: Adjust PC to remove the CS segment base address
Andreas Sandberg [Sun, 16 Mar 2014 16:30:24 +0000 (17:30 +0100)]
kvm: x86: Adjust PC to remove the CS segment base address

gem5 seems to store the PC as RIP+CS_BASE. This is not what KVM
expects, so we need to subtract CS_BASE prior to transferring the PC
into KVM. This changeset adds the necessary PC manipulation and
refactors thread context updates slightly to avoid reading registers
multiple times from KVM.

--HG--
extra : rebase_source : 3f0569dca06a1fcd8694925f75c8918d954ada44

10 years agokvm: x86: Add support for x86 INIT and STARTUP handling
Andreas Sandberg [Sun, 16 Mar 2014 16:28:23 +0000 (17:28 +0100)]
kvm: x86: Add support for x86 INIT and STARTUP handling

This changeset adds support for INIT and STARTUP IPI handling. We
currently handle both of these interrupts in gem5 and transfer the
state to KVM. Since we do not have a BIOS loaded, we pretend that the
INIT interrupt suspends the CPU after reset.

--HG--
extra : rebase_source : 7f3b25f3801d68f668b6cd91eaf50d6f48ee2a6a

10 years agoalpha: Small removal of dead comments/code from alpha ISA
Paul Rosenfeld [Wed, 12 Mar 2014 12:03:22 +0000 (07:03 -0500)]
alpha: Small removal of dead comments/code from alpha ISA

Committed by: Nilay Vaish <nilay@cs.wisc.edu>

10 years agocpu: Make CPU and ThreadContext getters const
Andreas Hansson [Fri, 7 Mar 2014 20:56:23 +0000 (15:56 -0500)]
cpu: Make CPU and ThreadContext getters const

This patch merely tidies up the CPU and ThreadContext getters by
making them const where appropriate.

10 years agoarm: Handle functional TLB walks properly
Geoffrey Blake [Fri, 7 Mar 2014 20:56:23 +0000 (15:56 -0500)]
arm: Handle functional TLB walks properly

The table walker code currently accounts for two types of walks,
Atomic and Timing, and treats them differently. Atomic walks keep a
single instance of WalkerState around for all walks to use in
currState. Timing mode keeps a queue of in-flight WalkerStates and
maintains currState as NULL between walks.

If a functional walk is done during Timing mode, it is treated as an
atomic walk and either creates a persistent WalkerState if in between
Timing walks, or stomps an existing currState for an in-progress
Timing walk.

This patch distinguishes functional walks as being able to exist at
any time and sets up a temporary WalkerState for its exclusive use and
then cleans up when finished, leaving any in progress Atomic or Timing
walks undisturbed.

10 years agomem: Fix incorrect assert failure in the Cache
Prakash Ramrakhyani [Fri, 7 Mar 2014 20:56:23 +0000 (15:56 -0500)]
mem: Fix incorrect assert failure in the Cache

This patch fixes an assert condition that is not true at all
times. There are valid situations that arise in dual-core
dual-workload runs where the assert condition is false. The function
call following the assert however needs to be called only when the
condition is true (a block cannot be invalidated in the tags structure
if has not been allocated in the structure, and the tempBlock is never
allocated). Hence the 'assert' has been replaced with an 'if'.

10 years agomem: Edit proto Packet and enhance the python script
Radhika Jagtap [Fri, 7 Mar 2014 20:56:23 +0000 (15:56 -0500)]
mem: Edit proto Packet and enhance the python script

This patch changes the decode script to output the optional fields of
the proto message Packet, namely id and flags. The flags field is set
by the communication monitor.

The id field is useful for CPU trace experiments, e.g. linking the
fetch side to decode side. It had to be renamed because it clashes
with a built in python function id() for getting the "identity" of an
object.

This patch also takes a few common function definitions out from the
multiple scripts and adds them to a protolib python module.

10 years agoscons: Fix clang version identification for OSX
Mitch Hayenga [Fri, 7 Mar 2014 20:56:23 +0000 (15:56 -0500)]
scons: Fix clang version identification for OSX

The version string may have additional trailing information

10 years agomisc: Add panic_if / fatal_if / chatty_assert
Stephan Diestelhorst [Fri, 7 Mar 2014 20:56:23 +0000 (15:56 -0500)]
misc: Add panic_if / fatal_if / chatty_assert

This snippet can be used to replace if + {panics, fatals, asserts} constructs.
The idea is to have both the condition checking and a verbose printout in a single statement.  The interface is as follows:

panic_if(foo != bar, "These should be equal: foo %i bar %i", foo, bar);
fatal_if(foo != bar, "These should be equal: foo %i bar %i", foo, bar);
chatty_assert(foo == bar, "These should be equal: foo %i bar %i", foo, bar);

10 years agoscons: Fixes uninitialized warnings issued by clang
Mitch Hayenga [Fri, 7 Mar 2014 20:56:23 +0000 (15:56 -0500)]
scons: Fixes uninitialized warnings issued by clang

Small fixes to appease recent clang versions.

10 years agoarm: Fix uninitialised warning with gcc 4.8
Stephan Diestelhorst [Fri, 7 Mar 2014 20:56:23 +0000 (15:56 -0500)]
arm: Fix uninitialised warning with gcc 4.8

Small fix for a warning that prevents compilation with gcc 4.8.1 due
to detecting that a variable might be uninitialised. The fix is to
assign a safe default.

10 years agomem: Wakeup sleeping CPUs without caches on LLSC
Ali Saidi [Fri, 7 Mar 2014 20:56:23 +0000 (15:56 -0500)]
mem: Wakeup sleeping CPUs without caches on LLSC

For systems without caches, the LLSC code does not get snoops for
wake-ups. We add the LLSC code in the abstract memory to do the job
for us.

10 years agosim: Schedule the global sync event at curTick() + simQuantum
Andreas Sandberg [Thu, 6 Mar 2014 14:59:53 +0000 (15:59 +0100)]
sim: Schedule the global sync event at curTick() + simQuantum

The global synchronization event used to be scheduled at
simQuantum. This prevented repeated entries into gem5 from Python as
it can be scheduled in the past. This changeset ensures that the first
global synchronization happens at curTick() + simQuantum instead.

10 years agox86: Setup correct TSL/TR segment attributes on INIT
Andreas Sandberg [Mon, 3 Mar 2014 13:44:57 +0000 (14:44 +0100)]
x86: Setup correct TSL/TR segment attributes on INIT

The TSL/LDT & TR/TSS segments didn't contain valid attributes. This
caused problems when transfering the state into KVM where invalid
state is a no-go. Fixup the attributes with values from AMD's
architecture programmer's manual.

10 years agokvm: x86: Always assume segments to be usable
Andreas Sandberg [Mon, 3 Mar 2014 13:34:33 +0000 (14:34 +0100)]
kvm: x86: Always assume segments to be usable

When transferring segment registers into kvm, we need to find the
value of the unusable bit. We used to assume that this could be
inferred from the selector since segments are generally unusable if
their selector is 0. This assumption breaks in some weird corner
cases.  Instead, we just assume that segments are always usable. This
is what qemu does so it should work.

10 years agokvm: Initialize signal handlers from startupThread()
Andreas Sandberg [Mon, 3 Mar 2014 13:31:39 +0000 (14:31 +0100)]
kvm: Initialize signal handlers from startupThread()

Signal handlers in KVM are controlled per thread and should be
initialized from the thread that is going to execute the CPU. This
changeset moves the initialization call from startup() to
startupThread().

10 years agoruby: message buffer: changes related to tracking push/pop times
Nilay Vaish [Sun, 2 Mar 2014 05:59:58 +0000 (23:59 -0600)]
ruby: message buffer: changes related to tracking push/pop times
The last pop operation is now tracked as a Tick instead of in Cycles.
This helps in avoiding use of the receiver's clock during the enqueue
operation.

10 years agoruby: make the max_size variable of the MessageBuffer unsigned
Nilay Vaish [Sun, 2 Mar 2014 05:59:57 +0000 (23:59 -0600)]
ruby: make the max_size variable of the MessageBuffer unsigned

10 years agocpu: Enable fast-forwarding for MIPS InOrderCPU and O3CPU
Christopher Torng [Sun, 2 Mar 2014 05:35:23 +0000 (23:35 -0600)]
cpu: Enable fast-forwarding for MIPS InOrderCPU and O3CPU
A copyRegs() function is added to MIPS utilities
to copy architectural state from the old CPU to
the new CPU during fast-forwarding. This
addition alone enables fast-forwarding for the
o3 cpu model running MIPS.

The patch also adds takeOverFrom() and
drainResume() functions to the InOrderCPU to
enable it to take over from another CPU. This
change enables fast-forwarding for the inorder
cpu model running MIPS, but not for Alpha.

Committed by: Nilay Vaish <nilay@cs.wisc.edu>

10 years agoruby: profiler: statically allocate stats variable
Nilay Vaish [Sun, 2 Mar 2014 05:35:21 +0000 (23:35 -0600)]
ruby: profiler: statically allocate stats variable
Couple of users observed segmentation fault when the simulator tries to
register the statistical variable m_IncompleteTimes.  It seems that there
is some problem with the initialization of these variables when allocated
in the constructor.

10 years agostats: updates due to c0db268f811b
Nilay Vaish [Tue, 25 Feb 2014 02:50:06 +0000 (20:50 -0600)]
stats: updates due to c0db268f811b

10 years agoruby: correct errors in changeset 4eec7bdde5b0
Nilay Vaish [Tue, 25 Feb 2014 02:50:05 +0000 (20:50 -0600)]
ruby: correct errors in changeset 4eec7bdde5b0
Couple of errors were discovered in 4eec7bdde5b0 which necessitated this patch.
Firstly, we create interrupt controllers in the se mode, but no piobus was
being created.  RubyPort, which earlier used to ignore range changes now
forwards those to the piobus.  The lack of piobus resulted in segmentation
fault.  This patch creates a piobus even in se mode.  It is not created only
when some tester is running.  Secondly,  I had missed out on modifying port
connections for other coherence protocols.

10 years agostats: updates due to changes to ruby pio access handling
Nilay Vaish [Mon, 24 Feb 2014 01:16:16 +0000 (19:16 -0600)]
stats: updates due to changes to ruby pio access handling

10 years agoruby: route all packets through ruby port
Nilay Vaish [Mon, 24 Feb 2014 01:16:16 +0000 (19:16 -0600)]
ruby: route all packets through ruby port
Currently, the interrupt controller in x86 is connected to the io bus
directly.  Therefore the packets between the io devices and the interrupt
controller do not go through ruby.  This patch changes ruby port so that
these packets arrive at the ruby port first, which then routes them to their
destination.  Note that the patch does not make these packets go through the
ruby network.  That would happen in a subsequent patch.

10 years agoruby: Simplify RubyPort flow control and routing
Andreas Hansson [Mon, 24 Feb 2014 01:16:16 +0000 (19:16 -0600)]
ruby: Simplify RubyPort flow control and routing

This patch simplfies the retry logic in the RubyPort, avoiding
redundant attributes, and enforcing more stringent checks on the
interactions with the normal ports. The patch also simplifies the
routing done by the RubyPort, using the port identifiers instead of a
heavy-weight sender state.

The patch also fixes a bug in the sending of responses from PIO
ports. Previously these responses bypassed the queue in the queued
port, and ignored the return value, potentially leading to response
packets being lost.

Committed by: Nilay Vaish <nilay@cs.wisc.edu>

10 years agoconfig: topologies: slight code refactor
Nilay Vaish [Mon, 24 Feb 2014 01:16:15 +0000 (19:16 -0600)]
config: topologies: slight code refactor

10 years agoruby: message buffer: refactor code
Nilay Vaish [Mon, 24 Feb 2014 01:16:15 +0000 (19:16 -0600)]
ruby: message buffer: refactor code
Code in two of the functions was exactly the same.  This patch moves
this code to a new function which is called from the two functions
mentioned initially.

10 years agoruby: remove few not required #includes
Nilay Vaish [Mon, 24 Feb 2014 01:16:15 +0000 (19:16 -0600)]
ruby: remove few not required #includes

10 years agoruby: slicc: remove unused COPY_HEAD functionality
Nilay Vaish [Mon, 24 Feb 2014 01:16:15 +0000 (19:16 -0600)]
ruby: slicc: remove unused COPY_HEAD functionality

10 years agoruby: protocols: remove unused action z_stall
Nilay Vaish [Mon, 24 Feb 2014 01:16:15 +0000 (19:16 -0600)]
ruby: protocols: remove unused action z_stall

10 years agoconfig: ruby_random_test: updates due to recent unrelated changes
Nilay Vaish [Fri, 21 Feb 2014 14:02:06 +0000 (08:02 -0600)]
config: ruby_random_test: updates due to recent unrelated changes

10 years agoruby: network: move message buffers to base network class.
Nilay Vaish [Fri, 21 Feb 2014 14:02:05 +0000 (08:02 -0600)]
ruby: network: move message buffers to base network class.

10 years agoruby: network: garnet: fixed: removes net_ptr from links
Nilay Vaish [Fri, 21 Feb 2014 14:02:04 +0000 (08:02 -0600)]
ruby: network: garnet: fixed: removes net_ptr from links

10 years agoruby: cache: remove not required variable m_cache_name
Nilay Vaish [Fri, 21 Feb 2014 14:02:02 +0000 (08:02 -0600)]
ruby: cache: remove not required variable m_cache_name

10 years agoruby: network: garnet: fixed: removes next cycle functions
Nilay Vaish [Thu, 20 Feb 2014 23:28:01 +0000 (17:28 -0600)]
ruby: network: garnet: fixed: removes next cycle functions
At several places, there are functions that take a cycle value as input
and performs some computation.  Along with each such function, another
function was being defined that simply added one more cycle to input and
computed the same function.  This patch removes this second copy of the
function.  Places where these functions were being called have been updated
to use the original function with argument being current cycle + 1.

10 years agoruby: controller: slight code refactoring
Nilay Vaish [Thu, 20 Feb 2014 23:27:45 +0000 (17:27 -0600)]
ruby: controller: slight code refactoring

10 years agoruby: mesi three level: rename incorrectly named files
Nilay Vaish [Thu, 20 Feb 2014 23:27:17 +0000 (17:27 -0600)]
ruby: mesi three level: rename incorrectly named files
Two files had been incorrectly named with a .cache suffix.

--HG--
rename : src/mem/protocol/MESI_Three_Level-L0.cache => src/mem/protocol/MESI_Three_Level-L0cache.sm
rename : src/mem/protocol/MESI_Three_Level-L1.cache => src/mem/protocol/MESI_Three_Level-L1cache.sm

10 years agoruby: network: removes unused code.
Nilay Vaish [Thu, 20 Feb 2014 23:27:07 +0000 (17:27 -0600)]
ruby: network: removes unused code.

10 years agoruby: slicc: slight code refactoring
Nilay Vaish [Thu, 20 Feb 2014 23:26:49 +0000 (17:26 -0600)]
ruby: slicc: slight code refactoring

10 years agoruby: message buffer: removes some unecessary functions.
Nilay Vaish [Thu, 20 Feb 2014 23:26:41 +0000 (17:26 -0600)]
ruby: message buffer: removes some unecessary functions.

10 years agokvm: Add support for multi-system simulation
Andreas Sandberg [Thu, 20 Feb 2014 14:43:53 +0000 (15:43 +0100)]
kvm: Add support for multi-system simulation

The introduction of parallel event queues added most of the support
needed to run multiple VMs (systems) within the same gem5
instance. This changeset fixes up signal delivery so that KVM's
control signals are delivered to the thread that executes the CPU's
event queue. Specifically:

  * Timers and counters are now initialized from a separate method
    (startupThread) that is scheduled as the first event in the
    thread-specific event queue. This ensures that they are
    initialized from the thread that is going to execute the CPUs
    event queue and enables signal delivery to the right thread when
    exiting from KVM.

  * The POSIX-timer-based KVM timer (used to force exits from KVM) has
    been updated to deliver signals to the thread that's executing KVM
    instead of the process (thread is undefined in that case). This
    assumes that the timer is instantiated from the thread that is
    going to execute the KVM vCPU.

  * Signal masking is now done using pthread_sigmask instead of
    sigprocmask. The behavior of the latter is undefined in threaded
    applications.

  * Since signal masks can be inherited, make sure to actively unmask
    the control signals when setting up the KVM signal mask.

There are currently no facilities to multiplex between multiple KVM
CPUs in the same event queue, we are therefore limited to
configurations where there is only one KVM CPU per event queue. In
practice, this means that multi-system configurations can be
simulated, but not multiple CPUs in a shared-memory configuration.

10 years agoarm: Bump stats after FS config script update
Andreas Hansson [Wed, 19 Feb 2014 12:59:46 +0000 (07:59 -0500)]
arm: Bump stats after FS config script update

This patch updates the stats to reflect the change in kernel options
needed for armv8 (but used for all FS regressions).

10 years agoarm: armv8 boot options to enable v8
Anthony Gutierrez [Tue, 18 Feb 2014 22:20:56 +0000 (17:20 -0500)]
arm: armv8 boot options to enable v8

Modifies FSConfig.py to enable ARMv8 compatibility.
To boot gem5 with ARMv8:
   Download the v8 kernel, .dtb file, and root FS from: http://gem5.org/Download
   Download the ARMv8 toolchain, and add the bin dir to your path:
       http://www.linaro.org/engineering/engineering-projects/armv8
   Build gem5 for ARM
   Build the v8 bootloader (in gem5/system/arm/aarch64_bootloader)
   Make script in gem5/system/arm/aarch64_bootloader will require v8 toolchain,
   drop the produced boot_emm.arm64 in $(M5_PATH)/binaries/
Run:
   $ build/ARM/gem5.fast configs/example/fs.py --machine-type=VExpress_EMM64 \
     --kernel=/path/to/kernel/vmlinux-linaro-tracking \
     --dtb-filename=/path/to/dtb/rtsm_ve-aemv8a.dtb \
     --disk-image=/path/to/img/linaro-minimal-armv8.img

10 years agomem: Fix bug in PhysicalMemory use of mmap and munmap
Andreas Hansson [Tue, 18 Feb 2014 10:51:01 +0000 (05:51 -0500)]
mem: Fix bug in PhysicalMemory use of mmap and munmap

This patch fixes a bug in how physical memory used to be mapped and
unmapped. Previously we unmapped and re-mapped if restoring from a
checkpoint. However, we never checked that the new mapping was
actually the same, it was just magically working as the OS seems to
fairly reliably give us the same chunk back. This patch fixes this
issue by relying entirely on the mmap call in the constructor.

10 years agodev: Include basic devices in NULL ISA build
Andreas Hansson [Tue, 18 Feb 2014 10:50:59 +0000 (05:50 -0500)]
dev: Include basic devices in NULL ISA build

This patch enbles use of the basic PIO devices as part of the NULL
build. Although it might seem counter intuitive to have a PIO device
without being able to execute a driver, this change enables us to
break a device class hierarchy into an ISA-agnostic part, and an
ISA-specific part, without requiring multiple-inheritance. The
ISA-agnostic base class is a PIO device, but does not make use of the
port.

10 years agoscons: Add PROTOC from the environment
Andreas Hansson [Tue, 18 Feb 2014 10:50:58 +0000 (05:50 -0500)]
scons: Add PROTOC from the environment

This patch adds PROTOC to the build environment.

10 years agomem: Filter cache snoops based on address ranges
Andreas Hansson [Tue, 18 Feb 2014 10:50:58 +0000 (05:50 -0500)]
mem: Filter cache snoops based on address ranges

This patch adds a filter to the cache to drop snoop requests that are
not for a range covered by the cache. This fixes an issue observed
when multiple caches are placed in parallel, covering different
address ranges. Without this patch, all the caches will forward the
snoop upwards, when only one should do so.

10 years agomem: Add a wrapped DRAMSim2 memory controller
Andreas Hansson [Tue, 18 Feb 2014 10:50:53 +0000 (05:50 -0500)]
mem: Add a wrapped DRAMSim2 memory controller

This patch adds DRAMSim2 as a memory controller by wrapping the
external library and creating a sublass of AbstractMemory that bridges
between the semantics of gem5 and the DRAMSim2 interface.

The DRAMSim2 wrapper extracts the clock period from the config
file. There is no way of extracting this information from DRAMSim2
itself, so we simply read the same config file and get it from there.

To properly model the response queue, the wrapper keeps track of how
many transactions are in the actual controller, and how many are
stacking up waiting to be sent back as responses (in the wrapper). The
latter requires us to move away from the queued port and manage the
packets ourselves. This is due to DRAMSim2 not having any flow control
on the response path.

DRAMSim2 assumes that the transactions it is given are matching the
burst size of the choosen memory. The wrapper checks to ensure the
cache line size of the system matches the burst size of DRAMSim2 as
there are currently no provisions to split the system requests. In
theory we could allow a cache line size smaller than the burst size,
but that would lead to inefficient use of the DRAM, so for not we
fatal also in this case.

10 years agoutil: Enhance the error messages for packet encode/decode
Andreas Hansson [Tue, 18 Feb 2014 10:50:52 +0000 (05:50 -0500)]
util: Enhance the error messages for packet encode/decode

This patch adds a more verbose error message when the Python protobuf
module cannot be loaded.

10 years agomem: Fix input to DPRINTF in CommMonitor
Andreas Hansson [Tue, 18 Feb 2014 10:50:51 +0000 (05:50 -0500)]
mem: Fix input to DPRINTF in CommMonitor

Minor fix of the debug message parameters.

10 years agostats: updates due to branch predictor warming
Nilay Vaish [Sun, 16 Feb 2014 17:40:34 +0000 (11:40 -0600)]
stats: updates due to branch predictor warming

10 years agoAdded tag stable_2014_02_15 to the changeset 459491344fcf
Nilay Vaish [Sat, 15 Feb 2014 18:44:09 +0000 (12:44 -0600)]
Added tag stable_2014_02_15 to the changeset 459491344fcf

10 years agocpu: simple: Add support for using branch predictors
Andreas Sandberg [Sun, 9 Feb 2014 19:49:28 +0000 (20:49 +0100)]
cpu: simple: Add support for using branch predictors

This changesets adds branch predictor support to the
BaseSimpleCPU. The simple CPUs normally don't need a branch predictor,
however, there are at least two cases where it can be desirable:

  1) A simple CPU can be used to warm the branch predictor of an O3
     CPU before switching to the slower O3 model.

  2) The simple CPU can be used as a quick way of evaluating/debugging
     new branch predictors since it exposes branch predictor
     statistics.

Limitations:
  * Since the simple CPU doesn't speculate, only one instruction will
    be active in the branch predictor at a time (i.e., the branch
    predictor will never see speculative branches).

  * The outcome of a branch prediction does not affect the performance
    of the simple CPU.

10 years agobase: calls abort() from fatal
Nilay Vaish [Thu, 6 Feb 2014 22:30:13 +0000 (16:30 -0600)]
base: calls abort() from fatal
Currently fatal() ends the simulation in a normal fashion.  This results in
the call stack getting lost when using a debugger and it is not always
possible to debug the simulation just from the information provided by the
printed error message.  Even though the error is likely due to a user's fault,
the information available should not be thrown away.  Hence, this patch to
call abort() from fatal().

10 years agoruby: memory controller: use MemoryNode *
Nilay Vaish [Thu, 6 Feb 2014 22:30:12 +0000 (16:30 -0600)]
ruby: memory controller: use MemoryNode *

10 years agox86: Fix x87 state transfer bug
Andreas Sandberg [Wed, 5 Feb 2014 13:08:13 +0000 (14:08 +0100)]
x86: Fix x87 state transfer bug

Changeset 7274310be1bb (isa: clean up register constants) increased
the value of NumFloatRegs, which triggered a bug in
X86ISA::copyRegs(). This bug is caused by the x87 stack being copied
twice since register indexes past NUM_FLOATREGS are mapped into the
x87 stack relative to the top of the stack, which is undefined when
the copy takes place.

This changeset updates the copyRegs() function to use access registers
using the non-flattening interface, which guarantees that undesirable
register folding does not happen.

10 years agox86, kvm: Fix bug in the RFlags get and set functions
Nikos Nikoleris [Sun, 2 Feb 2014 15:37:35 +0000 (16:37 +0100)]
x86, kvm: Fix bug in the RFlags get and set functions

The getRFlags and setRFlags utility functions were not updated
correctly when condition registers were separated into their own
register class. This lead to incorrect state transfer in calls from
kvm into the simulator (e.g., m5 readfile ended up in an infinite
loop) and when switching CPUs. This patch makes these utility
functions use getCCReg and setCCReg instead of getIntReg and setIntReg
which read and write the integer registers.

Reviewed-by: Andreas Sandberg <andreas@sandberg.pp.se>
10 years agoconfig: correct bug in x86 drive sys instantiation
Nilay Vaish [Fri, 31 Jan 2014 21:35:45 +0000 (15:35 -0600)]
config: correct bug in x86 drive sys instantiation

10 years agounittest: Fix build errors
Ola Jeppsson [Thu, 30 Jan 2014 18:21:58 +0000 (12:21 -0600)]
unittest: Fix build errors

Committed by: Nilay Vaish <nilay@cs.wisc.edu>

10 years agomem: Add additional tolerance to stride prefetcher
Mitch Hayenga [Thu, 30 Jan 2014 05:21:26 +0000 (23:21 -0600)]
mem: Add additional tolerance to stride prefetcher
Forces the prefetcher to mispredict twice in a row before resetting the
confidence of prefetching.  This helps cases where a load PC strides by a
constant factor, however it may operate on different arrays at times.
Avoids the cost of retraining.  Primarily helps with small iteration loops.

Committed by: Nilay Vaish <nilay@cs.wisc.edu>

10 years agomem: Allowed tagged instruction prefetching in stride prefetcher
Mitch Hayenga [Thu, 30 Jan 2014 05:21:26 +0000 (23:21 -0600)]
mem: Allowed tagged instruction prefetching in stride prefetcher
For systems with a tightly coupled L2, a stride-based prefetcher may observe
access requests from both instruction and data L1 caches.  However, the PC
address of an instruction miss gives no relevant training information to the
stride based prefetcher(there is no stride to train).  In theses cases, its
better if the L2 stride prefetcher simply reverted back to a simple N-block
ahead prefetcher.  This patch enables this option.

Committed by: Nilay Vaish <nilay@cs.wisc.edu>

10 years agomem: prefetcher: add options, support for unaligned addresses
Mitch Hayenga ext:(%2C%20Amin%20Farmahini%20%3Caminfar%40gmail.com%3E) [Thu, 30 Jan 2014 05:21:25 +0000 (23:21 -0600)]
mem: prefetcher: add options, support for unaligned addresses

This patch extends the classic prefetcher to work on non-block aligned
addresses.  Because the existing prefetchers in gem5 mask off the lower
address bits of cache accesses, many predictable strides fail to be
detected.  For example, if a load were to stride by 48 bytes, with 64 byte
cachelines, the current stride based prefetcher would see an access pattern
of 0, 64, 64, 128, 192.... Thus not detecting a constant stride pattern.  This
patch fixes this, by training the prefetcher on access and not masking off the
lower address bits.

It also adds the following configuration options:
1) Training/prefetching only on cache misses,
2) Training/prefetching only on data acceses,
3) Optionally tagging prefetches with a PC address.
#3 allows prefetchers to train off of prefetch requests in systems with
multiple cache levels and PC-based prefetchers present at multiple levels.
It also effectively allows a pipelining of prefetch requests (like in POWER4)
across multiple levels of cache hierarchy.

Improves performance on my gem5 configuration by 4.3% for SPECINT and 4.7%  for SPECFP (geomean).

10 years agocpu: fix bug when TrafficGen deschedules event
Xiangyu Dong [Thu, 30 Jan 2014 04:35:04 +0000 (22:35 -0600)]
cpu: fix bug when TrafficGen deschedules event

Committed by: Nilay Vaish <nilay@cs.wisc.edu>

10 years agoarm: Enable umask syscall in SE mode
Mitch Hayenga [Wed, 29 Jan 2014 00:00:51 +0000 (18:00 -0600)]
arm: Enable umask syscall in SE mode

Committed by: Nilay Vaish <nilay@cs.wisc.edu>

10 years agobase: Fix race condition in the socket listen function
Mitch Hayenga [Wed, 29 Jan 2014 00:00:51 +0000 (18:00 -0600)]
base: Fix race condition in the socket listen function

gem5 makes the incorrect assumption that by binding a socket, it
effectively has allocated a port. Linux only allocates ports once you call
listen on the given socket, not when you call bind.  So even if the port was
free when bind was called, another process (gem5 instance) could race in
between the bind & listen calls and steal the port. In the current code, if
the call to bind fails due to the port being in use (EADDRINUSE), gem5 retries
for a different port.  However if listen fails, gem5 just panics. The fix is
testing the return value of listen and re-trying if it was due to EADDRINUSE.

Committed by: Nilay Vaish <nilay@cs.wisc.edu>

10 years agomem: Remove redundant findVictim() input argument
Amin Farmahini [Wed, 29 Jan 2014 00:00:50 +0000 (18:00 -0600)]
mem: Remove redundant findVictim() input argument
The patch
(1) removes the redundant writeback argument from findVictim()
(2) fixes the description of access() function

Committed by: Nilay Vaish <nilay@cs.wisc.edu>

10 years agomem: Fixes a bug in simple_dram write merging
Amin Farmahini [Wed, 29 Jan 2014 00:00:49 +0000 (18:00 -0600)]
mem: Fixes a bug in simple_dram write merging
Fixes updating the value of size in the write merge function.

Committed by: Nilay Vaish <nilay@cs.wisc.edu>

10 years agox86: add a warning about the number of memory controllers
Nilay Vaish [Tue, 28 Jan 2014 13:15:53 +0000 (07:15 -0600)]
x86: add a warning about the number of memory controllers
When memory size > 3GB, print a warning that twice the number of memory
controllers would be created.

10 years agox86: use lfpimm instead of limm for fptan
Nilay Vaish [Tue, 28 Jan 2014 00:50:54 +0000 (18:50 -0600)]
x86: use lfpimm instead of limm for fptan

10 years agox86: implements x87 add/sub instructions
Nilay Vaish [Tue, 28 Jan 2014 00:50:53 +0000 (18:50 -0600)]
x86: implements  x87 add/sub instructions

10 years agox86: implements fxch instruction.
Nilay Vaish [Tue, 28 Jan 2014 00:50:52 +0000 (18:50 -0600)]
x86: implements fxch instruction.

10 years agox86: correct error in emms instruction.
Nilay Vaish [Tue, 28 Jan 2014 00:50:51 +0000 (18:50 -0600)]
x86: correct error in emms instruction.

10 years agoconfig: allow more than 3GB of memory for x86 simulations
Nilay Vaish [Tue, 28 Jan 2014 00:50:51 +0000 (18:50 -0600)]
config: allow more than 3GB of memory for x86 simulations
This patch edits the configuration files so that x86 simulations can have
more than 3GB of memory.  It also corrects a bug in the MemConfig.py script.

10 years agostats: update sparc fs stats
Nilay Vaish [Mon, 27 Jan 2014 19:30:37 +0000 (13:30 -0600)]
stats: update sparc fs stats

10 years agostats: update eio stats for recent changes
Steve Reinhardt [Mon, 27 Jan 2014 05:38:58 +0000 (00:38 -0500)]
stats: update eio stats for recent changes

10 years agostats: update stats for ARMv8 changes
Ali Saidi [Fri, 24 Jan 2014 21:29:34 +0000 (15:29 -0600)]
stats: update stats for ARMv8 changes

10 years agoarm: Add support for ARMv8 (AArch64 & AArch32)
ARM gem5 Developers [Fri, 24 Jan 2014 21:29:34 +0000 (15:29 -0600)]
arm: Add support for ARMv8 (AArch64 & AArch32)

Note: AArch64 and AArch32 interworking is not supported. If you use an AArch64
kernel you are restricted to AArch64 user-mode binaries. This will be addressed
in a later patch.

Note: Virtualization is only supported in AArch32 mode. This will also be fixed
in a later patch.

Contributors:
Giacomo Gabrielli    (TrustZone, LPAE, system-level AArch64, AArch64 NEON, validation)
Thomas Grocutt       (AArch32 Virtualization, AArch64 FP, validation)
Mbou Eyole           (AArch64 NEON, validation)
Ali Saidi            (AArch64 Linux support, code integration, validation)
Edmund Grimley-Evans (AArch64 FP)
William Wang         (AArch64 Linux support)
Rene De Jong         (AArch64 Linux support, performance opt.)
Matt Horsnell        (AArch64 MP, validation)
Matt Evans           (device models, code integration, validation)
Chris Adeniyi-Jones  (AArch64 syscall-emulation)
Prakash Ramrakhyani  (validation)
Dam Sunwoo           (validation)
Chander Sudanthi     (validation)
Stephan Diestelhorst (validation)
Andreas Hansson      (code integration, performance opt.)
Eric Van Hensbergen  (performance opt.)
Gabe Black

10 years agostats: update stats for cache occupancy and clock domain changes
Ali Saidi [Fri, 24 Jan 2014 21:29:33 +0000 (15:29 -0600)]
stats: update stats for cache occupancy and clock domain changes

10 years agoarch: Make all register index flattening const
Andreas Hansson [Fri, 24 Jan 2014 21:29:30 +0000 (15:29 -0600)]
arch: Make all register index flattening const

This patch makes all the register index flattening methods const for
all the ISAs. As part of this, readMiscRegNoEffect for ARM is also
made const.

10 years agochecker: CheckerCPU handling of MiscRegs was incorrect
Geoffrey Blake [Fri, 24 Jan 2014 21:29:30 +0000 (15:29 -0600)]
checker: CheckerCPU handling of MiscRegs was incorrect

The CheckerCPU model in pre-v8 code was not checking the
updates to miscellaneous registers due to some methods
for setting misc regs were not instrumented.  The v8 patches
exposed this by calling the instrumented misc reg update
methods and then invoking the checker before the main CPU had
updated its misc regs, leading to false positives about
register mismatches. This patch fixes the non-instrumented
misc reg update methods and places calls to the checker in
the proper places in the O3 model.

10 years agoarch, cpu: Add support for flattening misc register indexes.
Ali Saidi [Fri, 24 Jan 2014 21:29:30 +0000 (15:29 -0600)]
arch, cpu: Add support for flattening misc register indexes.

With ARMv8 support the same misc register id  results in accessing different
registers depending on the current mode of the processor. This patch adds
the same orthogonality to the misc register file as the others (int, float, cc).
For all the othre ISAs this is currently a null-implementation.

Additionally, a system variable is added to all the ISA objects.

10 years agocpu: Add support for Memory+Barrier instruction types in O3 cpu.
Giacomo Gabrielli [Fri, 24 Jan 2014 21:29:30 +0000 (15:29 -0600)]
cpu: Add support for Memory+Barrier instruction types in O3 cpu.

10 years agocpu: Add support for instructions that zero cache lines.
Ali Saidi [Fri, 24 Jan 2014 21:29:30 +0000 (15:29 -0600)]
cpu: Add support for instructions that zero cache lines.

10 years agocpu: Add CPU support for generatig wake up events when LLSC adresses are snooped.
Ali Saidi [Fri, 24 Jan 2014 21:29:30 +0000 (15:29 -0600)]
cpu: Add CPU support for generatig wake up events when LLSC adresses are snooped.

This patch add support for generating wake-up events in the CPU when an address
that is currently in the exclusive state is hit by a snoop. This mechanism is required
for ARMv8 multi-processor support.

10 years agomem: Add flag to request if it was generated by a page table walk
Giacomo Gabrielli [Fri, 24 Jan 2014 21:29:30 +0000 (15:29 -0600)]
mem: Add  flag to request if it was generated by a page table walk

10 years agomem: Add support for a security bit in the memory system
Giacomo Gabrielli [Fri, 24 Jan 2014 21:29:30 +0000 (15:29 -0600)]
mem: Add support for a security bit in the memory system

This patch adds the basic building blocks required to support e.g. ARM
TrustZone by discerning secure and non-secure memory accesses.

10 years agosim: Add openat/fstatat syscalls and fix mremap
Chris Adeniyi-Jones [Fri, 24 Jan 2014 21:29:30 +0000 (15:29 -0600)]
sim: Add openat/fstatat syscalls and fix mremap

This patch adds support for the openat and fstatat syscalls and
broadens the support for mremap to make it work on OS X.

10 years agomem: Remove explict cast from memhelper.
Ali Saidi [Fri, 24 Jan 2014 21:29:30 +0000 (15:29 -0600)]
mem: Remove explict cast from memhelper.

Previously we were casting the result type to the the memory type which
is incorrect for things like dual-memory operations which still return a
single result.

10 years agoCache: Collect very basic stats on tag and data accesses
Timothy M. Jones [Fri, 24 Jan 2014 21:29:30 +0000 (15:29 -0600)]
Cache: Collect very basic stats on tag and data accesses

Adds very basic statistics on the number of tag and data accesses within the
cache, which is important for power modelling.  For the tags, simply count
the associativity of the cache each time.  For the data, this depends on
whether tags and data are accessed sequentially, which is given by a new
parameter.  In the parallel case, all data blocks are accessed each time, but
with sequential accesses, a single data block is accessed only on a hit.

10 years agomem: per-thread cache occupancy and per-block ages
Dam Sunwoo [Fri, 24 Jan 2014 21:29:30 +0000 (15:29 -0600)]
mem: per-thread cache occupancy and per-block ages

This patch enables tracking of cache occupancy per thread along with
ages (in buckets) per cache blocks.  Cache occupancy stats are
recalculated on each stat dump.