One-to-One C-to-Hardware Mapping
The fundamental iteration statement for the C2H Compiler is the do loop,
which evaluates its condition at the end of each iteration. See section
“Loop Pipelining” on page 3–42 for information about loop state
machines and scheduling.
Selection Statements
A selection statement ( if-else , case , switch , and ?: ) translates to a
multiplexer in hardware. The structure of the hardware depends on the
type of statement, as described in the following sections.
if Statement
An if-else statement translates to three elements in hardware:
Logic to perform all operations in the then block
Logic to perform all operations in the else block
Selection logic that determines which result to use
The results of each element are registered, and the registered signals feed
a multiplexer.
If the if statement has both a then and an else block, the operations for
both blocks execute in parallel. When all operations have completed, the
multiplexer selects which value propagates to subsequent statements,
based on the value of the control expression.
Figure 3–4 shows the circuit that results from the code in Example 3–2 .
Example 3–2. If-else Logic
if (foo > bar)
foo += bar;
else
foo *= bar;
3–6
Nios II C2H Compiler User Guide
9.1
Altera Corporation
November 2009
相关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