X-Git-Url: http://sraa.de/git/?a=blobdiff_plain;f=dol%2Fsrc%2Fdol%2Fvisitor%2FsystemC%2Flib%2Fdol_fifo_if.h;fp=dol%2Fsrc%2Fdol%2Fvisitor%2FsystemC%2Flib%2Fdol_fifo_if.h;h=04c6f4a4404549d4f630df7e617737af6cadbc42;hb=8c411cf24ed0eb889191aaeafd8fa1e69081df42;hp=0000000000000000000000000000000000000000;hpb=dea7a4fb1ed110d3ce6e6d9255103d724bd66c0e;p=jump.git diff --git a/dol/src/dol/visitor/systemC/lib/dol_fifo_if.h b/dol/src/dol/visitor/systemC/lib/dol_fifo_if.h new file mode 100644 index 0000000..04c6f4a --- /dev/null +++ b/dol/src/dol/visitor/systemC/lib/dol_fifo_if.h @@ -0,0 +1,90 @@ +/************************************************************************** + dol_fifo_if.h + + DOL FIFO channel interfaces + + (c) 2006 by Alexander Maxiaguine + + Computer Engineering and Networks Laboratory, TIK + Swiss Federal Institute of Technology, ETHZ Zurich + Switzerland + +**************************************************************************/ + +/************************************************************************** + Change Log: + + 14.03.06 -- creation + +**************************************************************************/ + +#ifndef DOL_FIFO_IF_H +#define DOL_FIFO_IF_H + +#include "systemc.h" + + +template +class dol_fifo_write_if : virtual public sc_interface +{ +public: + + // bloking (re)acquire free room in the channel + virtual void reAcquireRoom(int count) = 0; + + // non-bloking (re)acquire free room in the channel + virtual bool tryReAcquireRoom(int count) = 0; + + // store data into the acquired free room + virtual void store(int offset, T* data, int count) = 0; + + // release the stored data to the channel (commit write) + virtual void releaseData(int count) = 0; + + +protected: + + // constructor + dol_fifo_write_if() {} + + +private: + + // disabled + dol_fifo_write_if( const dol_fifo_write_if& ); + dol_fifo_write_if& operator = ( const dol_fifo_write_if& ); +}; + +template +class dol_fifo_read_if : virtual public sc_interface +{ +public: + + // bloking (re)acquire data in the channel + virtual void reAcquireData(int count) = 0; + + // non-bloking (re)acquire data in the channel + virtual bool tryReAcquireData(int count) = 0; + + // load the acquired data into a vector + virtual void load(int offset, T* vector, int count) = 0; + + // free up the room in the channel (commit read) + virtual void releaseRoom(int count) = 0; + + +protected: + + // constructor + dol_fifo_read_if() {} + + +private: + + // disabled + dol_fifo_read_if( const dol_fifo_read_if& ); + dol_fifo_read_if& operator = ( const dol_fifo_read_if& ); +}; + + +#endif