00001 // vim:set et sts=4 ts=4 tw=75 sw=4 ai ci cin cino=g0,t0: 00002 /* 00003 * Copyright (C) 2007, Technical Computer Science Group, 00004 * University of Bonn 00005 * 00006 * This file is part of the ReChannel library. 00007 * 00008 * The ReChannel library is free software; you can redistribute it and/or 00009 * modify it under the terms of the GNU General Public License as 00010 * published by the Free Software Foundation; either version 2 of the 00011 * License, or (at your option) any later version. 00012 * 00013 * This library is distributed in the hope that it will be 00014 * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00016 * General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU General Public License 00019 * along with this library; see the file COPYING. If not, write to the 00020 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 00021 * Boston, MA 02110-1301, USA. 00022 * 00023 * Authors: Andreas Raabe and Armin Felke. Implementation by Armin Felke. 00024 * {raabe, felke}@cs.uni-bonn.de 00025 */ 00037 #ifndef RC_SC_SIGNAL_RV_H_ 00038 #define RC_SC_SIGNAL_RV_H_ 00039 00040 #include "ReChannel/components/rc_sc_signal.h" 00041 00042 namespace ReChannel { 00043 00047 template<int W> 00048 class rc_sc_signal_rv 00049 : public rc_sc_signal_b<sc_lv<W>, sc_signal_rv<W> > 00050 { 00051 private: 00052 typedef rc_sc_signal_b<sc_lv<W>, sc_signal_rv<W> > base_type; 00053 00054 public: 00055 explicit rc_sc_signal_rv( 00056 const sc_module_name& name_=sc_gen_unique_name("signal_rv")) 00057 : base_type(name_) 00058 { } 00059 00060 operator const sc_lv<W>&() const 00061 { return this->read(); } 00062 00063 rc_sc_signal_rv<W>& operator= (const sc_lv<W>& value) 00064 { this->write(value); return *this; } 00065 00066 rc_sc_signal_rv<W>& operator= (const rc_sc_signal_rv<W>& signal_) 00067 { this->write(signal_); return *this; } 00068 00069 protected: 00070 00071 RC_ON_RESET() 00072 { 00073 int count = this->get_driver_count(); 00074 for (int i=0; i < count; ++i) { 00075 driver_write(s_ZZZ, i); 00076 } 00077 } 00078 00079 private: 00080 static const sc_dt::sc_lv<W> s_ZZZ; 00081 }; 00082 00083 template<int W> 00084 const typename sc_dt::sc_lv<W> 00085 rc_sc_signal_rv<W>::s_ZZZ = sc_dt::sc_lv<W>('Z'); 00086 00087 } // namespace ReChannel 00088 00089 #endif // RC_SC_SIGNAL_RV_H_ 00090 00091 // 00092 // $Id: rc_sc_signal_rv.h,v 1.4 2007/11/23 13:25:45 felke Exp $ 00093 // $Source: /var/cvs/projekte/ReChannel-v2/src/ReChannel/components/rc_sc_signal_rv.h,v $ 00094 //
1.5.3