gem5.git
11 years agoconfig: Do not instantiate membus when using ruby
Nilay Vaish [Thu, 13 Jun 2013 12:24:25 +0000 (07:24 -0500)]
config: Do not instantiate membus when using ruby
This patch moves the instantiation of system.membus in se.py to the area of
code where classic memory system has been dealt with. Ruby does not require
this bus and hence it should not be instantiated.

11 years agokvm: Add more VM stats
Andreas Sandberg [Tue, 11 Jun 2013 07:43:05 +0000 (09:43 +0200)]
kvm: Add more VM stats

This changeset adds the following stats to KVM:
 * numVMHalfEntries: Number of entries into KVM to finalize pending
   IO operations without executing guest instructions. These typically
   happen as a result of a drain where the guest must finalize some
   operations before the guest state is consistent.
 * numExitSignal: Number of VM exits that have been triggered by a
   signal. These usually happen as a result of the timer that limits
   the time spent in KVM.

11 years agokvm: Separate host frequency from simulated CPU frequency
Andreas Sandberg [Tue, 11 Jun 2013 07:24:55 +0000 (09:24 +0200)]
kvm: Separate host frequency from simulated CPU frequency

We used to use the KVM CPU's clock to specify the host frequency. This
was not ideal for several reasons. One of them being that the clock
parameter of a CPU determines the frequency of some of the components
connected to the CPU. This changeset adds a separate hostFreq
parameter that should be used to specify the host frequency until we
add code to autodetect it. The hostFactor should still be used to
specify the conversion factor between the host performance and that of
the simulated system.

11 years agokvm: Don't handle IO and execute in the same tick
Andreas Sandberg [Tue, 11 Jun 2013 07:24:51 +0000 (09:24 +0200)]
kvm: Don't handle IO and execute in the same tick

We currently execute instructions in the guest and then handle any IO
request right after we break out of the virtualized environment. This
has the effect of executing IO requests in the exact same tick as the
first instruction in the sequence that was just run. There seem to be
cases where this simplification upsets some timing-sensitive devices.

This changeset splits execute and IO (and other services) across
multiple ticks. This is implemented by adding a separate
RunningService state to the CPU state machine. When a VM requires
service, it enters into this state and pending IO is then serviced in
the future instead of immediately. The delay between getting the
request and servicing it depends on the number of cycles executed in
the guest, which allows other components to catch up with the CPU.

11 years agokvm: Maintain a local instruction counter and update totalNumInsts
Andreas Sandberg [Tue, 11 Jun 2013 07:24:40 +0000 (09:24 +0200)]
kvm: Maintain a local instruction counter and update totalNumInsts

Update the system's totalNumInst counter when exiting from KVM and
maintain an internal absolute instruction count instead of relying on
the one from perf.

11 years agox86: Fix bug when copying TSC on CPU handover
Andreas Sandberg [Tue, 11 Jun 2013 07:24:38 +0000 (09:24 +0200)]
x86: Fix bug when copying TSC on CPU handover

The TSC value stored in MISCREG_TSC is actually just an offset from
the current CPU cycle to the actual TSC value. Writes with
side-effects to the TSC subtract the current cycle count before
storing the new value, while reads add the current cycle count. When
switching CPUs, the current value is copied without side-effects. This
works as long as the source and the destination CPUs have the same
clock frequencies. The TSC will jump, sometimes backwards, if they
have different clock frequencies. Most OSes assume the TSC to be
monotonic and break when this happens.

This changeset makes sure that the TSC is copied with side-effects to
ensure that the offset is updated to match the new CPU.

11 years agosim: Revert [34e3295b0e39] (sim: Fix early termination in mult...)
Andreas Sandberg [Tue, 11 Jun 2013 07:24:10 +0000 (09:24 +0200)]
sim: Revert [34e3295b0e39] (sim: Fix early termination in mult...)

HG changset 34e3295b0e39 introduced a check in the main simulation
loop that discards exit events that happen at the same tick as another
exit event. This was supposed to fix a problem where a simulation
script got confused by multiple exit events. This obviously breaks the
simulator since it can hide important simulation events, such as a
simulation failure, that happen at the same time as a non-fatal
simulation event.

11 years agocpu: Add support for scheduling multiple inst/load stop events
Andreas Sandberg [Tue, 11 Jun 2013 07:18:25 +0000 (09:18 +0200)]
cpu: Add support for scheduling multiple inst/load stop events

Currently, the only way to get a CPU to stop after a fixed number of
instructions/loads is to set a property on the CPU that causes a
SimLoopExitEvent to be scheduled when the CPU is constructed. This is
clearly not ideal in cases where the simulation script wants the CPU
to stop at multiple instruction counts (e.g., SimPoint generation).

This changeset adds the methods scheduleInstStop() and
scheduleLoadStop() to the BaseCPU. These methods are exported to
Python and are designed to be used from the simulation script. By
using these methods instead of the old properties, a simulation script
can schedule a stop at any point during simulation or schedule
multiple stops. The number of instructions specified when scheduling a
stop is relative to the current point of execution.

11 years agostats: updates due to changes to ruby
Nilay Vaish [Mon, 10 Jun 2013 11:46:20 +0000 (06:46 -0500)]
stats: updates due to changes to ruby
Ruby's controller statistics have been mostly moved to stats.txt now.
Plus stats.txt for solaris/t1000-simple-atomic and arm/20.parser are
also being updated.

11 years agoruby: remove several unused variables in Profiler
Nilay Vaish [Sun, 9 Jun 2013 12:30:00 +0000 (07:30 -0500)]
ruby: remove several unused variables in Profiler
This patch removes per processor cycle count, histogram for filter stats,
histogram for multicasts, histogram for prefetch wait, some function
prototypes that do not have definitions.

11 years agoruby: remove periodic event from Profiler
Nilay Vaish [Sun, 9 Jun 2013 12:29:59 +0000 (07:29 -0500)]
ruby: remove periodic event from Profiler
The Profiler class does not need an event for dumping statistics
periodically. This is because there is a method for dumping statistics
for all the sim objects periodically. Since Ruby is a sim object, its
statistics are also included.

11 years agoruby: stats: use gem5's stats for cache and memory controllers
Nilay Vaish [Sun, 9 Jun 2013 12:29:59 +0000 (07:29 -0500)]
ruby: stats: use gem5's stats for cache and memory controllers
This moves event and transition count statistics for cache controllers to
gem5's statistics. It does the same for the statistics associated with the
memory controller in ruby.

All the cache/directory/dma controllers individually collect the event and
transition counts. A callback function, collateStats(), has been added that
is invoked on the controller version 0 of each controller class. This
function adds all the individual controller statistics to a vector
variables. All the code for registering the statistical variables and
collating them is generated by SLICC. The patch removes the files
*_Profiler.{cc,hh} and *_ProfileDumper.{cc,hh} which were earlier used for
collecting and dumping statistics respectively.

11 years agoruby: remove undefined functions in Address class
Nilay Vaish [Sun, 9 Jun 2013 12:29:58 +0000 (07:29 -0500)]
ruby: remove undefined functions in Address class

11 years agostats: allow printing vectors on a single line
Nilay Vaish [Sun, 9 Jun 2013 12:29:57 +0000 (07:29 -0500)]
stats: allow printing vectors on a single line
This patch adds a new flag to specify if the data values for a given vector
should be printed in one line in the stats.txt file. The default behavior
will be to print the data in multiple lines. It makes changes to print
functions to enforce this behavior.

11 years agoconfig: add atomic cpu to X86_MESI_CMP_directory build options
Nilay Vaish [Sun, 9 Jun 2013 02:57:02 +0000 (21:57 -0500)]
config: add atomic cpu to X86_MESI_CMP_directory build options
There is some problem with the way listing cpu options right now.
Since Ruby uses the options variable, this variable has to be created in the
config file that runs the fs test for x86 and mesi cmp directory combination.
While creating the variable, some error is occurs due to the way list of cpu
types is now created. Hence, we need to compile all the cpu models.

11 years agoUpdating EIO regression reference outputs for new stats.
Steve Reinhardt [Sat, 8 Jun 2013 14:28:33 +0000 (10:28 -0400)]
Updating EIO regression reference outputs for new stats.

11 years agoscons: ammend swig warning error to version 2.0.10 as well
Ali Saidi [Tue, 4 Jun 2013 20:17:04 +0000 (15:17 -0500)]
scons: ammend swig warning error to version 2.0.10 as well

11 years agodev: Clarify why updates are delayed when the MC14818 is activated
Andreas Sandberg [Tue, 4 Jun 2013 08:08:21 +0000 (10:08 +0200)]
dev: Clarify why updates are delayed when the MC14818 is activated

11 years agoarch: Create a method to finalize physical addresses
Andreas Sandberg [Mon, 3 Jun 2013 11:55:41 +0000 (13:55 +0200)]
arch: Create a method to finalize physical addresses
 in the TLB

Some architectures (currently only x86) require some fixing-up of
physical addresses after a normal address translation. This is usually
to remap devices such as the APIC, but could be used for other memory
mapped devices as well. When running the CPU in a using hardware
virtualization, we still need to do these address fix-ups before
inserting the request into the memory system. This patch moves this
patch allows that code to be used by such CPUs without doing full
address translations.

11 years agobase: Make the Python module loader PEP302 compliant
Andreas Sandberg [Mon, 3 Jun 2013 11:51:03 +0000 (13:51 +0200)]
base: Make the Python module loader PEP302 compliant

The custom Python loader didn't comply with PEP302 for two reasons:

 * Previously, we would overwrite old modules on name
   conflicts. PEP302 explicitly states that: "If there is an existing
   module object named 'fullname' in sys.modules, the loader must use
   that existing module".

 * The "__package__" attribute wasn't set. PEP302: "The __package__
   attribute must be set."

This changeset addresses both of these issues.

11 years agoconfig: Add missing CPUs to --restore-with-cpu
Andreas Sandberg [Mon, 3 Jun 2013 11:40:05 +0000 (13:40 +0200)]
config: Add missing CPUs to --restore-with-cpu

The --restore-with-cpu option didn't use CpuConfig.cpu_names() to
determine which CPU names are valid, instead it used a static list of
known CPU names. This changeset makes the option parsing code use the
CPU list from the CpuConfig module instead.

11 years agokvm: Allow architectures to override the cycle accounting mechanism
Andreas Sandberg [Mon, 3 Jun 2013 11:39:11 +0000 (13:39 +0200)]
kvm: Allow architectures to override the cycle accounting mechanism

Some architectures have special registers in the guest that can be
used to do cycle accounting. This is generally preferrable since the
prevents the guest from seeing a non-monotonic clock. This changeset
adds a virtual method, getHostCycles(), that the architecture-specific
code can override to implement this functionallity. The default
implementation uses the hwCycles counter.

11 years agokvm: Add handling of EAGAIN when creating timers
Andreas Sandberg [Mon, 3 Jun 2013 11:38:59 +0000 (13:38 +0200)]
kvm: Add handling of EAGAIN when creating timers

timer_create can apparently return -1 and set errno to EAGAIN if the
kernel suffered a temporary failure when allocating a timer. This
happens from time to time, so we need to handle it.

11 years agosim: Add debug output when executing pseudo-instructions
Andreas Sandberg [Mon, 3 Jun 2013 11:21:21 +0000 (13:21 +0200)]
sim: Add debug output when executing pseudo-instructions

11 years agokvm: Add a call to thread->startup() in startup()
Andreas Sandberg [Mon, 3 Jun 2013 10:36:56 +0000 (12:36 +0200)]
kvm: Add a call to thread->startup() in startup()

It is now required to initialize the thread context by calling
startup() on it. Failing to do so currently causes decoder in
x86-based CPUs to get very confused when restoring from checkpoints.

11 years agodev: Add support for disabling ticking and the divider in MC146818
Andreas Sandberg [Mon, 3 Jun 2013 10:28:52 +0000 (12:28 +0200)]
dev: Add support for disabling ticking and the divider in MC146818

Some Linux versions disable updates (regB.set = 1) to prevent the chip
from updating its internal state while the OS is updating it. Support
for this was already there, this patch merely disables the check in
writeReg that prevented it from being enabled. The patch also includes
support for disabling the divider, which is used to control when clock
updates should start after setting the internal RTC state.

These changes are required to boot most vanilla Linux distributions
that update the RTC settings at boot.

11 years agodev: Clean up MC146818 register (A & B) handling
Andreas Sandberg [Mon, 3 Jun 2013 10:28:41 +0000 (12:28 +0200)]
dev: Clean up MC146818 register (A & B) handling

Rewrite reg A & B handling to use the bitunion stuff instead of bit
masking. Add better error messages when the kernel tries to enable
unsupported stuff.

11 years agostats: Update the stats to reflect bus and memory changes
Andreas Hansson [Thu, 30 May 2013 16:54:18 +0000 (12:54 -0400)]
stats: Update the stats to reflect bus and memory changes

This patch updates the stats to reflect the addition of the bus stats,
and changes to the bus layers. In addition it updates the stats to
match the addition of the static pipeline latency of the memory
conotroller and the addition of a stat tracking the bytes per
activate.

11 years agomem: More descriptive DRAM config names
Andreas Hansson [Thu, 30 May 2013 16:54:14 +0000 (12:54 -0400)]
mem: More descriptive DRAM config names

This patch changes the class names of the variuos DRAM configurations
to better reflect what memory they are based on. The speed and
interface width is now part of the name, and also the alias that is
used to select them on the command line.

Some minor changes are done to the actual parameters, to better
reflect the named configurations. As a result of these changes the
regressions change slightly and the stats will be bumped in a separate
patch.

11 years agomem: Add bytes per activate DRAM controller stat
Andreas Hansson [Thu, 30 May 2013 16:54:13 +0000 (12:54 -0400)]
mem: Add bytes per activate DRAM controller stat

This patch adds a histogram to track how many bytes are accessed in an
open row before it is closed. This metric is useful in characterising
a workload and the efficiency of the DRAM scheduler. For example, a
DDR3-1600 device requires 44 cycles (tRC) before it can activate
another row in the same bank. For a x32 interface (8 bytes per cycle)
that means 8 x 44 = 352 bytes must be transferred to hide the
preparation time.

11 years agomem: Add static latency to the DRAM controller
Andreas Hansson [Thu, 30 May 2013 16:54:12 +0000 (12:54 -0400)]
mem: Add static latency to the DRAM controller

This patch adds a frontend and backend static latency to the DRAM
controller by delaying the responses. Two parameters expressing the
frontend and backend contributions in absolute time are added to the
controller, and the appropriate latency is added to the responses when
adding them to the (infinite) queued port for sending.

For writes and reads that hit in the write buffer, only the frontend
latency is added. For reads that are serviced by the DRAM, the static
latency is the sum of the pipeline latencies of the entire frontend,
backend and PHY. The default values are chosen based on having roughly
10 pipeline stages in total at 500 MHz.

In the future, it would be sensible to make the controller use its
clock and convert these latencies (and a few of the DRAM timings) to
cycles.

11 years agomem: Spring cleaning of MSHR and MSHRQueue
Andreas Hansson [Thu, 30 May 2013 16:54:11 +0000 (12:54 -0400)]
mem: Spring cleaning of MSHR and MSHRQueue

This patch does some minor tidying up of the MSHR and MSHRQueue. The
clean up started as part of some ad-hoc tracing and debugging, but
seems worthwhile enough to go in as a separate patch.

The highlights of the changes are reduced scoping (private) members
where possible, avoiding redundant new/delete, and constructor
initialisation to please static code analyzers.

11 years agomem: Fix MSHR print format
Andreas Hansson [Thu, 30 May 2013 16:54:09 +0000 (12:54 -0400)]
mem: Fix MSHR print format

This patch fixes an incorrect print format string by adding an
additional string element.

11 years agocpu: Prune the stale TraceCPU
Andreas Hansson [Thu, 30 May 2013 16:54:09 +0000 (12:54 -0400)]
cpu: Prune the stale TraceCPU

This patch prunes the TraceCPU as the code is stale and the
functionality that it provided can now be achieved with the TrafficGen
using its trace playback mode.

The TraceCPU was able to play back pre-recorded memory traces of a few
different formats, and to achieve this level of flexibility with the
TrafficGen, use the util/encode_packet_trace (with suitable
modifications) to create a protobuf trace off-line.

11 years agocpu: Check that minimum TrafficGen period is less than max period
Sascha Bischoff [Thu, 30 May 2013 16:54:08 +0000 (12:54 -0400)]
cpu: Check that minimum TrafficGen period is less than max period

Add a check which ensures that the minumum period for the LINEAR and
RANDOM traffic generator states is less than or equal to the maximum
period. If the minimum period is greater than the maximum period a
fatal is triggered.

11 years agocpu: Fix bug when reading in TrafficGen state transitions
Sascha Bischoff [Thu, 30 May 2013 16:54:07 +0000 (12:54 -0400)]
cpu: Fix bug when reading in TrafficGen state transitions

This patch fixes a bug with the traffic generator which occured when
reading in the state transitions from the configuration
file. Previously, the size of the vector which stored the transitions
was used to get the size of the transitions matrix, rather than using
the number of states. Therefore, if there were more transitions than
states, i.e. some transitions has a probability of less than 1, then
the traffic generator would fatal when trying to check the
transitions.

This issue has been addressed by using the number of input states,
rather then the number of transitions.

11 years agocpu: Add request elasticity to the traffic generator
Andreas Hansson [Thu, 30 May 2013 16:54:06 +0000 (12:54 -0400)]
cpu: Add request elasticity to the traffic generator

This patch adds an optional request elasticity to the traffic
generator, effectievly compensating for it in the case of the linear
and random generators, and adding it in the case of the trace
generator. The accounting is left with the top-level traffic
generator, and the individual generators do the necessary math as part
of determining the next packet tick.

Note that in the linear and random generators we have to compensate
for the blocked time to not be elastic, i.e. without this patch the
aforementioned generators will slow down in the case of back-pressure.

11 years agocpu: Block traffic generator when requests have to retry
Andreas Hansson [Thu, 30 May 2013 16:54:05 +0000 (12:54 -0400)]
cpu: Block traffic generator when requests have to retry

This patch changes the queued port for a conventional master port and
stalls the traffic generator when requests are not immediately
accepted. This is a first step to allowing elasticity in the injection
of requests.

The patch also adds stats for the sent packets and retries, and
slightly changes how the nextPacketTick and getNextPacket
interact. The advancing of the trace is now moved to getNextPacket and
nextPacketTick is only responsible for answering the question when the
next packet should be sent.

11 years agocpu: Move traffic generator sending out of generator states
Andreas Hansson [Thu, 30 May 2013 16:54:04 +0000 (12:54 -0400)]
cpu: Move traffic generator sending out of generator states

This patch moves the responsibility for sending packets out of the
generator states and leaves it with the top-level traffic
generator. The main aim of this patch is to enable a transition to
non-queued ports, i.e. with send/retry flow control, and to do so it
is much more convenient to not wrap the port interactions and instead
leave it all local to the traffic generator.

The generator states now only govern when they are ready to send
something new, and the generation of the packets to send. They thus
have no knowledge of the port that is used.

11 years agocpu: Fold together the StateGraph and the TrafficGen
Andreas Hansson [Thu, 30 May 2013 16:54:03 +0000 (12:54 -0400)]
cpu: Fold together the StateGraph and the TrafficGen

This patch simplifies the object hierarchy of the traffic generator by
getting rid of the StateGraph class and folding this functionality
into the traffic generator itself.

The main goal of this patch is to facilitate upcoming changes by
reducing the number of affected layers.

11 years agomem: Make returning snoop responses occupy response layer
Andreas Hansson [Thu, 30 May 2013 16:54:02 +0000 (12:54 -0400)]
mem: Make returning snoop responses occupy response layer

This patch introduces a mirrored internal snoop port to facilitate
easy addition of flow control for the snoop responses that are turned
into normal responses on their return. To perform this, the slave
ports of the coherent bus are wrapped in internal master ports that
are passed as the source ports to the response layer in question.

As a result of this patch, there is more contention for the response
resources, and as such system performance will decrease slightly.

A consequence of the mirrored internal port is that the port the bus
tells to retry (the internal one) and the port actually retrying (the
mirrored) one are not the same. Thus, the existing check in tryTiming
is not longer correct. In fact, the test is redundant as the layer is
only in the retry state while calling sendRetry on the waiting port,
and if the latter does not immediately call the bus then the retry
state is left. Consequently the check is removed.

11 years agomem: Make the buses multi layered
Andreas Hansson [Thu, 30 May 2013 16:54:01 +0000 (12:54 -0400)]
mem: Make the buses multi layered

This patch makes the buses multi layered, and effectively creates a
crossbar structure with distributed contention ports at the
destination ports. Before this patch, a bus could have a single
request, response and snoop response in flight at any time, and with
these changes there can be as many requests as connected slaves (bus
master ports), and as many responses as connected masters (bus slave
ports).

Together with address interleaving, this patch enables us to create
high-throughput memory interconnects, e.g. 50+ GByte/s.

11 years agomem: Separate the two snoop response cases in the bus
Andreas Hansson [Thu, 30 May 2013 16:54:00 +0000 (12:54 -0400)]
mem: Separate the two snoop response cases in the bus

This patch makes the flow control and state updates of the coherent
bus more clear by separating the two cases, i.e. forward as a snoop
response, or turn it into a normal response.

With this change it is also more clear what resources are being
occupied, and that we effectively bypass the busy check for the second
case. As a result of the change in resource usage some stats change.

11 years agomem: Tidy up a few variables in the bus
Andreas Hansson [Thu, 30 May 2013 16:53:59 +0000 (12:53 -0400)]
mem: Tidy up a few variables in the bus

This patch does some minor housekeeping on the bus code, removing
redundant code, and moving the extraction of the destination id to the
top of the functions using it.

11 years agomem: Add basic stats to the buses
Uri Wiener [Thu, 30 May 2013 16:53:58 +0000 (12:53 -0400)]
mem: Add basic stats to the buses

This patch adds a basic set of stats which are hard to impossible to
implement using only communication monitors, and are needed for
insight such as bus utilization, transactions through the bus etc.

Stats added include throughput and transaction distribution, and also
a two-dimensional vector capturing how many packets and how much data
is exchanged between the masters and slaves connected to the bus.

11 years agomem: Use unordered set in bus request tracking
Andreas Hansson [Thu, 30 May 2013 16:53:57 +0000 (12:53 -0400)]
mem: Use unordered set in bus request tracking

This patch changes the set used to track outstanding requests to an
unordered set (part of C++11 STL). There is no need to maintain the
order, and hopefully there might even be a small performance benefit.

11 years agomem: Check for waiting state in bus draining
Andreas Hansson [Thu, 30 May 2013 16:53:57 +0000 (12:53 -0400)]
mem: Check for waiting state in bus draining

This patch fixes a bug in the bus where the bus transitions from busy
to idle and still has a port that is waiting for a retry from a peer.

11 years agomem: Add a LPDDR3-1600 configuration
Andreas Hansson [Thu, 30 May 2013 16:53:56 +0000 (12:53 -0400)]
mem: Add a LPDDR3-1600 configuration

This patch adds a typical (leaning towards fast) LPDDR3 configuration
based on publically available data. As expected, it looks very similar
to the LPDDR2-S4 configuration, only with a slightly lower burst time.

11 years agomem: Adapt the LPDDR2 to match a single x32 channel
Andreas Hansson [Thu, 30 May 2013 16:53:55 +0000 (12:53 -0400)]
mem: Adapt the LPDDR2 to match a single x32 channel

This patch adapts the existing LPDDR2 configuration to make use of the
multi-channel functionality. Thus, to get a x64 interface two
controllers should be instantiated using the makeMultiChannel method.

The page size and ranks are also adapted to better suit with a typical
LPDDR2 part.

11 years agomem: Avoid explicitly zeroing the memory backing store
Andreas Hansson [Thu, 30 May 2013 16:53:54 +0000 (12:53 -0400)]
mem: Avoid explicitly zeroing the memory backing store

This patch removes the explicit memset as it is redundant and causes
the simulator to touch the entire space, forcing the host system to
allocate the pages.

Anonymous pages are mapped on the first access, and the page-fault
handler is responsible for zeroing them. Thus, the pages are still
zeroed, but we avoid touching the entire allocated space which enables
us to use much larger memory sizes as long as not all the memory is
actually used.

11 years agoutil: Auto generate the packet proto definitions
Andreas Hansson [Thu, 30 May 2013 16:53:53 +0000 (12:53 -0400)]
util: Auto generate the packet proto definitions

This patch simplifies the usage of the packet trace encoder/decoder by
attempting to automatically generating the packet proto definitions in
case they cannot be found.

11 years agobase: Avoid size limitation on protobuf coded streams
Andreas Hansson [Thu, 30 May 2013 16:53:53 +0000 (12:53 -0400)]
base: Avoid size limitation on protobuf coded streams

This patch changes how the streams are created to avoid the size
limitation on the coded streams. As we only read/write a single
message at a time, there is never any message larger than a few
bytes. However, the coded stream eventually complains that its
internal counter reaches 64+ MByte if the total file size exceeds this
value.

Based on suggestions in the protobuf discussion forums, the coded
stream is now created for every message that is read/written. The
result is that the internal byte count never goes about tens of bytes,
and we can read/write any size file that the underlying file I/O can
handle.

11 years agocpu: Make hash struct instead of class to please clang
Andreas Hansson [Thu, 30 May 2013 16:53:52 +0000 (12:53 -0400)]
cpu: Make hash struct instead of class to please clang

This patch changes the type of the hash function for BasicBlockRanges
to match the original definition of the templatized type. Without
this, clang raises a warning and combined with the "-Werror" flag this
causes compilation to fail.

11 years agoruby: slicc: fix error msg in TypeFieldMemberAST.py
Malek Musleh [Tue, 21 May 2013 16:57:14 +0000 (11:57 -0500)]
ruby: slicc: fix error msg in TypeFieldMemberAST.py

11 years agox86, regressions: updates stats
Nilay Vaish [Tue, 21 May 2013 16:41:27 +0000 (11:41 -0500)]
x86, regressions: updates stats
This is due to op class, function call, walker patches.

11 years agox86: Squash outstanding walks when instructions are squashed.
Gedare Bloom [Tue, 21 May 2013 16:40:11 +0000 (11:40 -0500)]
x86: Squash outstanding walks when instructions are squashed.
This is the x86 version of the ARM changeset baa17ba80e06. In case an
instruction has been squashed by the o3 cpu, this patch allows page
table walker to avoid carrying out a pending translation that the
instruction requested for.

11 years agox86: mark instructions for being function call/return
Nilay Vaish [Tue, 21 May 2013 16:34:41 +0000 (11:34 -0500)]
x86: mark instructions for being function call/return
Currently call and return instructions are marked as IsCall and IsReturn. Thus, the
branch predictor does not use RAS for these instructions. Similarly, the number of
function calls that took place is recorded as 0. This patch marks these instructions
as they should be.

11 years agox86: add op class for int and fp microops in isa description
Nilay Vaish [Tue, 21 May 2013 16:33:57 +0000 (11:33 -0500)]
x86: add op class for int and fp microops in isa description
Currently all the integer microops are marked as IntAluOp and the floating
point microops are marked as FloatAddOp. This patch adds support for marking
different microops differently. Now IntMultOp, IntDivOp, FloatDivOp,
FloatMultOp, FloatCvtOp, FloatSqrtOp classes will be used as well. This will
help in providing different latencies for different op class.

11 years agostats: updates statistics for ruby regressions
Nilay Vaish [Tue, 21 May 2013 16:32:57 +0000 (11:32 -0500)]
stats: updates statistics for ruby regressions

11 years agoruby: moesi hammer: cosmetic changes
Nilay Vaish [Tue, 21 May 2013 16:32:45 +0000 (11:32 -0500)]
ruby: moesi hammer: cosmetic changes
Updates copyright years, removes space at the end of lines, shortens
variable names.

11 years agoruby: mesi cmp directory: cosmetic changes
Nilay Vaish [Tue, 21 May 2013 16:32:38 +0000 (11:32 -0500)]
ruby: mesi cmp directory: cosmetic changes
Updates copyright years, removes space at the end of lines, shortens
variable names.

11 years agoruby: moesi cmp token: cosmetic changes
Nilay Vaish [Tue, 21 May 2013 16:32:24 +0000 (11:32 -0500)]
ruby: moesi cmp token: cosmetic changes
Updates copyright years, removes space at the end of lines, shortens
variable names.

11 years agoruby: moesi cmp directory: cosmetic changes
Nilay Vaish [Tue, 21 May 2013 16:32:15 +0000 (11:32 -0500)]
ruby: moesi cmp directory: cosmetic changes
Updates copyright years, removes space at the end of lines, shortens
variable names.

11 years agoconfigs: ruby: pass the option use_map to directory controller
Nilay Vaish [Tue, 21 May 2013 16:32:08 +0000 (11:32 -0500)]
configs: ruby: pass the option use_map to directory controller
The option was not being passed to directory controllers for the protocols
MOESI_CMP_token and MOESI_CMP_directory. This was resulting in an error
while instantiating the directory controller as it tries to access the
wrong type of memory.

11 years agoruby: add stats to .sm files, remove cache profiler
Nilay Vaish ext:(%2C%20Malek%20Musleh%20%3Cmalek.musleh%40gmail.com%3E) [Tue, 21 May 2013 16:31:31 +0000 (11:31 -0500)]
ruby: add stats to .sm files, remove cache profiler
This patch changes the way cache statistics are collected in ruby.

As of now, there is separate entity called CacheProfiler which holds
statistical variables for caches. The CacheMemory class defines different
functions for accessing the CacheProfiler. These functions are then invoked
in the .sm files. I find this approach opaque and prone to error. Secondly,
we probably should not be paying the cost of a function call for recording
statistics.

Instead, this patch allows for accessing statistical variables in the
.sm files. The collection would become transparent. Secondly, it would happen
in place, so no function calls. The patch also removes the CacheProfiler class.

--HG--
rename : src/mem/slicc/ast/InfixOperatorExprAST.py => src/mem/slicc/ast/OperatorExprAST.py

11 years agocpu: remove local/globalHistoryBits params from branch pred
Anthony Gutierrez [Tue, 14 May 2013 22:39:47 +0000 (18:39 -0400)]
cpu: remove local/globalHistoryBits params from branch pred

having separate params for the local/globalHistoryBits and the
local/globalPredictorSize can lead to inconsistencies if they
are not carefully set. this patch dervies the number of bits
necessary to index into the local/global predictors based on
their size.

the value of the localHistoryTableSize for the ARM O3 CPU has been
increased to 1024 from 64, which is more accurate for an A15 based
on some correlation against A15 hardware.

11 years agokvm: Add support for disabling coalesced MMIO
Andreas Sandberg [Tue, 14 May 2013 14:02:45 +0000 (16:02 +0200)]
kvm: Add support for disabling coalesced MMIO

Add the option useCoalescedMMIO to the BaseKvmCPU. The default
behavior is to disable coalesced MMIO since this hasn't been heavily
tested.

11 years agokvm: Dump state before panic in KVM exit handlers
Andreas Sandberg [Tue, 14 May 2013 13:59:43 +0000 (15:59 +0200)]
kvm: Dump state before panic in KVM exit handlers

11 years agokvm: Fix the memory interface used by KVM
Andreas Sandberg [Tue, 14 May 2013 13:56:04 +0000 (15:56 +0200)]
kvm: Fix the memory interface used by KVM

The CpuPort class was removed before the KVM patches were committed,
which means that the KVM interface currently doesn't compile. This
changeset adds the BaseKvmCPU::KVMCpuPort class which derives from
MasterPort. This class is used on the data and instruction ports
instead of the old CpuPort.

11 years agoarm: Add support for the m5fail pseudo-op
Andreas Sandberg [Tue, 14 May 2013 13:06:50 +0000 (15:06 +0200)]
arm: Add support for the m5fail pseudo-op

11 years agoarm: Fix compilation error in m5 utility
Andreas Sandberg [Tue, 14 May 2013 13:03:45 +0000 (15:03 +0200)]
arm: Fix compilation error in m5 utility

Changeset 5ca6098b9560 accidentally broke the m5 utility. This
changeset adds the missing co-processor call used to trigger the
pseudo-op in ARM mode and fixes an alignment issue that caused some
pseudo-ops to leave thumb mode.

11 years agoarm: Make libm5 a dependency of the m5 utility
Andreas Sandberg [Tue, 7 May 2013 12:47:04 +0000 (14:47 +0200)]
arm: Make libm5 a dependency of the m5 utility

The m5 utility wasn't relinked properly since libm5.a wasn't a
dependency of the utility. This changeset addresses that issue.

11 years agokvm: Add a stat counting number of instructions executed
Andreas Sandberg [Thu, 2 May 2013 10:03:43 +0000 (12:03 +0200)]
kvm: Add a stat counting number of instructions executed

This changeset adds a 'numInsts' stat to the KVM-based CPU. It also
cleans up the variable names in kvmRun to make the distinction between
host cycles and estimated simulated cycles clearer. As a bonus
feature, it also fixes a warning (unreferenced variable) when
compiling in fast mode.

11 years agokvm: Add checkpoint debug print
Andreas Sandberg [Thu, 2 May 2013 10:02:19 +0000 (12:02 +0200)]
kvm: Add checkpoint debug print

Add a debug print (when the Checkpoint debug flag is set) on serialize
and unserialize. Additionally, dump the KVM state before
serializing. The KVM state isn't dumped after unserializing since the
state is loaded lazily on the next KVM entry.

11 years agokvm: Make MMIO requests uncacheable
Andreas Sandberg [Thu, 2 May 2013 10:01:50 +0000 (12:01 +0200)]
kvm: Make MMIO requests uncacheable

Device accesses are normally uncacheable. This change probably doesn't
make any difference since we normally disable caching when KVM is
active. However, there might be devices that check this, so we'd
better enable this flag to be safe.

11 years agosim: Add support for m5fail in pseudoInst()
Andreas Sandberg [Thu, 2 May 2013 09:54:08 +0000 (11:54 +0200)]
sim: Add support for m5fail in pseudoInst()

11 years agoconfig: Added memory type to t1000 regression
Andreas Hansson [Sun, 28 Apr 2013 21:14:39 +0000 (17:14 -0400)]
config: Added memory type to t1000 regression

This patch adds the memory type parameter to the t1000 regression.

11 years agox86: corrects vsyscall address for gettimeofday
Michael Levenhagen [Tue, 23 Apr 2013 20:21:32 +0000 (15:21 -0500)]
x86: corrects vsyscall address for gettimeofday
The vsyscall address for gettimeofday is 0xffffffffff600000ul. The offset
therefore should be 0x0 instead of 0x410. This can be cross checked with
the file sysdeps/unix/sysv/linux/x86_64/gettimeofday.c in source of glibc.

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

11 years agox86: enable gettimeofday and getppid system calls
Michael Levenhagen [Tue, 23 Apr 2013 20:21:30 +0000 (15:21 -0500)]
x86: enable gettimeofday and getppid system calls

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

11 years agoconfig: Fix mem-type option not used in ruby_fs script
Marco Elver [Tue, 23 Apr 2013 16:56:48 +0000 (11:56 -0500)]
config: Fix mem-type option not used in ruby_fs script
This fixes missing mem-type arguments to makeLinuxAlphaRubySystem and
makeLinuxX86System after a recent changeset allowing mem-type to be
configured via options missed fixing these calls.

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

11 years agosim: Fix two bugs relating to software caching of PageTable entries.
Mitch Hayenga [Tue, 23 Apr 2013 13:47:52 +0000 (09:47 -0400)]
sim: Fix two bugs relating to software caching of PageTable entries.

The existing implementation can read uninitialized data or stale information
from the cached PageTable entries.

1) Add a valid bit for the cache entries.  Simply using zero for the virtual
address to signify invalid entries is not sufficient.  Speculative, wrong-path
accesses frequently access page zero.  The current implementation would return
a uninitialized TLB entry when address zero was accessed and the PageTable
cache entry was invalid.

2) When unmapping/mapping/remaping a page, invalidate the corresponding
PageTable cache entry if one already exists.

11 years agocpu: Fix TraceGen flag initalisation
Andreas Hansson [Tue, 23 Apr 2013 09:07:10 +0000 (05:07 -0400)]
cpu: Fix TraceGen flag initalisation

This patch ensures the flags are always initialised.

11 years agox86: regressions: add switcher full test
Nilay Vaish [Tue, 23 Apr 2013 05:03:09 +0000 (00:03 -0500)]
x86: regressions: add switcher full test

11 years agoruby: mesi coherence protocol: remove unused state M_MB
Nilay Vaish [Tue, 23 Apr 2013 05:03:07 +0000 (00:03 -0500)]
ruby: mesi coherence protocol: remove unused state M_MB

11 years agox86, stats: updates due to lret bugfix
Nilay Vaish [Tue, 23 Apr 2013 05:03:05 +0000 (00:03 -0500)]
x86, stats: updates due to lret bugfix

11 years agox86: increment the stack pointer in lret inst
Christian Menard [Tue, 23 Apr 2013 05:03:04 +0000 (00:03 -0500)]
x86: increment the stack pointer in lret inst
The 'lret' instruction reloads instruction pointer and code segment from the
stack and then pops them. But the popping part is missing from the current
implementation. This caused incorrect behavior in some code related to the
Fiasco OS. Microops are being added to rectify the behavior of the instruction.

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

11 years agoruby: patch checkpoint restore with garnet
Nilay Vaish [Tue, 23 Apr 2013 05:03:02 +0000 (00:03 -0500)]
ruby: patch checkpoint restore with garnet
Due to recent changes to clocking system in Ruby and the way Ruby restores
state from a checkpoint, garnet was failing to run from a checkpointed state.
The problem is that Ruby resets the time to zero while warming up the caches.
If any component records a local copy of the time (read calls curCycle())
before the simulation has started, then that component will not operate until
that time is reached. In the context of this particular patch, the Garnet
Network class calls curCycle() at multiple places. Any non-operational
component can block in requests in the memory system, which the system
interprets as a deadlock. This patch makes changes so that Garnet can
successfully run from checkpointed state.

It adds a globally visible time at which the actual execution started. This
time is initialized in RubySystem::startup() function. This variable is only
meant for components with in Ruby. This replaces the private variable that
was maintained within Garnet since it is not possible to figure out the
correct time when the value of this variable can be set.

The patch also does away with all cases where curCycle() is called with in
some Ruby component before the system has actually started executing. This
is required due to the quirky manner in which ruby restores from a checkpoint.

11 years agomem: Address mapping with fine-grained channel interleaving
Andreas Hansson [Mon, 22 Apr 2013 17:20:34 +0000 (13:20 -0400)]
mem: Address mapping with fine-grained channel interleaving

This patch adds an address mapping scheme where the channel
interleaving takes place on a cache line granularity. It is similar to
the existing RaBaChCo that interleaves on a DRAM page, but should give
higher performance when there is less locality in the address
stream.

11 years agomem: More descriptive enum names for address mapping
Andreas Hansson [Mon, 22 Apr 2013 17:20:33 +0000 (13:20 -0400)]
mem: More descriptive enum names for address mapping

This patch changes the slightly ambigious names used for the address
mapping scheme to be more descriptive, and actually spell out what
they do. With this patch we also open up for adding more flavours of
open- and close-type mappings, i.e. interleaving across channels with
the open map.

11 years agocpu: Use request flags in trace playback
Andreas Hansson [Mon, 22 Apr 2013 17:20:33 +0000 (13:20 -0400)]
cpu: Use request flags in trace playback

This patch changes the TraceGen such that it uses the optional request
flags from the protobuf trace if they are present.

11 years agocpu: Make the generators usable outside the TrafficGen module
Andreas Hansson [Mon, 22 Apr 2013 17:20:33 +0000 (13:20 -0400)]
cpu: Make the generators usable outside the TrafficGen module

This patch enables the use of the generator behaviours outside the
TrafficGen module. This is useful e.g. to allow packet replay modes
for other devices in the system without having to replace them with a
TrafficGen in the configuration files.

This change also enables more specific behaviours to be composed as
specific modules, e.g. BaseBandModem can use a number of generators
and have application-specific parameters based around a specific set
of generators.

11 years agoconfig: Add a mem-type config option to se/fs scripts
Andreas Hansson [Mon, 22 Apr 2013 17:20:33 +0000 (13:20 -0400)]
config: Add a mem-type config option to se/fs scripts

This patch enables selection of the memory controller class through a
mem-type command-line option. Behind the scenes, this option is
treated much like the cpu-type, and a similar framework is used to
resolve the valid options, and translate the short-hand description to
a valid class.

The regression scripts are updated with a hardcoded memory class for
the moment. The best solution going forward is probably to get the
memory out of the makeSystem functions, but Ruby complicates things as
it does not connect the memory controller to the membus.

--HG--
rename : configs/common/CpuConfig.py => configs/common/MemConfig.py

11 years agomem: Add a WideIO DRAM configuration
Andreas Hansson [Mon, 22 Apr 2013 17:20:33 +0000 (13:20 -0400)]
mem: Add a WideIO DRAM configuration

This patch adds a WideIO 200 MHz configuration that can be used as a
baseline to compare with DDRx and LPDDRx. Note that it is a single
channel and that it should be replicated 4 times. It is based on
publically available information and attempts to capture an envisioned
8 Gbit single-die part (i.e. without TSVs).

11 years agomem: Adding verbose debug output in the memory system
Uri Wiener [Mon, 22 Apr 2013 17:20:33 +0000 (13:20 -0400)]
mem: Adding verbose debug output in the memory system

This patch provides useful printouts throughut the memory system. This
includes pretty-printed cache tags and function call messages
(call-stack like).

11 years agomem: Replace check with panic where inhibited should not happen
Andreas Hansson [Mon, 22 Apr 2013 17:20:33 +0000 (13:20 -0400)]
mem: Replace check with panic where inhibited should not happen

This patch changes the SimpleTimingPort and RubyPort to panic on
inhibited requests as this should never happen in either of the
cases. The SimpleTimingPort is only used for the I/O devices PIO port
and the DMA devices config port and should thus never see an inhibited
request. Similarly, the SimpleTimingPort is also used for the
MessagePort in x86, and there should also not be any cases where the
port sees an inhibited request.

11 years agostats: Update stats for O3 switching fix.
Ali Saidi [Mon, 22 Apr 2013 17:20:33 +0000 (13:20 -0400)]
stats: Update stats for O3 switching fix.

11 years agokvm: Add support for pseudo-ops on ARM
Andreas Sandberg [Mon, 22 Apr 2013 17:20:32 +0000 (13:20 -0400)]
kvm: Add support for pseudo-ops on ARM

This changeset adds support for m5 pseudo-ops when running in
kvm-mode. Unfortunately, we can't trap the normal gem5 co-processor
entry in KVM (it doesn't seem to be possible to trap accesses to
non-existing co-processors). We therefore use BZJ instructions to
cause a trap from virtualized mode into gem5. The BZJ instruction is
becomes a normal branch to the gem5 fallback code when running in
simulated mode, which means that this patch does not need to change
the ARM ISA-specific code.

Note: This requires a patched host kernel.

11 years agosim: Add a helper function to execute pseudo instructions
Andreas Sandberg [Mon, 22 Apr 2013 17:20:32 +0000 (13:20 -0400)]
sim: Add a helper function to execute pseudo instructions

All architectures execute m5 pseudo instructions by setting up
arguments according to the ABI and executing a magic instruction that
contains an operation number. Handling of such instructions is
currently spread across the different ISA implementations. This
changeset introduces the PseudoInst::pseudoInst function which handles
most of this in an architecture independent way. This is function is
mainly intended to be used from KVM, but can also be used from the
simulated CPUs.

11 years agokvm: Add support for state dumping on ARM
Andreas Sandberg [Mon, 22 Apr 2013 17:20:32 +0000 (13:20 -0400)]
kvm: Add support for state dumping on ARM

11 years agokvm: Add basic support for ARM
Andreas Sandberg [Mon, 22 Apr 2013 17:20:32 +0000 (13:20 -0400)]
kvm: Add basic support for ARM

Architecture specific limitations:
 * LPAE is currently not supported by gem5. We therefore panic if LPAE
   is enabled when returning to gem5.
 * The co-processor based interface to the architected timer is
   unsupported. We can't support this due to limitations in the KVM
   API on ARM.
 * M5 ops are currently not supported. This requires either a kernel
   hack or a memory mapped device that handles the guest<->m5
   interface.