bgottula / noodles

Framework for DSP flowgraphs.
MIT License
1 stars 0 forks source link

Cycle-accurate simulation #26

Closed jgottula closed 10 years ago

jgottula commented 10 years ago

If we ultimately decide to go down the path of cycle-accurate simulation, we'll need to (a) determine how to modify the block/noodle stuff to accommodate this, and (b) determine what constraints this puts on the overall system (could we still get away with multithreading; how to make sure feedback works; can we batch blocks to any extent; etc.).

Replace Block::work with two new functions:

Previously, I was thinking that we would have a fast, threaded mode of the scheduler for high level design of blocks, and then a slower, serialized mode for creating test vectors to do verification. Now that cycle-accurate simulation has been brought up, might it make sense to have two versions of Noodles?

This bifurcation would require writing a High-Level implementation and Low-Level implementation of each block, which sounds like duplication of effort. But it has the advantage of retaining the relative ease of writing and simulating blocks' overall function without worrying about the implementation stuff, while still being able to also do cycle-accurate verification when you want to do that.

Or maybe this would just increase the amount of work you'd have to do, since now you'd have to make sure the High-Level and Low-Level blocks really do the same thing.

Good idea, bad idea?

bgottula commented 10 years ago

Now that I'm further along in the design of a high-speed DSP project, it's becoming more clear that cycle-accurate simulation is not as critical of a priority as I had thought, and in fact it is actually somewhat undesirable from a verification standpoint. I was able to design a very complex multirate filter and the hardware verification was definitely somewhat painful, but not unbearably so. By keeping the software implementation as a straightforward implementation of the original DSP algorithm it can serve as a reliable reference to confirm that the process of refactoring the algorithm to work in hardware did not change the math. In the case of the high-speed multirate filter, hardware constraints required the FPGA engineer to significantly refactor the algorithm to support the required throughput, meet timing, and efficiently utilize DSP slices and RAM. However this refactoring was very complex and introduced a number of bugs which were caught by comparison with the software model which had not undergone such manipulations. I think most of the debugging value of the software model would have been lost had I tried to mimic the hardware too closely.

bgottula commented 10 years ago

Conclusion: We won't directly support cycle-accurate simulation in Noodles.