??? 01/16/08 01:56 Read: times |
#149501 - Re: How much code space does it support? Responding to: ???'s previous message |
Richard said:
Have you figured out how much code space you have left in this FPGA? Yes and no. Here's the "no" part: Currently I have the code space implemented as a simple case statement that gets translated by the synthesizer into a wad of combinational logic. That in turn gets implemented in the LUTs along with everything else. So when I run out of LUTs, I'm out of code space also. The interesting thing about this scheme is that the amount of code space available depends on what you want to put in it! If, for example, I wanted 64K worth of NOPs with a JMP at the end back to address zero, I'm sure there would be no problem because the combinational logic to do that would be trivial. On the other hand, the amount of "real" code that could be handled by this scheme would be far less than the full 64K. I haven't tried to determine the actual limit. Here's the "yes" part: For a couple of reasons, one of the things I want to do fairly soon is reimplement the code space in block RAM. If I remember correctly, the FPGA I have has about 40 KB of block RAM available, and that will be shared between the code memory and XRAM. My initial thought was to implement 8 KB of XRAM and 32 KB of code space, but I haven't seen a reason yet why those numbers can't be adjusted one way or another as long as their sum doesn't exceed the 40 KB total. What about data space, particularly IRAM? Are you supporting any sort of XRAM? Currently I've got 256 bytes of IRAM and 2 KB of XRAM. As I mentioned, the XRAM is implemented in block RAM. The IRAM wound up as distributed RAM because I wanted to read it asynchronously for performance reasons. Have you implemented any part of SFR space? Do you have a DPTR, SP, etc, yet? Yes, of course, since many of the instructions depend on those registers. Currently, I've got ACC, PSW, SP, B and both halves of DPTR implemented. What, exactly, do you mean by "some kind of comprehensive regression test"? I think what I'd like is an 8051 program that exercises each instruction completely and probably just halts with an error code somewhere if it finds a problem. I think this may be something akin to what you were wishing for some time ago for incoming inspection on your parts. As I implemented each instruction, I ran the resulting new version of the core on the simulator and inspected the simulator's output manually to make sure that the new instruction worked as advertised. Now I want to experiment with several gross changes to the implementation, and I need some way to make sure that it still works after each one, without going through the entire manual inspection procedure over and over again. I'm patient, but not that patient! I suppose one step in the right direction would simply be to use a big C program, on the assumption that it would exercise much of what was important to big C programs. Obviously, however, a program specifically designed to thoroughly test all the instructions would be a lot better. I've seen a couple of half-hearted attempts at such on the web, but nothing you'd want to be the farm on. I still have hope of finding something at least partway done that I can start from. If not, I'll write one from scratch. -- Russ |