|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
最近初学systemc,遇到些问题,望大家指点一下,谢谢!!
下面是systemc的sc_fixed写的一段定点仿真程序,实现2个数求和。
#include "systemc.h"
int sc_main(int argc,char *argv[]) {
sc_fixed<8,4,SC_RND,SC_SAT> x,y;
sc_fixed<9,5,SC_RND,SC_SAT> sum;
x=2.356;
y=3.5678;
sum=x+y;
cout<<"x="<<x<<endl;
cout<<"y="<<y<<endl;
cout<<"sum=x+y="<<sum<<endl;
return(0);
};
编译时报错:
sc_main.cpp(3) : error C2065: 'sc_fixed' : undeclared identifier
sc_main.cpp(3) : error C2065: 'SC_RND' : undeclared identifier
sc_main.cpp(3) : error C2065: 'SC_SAT' : undeclared identifier
sc_main.cpp(3) : error C2065: 'x' : undeclared identifier
sc_main.cpp(3) : error C2065: 'y' : undeclared identifier
sc_main.cpp(4) : error C2065: 'sum' : undeclared identifier
不知为什么出错,systemc里应该有'sc_fixed' 数据类型的啊?怎么会出错呢?
望大家指点一下,谢谢!! |
|