• 中国计算机学会会刊
  • 中国科技核心期刊
  • 中文核心期刊

Computer Engineering & Science

Previous Articles     Next Articles

Automatic generation of SystemC code from Mediator

ZHANG Qi1,2,LI Yi1,SUN Meng1   

  1. (1.School of Mathematical Sciences,Peking University,Beijing 100871;
    2.School of Computer Science and Technology,Xidian University,Xi’an 710126,China)
  • Received:2018-10-16 Revised:2018-12-04 Online:2019-05-25 Published:2019-05-25

Abstract:

Mediator is a hierarchical componentbased modeling language that provides proper description of models by using automata and systems. By transforming the models described in Mediator to executable code, we can avoid errors caused by human negligence in the encoding process and enhance encoding reliability, and shorten model development cycle. We present a new automatic code generation tool, which can convert Mediator model to SystemC code. The tool is designed to generate models on specific platforms (SystemC in this case) into directly executable code without any manual adaption.We first analyze the syntax and semantics of Mediator, and select a proper SystemC organization. Then, we design generation rules for each component of the Mediator model, in which we mainly focus on analysis of the generation of types, the generation of transition statement,and the generation of synchronize statement. Finally, we build a power failure detection model by Mediator and convert it to SystemC executable code through our code generator, and it has been executed successfully in C++ environment.
 

Key words: Mediator, SystemC, code automatic generation, component-based modeling