systemc: Fix builds on Power systems
authorSandipan Das <sandipan@linux.ibm.com>
Thu, 16 Jul 2020 16:05:48 +0000 (21:35 +0530)
committerSandipan Das <sandipan@linux.ibm.com>
Fri, 17 Jul 2020 02:38:51 +0000 (02:38 +0000)
commita937089d6ffcbfe82ac06754451d1d67c12cc36d
tree20d9f64758a182b1dc2476b8fb336c38142b3c00
parent536ea331b09b98fb214b71737081dd5fa1826929
systemc: Fix builds on Power systems

Based on the 64-bit ELF ABI for Power systems (ppc64 and
ppc64le), the data types int64_t and uint64_t are typedefs
of long and unsigned long respectively. If the SystemC
data types int64 and uint64 point to these, several errors
are observed while building the simulator on Power systems
due to ambiguity between the types when overloading some
operators and functions.

E.g.
  ...
  build/POWER/systemc/ext/channel/../dt/bit/sc_bit.hh:114:17: error: 'static bool sc_dt::sc_bit::to_value(sc_dt::int64)' cannot be overloaded with 'static bool sc_dt::sc_bit::to_value(long int)'
    114 |     static bool to_value(tp i) { return to_value((int)i); }
        |                 ^~~~~~~~
  ...
  build/POWER/systemc/ext/channel/../dt/bit/sc_bit.hh:114:17: note: previous declaration 'static bool sc_dt::sc_bit::to_value(long int)'
    114 |     static bool to_value(tp i) { return to_value((int)i); }
        |                 ^~~~~~~~
  ...

This adds a minor change to a SystemC datatype header to
ensure that the simulator can be built on Power systems.

Change-Id: Icd8bb38134bf98768cc38f9856d7d11a01ebaf21
Signed-off-by: Sandipan Das <sandipan@linux.ibm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/31414
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/systemc/ext/dt/int/sc_nbdefs.hh