gem5.git
11 years agomem: Merge ranges in bus before passing them on
Andreas Hansson [Fri, 1 Mar 2013 18:20:19 +0000 (13:20 -0500)]
mem: Merge ranges in bus before passing them on

This patch adds basic merging of address ranges to the bus, such that
interleaved ranges are merged together before being passed on by the
bus. As such, the bus aggregates the address ranges of the connected
slave ports and then passes on the merged ranges through its master
ports. The bus thus hides the complexity of the interleaved ranges and
only exposes contigous ranges to the surrounding system.

As part of this patch, the bus ranges are also cached for any future
queries.

11 years agoruby: mesi coherence protocol: invalidate lock
Dibakar Gope ext:(%2C%20Nilay%20Vaish%20%3Cnilay%40cs.wisc.edu%3E) [Thu, 28 Feb 2013 16:04:26 +0000 (10:04 -0600)]
ruby: mesi coherence protocol: invalidate lock
The MESI CMP directory coherence protocol, while transitioning from SM to IM,
did not invalidate the lock that it might have taken on a cache line. This
patch adds an action for doing so.

The problem was found by Dibakar, but I was not happy with his proposed
solution. So I implemented a different solution.

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

11 years agoconfig: Fix --prog-interval command line option
Ali Saidi [Wed, 20 Feb 2013 13:18:22 +0000 (08:18 -0500)]
config: Fix --prog-interval command line option

11 years agoslicc: remove unused variable message_buffer_names
Nilay Vaish [Wed, 20 Feb 2013 04:58:51 +0000 (22:58 -0600)]
slicc: remove unused variable message_buffer_names

11 years agoruby: remove unused variable m_print_config in class Topology
Nilay Vaish [Wed, 20 Feb 2013 04:58:50 +0000 (22:58 -0600)]
ruby: remove unused variable m_print_config in class Topology

11 years agomem: Fix sender state bug and delay popping
Andreas Hansson [Tue, 19 Feb 2013 17:57:47 +0000 (12:57 -0500)]
mem: Fix sender state bug and delay popping

This patch fixes a newly introduced bug where the sender state was
popped before checking that it should be. Amazingly all regressions
pass, but Linux fails to boot on the detailed CPU with caches enabled.

11 years agostats: more zizzer stats fun
Ali Saidi [Tue, 19 Feb 2013 14:53:07 +0000 (09:53 -0500)]
stats: more zizzer stats fun

11 years agoscons: Fix warnings issued by clang 3.2svn (XCode 4.6)
Andreas Hansson [Tue, 19 Feb 2013 10:56:08 +0000 (05:56 -0500)]
scons: Fix warnings issued by clang 3.2svn (XCode 4.6)

This patch fixes the warnings that clang3.2svn emit due to the "-Wall"
flag. There is one case of an uninitialised value in the ARM neon ISA
description, and then a whole range of unused private fields that are
pruned.

11 years agoscons: Unify the flags shared by gcc and clang
Andreas Hansson [Tue, 19 Feb 2013 10:56:07 +0000 (05:56 -0500)]
scons: Unify the flags shared by gcc and clang

This patch restructures and unifies the flags used by gcc and clang as
they are largely the same. The common parts are now dealt with in a
shared block of code, and the few bits and pieces that are
specifically affecting either gcc or clang are done separately.

11 years agoscons: Add warning delete with non-virtual destructor
Andreas Hansson [Tue, 19 Feb 2013 10:56:07 +0000 (05:56 -0500)]
scons: Add warning delete with non-virtual destructor

This patch enables a warning for deleting derived classes that do not
have a virtual destructor. The patch merely adds additional checks,
and there are currently no cases that had to be fixed.

11 years agoscons: Add warning for missing declarations
Andreas Hansson [Tue, 19 Feb 2013 10:56:07 +0000 (05:56 -0500)]
scons: Add warning for missing declarations

This patch enables warnings for missing declarations. To avoid issues
with SWIG-generated code, the warning is only applied to non-SWIG
code.

11 years agoscons: Add warning for overloaded virtual functions
Andreas Hansson [Tue, 19 Feb 2013 10:56:07 +0000 (05:56 -0500)]
scons: Add warning for overloaded virtual functions

Fix the ISA startup warnings

11 years agoscons: Add warning for overloaded virtual functions
Andreas Hansson [Tue, 19 Feb 2013 10:56:06 +0000 (05:56 -0500)]
scons: Add warning for overloaded virtual functions

A derived function with a different signature than a base class
function will result in the base class function of the same name being
hidden. The parameter list and return type for the member function in
the derived class must match those of the member function in the base
class, otherwise the function in the derived class will hide the
function in the base class and no polymorphic behaviour will occur.

This patch addresses these warnings by ensuring a unique function name
to avoid (unintentionally) hiding any functions.

11 years agoscons: Add warning for missing field initializers
Andreas Hansson [Tue, 19 Feb 2013 10:56:06 +0000 (05:56 -0500)]
scons: Add warning for missing field initializers

This patch adds a warning for missing field initializers for both gcc
and clang, and addresses the warnings that were generated.

11 years agoscons: Fix up numerous warnings about name shadowing
Andreas Hansson [Tue, 19 Feb 2013 10:56:06 +0000 (05:56 -0500)]
scons: Fix up numerous warnings about name shadowing

This patch address the most important name shadowing warnings (as
produced when using gcc/clang with -Wshadow). There are many
locations where constructor parameters and function parameters shadow
local variables, but these are left unchanged.

11 years agomem: Enforce strict use of busFirst- and busLastWordTime
Andreas Hansson [Tue, 19 Feb 2013 10:56:06 +0000 (05:56 -0500)]
mem: Enforce strict use of busFirst- and busLastWordTime

This patch adds a check to ensure that the delay incurred by
the bus is not simply disregarded, but accounted for by someone. At
this point, all the modules do is to zero it out, and no additional
time is spent. This highlights where the bus timing is simply dropped
instead of being paid for.

As a follow up, the locations identified in this patch should add this
additional time to the packets in one way or another. For now it
simply acts as a sanity check and highlights where the delay is simply
ignored.

Since no time is added, all regressions remain the same.

11 years agomem: Change accessor function names to match the port interface
Andreas Hansson [Tue, 19 Feb 2013 10:56:06 +0000 (05:56 -0500)]
mem: Change accessor function names to match the port interface

This patch changes the names of the cache accessor functions to be in
line with those used by the ports. This is done to avoid confusion and
get closer to a one-to-one correspondence between the interface of the
memory object (the cache in this case) and the port itself.

The member function timingAccess has been split into a snoop/non-snoop
part to avoid branching on the isResponse() of the packet.

11 years agomem: Make packet bus-related time accounting relative
Andreas Hansson [Tue, 19 Feb 2013 10:56:06 +0000 (05:56 -0500)]
mem: Make packet bus-related time accounting relative

This patch changes the bus-related time accounting done in the packet
to be relative. Besides making it easier to align the cache timing to
cache clock cycles, it also makes it possible to create a Last-Level
Cache (LLC) directly to a memory controller without a bus inbetween.

The bus is unique in that it does not ever make the packets wait to
reflect the time spent forwarding them. Instead, the cache is
currently responsible for making the packets wait. Thus, the bus
annotates the packets with the time needed for the first word to
appear, and also the last word. The cache then delays the packets in
its queues before passing them on. It is worth noting that every
object attached to a bus (devices, memories, bridges, etc) should be
doing this if we opt for keeping this way of accounting for the bus
timing.

11 years agomem: Add deferred packet class to prefetcher
Andreas Hansson [Tue, 19 Feb 2013 10:56:06 +0000 (05:56 -0500)]
mem: Add deferred packet class to prefetcher

This patch removes the time field from the packet as it was only used
by the preftecher. Similar to the packet queue, the prefetcher now
wraps the packet in a deferred packet, which also has a tick
representing the absolute time when the packet should be sent.

11 years agosim: Make clock private and access using clockPeriod()
Andreas Hansson [Tue, 19 Feb 2013 10:56:06 +0000 (05:56 -0500)]
sim: Make clock private and access using clockPeriod()

This patch makes the clock member private to the ClockedObject and
forces all children to access it using clockPeriod(). This makes it
impossible to inadvertently change the clock, and also makes it easier
to transition to a situation where the clock is derived from e.g. a
clock domain, or through a multiplier.

11 years agox86: Move APIC clock divider to Python
Andreas Hansson [Tue, 19 Feb 2013 10:56:06 +0000 (05:56 -0500)]
x86: Move APIC clock divider to Python

This patch moves the 16x APIC clock divider to the Python code to
avoid the post-instantiation modifications to the clock. The x86 APIC
was the only object setting the clock after creation time and this
required some custom functionality and configuration. With this patch,
the clock multiplier is moved to the Python code and the objects are
instantiated with the appropriate clock.

11 years agomem: Fix SenderState related cache deadlock
Sascha Bischoff [Tue, 19 Feb 2013 10:56:06 +0000 (05:56 -0500)]
mem: Fix SenderState related cache deadlock

This patch fixes a potential deadlock in the caches. This deadlock
could occur when more than one cache is used in a system, and
pkt->senderState is modified in between the two caches. This happened
as the caches relied on the senderState remaining unchanged, and used
it for instantaneous upstream communication with other caches.

This issue has been addressed by iterating over the linked list of
senderStates until we are either able to cast to a MSHR* or
senderState is NULL. If the cast is successful, we know that the
packet has previously passed through another cache, and therefore
update the downstreamPending flag accordingly. Otherwise, we do
nothing.

11 years agomem: Add predecessor to SenderState base class
Andreas Hansson [Tue, 19 Feb 2013 10:56:05 +0000 (05:56 -0500)]
mem: Add predecessor to SenderState base class

This patch adds a predecessor field to the SenderState base class to
make the process of linking them up more uniform, and enable a
traversal of the stack without knowing the specific type of the
subclasses.

There are a number of simplifications done as part of changing the
SenderState, particularly in the RubyTest.

11 years agobase: Fix a bug in the address interleaving
Andreas Hansson [Tue, 19 Feb 2013 10:56:05 +0000 (05:56 -0500)]
base: Fix a bug in the address interleaving

This patch fixes a minor (but important) typo in the matching of an
address to an interleaved range.

11 years agomem: Ensure trace captures packet fields before forwarding
Andreas Hansson [Tue, 19 Feb 2013 10:56:05 +0000 (05:56 -0500)]
mem: Ensure trace captures packet fields before forwarding

This patch fixes a bug in the CommMonitor caused by the packet being
modified before it is captured in the trace. By recording the fields
before passing the packet on, and then putting these values in the
trace we ensure that even if the packet is modified the trace captures
what the CommMonitor saw.

11 years agooptions: add command line option for dtb file
Anthony Gutierrez [Fri, 15 Feb 2013 23:48:59 +0000 (18:48 -0500)]
options: add command line option for dtb file

11 years agoloader: add a flattened device tree blob (dtb) object
Anthony Gutierrez [Fri, 15 Feb 2013 23:48:59 +0000 (18:48 -0500)]
loader: add a flattened device tree blob (dtb) object

this adds a dtb_object so the loader can load in the dtb
file for linux/android ARM kernels.

11 years agoext lib: add libfdt to enable flattened device tree support
Anthony Gutierrez [Fri, 15 Feb 2013 23:48:59 +0000 (18:48 -0500)]
ext lib: add libfdt to enable flattened device tree support

this patch adds libfdt, a library necessary for supporting
flattened device tree support in current and future versions of
the linux/android kernel for ARM.

11 years agostats: update regressions for o3 changes in renaming and translation.
Ali Saidi [Fri, 15 Feb 2013 22:40:14 +0000 (17:40 -0500)]
stats: update regressions for o3 changes in renaming and translation.

11 years agoarm: fix a page table walker issue where a page could be translated multiple times
Mrinmoy Ghosh [Fri, 15 Feb 2013 22:40:10 +0000 (17:40 -0500)]
arm: fix a page table walker issue where a page could be translated multiple times

If multiple memory operations to the same page are miss the TLB they are
all inserted into the page table queue and before this change could result
in multiple uncessesary walks as well as duplicate enteries being inserted
into the TLB.

11 years agocpu: Document exec trace flags
Andreas Sandberg [Fri, 15 Feb 2013 22:40:10 +0000 (17:40 -0500)]
cpu: Document exec trace flags

11 years agodev: Use the correct return type for disk offsets
Andreas Sandberg [Fri, 15 Feb 2013 22:40:10 +0000 (17:40 -0500)]
dev: Use the correct return type for disk offsets

Replace the use of off_t in the various DiskImage related classes with
std::streampos. off_t is a signed 32 bit integer on most 32-bit
systems, whereas std::streampos is normally a 64 bit integer on most
modern systems. Furthermore, std::streampos is the type used by
tellg() and seekg() in the standard library, so it should have been
used in the first place. This patch makes it possible to use disk
images larger than 2 GiB on 32 bit systems with a modern C++ standard
library.

11 years agocpu: Avoid duplicate entries in tracking structures for writes to misc regs
Geoffrey Blake [Fri, 15 Feb 2013 22:40:10 +0000 (17:40 -0500)]
cpu: Avoid duplicate entries in tracking structures for writes to misc regs

setMiscReg currently makes a new entry for each write to a misc reg without
checking for duplicates, this can cause a triggering of the assert if an
instruction get replayed and writes to the same misc regs multiple times.
This fix prevents duplicate entries and instead updates the value.

11 years agocpu: Fix rename mis-handling serializing instructions when resource constrained
Geoffrey Blake [Fri, 15 Feb 2013 22:40:10 +0000 (17:40 -0500)]
cpu: Fix rename mis-handling serializing instructions when resource constrained

The rename can mis-handle serializing instructions (i.e. strex) if it gets
into a resource constrained situation and the serializing instruction has
to be placed on the skid buffer to handle blocking.  In this situation the
instruction informs the pipeline it is serializing and logs that the next
instruction must be serialized, but since we are blocking the pipeline
defers this action to place the serializing instruction and
incoming instructions into the skid buffer. When resuming from blocking,
rename will pull the serializing instruction from the skid buffer and
the current logic will see this as the "next" instruction that has to
be serialized and because of flags set on the serializing instruction,
it passes through the pipeline stage as normal and resets rename to
non-serializing.  This causes instructions to follow the serializing inst
incorrectly and eventually leads to an error in the pipeline. To fix this
rename should check first if it has to block before checking for serializing
instructions.

11 years agoARM: Postpones creation of framebuffer output file until it is actually used.
Chris Emmons [Fri, 15 Feb 2013 22:40:10 +0000 (17:40 -0500)]
ARM: Postpones creation of framebuffer output file until it is actually used.

This delay prevents a potential conflict with the HDLCD if both are in the same
system even if only one is enabled.

11 years agomem: Tighten up cache constness and scoping
Andreas Hansson [Fri, 15 Feb 2013 22:40:10 +0000 (17:40 -0500)]
mem: Tighten up cache constness and scoping

This patch merely adopts a more strict use of const for the cache
member functions and variables, and also moves a large portion of the
member functions from public to protected.

11 years agobase: Add warn() and inform() to m5.utils for use from python
Sascha Bischoff [Fri, 15 Feb 2013 22:40:10 +0000 (17:40 -0500)]
base: Add warn() and inform() to m5.utils for use from python

This patch adds two fuctions to m5.util, warn and inform, which mirror those
found in the C++ side of gem5. These are added in addition to the already
existing m5.util.panic and m5.util.fatal which already mirror the C++
functionality. This ensures that warning and information messages generated
by python are in the same format as those generated by C++.

Occurrences of
    print "Warning: %s..." % name
have been replaced with
    warn("%s...", name)

11 years agoo3: fix tick used for renaming and issue with range selection
Matt Horsnell [Fri, 15 Feb 2013 22:40:09 +0000 (17:40 -0500)]
o3: fix tick used for renaming and issue with range selection

Fixes the tick used from rename:
- previously this gathered the tick on leaving rename which was always 1 less
  than the dispatch. This conflated the decode ticks when back pressure built
  in the pipeline.
- now picks up tick on entry.

Added --store_completions flag:
- will additionally display the store completion tail in the viewer.
- this highlights periods when large numbers of stores are outstanding (>16 LSQ
  blocking)

Allows selection by tick range (previously this caused an infinite loop)

11 years agoarm: Don't export private GIC methods
Andreas Sandberg [Thu, 25 Oct 2012 13:08:29 +0000 (14:08 +0100)]
arm: Don't export private GIC methods

11 years agoarm: Create a GIC base class and make the PL390 derive from it
Andreas Sandberg [Thu, 25 Oct 2012 13:05:24 +0000 (14:05 +0100)]
arm: Create a GIC base class and make the PL390 derive from it

This patch moves the GIC interface to a separate base class and makes
all interrupt devices use that base class instead of a pointer to the
PL390 implementation. This allows us to have multiple GIC
implementations. Future implementations will allow in-kernel GIC
implementations when using hardware virtualization.

--HG--
rename : src/dev/arm/gic.cc => src/dev/arm/gic_pl390.cc
rename : src/dev/arm/gic.hh => src/dev/arm/gic_pl390.hh

11 years agosim: Add a system-global option to bypass caches
Andreas Sandberg [Fri, 15 Feb 2013 22:40:09 +0000 (17:40 -0500)]
sim: Add a system-global option to bypass caches

Virtualized CPUs and the fastmem mode of the atomic CPU require direct
access to physical memory. We currently require caches to be disabled
when using them to prevent chaos. This is not ideal when switching
between hardware virutalized CPUs and other CPU models as it would
require a configuration change on each switch. This changeset
introduces a new version of the atomic memory mode,
'atomic_noncaching', where memory accesses are inserted into the
memory system as atomic accesses, but bypass caches.

To make memory mode tests cleaner, the following methods are added to
the System class:

 * isAtomicMode() -- True if the memory mode is 'atomic' or 'direct'.
 * isTimingMode() -- True if the memory mode is 'timing'.
 * bypassCaches() -- True if caches should be bypassed.

The old getMemoryMode() and setMemoryMode() methods should never be
used from the C++ world anymore.

11 years agocpu: Refactor memory system checks
Andreas Sandberg [Fri, 15 Feb 2013 22:40:08 +0000 (17:40 -0500)]
cpu: Refactor memory system checks

CPUs need to test that the memory system is in the right mode in two
places, when the CPU is initialized (unless it's switched out) and on
a drainResume(). This led to some code duplication in the CPU
models. This changeset introduces the verifyMemoryMode() method which
is called by BaseCPU::init() if the CPU isn't switched out. The
individual CPU models are responsible for calling this method when
resuming from a drain as this code is CPU model specific.

11 years agoconfig: Remove O3 dependencies
Andreas Sandberg [Fri, 15 Feb 2013 22:40:08 +0000 (17:40 -0500)]
config: Remove O3 dependencies

The default cache configuration script currently import the O3_ARM_v7a
model configuration, which depends on the O3 CPU. This breaks if gem5
has been compiled without O3 support. This changeset removes the
dependency by only importing the model if it is requested by the
user. As a bonus, it actually removes some code duplication in the
configuration scripts.

11 years agoconfig: Move CPU handover logic to m5.switchCpus()
Andreas Sandberg [Fri, 15 Feb 2013 22:40:08 +0000 (17:40 -0500)]
config: Move CPU handover logic to m5.switchCpus()

CPU switching consists of the following steps:
 1. Drain the system
 2. Switch out old CPUs (cpu.switchOut())
 3. Change the system timing mode to the mode the new CPUs require
 4. Flush caches if switching to hardware virtualization
 5. Inform new CPUs of the handover (cpu.takeOverFrom())
 6. Resume the system

m5.switchCpus() previously only did step 2 & 5. Since information
about the new processors' memory system requirements is now exposed,
do all of the steps above.

This patch adds automatic memory system switching and flush (if
needed) to switchCpus(). Additionally, it adds optional draining to
switchCpus(). This has the following implications:

* changeToTiming and changeToAtomic are no longer needed, so they have
  been removed.

* changeMemoryMode is only used internally, so it is has been renamed
  to be private.

* switchCpus requires a reference to the system containing the CPUs as
  its first parameter.

WARNING: This changeset breaks compatibility with existing
configuration scripts since it changes the signature of
m5.switchCpus().

11 years agoconfig: Cleanup CPU configuration
Andreas Sandberg [Fri, 15 Feb 2013 22:40:08 +0000 (17:40 -0500)]
config: Cleanup CPU configuration

The CPUs supported by the configuration scripts used to be
hard-coded. This was not ideal for several reasons. For example, the
configuration scripts depend on all CPU models even though only a
subset might have been compiled.

This changeset adds a new module to the configuration scripts that
automatically discovers the available CPU models from the compiled
SimObjects. As a nice bonus, the use of introspection allows us to
automatically generate a list of available CPU models suitable for
printing. This list is augmented with the Python doc string from the
underlying class if available.

11 years agocpu: Make checker CPUs inherit from CheckerCPU in the Python hierarchy
Andreas Sandberg [Fri, 15 Feb 2013 22:40:08 +0000 (17:40 -0500)]
cpu: Make checker CPUs inherit from CheckerCPU in the Python hierarchy

Checker CPUs currently don't inherit from the CheckerCPU in the Python
object hierarchy. This has two consequences:
 * It makes CPU model discovery from the Python world somewhat
   complicated as there is no way of testing if a CPU is a checker.
 * Parameters are duplicated in the checker configuration
   specification.

This changeset makes all checker CPUs inherit from the base checker
CPU class.

11 years agocpu: Add CPU metadata om the Python classes
Andreas Sandberg [Fri, 15 Feb 2013 22:40:08 +0000 (17:40 -0500)]
cpu: Add CPU metadata om the Python classes

The configuration scripts currently hard-code the requirements of each
CPU. This is clearly not optimal as it makes writing new configuration
scripts painful and adding new CPU models requires existing scripts to
be updated. This patch adds the following class methods to the base
CPU and all relevant CPUs:

 * memory_mode -- Return a string describing the current memory mode
                  (invalid/atomic/timing).

 * require_caches -- Does the CPU model require caches?

 * support_take_over -- Does the CPU support CPU handover?

11 years agoarm: fix some fp comparisons that worked by accident.
Ali Saidi [Fri, 15 Feb 2013 22:40:08 +0000 (17:40 -0500)]
arm: fix some fp comparisons that worked by accident.

The explict tests in the follwing fp comparison operations were
incorrect as they checked for only signaling NaNs and not quite-NaNs
as well. When compiled with gcc, the comparison generates a fp exception
that causes the FE_INVALID flag to be set and we check for it, so even
though the check was incorrect, the correct exception was set. With clang
this behavior seems to not occur. The checks are updated to test for nans and
the behavior is now correct with both clang and gcc.

11 years agocpu: include set in o3/commit_impl.
Ali Saidi [Fri, 15 Feb 2013 22:40:08 +0000 (17:40 -0500)]
cpu: include set in o3/commit_impl.

While the majority of compilers seemed to pickup set from else where,
one version of gcc 4.7 complains, so explictly add it.

11 years agoARM: Fix an issue with clang generating wrong code.
Ali Saidi [Fri, 15 Feb 2013 22:40:08 +0000 (17:40 -0500)]
ARM: Fix an issue with clang generating wrong code.

Clang generated executables would enter the if condition when it wasn't
supposted to, resulting in the wrong simulated behavior.
Implementing the operation this way is a bit faster anyway.

11 years agocpu: fix case with o3 cpu blocking and unblocking decode in cycle
Ali Saidi [Fri, 15 Feb 2013 22:40:08 +0000 (17:40 -0500)]
cpu: fix case with o3 cpu blocking and unblocking decode in cycle

Fix a case in the O3 CPU where the decode stage blocks and unblocks in a
single cycle sending both signals to fetch which causes an assert or worse.
The previous check could never work before since the status was set to Blocked
before a test for the status being Unblocking was executed.

11 years agocpu: Fix a livelock in the o3 cpu.
Ali Saidi [Fri, 15 Feb 2013 22:40:07 +0000 (17:40 -0500)]
cpu: Fix a livelock in the o3 cpu.

Check if an instruction just enabled interrupts and we've previously had an
interrupt pending that was not handled because interrupts were subsequently
disabled before the pipeline reached a place to handle the interrupt. In that
case squash now to make sure the interrupt is handled.

11 years agobase: Add support for newer versions of IPython
Andreas Sandberg [Sun, 10 Feb 2013 12:23:58 +0000 (13:23 +0100)]
base: Add support for newer versions of IPython

IPython is used for the interactive gem5 shell if it exists. IPython
made API changes in version 0.11. This patch adds support for IPython
version 0.11 and above.

--HG--
extra : rebase_source : 5388d0919adb58d97f49a1a637db48cba61283a3

11 years agoRuby: Fix compilation errors on gcc 4.7 and clang 3.2
Andreas Hansson [Thu, 14 Feb 2013 17:24:51 +0000 (12:24 -0500)]
Ruby: Fix compilation errors on gcc 4.7 and clang 3.2

This patch fixes a few (recently added) errors that prevented gem5 from
compiling on more recent versions of gcc and clang.

11 years agoregressions: update stats due to changes to ruby
Nilay Vaish [Mon, 11 Feb 2013 03:43:23 +0000 (21:43 -0600)]
regressions: update stats due to changes to ruby

11 years agoruby: MI protocol: add a missing transition
Nilay Vaish [Mon, 11 Feb 2013 03:43:18 +0000 (21:43 -0600)]
ruby: MI protocol: add a missing transition
The transition for state MII and event Store was found missing during testing.
The transition is being added. The controller will not stall the Store request
in state MII

11 years agoruby: enable multiple clock domains
Nilay Vaish [Mon, 11 Feb 2013 03:43:17 +0000 (21:43 -0600)]
ruby: enable multiple clock domains
This patch allows ruby to have multiple clock domains. As I understand
with this patch, controllers can have different frequencies. The entire
network needs to run at a single frequency.

The idea is that with in an object, time is treated in terms of cycles.
But the messages that are passed from one entity to another should contain
the time in Ticks. As of now, this is only true for the message buffers,
but not for the links in the network. As I understand the code, all the
entities in different networks (simple, garnet-fixed, garnet-flexible) should
be clocked at the same frequency.

Another problem is that the directory controller has to operate at the same
frequency as the ruby system. This is because the memory controller does
not make use of the Message Buffer, and instead implements a buffer of its
own. So, it has no idea of the frequency at which the directory controller
is operating and uses ruby system's frequency for scheduling events.

11 years agoruby: replace Time with Cycles (final patch in the series)
Nilay Vaish [Mon, 11 Feb 2013 03:43:10 +0000 (21:43 -0600)]
ruby: replace Time with Cycles (final patch in the series)
This patch is as of now the final patch in the series of patches that replace
Time with Cycles.This patch further replaces Time with Cycles in Sequencer,
Profiler, different protocols and related entities.

Though Time has not been completely removed, the places where it is in use
seem benign as of now.

11 years agoruby: replace Time with Cycles in garnet fixed and flexible
Nilay Vaish [Mon, 11 Feb 2013 03:43:09 +0000 (21:43 -0600)]
ruby: replace Time with Cycles in garnet fixed and flexible

11 years agoruby: replace Time with Tick in replacement policy classes
Nilay Vaish [Mon, 11 Feb 2013 03:43:08 +0000 (21:43 -0600)]
ruby: replace Time with Tick in replacement policy classes

11 years agoruby: convert block size, memory size to unsigned
Nilay Vaish [Mon, 11 Feb 2013 03:43:07 +0000 (21:43 -0600)]
ruby: convert block size, memory size to unsigned

11 years agoruby: replace Time with Cycles in MessageBuffer
Nilay Vaish [Mon, 11 Feb 2013 03:26:26 +0000 (21:26 -0600)]
ruby: replace Time with Cycles in MessageBuffer

11 years agoruby: replace Time with Cycles in Memory Controller
Nilay Vaish [Mon, 11 Feb 2013 03:26:25 +0000 (21:26 -0600)]
ruby: replace Time with Cycles in Memory Controller

11 years agoruby: Replace Time with Cycles in SequencerMessage
Nilay Vaish [Mon, 11 Feb 2013 03:26:25 +0000 (21:26 -0600)]
ruby: Replace Time with Cycles in SequencerMessage

11 years agoruby: replace Time with Cycles in Message class
Nilay Vaish [Mon, 11 Feb 2013 03:26:24 +0000 (21:26 -0600)]
ruby: replace Time with Cycles in Message class
Concomitant changes are being committed as well, including the io operator<<
for the Cycles class.

11 years agoruby: replaces Time with Cycles in many places
Nilay Vaish [Mon, 11 Feb 2013 03:26:24 +0000 (21:26 -0600)]
ruby: replaces Time with Cycles in many places
The patch started of with replacing Time with Cycles in the Consumer class.
But to get ruby to compile, the rest of the changes had to be carried out.
Subsequent patches will further this process, till we completely replace
Time with Cycles.

11 years agobase: add some mathematical operators to Cycles class
Nilay Vaish [Mon, 11 Feb 2013 03:26:23 +0000 (21:26 -0600)]
base: add some mathematical operators to Cycles class

11 years agoruby: modifies histogram add() function
Nilay Vaish [Mon, 11 Feb 2013 03:26:22 +0000 (21:26 -0600)]
ruby: modifies histogram add() function
This patch modifies the Histogram class' add() function so that it can add
linear histograms as well. The function assumes that the left end point of
the ranges of the two histograms are the same. It also assumes that when
the ranges of the two histogram are changed to accomodate an element not in
the range, the factor used in changing the range is same for both the
histograms.

This function is then used in removing one of the calls to the global
profiler*. The histograms for recording the delays incurred in processing
different requests are now maintained by the controllers. The profiler
adds these histograms when it needs to print the stats.

11 years agoruby: record fully busy cycle with in the controller
Nilay Vaish [Mon, 11 Feb 2013 03:26:22 +0000 (21:26 -0600)]
ruby: record fully busy cycle with in the controller
This patch does several things. First, the counter for fully busy cycles for a
controller is now kept with in the controller, instead of being part of the profiler.
Second, the topology class no longer keeps an array of controllers which was only
used for printing stats. Instead, ruby system will now ask each controller to print
the stats. Thirdly, the statistical variable for recording how many different types
were created is being moved in to the controller from the profiler. Note that for
printing, the profiler will collate results from different controllers.

11 years agobase: Fix broken IPython argument handling
Andreas Sandberg [Sun, 10 Feb 2013 12:23:56 +0000 (13:23 +0100)]
base: Fix broken IPython argument handling

Prior to this changeset, we used to clear sys.argv before entering the
IPython shell. This caused some versions of IPython to crash because
they assume argv[0] to exist. The correct way of overriding the
arguments passed to IPython is to set the argv keyword argument when
initializing the shell.

11 years agoconfig: Don't call sys.exit in interactive mode in run()
Andreas Sandberg [Sun, 10 Feb 2013 12:23:54 +0000 (13:23 +0100)]
config: Don't call sys.exit in interactive mode in run()

The run() method in Simulation.py used to call sys.exit() when the
simulator exits. This is undesirable when user has requested the
simulator to be run in interactive mode since it causes the simulator
to exit rather than entering the interactive Python environment.

11 years agosim: remove unused struct priority_compare
Nilay Vaish [Fri, 1 Feb 2013 03:26:29 +0000 (21:26 -0600)]
sim: remove unused struct priority_compare

11 years agoruby: correct computation of number of bits required for address
Nilay Vaish [Thu, 31 Jan 2013 15:44:20 +0000 (09:44 -0600)]
ruby: correct computation of number of bits required for address
The number of bits required for an address was set to floorLog2(memory size).
This is correct under the assumption that the memory size is a power of 2,
which is not always true. Hence, floorLog2 is being replaced with ceilLog2.

11 years agomem: Add comments for the DRAM address decoding
Andreas Hansson [Thu, 31 Jan 2013 12:49:18 +0000 (07:49 -0500)]
mem: Add comments for the DRAM address decoding

This patch adds more verbose comments to explain the two different
address mapping schemes of the DRAM controller.

11 years agostats: Update stats for regressions using SimpleDDR3
Andreas Hansson [Thu, 31 Jan 2013 12:49:16 +0000 (07:49 -0500)]
stats: Update stats for regressions using SimpleDDR3

This patch updates the regression stats to reflect that they are using
the SimpleDDR3 controller by default.

11 years agomem: Add DDR3 and LPDDR2 DRAM controller configurations
Andreas Hansson [Thu, 31 Jan 2013 12:49:14 +0000 (07:49 -0500)]
mem: Add DDR3 and LPDDR2 DRAM controller configurations

This patch moves the default DRAM parameters from the SimpleDRAM class
to two different subclasses, one for DDR3 and one for LPDDR2. More can
be added as we go forward.

The regressions that previously used the SimpleDRAM are now using
SimpleDDR3 as this is the most similar configuration.

11 years agomem: Add tTAW and tFAW to the SimpleDRAM model
Ani Udipi [Thu, 31 Jan 2013 12:49:14 +0000 (07:49 -0500)]
mem: Add tTAW and tFAW to the SimpleDRAM model

This patch adds two additional scheduling constraints to the DRAM
controller model, to constrain the activation rate. The two metrics
are determine the size of the activation window in terms of the number
of activates and the minimum time required for that number of
activates. This maps to current DDRx, LPDDRx and WIOx standards that
have either tFAW (4 activate window) or tTAW (2 activate window)
scheduling constraints.

11 years agomem: Separate out the different cases for DRAM bus busy time
Andreas Hansson [Thu, 31 Jan 2013 12:49:13 +0000 (07:49 -0500)]
mem: Separate out the different cases for DRAM bus busy time

This patch changes how the data bus busy time is calculated such that
it is delayed to the actual scheduling time of the request as opposed
to being done as soon as possible.

This patch changes a bunch of statistics, and the stats update is
bundled together with the introruction of tFAW/tTAW and the named DRAM
configurations like DDR3 and LPDDR2.

11 years agocache: remove drainManager because it's not used
Anthony Gutierrez [Tue, 29 Jan 2013 01:19:42 +0000 (20:19 -0500)]
cache: remove drainManager because it's not used

the cache drainManager is set but never cleared, this is because
the cache itself does not need to be drained and thus never
triggers a signalDrainDone(). because the drainManager variable
is not used properly and does not appear to be necessary it has
been removed with this patch.

11 years agomerged 798c2cec8e37 and e96ff45795bc
Nilay Vaish [Mon, 28 Jan 2013 14:24:40 +0000 (08:24 -0600)]
merged 798c2cec8e37 and e96ff45795bc

11 years agostats: Fix naming (BPredUnit to branchPred) for 20.parser ARM o3
Andreas Hansson [Mon, 28 Jan 2013 12:44:26 +0000 (07:44 -0500)]
stats: Fix naming (BPredUnit to branchPred) for 20.parser ARM o3

This patch bumps the stats for 20.parser for ARM o3-timing to reflect
a namechange of the branch predictor.

11 years agoruby: remove get_time()
Nilay Vaish [Mon, 28 Jan 2013 12:14:18 +0000 (06:14 -0600)]
ruby: remove get_time()
This patch replaces get_time() in *.sm files with curCycle() which
is now possible since controllers are clocked objects.

11 years agoruby: remove call to curCycle in panic()
Nilay Vaish [Mon, 28 Jan 2013 12:11:42 +0000 (06:11 -0600)]
ruby: remove call to curCycle in panic()
The panic() function already prints the current tick value. This call to
curCycle() is as such redundant. Since we are trying to move towards multiple
clock domains, this call will print misleading time.

11 years agoregressions: update stats due to branch predictor changes
Nilay Vaish [Thu, 24 Jan 2013 18:29:00 +0000 (12:29 -0600)]
regressions: update stats due to branch predictor changes
The actual statistical values are being updated for only two tests belonging
to sparc architecture and inorder cpu: 00.hello and 02.insttest. For others
the patch updates config.ini and name changes to statistical variables.

11 years agobranch predictor: move out of o3 and inorder cpus
Nilay Vaish ext:(%2C%20Timothy%20Jones%20%3Ctimothy.jones%40cl.cam.ac.uk%3E) [Thu, 24 Jan 2013 18:28:51 +0000 (12:28 -0600)]
branch predictor: move out of o3 and inorder cpus
This patch moves the branch predictor files in the o3 and inorder directories
to src/cpu/pred. This allows sharing the branch predictor across different
cpu models.

This patch was originally posted by Timothy Jones in July 2010
but never made it to the repository.

--HG--
rename : src/cpu/o3/bpred_unit.cc => src/cpu/pred/bpred_unit.cc
rename : src/cpu/o3/bpred_unit.hh => src/cpu/pred/bpred_unit.hh
rename : src/cpu/o3/bpred_unit_impl.hh => src/cpu/pred/bpred_unit_impl.hh
rename : src/cpu/o3/sat_counter.hh => src/cpu/pred/sat_counter.hh

11 years agoo3 cpu: fix zero reg problem
Andrea Pellegrini [Tue, 22 Jan 2013 06:13:28 +0000 (00:13 -0600)]
o3 cpu: fix zero reg problem
There was an issue w/ the rename logic, which would assign a previous physical
register to the ZeroReg architectural register in x86.  This issue was giving
problems for instructions squashed in threads w/ ID different from 0,
sometimes allowing non-mispredicted instructions to obtain a value different
from zero when reading the zeroReg.

11 years agox86, cpu: corrects 270c9a75e91f, take over decoder on cpu switch
Nilay Vaish [Tue, 22 Jan 2013 06:10:10 +0000 (00:10 -0600)]
x86, cpu: corrects 270c9a75e91f, take over decoder on cpu switch
The changes made by the changeset 270c9a75e91f do not work well with switching
of cpus. The problem is that decoder for the old thread context holds state
that is not taken over by the new decoder.

This patch adds a takeOverFrom() function to Decoder class in each ISA. Except
for x86, functions in other ISAs are blank. For x86, the function copies state
from the old decoder to the new decoder.

11 years agoscons: Disable protobuf if pkg-config and CheckLib fails
Andreas Hansson [Mon, 21 Jan 2013 14:20:18 +0000 (09:20 -0500)]
scons: Disable protobuf if pkg-config and CheckLib fails

This patch changes the use of pkg-config such that protobuf is still
evaluated with CheckLib even if it fails. This is to allow setups
where libprotobuf is available, but not configured through
protobuf. Moreover, if CheckLib fails to use libprotobuf then all the
tracing is disabled, but scons is allowed to continue with a warning.

11 years agoO3 IEW: Make incrWb and decrWb clearer
Joel Hestness [Sat, 19 Jan 2013 21:14:54 +0000 (15:14 -0600)]
O3 IEW: Make incrWb and decrWb clearer

Move the increment/decrement of wbOutstanding outside of the comparison
in incrWb and decrWb in the IEW. This also fixes a compiler bug with gcc
4.4.7, which incorrectly optimizes "-- ==" as "-=".

11 years agoruby: remove calls to g_system_ptr->getTime()
Nilay Vaish [Thu, 17 Jan 2013 19:10:12 +0000 (13:10 -0600)]
ruby: remove calls to g_system_ptr->getTime()
This patch further removes calls to g_system_ptr->getTime() where ever other
clocked objects are available for providing current time.

11 years agox86 regressions: updates due to new instructions and cpuid
Nilay Vaish [Tue, 15 Jan 2013 13:43:23 +0000 (07:43 -0600)]
x86 regressions: updates due to new instructions and cpuid

11 years agox86 cpuid: enable clflush
Nilay Vaish [Tue, 15 Jan 2013 13:43:21 +0000 (07:43 -0600)]
x86 cpuid: enable clflush
Note that clflush is only being enabled. It is not implemented
in actual. A warning is printed if the cpu encounters a clflush
instruction. We need to enable this instruction in cpuid since
JRE 1.7 tests for it.

11 years agox86: implements fsin, fcos instructions
Nilay Vaish [Tue, 15 Jan 2013 13:43:21 +0000 (07:43 -0600)]
x86: implements fsin, fcos instructions

11 years agox86: implements emms instruction
Nilay Vaish [Tue, 15 Jan 2013 13:43:20 +0000 (07:43 -0600)]
x86: implements emms instruction

11 years agox86: implement fabs, fchs instructions
Nilay Vaish [Tue, 15 Jan 2013 13:43:19 +0000 (07:43 -0600)]
x86: implement fabs, fchs instructions

11 years agoregressions: update stats due to changes in ruby obj hierarchy
Nilay Vaish [Mon, 14 Jan 2013 16:20:16 +0000 (10:20 -0600)]
regressions: update stats due to changes in ruby obj hierarchy

11 years agoconfig: move ruby objects under ruby_system in obj hierarchy
Malek Musleh [Mon, 14 Jan 2013 16:05:14 +0000 (10:05 -0600)]
config: move ruby objects under ruby_system in obj hierarchy
This patch moves the contollers to be children of the ruby_system instead of
'system' under the python object hierarchy. This is so that these objects
can inherit some of the ruby_system's parameter values without resorting to
calling a global system pointer during run-time.

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

11 years agoruby sequencer: converts cycles to ticks in deadlock panic()
Malek Musleh [Mon, 14 Jan 2013 16:05:12 +0000 (10:05 -0600)]
ruby sequencer: converts cycles to ticks in deadlock panic()
This patch converts the panic() print outs in the Sequencer::wakeup()
call from ruby cycles to Ticks(). This makes it easier to debug deadlocks
with the ProtocolTrace flag so the issue time indicated in the panic message
can be quickly searched for.

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

11 years agoRuby: remove reference to g_system_ptr from class Message
Nilay Vaish [Mon, 14 Jan 2013 16:05:10 +0000 (10:05 -0600)]
Ruby: remove reference to g_system_ptr from class Message
This patch was initiated so as to remove reference to g_system_ptr,
the pointer to Ruby System that is used for getting the current time.
That simple change actual requires changing a lot many things in slicc and
garnet. All these changes are related to how time is handled.

In most of the places, g_system_ptr has been replaced by another clock
object. The changes have been done under the assumption that all the
components in the memory system are on the same clock frequency, but the
actual clocks might be distributed.

11 years agoRuby: use ClockedObject in Consumer class
Nilay Vaish [Mon, 14 Jan 2013 16:04:21 +0000 (10:04 -0600)]
Ruby: use ClockedObject in Consumer class
Many Ruby structures inherit from the Consumer, which is used for scheduling
events. The Consumer used to relay on an Event Manager for scheduling events
and on g_system_ptr for time. With this patch, the Consumer will now use a
ClockedObject to schedule events and to query for current time. This resulted
in several structures being converted from SimObjects to ClockedObjects. Also,
the MessageBuffer class now requires a pointer to a ClockedObject so as to
query for time.