Showing results for

- Intel Community
- FPGAs and Programmable Solutions
- Nios® II Embedded Design Suite (EDS)
- Convert Dot Multiply from C2H to ???

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Highlighted
##

Altera_Forum

Valued Contributor III

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

09-06-2013
05:28 PM

686 Views

Convert Dot Multiply from C2H to ???

I have the following simple vector dot multiply as a C2H accelerator.

For some situations (but not all) regular NIOS running 50MHz on a 2C8 is fast enough running in code. I want to implement this as something supported by Qsys and newer Quartus. Options? Special instruction in NIOS? User component in Qsys? Something else? I have constructed signal processing accelerators outside of NIOS using read and write masters, but would like to avoid that effort here. Seems likely this function has been covered before.```
// Multiply data vector with polyphase filter
int DotMpy(int* __restrict__ r, int* __restrict__ p, alt_u16 PolySel)
{
# pragma altera_accelerate connect_variable DotMpy/r to sdram
# pragma altera_accelerate connect_variable DotMpy/r to onchip_SRAM
# pragma altera_accelerate connect_variable DotMpy/p to onchip_SRAM
long long SumVal = 0;
int k = 20;
do {
SumVal += (long long)*r++ * (long long)*p;
if (PolySel&0x100) (p--); else (p++);
} while (--k);
return (int)(SumVal >> 16);
}
```

0 Replies

For more complete information about compiler optimizations, see our Optimization Notice.