How do I input a large Excel data set when using HDL coder?
2 views (last 30 days)
Show older comments
Hi,
I am making an easy trading algorithm which should run on an fpga. I want to use massive datasets but get an error message in the HDL verify part of the workflow which says my data set is too large. (this dataset only has 879 entries)
Also, which of the generated files do I use to run my Fpga in the loop? Can I use the testbench_fil file?
0 Comments
Answers (1)
Tim McBrayer
on 7 Jan 2014
You need to make sure your dataset is being read by your testbench and then fed to your design in a hardware-friendly fashion. When using FIL, the full dataset needs to reside in Simulink and be passed to your design element by element. This is a requirement due to the limited number of pins on an FPGA. For example 879 data values, if they were 32-bit integers, would require over 28000 pins to pass at once onto an FPGA.
For a simple discussion of testbenches for HDL Coder, see this <http://www.mathworks.com/matlabcentral/answers/109999-how-to-make-a-test-bench-file-for-a-matlab-m-file answer>.
2 Comments
Tim McBrayer
on 8 Jan 2014
If the data is just a vector, you'd want to pass it into the design one element at a time. You will need to consider how much data you need to have on hand at any instant inside your design. You can use Block RAMs to store reasonable amounts of data on an FPGA. But, as with all FPGA resources, there are limits.
You will also need to choose a data type that minimizes the number of bits while also minimizing the error when converting from floating to fixed point. For example, the data above shows precision down to 0.01. This means you should be looking to use at least 7 fractional bits. This makes your minimum step size 1/128. More fractional bits will minimize your conversion error, while increasing the size of your hardware.
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!