Go Back   Velocity Reviews > Newsgroups > VHDL
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

VHDL - Finding the execution time

 
Thread Tools Search this Thread
Old 09-02-2005, 01:08 PM   #1
Default Finding the execution time


Hi, Suppose I have written algorithm in VHDL. This algorithm has
sequential statements before the final result appeared.
My question: can I calculate the time need on microsecond from the
first input until the last output? Like in Matlab we use "tic" in first
line and "toc" in the last line? i.e. how can I find the execution time
for my algorithm?
Thank you.



a_Conan
  Reply With Quote
Old 09-02-2005, 01:43 PM   #2
Nicolas Matringe
 
Posts: n/a
Default Re: Finding the execution time
a_Conan wrote:
> Hi, Suppose I have written algorithm in VHDL. This algorithm has
> sequential statements before the final result appeared.
> My question: can I calculate the time need on microsecond from the
> first input until the last output? Like in Matlab we use "tic" in first
> line and "toc" in the last line? i.e. how can I find the execution time
> for my algorithm?


This depends on your clock frequency but from your question I think
that your algorithm is purely combinational (combinatorial?). Thus the
'execution' time will depend on your hardware implementation (ASIC?
FPGA?)
Post your code and we might help you further.

Nicolas



Nicolas Matringe
  Reply With Quote
Old 09-02-2005, 02:29 PM   #3
a_Conan
 
Posts: n/a
Default Re: Finding the execution time
Hi Nicolas, yes my algorithm depends to multiple calculations separated
in functions and procedures such as:
..
..
..
for i in 1 to M loop--start from the second row
for k in 0 to (N - i) loop
Matrix_out(i, k) := Matrix_in(i, i + k);
end loop;
for k in 0 to (i - 1) loop
Matrix_out(i, N - k) := Matrix_in(i, i - k - 1);
end loop;
end loop;
..
..
..

every function can call others as need.
suppose my clock frequency is 50MHz. so how can I find the exe-time.
I will use FPGA.



a_Conan
  Reply With Quote
Old 09-02-2005, 02:54 PM   #4
Nicolas Matringe
 
Posts: n/a
Default Re: Finding the execution time
This is quite a big arithmetic block...
Functions and procedure are to be used with great care in synthesizable
code (especially procedures).
If you don't have any synchronous process, your max speed will depend
on the FPGA (brand & family) but anyway it may well be very slow.
Again, post your code and we may be able to help you further.
Remember that VHDL is definitely *not* a programming language. Always
think hardware.

Nicolas



Nicolas Matringe
  Reply With Quote
Old 09-02-2005, 03:17 PM   #5
a_Conan
 
Posts: n/a
Default Re: Finding the execution time
Do you think I can do it like this:
..
..
T1 := NOW
function1 :=( N1 , N2)
function2 :=( N1 , N2)
function3 :=( N1 , N2)
T2 := NOW - T1;
..
..



a_Conan
  Reply With Quote
Old 09-02-2005, 03:29 PM   #6
patrick.melet@dmradiocom.fr
 
Posts: n/a
Default Re: Finding the execution time

Stop thinking software !!!

Your two loops with 2 dimensions vector cannot be synthesizable !!

I think you better use a RAM and make transfert inside the RAM...

Are you just doing simulation or you want to implant it in a FPGA



patrick.melet@dmradiocom.fr
  Reply With Quote
Old 09-02-2005, 03:29 PM   #7
patrick.melet@dmradiocom.fr
 
Posts: n/a
Default Re: Finding the execution time

Stop thinking software !!!

Your two loops with 2 dimensions vector cannot be synthesizable !!

I think you better use a RAM and make transfert inside the RAM...

Are you just doing simulation or you want to implant it in a FPGA



patrick.melet@dmradiocom.fr
  Reply With Quote
Old 09-02-2005, 04:47 PM   #8
a_Conan
 
Posts: n/a
Default Re: Finding the execution time
Sorry patrick, do you mean I cannot synthesize the upper code on my
FPGA?
Are you sure?



a_Conan
  Reply With Quote
Old 09-03-2005, 05:21 AM   #9
a_Conan
 
Posts: n/a
Default Re: Finding the execution time
Ok, Patric can you tell me how can I do
for i in 1 to M loop--start from the second row
for k in 0 to (N - i) loop
Matrix_out(i, k) := Matrix_in(i, i + k);
end loop;
for k in 0 to (i - 1) loop
Matrix_out(i, N - k) := Matrix_in(i, i - k - 1);
end loop;
end loop;

in RAM to make it synthesizable ?

Thanks



a_Conan
  Reply With Quote
Old 09-03-2005, 08:13 AM   #10
Ralf Hildebrandt
 
Posts: n/a
Default Re: Finding the execution time
a_Conan wrote:

> Ok, Patric can you tell me how can I do
> for i in 1 to M loop--start from the second row
> for k in 0 to (N - i) loop
> Matrix_out(i, k) := Matrix_in(i, i + k);
> end loop;
> for k in 0 to (i - 1) loop
> Matrix_out(i, N - k) := Matrix_in(i, i - k - 1);
> end loop;
> end loop;
>
> in RAM to make it synthesizable ?


1st of all: Get knowledge about flipflops, combinational logic and
latches. Make yourself familiar with the concept of a state machine -
especially a synthesizable state machine in VHDL.

2nd: Think about a data path, on which such an algorithm may be
implemented. You need a state machine and inside some states you connect
some blocks (registers, arithmetic units...) together. Everything
step-by-step, controlled by a state machine.


VHDL may be used like a programming language, but only for simulation
purpose. If you want to model real hardware you have to think hardware.

Ralf


Ralf Hildebrandt
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
As growth slows, Hollywood faces a DVD standoff. Allan DVD Video 0 07-11-2005 02:10 PM
NEWS RELEASE: Leone's "Nobody" Films 1st time mastered in HD for DVD release with 240 Minutes Extras Torsten Kaiser \(TLEFilms\) DVD Video 1 06-06-2005 04:17 PM
Attn Joshua Zyber: Any comment on "Final Cut" running time? Film Buff DVD Video 8 03-26-2005 09:15 PM
"The Final Cut" running time????? Film Buff DVD Video 7 03-23-2005 03:38 PM
DVD Verdict reviews: THE LAND BEFORE TIME XI: INVASION OF THE TINYSAURUSES and more! DVD Verdict DVD Video 0 03-04-2005 09:11 AM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46