dol: initial dol commit
[jump.git] / dol / src / dol / visitor / systemC / lib / dol_fifo_if.h
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 (file)
index 0000000..04c6f4a
--- /dev/null
@@ -0,0 +1,90 @@
+/**************************************************************************\r
+       dol_fifo_if.h\r
\r
+       DOL FIFO channel interfaces   \r
+\r
+       (c) 2006 by Alexander Maxiaguine <maxiagui@tik.ee.ethz.ch>\r
+\r
+       Computer Engineering and Networks Laboratory, TIK\r
+       Swiss Federal Institute of Technology, ETHZ Zurich \r
+       Switzerland\r
+\r
+**************************************************************************/\r
+\r
+/**************************************************************************\r
+       Change Log:\r
+\r
+       14.03.06 -- creation\r
+\r
+**************************************************************************/\r
+\r
+#ifndef DOL_FIFO_IF_H\r
+#define DOL_FIFO_IF_H\r
+\r
+#include "systemc.h"\r
+\r
+\r
+template <class T>\r
+class dol_fifo_write_if : virtual public sc_interface\r
+{\r
+public:\r
+    \r
+    // bloking (re)acquire free room in the channel\r
+    virtual void reAcquireRoom(int count) = 0;\r
+    \r
+    // non-bloking (re)acquire free room in the channel\r
+    virtual bool tryReAcquireRoom(int count) = 0;\r
+    \r
+    // store data into the acquired free room\r
+    virtual void store(int offset, T* data, int count) = 0;\r
+    \r
+    // release the stored data to the channel (commit write)\r
+    virtual void releaseData(int count) = 0;\r
+\r
+    \r
+protected:\r
+    \r
+    // constructor\r
+    dol_fifo_write_if()        {}\r
+\r
+    \r
+private:\r
+\r
+    // disabled\r
+    dol_fifo_write_if( const dol_fifo_write_if<T>& );\r
+    dol_fifo_write_if<T>& operator = ( const dol_fifo_write_if<T>& );\r
+};\r
+\r
+template <class T>\r
+class dol_fifo_read_if : virtual public sc_interface\r
+{\r
+public:\r
+\r
+    // bloking (re)acquire data in the channel\r
+    virtual void reAcquireData(int count) = 0;\r
+\r
+    // non-bloking (re)acquire data in the channel\r
+    virtual bool tryReAcquireData(int count) = 0;\r
+    \r
+    // load the acquired data into a vector\r
+    virtual void load(int offset, T* vector, int count) = 0;\r
+    \r
+    // free up the room in the channel (commit read)\r
+    virtual void releaseRoom(int count) = 0;\r
+    \r
+    \r
+protected:\r
+    \r
+    // constructor\r
+    dol_fifo_read_if() {}\r
+\r
+    \r
+private:\r
+\r
+    // disabled\r
+    dol_fifo_read_if( const dol_fifo_read_if<T>& );\r
+    dol_fifo_read_if<T>& operator = ( const dol_fifo_read_if<T>& );\r
+};\r
+\r
+\r
+#endif\r