0

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.

1 Answer 1

0

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.

Sign up to request clarification or add additional context in comments.

2 Comments

My guess is that OP cares about wall time of emulation and simulation. OP just needs to have a good stopwatch and make sure that the test in both worlds does the same job :-).
I am trying to find out the propagation delay of just calculating matA*matB operation, doing the behavioral simulation gives the correct output but post synthesis shows more than 100% IO utilization and the output is always Z... (trying to compare np.dot(mata,matb) vs fpga)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.