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

📄 timer.h

📁 SystemC可以由C语言直接开发硬件
💻 H
字号:
/************************************************************************
 * file name:	timer.h
 * description:	for test use.
 * modification history
 * --------------------
 * 2003-5-3 9:21:11, created by zhuwei
 */ 

#ifndef _TIMER_H
#define _TIMER_H

/* includes----------------------------------------------------------- */
#include "systemc.h"

/* defines------------------------------------------------------------ */
/* typedefs----------------------------------------------------------- */
SC_MODULE(timer) 
{
	sc_inout<bool> start; // input port
	sc_out<bool> timeout; // output port
	sc_in<bool> clock; // input port
	//sc_in_clk	clk;

	int count;
	void runtimer();
	// Constructor
	SC_CTOR(timer) 
	{
		SC_THREAD(runtimer); // Thread process
		sensitive_pos << clock;  /* zhuwei (2003-5-7 11:35:32) wait until clock’event and clock = ‘1’*/
		/* zhuwei (2003-5-7 11:46:02) 或者写成:sensitive_pos(clock); */
		sensitive << start;
		count = 0;
	}
};

/* externs------------------------------------------------------------ */
/* globals------------------------------------------------------------ */
/* forward declarations----------------------------------------------- */

#endif /* _TIMER_H */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -