Settings

Theme

Visualizing CPU Pipelining (2024)

timmastny.com

97 points by flipacholas 18 days ago · 14 comments

Reader

inetknght 18 days ago

The best presentation I've seen about CPU performance related to pipelining, branch prediction, and speculative execution was Chandler Carruth's "Going Nowhere Faster" presentation at CppCon 2017 [0]. I do recommend watching the whole presentation, but if you watch nothing else then just watch the 5 minutes or so from the linked timestamp.

[0]: https://youtu.be/2EWejmkKlxs?t=2511

  • omcnoe 18 days ago

    It also contains a wonderfully prescient question asked right at the end of the talk: "... the processor gonna speculate, doing some loads out of the bounds of the array, how does it work in the hardware that it doesn't crash?"

    Left unanswered at the time. I believe Spectre was known but not publicly disclosed at this time.

smallpipe 18 days ago

CPUs haven't worked like that in anything but a microcontroller for half a century

risingedge 18 days ago

If anyone is interested, at https://sonic-rv.ics.jku.at/ we built an educational platform for web-based simulation and visualization of RISC-V processor architectures.

Our pipeline visualization is reconstructed from real RTL traces (you can run your on programs which are simulated using GHDL).

Under examples you can find some different architectures based on the Harris&Harris book on computer architecture.

jhallenworld 18 days ago

Now do a dynamic scheduling out of order engine with renaming, 20 pipes, speculative execution and hundreds of instructions in flight. I guess you could make a multi-person game for this.

empiricus 18 days ago

Maybe it's just me, but the visualizations do not help me at all.

  • artemonster 18 days ago

    I am always puzzled by such articles - its actually very well made, drawings are good, little interactive pipeline animations are fine. But in order to follow it you must already know and understand what its writeen about and if you dont - the content is just noise for you.

    • cogman10 18 days ago

      The article does say what it expects you to know before reading. However, it has a dead link to the knowledge it wants you to know.

      • tmastny 17 days ago

        Author here: thanks for flagging the dead link! Unfortunately, I had to remove it. I couldn't find the original slides.

    • tmastny 17 days ago

      Hi, I'm the author! Thanks for saying it's well made :).

      I actually agree with you, the intended audience isn't someone who has never heard of CPUs before.

      I tend to either write for myself: you know the saying you don't understand something until you try to explain. Or I'm writing for the person self-studying that is looking for that one explanation where everything finally clicks. I always get a lot out of those type of posts myself, so like to create them for others too.

      • empiricus 16 days ago

        You could use colors in the step-by-step simulation to show dependencies. Also show some tooltips/comments when things happen (that you described above). Ideally one should press next next next in the simulation, and understand what happens better than the paragraph description above.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection