??? 12/17/07 11:49 Modified: 12/17/07 11:50 Read: times |
#148369 - I think this horse is finally dead Responding to: ???'s previous message |
I said:
It's fairly obvious that the SFRs need to be implemented as discrete registers, because in general, their outputs need to be available continuously, either to configure various features of the peripherals that they control, or to speed up certain instructions. A second, similar reason is that some SFRs contain bits that get manipulated individually, and that would be messy if they were stored in a RAM. Finally, it may make sense for performance reasons to implement SP and DPTR as loadable counters. Putting them in a RAM would clearly preclude that option. Richard said:
I don't see that, as they're also accessible, bitwise, from memory ... if not under the instruction set, certainly in the hardware. I said:
This I need to think about. I have been assuming otherwise. I have finally resolved this issue to my satisfaction by running an experiment. First, I grabbed the 64 x 8 FIFO module from my Morse code project and synthesized it as a standalone thing. The synthesizer generated a LUT-based (a.k.a. "distributed") RAM for the FIFO that used up roughly 1% of the FPGA resources. Then I added a couple of lines of code to the module to bring just one bit from within the RAM array out for continuous availability to other logic. With that change in place, the synthesizer generated 512 individual flip flops** and a whole bunch of combinatorial logic instead of the more efficient LUT-based RAM. The FPGA utilization was about ten times bigger than before. So, while it is possible to access individual bits within a memory array implemented on an FPGA, doing so appears to kill the chance for an efficient implementation of that memory as either a block RAM or a distributed RAM, at least with the particular Xilinx tools and Xilinx FPGA that I happen to be using. I suppose a big YMMV is in order for other tools and/or chips. Bottom line for the 8051 core:
** A "sea" of flip flops, one might say, as predicted here by Andy Peters. |