⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 timer.cpp

📁 SystemC可以由C语言直接开发硬件
💻 CPP
字号:
/************************************************************************
 * 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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -