dol: initial dol commit
[jump.git] / dol / src / dol / visitor / systemC / lib / dol_fifo_if.h
1 /**************************************************************************\r
2         dol_fifo_if.h\r
3  \r
4         DOL FIFO channel interfaces   \r
5 \r
6         (c) 2006 by Alexander Maxiaguine <maxiagui@tik.ee.ethz.ch>\r
7 \r
8         Computer Engineering and Networks Laboratory, TIK\r
9         Swiss Federal Institute of Technology, ETHZ Zurich \r
10         Switzerland\r
11 \r
12 **************************************************************************/\r
13 \r
14 /**************************************************************************\r
15         Change Log:\r
16 \r
17         14.03.06 -- creation\r
18 \r
19 **************************************************************************/\r
20 \r
21 #ifndef DOL_FIFO_IF_H\r
22 #define DOL_FIFO_IF_H\r
23 \r
24 #include "systemc.h"\r
25 \r
26 \r
27 template <class T>\r
28 class dol_fifo_write_if : virtual public sc_interface\r
29 {\r
30 public:\r
31     \r
32     // bloking (re)acquire free room in the channel\r
33     virtual void reAcquireRoom(int count) = 0;\r
34     \r
35     // non-bloking (re)acquire free room in the channel\r
36     virtual bool tryReAcquireRoom(int count) = 0;\r
37     \r
38     // store data into the acquired free room\r
39     virtual void store(int offset, T* data, int count) = 0;\r
40     \r
41     // release the stored data to the channel (commit write)\r
42     virtual void releaseData(int count) = 0;\r
43 \r
44     \r
45 protected:\r
46     \r
47     // constructor\r
48     dol_fifo_write_if() {}\r
49 \r
50     \r
51 private:\r
52 \r
53     // disabled\r
54     dol_fifo_write_if( const dol_fifo_write_if<T>& );\r
55     dol_fifo_write_if<T>& operator = ( const dol_fifo_write_if<T>& );\r
56 };\r
57 \r
58 template <class T>\r
59 class dol_fifo_read_if  : virtual public sc_interface\r
60 {\r
61 public:\r
62 \r
63     // bloking (re)acquire data in the channel\r
64     virtual void reAcquireData(int count) = 0;\r
65 \r
66     // non-bloking (re)acquire data in the channel\r
67     virtual bool tryReAcquireData(int count) = 0;\r
68     \r
69     // load the acquired data into a vector\r
70     virtual void load(int offset, T* vector, int count) = 0;\r
71     \r
72     // free up the room in the channel (commit read)\r
73     virtual void releaseRoom(int count) = 0;\r
74     \r
75     \r
76 protected:\r
77     \r
78     // constructor\r
79     dol_fifo_read_if()  {}\r
80 \r
81     \r
82 private:\r
83 \r
84     // disabled\r
85     dol_fifo_read_if( const dol_fifo_read_if<T>& );\r
86     dol_fifo_read_if<T>& operator = ( const dol_fifo_read_if<T>& );\r
87 };\r
88 \r
89 \r
90 #endif\r