sim,misc: Move protobuf housekeeping out of gem5Main.

Put that code into a singleton class in src/proto, so that it gets
called during initialization and teardown of gem5 without cluttering up
gem5Main. This also removes the need to use #ifdefs to guard for
actualling having protobuf support.

Change-Id: I93b5d994eee478a9c159a3f3d02b3e996af02a3e
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49416
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Gabe Black
2021-08-17 04:12:47 -07:00
parent 619e443700
commit ff802f4e27
3 changed files with 69 additions and 18 deletions

View File

@@ -42,6 +42,7 @@ if env['HAVE_PROTOBUF']:
ProtoBuf('inst_dep_record.proto')
ProtoBuf('packet.proto')
ProtoBuf('inst.proto')
Source('protobuf.cc')
Source('protoio.cc')
# protoc relies on the fact that undefined preprocessor symbols are