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

📄 mux.cpp

📁 改进的基于6个mips核的NOC网络
💻 CPP
字号:
/* *  TU Eindhoven *  Eindhoven, The Netherlands * *  Name            :   mux.cc * *  Author          :   Sander Stuijk (sander@ics.ele.tue.nl) * *  Date            :   July 23, 2002 * *  Function        :   Multiplexer * *  History         : *      23-07-02    :   Initial version. *      13-12-02    :   Synthesizable version A.S.Slusarczyk@tue.nl * */ #include "mux.h"void MUX2::mux_thread(){	sc_bv<DWORD> data;		//-> while (true) {		#ifdef VERBOSE			clog << "MUX '" << name() << "'" <<endl;		#endif				// Read correct input		if(sc_uint<1>(sel.read()) == 0)			data = in0.read();		else			data = in1.read();				// Write output		out.write(data);				// wait for new event		//-> wait();//-> 	}}void MUX3::mux_thread(){	sc_bv<DWORD> data;	sc_uint<2> sel_t;		//-> while (true) {		#ifdef VERBOSE			clog << "MUX '" << name() << "'" <<endl;		#endif				// Read correct input		sel_t = sel.read();		if(sel_t == 0)			data = in0.read();		else if (sel_t == 1)			data = in1.read();		else			data = in2.read();					// Write output		out.write(data);				// wait for new event		//-> wait();//-> 	}}void MUX3_AWORDREG::mux_thread(){	sc_bv<AWORDREG> data;	sc_uint<2> sel_t;		//-> while (true) {		#ifdef VERBOSE			clog << "MUX '" << name() << "'" <<endl;		#endif				// Read correct input		sel_t = sel.read();		if(sel_t == 0)			data = in0.read();		else if (sel_t == 1)			data = in1.read();		else			data = in2.read();					// Write output		out.write(data);				// wait for new event		//-> wait();//-> 	}}

⌨️ 快捷键说明

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