www.pudn.com > noc.rar > alu.h


/*
 *  TU Eindhoven
 *  Eindhoven, The Netherlands
 *
 *  Name            :   alu.h
 *
 *  Author          :   Sander Stuijk (sander@ics.ele.tue.nl)
 *
 *  Date            :   July 23, 2002
 *
 *  Function        :   Arithmetic  Logic Unit
 *
 *  History         :
 *      23-07-02    :   Initial version.
 *      13-12-02    :   Synthesizable version A.S.Slusarczyk@tue.nl
 *
 */

#ifndef ALU_H_INCLUDED
#define ALU_H_INCLUDED

#include "mips.h"
 
SC_MODULE(ALU) {
	sc_in< 	sc_bv >	ctrl;	// Control input
	sc_in< 	sc_bv >		a;		// First operand input 
	sc_in< 	sc_bv >		b;		// Second operand input
	sc_out<	sc_bv >		r;		// Result
	sc_out< sc_bv<1> >			z;		// Zero (one in case result equal zero)
	
	void alu_thread();
	
	// Constructor
	SC_CTOR(ALU) {
		SC_METHOD(alu_thread); //-> SC_THREAD(alu_thread);
		sensitive << ctrl << a << b;
	}
};

#endif