output.cpp

来自「SystemC可以由C语言直接开发硬件」· C++ 代码 · 共 50 行

CPP
50
字号
/************************************************************************
 * file name:	output.cpp 
 * description:	implementation of output module. 
 *
 * modification history
 * --------------------
 * 2003-5-31 20:10:39, created by zhuwei
 */

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

/* defines------------------------------------------------------------ */
/* typedefs----------------------------------------------------------- */
/* externs------------------------------------------------------------ */
/* globals------------------------------------------------------------ */
/* forward declarations----------------------------------------------- */

void output::do_output()
{
	sc_bit b1, b0;
	b1 = 1;
	b0 = 0;

	while(true)
	{
		dout[0] = b0;
		dout[1] = b0;
		dout[2] = b0;
		wait(5, SC_NS);

		dout[0] = b1;
		dout[1] = b1;
		dout[2] = b1;
		wait(15, SC_NS);

		dout[0] = b0;
		dout[1] = b0;
		dout[2] = b0;
		wait(15, SC_NS);

		dout[0] = b0;
		dout[1] = b0;
		dout[2] = b1;
		wait(15, SC_NS);

		sc_stop();
	}
}

⌨️ 快捷键说明

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