Moving Functions into Programmable Logic
When you have created a new project, you can open up theSDSoC Project Overviewby double-clicking on theproject.sdsocfile in theProject Explorer.
Click on thesymbol in theHardware Functionspanel to display the list of candidate functions within your program. The list of Hardware Functions consists of functions in the call graph rooted at the
Root Function
as defined in theGeneralpanel as shown above, and is set tomain
by default. TheRoot Function
can be changed by clicking on the...button and selecting an alternative function root.
From within the popup window, you can select one or more functions for hardware acceleration and clickOK. The selected functions appear in the list box. Note that the Eclipse CDT indexing mechanism is not foolproof, and you might need to close and reopen the selection popup to view available functions. If a function does not appear in the list, you can navigate to its containing file in theProject Explorer, expand the contents, right-click on the function prototype, and selectToggle HW/SW.
foo
in the file
foo_src.cfor hardware with the following
sdscc
command line option.
-sds-hw foo foo_src.c -sds-end
foo
invokes sub-functions contained in files
foo_sub0.cand
foo_sub1.c, use the
-files
option.
-sds-hw foo foo_src.c -files foo_sub0.c,foo_sub1.c -sds-end
Although the data motion network runs off of a single clock, it is possible to run hardware functions at different clock rates to achieve higher performance. In theHardware Functionspanel, select functions from the list and use theClock Frequencypull-down menu to choose their clocks. Be aware that it might not be possible to implement the hardware system with some clock selections.
sdscc -sds-pf-info
and use the
-clkid
option.
-sds-hw foo foo_src.c -clkid 1 -sds-end
When moving a function optimized for CPU execution into programmable logic, you usually need to revise the code to achieve best performance. SeeImproving Hardware Function ParallelismandCoding Guidelinesfor programming guidelines.