There are multiple files that reimplement the same functionality of listing and getting available modules for class instantiation. Create a base class that can be derived and reduce code duplication. Change-Id: I96bf47b1ffd10893691b0b95591969b38894dd65 Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br> Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/20588 Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Maintainer: Andreas Sandberg <andreas.sandberg@arm.com> Tested-by: kokoro <noreply+kokoro@google.com>