sim: Add some helpers for working with values in buffers.

This change adds helpers to get and set values from byte buffers of
variable size, and to print them. It also provides a helper to print a
buffer of bytes.

Change-Id: I23210505f99488a901bed244ffc70ef4736470d0
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/57149
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Gabe Black
2022-02-25 04:59:58 -08:00
parent 7f9f145174
commit 9df4159456
4 changed files with 550 additions and 0 deletions

View File

@@ -45,6 +45,7 @@ SimObject('PowerDomain.py', sim_objects=['PowerDomain'])
Source('async.cc')
Source('backtrace_%s.cc' % env['BACKTRACE_IMPL'], add_tags='gem5 trace')
Source('bufval.cc')
Source('core.cc')
Source('cur_tick.cc', add_tags='gem5 trace')
Source('tags.cc')
@@ -93,6 +94,7 @@ env.TagImplies('gem5 drain', ['gem5 events', 'gem5 trace'])
env.TagImplies('gem5 events', ['gem5 serialize', 'gem5 trace'])
env.TagImplies('gem5 serialize', 'gem5 trace')
GTest('bufval.test', 'bufval.test.cc', 'bufval.cc')
GTest('byteswap.test', 'byteswap.test.cc', '../base/types.cc')
GTest('globals.test', 'globals.test.cc', 'globals.cc',
with_tag('gem5 serialize'))