base, sim: Make ByteOrder into a ScopedEnum accessible to Python

There is currently no good way of passing a byte order as a Param
since the ByteOrder type is defined in C++. Make this into a generated
ScopedEnum that can be used in Params.

Change-Id: I990f402340c17c4e0799de57df19516ae61794d4
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/33174
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gabe Black <gabeblack@google.com>
This commit is contained in:
Andreas Sandberg
2020-08-21 11:53:18 +01:00
parent 2ea459e6cd
commit 51992fa80a
43 changed files with 233 additions and 228 deletions

View File

@@ -206,10 +206,10 @@ class Base : public ClockedObject
panic("PrefetchInfo::get called with a request with no data.");
}
switch (endian) {
case BigEndianByteOrder:
case ByteOrder::big:
return betoh(*(T*)data);
case LittleEndianByteOrder:
case ByteOrder::little:
return letoh(*(T*)data);
default: