Visible to Intel only — GUID: bgt1573327555464
Ixiasoft
Visible to Intel only — GUID: bgt1573327555464
Ixiasoft
3.1.5. Pass-by-Value Interface
For software developers accustomed to writing code that targets a CPU, passing each element in an array by value might be unintuitive because it typically results in many function calls or large parameters. However, for code targeting an FPGA, passing array elements by value can result in smaller and simpler hardware on the FPGA.
struct int_v8 {
int data[8];
};
component int_v8 vector_add(
int_v8 a,
int_v8 b) {
int_v8 c;
#pragma unroll 8
for (int i = 0; i < 8; ++i) {
c.data[i] = a.data[i]
+ b.data[i];
}
return c;
}
This component takes and processes only eight elements of vector a and vector b, and returns eight elements of vector c. To compute 1024 elements for the example, the component needs to be called 128 times (1024/8). While in previous examples the component contained loops that were pipelined, here the component is invoked many times, and each of the invocations are pipelined.
QoR Metric | Pointer | Avalon® MM Master | Avalon® MM Slave | Avalon® ST | Pass-by-Value |
---|---|---|---|---|---|
ALMs | 15593.5 | 643 | 490.5 | 314.5 | 130 |
DSPs | 0 | 0 | 0 | 0 | 0 |
RAMs | 30 | 0 | 48 | 0 | 0 |
fMAX (MHz)2 | 298.6 | 472.37 | 498.26 | 389.71 | 581.06 |
Latency (cycles) | 24071 | 142 | 139 | 134 | 128 |
Initiation Interval (II) (cycles) | ~508 | 1 | 1 | 1 | 1 |
1The compilation flow used to calculate the QoR metrics used Intel® Quartus® Prime Pro Edition Version 17.1. |
2The fMAX measurement was calculated from a single seed. |