gem5.git
12 years agomem: fix bug with CopyStringOut and null string termination.
Ali Saidi [Thu, 10 May 2012 23:04:27 +0000 (18:04 -0500)]
mem: fix bug with CopyStringOut and null string termination.

12 years agoCache: restructure code that actually isn't a loop
Ali Saidi [Thu, 10 May 2012 23:04:27 +0000 (18:04 -0500)]
Cache: restructure code that actually isn't a loop

12 years agodev: use correct delete operation in SimpleDisk
Ali Saidi [Thu, 10 May 2012 23:04:27 +0000 (18:04 -0500)]
dev: use correct delete operation in SimpleDisk

12 years agoARM: Fix incorrect use of not operators in arm devices
Ali Saidi [Thu, 10 May 2012 23:04:27 +0000 (18:04 -0500)]
ARM: Fix incorrect use of not operators in arm devices

12 years agogem5: assert before indexing intro arrays to verify bounds
Ali Saidi [Thu, 10 May 2012 23:04:27 +0000 (18:04 -0500)]
gem5: assert before indexing intro arrays to verify bounds

12 years agogem5: fix some iterator use and erase bugs
Ali Saidi [Thu, 10 May 2012 23:04:27 +0000 (18:04 -0500)]
gem5: fix some iterator use and erase bugs

12 years agogem5: fix a number of use after free issues
Ali Saidi [Thu, 10 May 2012 23:04:27 +0000 (18:04 -0500)]
gem5: fix a number of use after free issues

12 years agobase: fix a invalid ?: operator
Ali Saidi [Thu, 10 May 2012 23:04:27 +0000 (18:04 -0500)]
base: fix a invalid ?: operator

12 years agogem5: Fix a number of incorrect case statements
Ali Saidi [Thu, 10 May 2012 23:04:26 +0000 (18:04 -0500)]
gem5: Fix a number of incorrect case statements

12 years agoARM: Update m5op assembly for thumb compilation.
Ali Saidi [Thu, 10 May 2012 23:04:26 +0000 (18:04 -0500)]
ARM: Update m5op assembly for thumb compilation.

12 years agostats: track if the stats have been enabled and prevent requesting master id
Ali Saidi [Thu, 10 May 2012 23:04:26 +0000 (18:04 -0500)]
stats: track if the stats have been enabled and prevent requesting master id

Track the point in the initialization where statistics have been registered.
After this point registering new masterIds can no longer work as some
SimObjects may have sized stats vectors based on the previous value. If someone
tries to register a masterId after this point the simulator executes fatal().

12 years agoCache: Panic if you attempt to create a checkpoint with a cache in the system
Ali Saidi [Thu, 10 May 2012 23:04:26 +0000 (18:04 -0500)]
Cache: Panic if you attempt to create a checkpoint with a cache in the system

12 years agoIGbE: Fix writeback conditions for i8254x GbE in updated data sheet.
Pritha Ghoshal [Thu, 10 May 2012 23:04:26 +0000 (18:04 -0500)]
IGbE: Fix writeback conditions for i8254x GbE in updated data sheet.

An older revision of the data sheet specified that txdctl.gran was 1 the granularity was
based on cache block and gran being 0 is based on descriptor count. The newer version of
the data sheet reverses this errata

12 years agostats: update stats for no_value -> nan
Nathan Binkert [Wed, 9 May 2012 18:52:14 +0000 (11:52 -0700)]
stats: update stats for no_value -> nan
Lots of accumulated older changes too.

12 years agostats: use nan instead of no_value
Nathan Binkert [Wed, 9 May 2012 18:51:42 +0000 (11:51 -0700)]
stats: use nan instead of no_value

12 years agoMEM: Add the communication monitor
Andreas Hansson [Wed, 9 May 2012 08:37:45 +0000 (04:37 -0400)]
MEM: Add the communication monitor

This patch adds a communication monitor MemObject that can be inserted
between a master and slave port to provide a range of statistics about
the communication passing through it. The communication monitor is
non-invasive and does not change any properties or timing of the
packets, with the exception of adding a sender state to be able to
track latency. The statistics are only collected in timing mode (not
atomic) to avoid slowing down any fast forwarding.

An example of the statistics captured by the monitor are: read/write
burst lengths, bandwidth, request-response latency, outstanding
transactions, inter transaction time, transaction count, and address
distribution. The monitor can be used in combination with periodic
resetting and dumping of stats (through schedStatEvent) to study the
behaviour over time.

In future patches, a selection of convenience scripts will be added to
aid in visualising the statistics collected by the monitor.

12 years agoscons: allow override of SWIG binary on command line
Steve Reinhardt [Tue, 8 May 2012 14:49:57 +0000 (07:49 -0700)]
scons: allow override of SWIG binary on command line

12 years agoMEM: Do not forward uncacheable to bus snoopers
Andreas Hansson [Tue, 8 May 2012 09:15:52 +0000 (05:15 -0400)]
MEM: Do not forward uncacheable to bus snoopers

This patch adds a guarding if-statement to avoid forwarding
uncacheable requests (or rather their corresponding request packets)
to bus snoopers. These packets should never have any effect on the
caches, and thus there is no need to forward them to the snoopers.

12 years agoRuby: Ensure snoop requests are sent using sendTimingSnoopReq
Andreas Hansson [Fri, 4 May 2012 07:30:02 +0000 (03:30 -0400)]
Ruby: Ensure snoop requests are sent using sendTimingSnoopReq

This patch fixes a bug that caused snoop requests to be placed in a
packet queue. Instead, the packet is now sent immediately using
sendTimingSnoopReq, thus bypassing the packet queue and any normal
responses waiting to be sent.

12 years agoRegression: Move x86 fs ruby simulation from quick to long
Nilay Vaish [Fri, 4 May 2012 04:18:13 +0000 (23:18 -0500)]
Regression: Move x86 fs ruby simulation from quick to long

--HG--
rename : tests/quick/fs/10.linux-boot/ref/x86/linux/pc-simple-timing-ruby-MESI_CMP_directory/config.ini => tests/long/fs/10.linux-boot/ref/x86/linux/pc-simple-timing-ruby-MESI_CMP_directory/config.ini
rename : tests/quick/fs/10.linux-boot/ref/x86/linux/pc-simple-timing-ruby-MESI_CMP_directory/ruby.stats => tests/long/fs/10.linux-boot/ref/x86/linux/pc-simple-timing-ruby-MESI_CMP_directory/ruby.stats
rename : tests/quick/fs/10.linux-boot/ref/x86/linux/pc-simple-timing-ruby-MESI_CMP_directory/simerr => tests/long/fs/10.linux-boot/ref/x86/linux/pc-simple-timing-ruby-MESI_CMP_directory/simerr
rename : tests/quick/fs/10.linux-boot/ref/x86/linux/pc-simple-timing-ruby-MESI_CMP_directory/simout => tests/long/fs/10.linux-boot/ref/x86/linux/pc-simple-timing-ruby-MESI_CMP_directory/simout
rename : tests/quick/fs/10.linux-boot/ref/x86/linux/pc-simple-timing-ruby-MESI_CMP_directory/stats.txt => tests/long/fs/10.linux-boot/ref/x86/linux/pc-simple-timing-ruby-MESI_CMP_directory/stats.txt
rename : tests/quick/fs/10.linux-boot/ref/x86/linux/pc-simple-timing-ruby-MESI_CMP_directory/system.pc.com_1.terminal => tests/long/fs/10.linux-boot/ref/x86/linux/pc-simple-timing-ruby-MESI_CMP_directory/system.pc.com_1.terminal

12 years agoConfig: Fix help msg for option --mem-size
Jayneel Gandhi [Thu, 3 May 2012 10:17:29 +0000 (05:17 -0500)]
Config: Fix help msg for option --mem-size

12 years agoMEM: Separate requests and responses for timing accesses
Andreas Hansson [Tue, 1 May 2012 17:40:42 +0000 (13:40 -0400)]
MEM: Separate requests and responses for timing accesses

This patch moves send/recvTiming and send/recvTimingSnoop from the
Port base class to the MasterPort and SlavePort, and also splits them
into separate member functions for requests and responses:
send/recvTimingReq, send/recvTimingResp, and send/recvTimingSnoopReq,
send/recvTimingSnoopResp. A master port sends requests and receives
responses, and also receives snoop requests and sends snoop
responses. A slave port has the reciprocal behaviour as it receives
requests and sends responses, and sends snoop requests and receives
snoop responses.

For all MemObjects that have only master ports or slave ports (but not
both), e.g. a CPU, or a PIO device, this patch merely adds more
clarity to what kind of access is taking place. For example, a CPU
port used to call sendTiming, and will now call
sendTimingReq. Similarly, a response previously came back through
recvTiming, which is now recvTimingResp. For the modules that have
both master and slave ports, e.g. the bus, the behaviour was
previously relying on branches based on pkt->isRequest(), and this is
now replaced with a direct call to the apprioriate member function
depending on the type of access. Please note that send/recvRetry is
still shared by all the timing accessors and remains in the Port base
class for now (to maintain the current bus functionality and avoid
changing the statistics of all regressions).

The packet queue is split into a MasterPort and SlavePort version to
facilitate the use of the new timing accessors. All uses of the
PacketQueue are updated accordingly.

With this patch, the type of packet (request or response) is now well
defined for each type of access, and asserts on pkt->isRequest() and
pkt->isResponse() are now moved to the appropriate send member
functions. It is also worth noting that sendTimingSnoopReq no longer
returns a boolean, as the semantics do not alow snoop requests to be
rejected or stalled. All these assumptions are now excplicitly part of
the port interface itself.

12 years agoRegression: Stats update for X86 Ruby FS test
Nilay Vaish [Mon, 30 Apr 2012 08:47:22 +0000 (03:47 -0500)]
Regression: Stats update for X86 Ruby FS test
The kernel originally used to generate the stats is different from the one
at use on zizzer. This patch updates the stats with the correct kernel in
use.

12 years agoX86: Fix the IMUL_R_P_I macroop.
Gabe Black [Sun, 29 Apr 2012 09:26:34 +0000 (02:26 -0700)]
X86: Fix the IMUL_R_P_I macroop.

The disp displacement was left off the load microop so the wrong value was
used.

12 years agoX86: Fix up the open system call's flags.
Vince Weaver [Sun, 29 Apr 2012 07:31:03 +0000 (00:31 -0700)]
X86: Fix up the open system call's flags.

12 years agoX86: Make gem5 ignore a bunch of syscalls.
Vince Weaver [Sun, 29 Apr 2012 07:30:56 +0000 (00:30 -0700)]
X86: Make gem5 ignore a bunch of syscalls.

12 years agoGarnet: Correct computation of link utilization
Nilay Vaish [Sat, 28 Apr 2012 21:57:31 +0000 (16:57 -0500)]
Garnet: Correct computation of link utilization
The computation for link utilization was incorrect for the flexible network.
The utilization was being divided twice by the total time.

12 years agoutil/regress: Add the missing comma in the list of builds
Nilay Vaish [Fri, 27 Apr 2012 01:28:45 +0000 (20:28 -0500)]
util/regress: Add the missing comma in the list of builds

12 years agoRegression: Add a test for x86 timing full system ruby simulation
Nilay Vaish [Thu, 26 Apr 2012 03:43:36 +0000 (22:43 -0500)]
Regression: Add a test for x86 timing full system ruby simulation

12 years agoRuby: Remove extra statements from Sequencer
Nilay Vaish [Wed, 25 Apr 2012 22:52:03 +0000 (17:52 -0500)]
Ruby: Remove extra statements from Sequencer

12 years agoMEM: Use base class Master/SlavePort pointers in the bus
Andreas Hansson [Wed, 25 Apr 2012 14:45:23 +0000 (10:45 -0400)]
MEM: Use base class Master/SlavePort pointers in the bus

This patch makes some rather trivial simplifications to the bus in
that it changes the use of BusMasterPort and BusSlavePort pointers to
simply use MasterPort and SlavePort (iterators are also updated
accordingly).

This change is a step towards a future patch that introduces a
separation of the interface and the structural port itself.

12 years agoMEM: Add the PortId type and a corresponding id field to Port
Andreas Hansson [Wed, 25 Apr 2012 14:41:23 +0000 (10:41 -0400)]
MEM: Add the PortId type and a corresponding id field to Port

This patch introduces the PortId type, moves the definition of
INVALID_PORT_ID to the Port class, and also gives every port an id to
reflect the fact that each element in a vector port has an
identifier/index.

Previously the bus and Ruby testers (and potentially other users of
the vector ports) added the id field in their port subclasses, and now
this functionality is always present as it is moved to the base class.

12 years agoclang/gcc: Use STL hash function for int64_t and uint64_t
Andreas Hansson [Wed, 25 Apr 2012 12:57:18 +0000 (08:57 -0400)]
clang/gcc: Use STL hash function for int64_t and uint64_t

This patch changes the guards for the definition of hash functions to
also exclude the int64_t and uint64_t hash functions in the case we
are using the c++0x STL <unordered_map> (and <hash>) or the TR1
version of the same header. Previously the guard only covered the hash
function for strings, but it seems there is also no need to define a
hash for the 64-bit integer types, and this has caused problems with
builds on 32-bit Ubuntu.

12 years agoX86: Update stats for the slightly changed TLB behavior.
Gabe Black [Tue, 24 Apr 2012 07:48:57 +0000 (00:48 -0700)]
X86: Update stats for the slightly changed TLB behavior.

12 years agoX86: Clear out duplicate TLB entries when adding a new one.
Gabe Black [Tue, 24 Apr 2012 07:48:41 +0000 (00:48 -0700)]
X86: Clear out duplicate TLB entries when adding a new one.

It's possible for two page table walks to overlap which will go in the same
place in the TLB's trie. They would land on top of each other, so this change
adds some code which detects if an address already matches an entry and if so
throws away the new one.

12 years agoISA: Put parser generated files in a "generated" directory.
Gabe Black [Mon, 23 Apr 2012 19:00:41 +0000 (12:00 -0700)]
ISA: Put parser generated files in a "generated" directory.

This is to avoid collision with non-generated files.

12 years agoscons: update minimum SWIG version to 1.3.34
Steve Reinhardt [Mon, 23 Apr 2012 16:25:16 +0000 (09:25 -0700)]
scons: update minimum SWIG version to 1.3.34

We should try to keep this synced with the wiki
(which I also just updated, but which was
previously inconsistent).

12 years agobase: Include cassert in trie.hh.
Gabe Black [Sun, 22 Apr 2012 12:20:44 +0000 (05:20 -0700)]
base: Include cassert in trie.hh.

trie.hh uses assert, but it wasn't explicitly including cassert.

12 years agoX86: Report an error if there's no kernel object, don't blindly use it.
Gabe Black [Sat, 21 Apr 2012 22:00:23 +0000 (15:00 -0700)]
X86: Report an error if there's no kernel object, don't blindly use it.

This way the user gets a nice message instead of a less nice segfault.

12 years agoSE Config: Changed se.py to support multithreaded mode
Jayneel Gandhi [Tue, 17 Apr 2012 21:12:41 +0000 (16:12 -0500)]
SE Config: Changed se.py to support multithreaded mode
Multithreaded programs did not run by just specifying the binary once on the
command line of SE mode.The default mode is multi-programmed mode. Added
check in SE mode to run multi-threaded programs in case only one program is
specified with multiple CPUS. Default mode is still multi-programmed mode.

12 years agoConfig: Add command line options for disk image and memory size
Jayneel Gandhi [Mon, 16 Apr 2012 22:51:26 +0000 (17:51 -0500)]
Config: Add command line options for disk image and memory size
Added the options to Options.py for FS mode with backward compatibility. It is
good to provide an option to specify the disk image and the memory size from
command line since a lot of disk images are created to support different
benchmark suites as well as per user needs. Change in program also leads to
change in memory requirements. These options provide the interface to provide
both disk image and memory size from the command line and gives more
flexibility.

12 years agoCPU: Tidy up some formatting and a DPRINTF in the simple CPU base class.
Gabe Black [Sun, 15 Apr 2012 19:35:49 +0000 (12:35 -0700)]
CPU: Tidy up some formatting and a DPRINTF in the simple CPU base class.

Put the { on the same line as the if and put a space between the if and the
open paren. Also, use the # format modifier which puts a 0x in front of hex
values automatically. If the ExtMachInst type isn't integral and actually
prints something more complicated, the # falls away harmlessly and we aren't
left with a phantom 0x followed by a bunch of unrelated text.

12 years agoX86: Fix a tiny typo in the load/store microop constructor.
Gabe Black [Sun, 15 Apr 2012 08:07:39 +0000 (01:07 -0700)]
X86: Fix a tiny typo in the load/store microop constructor.

The parameter is _machInst, which is very similar to the member machInst. If
machInst is used to pass the parameter to a lower level constructor, what
really happens is that machInst is set to whatever it already happened to be,
effectively leaving it uninitialized.

12 years agoX86: Use the AddrTrie class to implement the TLB.
Gabe Black [Sun, 15 Apr 2012 06:24:18 +0000 (23:24 -0700)]
X86: Use the AddrTrie class to implement the TLB.

This change also adjusts the TlbEntry class so that it stores the number of
address bits wide a page is rather than its size in bytes. In other words,
instead of storing 4K for a 4K page, it stores 12. 12 is easy to turn into 4K,
but it's a little harder going the other way.

12 years agosim: Update some comments in trie.hh that were meant to go in the last change.
Gabe Black [Sun, 15 Apr 2012 06:22:57 +0000 (23:22 -0700)]
sim: Update some comments in trie.hh that were meant to go in the last change.

12 years agosim: A trie data structure specifically to speed up paging lookups.
Gabe Black [Sun, 15 Apr 2012 06:19:34 +0000 (23:19 -0700)]
sim: A trie data structure specifically to speed up paging lookups.

This change adds a trie data structure which stores an arbitrary pointer type
based on an address and a number of relevant bits. Then lookups can be done
against the trie where the tree is traversed and the first legitimate match
found is returned.

12 years agoRuby: Use MasterPort base-class pointers where possible
Andreas Hansson [Sat, 14 Apr 2012 09:46:59 +0000 (05:46 -0400)]
Ruby: Use MasterPort base-class pointers where possible

This patch simplifies future patches by changing the pointer type used
in a number of the Ruby testers to use MasterPort instead of using a
derived CpuPort class. There is no reason for using the more
specialised pointers, and there is no longer a need to do any casting.

With the latest changes to the tester, organising ports as readers and
writes, things got a bit more complicated, and the "type" now had to
be removed to be able to fall back to using MasterPort rather than
CpuPort.

12 years agoMEM: Remove the Broadcast destination from the packet
Andreas Hansson [Sat, 14 Apr 2012 09:45:55 +0000 (05:45 -0400)]
MEM: Remove the Broadcast destination from the packet

This patch simplifies the packet by removing the broadcast flag and
instead more firmly relying on (and enforcing) the semantics of
transactions in the classic memory system, i.e. request packets are
routed from a master to a slave based on the address, and when they
are created they have neither a valid source, nor destination. On
their way to the slave, the request packet is updated with a source
field for all modules that multiplex packets from multiple master
(e.g. a bus). When a request packet is turned into a response packet
(at the final slave), it moves the potentially populated source field
to the destination field, and the response packet is routed through
any multiplexing components back to the master based on the
destination field.

Modules that connect multiplexing components, such as caches and
bridges store any existing source and destination field in the sender
state as a stack (just as before).

The packet constructor is simplified in that there is no longer a need
to pass the Packet::Broadcast as the destination (this was always the
case for the classic memory system). In the case of Ruby, rather than
using the parameter to the constructor we now rely on setDest, as
there is already another three-argument constructor in the packet
class.

In many places where the packet information was printed as part of
DPRINTFs, request packets would be printed with a numeric "dest" that
would always be -1 (Broadcast) and that field is now removed from the
printing.

12 years agoMEM: Separate snoops and normal memory requests/responses
Andreas Hansson [Sat, 14 Apr 2012 09:45:07 +0000 (05:45 -0400)]
MEM: Separate snoops and normal memory requests/responses

This patch introduces port access methods that separates snoop
request/responses from normal memory request/responses. The
differentiation is made for functional, atomic and timing accesses and
builds on the introduction of master and slave ports.

Before the introduction of this patch, the packets belonging to the
different phases of the protocol (request -> [forwarded snoop request
-> snoop response]* -> response) all use the same port access
functions, even though the snoop packets flow in the opposite
direction to the normal packet. That is, a coherent master sends
normal request and receives responses, but receives snoop requests and
sends snoop responses (vice versa for the slave). These two distinct
phases now use different access functions, as described below.

Starting with the functional access, a master sends a request to a
slave through sendFunctional, and the request packet is turned into a
response before the call returns. In a system without cache coherence,
this is all that is needed from the functional interface. For the
cache-coherent scenario, a slave also sends snoop requests to coherent
masters through sendFunctionalSnoop, with responses returned within
the same packet pointer. This is currently used by the bus and caches,
and the LSQ of the O3 CPU. The send/recvFunctional and
send/recvFunctionalSnoop are moved from the Port super class to the
appropriate subclass.

Atomic accesses follow the same flow as functional accesses, with
request being sent from master to slave through sendAtomic. In the
case of cache-coherent ports, a slave can send snoop requests to a
master through sendAtomicSnoop. Just as for the functional access
methods, the atomic send and receive member functions are moved to the
appropriate subclasses.

The timing access methods are different from the functional and atomic
in that requests and responses are separated in time and
send/recvTiming are used for both directions. Hence, a master uses
sendTiming to send a request to a slave, and a slave uses sendTiming
to send a response back to a master, at a later point in time. Snoop
requests and responses travel in the opposite direction, similar to
what happens in functional and atomic accesses. With the introduction
of this patch, it is possible to determine the direction of packets in
the bus, and no longer necessary to look for both a master and a slave
port with the requested port id.

In contrast to the normal recvFunctional, recvAtomic and recvTiming
that are pure virtual functions, the recvFunctionalSnoop,
recvAtomicSnoop and recvTimingSnoop have a default implementation that
calls panic. This is to allow non-coherent master and slave ports to
not implement these functions.

12 years agoRegression: Add ANSI colours to highlight test status
Andreas Hansson [Sat, 14 Apr 2012 09:44:27 +0000 (05:44 -0400)]
Regression: Add ANSI colours to highlight test status

This patch adds a very basic pretty-printing of the test status
(passed or failed) to highlight failing tests even more: green for
passed, and red for failed. The printing only uses ANSI it the target
output is a tty and supports ANSI colours. Hence, any regression
scripts that are outputting to files or sending e-mails etc should
still be fine.

12 years agoclang/gcc: Fix compilation issues with clang 3.0 and gcc 4.6
Andreas Hansson [Sat, 14 Apr 2012 09:43:31 +0000 (05:43 -0400)]
clang/gcc: Fix compilation issues with clang 3.0 and gcc 4.6

This patch addresses a number of minor issues that cause problems when
compiling with clang >= 3.0 and gcc >= 4.6. Most importantly, it
avoids using the deprecated ext/hash_map and instead uses
unordered_map (and similarly so for the hash_set). To make use of the
new STL containers, g++ and clang has to be invoked with "-std=c++0x",
and this is now added for all gcc versions >= 4.6, and for clang >=
3.0. For gcc >= 4.3 and <= 4.5 and clang <= 3.0 we use the tr1
unordered_map to avoid the deprecation warning.

The addition of c++0x in turn causes a few problems, as the
compiler is more stringent and adds a number of new warnings. Below,
the most important issues are enumerated:

1) the use of namespaces is more strict, e.g. for isnan, and all
   headers opening the entire namespace std are now fixed.

2) another other issue caused by the more stringent compiler is the
   narrowing of the embedded python, which used to be a char array,
   and is now unsigned char since there were values larger than 128.

3) a particularly odd issue that arose with the new c++0x behaviour is
   found in range.hh, where the operator< causes gcc to complain about
   the template type parsing (the "<" is interpreted as the beginning
   of a template argument), and the problem seems to be related to the
   begin/end members introduced for the range-type iteration, which is
   a new feature in c++11.

As a minor update, this patch also fixes the build flags for the clang
debug target that used to be shared with gcc and incorrectly use
"-ggdb".

12 years agoSCons: restore Werror option in src/SConscript
Steve Reinhardt [Fri, 13 Apr 2012 15:13:04 +0000 (08:13 -0700)]
SCons: restore Werror option in src/SConscript

Partial backout of cset 8b223e308b08.

Although it's great that there's currently no need
for Werror=false in the current tree, some of us
have uncommitted code that still needs this option.

12 years agoStats: Update with use of std::map for ordered iteration in Ruby
Andreas Hansson [Thu, 12 Apr 2012 12:35:56 +0000 (08:35 -0400)]
Stats: Update with use of std::map for ordered iteration in Ruby

This patch updates the stats to reflect the changes due to the use of
std::map instead of the hash map order-dependent iteration in Ruby.

12 years agoRuby: Ensure order-dependent iteration uses an ordered map
Andreas Hansson [Thu, 12 Apr 2012 12:35:49 +0000 (08:35 -0400)]
Ruby: Ensure order-dependent iteration uses an ordered map

This patch fixes a bug in Ruby that caused non-deterministic
simulation when changing the underlying hash map implementation. The
reason is order-dependent behaviour in combination with iteration over
the hash map contents. The two locations where a sorted container is
assumed are now changed to make use of a std::map instead of the
unordered hash map.

With this change, the stats changes slightly and the follow-on
changeset will update the relevant statistics.

12 years agotests: Fix building unit tests.
Gabe Black [Tue, 10 Apr 2012 06:20:30 +0000 (23:20 -0700)]
tests: Fix building unit tests.

Unit tests shouldn't build in gem5's main function because they have thier
own.

12 years agorubytest: remove spurious printf
Brad Beckmann [Sat, 7 Apr 2012 00:51:47 +0000 (17:51 -0700)]
rubytest: remove spurious printf

12 years agoregress: ruby random tester and hammer stats updates
Brad Beckmann [Fri, 6 Apr 2012 23:16:24 +0000 (16:16 -0700)]
regress: ruby random tester and hammer stats updates

12 years agoruby: set SimpleTiming as the default cpu
Brad Beckmann [Fri, 6 Apr 2012 20:47:08 +0000 (13:47 -0700)]
ruby: set SimpleTiming as the default cpu

12 years agoslicc: Controllers attached to Sequencers no longer have to be named L1Cache.
Lisa Hsu [Fri, 6 Apr 2012 20:47:08 +0000 (13:47 -0700)]
slicc: Controllers attached to Sequencers no longer have to be named L1Cache.

12 years agosim-ruby: checkpointing fixes and dependent eventq improvements
Brad Beckmann [Fri, 6 Apr 2012 20:47:07 +0000 (13:47 -0700)]
sim-ruby: checkpointing fixes and dependent eventq improvements

Fixes checkpointing with respect to lost events after swapping event queues.
Also adds DPRINTFs to better understand what's going on when Ruby serializes
and unserializes.

12 years agoslicc: fixed error message when the type has no inheritance
Brad Beckmann [Fri, 6 Apr 2012 20:47:07 +0000 (13:47 -0700)]
slicc: fixed error message when the type has no inheritance

12 years agoMOESI_hammer: tbe allocation and dependent wakeup fixes
Brad Beckmann [Fri, 6 Apr 2012 20:47:07 +0000 (13:47 -0700)]
MOESI_hammer: tbe allocation and dependent wakeup fixes

12 years agopython: added __nonzero__ function to SimObject Bool params
Brad Beckmann [Fri, 6 Apr 2012 20:47:07 +0000 (13:47 -0700)]
python: added __nonzero__ function to SimObject Bool params

12 years agoMOESI_hammer: fixed bug with single cpu + flushes, then modified the regression teste...
Brad Beckmann [Fri, 6 Apr 2012 20:47:06 +0000 (13:47 -0700)]
MOESI_hammer: fixed bug with single cpu + flushes, then modified the regression tester to check this functionality

12 years agorubytest: seperated read and write ports.
Brad Beckmann [Fri, 6 Apr 2012 20:47:06 +0000 (13:47 -0700)]
rubytest: seperated read and write ports.

This patch allows the ruby tester to support protocols where the i-cache and d-cache
are managed by seperate controllers.

12 years agoMEM: Enable multiple distributed generalized memories
Andreas Hansson [Fri, 6 Apr 2012 17:46:31 +0000 (13:46 -0400)]
MEM: Enable multiple distributed generalized memories

This patch removes the assumption on having on single instance of
PhysicalMemory, and enables a distributed memory where the individual
memories in the system are each responsible for a single contiguous
address range.

All memories inherit from an AbstractMemory that encompasses the basic
behaviuor of a random access memory, and provides untimed access
methods. What was previously called PhysicalMemory is now
SimpleMemory, and a subclass of AbstractMemory. All future types of
memory controllers should inherit from AbstractMemory.

To enable e.g. the atomic CPU and RubyPort to access the now
distributed memory, the system has a wrapper class, called
PhysicalMemory that is aware of all the memories in the system and
their associated address ranges. This class thus acts as an
infinitely-fast bus and performs address decoding for these "shortcut"
accesses. Each memory can specify that it should not be part of the
global address map (used e.g. by the functional memories by some
testers). Moreover, each memory can be configured to be reported to
the OS configuration table, useful for populating ATAG structures, and
any potential ACPI tables.

Checkpointing support currently assumes that all memories have the
same size and organisation when creating and resuming from the
checkpoint. A future patch will enable a more flexible
re-organisation.

--HG--
rename : src/mem/PhysicalMemory.py => src/mem/AbstractMemory.py
rename : src/mem/PhysicalMemory.py => src/mem/SimpleMemory.py
rename : src/mem/physical.cc => src/mem/abstract_mem.cc
rename : src/mem/physical.hh => src/mem/abstract_mem.hh
rename : src/mem/physical.cc => src/mem/simple_mem.cc
rename : src/mem/physical.hh => src/mem/simple_mem.hh

12 years agoNetworkTest: remove unnecessary memory allocation
Tushar Krishna [Thu, 5 Apr 2012 21:51:26 +0000 (17:51 -0400)]
NetworkTest: remove unnecessary memory allocation

12 years agoConfig: corrects the way Ruby attaches to the DMA ports
Nilay Vaish [Thu, 5 Apr 2012 16:09:19 +0000 (11:09 -0500)]
Config: corrects the way Ruby attaches to the DMA ports
With recent changes to the memory system, a port cannot be assigned a peer
port twice. While making use of the Ruby memory system in FS mode, DMA
ports were assigned peer twice, once for the classic memory system
and once for the Ruby memory system. This patch removes this double
assignment of peer ports.

12 years agoRuby: Fix the example configurations option parsing
Andreas Hansson [Thu, 5 Apr 2012 14:45:26 +0000 (10:45 -0400)]
Ruby: Fix the example configurations option parsing

This patch fixes the, currently broken, Ruby example scripts to
reflect the changes in the parsing of command-line options.

12 years agoPython: Make the All proxy traverse SimObject children as well
Andreas Hansson [Thu, 5 Apr 2012 14:44:35 +0000 (10:44 -0400)]
Python: Make the All proxy traverse SimObject children as well

This patch changes the behaviour of the All proxy parameter to not
only consider the direct children, but also do a pre-order depth-first
traversal of the object tree and append all results from the
children.

This is used in a later patch to find all the memories in the system,
independent of where they are located in the hierarchy.

12 years agoAtomic: Remove the physmem_port and access memory directly
Andreas Hansson [Tue, 3 Apr 2012 07:50:14 +0000 (03:50 -0400)]
Atomic: Remove the physmem_port and access memory directly

This patch removes the physmem_port from the Atomic CPU and instead
uses the system pointer to access the physmem when using the fastmem
option. The system already keeps track of the physmem and the valid
memory address ranges, and with this patch we merely make use of that
existing functionality. As a result of this change, the overloaded
getMasterPort in the Atomic CPU can be removed, thus unifying the CPUs.

12 years agoX86: Fix address size handling so real mode works properly.
Gabe Black [Sat, 31 Mar 2012 19:27:33 +0000 (12:27 -0700)]
X86: Fix address size handling so real mode works properly.

Virtual (pre-segmentation) addresses are truncated based on address size, and
any non-64 bit linear address is truncated to 32 bits. This means that real
mode addresses aren't truncated down to 16 bits after their segment bases are
added in.

12 years agoMEM: Remove legacy DRAM in preparation for memory updates
Andreas Hansson [Fri, 30 Mar 2012 16:57:48 +0000 (12:57 -0400)]
MEM: Remove legacy DRAM in preparation for memory updates

This patch removes the DRAM memory class in preparation for updates to
the memory system, with the first one introducing an abstract memory
class, and removing the assumption of a single physical memory.

12 years agoRuby: Remove the physMemPort and instead access memory directly
Andreas Hansson [Fri, 30 Mar 2012 13:42:36 +0000 (09:42 -0400)]
Ruby: Remove the physMemPort and instead access memory directly

This patch removes the physMemPort from the RubySequencer and instead
uses the system pointer to access the physmem. The system already
keeps track of the physmem and the valid memory address ranges, and
with this patch we merely make use of that existing functionality. The
memory is modified so that it is possible to call the access functions
(atomic and functional) without going through the port, and the memory
is allowed to be unconnected, i.e. have no ports (since Ruby does not
attach it like the conventional memory system).

12 years agoMEM: Introduce the master/slave port sub-classes in C++
William Wang [Fri, 30 Mar 2012 13:40:11 +0000 (09:40 -0400)]
MEM: Introduce the master/slave port sub-classes in C++

This patch introduces the notion of a master and slave port in the C++
code, thus bringing the previous classification from the Python
classes into the corresponding simulation objects and memory objects.

The patch enables us to classify behaviours into the two bins and add
assumptions and enfore compliance, also simplifying the two
interfaces. As a starting point, isSnooping is confined to a master
port, and getAddrRanges to slave ports. More of these specilisations
are to come in later patches.

The getPort function is not getMasterPort and getSlavePort, and
returns a port reference rather than a pointer as NULL would never be
a valid return value. The default implementation of these two
functions is placed in MemObject, and calls fatal.

The one drawback with this specific patch is that it requires some
code duplication, e.g. QueuedPort becomes QueuedMasterPort and
QueuedSlavePort, and BusPort becomes BusMasterPort and BusSlavePort
(avoiding multiple inheritance). With the later introduction of the
port interfaces, moving the functionality outside the port itself, a
lot of the duplicated code will disappear again.

12 years agoCPU: Unify initMemProxies across CPUs and simulation modes
Andreas Hansson [Fri, 30 Mar 2012 13:38:35 +0000 (09:38 -0400)]
CPU: Unify initMemProxies across CPUs and simulation modes

This patch unifies where initMemProxies is called, in the init()
method of each BaseCPU subclass, before TheISA::initCPU is
called. Moreover, it also ensures that initMemProxies is called in
both full-system and syscall-emulation mode, thus unifying also across
the modes. An additional check is added in the ThreadState to ensure
that initMemProxies is only called once.

12 years agoConfig: Change the way options are added
Nilay Vaish [Wed, 28 Mar 2012 16:01:53 +0000 (11:01 -0500)]
Config: Change the way options are added
I am not too happy with the way options are added in files se.py and fs.py
currently. This patch moves all the options to the file Options.py, functions
from which are called when required.

12 years agoConfig: Move setWorkCountOptions() to Simulation.py
Nilay Vaish [Tue, 27 Mar 2012 23:23:21 +0000 (18:23 -0500)]
Config: Move setWorkCountOptions() to Simulation.py
The function is presently defined in FSConfig.py, which does not seem to be
the correct place for it.

12 years agorange_map: Enable const find and iteration
Andreas Hansson [Mon, 26 Mar 2012 09:37:00 +0000 (05:37 -0400)]
range_map: Enable const find and iteration

This patch adds const access functions to the range_map to enable its use
in a const context, similar to the STL container classes.

12 years agoPower: Change bitfield name to avoid conflicts with range_map
Andreas Hansson [Mon, 26 Mar 2012 09:35:24 +0000 (05:35 -0400)]
Power: Change bitfield name to avoid conflicts with range_map

This patch changes the name of a bitfield from W to W_FIELD to avoid
clashes with W being used as a class (typename) in the templatized
range_map. It also changes L to L_FIELD to avoid future problems. The
problem manifestes itself when the CPU includes a header that in turn
includes range_map.hh. The relevant parts of the decoder are updated.

12 years agoRuby: Fix Set::print for 32-bit hosts
Andreas Hansson [Fri, 23 Mar 2012 10:54:25 +0000 (06:54 -0400)]
Ruby: Fix Set::print for 32-bit hosts

This patch fixes a compilation error caused by a length mismatch on
32-bit hosts. The ifdef and sprintf is replaced by a csprintf.

12 years agoMEM: Unify bus access methods and prepare for master/slave split
Andreas Hansson [Thu, 22 Mar 2012 10:37:21 +0000 (06:37 -0400)]
MEM: Unify bus access methods and prepare for master/slave split

This patch unifies the recvFunctional, recvAtomic and recvTiming to
all be based on a similar structure: 1) extract information about the
incoming packet, 2) send it out to the appropriate snoopers, 3)
determine where it is going, and 4) forward it to the right
destination. The naming of variables across the different access
functions is now consistent as well.

Additionally, the patch introduces the member functions releaseBus and
retryWaiting to better distinguish between the two cases when we
should tell a sender to retry. The first case is when the bus goes
from busy to idle, and the second case is when it receives a retry
from a destination that did not immediatelly accept a packet.

As a very minor change, the MMU debug flag is no longer used in the bus.

12 years agoMEM: Split SimpleTimingPort into PacketQueue and ports
Andreas Hansson [Thu, 22 Mar 2012 10:36:27 +0000 (06:36 -0400)]
MEM: Split SimpleTimingPort into PacketQueue and ports

This patch decouples the queueing and the port interactions to
simplify the introduction of the master and slave ports. By separating
the queueing functionality from the port itself, it becomes much
easier to distinguish between master and slave ports, and still retain
the queueing ability for both (without code duplication).

As part of the split into a PacketQueue and a port, there is now also
a hierarchy of two port classes, QueuedPort and SimpleTimingPort. The
QueuedPort is useful for ports that want to leave the packet
transmission of outgoing packets to the queue and is used by both
master and slave ports. The SimpleTimingPort inherits from the
QueuedPort and adds the implemention of recvTiming and recvFunctional
through recvAtomic.

The PioPort and MessagePort are cleaned up as part of the changes.

--HG--
rename : src/mem/tport.cc => src/mem/packet_queue.cc
rename : src/mem/tport.hh => src/mem/packet_queue.hh

12 years agoScons: Remove Werror=False in SConscript files
Andreas Hansson [Thu, 22 Mar 2012 10:34:50 +0000 (06:34 -0400)]
Scons: Remove Werror=False in SConscript files

This patch removes the overriding of "-Werror" in a handful of
cases. The code compiles with gcc 4.6.3 and clang 3.0 without any
warnings, and thus without any errors. There are no functional changes
introduced by this patch. In the future, rather than ypassing
"-Werror", address the warnings.

12 years agoPython: Fix a conditional expression that requires Python 2.5
Andreas Hansson [Wed, 21 Mar 2012 23:02:03 +0000 (19:02 -0400)]
Python: Fix a conditional expression that requires Python 2.5

This patch changes a conditional expression to a conventional if/else
block, which does not require Python >= 2.5.

12 years agoARM: Update stats for IT and conditional branch changes
Ali Saidi [Wed, 21 Mar 2012 15:36:45 +0000 (10:36 -0500)]
ARM: Update stats for IT and conditional branch changes

12 years agoARM: Fix case where cond/uncond control is mis-specified
Nathanael Premillieu [Wed, 21 Mar 2012 15:34:06 +0000 (10:34 -0500)]
ARM: Fix case where cond/uncond control is mis-specified

12 years agoARM: Clean up condCodes in IT blocks.
Ali Saidi [Wed, 21 Mar 2012 15:34:06 +0000 (10:34 -0500)]
ARM: Clean up condCodes in IT blocks.

12 years agoARM: IT doesn't need to be serializing.
Geoffrey Blake [Wed, 21 Mar 2012 15:34:06 +0000 (10:34 -0500)]
ARM: IT doesn't need to be serializing.

12 years agoO3: Fix sizing of decode to rename skid buffer.
Andrew Lukefahr [Wed, 21 Mar 2012 15:34:06 +0000 (10:34 -0500)]
O3: Fix sizing of decode to rename skid buffer.

12 years agoARM: Add RTC to PBX System
Koan-Sin Tan [Wed, 21 Mar 2012 15:34:05 +0000 (10:34 -0500)]
ARM: Add RTC to PBX System

12 years agoO3: Fix size of skid buffer between fetch and decode when widths are different
Brian Grayson [Wed, 21 Mar 2012 15:34:05 +0000 (10:34 -0500)]
O3: Fix size of skid buffer between fetch and decode when widths are different

12 years agoARM: Fix uninitialized value in ARM RTC model.
Ali Saidi [Wed, 21 Mar 2012 15:34:05 +0000 (10:34 -0500)]
ARM: Fix uninitialized value in ARM RTC model.

12 years agoGarnet: Stats at vnet granularity + code cleanup
Tushar Krishna [Mon, 19 Mar 2012 21:34:17 +0000 (17:34 -0400)]
Garnet: Stats at vnet granularity + code cleanup

This patch
(1) Moves redundant code from fixed and flexible networks to BaseGarnetNetwork.
(2) Prints network stats at vnet granularity.

12 years agogcc: Clean-up of non-C++0x compliant code, first steps
Andreas Hansson [Mon, 19 Mar 2012 10:36:09 +0000 (06:36 -0400)]
gcc: Clean-up of non-C++0x compliant code, first steps

This patch cleans up a number of minor issues aiming to get closer to
compliance with the C++0x standard as interpreted by gcc and clang
(compile with std=c++0x and -pedantic-errors). In particular, the
patch cleans up enums where the last item was succeded by a comma,
namespaces closed by a curcly brace followed by a semi-colon, and the
use of the GNU-extension typeof (replaced by templated functions). It
does not address variable-length arrays, zero-size arrays, anonymous
structs, range expressions in switch statements, and the use of long
long. The generated CPU code also has a large number of issues that
remain to be fixed, mainly related to overflows in implicit constant
conversion (due to shifts).

12 years agoclang: Fix recently introduced clang compilation errors
Andreas Hansson [Mon, 19 Mar 2012 10:35:04 +0000 (06:35 -0400)]
clang: Fix recently introduced clang compilation errors

This patch makes the code compile with clang 2.9 and 3.0 again by
making two very minor changes. Firt, it maintains a strict typing in
the forward declaration of the BaseCPUParams. Second, it adds a
FullSystemInt flag of the type unsigned int next to the boolean
FullSystem flag. The FullSystemInt variable can be used in
decode-statements (expands to switch statements) in the instruction
decoder.

12 years agoscripts: Fix to ensure that port connection count is always set
Andreas Hansson [Mon, 19 Mar 2012 10:34:02 +0000 (06:34 -0400)]
scripts: Fix to ensure that port connection count is always set

This patch ensures that the port connection count is set to zero in those
cases when the port is not connected.

12 years agoruby_fs.py: Add call to createInterruptController()
Nilay Vaish [Fri, 16 Mar 2012 12:47:03 +0000 (07:47 -0500)]
ruby_fs.py: Add call to createInterruptController()

12 years agoFSConfig.py: fix a typo makeLinuxAlphaRubySystem
Nilay Vaish [Fri, 16 Mar 2012 12:46:45 +0000 (07:46 -0500)]
FSConfig.py: fix a typo makeLinuxAlphaRubySystem

12 years agobuild: remove implicit-cache setting of scons from recent build faster patch
Marc Orr [Fri, 16 Mar 2012 10:29:07 +0000 (03:29 -0700)]
build: remove implicit-cache setting of scons from recent build faster patch