00001 /*******************************************************************\ 00002 00003 SESAME project software license 00004 00005 Copyright (C) 2002 University of Amsterdam 00006 00007 This program is free software; you can redistribute it and/or 00008 modify it under the terms of the GNU General Public License 00009 as published by the Free Software Foundation; either version 2 00010 of the License, or (at your option) any later version. 00011 00012 This program is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU General Public License for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with this program; if not, write to the Free Software 00019 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 00020 02111-1307, USA. 00021 00022 For information regarding the SESAME software project see 00023 http://sesamesim.sourceforge.net or email 00024 jcofflan@users.sourceforge.net 00025 00026 \*******************************************************************/ 00027 00028 #ifndef FIFO_H 00029 #define FIFO_H 00030 00031 #include <pnxmltags.h> 00032 #include <ymldefs.h> 00033 #include <iostream> 00034 00035 #include "io.h" 00036 #include "id.h" 00037 00038 template<class T> 00039 class Fifo : public Id, public In<T>, public Out<T> { 00040 Id *in; 00041 Id *out; 00042 00043 public: 00044 Fifo(const Id& n); 00045 Fifo(const Id& n, unsigned int lo); 00046 Fifo(const Id& n, unsigned int lo, unsigned int hi); 00047 00048 void read(T& t); 00049 void read(T* p, unsigned int n); 00050 void setIn(Id *in) {this->in = in;} 00051 00052 void write(const T& t); 00053 void write(const T* p, unsigned int n); 00054 void setOut(Id *out) {this->out = out;} 00055 00056 yapiObject_t getYAPIType() {return yapiFIFO;} 00057 virtual void dumpYML(std::ostream &stream, int tablevel); 00058 }; 00059 00060 #include "fifo.cc" 00061 00062 #endif
1.4.6