Forum Discussion
Altera_Forum
Honored Contributor
11 years agoThanks for the reply. I was able to decrease the time taken considerably by altering the algorithm to use integer arithmetic instead of FP operations where possible. I've given a performance counter result for the whole algorithm before and after the change. By 'too slow' I meant that I'm trying to reduce the img_detection time as much as possible. I have already met my requirements so to speak but I would like reduce the time taken by the algorithm as much as possible so I can try to use it for a real time application.
I'm learning how NIOS works by using the online training that Altera offers but my main confusion is on how to use user logic to speed up an application. The bottleneck is the tree_detection function because of the number of times it's called but I can't decide whether I should learn how to implement a custom instruction or a custom component. How does one decide which to employ and is it more beneficial to convert the whole function to a custom component or to convert parts of that function into custom instructions? I apologize if these are stupid questions and thank you for your suggestions. Just for reference, the img_detection calls window_detection multiple times, which in turn calls tree_detection. | Section | Time (sec)| Time (clocks)|Occurrences| +---------------+-----+-----------+---------------+-----------+ |tree_detection| 5.53454| 276727241| 363046| +---------------+-----+-----------+---------------+-----------+ |img_detection | 6.84809| 342404652| 1| +---------------+-----+-----------+---------------+-----------+ before: |img_detection | 17.43497| 871748352| 1|