96 sc_signal(
const char* name_,
const T& initial_value_ )
128 ,
"value_changed_event");
154 virtual void write(
const T& );
159 operator const T& ()
const
164 {
write( a );
return *
this; }
167 {
write( a.read() );
return *
this; }
188 # ifdef DEBUG_SYSTEMC
196 virtual void print( ::std::ostream& = ::std::cout )
const;
197 virtual void dump( ::std::ostream& = ::std::cout )
const;
199 virtual const char*
kind()
const
200 {
return "sc_signal"; }
224 template<
class T, sc_writer_policy POL >
228 ,
const char* if_typename_ )
230 bool is_output = std::string( if_typename_ ) ==
typeid(
if_type).name();
231 if( !policy_type::check_port(
this, &port_, is_output ) )
238 template<
class T, sc_writer_policy POL >
247 bool value_changed = !( m_cur_val == value_ );
248 if ( !policy_type::check_write(
this, value_changed) )
252 if( value_changed ) {
259 template<
class T, sc_writer_policy POL >
267 template<
class T, sc_writer_policy POL >
274 os <<
" name = " << name() << ::std::endl;
275 os <<
" value = " << m_cur_val << ::std::endl;
276 os <<
"new value = " << m_new_val << ::std::endl;
282 template<
class T, sc_writer_policy POL >
286 policy_type::update();
287 if( !( m_new_val == m_cur_val ) ) {
292 template<
class T, sc_writer_policy POL >
296 m_cur_val = m_new_val;
297 if ( m_change_event_p ) m_change_event_p->notify(
SC_ZERO_TIME);
298 m_change_stamp = simcontext()->change_stamp();
309 template< sc_writer_policy POL >
327 m_negedge_event_p( 0 ),
329 m_posedge_event_p( 0 ),
338 m_negedge_event_p( 0 ),
340 m_posedge_event_p( 0 ),
349 , m_negedge_event_p( 0 )
351 , m_posedge_event_p( 0 )
373 virtual const sc_event& posedge_event()
const;
376 virtual const sc_event& negedge_event()
const;
380 virtual const bool&
read()
const
408 virtual void write(
const bool& );
412 operator const bool& ()
const
417 {
write( a );
return *
this; }
442 # ifdef DEBUG_SYSTEMC
450 virtual void print( ::std::ostream& = ::std::cout )
const;
451 virtual void dump( ::std::ostream& = ::std::cout )
const;
453 virtual const char*
kind()
const
454 {
return "sc_signal"; }
490 template< sc_writer_policy POL >
508 m_negedge_event_p( 0 ),
510 m_posedge_event_p( 0 )
518 m_negedge_event_p( 0 ),
520 m_posedge_event_p( 0 )
528 , m_negedge_event_p( 0 )
530 , m_posedge_event_p( 0 )
536 delete m_negedge_event_p;
537 delete m_posedge_event_p;
556 virtual const sc_event& posedge_event()
const;
559 virtual const sc_event& negedge_event()
const;
602 {
write( a );
return *
this; }
627 # ifdef DEBUG_SYSTEMC
634 virtual void print( ::std::ostream& = ::std::cout )
const;
635 virtual void dump( ::std::ostream& = ::std::cout )
const;
637 virtual const char*
kind()
const
638 {
return "sc_signal"; }
662 template<
typename T, sc_writer_policy POL >
665 operator << ( ::std::ostream& os, const sc_signal<T,POL>& a )
667 return ( os << a.read() );
virtual sc_writer_policy get_writer_policy() const
sc_signal(const char *name_)
sc_event * m_change_event_p
virtual bool negedge() const
Specialization of sc_signal_in_if<T> for type bool.
sc_dt::uint64 m_change_stamp
const sc_dt::sc_logic & get_new_value() const
sc_event * sc_lazy_kernel_event(sc_event **, const char *name)
virtual const sc_event & default_event() const
virtual void dump(::std::ostream &=::std::cout) const
sc_object * get_current_writer() const
sc_writer_policy_check< POL > policy_type
sc_signal(const char *name_, sc_dt::sc_logic initial_value_)
CHNL_MTX_TYPE_ m_mutex
A mutex to protect concurrent communication.
virtual const sc_event & default_event() const
sc_event * m_posedge_event_p
virtual sc_writer_policy get_writer_policy() const
virtual bool negedge() const
sc_dt::uint64 m_change_stamp
const T & get_new_value() const
virtual const char * kind() const
void trace(sc_trace_file *tf) const
virtual void update()
The update method (does nothing by default).
sc_dt::sc_logic m_new_val
virtual const sc_event & default_event() const
const char * name() const
sc_simcontext * simcontext() const
void sc_deprecated_get_new_value()
bool event_occurred(sc_dt::uint64 last_change_count) const
sc_signal< bool, POL > this_type
sc_writer_policy_check< POL > policy_type
void sc_deprecated_trace()
virtual const char * kind() const
sc_dt::sc_logic m_cur_val
sc_signal< T, POL > this_type
The sc_signal<T> input/output interface class.
const char * sc_gen_unique_name(const char *, bool preserve_first)
The sc_signal<T> input interface class.
this_type & operator=(const T &a)
sc_signal_inout_if< T > if_type
virtual const bool & get_data_ref() const
virtual const sc_dt::sc_logic & get_data_ref() const
virtual void register_port(sc_port_base &, const char *)
virtual const sc_dt::sc_logic & read() const =0
virtual void write(const T &)
sc_event * m_change_event_p
void trace(sc_trace_file *tf) const
virtual const sc_event & value_changed_event() const
virtual const T & read() const
void sc_deprecated_get_data_ref()
virtual bool event() const
sc_signal_inout_if< bool > if_type
Specialization of sc_signal_in_if<T> for type sc_dt::sc_logic.
sc_event * m_change_event_p
Abstract base class for class sc_port_b.
virtual const bool & read() const
bool check_write(sc_object *target, bool value_changed)
sc_dt::uint64 m_change_stamp
sc_writer_policy_check< POL > policy_type
virtual sc_writer_policy get_writer_policy() const
virtual const char * kind() const
const sc_logic SC_LOGIC_0
virtual bool is_clock() const
virtual void print(::std::ostream &=::std::cout) const
virtual const T & get_data_ref() const
const bool & get_new_value() const
sc_simcontext * sc_get_curr_simcontext()
sc_event * m_negedge_event_p
sc_signal< sc_dt::sc_logic, POL > this_type
virtual bool event() const
const sc_time SC_ZERO_TIME
virtual const sc_dt::sc_logic & read() const
void trace(sc_trace_file *tf) const
sc_signal(const char *name_, bool initial_value_)
void sc_trace(sc_trace_file *tf, const sc_in< T > &port, const std::string &name)
sc_event * m_posedge_event_p
const sc_logic SC_LOGIC_1
sc_signal_inout_if< sc_dt::sc_logic > if_type
virtual const bool & read() const =0
sc_signal(const char *name_, const T &initial_value_)
The chnl_scoped_lock class to lock (and automatically release) a mutex.
virtual bool event() const
sc_signal(const char *name_)
sc_signal(const char *name_)
virtual bool posedge() const
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
Abstract base class of all primitive channel classes.
Abstract base class of all SystemC `simulation' objects.
virtual bool posedge() const