Use FeatureC++ to develop SystemC modules —— a case study
来源:互联网 发布:单片机开发工程师 编辑:程序博客网 时间:2024/05/09 02:29
This case is based on the implementation of a Fast Fourier Transform (FFT). It’s an example shipped with SystemC release. The system is consisted of a Source module (generate the data to be transformed), a FFT module (transform the data), and a Sink module (receive the transformed data). Its communication protocol is described as follow.
FFT block initiates the reading of a sample by sending a "data_req" signal to the source. It waits for "data_valid" signal from the source to become high; then it lowers the "data_req" signal and reads in data samples from its input ports. Once the FFT calculation is performed, the block writes the transformed values to a sink. It puts the transformed value on its output ports and sends a "data_ready" signal to the sink. It waits for "data_ack" signal from the sink to go high and then writes out the next value.
For architecture exploration, two models of the FFT system are developed. They share the communication protocol but differentiate at the data type to be transformed. The data type of the first model is float and second is sc_int<16>. Since the communication protocol is same, there is plenty of duplicate code within these two models. The duplication makes the development of other models harder, and easier to be inconsistent with existing ones, which hampers the architectural exploration of the FFT system. To eliminate the duplication, we FOR this system, separate its communication protocol and computation into different layers and thus make the communication protocol reusable.
The project can be download at http://www.kaixin001.com/file/file.php?verify=6304157_1008_6304157_1223043483_ab5417317ab33eebf59253b4c22128bb&fileid=831633&uid=6304157
We encapsulate the communication protocol into the base layer. The base FFT module can be seen in the project, read_in, compute, write_out are all hook functions related with computation and will be refined in the computation layer. Base source and sink module can be seen in the project, as well as base top module. Comparing the codes with the communication protocol, we see that the base layer is a straightforward and cohesive implementation of the protocol. We encapsulate the float point related FFT computation into the flpt layer. We encapsulate the fix point related FFT computation into the fxpt layer. Now, to obtain our float point model, all we need to do is write a simple configuration file to configure the composition of base layer and flpt layer; and the fix point model can be obtained by modifying the configuration file to compose fxpt layer with base layer.
As we can see from the case, the featurezation of communication protocol and computation model makes the architectural exploration of the FFT system much easier.
A. Performance analysis
To analyze the performance of our models, we develop a performance analysis layer. And for the purpose of compare, we analyze the performance of the two original models by injecting a fragment of same code into them. The result of the performance analysis is shown in Table 1. From the result we can see that the performance overhead of integrating FeatureC++ is ignorable.
Model | before FOR | after FOR | FOR overhead |
Float point | 330.2ms | 345.3ms | 4.57% |
Fix point | 423.35ms | 435.97ms | 2.98% |
Table 1: average perform time of the FFT system before/after FOR. Every performance transforms 400 groups of sample data and the average time is obtained by 60 times performance.
- Use FeatureC++ to develop SystemC modules —— a case study
- Day5、How to develop a test case with RIDE
- SystemC Modules
- Inline assembly : a case study
- Use P/Invoke to Develop a .NET Base Class Library for Serial Device Communications
- Use P/Invoke to Develop a .NET Base Class Library for Serial Device Communications
- Use P/Invoke to Develop a .NET Base Class Library for Serial Device Communications
- Use P/Invoke to Develop a .NET Base Class Library for Serial Device Communications
- Use P/Invoke to Develop a .NET Base Class Library for Serial Device Communications
- UML—Use Case Diagram
- 《iOS Human Interface Guidelines》——Case Study:From Desktop to iOS
- Use Eric IDE to develop python
- iBOMA’s Case Study—Health Care
- How to Develop a Bootloader
- How to develop a person
- How to use modules in Drupal
- QML官方系列教程——Use Case - Responding To User Input in QML
- RS232 Serial Comm (Use P/Invoke to Develop a .NET Base Class Library for Serial Device Communications)
- Operation System
- 读《徐家骏:我在华为工作十年的感悟》有感
- Win32平台安装Openssl手记
- 改eclipse的设置
- 记下有感触的东西,与大家一起分享
- Use FeatureC++ to develop SystemC modules —— a case study
- 应付考试
- 三层结构引入工厂模式后的模型
- 正则表达式的基本写法
- 感受微软外包项目(二)
- 用Windbg调试一个Windows自带扫雷程序的逻辑bug
- 大家都来看骗子啊!
- Oracle Grid Control架构图
- 个人看好的最具投资价值的几家高潜力B2C