Gregory, as I would call him, comes by my cube. With a coke in his hand, "what's up G-man?" comes the question. And I get set for another discussion ranging from alternative energy sources to Wimbledon to 'how Iron Man's brain would turn to pulp if an F-22 shoots a missile at him'. Today I have a topic to discuss, so I take the lead.
"Why would you prefer using pipelined approach to coding an RTL design over writing a state machine?" Gregory's answer:
a.
FSM code is really cryptic to analyze. There are state encodings, state transitions, plus a multitude of different things that the FSM does when in a particular state. To get your head around this code, you need to go all over the place and understand all these transitions. Pipelined code is much simpler in this sense. Typically a set of registers feeding each other every clock, pipelined code is easier to trace through and understand. One year, after you've coded your design as a pipeline, and you're racking your brain trying to figure out what your code does, you'll thank yourself to have coded it as a pipeline than as an FSM.
b.
How simple is it to change the code? FSMs are very timing critical. Adding an extra state or modifying a signal assignment has to be done keeping in mind all state transitions. One screw-up and you introduce a bug that will take multiple regressions to surface. Pipelines, on the other hand, are timing critical too. But since they don't have states going back and forth like in an FSM, whatever you change will only affect downstream logic. Relatively easy!
c.
So FSMs are useless? Not quite. FSMs would be ideal in situations where you have to interface with external devices. A lot of handshaking is required in these, with requests and acknowledgements going back and forth. A state machine would be the way to go.
So how did Gregory develop a style to code in a pipelined way instead of state machines? Well, Chromatic Research! He worked at this microprocessor company a while back. And microprocessors have very strict timing constraints, nothing that an FSM can handle. Chromatic Research developed graphics processors around the time that the gaming and industry was just entering the 3D realm. Duke Nukem 3D had just come out. Also, DVDs were finally making their presence felt. Chromatic Research developed processors customized for video and gaming applications. So you could do a super-fast discrete cosine transform or a matrix multiplication using minimal instructions. Great for things like MPEG2 decoding. Awesome for video! In fact, Chromatic Research had the best video accelerator in the market. Whereas competitors like Matroxx just focused on 3D rendering and sucked at video.
So what happened to Chromatic Research? Bad judgement. It never thought gaming would surpass video in GPU utilization. It missed this market transition and put itself up for sale. ATI grabbed it and integrated the technology in their Radeons. At that time, ATI was an average Joe company, with the only advantage that its products were easily customizable for OEMs. So companies like Dell, could easily integrate them in a very cost-effective manner. 3D graphics was a big player in the GPU market then, and nVidia didn't exist. But then, 3D graphics made some wrong moves, a few other companies merged to form nVidia, ATI pulled up its sleeves in the GPU segment, and ATI started being on par with nVidia. Now acquired by AMD, ATI is a close second behind nVidia in the GPU market.
What else? Is that all the tech discussion today with Gregory? No way! How can it end without talking about cars and fuel cells, etc. So what's new on that front? Its his Mitsubishi Eclipse's alternator. Apparently, it can't drive a lot of current. It starts chugging if you start the wipers, stutters if you put the fan to full blow and just dies if you add some music playing to it. So Gregory's going to add a brand-new alternator, change the wires and make his car kick ass again.
What about turbo-charging? Seen those Fast and Furious movies where the hero presses a Nitro button and jets start shooting off the exhaust and the car zooms forward like a rocket? Thought that was just special effects in movies. But no, Gregory knows better. That thing actually exists, sans the exhaust jets. Its a way to boost the horsepower on your engine, although you end up risking its durability. The way it works is you cool the gas chamber and inject a compressed nitrous gas into the chamber. This leads to a bigger explosion that pumps the car forward.
And with some other pleasantries like how's volleyball going and how's Federer got washed out at Wimbledon, we ended today's session of Greg Talks.