Comment by mathisfun123
17 hours ago
This is a cycle accurate simulator. It takes a list of instructions and simulates how long it would take to actually execute those instructions. In addition it keeps track of counters for various things (cache misses, interrupts, etc). Correlation refers to making sure the counter values reported by the sim are within some ballpark of the same values on a real chip. Cycle accurate sims are used for architecture research (trying out new features) as well as pre-silicon software work - chip isn't taped out but you want to start building a compiler. They are generally very slow (1000x slower than running on device) because they are generally written by HW people who have no idea how to write fast code. I would be interested to know how fast this one is.
The reason is not bad SW engineering for the simulator, but rather a different goal.
Cycle accurate simulations means you emulated the exact CPU behaviour - easily spending 1000 instructions to compute what happened and maybe even log the results for later inspection. You want to be flexible to try different things, so not over optimize and still compare detailed behaviour.
If you build a performance multi core CPU and emulated on a single regular core, I would not be surprised to be 1000000x the runtime.
Is it really a “write fast code” problem? I always assumed 1000x was more of a ceiling because of how much must be modeled. Think of how emulating a different architecture often runs at least 10x slower, and there is significantly less work there to do.
In larger orgs these cycle accurate simulators are generally written by SW people (or SW people with a HW background).
If you think a little bit harder about this you will realize this is impossible. The hardware modeling people are the SMEs - they read the arch spec and implement the sim to match as closely as possible.
Also speaking from experience at one of the largest chip orgs in the world, it's empirically not the case.
Speaking from experience, you are both right. It depends on the team, even within the same company.