Hi folks, I'm looking at refactoring some of the config code, and CpuConfig.py is complicating things a bit. It's a central point where there's a list of things, specifically CPU models, and so to add new CPU models you need to modify that file. That makes it hard for things that define new CPU models to be kept out of the main code base.
What I'd like to do is to add a concept of a "flavor" of CPU which would be defined as part of the CPU subclasses and which would be aggregated in BaseCPU. If a CPU has a member called "flavor" when it's defined, that string will take the place of the CPU aliases which currently exist. Those will be aggregated in BaseCPU using a metaclass, and could be listed, queried against, etc., like the code in CpuConfig.py today, but without having to centralize all those definitions. This sounds like something that could be useful in other places where there are collections of similar, largely interchangeable things with different implementations, so it might even be nice to wrap the implementation in a python decorator, for instance, which could be used for other things like prefetchers, etc. That would be above and beyond what I'm hoping to do for now, but I thought I'd throw it out there in case it seemed like a good idea to folks. Thoughts? Gabe _______________________________________________ gem5-dev mailing list [email protected] http://m5sim.org/mailman/listinfo/gem5-dev
