C-to-Hardware Mapping Reference
If multiple loops have no interdependencies, the C2H Compiler
schedules the loops on the same state, allowing the loops to execute in
parallel. The code in Example 3–34 has two while loops with no
dependencies on each other. The C2H Compiler schedules these loops on
the same state.
Example 3–34. Loops Without Interdependencies Scheduled in Parallel
void double_mac (int* _ _ restrict_ _ a, int* __restrict__ b,
int* _ _ restrict_ _ c, int* __restrict__ d,
long long* _ _ restrict__ res_ab,
long long* _ _ restrict__ res_cd,
int len)
{
int len_cd = len; // duplicate the length index
// Compute the MAC for a & b
long long mac_ab = 0;
while (len_ab > 0)
{
mac_ab += *a++ * *b++;
len_ab--;
}
// Compute the MAC for c & d
long long mac_cd = 0;
while (len_cd > 0)
{
mac_cd += *c++ * *d++;
len_cd--;
}
*res_ab = mac_ab;
*res_cd = mac_cd;
return;
}
Subfunction Calls
A subfunction call can stall the state machine in the same way that an
inner loop does. When a subfunction contains a looping structure or
shares a data dependency with its caller, the subfunction is not pipelined.
If this is the case, when the outer state machine reaches its state for the
subfunction, the outer state machine stalls until the subfunction has
completed.
If the subfunction does not contain loops or shared data dependencies the
C2H Compiler can pipeline the subfunction. For details about pipelined
subfunctions, see “Subfunction Pipelining” on page 3–49 .
Altera Corporation
November 2009
9.1
3–41
Nios II C2H Compiler User Guide
相关PDF资料
IPTR-DSPBUILDER DSP BUILDER SOFTWARE
IR11662SPBF IC CNTROL SMART RECTIFIER 8-SOIC
IR1166STRPBF IC MOSFET DRIVER N-CH 200V 8SOIC
IR11672ASPBF IC MOSFET DRIVER 200V 8-SOIC
IR1167ASTRPBF IC SMART SECONDARY DRIVER 8-SOIC
IR11682STRPBF IC MOSFET DRIVER DUAL 200V 8SOIC
IR1168SPBF IC MOSFET DRIVER DUAL 200V 8SOIC
IR1176STR IC DRIVER RECT SYNC 5V 4A 20SSOP
相关代理商/技术参数
IPT-DSPBUILDER 功能描述:开发软件 DSP Builder MATLAB SIMULINK RoHS:否 制造商:Atollic Inc. 产品:Compilers/Debuggers 用于:ARM7, ARM9, Cortex-A, Cortex-M, Cortex-R Processors
IPTE-75GF-1000-70D 制造商: 功能描述: 制造商:undefined 功能描述:
IPTG06A18-11SZC 制造商:GLENAIR 制造商全称:Glenair, Inc. 功能描述:Straight Plug Connector with Backshell to Accommodate
IPTG06A18-11SZCPH16 制造商:GLENAIR 制造商全称:Glenair, Inc. 功能描述:Straight Plug Connector
IPTG06A18-11SZCPHM18 制造商:GLENAIR 制造商全称:Glenair, Inc. 功能描述:Straight Plug Connector
IPTG06A18-11SZCSR 制造商:GLENAIR 制造商全称:Glenair, Inc. 功能描述:Straight Plug Connector
IPTG06ASE18-11SZ 制造商:GLENAIR 制造商全称:Glenair, Inc. 功能描述:Straight Plug Connector
IPTG06E18-11SZC 制造商:GLENAIR 制造商全称:Glenair, Inc. 功能描述:Straight Plug Connector