mem-ruby: add addressOffset util
authorTiago Mück <tiago.muck@arm.com>
Fri, 5 Jun 2020 17:55:42 +0000 (12:55 -0500)
committerTiago Mück <tiago.muck@arm.com>
Tue, 13 Oct 2020 15:25:34 +0000 (15:25 +0000)
commitcb48ce2a344054a6dd963f5a8b830b803477d353
tree32380306f3ed489e6cf26d8f73e87cce3c626a93
parent7e738c00d2dcc005dc447f1dfb97ea928a72f8cb
mem-ruby: add addressOffset util

Returns the offset of an address with respect to a base address.
Looks unnecessary, but SLICC doesn't support casting and the '-'
operator for Addr types, so the alternative to this would be to add
more some helpers like 'addrToUint64' and 'uint64ToInt'.

Change-Id: I90480cec4c8b2e6bb9706f8b94ed33abe3c93e78
Signed-off-by: Tiago Mück <tiago.muck@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/31270
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/mem/ruby/protocol/RubySlicc_Util.sm
src/mem/ruby/slicc_interface/RubySlicc_Util.hh