Hi,
I have one HW function (use #pragma CO PRIMITIVE), which will be called several times in my main HW process. I think the HW function can be reused or shared. But, from the generated HDLs, they instantiate one HW primitive each time when it is called. So, the final design has several HW primitives and is too large.
Is there a way that I can reuse the primitives and reduce the size of the design?
Thanks,
Eric
How to reuse primitives?
Started by Eric Guo, Sep 03 2009 11:06 PM
2 replies to this topic
#1
Posted 03 September 2009 - 11:06 PM
#2
Posted 04 September 2009 - 07:32 AM
Just get some ideas from one of the previous posts about 'resources share':
============================
You could share the multiplier in your code example by doing a single multiply in a small loop over an array of operands. Or you could write an HDL function that feeds both pairs of operands through the same multiplier, then call that HDL function from C using the CO IMPLEMENTATION pragma.
============================
So, is use of CO IMPLEMENTATION the only way to reuse one HW primitive multiple times in a hardware process? Has anyone tried this?
Thanks,
Eric
============================
You could share the multiplier in your code example by doing a single multiply in a small loop over an array of operands. Or you could write an HDL function that feeds both pairs of operands through the same multiplier, then call that HDL function from C using the CO IMPLEMENTATION pragma.
============================
So, is use of CO IMPLEMENTATION the only way to reuse one HW primitive multiple times in a hardware process? Has anyone tried this?
Thanks,
Eric
#3
Posted 21 September 2009 - 06:54 AM
Hello Eric,
This feature (creating a shareable primitive) has been the subject of much discussion and some experimentation. One method that has been used successfully is to create a "wormhole". This means creating an Impulse C process that connects into your calling process via co_stream, co_signal or co_register. The process can be pipelined with an inner code loop, reading and writing values simultaneously. Of course the calling process must handle the pipelined behavior of the lower-level process. There will also be a certain amount of hardware overhead associated with the process-to-process I/O. But this method can be used to create processes that are "shared" even when invoked at different times.
This feature (creating a shareable primitive) has been the subject of much discussion and some experimentation. One method that has been used successfully is to create a "wormhole". This means creating an Impulse C process that connects into your calling process via co_stream, co_signal or co_register. The process can be pipelined with an inner code loop, reading and writing values simultaneously. Of course the calling process must handle the pipelined behavior of the lower-level process. There will also be a certain amount of hardware overhead associated with the process-to-process I/O. But this method can be used to create processes that are "shared" even when invoked at different times.
--
-- Impulse Support (support@ImpulseC.com)
--
-- Impulse Support (support@ImpulseC.com)
--
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users












