仅对英特尔可见 — GUID: ewa1466524088069
Ixiasoft
1. Intel® HLS Compiler Pro版参考手册
2. 编译器
3. C语言和库支持
4. 组件接口
5. 组件存储器(存储器属性)
6. 组件中的循环
7. 组件并发
8. 任意精度数学支持
9. 组件目标频率(Target Frequency)
10. 任务系统
11. 库
12. 高级硬件综合控制
13. Intel® High Level Synthesis Compiler Pro版参考总结
A. 高级数学源代码库
B. 支持的数学函数
C. Cyclone® V限制
D. Intel® HLS Compiler Pro版参考手册存档
E. Intel® HLS Compiler Pro版参考手册修订历史
13.1. Intel® HLS Compiler Pro版i++命令行参数
13.2. Intel® HLS Compiler Pro版头文件
13.3. Intel® HLS Compiler Pro版编译器定义的预处理器宏
13.4. Intel® HLS Compiler Pro版关键字
13.5. Intel® HLS Compiler Pro版模拟API(仅测试台)
13.6. Intel® HLS Compiler Pro版组件存储器属性
13.7. Intel® HLS Compiler Pro版循环预处理指令
13.8. Intel® HLS Compiler Pro版范围预处理指令
13.9. Intel® HLS Compiler Pro版组件属性
13.10. Intel® HLS Compiler Pro版组件默认值接口
13.11. Intel® HLS Compiler Pro版组件调用接口控制属性
13.12. Intel® HLS Compiler Pro版组件宏
13.13. Intel® HLS Compiler Pro版技术性任务系统API
13.14. Intel® HLS Compiler Pro版管道API
13.15. Intel® HLS Compiler Pro版流输入接口
13.16. Intel® HLS Compiler Pro版流输出接口
13.17. Intel® HLS Compiler Pro版存储器映射接口
13.18. Intel® HLS Compiler Pro版加载-存储单元控制
13.19. Intel® HLS Compiler Pro版任意精度数据类型
仅对英特尔可见 — GUID: ewa1466524088069
Ixiasoft
4.5.1. 控制和状态寄存器(CSR)Agent
一个组件最多可以有一个CSR agent接口,但可以将多个参数映射到该接口。
任何标记为hls_avalon_agent_register_argument的参数都被放置于此存储器空间中。自动生成的头文件中将产生的存储器映射描述为 <results>.prj/components/<component_name>_csr.h。此文件还为host组件提供C宏功能以与agent组件进行交互。包含 Nios® II软处理器和 Intel® Acceleration Stack host应用程序的host组件的实例。
具有hls_avalon_agent_component属性的组件的控制和状态寄存器(即,函数调用和返回)都在CSR agent接口中实现。
您不需要使用hls_avalon_agent_component属性才来使用hls_avalon_agent_register_argument属性。
要了解更多信息,请查看教程: <quartus_installdir>/hls/examples/tutorials/interfaces/mm_agents
具有CSR agent的组件的实例代码:
#include "HLS/hls.h"
struct MyStruct {
int f;
double j;
short k;
};
hls_avalon_agent_component
component MyStruct mycomp_xyz (hls_avalon_agent_register_argument int y,
hls_avalon_agent_register_argument MyStruct struct_argument,
hls_avalon_agent_register_argument unsigned long long mylong,
hls_avalon_agent_register_argument char char_arg
) {
return struct_argument;
}
针对组件mycomp_xyz生成的C头文件:
/* This header file describes the CSR Agent for the mycomp_xyz component */ #ifndef __MYCOMP_XYZ_CSR_REGS_H__ #define __MYCOMP_XYZ_CSR_REGS_H__ /******************************************************************************/ /* Memory Map Summary */ /******************************************************************************/ /* Register | Access | Register Contents | Description Address | | (64-bits) | ------------|---------|--------------------------|----------------------------- 0x0 | R | {reserved[62:0], | Read the busy status of | | busy[0:0]} | the component | | | 0 - the component is ready | | | to accept a new start | | | 1 - the component cannot | | | accept a new start ------------|---------|--------------------------|----------------------------- 0x8 | W | {reserved[62:0], | Write 1 to signal start to | | start[0:0]} | the component ------------|---------|--------------------------|----------------------------- 0x10 | R/W | {reserved[62:0], | 0 - Disable interrupt, | | interrupt_enable[0:0]} | 1 - Enable interrupt ------------|---------|--------------------------|----------------------------- 0x18 | R/Wclr | {reserved[61:0], | Signals component completion | | done[0:0], | done is read-only and | | interrupt_status[0:0]} | interrupt_status is write 1 | | | to clear ------------|---------|--------------------------|----------------------------- 0x20 | R | {returndata[63:0]} | Return data (0 of 3) ------------|---------|--------------------------|----------------------------- 0x28 | R | {returndata[127:64]} | Return data (1 of 3) ------------|---------|--------------------------|----------------------------- 0x30 | R | {returndata[191:128]} | Return data (2 of 3) ------------|---------|--------------------------|----------------------------- 0x38 | R/W | {reserved[31:0], | Argument y | | y[31:0]} | ------------|---------|--------------------------|----------------------------- 0x40 | R/W | {struct_argument[63:0]} | Argument struct_argument (0 of 3) ------------|---------|--------------------------|----------------------------- 0x48 | R/W | {struct_argument[127:64]} | Argument struct_argument (1 of 3) ------------|---------|--------------------------|----------------------------- 0x50 | R/W | {struct_argument[191:128]} | Argument struct_argument (2 of 3) ------------|---------|--------------------------|----------------------------- 0x58 | R/W | {mylong[63:0]} | Argument mylong ------------|---------|--------------------------|----------------------------- 0x60 | R/W | {reserved[55:0], | Argument char_arg | | char_arg[7:0]} | NOTE: Writes to reserved bits will be ignored and reads from reserved bits will return undefined values. */ /******************************************************************************/ /* Register Address Macros */ /******************************************************************************/ /* Byte Addresses */ #define MYCOMP_XYZ_CSR_BUSY_REG (0x0) #define MYCOMP_XYZ_CSR_START_REG (0x8) #define MYCOMP_XYZ_CSR_INTERRUPT_ENABLE_REG (0x10) #define MYCOMP_XYZ_CSR_INTERRUPT_STATUS_REG (0x18) #define MYCOMP_XYZ_CSR_RETURNDATA_0_REG (0x20) #define MYCOMP_XYZ_CSR_RETURNDATA_1_REG (0x28) #define MYCOMP_XYZ_CSR_RETURNDATA_2_REG (0x30) #define MYCOMP_XYZ_CSR_ARG_Y_REG (0x38) #define MYCOMP_XYZ_CSR_ARG_STRUCT_ARGUMENT_0_REG (0x40) #define MYCOMP_XYZ_CSR_ARG_STRUCT_ARGUMENT_1_REG (0x48) #define MYCOMP_XYZ_CSR_ARG_STRUCT_ARGUMENT_2_REG (0x50) #define MYCOMP_XYZ_CSR_ARG_MYLONG_REG (0x58) #define MYCOMP_XYZ_CSR_ARG_CHAR_ARG_REG (0x60) /* Argument Sizes (bytes) */ #define MYCOMP_XYZ_CSR_RETURNDATA_0_SIZE (8) #define MYCOMP_XYZ_CSR_RETURNDATA_1_SIZE (8) #define MYCOMP_XYZ_CSR_RETURNDATA_2_SIZE (8) #define MYCOMP_XYZ_CSR_ARG_Y_SIZE (4) #define MYCOMP_XYZ_CSR_ARG_STRUCT_ARGUMENT_0_SIZE (8) #define MYCOMP_XYZ_CSR_ARG_STRUCT_ARGUMENT_1_SIZE (8) #define MYCOMP_XYZ_CSR_ARG_STRUCT_ARGUMENT_2_SIZE (8) #define MYCOMP_XYZ_CSR_ARG_MYLONG_SIZE (8) #define MYCOMP_XYZ_CSR_ARG_CHAR_ARG_SIZE (1) /* Argument Masks */ #define MYCOMP_XYZ_CSR_RETURNDATA_0_MASK (0xffffffffffffffffULL) #define MYCOMP_XYZ_CSR_RETURNDATA_1_MASK (0xffffffffffffffffULL) #define MYCOMP_XYZ_CSR_RETURNDATA_2_MASK (0xffffffffffffffffULL) #define MYCOMP_XYZ_CSR_ARG_Y_MASK (0xffffffff) #define MYCOMP_XYZ_CSR_ARG_STRUCT_ARGUMENT_0_MASK (0xffffffffffffffffULL) #define MYCOMP_XYZ_CSR_ARG_STRUCT_ARGUMENT_1_MASK (0xffffffffffffffffULL) #define MYCOMP_XYZ_CSR_ARG_STRUCT_ARGUMENT_2_MASK (0xffffffffffffffffULL) #define MYCOMP_XYZ_CSR_ARG_MYLONG_MASK (0xffffffffffffffffULL) #define MYCOMP_XYZ_CSR_ARG_CHAR_ARG_MASK (0xff) /* Status/Control Masks */ #define MYCOMP_XYZ_CSR_BUSY_MASK (1<<0) #define MYCOMP_XYZ_CSR_BUSY_OFFSET (0) #define MYCOMP_XYZ_CSR_START_MASK (1<<0) #define MYCOMP_XYZ_CSR_START_OFFSET (0) #define MYCOMP_XYZ_CSR_INTERRUPT_ENABLE_MASK (1<<0) #define MYCOMP_XYZ_CSR_INTERRUPT_ENABLE_OFFSET (0) #define MYCOMP_XYZ_CSR_INTERRUPT_STATUS_MASK (1<<0) #define MYCOMP_XYZ_CSR_INTERRUPT_STATUS_OFFSET (0) #define MYCOMP_XYZ_CSR_DONE_MASK (1<<1) #define MYCOMP_XYZ_CSR_DONE_OFFSET (1) #endif /* __MYCOMP_XYZ_CSR_REGS_H__ */