systemc教程pptlecture2systemcverybasics资料资料

上传人:w****i 文档编号:98178510 上传时间:2019-09-09 格式:PPT 页数:149 大小:775.50KB
返回 下载 相关 举报
systemc教程pptlecture2systemcverybasics资料资料_第1页
第1页 / 共149页
systemc教程pptlecture2systemcverybasics资料资料_第2页
第2页 / 共149页
systemc教程pptlecture2systemcverybasics资料资料_第3页
第3页 / 共149页
systemc教程pptlecture2systemcverybasics资料资料_第4页
第4页 / 共149页
systemc教程pptlecture2systemcverybasics资料资料_第5页
第5页 / 共149页
点击查看更多>>
资源描述

《systemc教程pptlecture2systemcverybasics资料资料》由会员分享,可在线阅读,更多相关《systemc教程pptlecture2systemcverybasics资料资料(149页珍藏版)》请在金锄头文库上搜索。

1、1,系统级设计描述语言SystemC,徐宁仪 Xuny smth 东主楼9区324房间 62781914,版权所有 2004,第二部分 SystemC的基本语法,教材:陈曦 徐宁仪SystemC片上系统设计,科学出版社,2003 本课件大部分内容参考此书,仅作为大学教学之用, 请勿用于商业,2,课程主要内容,共讲4次,争取讲清楚Why,What &How。,内容包括: 为什么用SystemC做片上系统设计? SystemC基本语法* SystemC行为建模基础* SystemC交易级建模与通信细化* SystemC 方法库 Master/Slave库 验证库,3,第二部分,SystemC的基

2、本语法,4,目的 掌握基本语法语义 了解SystmeC的语言架构 了解SystemC的语言能力 编程中容易出现的错误 养成良好的编程习惯,5,内容,1 一个“Hello,SystemC”实例 SC_MAIN()和全局函数 2 一个2输入与非门组合逻辑实例 SystemC的仿真过程与时间模型 3 语法 模块 端口和信号 时钟和时间模型 数据类型 进程 4 仿真和波形跟踪 5 寄存器传输级SystemC设计简介,6,1 一个“Hello,SystemC”实例,输出“Hello,SystemC”、SystemC版本信息 、SystemC版权声明、当前仿真时间、SystemC缺省时间单位和时间分辨率。

3、 包括一个模块Hello和sc_main函数。,7,1 一个“Hello,SystemC”实例,/头文件 / hello.h #ifndef _HELLO_H /基本C+ #define _HELLO_H #include “systemc.h” /所有SystemC模块必须包含“systemc.h” #endif,SC_MODULE(hello) /此处声明SystemC模块 ;,SC_CTOR(hello) /此处声明SystemC构造函数 cout“Hello,SystemC!”endl; /输出“Hello, SystemC!” cout“sc_version():”endl; cou

4、tsc_version()endl; /输出SystemC版本 cout“sc_copyright():”endl; coutsc_copyright()endl; /输出版权声明 cout“sc_time_stamp():“sc_time_stamp()endl; cout“sc_get_time_resolution():“sc_get_time_resolution()endl; cout“sc_get_default_time_unit():“sc_get_default_time_unit()endl; ,8,1 一个“Hello,SystemC”实例,sc_main函数 运行结果,

5、/ 主文件 / main.cpp #include “hello.h“ int sc_main(int i, char* av ) hello h(“hello”); /实例化模块 return 0; ,9,1 运行结果,10,从本例得出的结论,SystemC的缺省时间单位为ns,缺省的时间分辨率为1ps,用Verilog HDL可以描述为 timescale 1 ns/1 ps,SystemC中的模块用SC_MODULE(module_name) 来声明,等效于VHDL的entity。,SystemC的一个模块实际上是一个类,所以它有构造函数和析构函数。,SystemC的最顶层函数是sc_m

6、ain。既然SystemC是C+,为什么不用main()?,11,main() & sc_main(),所有的C/C+的代码的入口是main()。,SystemC也不例外。但main()函数是SystemC核心语言库的一部分,它调用sc_main(),所以SystemC用户代码的入口函数是sc_main()。Return 0代表正常返回。,如果SystemC库中的main()函数不能满足我们的要求,我们可以修改这个函数 。,int sc_main(int i, char* av )的两个参数中,前面一个表示参数的数目,后面一个是用字符串表示的参数的值,这与C语言的main()函数的参数的意义一样。,

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 高等教育 > 大学课件

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号