16位/32位MCU软件仿真器的设计与实现
详细信息    本馆镜像全文|  推荐本文 |  |   获取CNKI官网全文
摘要
在PC机和普适计算盛行的今天,嵌入式系统的应用已经成为计算机工业最热门的领域之一,16位/32位高端MCU由于具有功能强大、处理速度快、能耗低等优点,逐渐成为研究与开发的热点。在嵌入式应用的软件开发中,传统交叉开发方式制约了系统开发的效率,硬件对软件的牵制严重影响软件的调试和测试,延误开发进度,致使软件质量难以保整。软件仿真是摆脱困境的一种有效途径,利用仿真技术模拟硬件系统的运行,使软件开发和系统测试在虚拟平台上进行,避免软硬件开发的相互等待,提高开发效率,降低风险成本。
     本文通过研究16位/32位MCU软件仿真的相关技术,设计并实现了一种具有良好扩展性和通用性的MCU软件仿真器。本文实现的仿真器采用面向对象的设计思想,参照MVC模式,把仿真器的结构分为两层:用户接口层和指令仿真层。接口部分采用构件技术实现,使得仿真器具有良好的扩展性,指令仿真层采用虚指令技术,使得仿真器具有良好的通用性。
     首先,本文通过对MCU硬件体系结构的分析,提出了在构造MCU软件仿真器时引入构件技术,设计了基于构件的MCU软件仿真器模型,并实现各个子构件的设计,通过动态集成方式将分离的构件组合起来,构成一个完整的MCU软件仿真器,实现动态配置仿真器的功能,使其具有良好的扩展性。其次,为实现对不同体系MCU指令集的仿真,本文提出采用虚指令技术来设计指令的仿真,研究了虚指令的设计与翻译,设计了虚指令函数并对翻译的虚指令进行优化,实现了体系无关的通用型指令仿真的设计。再次,为便于用户进行软件开发,本文设计实现了基于构件的仿真调试平台,提供多种调试方式和部分时序分析的功能。最后,本文对MCU软件仿真器进行测试,结果表明仿真器模型和虚指令的设计都能较好的满足仿真器的要求。
With the prevalence of PC and ubiquitous computing,embedded system application becomes one of the hottest areas of computer industry.Species of 16/32-bit MCU is becoming the key and hot spot,for the advantage of powerful,fast and low energy consumption.In the software development of embedded application,the traditional development mode reduces the efficiency of development.Hamper from hardware to software has serious impact on software debugging and testing,delays the development progress,and makes the quality of software hard to guarantee.Simulation development is an effective way to break the mass.With simulation technology simulating the running of hardware system,software development and system testing can be implemented on a virtual platform,which avoids mutual wait between hardware development and software development,improves the development efficiency and lowers the costs and risk.
     Through the analysis of 16/32-bit MCU simulation technology,a general MCU simulator with good expansibility is designed and implemented.Using the idea of object-oriented and referring to the MVC patten,the MCU simulator is divided into two tiers:user interface and instruction simulation.The interface is implemented by component technology,which makes the simulator eazily expanded.The instruction simulation utilizes virtual instruction technology,which makes the simulator a general one.
     Firstly,through the analysis of MCU,component technology is utilized to build MCU simulator.The MCU software simulator model based on component is designed and MCU's sub-components are implemented.Dynamic integration is utilized to form a complete MCU simulator with isolated components,which makes MCU software simulator can be dynamic configured and eazily expanded.Secondly,to simulate different instructions,virtual instruction technology is utilized to design of instruction simulation, and the construction,translation and optimization is studied.The instruction function is designed and the translated virtual instruction is opotimized.At last,a generic and hierarchy-independent instruction simulator is implemented.Thirdly,to facilitate the software development,simulation debugging is implemented and several debug modes are provided and the timing analyse.Finally the test of MCU software simulator is done,the result shows that the MCU software simulator model and the design of virtual instruction both can satisfy the requirement of MCU software simulator.
引文
[1]王宜怀,刘晓升.嵌入式应用技术基础教程[M].北京:清华大学出版社.2005.
    [2]Keet E.A personal recollection of software's early days(1960-1979):part1[J].IEEE Annals of the History of Computing.Vol 17,Issue 4,1995:24-45.
    [3]Voith R.The PowerPC 603 C++Verilog Interface Model.Digest of papers-Spring ComPCon 94[J].IEEE Computer Society Press.1994.3:337-340.
    [4]G.Maturana J L,Bal J,Gee et al.Incas:A Cycle Accurate Model of UltraSPARC [J].IEEE VLSI in computers&Processor(ICCD'95).1995:130-135.
    [5]Austin T,Larson E,Emst D.SimpleScalar:an infrastructure for computer system modeling[J].Computer.Vol 35,Issue 2,2002:59-67.
    [6]ARM.ARM7TDMI DesignStart Kit User Guide[EB/OL].http://www.arm.com,
    [7]Rosenblum M,herrod S,Witchel E.Complete Computer System Simulation:The SimOS Approach[J].Stanford University IEEE Parallel&Distributed Technology.1995:34-43.
    [8]Moudgill M.Techniques for implementing fast processor simulators[J].IEEE Simulation Symposium,1998.Proceedings.31st Annual.5-9 April 1998:83-90.
    [9]Quicksall E,Gibson K.Simulation and Device-Driver Development[D].Dr Dobb's Journal,1997(1).
    [10]萧鹏,季红彬.M~*CORE和SoC设计平台及其应用[C].2002年集成电路行业协会年会.中国.成都.2002.10.
    [11]李霞,亓雪冬.Linux平台RTOS通用仿真环境的设计与实现[J].微计算机信息,2006.5:75-77.
    [12]金方其.可重配置的时钟精确嵌入式处理器仿真平台的研究[D].浙江大学.2006.
    [13]廖桂华.FreescaleS08系列MCU软件仿真器的设计开发.[D].苏州大学.2007.
    [14]江乐斌.嵌入式MCU仿真的研究与实现[D].电子科技大学.2007.
    [15]吴旭光,杨惠珍,王新民.计算机仿真技术[M].北京:化学工业出版社,2005.
    [16]肖田元,张燕云,陈加栋.系统仿真导论[M].北京:清华大学出版社,2000.
    [17]刘瑞叶,任洪林,李志民等.计算机仿真技术基础[M].北京:电子工业出版社.2004.
    [18]康凤举,杨惠珍,高立娥等.现代仿真技术与应用[M].北京:国防工业出版社2006.
    [19]何江华.计算机仿真导论[M].北京:科学出版社.2001.
    [20]邢文峰.RISC_DSP系统仿真器的研究[D].浙江大学.2004.
    [21]贺红卫.Intel8086软件仿真器的设计与实现[J].系统仿真学报,1996.9:50-55.
    [22]Wilsey P A.Dynamic Component Substitution in Web-based Simulation [J].Simulation Conference Proceedings,2000.Winter,IEEE CNF:1840-1848.
    [23]时应.实用化的软件重用方法及其环境[J].计算机科学,1995,22(5):58-60.
    [24]李涛.一种嵌入式软件构件模型和构件库[J].计算机科学,2006,33(11):259-262.
    [25]Burle K,Ehsani M,Kamath P.A Matlab-Based Modeling and Simulation Package for Electric and Hybrid Electric Vehicle Design[J].IEEE transactions on vehicular technology Vol.48,no 6,NOV 1999:1771-1778.
    [26]薛定宇.基于MATLAB/Simulink的系统仿真技术与应用[M].清华大学出版社,2002.
    [27]金凤莲.VHDL语言在EDA仿真中的应用[J].现在电子技术,2005,6:11-13.
    [28]古幼鹏.基于构件的嵌入式软件仿真开发环境模型研究[J].系统工程与电子技术,2004,26(10):1495-1498.
    [29]邢文峰.一种高速灵活的指令仿真器[J].计算机工程,2004,30(22):74-75.
    [30]Zhu Jianwen,Gajski D D.An ultra-fast instruction set simulator[J].IEEE Translation on Very Large Scale Integration Systems,2002,10(3):363-373.
    [31]rising2005.什么是设计模式[EB/OL].http://www.shineblog.com/userl-/1212/archives/2005/29967.shtml.2005.4.
    [32]k_eckel.设计模式精解-GoF23种设计模式解析附C++实现源码[EB/OL].http://www.mscenter.edu.cn/blog/k_eckel.2005.5.
    [33]余先庆.构件 构件库 构件化的开发方法[J].中国科学院研究生院学报,1998,15(1):87-90.
    [34]李强.微处理器仿真器sim-alpha浅析[J].高性能计算技术,2003,(160):61-64.
    [35]王爱英.计算机组成与结构(第3版)[M].北京:清华大学出版社,2001.
    [36]ARM.Architecture Reference Manual[M].ARM DDI0100E,ARM,1996.
    [37]ARM926EJ-S technical reference Manual[M].V1.0,ARM,2001.
    [38]ARM(?) Developer Suite CodeWarrior(?) IDE Guide[M].V 1.2,ARM,2001.
    [39]石教英.计算机体系结构[M].浙江:浙江大学出版社,2002.
    [40]钱斌,付宇卓.一种基于虚指令集技术构建快速的可重用的指令集仿真器的方法[J].计算机工程与应用,2005,41(12):95-97.
    [41]林巧民.虚拟机相关技术研究及实践[D].河海大学,2004.
    [42]乔亚男,王换招,方舟.指令分层过滤体系在通用CPU模拟器设计中的应用[J].计算机工程与应用,2005,41(3):119-121.
    [43]姜旭锋.SmartSimular_基于虚指令集的嵌入式系统模拟器[D].浙江大学.2006.
    [44]马湘宁.二进制翻译关键技术研究[D].中科院计算技术研究所,2004.
    [45]陈火旺,刘春林.程序设计语言编译原理(第3版)[M].北京:国防工业出版社,2000.

© 2004-2018 中国地质图书馆版权所有 京ICP备05064691号 京公网安备11010802017129号

地址:北京市海淀区学院路29号 邮编:100083

电话:办公室:(+86 10)66554848;文献借阅、咨询服务、科技查新:66554700