timer.h
来自「SystemC可以由C语言直接开发硬件」· C头文件 代码 · 共 41 行
H
41 行
/************************************************************************
* 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 + =
减小字号Ctrl + -
显示快捷键?