计算机工程与应用 ›› 2010, Vol. 46 ›› Issue (30): 61-64.DOI: 10.3778/j.issn.1002-8331.2010.30.018

• 研发、设计、测试 • 上一篇    下一篇

非计数类循环的C2VHDL编译方法

杨 杰,吴艳霞,顾国昌,孙延腾   

  1. 哈尔滨工程大学 计算机科学与技术学院,哈尔滨 150001
  • 收稿日期:2010-02-04 修回日期:2010-03-19 出版日期:2010-10-21 发布日期:2010-10-21
  • 通讯作者: 杨 杰

C2VHDL compilation method of non-count loop

YANG Jie,WU Yan-xia,GU Guo-chang,SUN Yan-teng   

  1. College of Computer Science and Technology,Harbin Engineering University,Harbin 150001,China
  • Received:2010-02-04 Revised:2010-03-19 Online:2010-10-21 Published:2010-10-21
  • Contact: YANG Jie

摘要: 目前,大多数C2VHDL编译工具采用有穷状态机(FSM)的设计方法,该方法可以实现循环初值、终值以及步进值确定的计数类循环。由于非计数类循环每次执行循环时都要进行条件判断,程序执行前不能确定循环体执行次数,导致采用FSM方式对其进行C2VHDL编译很复杂,所以大多数C2VHDL编译工具不支持这类循环。以基于LLVM(Low Level Virtual Machine)的ASCRA(Application-Specific Compiler for Reconfigurable Architecture)编译架构为基础,采用一个周期高电平使能信号控制方式代替FSM,提出了一种支持嵌套格式的非计数类循环编译方法。实验结果证明该方法生成的控制结构简单,能够灵活地实现各种非计数类循环的C2VHDL转换,具有较强的可扩展性。

关键词: C2VHDL编译器, 低级虚拟系统中间表示(LLVM IR), 非计数类循环

Abstract: At present,most C2VHDL compilers use the design method of Finite State Mechine(FSM),it compiles count loop easily as the loop of initial value and final value and the step value are known in compile.Because non-count loop’s index can not be known before program execution,FSM is complex to achieve,most C2VHDL compiler tools do not support non-count loop.This paper,based on Low Level Virtual Machine(LLVM),presents a compilation method which adaptes one cycle of high signal instead of FSM to support multiple nested format non-count loops.Experiment proves that the generated control structure is simple and it is flexible and extendible and can achieve all kinds of non-count loops’ C2VHDL conversion.

Key words: C2VHDL compiler, Low Level Virtual Machine Intermediate Representation(LLVM IR), non-count loop

中图分类号: