计算机应用 ›› 2016, Vol. 36 ›› Issue (9): 2503-2507.DOI: 10.11772/j.issn.1001-9081.2016.09.2503

• 计算机软件技术 • 上一篇    下一篇

基于Matlab的并行循环冗余校验Verilog代码自动生成方法

薛俊, 段发阶, 蒋佳佳, 李彦超, 袁建富, 王宪全   

  1. 精密测试技术及仪器国家重点实验室(天津大学), 天津 300072
  • 收稿日期:2016-02-24 修回日期:2016-03-24 出版日期:2016-09-10 发布日期:2016-09-08
  • 通讯作者: 蒋佳佳
  • 作者简介:薛俊(1992-),男,湖南长沙人,硕士研究生,主要研究方向:声呐阵列信号传输、水声信号检测;段发阶(1968-),男,湖南郴州人,教授,博士,主要研究方向:激光及光电测试、计算机视觉检测、海洋声学探测;蒋佳佳(1986-),男,湖北天门人,讲师,博士,主要研究方向:水声信号探测、声呐阵列信号处理;李彦超(1989-),男,内蒙古赤峰人,博士研究生,主要研究方向:水听器阵列信号处理;袁建富(1992-),男,吉林磐石人,硕士研究生,主要研究方向:声呐阵列信号传输;王宪全(1993-),男,山东德州人,硕士研究生,主要研究方向:水声信号检测。
  • 基金资助:
    国家自然科学基金资助项目(61501319);海洋经济创新发展区域示范项目(cxsf2014-2)。

Parallel cyclic redundancy check Verilog program generating method based on Matlab

XUE Jun, DUAN Fajie, JIANG Jiajia, LI Yanchao, YUAN Jianfu, WANG Xianquan   

  1. State Key Laboratory of Precision Measurement Technology and Instrument (Tianjin University), Tianjin 300072, China
  • Received:2016-02-24 Revised:2016-03-24 Online:2016-09-10 Published:2016-09-08
  • Supported by:
    This work is partially supported by the National Natural Science Foundation of China (61501319) and the Regional Demonstration Projects of National Marine Economic Innovation and Development Foundation of China (cxsf2014-2).

摘要: 在水声信号探测数据的传输过程中,现场可编程门阵列(FPGA)通过传统串行方法对长数据帧进行循环冗余校验(CRC)时无法达到速度要求,而更快速的并行校验方法存在因编程复杂带来的实际工程应用困难问题。为了满足传输对校验速度的需求,降低编程难度和缩短编程时间,设计了一种借助Matlab对任意长度数据帧自动编写并行CRC程序语句的方法。该计算方法基于矩阵法数学原理,借助Matlab完成所有数学推导计算过程,然后直接输出符合Verilog HDL语法规则的并行CRC校验程序语句。通过在Quartus Ⅱ 9.0中仿真,进一步在民用拖曳声呐阵列系统上进行数据传输实验,验证了Matlab自动编程方法的有效性:校验程序的自动编写输出能在几十秒内完成,同时生成的并行CRC校验程序能在满足数据传输速度要求的情况下正确地计算出系统中传输协议定义的长数据帧的校验码。

关键词: 循环冗余校验, 并行计算, Matlab, Verilog硬件描述语言, 现场可编程门阵列

Abstract: During underwater signal data transmission process, using Field Programmable Gate Array (FPGA) to calculate Cyclic Redundancy Check (CRC) code with traditional serial calculating method cannot meet the demand of fast computation; however, parallel checking method, which is much faster, has difficulty in practical engineering application because of programming complexity. In order to meet the demand of transmission speed, to eliminate programming difficulty and time waste, a method was proposed to automatically generate parallel CRC code for any length data frames by Matlab. It finished all the mathematical deductions based on matrix method and calculations with the help of Matlab and then generated parallel CRC calculating program which conforms to the Verilog HDL grammar rules. Finally, the CRC calculation program statements generated by Matlab were first simulated in Quartus II 9.0 and then demonstrated by data transmission experiments on a civil towed sonar system. The results prove the validity of the proposed method, its programming and generation can be finished in tens of seconds, and the CRC module can accurately figure out CRC code of every long data frame defined by transmission protocol within requested time.

Key words: Cyclic Redundancy Check (CRC), parallel computing, Matlab, Verilog Hardware Description Language (Verilog HDL), Field Programmable Gate Array (FPGA)

中图分类号: