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_RESOLVED_H_ 00038 #define RC_SC_SIGNAL_RESOLVED_H_ 00039 00040 #include "ReChannel/components/rc_sc_signal.h" 00041 00042 namespace ReChannel { 00043 00047 class rc_sc_signal_resolved 00048 : public rc_sc_signal_b<sc_logic, sc_signal_resolved > 00049 { 00050 private: 00051 typedef rc_sc_signal_b<sc_logic, sc_signal_resolved > base_type; 00052 00053 public: 00054 explicit rc_sc_signal_resolved( 00055 const sc_module_name& name_=sc_gen_unique_name("signal_resolved")) 00056 : base_type(name_) 00057 { } 00058 00059 operator const sc_logic&() const 00060 { return this->read(); } 00061 00062 rc_sc_signal_resolved& operator=(const sc_logic& value) 00063 { this->write(value); return *this; } 00064 00065 rc_sc_signal_resolved& operator=(const rc_sc_signal_resolved& signal_) 00066 { this->write(signal_); return *this; } 00067 00068 virtual bool posedge() const 00069 { return get_if().posedge(); } 00070 00071 virtual bool negedge() const 00072 { return get_if().negedge(); } 00073 00074 virtual const sc_event& posedge_event() const 00075 { return get_exportal_if().posedge_event(); } 00076 00077 virtual const sc_event& negedge_event() const 00078 { return get_exportal_if().negedge_event(); } 00079 00080 protected: 00081 00082 RC_ON_RESET() 00083 { 00084 int count = this->get_driver_count(); 00085 for (int i=0; i < count; ++i) { 00086 driver_write(SC_LOGIC_Z, i); 00087 } 00088 } 00089 }; 00090 00091 } // namespace ReChannel 00092 00093 #endif // RC_SC_SIGNAL_RESOLVED_H_ 00094 00095 // 00096 // $Id: rc_sc_signal_resolved.h,v 1.4 2007/11/23 13:25:45 felke Exp $ 00097 // $Source: /var/cvs/projekte/ReChannel-v2/src/ReChannel/components/rc_sc_signal_resolved.h,v $ 00098 //
1.5.3