timer.cpp
来自「SYSTEMC经典案例,很好的SYSTEMC参考资料.SYSTEMC系统验证测试」· C++ 代码 · 共 52 行
CPP
52 行
/************************************************************************
* file name: timer.cpp
* description: for test use.
* modification history
* --------------------
* 2003-5-3 9:23:11, created by zhuwei
*/
/* includes----------------------------------------------------------- */
#include "timer.h"
/* defines------------------------------------------------------------ */
/* typedefs----------------------------------------------------------- */
/* externs------------------------------------------------------------ */
/* globals------------------------------------------------------------ */
/* forward declarations----------------------------------------------- */
void timer::runtimer()
{
while (true)
{
if (start)
{
cout <<"Timer: timer start detected"<<endl;
count = 5; // need to make this a constant
timeout = false;
start = false;
}
else
{
if (count > 0)
{
count--;
timeout = false;
}
else
{
timeout = true;
}
}
/*-------------------zhuwei add(2003-5-8 9:42:45)--------------------
When the wait() method is called without arguments, the calling thread process will
suspend. When one of the events in the sensitivity list is notified, the waiting
thread process is resumed.
若指定了参数,则suspends the thread of execution until the event specified in the argument
occurs.
----------------------end(2003-5-8 9:42:45)------------------------*/
wait();
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?