gem5.git
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.

11 years agoarm: Add a method to query interrupt state ignoring CPSR masks
Andreas Sandberg [Mon, 22 Apr 2013 17:20:32 +0000 (13:20 -0400)]
arm: Add a method to query interrupt state ignoring CPSR masks

Add the method checkRaw to ArmISA::Interrupts. This method can be used
to query the raw state (ignoring CPSR masks) of an interrupt. It is
primarily intended for hardware virtualized CPUs.

11 years agokvm: Add experimental support for a perf-based execution timer
Andreas Sandberg [Mon, 22 Apr 2013 17:20:32 +0000 (13:20 -0400)]
kvm: Add experimental support for a perf-based execution timer

Add support for using the CPU cycle counter instead of a normal POSIX
timer to generate timed exits to gem5. This should, in theory, provide
better resolution when requesting timer signals.

The perf-based timer requires a fairly recent kernel since it requires
a working PERF_EVENT_IOC_PERIOD ioctl. This ioctl has existed in the
kernel for a long time, but it used to be completely broken due to an
inverted match when the kernel copied things from user
space. Additionally, the ioctl does not change the sample period
correctly on all kernel versions which implement it. It is currently
only known to work reliably on kernel version 3.7 and above on ARM.

11 years agotests: Add support for testing KVM-based CPUs
Andreas Sandberg [Mon, 22 Apr 2013 17:20:32 +0000 (13:20 -0400)]
tests: Add support for testing KVM-based CPUs

This changeset adds support for initializing a KVM VM in the
BaseSystem test class and adds the following methods in run.py:

require_file -- Test if a file exists and abort/skip if not.
require_kvm -- Test if KVM support has been compiled into gem5 (i.e.,
       BaseKvmCPU exists) and the KVM device exists on the
       host.

11 years agoconfig: Add a KVM VM to systems with KVM CPUs
Andreas Sandberg [Mon, 22 Apr 2013 17:20:32 +0000 (13:20 -0400)]
config: Add a KVM VM to systems with KVM CPUs

KVM-based CPUs need a KVM VM object in the system to manage
system-global KVM stuff (VM creation, interrupt delivery, memory
managment, etc.). This changeset adds a VM to the system if KVM has
been enabled at compile time (the BaseKvmCPU object exists) and a
KVM-based CPU has been selected at runtime.

11 years agokvm: Avoid synchronizing the TC on every KVM exit
Andreas Sandberg [Mon, 22 Apr 2013 17:20:32 +0000 (13:20 -0400)]
kvm: Avoid synchronizing the TC on every KVM exit

Reduce the number of KVM->TC synchronizations by overloading the
getContext() method and only request an update when the TC is
requested as opposed to every time KVM returns to gem5.

11 years agokvm: Basic support for hardware virtualized CPUs
Andreas Sandberg [Mon, 22 Apr 2013 17:20:32 +0000 (13:20 -0400)]
kvm: Basic support for hardware virtualized CPUs

This changeset introduces the architecture independent parts required
to support KVM-accelerated CPUs. It introduces two new simulation
objects:

KvmVM -- The KVM VM is a component shared between all CPUs in a shared
         memory domain. It is typically instantiated as a child of the
         system object in the simulation hierarchy. It provides access
         to KVM VM specific interfaces.

BaseKvmCPU -- Abstract base class for all KVM-based CPUs. Architecture
      dependent CPU implementations inherit from this class
      and implement the following methods:

                * updateKvmState() -- Update the
                  architecture-dependent KVM state from the gem5
                  thread context associated with the CPU.

                * updateThreadContext() -- Update the thread context
                  from the architecture-dependent KVM state.

                * dump() -- Dump the KVM state using (optional).

      In order to deliver interrupts to the guest, CPU
      implementations typically override the tick() method and
      check for, and deliver, interrupts prior to entering
      KVM.

Hardware-virutalized CPU currently have the following limitations:
 * SE mode is not supported.
 * PC events are not supported.
 * Timing statistics are currently very limited. The current approach
   simply scales the host cycles with a user-configurable factor.
 * The simulated system must not contain any caches.
 * Since cycle counts are approximate, there is no way to request an
   exact number of cycles (or instructions) to be executed by the CPU.
 * Hardware virtualized CPUs and gem5 CPUs must not execute at the
   same time in the same simulator instance.
 * Only single-CPU systems can be simulated.
 * Remote GDB connections to the guest system are not supported.

Additionally, m5ops requires an architecture specific interface and
might not be supported.

11 years agocpu: Let python scripts obtain the number of instructions executed
Timothy M. Jones [Mon, 22 Apr 2013 17:20:31 +0000 (13:20 -0400)]
cpu: Let python scripts obtain the number of instructions executed

11 years agoarm: Enable support for triggering a sim panic on kernel panics
Andreas Sandberg [Mon, 22 Apr 2013 17:20:31 +0000 (13:20 -0400)]
arm: Enable support for triggering a sim panic on kernel panics

Add the options 'panic_on_panic' and 'panic_on_oops' to the
LinuxArmSystem SimObject. When these option are enabled, the simulator
panics when the guest kernel panics or oopses. Enable panic on panic
and panic on oops in ARM-based test cases.

11 years agosim: separate nextCycle() and clockEdge() in clockedObjects
Dam Sunwoo [Mon, 22 Apr 2013 17:20:31 +0000 (13:20 -0400)]
sim: separate nextCycle() and clockEdge() in clockedObjects

Previously, nextCycle() could return the *current* cycle if the current tick was
already aligned with the clock edge. This behavior is not only confusing (not
quite what the function name implies), but also caused problems in the
drainResume() function. When exiting/re-entering the sim loop (e.g., to take
checkpoints), the CPUs will drain and resume. Due to the previous behavior of
nextCycle(), the CPU tick events were being rescheduled in the same ticks that
were already processed before draining. This caused divergence from runs that
did not exit/re-entered the sim loop. (Initially a cycle difference, but a
significant impact later on.)

This patch separates out the two behaviors (nextCycle() and clockEdge()),
uses nextCycle() in drainResume, and uses clockEdge() everywhere else.
Nothing (other than name) should change except for the drainResume timing.

11 years agocpu: generate SimPoint basic block vector profiles
Dam Sunwoo [Mon, 22 Apr 2013 17:20:31 +0000 (13:20 -0400)]
cpu: generate SimPoint basic block vector profiles

This patch is based on http://reviews.m5sim.org/r/1474/ originally written by
Mitch Hayenga. Basic block vectors are generated (simpoint.bb.gz in simout
folder) based on start and end addresses of basic blocks.

Some comments to the original patch are addressed and hooks are added to create
and resume from checkpoints based on instruction counts dictated by external
SimPoint analysis tools.

SimPoint creation/resuming options will be implemented as a separate patch.

11 years agoARM: Add support for HDLCD controller for TC2 and newer Versatile Express tiles.
Chris Emmons [Mon, 22 Apr 2013 17:20:31 +0000 (13:20 -0400)]
ARM: Add support for HDLCD controller for TC2 and newer Versatile Express tiles.

Newer core tiles / daughterboards for the Versatile Express platform have an
HDLCD controller that supports HD-quality output.  This patch adds an
implementation of the controller.

11 years agosim: Add helper functions that add PCEvents with custom arguments
Andreas Sandberg [Mon, 22 Apr 2013 17:20:31 +0000 (13:20 -0400)]
sim: Add helper functions that add PCEvents with custom arguments

This changeset adds support for forwarding arguments to the PC
event constructors to following methods:

addKernelFuncEvent
addFuncEvent

Additionally, this changeset adds the following helper method to the
System base class:

addFuncEventOrPanic - Hook a PCEvent to a symbol, panic on failure.

addKernelFuncEventOrPanic - Hook a PCEvent to a kernel symbol, panic
                            on failure.

System implementations have been updated to use the new functionality
where appropriate.

11 years agocpu: fix a switching issue with the o3 cpu. stable_2013_06_16
Ali Saidi [Mon, 22 Apr 2013 17:20:31 +0000 (13:20 -0400)]
cpu: fix a switching issue with the o3 cpu.

This change fixes the switcheroo test that broke earlier this month. The code
that was checking for the pipeline being blocked wasn't checking for a pending
translation, only for a icache access.

11 years agostats: Update stats for ldr_ret_uop (changeset 35198406dd72)
Andreas Hansson [Fri, 19 Apr 2013 13:04:42 +0000 (09:04 -0400)]
stats: Update stats for ldr_ret_uop (changeset 35198406dd72)

This patch merely bumps the stats to match the changes introduced in
changeset 35198406dd72.

11 years agoMerged c22628fa2564 and 2285b98847d7
Nilay Vaish [Wed, 17 Apr 2013 21:09:37 +0000 (16:09 -0500)]
Merged c22628fa2564 and 2285b98847d7

11 years agobase: load weak symbols from object file
Deyuan Guo ext:(%2C%20Nilay%20Vaish%20%3Cnilay%40cs.wisc.edu%3E) [Wed, 17 Apr 2013 21:07:19 +0000 (16:07 -0500)]
base: load weak symbols from object file
Without loading weak symbols into gem5, some function names and the given PC
cannot correspond correctly, because the binding attributes of unction names
in an ELF file are not only STB_GLOBAL or STB_LOCAL, but also STB_WEAK. This
patch adds a function for loading weak symbols.

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

11 years agoarm: set ldr_ret_uop as conditional or unconditional control
Nathanael Premillieu [Wed, 17 Apr 2013 21:07:10 +0000 (16:07 -0500)]
arm: set ldr_ret_uop as conditional or unconditional control
This patch adds a missing flag to the ldr_ret_uop microop instruction.
The flag is added when the instruction is used, not directly in the
constructor of the instruction.

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

11 years agoruby: moesi cmp directory: add copyright notice
Nilay Vaish [Wed, 17 Apr 2013 21:06:58 +0000 (16:06 -0500)]
ruby: moesi cmp directory: add copyright notice

11 years agoconfig: ruby network test: remove piobus check
Nilay Vaish [Wed, 17 Apr 2013 21:06:24 +0000 (16:06 -0500)]
config: ruby network test: remove piobus check

11 years agodev: Fix a bug in the use of seekp/seekg
Andreas Hansson [Wed, 17 Apr 2013 12:17:03 +0000 (08:17 -0400)]
dev: Fix a bug in the use of seekp/seekg

This patch fixes two instances of incorrect use of the seekp/seekg
stream member functions. These two functions return a stream reference
(*this), and should not be compared to an integer value.

11 years agostats: Bump the vortex stats to match latest behaviour
Andreas Hansson [Tue, 16 Apr 2013 10:26:49 +0000 (06:26 -0400)]
stats: Bump the vortex stats to match latest behaviour

This patch bumps the stats for the failing vortex o3 regression.

11 years agostats: Bump Ruby stats for new changesets
Joel Hestness [Tue, 9 Apr 2013 21:41:12 +0000 (16:41 -0500)]
stats: Bump Ruby stats for new changesets

The new changeset that can reorder Ruby profilers will cause the ruby.stats
files to reordered statistics (the point of the patch). Update the references
to ensure that these changes are reflected in regressions.

11 years agoConfigs: Fix handling of maxtick and take_checkpoints
Joel Hestness [Tue, 9 Apr 2013 21:25:30 +0000 (16:25 -0500)]
Configs: Fix handling of maxtick and take_checkpoints

In Simulation.py, calls to m5.simulate(num_ticks) will run the simulated system
for num_ticks after the current tick. Fix calls to m5.simulate in
scriptCheckpoints() and benchCheckpoints() to appropriately handle the maxticks
variable.

11 years agoRuby: Fix RubyPort evict packet memory leak
Joel Hestness [Tue, 9 Apr 2013 21:25:30 +0000 (16:25 -0500)]
Ruby: Fix RubyPort evict packet memory leak

When using the o3 or inorder CPUs with many Ruby protocols, the caches may
need to forward invalidations to the CPUs. The RubyPort was instantiating a
packet to be sent to the CPUs to signal the eviction, but the packets were
not being freed by the CPUs. Consistent with the classic memory model, stack
allocate the packet and heap allocate the request so on
ruby_eviction_callback() completion, the packet deconstructor is called, and
deletes the request (*Note: stack allocating the request causes double
deletion, since it will be deleted in the packet destructor). This results in
the least memory allocations without memory errors.

11 years agoRuby: Delete packet requests during warmup
Joel Hestness [Tue, 9 Apr 2013 21:25:29 +0000 (16:25 -0500)]
Ruby: Delete packet requests during warmup

When warming up caches in Ruby, the CacheRecorder sends fetch requests into
Ruby Sequencers with packet types that require responses. Since responses are
never generated for these CacheRecorder requests, the requests are not deleted
in the packet destructor called from the Ruby hit callback. Free the request.