96 sc_signal(
const char* name_,
const T& initial_value_ )
125 ,
"value_changed_event");
143 virtual void write(
const T& );
148 operator const T& ()
const
153 {
write( a );
return *
this; }
169 # ifdef DEBUG_SYSTEMC
177 virtual void print( ::std::ostream& = ::std::cout )
const;
178 virtual void dump( ::std::ostream& = ::std::cout )
const;
180 virtual const char*
kind()
const
181 {
return "sc_signal"; }
205 template<
class T, sc_writer_policy POL >
209 ,
const char* if_typename_ )
212 bool is_output = std::string( if_typename_ ) ==
typeid(
if_type).name();
213 if( !policy_type::check_port(
this, &port_, is_output ) )
220 template<
class T, sc_writer_policy POL >
225 bool value_changed = !( m_cur_val == value_ );
226 if ( !policy_type::check_write(
this, value_changed) )
230 if( value_changed ) {
236 template<
class T, sc_writer_policy POL >
244 template<
class T, sc_writer_policy POL >
248 os <<
" name = " << name() << ::std::endl;
249 os <<
" value = " << m_cur_val << ::std::endl;
250 os <<
"new value = " << m_new_val << ::std::endl;
254 template<
class T, sc_writer_policy POL >
258 policy_type::update();
259 if( !( m_new_val == m_cur_val ) ) {
264 template<
class T, sc_writer_policy POL >
268 m_cur_val = m_new_val;
269 if ( m_change_event_p ) m_change_event_p->notify_next_delta();
270 m_change_stamp = simcontext()->change_stamp();
281 template< sc_writer_policy POL >
299 m_negedge_event_p( 0 ),
301 m_posedge_event_p( 0 ),
310 m_negedge_event_p( 0 ),
312 m_posedge_event_p( 0 ),
321 , m_negedge_event_p( 0 )
323 , m_posedge_event_p( 0 )
345 virtual const sc_event& posedge_event()
const;
348 virtual const sc_event& negedge_event()
const;
352 virtual const bool&
read()
const
373 virtual void write(
const bool& );
377 operator const bool& ()
const
382 {
write( a );
return *
this; }
398 # ifdef DEBUG_SYSTEMC
406 virtual void print( ::std::ostream& = ::std::cout )
const;
407 virtual void dump( ::std::ostream& = ::std::cout )
const;
409 virtual const char*
kind()
const
410 {
return "sc_signal"; }
444 template< sc_writer_policy POL >
462 m_negedge_event_p( 0 ),
464 m_posedge_event_p( 0 )
472 m_negedge_event_p( 0 ),
474 m_posedge_event_p( 0 )
482 , m_negedge_event_p( 0 )
484 , m_posedge_event_p( 0 )
490 delete m_negedge_event_p;
491 delete m_posedge_event_p;
510 virtual const sc_event& posedge_event()
const;
513 virtual const sc_event& negedge_event()
const;
549 {
write( a );
return *
this; }
565 # ifdef DEBUG_SYSTEMC
572 virtual void print( ::std::ostream& = ::std::cout )
const;
573 virtual void dump( ::std::ostream& = ::std::cout )
const;
575 virtual const char*
kind()
const
576 {
return "sc_signal"; }
600 template<
typename T, sc_writer_policy POL >
603 operator << ( ::std::ostream& os, const sc_signal<T,POL>& a )
605 return ( os << a.read() );
virtual void print(::std::ostream &=::std::cout) const
sc_signal(const char *name_, sc_dt::sc_logic initial_value_)
const char * name() const
sc_signal< T, POL > this_type
virtual bool event() const
const sc_dt::sc_logic & get_new_value() const
sc_signal_inout_if< bool > if_type
sc_dt::sc_logic m_new_val
sc_signal< bool, POL > this_type
sc_event * m_posedge_event_p
virtual const char * kind() const
sc_dt::uint64 m_change_stamp
sc_writer_policy_check< POL > policy_type
sc_event * m_change_event_p
virtual sc_writer_policy get_writer_policy() const
sc_dt::sc_logic m_cur_val
sc_event * m_change_event_p
sc_writer_policy_check< POL > policy_type
virtual const sc_event & default_event() const
const T & get_new_value() const
sc_signal(const char *name_)
sc_signal(const char *name_, const T &initial_value_)
virtual const sc_dt::sc_logic & read() const =0
sc_event * m_posedge_event_p
virtual void write(const T &)
virtual const sc_event & default_event() const
sc_event * m_change_event_p
void sc_deprecated_get_data_ref()
virtual const sc_event & default_event() const
sc_dt::uint64 m_change_stamp
virtual bool event() const
sc_simcontext * sc_get_curr_simcontext()
virtual const char * kind() const
sc_object * get_current_writer() const
virtual bool negedge() const
virtual const bool & read() const =0
virtual void register_port(sc_port_base &, const char *)
bool event_occurred(sc_dt::uint64 last_change_count) const
virtual bool event() const
virtual bool posedge() const
const char * sc_gen_unique_name(const char *, bool preserve_first)
void sc_deprecated_trace()
virtual const T & read() const =0
const bool & get_new_value() const
void trace(sc_trace_file *tf) const
virtual void dump(::std::ostream &=::std::cout) const
sc_signal_inout_if< sc_dt::sc_logic > if_type
virtual bool is_clock() const
const sc_logic SC_LOGIC_0
void sc_deprecated_get_new_value()
virtual const sc_event & value_changed_event() const
sc_event * m_negedge_event_p
virtual bool negedge() const
sc_dt::uint64 m_change_stamp
void sc_signal_invalid_writer(sc_object *target, sc_object *first_writer, sc_object *second_writer, bool check_delta)
sc_event * m_negedge_event_p
virtual const sc_dt::sc_logic & get_data_ref() const
void trace(sc_trace_file *tf) const
sc_writer_policy_check< POL > policy_type
bool check_write(sc_object *target, bool value_changed)
sc_signal< sc_dt::sc_logic, POL > this_type
sc_signal(const char *name_, bool initial_value_)
virtual const char * kind() const
virtual const T & read() const
virtual const bool & read() const
const sc_logic SC_LOGIC_1
sc_signal(const char *name_)
virtual const T & get_data_ref() const
sc_simcontext * simcontext() const
void sc_trace(sc_trace_file *tf, const sc_in< T > &port, const std::string &name)
virtual sc_writer_policy get_writer_policy() const
sc_signal(const char *name_)
virtual const bool & get_data_ref() const
sc_event * sc_lazy_kernel_event(sc_event **, const char *name)
virtual bool posedge() const
virtual const sc_dt::sc_logic & read() const
void trace(sc_trace_file *tf) const
this_type & operator=(const T &a)
virtual sc_writer_policy get_writer_policy() const
sc_signal_inout_if< T > if_type