简体   繁体   中英

Compute processing time Verilog using simulation and using FPGA

New to fpga world, i wrote a verilog HDL program for nxn matrix multiplication and now i want to compare time between FPGA and CPU/GPU. I get the execution time on CPU/CPU by using time.time() in python or using profiling. How do i achieve the same thing in vivado simulation (how to use same hardware specs of basys3 in simulation)? the Basys 3 (Hardware) is yet to be delivered.

Is there a way to calculate a metric which is same for both the worlds? Time or clock cycles.. ?

Thanks for your help.

You can measure how many clock cycles it takes to finish the calculation. **

Unfortunately that is not enough.
The simulation is artificial. You can run it at any speed. If you want, you can use a 500GHz clock in simulation, which you know is not real. You need to synthesize the code and see what the tool tells you the maximum speed is which the code can run at. Then use that clock speed with the cycles from the simulator to calculate the time it takes to finish.

That is fine in theory.
Practically you also are going to need to get the data to and from the FPGA. If you can't do that fast enough your I/O is the bottleneck, not the actual matrix calculation.

** Use the cursor to measure the time of the simulation. Divide that by the time of one clock cycle.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM