94 , m_change_event_p( 0 )
104 virtual const char*
kind()
const 105 {
return "sc_signal_channel"; }
109 {
return value_changed_event(); }
112 const sc_event& value_changed_event()
const;
116 {
return simcontext()->event_occurred(m_change_stamp); }
123 void deprecated_get_data_ref()
const;
124 void deprecated_get_new_value()
const;
125 void deprecated_trace()
const;
129 {
if( ev ) ev->notify_next_delta(); }
158 template<
class T, sc_writer_policy POL >
176 , m_cur_val( initial_value_ )
177 , m_new_val( initial_value_ )
186 virtual const char*
kind()
const 187 {
return "sc_signal"; }
189 virtual void register_port(
sc_port_base&,
const char* );
196 {
return value_changed_event(); }
200 {
return base_type::value_changed_event(); }
204 {
return m_cur_val; }
209 deprecated_get_data_ref();
215 {
return base_type::event(); }
218 virtual void write(
const T& );
223 operator const T& ()
const 228 this_type& operator = (
const T& a )
229 { write( a );
return *
this; }
232 { write( a.read() );
return *
this; }
234 this_type& operator = (
const this_type& a )
235 { write( a.
read() );
return *
this; }
240 deprecated_get_new_value();
248 # ifdef DEBUG_SYSTEMC 256 virtual void print( ::std::ostream& = ::std::cout )
const;
257 virtual void dump( ::std::ostream& = ::std::cout )
const;
276 template<
class T, sc_writer_policy POL >
280 ,
const char* if_typename_ )
282 bool is_output = std::string( if_typename_ ) ==
typeid(
if_type).name();
283 if( !policy_type::check_port(
this, &port_, is_output ) )
290 template<
class T, sc_writer_policy POL >
296 bool value_changed = !( m_new_val == value_ );
297 if ( !policy_type::check_write(
this, value_changed) )
301 if( value_changed || policy_type::needs_update() ) {
307 template<
class T, sc_writer_policy POL >
315 template<
class T, sc_writer_policy POL >
319 os <<
" name = " << name() << ::std::endl;
320 os <<
" value = " << m_cur_val << ::std::endl;
321 os <<
"new value = " << m_new_val << ::std::endl;
325 template<
class T, sc_writer_policy POL >
329 policy_type::update();
330 if( !( m_new_val == m_cur_val ) ) {
335 template<
class T, sc_writer_policy POL >
339 base_type::do_update();
340 m_cur_val = m_new_val;
368 : base_type( name_, value_type() )
371 sc_signal(
const char* name_,
const value_type& initial_value_ )
372 : base_type( name_, initial_value_ )
378 this_type& operator = (
const value_type& a )
379 { base_type::operator=(a);
return *
this; }
382 { base_type::operator=(a);
return *
this; }
384 this_type& operator = (
const this_type& a )
385 { base_type::operator=(a);
return *
this; }
405 template< sc_writer_policy POL >
421 , m_negedge_event_p( 0 ) , m_posedge_event_p( 0 ) , m_reset_p( 0 )
426 : base_type( name_, value_type() )
427 , m_negedge_event_p( 0 ) , m_posedge_event_p( 0 ) , m_reset_p( 0 )
430 sc_signal(
const char* name_,
const value_type& initial_value_ )
431 : base_type( name_, initial_value_ )
432 , m_negedge_event_p( 0 ) , m_posedge_event_p( 0 ) , m_reset_p( 0 )
438 virtual const sc_event& posedge_event()
const;
441 virtual const sc_event& negedge_event()
const;
445 {
return ( this->event() && this->m_cur_val ); }
449 {
return ( this->event() && ! this->m_cur_val ); }
453 this_type& operator = (
const value_type& a )
454 { base_type::operator=(a);
return *
this; }
457 { base_type::operator=(a);
return *
this; }
459 this_type& operator = (
const this_type& a )
460 { base_type::operator=(a);
return *
this; }
493 template< sc_writer_policy POL >
507 , m_negedge_event_p( 0 ) , m_posedge_event_p( 0 )
512 : base_type( name_, value_type() )
513 , m_negedge_event_p( 0 ) , m_posedge_event_p( 0 )
516 sc_signal(
const char* name_,
const value_type& initial_value_ )
517 : base_type( name_, initial_value_ )
518 , m_negedge_event_p( 0 ) , m_posedge_event_p( 0 )
524 virtual const sc_event& posedge_event()
const;
527 virtual const sc_event& negedge_event()
const;
540 this_type& operator = (
const value_type& a )
541 { base_type::operator=(a);
return *
this; }
544 { base_type::operator=(a);
return *
this; }
546 this_type& operator = (
const this_type& a )
547 { base_type::operator=(a);
return *
this; }
virtual void register_port(sc_port_base &, const char *)
sc_signal_channel base_type
sc_signal_t< T, POL > this_type
The sc_signal<T> input interface class.
inline ::std::ostream & operator<<(::std::ostream &os, const sc_fifo< T > &a)
virtual void print(::std::ostream &os=::std::cout) const
sc_signal(const char *name_, const value_type &initial_value_)
Process base class support.
void sc_trace(sc_trace_file *tf, const sc_in< T > &port, const std::string &name)
sc_writer_policy_check< POL > policy_type
sc_signal_t< sc_dt::sc_logic, POL > base_type
sc_signal_inout_if< T > if_type
Abstract base class of all SystemC `simulation' objects.
virtual void dump(::std::ostream &=::std::cout) const
virtual sc_writer_policy get_writer_policy() const
Base classes of all port classes.
virtual bool negedge() const
sc_dt::uint64 m_change_stamp
virtual const T & read() const
The sc_signal<T> interface classes.
Abstract base class of all primitive channel classes.
sc_signal_channel(const char *name_)
Abstract base class for class sc_port_b.
sc_writer_policy_check< POL > policy_type
const T & get_new_value() const
sc_event * m_negedge_event_p
SC_API const sc_logic SC_LOGIC_0
virtual bool is_clock() const
sc_signal(const char *name_)
virtual const sc_event & default_event() const
The sc_signal<T> input/output interface class.
virtual const sc_event & value_changed_event() const
virtual bool event() const
virtual bool posedge() const
sc_event * m_change_event_p
sc_signal_t< T, POL > base_type
sc_signal< bool, POL > this_type
const sc_event & default_event() const
void notify_next_delta(sc_event *ev) const
sc_signal< sc_dt::sc_logic, POL > this_type
SC_API const sc_logic SC_LOGIC_1
bool check_write(sc_object *target, bool value_changed)
sc_event * m_posedge_event_p
sc_event * m_negedge_event_p
void swap(sc_process_handle &other)
virtual void write(const T &)
sc_signal(const char *name_, const value_type &initial_value_)
virtual bool posedge() const
SC_API const char * sc_gen_unique_name(const char *, bool preserve_first)
sc_signal_t< bool, POL > base_type
sc_signal< T, POL > this_type
Definition of the simulation context class.
sc_signal(const char *name_)
C++ implementation of logic type. Behaves.
virtual const char * kind() const
sc_writer_policy_check< POL > policy_type
sc_event * m_posedge_event_p
virtual const char * kind() const
sc_simcontext * sc_get_curr_simcontext()
sc_writer_policy_check< POL > policy_type
sc_process_handle m_writer_p
#define SC_API_TEMPLATE_DECL_
virtual const T & get_data_ref() const
virtual bool negedge() const
sc_dt::sc_logic value_type
void trace(sc_trace_file *tf) const
The sc_signal<T> writer policy definition.
sc_process_b * get_current_writer() const
sc_signal_t(const char *name_, const T &initial_value_)
Abstract base class of all primitive channel classes.
SC_API void sc_signal_invalid_writer(sc_object *target, sc_object *first_writer, sc_object *second_writer, bool check_delta)
Original Author: Martin Janssen, Synopsys, Inc., 2001-05-21.
sc_signal_inout_if< T > if_type
sc_signal(const char *name_, const value_type &initial_value_)
virtual void print(::std::ostream &=::std::cout) const
static const uint64 UINT64_ONE
sc_signal(const char *name_)