base-stats,python: Add Python Stats

This model is used to store and represent the "new" hierarchical stats
at the Python level. Over time these classes may be extended with
functions to ease in the analysis of gem5 stats. Though, for this
commit, such functions have been kept to a minimum.

`m5/pystats/loader.py` contains functions for translating the gem5  `_m5.stats`
statistics exposed via Pybind11 to the Python Stats model. For example:

```
import m5.pystats.gem5stats as gem5stats

simstat = gem5stats.get_simstat(root)
```

All the python Stats model classes inherit from JsonSerializable meaning
they can be translated to JSON. For example:

```
import m5.pystats.gem5stats as gem5stats

simstat = gem5stats.get_simstat(root)
with open('test.json', 'w') as f:
    simstat.dump(f)
```

The stats have also been exposed via the python statistics API. Via
command line, a JSON output may be specified with the argument
`--stats-file json://<file path>`.

Change-Id: I253a869f6b6d8c0de4dbed708892ee0cc33c5665
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/38615
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
10 files changed