第一部分
Designing with Catapult C
Catapult C推荐设计块的大小在100-200K gates(20-40K LUTs)
Catapult C 基本设计流如下∶
Step 1: Writing and Testing the C Code
Step 2: Analyzing the Algorithm
Step 3: Creating the Hardware Design
Step 4: Performing Timed Simulations .
Step 5: Synthesizing the RTL Design
Step 1: Writing and Testing the C Code
Catapult C 是C的一个子集.Catapult C Synthesis不支持动态内存分配、因此malloc、free和function recursion不能使用.还有有些次要的限制、是关于指针使用等.
对于C synthesis、需要注记(pragma)定义顶层函数、在综合过程中.所有被这个顶层函数调用的都被硬件化、而以外的被做为软件或则test bench而被忽视.Catapult C Synthesis提供了一个整合的文本编辑器、包括比标准C++编译更为彻底C++ checking.
Step 2: Analyzing the Algorithm
Catapult C Synthesis提供了一套件算法和设计分析工具.
在算法分析中、Catapult C Synthesis执行设计的有限各符号(抽象)分析去决定循环的秩代次数.这个次数大于或小于你的期望值、是指出了你算法中的错误或无效.你可以修改算法或者是增加秩代约束.
还有一个地方可以查看你的算法、就是Gantt chart.Gantt chart是设计算法的示意图观察器.它可以知道how long your design will take to process information and a quick pointer to
where you might want to work on your algorithm
.
Gantt Chart A scheduling tool used to display the status of a project’s tasks. A Gantt chart shows each task’s duration as a horizontal line. The ends of the lines correspond to the task’s start and end dates.
最后就是查 看报 告了
Step 3: Creating the Hardware Design
.
结束完算法分析、得到满意的结果后、就可以进行硬件约束设置.首先是包括时钟、reset和enable、还有process level handshake的全局约束.而后是、I/O、loop和memory约束.你还可以定义unroll或pipeline属性.最后一步就是验证或设定资源约束、这给你一个直接控制硬件资源数的方法.在这里你还能设置延迟约束.
Step 4: Performing Timed Simulations
有行为级和RTL级两中输出用于仿真.
Step 5: Synthesizing the RTL Design
第二部分
Writing
C
Code for Hardware
在Catapult中使用的C可以说是标准C的一个子集.有几个基本注意点如下:
l
工具需要一个pragma在顶层函数
l
不支持动态内存分配
l
设计必须是静态的、指针本质上是一个数组的地址索引
l
硬件约束可以在catapult.ini中定义、也可以做为编译指示(pragmas)出现在设计中(或以互交方式)
l
Catapult.ini(后叙)
l
Pragmas can be used for design specific things that don’t change much, such as loop
pipelining and unrolling.
l
Directives are used for constraints that change from solution to solution.
第三部分
Algorithmic Synthesis
这里主要是接口综合和时序描述.Catapult C能自动综合、综合时关注于
l
优化最小数据带宽和最少硬件算子.
l
优化最小RAM和I/O accesses
l
根据约束添加时序
C++是不包括任何时间信息的、所以在综合的时候必须把这些加进去.一些必须加载的时间信息、默认如下:
1.
一个virtual wait 加在顶层文件.因为所有的输出被默认为寄存器(可改)、所有存储部件至少需要一个时钟的读写
2.
默认状况下、所有输出被认为是寄存输出(可变、载Interface synthesis中修改)
3.
无索存器
l
自动生成RTL(bottom-up RTL flow)
第四部分
设计步骤
l
C 原码输入
l
调用图形界面(或命令行界面)
l
设置Catapult C
1.
General Options
2.
Message Options
3.
Project Initialization
²
Version Control
²
Component Libraries
²
Interface
²
Architectural
²
Hardware
4.
Input
5.
Output
6.
Simulation
7.
Synthesis Precision RTL
8.
Synthesis Design Compiler
9.
Text Editor
10.
Schedule Viewer
11.
Schematic Viewer