New CPU simulator

discussion of forwardcom instruction set and corresponding hardware and software

Moderator: agner

Post Reply
Kulasko
Posts: 31
Joined: 2017-11-14, 21:41:53
Location: Germany

New CPU simulator

Post by Kulasko »

After way too much time, I finally managed to release a ForwardCom-capable CPU simulator in usable condition.
I will use it to examine ForwardCom features for a performance impact in my bachelor thesis.

It can be found here, though binaries are not available yet:
https://git.h3n.eu/gpcas/gpcas

The CPU model is highly tunable, but has some missing features I would have liked. Most important is advanced branch prediction, as my TAGE predictor implementation seems broken.
Front end ALUs are also not implemented yet, but in-order and out-of-oder pipelines can be mixed, with in-order ones taking priority if all operands are available. Combined Load + ALU instructions get split if there are only dedicated ALU or memory pipelines.

The ForwardCom emulation has quite a few instructions missing, but the general structure is in place, so adding them should mostly be straightforward. All instructions needed for the n-body simulation benchmark I wrote are working.
Still, quite a few things are missing, such as the memory map and multi-thread support. As such, it should not be used to developing new programs, but working single-threaded programs not relying on interrupts should also work inside the simulator.

The simulator is written in Rust, so the code might look a bit unfamiliar to people used to C++. The performance is alright, the emulation doesn't reach the speed of the official emulator, but it isn't much slower with smaller vector lengths.
My old AMD FX managed >6 MIPS in the simulator versus >8 MIPS in the official emulator.
CPU simulation speed varies greatly with the simulated model. I measured about 4 MHz for the simplest possible model and about 300 KHz for a model aiming to match the https://boom-core.org/ architecture.

Even if the simulator should not see much use, developing it helped identifying numerous small missing or conflicting pieces of information inside the specification. As these are fixed now, it already contributed to ForwardCom development. Hopefully, it will do so even more going forward.
agner
Site Admin
Posts: 177
Joined: 2017-10-15, 8:07:27
Contact:

Re: New CPU simulator

Post by agner »

This looks very exciting. I am looking forward to see your results.
Post Reply