为提高建模网络处理器的效率,利用C++模板机制和依据依赖倒置原则采用的接口方法调用机制封装SystemC构建建模框架。针对处理器内部结构和功能,框架使通信和连接、功能和时间解耦,这样不仅提高建模效率而且减少逻辑进程^[1]和事件的数量从而加快仿真速度。为提高仿真系统稳定性,提出单元和系统测试方案,其中系统测试平台通过静态建模实现自动化测试,通过网络和文件两种方式与仿真系统通信实现功能和性能测试。该框架和测试方案适合各种网络处理器的建模和测试,在工程中已成功应用。
To improve the efficiency of modeling network processor, a modeling framewrok is built by using C+ + template mechanism and interface-method call (IMC) mechanism based on the dependence inversion principle to encapsulate SystemC. To the structure and function inside processor, the framework seperately deeouples communication and connection, function and time, which not only improves modeling efficiency but also enhances simulating speed by decreacing the number of logic process and event. To improve the stability of simulating system, unit and system testing scheme is proposed, and the system testing platform completes being automated by static modeling and achieves to function and performance testing by network and file communicating mode with simulating system. The framework and testing scheme can be reused for modeling and testing of various network processors and are successfully applied to engineering.