Yeah, that's a good question, and I don't have a specific plan for how to handle it. Since gem5 nominally simulates some sort of abstract x86 CPU which isn't really Intel or AMD or anybody (although probably most like AMD because those are the manuals I used), it sits in a weird area where code written for the real world probably doesn't know quite what to do with it.
This might be a place where it would make sense to somehow bridge between python and c++ and let the config specialize some sort of function or dict or tree of dicts or whatever which decode what CPUID function is being requested. We should consider how much interaction there would need to be between a system like that and the c++ side of the hardware, or if, for instance, it could somehow crawl the SimObject hierarchy in python to find out what values to return for, say, cache sizes, etc. I've been playing around with the interface between c++ and python, and while it's still a bit mysterious still, it's actually pretty powerful and fairly straightforward to use. With that sort of setup, if you wanted to make it look like a particular model of AMD cpu or Intel CPU or your own magic CPU, or add in some additional CPUID field for some reason, all of that would be relatively accessible and easier to customize on a per CPU basis. What do you think? Gabe On Thu, May 3, 2018 at 2:55 PM, Gutierrez, Anthony < [email protected]> wrote: > This question is mostly for Gabe. In the ROCm runtime we see some inline > asm for specific CPUID functions. They first use CPUID to determine the > name string for the processor, and when it seems the "M5 Simulator" as the > vendor it defaults to Intel and sends along the CPUID request with the > Intel-specific ID for cache config descriptors. The ID used by Intel is > different than is used by AMD for the same function. > I am just wondering what your thoughts are about implementing these > functions. Do we implement the CPUID functions for only one vendor? Is > there a way to make it configurable? > > Currently I am not bothering to implement it, I am simply returning {0x0, > 0x0, 0x0, 0x0} and issuing a warn (in cupid.cc), but I still need to add > the particular ID to the StandardCpuidFunction enums in order for it to be > considered in the switch statement. > _______________________________________________ > gem5-dev mailing list > [email protected] > http://m5sim.org/mailman/listinfo/gem5-dev _______________________________________________ gem5-dev mailing list [email protected] http://m5sim.org/mailman/listinfo/gem5-dev
