systemc: Fix verify.py and make it python 3 compatible

1. The logger behavior change breaks verify.py.
commit 8deb205ea10d6cee0b58c46e097be46c784ed345
Author: Daniel Carvalho <odanrc@yahoo.com.br>
Date:   Wed Mar 3 16:49:05 2021 -0300

    base: Add LOC to Loggers

    Printing the line and the file that triggered a log
    is useful for debugging.

    Change-Id: I74e0637b2943049134bd3e9a4bc6cab3766591a9
    Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
    Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/42141
    Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
    Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
    Tested-by: kokoro <noreply+kokoro@google.com>

2. Use bytes diff in LogChecker.
In Python3, string is required to be in a certain encoding, while in Python2,
it is not. In the testcase, misc/cae_test/general/bitwise/or/datatypes,
it contains some invalid codepoint of utf-8, we need diff the log with
bytes in Pyhton3.

3. Python3 compatible.
* dict.iteritems -> dict.items
* remove object base class
* use `except as` when catching exceptions
* handle map and filter behavior change

Test with

src/systemc/tests/verify.py --update-json build/ARM -j `nproc` \
  --filter-file src/systemc/tests/working.filt

src/systemc/tests/verify.py --update-json build/ARM -j `nproc` \
  --filter-file src/systemc/tests/working.filt --phase verify --result-file

Change-Id: Ibf5b99d08a948387cf6162c476c294c49a7dac0f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/44465
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45822
1 file changed