R
rickman
Guest
On 8/5/2015 3:45 PM, glen herrmannsfeldt wrote:
That is pretty obvious if you give it a bit of thought. A CPU running
software is a *HUGE* finite state machine (FSM) with the memory
containing the majority of the state along with the fewer registers in
the CPU. The memory contents are all accessed through a very large
multiplexer and operations on this FSM are time multiplexed and
controlled by a program stored in memory.
In an FPGA or ASIC the logic can all be designed in parallel with the
much less happening sequentially. The design could be done in the same
way with the very large multiplexers. The program can be done with
logic rather than a stored program, but the access to the large FSM
still requires a lot of multiplexers. So while it is possible to
duplicate the actual CPU in an FPGA, it is seldom the best way to
utilize an FPGA. The same problem can be implemented with a lot fewer
gates by tailoring the algorithm to take advantage of the parallel
nature of the FPGA and only implementing the specific data paths
required by the problem. The generic CPU gains efficiency by the
repetition of the regular arrays in memory which can be made both small
and cheap but only with a sequential algorithm.
--
Rick
Often the useful hardware implementation of an algorithm is
completely different from the usual software implementations.
It is unusual for tools to figure that out.
That is pretty obvious if you give it a bit of thought. A CPU running
software is a *HUGE* finite state machine (FSM) with the memory
containing the majority of the state along with the fewer registers in
the CPU. The memory contents are all accessed through a very large
multiplexer and operations on this FSM are time multiplexed and
controlled by a program stored in memory.
In an FPGA or ASIC the logic can all be designed in parallel with the
much less happening sequentially. The design could be done in the same
way with the very large multiplexers. The program can be done with
logic rather than a stored program, but the access to the large FSM
still requires a lot of multiplexers. So while it is possible to
duplicate the actual CPU in an FPGA, it is seldom the best way to
utilize an FPGA. The same problem can be implemented with a lot fewer
gates by tailoring the algorithm to take advantage of the parallel
nature of the FPGA and only implementing the specific data paths
required by the problem. The generic CPU gains efficiency by the
repetition of the regular arrays in memory which can be made both small
and cheap but only with a sequential algorithm.
--
Rick