359 points · by asicsp · 4y ago · 121 comments
I think it's more likely that this is an artifact of the interconnect design. For example, the interconnect may be designed as a tree, where the path from core 0 to the L2 only visits a branch but the path to core1/2 has to traverse the root of the tree. If each stage adds a clock cycle, there's your 4 clock cycles: one to go to the root, one back down to the other side, and then the whole thing in the other direction for the reply from L2 with the data.
If the interconnect had been a ring bus instead, you'd find that the latency from cores 0 and 2 is the same, but higher for core 1 - assuming no other endpoints in the ring, but that's obviously not the case, since I/O needs to be on the bus too. It's possible he got the core numbers wrong in the die shot, and core 0 is the bottom left core. Then if the ring goes clockwise L2 - core 0 - core 1 - core 2 - I/O on the top right - L2, that's how you end up with core 0 being closer to the L2 in terms of clock cycles than the others, and the observation would be consistent with this design too.
And if you are going to do anything useful (e.g. toggling the signal), the max frequency at which you can do it is even lower than the limit set by the propagation delay.
In any case, even TFA says the reason pretty explicitly: it's actually 4 pipelined stages, thus 4 clock cycles delay. Probably it was way too much power+area to drive the distance in one cycle.
Typical numbers for designs going for higher clocks (read: Pentium 4) would be 16 FO4 stages per clock. So of all you're doing is moving data from point A to point B on the chip, that still gives you quite a bit of leeway for adding buffer stages without having to add an extra cycle of latency.
Things have changed though, as other commenters have pointed out. These days everything is a lot more complicated, as you get to smaller nodes.
But, this request/response means that a ring bus seems unlikely because a unidirectional ring bus should make the sum of the request/response times identical for all CPUs, if I'm understanding correctly.
FWIW, the Cell used a bidirectional ring bus network, and it's of the same generation and happens to share technology heritage with the XCPU... (very similar PowerPC core) :-)
On a modern core the delay is enough that you can't come close to reaching from side one side of a core (not to mention CPU) to another in a single cycle.
The Big Misconception About Electricity.. https://www.youtube.com/watch?v=bHIhgxav9LY
Take a look at the video made by YouTuber AlphaPhoenix where he constructs the entire thing on a smaller scale and demonstrates the effect with an oscilloscope: https://www.youtube.com/watch?v=2Vrhk5OjBP8
One way of viewing what’s going on here is to consider the two sides as a pair of large dipole antennas. When the switch (or in AlphaPheonix’s case, a transistor) is turned on, a pulse of electrons is pushed down one antenna, setting up a transient wave in the electromagnetic field around it which induces a current in the opposite direction in the “receiving” antenna on the other side. This happens regardless of whether the wired are connected in a loop or not!
Physics is great.
E&M can be a little tricky, even for experienced circuit designers.
Phase velocity is close to the speed of light. It can be reduced by dielectric materials parameters so it's often lower than c.
https://en.wikipedia.org/wiki/Phase_velocity
Group velocity is often much slower. Information transfer can never be faster the group velocity, rather than the phase velocity. So when it comes to "on chip communication" it is group velocity that matters. Group velocity depends on many factor of transmission line design such as line thickness, line width, dielectric thickness, etc.
I was blown away by the amount of technical detail we were getting access to and how clearly explained it was. Much of that was thanks to Bruce Dawson. I remember devouring everything I could find that he'd written and it was a fascinating crash course in CPU architecture for a relatively young software engineer at the time with little hardware background. Thanks Bruce!
This way of learning is not taught often enough, we learn it in school when learning another language (e.g. repeating words over and over). But in sciences and engineering the repeated reading of the material is not usually encouraged or talked about.
It would be interesting to see what the material was, it's not linked, but it must have been really detailed.
The main point I wanted to make with how I became the CPU expert was not actually the "reading multiple times" in order to deeply understand it (although that was important) but rather the fact that I chose to become the CPU expert rather than having it assigned to me.
It was one of many times that I became the acknowledged expert of some area, and perhaps therefore in charge of that area, just by working hard in that area until I was "obviously" the expert.
I work on Display team in Windows and in past worked mostly on IddCx and SoftGpu but recently went through some VESA docs and chimed in my opinion during some meetings. Now I'm leading DisplayPort reliability efforts with graphics IHVs
I taught myself almost everything I know, and repeated reading is the method I usually use. I don't memorize, but instead I attack any material to learn by "reading sweeps" (this only applies to topics I know nothing about).
I first read all the material and, even if I don't understand a word about anything, I keep going until the end. Then I read everything again from start to end and here I can definitely say that I'm starting to understand. Then again, and this time I allow myself to go back and clarify something I didn't understand. When I feel confident, I try to implement something with the reading material at hand.
I can't recall any material that I recently learnt that way but "The definitive guide to the ARM Cortex M3" by Joseph Yiu is a book I remember (back in 2007 when I started with Cortex microcontrollers).
Now I happily browse through as many sources as I can find, noting which I think are high quality even if above my head, and absorbing what I can for my current knowledge level. Then I'll revisit the good stuff and scan it to pick up the next layer deep, and repeat over select material until I feel I have what I need.
The other thing I do is make flashcards as I go (I use an app called Quizlet, but I know there are lots out there). Especially with a new subject, just basic terms can be overwhelming at first. I capture want I feel is important in a question & answer format, and just fire it up when I have to a few mins to run through some flashcards (e.g. waiting for a meeting, sitting on the lav, etc.). It seems to work really well for me.
...Unless you're into that kind of thing, and I do believe it will help "pick the right tool for the job", instead of writing your own or picking a random library off the internet. Maybe I should make a habit of it, I'm quite invested in Go at the moment.
On the other hand, probably a bigger factor is 'arsedness'. I don't have the attention span or interest to read something back-to-front, or maybe not anymore? I don't know for sure. But there's not many things that grip me enough to really draw me in.
...except writing shitpost comments on HN.
Don't treat all sources as a mere dictionary of self-evident structure. Quitting just because the blurb of immediate interest has been rendered leaves out key opportunities to learn what is available.
A lot of documentation these days is mostly references that you look up when you need the nitty gritty details and the bigger picture is not documented as well.
I don't repeatedly read books just to memorise or remember stuff, but I repeatedly read books because you learn and fully digest certain concepts which are then needed before moving on to other concepts
Short version: don't be too concerned if you're not completely confident on the details the first time through, because it will make a lot more sense next time around.
I appologise in advance for the fact I will repeat questions to people and get it wrong initially, it's part of the learning process
To learn a language, you can't problem solve your way to the solution, you either know it or you don't, and when you use it in practice (in a conversation) you can't look up what you need to know on the spot.
In the mid-90s I set up my then-employer's first WAN. Cisco 2501 with T1s for in-city links and frame relay for inter-city/international. As part of our Cisco contract, we got a full manual set, which was maybe 24" of shelf space. In my spare time over a couple of weeks, I sat down and read the whole thing. Then I went back and actually studied the parts that were relevant, mostly by reading and re-reading until it all made sense to me.
On top of that, I added a lot of practical experimentation with the gear. But foundational for me was really understanding the perspective of the people who made it.
I fully agree with understanding the perspective of the people making the thing, knowing the what isn't always as useful as knowing the why. I speak a lot about being idiomatic, which is to say developing in a way that is sympathetic to the system and its existing approaches. That takes understanding the why more than the what.
I am reminded of the Honda motorcycle maintenance manuals. They are like being face to face with the engineers who designed the bike, reading that back to back would give you that deeper understanding of the system I think.
That's my pet peeve with auto-generated docs, they don't actually help much. I can see the function for myself, I don't need to be told it exists, I need to know why!
But for every given topic, we still need deep experts, like Bruce Dawson was for this processor at Microsoft. So I think this mode is still very valuable, so I agree with Ciantic: this way of learning is something everybody should have at least some practice in.
Like it's much easier to find a connection between two things you know about compared to two things you could look up.
i think this is exactly the right take in entirely the wrong direction.
proficiency and mastery are about committing more and more complex things into sub- or un- concious action; muscle memory as it were. grandmaster chess players dont think about solving puzzles that stump novices, they absorb whole board states and many/all permutations instantly. BJJ black belts dont have to think about arm bars, they anticipate complex possibilities of moves and countermoves that a novice simply cannot fathom. this is as true in engineering as any other field. a simple litmus test: is there a difference between a college grad and a 40-years experienced engineer? of course there is
I think GPs point is exactly right. there is a certain lost magic to simply smashing your brain into something and absorbing as much as possible. big eyes, big ears, ego to attempt but humble to fail. one might call such a person a hacker.
edit: see The Art of Learning, Waitzkin
In other instances memorization is a foundational requirement, like language learning. Can't leanr a word if you don't know the alphabet, for example. In that sense practice only serves to reinforce the memorization it is the memory that is most important to being effective in that case.
Xbox 360 was getting into the era where consoles had OSes and things should be abstracted through DirectX but I guess Microsoft decided the safest thing to do was create a clone with artificial slowdowns rather than risk games pushing the limit breaking.
Nowadays consoles can change CPU / GPU microarchitectures seemingly without problems...
Yeah, the only place I've seen a full wafer on display is a display case in the lobby of a chip company office building. I wonder how often some process goes out of whack and they get an entire known-bad wafer that still looks great?
I think many of the alignment steps during manufacturing involve making a wafer, seeing how misaligned it is using an electron microscope, adjusting all the machines, then making another wafer. Repeat until the wafers start working.
reminds me of when I had some 'trash' leftover CPU's, chips, or memory units; drill a hole in it and you have a keychain gadget.
"Wafer of the Sony PlayStation 1 CPU. While decaping a Sony CXD8606Q, I was very lucky to be able to match the die to an unidentified wafer I had in my collection. The 6“ wafer could accommodate a total of 200 individual dies."
https://twitter.com/chiakokhua/status/1306437988801486848 sourced from
https://cset.georgetown.edu/wp-content/uploads/AI-Chips%E2%8... p45
Adding that to the fact that the three cores have a shared common bus, and there are gone to be some kind of signalling about who is using it (that we don't know), this could be reasonable.
The Xbox 360 CPUs works at 3.2 GHz, that's 0.3125 ns per cycle, and four cycles make those 1.25 ns. I won't be surprised if those who made the CPU designed to have 4 cycles of delay to cores 1 and 2 to be sure there isn't any kind of glitch reading the data from the port.
It's common in FPGA/microcontroller designs to have 'input synchronizers' on inputs from long digital lines (on any input where you can't guarantee synchronicity) to prevent metastability problems, especially when crossing clock domains. I think that's likely the case here, there are both long lines and different clock domains.
1. An otherwise inconvenient situation (snowpocalypse) was turned into a learning opportunity. I would've probably turned it into a Netflix binge.
2. People took the time to detail the CPU design in a document. I'm always looking for examples showing the benefits of documenting design (I'm an EM) and it's rare to find one that changes someone's life trajectory. :)
The documentation that I read showed the pipelines in great deal, but they were badly presented such that the flows of data and time were obscured. My main contribution was to straighten out and simplify the diagrams, and then animate them. Well, and then explain them. It was definitely a CPU that required that level of detail.
"...So the 5.5 mm actually only takes 0.625 nanoseconds each way, the signal actually goes 11 mm in 1.25 nanoseconds, so the original title of this blog post is a lie. Sorry!"
Now I am! 15 years late.