summaryrefslogtreecommitdiff
path: root/src/base/SConscript
AgeCommit message (Collapse)Author
2020-01-09tests,base: Added GTest for base/socket.ccBobby R. Bruce
It should be noted that some features of this class have not been fully tested due to interaction with system-calls. Change-Id: I8315188327e022ac4c98aa9ce4bd38243266ab17 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23984 Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br> Maintainer: Jason Lowe-Power <jason@lowepower.com> Tested-by: kokoro <noreply+kokoro@google.com>
2019-12-17scons: Added channel_addr.cc dependency to channel_addr GTestBobby R. Bruce
In some circumstances not including channel_addr.cc as a dependency for the channel_addr.test compilation resulted in a build failure (this was observed in gem5's Kokoro CI system). This commit fixes this problem. Change-Id: Ic38a104a1e6bf655fc64158b556e6227d5ac3981 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23603 Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br> Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Jason Lowe-Power <jason@lowepower.com> Tested-by: kokoro <noreply+kokoro@google.com>
2019-12-03base: add the FmtStackTrace debug optionCiro Santilli
If given, a stack trace is printed after every debug message. This helps to localize where debug messages are being called from, which is often the critical information needed to debug certain problems. Change-Id: I82b8990c0d286393d5bdab05f718be3e89eadc40 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22003 Reviewed-by: Brandon Potter <Brandon.Potter@amd.com> Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Jason Lowe-Power <jason@lowepower.com> Tested-by: kokoro <noreply+kokoro@google.com>
2019-11-26base: generalize ExecTicks to all messages with FmtTicksOffCiro Santilli
If FmtTicksOff is given, ticks are disabled for all log messages. The original motivation of this is to bring the implementation of native traces closer to that of other traces to help refactoring done in future patches. One additional advantage of this is that sometimes we want to compare traces of a given program under different conditions, so the start of the ROI is different, and the different initial timestamp makes a diff useless by showing differences on every line. Change-Id: Idd6cb105d301b3b9b064996043f4ca75ddafe0af Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22006 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Jason Lowe-Power <jason@lowepower.com> Tested-by: kokoro <noreply+kokoro@google.com>
2019-11-26base: add the --debug-flag to DPRINTF output with FmtFlagCiro Santilli
This makes it easier to determine which messages come from which flags when enabling multiple flags at once. This commit covers the bulk of the debug messages, which use the DPRINTF* family of macros. There however macros that use DTRACE to check for enable, those will be covered in future patches. Change-Id: I6738b18f08ccfd1e11f2874b426c1827b42e82a2 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22004 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Jason Lowe-Power <jason@lowepower.com> Tested-by: kokoro <noreply+kokoro@google.com>
2019-11-21tests,base: Added GTests for exec_ecoff.h and exec_aout.hBobby R. Bruce
Change-Id: Iec76ba24a06425caefd28d640c6479720f401c06 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22323 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Jason Lowe-Power <jason@lowepower.com> Tested-by: kokoro <noreply+kokoro@google.com>
2019-11-21test,base: Added GTest for base/loader/image_file_data.ccBobby R. Bruce
image_file_data.cc reads an image file, or an image file compressed with gzip. Mock image file data, and that data in a gzipped state, has been included in base/loader/small_image_file.test.hh to aid testing. Change-Id: I69691b93ca03c34d6bd736cbc5c6503115bd7b3f Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22743 Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br> Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Jason Lowe-Power <jason@lowepower.com> Tested-by: kokoro <noreply+kokoro@google.com>
2019-11-20tests, base: Added GTests for base/intmath.ccBobby R. Bruce
Testing intmath.hh and intmath.cc. Here is the list of the functions that are tested. intmath.isPowerOf2, intmath.power, intmath.floorLog2, intmath.ceilLog2, intmath.divCeil, intmath.roundUp, intmath.roundDown. Other functions are not tested, because they are not currently used and are dead code. Change-Id: I150ac1b5cead93c6698a8c9e9cec80bd87ef181a Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22081 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Mahyar Samani <msamani@ucdavis.edu> Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu> Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu> Maintainer: Jason Lowe-Power <jason@lowepower.com>
2019-11-20tests, base: Removed dead code from base/intmathMahyar Samani
The below list of functions were dead code and are now deleted. intmath.prevPrime, intmath.isPrime, intmath.leastSigBit, intmath.floorPow2, intmath.ceilPow2, intmath.isHex, intmath.isOct, intmath.isDec, intmath.hex2Int. The source file intmath.cc is now effectively useless and deleted. Change-Id: I28e4350056b8d03e02fecd5c7f7f9c62bc2df7ce Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22584 Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br> Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Reviewed-by: Gabe Black <gabeblack@google.com>
2019-11-13tests: Added GTests for base/chunk_generator.hhBobby R. Bruce
Change-Id: Ic6ededfc7fed1f91a75e48a0933e61b4670e5af1 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/21679 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com> Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
2019-11-13tests: Added GTests for base/types.ccBobby R. Bruce
Change-Id: I9515735efdd452a9f8c98f37f4ec2c27120929f5 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/21659 Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu> Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br> Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu> Maintainer: Jason Lowe-Power <jason@lowepower.com> Tested-by: kokoro <noreply+kokoro@google.com>
2019-11-12tests,base: Added GTests for base/condcodes.hhBobby R. Bruce
The documentation for the "findParity" and "findCarry" functions in base/condcodes.hh has been enhanced to better explain their behavior. Change-Id: I9ba3bf68eb56529a3030e965ec21e41d2dacfad6 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/21639 Reviewed-by: Gabe Black <gabeblack@google.com> Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu> Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu> Tested-by: kokoro <noreply+kokoro@google.com>
2019-11-07tests,base: Added GTests for base/match.ccBobby R. Bruce
In order to aid testing the method "match.getExpressions()" has been added. Change-Id: I11acf9bed286ee2809dfa3d05ef573dea85eb786 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22503 Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br> Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Jason Lowe-Power <jason@lowepower.com> Tested-by: kokoro <noreply+kokoro@google.com>
2019-10-24tests: Added GTests for base/str.ccBobby R. Bruce
Adding these tests supercedes the unittest/strnumtest.cc and unittest/tokentest.cc tests. They have thereby been removed. Function "to_number" in base/str.hh previously failed to cast negative float/double numbers. This was due to the use of std::numeric_limits<T>::min() instead of std::numeric_limits<T>::lowest() to determine whether a string-to-float/double conversion was "Out of range". Tests "StrTest.ToNumberFloatNegative" and "StrTest.ToNumberDoubleNegative" exposed this bug. It has been fixed. Methods "split_first" and "split_last" in base/str.hh have had their documentation updated to remove abiguity in their functionality. Change-Id: I16e0fe40d884e22dd010db4045857eb6e7f33d4a Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22084 Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br> Maintainer: Jason Lowe-Power <jason@lowepower.com> Tested-by: kokoro <noreply+kokoro@google.com>
2019-10-18tests: Added GTests for base/bitfield.hhBobby R. Bruce
In addition to the tests, a more detailed explanation of how "insertBits(..)" functions has been included in its doxygen documentation. The previous explanation was ambigious and led to confusion. Change-Id: I2ae8608733ebaa8f8f726cbb3a2cd8639b69c6b7 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/21700 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Gabe Black <gabeblack@google.com> Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br> Maintainer: Jason Lowe-Power <jason@lowepower.com>
2019-10-18tests: Added GTests for base/atomicio.ccBobby R. Bruce
Change-Id: I586a06c70f4e7331b4a31208ef7831e8473509c5 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/21699 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Jason Lowe-Power <jason@lowepower.com> Tested-by: kokoro <noreply+kokoro@google.com>
2019-10-18base: Add classes that encapsulate a channel addressAndreas Sandberg
There are cases where the memory system needs to reason about channel-local addresses. These are currently represented using the Addr and AddrRange classes. This is not ideal since it doesn't provide any type safety when working with global addresses and channel-local addresses. This is particularly problematic when porting existing components to work in multi-channel configurations. This changeset introduces the new ChannelAddr and ChannelAddrRange classes. These classes encapsulate channel-local addresses in a contiguous address space. These can, for example, be used in a memory controller to represent a flat address space when calculating timings or in a sectored cache. Change-Id: I45d4061ebc8507a10d0a4577b28796dc5ec7a469 Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/21600 Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu> Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br> Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com> Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Jason Lowe-Power <jason@lowepower.com> Tested-by: kokoro <noreply+kokoro@google.com>
2019-10-15arch,base: Restructure the object file loaders.Gabe Black
This change creates a distinction between object files which hold executable code, and flat files which don't. The first type of files have entry points, symbols, etc., while the others are just blobs which can be shoved into memory. Rather than have those aspects but stub them out, this change creates a new base class which simply doesn't have them. This change also restructures the ELF loader since it's main function was quite long and doing multiple jobs. It stops passing the architecture and operating system to the ObjectFile constructor, since those might not be known at the very top of the constructor. Instead, those default to Uknown*, and then are filled in in the constructor body if appropriate. This removes a lot of plumbing that was hard to actually use in practice. It also introduces a mechanism to collect generic object file formats so that they can be tried one by one by the general createObjectFile function, rather than listing them all there one by one. It's unlikely that new types of object files will need to be added in a modular way without being able to modify the core loader code, but it's cleaner to have that abstraction and modularization like is already there for process loaders. Finally, to make it possible to share the code which handles zipped files for both true object files and also files which will be loaded into memory but are just blobs, that mechanism is pulled out into a new class called ImageFileData. It holds a collection of segments which are set up by the object file and may refer to regions of the original file, buffers maintained elsewhere, or even nothing to support bss-es. shared_ptr is used to make it easier to keep track of that information without having to do so explicitly or worry about deleting a buffer before everyone was done using it. Change-Id: I92890266f2ba0a703803cccad675a3ab41f2c4af Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/21467 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Brandon Potter <Brandon.Potter@amd.com> Maintainer: Gabe Black <gabeblack@google.com>
2019-10-14Tests: Added GTests for base/callback.ccBobby R. Bruce
Change-Id: Icebd0fdec4be86e0f0fd86ef58f52ddbfdf8d714 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/21619 Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Maintainer: Andreas Sandberg <andreas.sandberg@arm.com> Tested-by: kokoro <noreply+kokoro@google.com>
2019-10-12arch,base: Separate the idea of a memory image and object file.Gabe Black
A memory image can be described by an object file, but an object file is more than a memory image. Also, it makes sense to manipulate a memory image to, for instance, change how it's loaded into memory. That takes on larger implications (relocations, the entry point, symbols, etc.) when talking about the whole object file, and also modifies aspects which may not need to change. For instance if an image needs to be loaded into memory at addresses different from what's in the object file, but other things like symbols need to stay unmodified. Change-Id: Ia360405ffb2c1c48e0cc201ac0a0764357996a54 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/21466 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Brandon Potter <Brandon.Potter@amd.com> Maintainer: Gabe Black <gabeblack@google.com>
2019-10-09tests: Migrated refcnt.cc test from src/unitttest to a gtestBobby R. Bruce
refcnt.cc was previously tested in src/unittest/refcnttest.cc. This has now been translated into a GTest as faithfully to the original as possible. Change-Id: I51f7a3d1e0a85b128c4eebd97cfe79b87406dc29 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/21499 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com> Tested-by: kokoro <noreply+kokoro@google.com>
2019-10-09arch-mips,arch-riscv,base: Get rid of the unused HexFile class.Gabe Black
A pointer to it was set up in the MIPS and RISCV system classes, but nothing ever set that pointer. The class was put in base/loader, but didn't have anything to do (as far as I can see) with loading anything it had a loadSegments method, but was not a subclass of ObjectFile. Change-Id: I4b711a31df20e20ffc306709227f60aa020fca15 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/21464 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
2019-08-29stats: Add beta support for HDF5 stat dumpsAndreas Sandberg
This changeset add support for stat dumps in the HDF5 file format. HDF5 is a binary data format that represents data in a file-system-like balanced tree. It has native support for N-dimensional arrays and binary data (e.g., frame buffers). It has the following benefits over traditional text stat files: * Efficient storage of time series (multiple stat dumps) * Fast lookup of stats * Plenty of existing tooling (e.g., Python libraries and graphical viewers) * File format can be used to store frame buffers together with normal stats. Drawbacks: * Large startup cost (single stat dump larger than text equivalent) * Stat dumps are slower than text Known limitations: * Distributions and histograms aren't supported. HDF5 stat output can be enabled using the 'h5' URL scheme when overriding the stat file name on gem5's command line. The following parameters are supported: * chunking (unsigned): Number of time steps to pre-allocate (default: 10) * desc (bool): Output stat descriptions (default: True) * formulas (bool): Output derived stats (default: True) Example gem5 command line: ./build/ARM/gem5.opt \ --stats-file="h5://stats.h5?desc=False;formulas=False" \ configs/example/fs.py Example Python stat consumer that computes IPC: import h5py f = h5py.File('stats.h5', 'r') group = f['/system/cpu'] for i, c in zip(group['committedInsts'], group['numCycles']): print i, c, i / c Change-Id: I351c6cbff2fb7bef9012f47876ba227ed288975b Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com> Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/8121 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br> Reviewed-by: Ciro Santilli <ciro.santilli@arm.com>
2019-08-29stats: Add support for hierarchical statsAndreas Sandberg
This change makes the stat system aware of the hierarchical nature of stats. The aim is to achieve the following goals: * Make the SimObject hierarchy explicit in the stat system (i.e., get rid of name() + ".foo"). This makes stat naming less fragile and makes it possible to implement hierarchical formats like XML/HDF5/JSON in a clean way. * Make it more convenient to split stats into a separate struct/class that can be bound to a SimObject. This makes the namespace cleaner and makes stat accesses a bit more obvious. * Make it possible to build groups of stats in C++ that can be used in subcomponents in a SimObject (similar to what we do for checkpoint sections). This makes it easier to structure large components. * Enable partial stat dumps. Some of our internal users have been asking for this since a full stat dump can be large. * Enable better stat access from Python. This changeset implements solves the first three points by introducing a class (Stats::Group) that owns statistics belonging to the same object. SimObjects inherit from Stats::Group since they typically have statistics. New-style statistics need to be associated with a parent group at instantiation time. Instantiation typically sets the name and the description, other parameters need to be set by overriding Group::regStats() just like with legacy stats. Simple objects with scalar stats can typically avoid implementing regStats() altogether since the stat name and description are both specified in the constructor. For convenience reasons, statistics groups can be merged into other groups. This means that a SimObject can create a stat struct that inherits from Stats::Group and merge it into the parent group (SimObject). This can make the code cleaner since statistics tracking gets grouped into a single object. Stat visitors have a new API to expose the group structure. The Output::beginGroup(name) method is called at the beginning of a group and the Output::endGroup() method is called when all stats, and sub-groups, have been visited. Flat formats (e.g., the text format) typically need to maintain a stack to track the full path to a stat. Legacy, flat, statistics are still supported after applying this change. These stats don't belong to any group and stat visitors will not see a Output::beginGroup(name) call before their corresponding Output::visit() methods are called. Change-Id: I9025d61dfadeabcc8ecf30813ab2060def455648 Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/19368 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
2019-05-14base: Add GTest to SatCounterDaniel
Add a GTest to the SatCounter class. Change-Id: Iaf1b18db9fe8d7fe32e0e40c7947dcd1fd6cc33b Signed-off-by: Daniel <odanrc@yahoo.com.br> Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/17994 Maintainer: Jason Lowe-Power <jason@lowepower.com> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
2018-12-06base: Iterable CircularQueue implementationRekai Gonzalez-Alberquilla
The former implementation of CircleBuf is functional but a bit too tailored to match a use-case. This patches introduces a new iterable circular queue, which adds some more functionality so it can also be used for the newer LSQ implementation, where iteration and iterators are a very desirable feature. Additional contributors: Gabor Dozsa. Change-Id: I5cfb95c8abc1f5e566a114acdbf23fc52a38ce5e Signed-off-by: Giacomo Gabrielli <giacomo.gabrielli@arm.com> Reviewed-on: https://gem5-review.googlesource.com/c/13127 Maintainer: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
2018-11-29base: Change the unit test binary names to use .test, and to be consistent.Gabe Black
Most tests were named *test where * was the base name of the file being tested, but some were named differently based on, for instance, the name of the class that file implemented. This change makes all the test names consistently based off of the file name they test, and also brings in the new .test convention to make them easier to read. Now, if you have a file like fiber.cc you want to test, you'd have a unit test in a file called fiber.test.cc, and a test called fiber.test which would generate a binary called fiber.test.opt, fiber.test.debug, etc. Change-Id: I61d59016090371a9bae72066e7473a34aecea21f Reviewed-on: https://gem5-review.googlesource.com/c/14677 Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-11-29base: Rename unit test cc files to be *.test.cc.Gabe Black
This makes the name easier to read, looks ok if the file is named with underscores between words or not, is easy to grep for, and shouldn't introduce any ambiguities in the file names. Change-Id: I34b7bcccea2d87c10c0de417dd5e3ef27c4b5666 Reviewed-on: https://gem5-review.googlesource.com/c/14676 Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com> Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br> Maintainer: Gabe Black <gabeblack@google.com>
2018-11-28tests: Convert IniFile unit test to a GTestGiacomo Travaglini
Change-Id: I47d6c9cbae21877420a15ffcf8489e3c26959139 Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com> Reviewed-on: https://gem5-review.googlesource.com/c/14615 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-26tests: Convert AddrRangeMap unit test to a GTestAndreas Sandberg
Change-Id: Ifeb0b57c0cda77706691286f78325e50edb31c0d Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-on: https://gem5-review.googlesource.com/c/13736 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2018-10-26tests: Convert CircleBuf unit test to a GTestAndreas Sandberg
Change-Id: I028c6b8d8e0ec06cac3d636689ae647f717096cd Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-on: https://gem5-review.googlesource.com/c/13735 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2018-09-10base: Fix isSubset() for addr ranges with interleavingNikos Nikoleris
This change extends isSubset() which checks whether the range is a subset of an input range to support address ranges with interleaving and hashing. Change-Id: I3dc9ceccb189b7c8665de0355f0555fc2c37d872 Reviewed-on: https://gem5-review.googlesource.com/12319 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
2018-06-28base: Add an asymmetrical Coroutine classGiacomo Travaglini
This patch is providing gem5 a Coroutine class to be used for instantiating asymmetrical coroutines. Coroutines are built on top of gem5 fibers, which makes them ucontext based. Change-Id: I7bb673a954d4a456997afd45b696933534f3e239 Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com> Reviewed-on: https://gem5-review.googlesource.com/11195 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-06-21base: Add a class which encapsulates Fibers.Gabe Black
This class encapsulates the idea of a Fiber in such a way that other implementations can be substituted in in the future. This implementation uses the ucontext family of functions. This change also adds a new unit test which exercises the new class. It creates three new fibers which accept a sequence of other fibers to switch to, one after the other. The main test function switches to the these fibers which switch with each other and occasionally back to the main fiber. Each time a test fiber is activated, it checks against a list which shows the correct order for the fibers to run in. When the main fiber gets control, it makes sure that list has been progressed through by the correct amount. Change-Id: I1fc2afa414b51baaa91e350a4ebc791d989f0b8a Reviewed-on: https://gem5-review.googlesource.com/10935 Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com> Maintainer: Gabe Black <gabeblack@google.com>
2017-12-13arm,sparc,x86,base,cpu,sim: Replace the Twin(32|64)_t types with.Gabe Black
Replace them with std::array<>s. Change-Id: I76624c87a1cd9b21c386a96147a18de92b8a8a34 Reviewed-on: https://gem5-review.googlesource.com/6602 Maintainer: Gabe Black <gabeblack@google.com> Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
2017-12-12tests: Turn fbtest into a gtest and move it to src/base.Gabe Black
Change-Id: I9ca57e24f27e0eb747d1f27262972a8abcd10fc8 Reviewed-on: https://gem5-review.googlesource.com/6342 Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
2017-12-12tests: Move the cprintftest unit test into src/base.Gabe Black
That way it will live alongside the code it tests. Change-Id: I00baad2206870a4619b7cee792a1d4c303dad04d Reviewed-on: https://gem5-review.googlesource.com/6324 Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
2017-12-12tests: Move the trietest unit test into base.Gabe Black
This puts it alongside trie.hh, the header file it tests. Change-Id: Id8ca0c1d68bdc01807c5ba4b51c0142b1221385d Reviewed-on: https://gem5-review.googlesource.com/6281 Maintainer: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-by: Brandon Potter <Brandon.Potter@amd.com>
2017-12-12tests: Add an implementation of the Logger interface for use gtests.Gabe Black
On exiting log types (panic and fatal), the message is set to an ADD_FAILURE_AT macro, and the test is exited by throwing an otherwise unexpected exception. On non-exiting log types, the message is sent to the SUCCEEDED macro which currently doesn't output anything. Change-Id: I1bb569e6cb8308dbc4c3e04eea7a962bd2b1ddd8 Reviewed-on: https://gem5-review.googlesource.com/6264 Maintainer: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
2017-12-06base: Split out the pixel class in framebuffer.(cc|hh).Gabe Black
These are really two separate things. Also, while it's realitively straightforward to write a unit test for the pixel conversion code, the framebuffer object is serializable and brings in more dependencies. Change-Id: If954caeb0bfedb1002cfb1a7a115a00c90d56d19 Reviewed-on: https://gem5-review.googlesource.com/6341 Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
2017-12-04misc: Rename misc.(hh|cc) to logging.(hh|cc)Gabe Black
These files aren't a collection of miscellaneous stuff, they're the definition of the Logger interface, and a few utility macros for calling into that interface (panic, warn, etc.). Change-Id: I84267ac3f45896a83c0ef027f8f19c5e9a5667d1 Reviewed-on: https://gem5-review.googlesource.com/6226 Reviewed-by: Brandon Potter <Brandon.Potter@amd.com> Maintainer: Gabe Black <gabeblack@google.com>
2017-11-28tests: Move the bituniontest to be alongside the bitunion header.Gabe Black
Change-Id: I7c1a49c41672a1108fcf67c5505b0441f90588ef Reviewed-on: https://gem5-review.googlesource.com/6142 Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
2017-10-31base: Introducing utility for writing raw data in png formatGiacomo Travaglini
Originally it was possible to use a Bitmap writer class for dumping a framebuffer snapshot in a .bmp file. This patch enables you to choose another format. In particular it implements the writing of PNG Images using libpng library. The latter has to be already installed in your machine, otherwise gem5 will default to the Bitmap format. This configurable writer has been introduced in the VNC frame dumping mechanism, which is storing changed frame buffers from the VNC server Change-Id: Id7e5763c82235f1ce90381c8486b85a7cce734ce Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-on: https://gem5-review.googlesource.com/5181 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
2017-10-20base: Function for mirroring bits in variable length wordGiacomo Travaglini
This patch introduces a high-speed template function for mirroring the bits (MSB=>LSB) in a variable length word. The function is achieving high performances since it is using a look-up table. Change-Id: Ib0d0480e68d902f25655f74d243de305103eff75 Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com> Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com> Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-on: https://gem5-review.googlesource.com/5261 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Jason Lowe-Power <jason@lowepower.com>
2015-08-07base: Rewrite the CircleBuf to fix bugs and add serializationAndreas Sandberg
The CircleBuf class has at least one bug causing it to overwrite the wrong elements when wrapping. The current code has a lot of unused functionality and duplicated code. This changeset replaces the old implementation with a new version that supports serialization and arbitrary types in the buffer (not just char).
2015-05-23base: Redesign internal frame buffer handlingAndreas Sandberg
Currently, frame buffer handling in gem5 is quite ad hoc. In practice, we pass around naked pointers to raw pixel data and expect consumers to convert frame buffers using the (broken) VideoConverter. This changeset completely redesigns the way we handle frame buffers internally. In summary, it fixes several color conversion bugs, adds support for more color formats (e.g., big endian), and makes the code base easier to follow. In the new world, gem5 always represents pixel data using the Pixel struct when pixels need to be passed between different classes (e.g., a display controller and the VNC server). Producers of entire frames (e.g., display controllers) should use the FrameBuffer class to represent a frame. Frame producers are expected to create one instance of the FrameBuffer class in their constructors and register it with its consumers once. Consumers are expected to check the dimensions of the frame buffer when they consume it. Conversion between the external representation and the internal representation is supported for all common "true color" RGB formats of up to 32-bit color depth. The external pixel representation is expected to be between 1 and 4 bytes in either big endian or little endian. Color channels are assumed to be contiguous ranges of bits within each pixel word. The external pixel value is scaled to an 8-bit internal representation using a floating multiplication to map it to the entire 8-bit range.
2014-09-03base: Use STL C++11 random number generationAndreas Hansson
This patch changes the random number generator from the in-house Mersenne twister to an implementation relying entirely on C++11 STL. The format for the checkpointing of the twister is simplified. As the functionality was never used this should not matter. Note that this patch does not actually make use of the checkpointing functionality. As the random number generator is not thread safe, it may be sensible to create one generator per thread, system, or even object. Until this is decided the status quo is maintained in that no generator state is part of the checkpoint.
2014-08-10base: Remove unused filesAndreas Hansson
A bit of pruning
2013-09-04arch: Resurrect the NOISA build target and rename it NULLAndreas Hansson
This patch makes it possible to once again build gem5 without any ISA. The main purpose is to enable work around the interconnect and memory system without having to build any CPU models or device models. The regress script is updated to include the NULL ISA target. Currently no regressions make use of it, but all the testers could (and perhaps should) transition to it. --HG-- rename : build_opts/NOISA => build_opts/NULL rename : src/arch/noisa/SConsopts => src/arch/null/SConsopts rename : src/arch/noisa/cpu_dummy.hh => src/arch/null/cpu_dummy.hh rename : src/cpu/intr_control.cc => src/cpu/intr_control_noisa.cc
2013-02-15loader: add a flattened device tree blob (dtb) objectAnthony Gutierrez
this adds a dtb_object so the loader can load in the dtb file for linux/android ARM kernels.