27 #ifndef SC_SIGNAL_PORTS_H
28 #define SC_SIGNAL_PORTS_H
37 #if ! defined( SC_DISABLE_VIRTUAL_BIND )
38 # define SC_VIRTUAL_ virtual
76 :
public sc_port<sc_signal_in_if<T>,1,SC_ONE_OR_MORE_BOUND>
154 delete m_change_finder_p;
164 { this->
bind( CCAST<const in_if_type&>( interface_ ) ); }
167 { this->
bind( interface_ ); }
176 { this->
bind( parent_ ); }
185 { this->
bind( parent_ ); }
193 {
return (*this)->default_event(); }
199 {
return (*this)->value_changed_event(); }
205 {
return (*this)->read(); }
208 {
return (*this)->read(); }
214 {
return (*this)->event(); }
221 if ( !m_change_finder_p )
226 return *m_change_finder_p;
236 virtual const char*
kind()
const
285 ::std::ostream& operator << ( ::std::ostream& os, const sc_in<T>& a )
287 return os << a->read();
300 if( m_traces != 0 ) {
301 for(
int i = 0; i < (int)m_traces->size(); ++ i ) {
303 in_if_type* iface = DCAST<in_if_type*>( this->get_interface() );
320 if( m_traces == 0 ) {
334 add_trace_internal(tf_, name_);
342 if( m_traces != 0 ) {
343 for(
int i = (
int)m_traces->size() - 1; i >= 0; -- i ) {
344 delete (*m_traces)[i];
367 in_port_type* in_parent = DCAST<in_port_type*>( &parent_ );
368 if( in_parent != 0 ) {
373 if( inout_parent != 0 ) {
390 public sc_port<sc_signal_in_if<bool>,1,SC_ONE_OR_MORE_BOUND>
414 m_neg_finder_p(0), m_pos_finder_p(0)
419 m_neg_finder_p(0), m_pos_finder_p(0)
424 m_change_finder_p(0), m_neg_finder_p(0), m_pos_finder_p(0)
429 m_change_finder_p(0), m_neg_finder_p(0), m_pos_finder_p(0)
434 m_change_finder_p(0), m_neg_finder_p(0), m_pos_finder_p(0)
439 m_change_finder_p(0), m_neg_finder_p(0), m_pos_finder_p(0)
444 m_change_finder_p(0), m_neg_finder_p(0), m_pos_finder_p(0)
449 m_change_finder_p(0), m_neg_finder_p(0), m_pos_finder_p(0)
454 m_change_finder_p(0), m_neg_finder_p(0), m_pos_finder_p(0)
460 m_change_finder_p(0), m_neg_finder_p(0), m_pos_finder_p(0)
466 m_change_finder_p(0), m_neg_finder_p(0), m_pos_finder_p(0)
475 delete m_change_finder_p;
476 delete m_neg_finder_p;
477 delete m_pos_finder_p;
487 { this->
bind( CCAST<const in_if_type&>( interface_ ) ); }
490 { this->
bind( interface_ ); }
499 { this->
bind( parent_ ); }
508 { this->
bind( parent_ ); }
516 {
return (*this)->default_event(); }
522 {
return (*this)->value_changed_event(); }
527 {
return (*this)->posedge_event(); }
532 {
return (*this)->negedge_event(); }
538 {
return (*this)->read(); }
541 {
return (*this)->read(); }
548 if ( !m_pos_finder_p )
551 *
this, &in_if_type::posedge_event );
553 return *m_pos_finder_p;
560 if ( !m_neg_finder_p )
563 *
this, &in_if_type::negedge_event );
565 return *m_neg_finder_p;
572 {
return (*this)->event(); }
577 {
return (*this)->posedge(); }
582 {
return (*this)->negedge(); }
588 if ( !m_change_finder_p )
593 return *m_change_finder_p;
603 virtual const char*
kind()
const
664 :
public sc_port<sc_signal_in_if<sc_dt::sc_logic>,1,SC_ONE_OR_MORE_BOUND>
688 m_change_finder_p(0), m_neg_finder_p(0), m_pos_finder_p(0)
693 m_change_finder_p(0), m_neg_finder_p(0), m_pos_finder_p(0)
698 m_change_finder_p(0), m_neg_finder_p(0), m_pos_finder_p(0)
703 m_change_finder_p(0), m_neg_finder_p(0), m_pos_finder_p(0)
708 m_change_finder_p(0), m_neg_finder_p(0), m_pos_finder_p(0)
713 m_change_finder_p(0), m_neg_finder_p(0), m_pos_finder_p(0)
718 m_change_finder_p(0), m_neg_finder_p(0), m_pos_finder_p(0)
723 m_change_finder_p(0), m_neg_finder_p(0), m_pos_finder_p(0)
728 m_change_finder_p(0), m_neg_finder_p(0), m_pos_finder_p(0)
733 m_change_finder_p(0), m_neg_finder_p(0), m_pos_finder_p(0)
742 delete m_change_finder_p;
743 delete m_neg_finder_p;
744 delete m_pos_finder_p;
754 { this->
bind( CCAST<const in_if_type&>( interface_ ) ); }
757 { this->
bind( interface_ ); }
766 { this->
bind( parent_ ); }
775 { this->
bind( parent_ ); }
783 {
return (*this)->default_event(); }
789 {
return (*this)->value_changed_event(); }
794 {
return (*this)->posedge_event(); }
799 {
return (*this)->negedge_event(); }
805 {
return (*this)->read(); }
808 {
return (*this)->read(); }
815 if ( !m_pos_finder_p )
818 *
this, &in_if_type::posedge_event );
820 return *m_pos_finder_p;
827 if ( !m_neg_finder_p )
830 *
this, &in_if_type::negedge_event );
832 return *m_neg_finder_p;
839 {
return (*this)->event(); }
844 {
return (*this)->posedge(); }
849 {
return (*this)->negedge(); }
855 if ( !m_change_finder_p )
860 return *m_change_finder_p;
870 virtual const char*
kind()
const
928 :
public sc_port<sc_signal_inout_if<T>,1,SC_ONE_OR_MORE_BOUND>
1000 {
return (*this)->default_event(); }
1006 {
return (*this)->value_changed_event(); }
1012 {
return (*this)->read(); }
1015 {
return (*this)->read(); }
1021 {
return (*this)->event(); }
1027 { (*this)->write( value_ ); }
1030 { (*this)->
write( value_ );
return *
this; }
1033 { (*this)->
write( interface_.
read() );
return *
this; }
1036 { (*this)->
write( port_->read() );
return *
this; }
1039 { (*this)->
write( port_->read() );
return *
this; }
1042 { (*this)->
write( port_->read() );
return *
this; }
1064 if ( !m_change_finder_p )
1069 return *m_change_finder_p;
1073 {
return "sc_inout"; }
1109 template<
typename T>
1110 ::std::ostream& operator << ( ::std::ostream& os, const sc_inout<T>& a )
1112 return os << a->read();
1124 delete m_change_finder_p;
1137 inout_if_type* iface = DCAST<inout_if_type*>( this->get_interface() );
1139 iface->
write( value_ );
1141 if( m_init_val == 0 ) {
1144 *m_init_val = value_;
1156 if( m_init_val != 0 ) {
1157 write( *m_init_val );
1161 if( m_traces != 0 ) {
1162 for(
int i = 0; i < (int)m_traces->size(); ++ i ) {
1164 in_if_type* iface = DCAST<in_if_type*>( this->get_interface() );
1181 if( m_traces == 0 ) {
1194 add_trace_internal(tf_, name_);
1202 if( m_traces != 0 ) {
1203 for(
int i = m_traces->size() - 1; i >= 0; -- i ) {
1204 delete (*m_traces)[i];
1220 public sc_port<sc_signal_inout_if<bool>,1,SC_ONE_OR_MORE_BOUND>
1243 m_change_finder_p(0), m_neg_finder_p(0), m_pos_finder_p(0)
1248 m_change_finder_p(0), m_neg_finder_p(0), m_pos_finder_p(0)
1253 m_change_finder_p(0), m_neg_finder_p(0), m_pos_finder_p(0)
1258 m_change_finder_p(0), m_neg_finder_p(0), m_pos_finder_p(0)
1263 m_change_finder_p(0), m_neg_finder_p(0), m_pos_finder_p(0)
1268 m_change_finder_p(0), m_neg_finder_p(0), m_pos_finder_p(0)
1273 m_change_finder_p(0), m_neg_finder_p(0), m_pos_finder_p(0)
1278 m_change_finder_p(0), m_neg_finder_p(0), m_pos_finder_p(0)
1292 {
return (*this)->default_event(); }
1298 {
return (*this)->value_changed_event(); }
1303 {
return (*this)->posedge_event(); }
1308 {
return (*this)->negedge_event(); }
1314 {
return (*this)->read(); }
1317 {
return (*this)->read(); }
1324 if ( !m_pos_finder_p )
1327 *
this, &in_if_type::posedge_event );
1329 return *m_pos_finder_p;
1336 if ( !m_neg_finder_p )
1339 *
this, &in_if_type::negedge_event );
1341 return *m_neg_finder_p;
1348 {
return (*this)->event(); }
1353 {
return (*this)->posedge(); }
1358 {
return (*this)->negedge(); }
1363 { (*this)->write( value_ ); }
1366 { (*this)->
write( value_ );
return *
this; }
1369 { (*this)->
write( interface_.
read() );
return *
this; }
1372 { (*this)->
write( port_->read() );
return *
this; }
1375 { (*this)->
write( port_->read() );
return *
this; }
1378 { (*this)->
write( port_->read() );
return *
this; }
1400 if ( !m_change_finder_p )
1405 return *m_change_finder_p;
1409 {
return "sc_inout"; }
1456 :
public sc_port<sc_signal_inout_if<sc_dt::sc_logic>,1,SC_ONE_OR_MORE_BOUND>
1479 m_change_finder_p(0), m_neg_finder_p(0), m_pos_finder_p(0)
1484 m_change_finder_p(0), m_neg_finder_p(0), m_pos_finder_p(0)
1489 m_change_finder_p(0), m_neg_finder_p(0), m_pos_finder_p(0)
1494 m_change_finder_p(0), m_neg_finder_p(0), m_pos_finder_p(0)
1499 m_change_finder_p(0), m_neg_finder_p(0), m_pos_finder_p(0)
1504 m_change_finder_p(0), m_neg_finder_p(0), m_pos_finder_p(0)
1509 m_change_finder_p(0), m_neg_finder_p(0), m_pos_finder_p(0)
1514 m_change_finder_p(0), m_neg_finder_p(0), m_pos_finder_p(0)
1528 {
return (*this)->default_event(); }
1534 {
return (*this)->value_changed_event(); }
1539 {
return (*this)->posedge_event(); }
1544 {
return (*this)->negedge_event(); }
1550 {
return (*this)->read(); }
1553 {
return (*this)->read(); }
1560 if ( !m_pos_finder_p )
1563 *
this, &in_if_type::posedge_event );
1565 return *m_pos_finder_p;
1572 if ( !m_neg_finder_p )
1575 *
this, &in_if_type::negedge_event );
1577 return *m_neg_finder_p;
1584 {
return (*this)->event(); }
1589 {
return (*this)->posedge(); }
1594 {
return (*this)->negedge(); }
1599 { (*this)->write( value_ ); }
1602 { (*this)->
write( value_ );
return *
this; }
1605 { (*this)->
write( interface_.
read() );
return *
this; }
1608 { (*this)->
write( port_->read() );
return *
this; }
1611 { (*this)->
write( port_->read() );
return *
this; }
1614 { (*this)->
write( port_->read() );
return *
this; }
1636 if ( !m_change_finder_p )
1641 return *m_change_finder_p;
1645 {
return "sc_inout"; }
1757 { (*this)->
write( value_ );
return *
this; }
1760 { (*this)->
write( interface_.
read() );
return *
this; }
1763 { (*this)->
write( port_->read() );
return *
this; }
1766 { (*this)->
write( port_->read() );
return *
this; }
1769 { (*this)->
write( port_->read() );
return *
this; }
1772 {
return "sc_out"; }
1796 iface = DCAST<const sc_signal_in_if<T>*>( port.
get_interface() );
1809 const std::string& name )
1814 iface =DCAST<const sc_signal_in_if<T>*>( port.
get_interface() );
sc_inout(const char *name_, inout_port_type &parent_)
sc_in(in_port_type &parent_)
sc_port< if_type, 1, SC_ONE_OR_MORE_BOUND > base_type
SC_VIRTUAL_ void bind(in_port_type &parent_)
virtual const char * kind() const
sc_event_finder & pos() const
SC_VIRTUAL_ void bind(const in_if_type &interface_)
virtual void end_of_elaboration()
sc_event_finder & pos() const
sc_out(inout_if_type &interface_)
virtual const char * kind() const
sc_inout(this_type &parent_)
this_type & operator=(const data_type &value_)
sc_port< if_type, 1, SC_ONE_OR_MORE_BOUND > base_type
sc_out(inout_port_type &parent_)
sc_inout(inout_port_type &parent_)
sc_inout(inout_if_type &interface_)
virtual void end_of_elaboration()
sc_trace_params_vec * m_traces
const sc_event & value_changed_event() const
void initialize(const in_if_type &interface_)
void operator()(const in_if_type &interface_)
std::vector< sc_trace_params * > sc_trace_params_vec
SC_VIRTUAL_ void bind(in_if_type &interface_)
sc_port< if_type, 1, SC_ONE_OR_MORE_BOUND > base_type
const data_type & read() const
const sc_event & posedge_event() const
sc_event_finder & value_changed() const
virtual const char * kind() const
sc_in(in_port_type &parent_)
virtual sc_interface * get_interface()
const sc_event & negedge_event() const
sc_event_finder & pos() const
sc_in(const char *name_, this_type &parent_)
sc_signal_in_if< data_type > if_type
SC_VIRTUAL_ void bind(inout_port_type &parent_)
SC_VIRTUAL_ void bind(const in_if_type &interface_)
sc_port< in_if_type, 1, SC_ONE_OR_MORE_BOUND > in_port_type
SC_VIRTUAL_ void bind(inout_port_type &parent_)
sc_port< in_if_type, 1, SC_ONE_OR_MORE_BOUND > in_port_type
const data_type & read() const
sc_trace_params_vec * m_traces
sc_signal_inout_if< data_type > inout_if_type
sc_inout(const char *name_, inout_port_type &parent_)
sc_event_finder & neg() const
SC_VIRTUAL_ void bind(in_if_type &interface_)
sc_inout(const char *name_, inout_if_type &interface_)
sc_signal_inout_if< data_type > if_type
void write(const data_type &value_)
sc_signal_in_if< data_type > if_type
sc_inout(inout_if_type &interface_)
const data_type & read() const
sc_event_finder & value_changed() const
sc_inout(const char *name_)
const sc_event & negedge_event() const
sc_event_finder & pos() const
SC_VIRTUAL_ void bind(base_port_type &parent_)
SC_VIRTUAL_ void bind(in_port_type &parent_)
sc_in(const char *name_, in_port_type &parent_)
const sc_event & posedge_event() const
const sc_event & posedge_event() const
sc_in< data_type > this_type
sc_inout(inout_port_type &parent_)
const sc_event & negedge_event() const
sc_trace_params_vec * m_traces
void initialize(const data_type &value_)
sc_signal_inout_if< data_type > if_type
sc_inout(this_type &parent_)
const sc_event & value_changed_event() const
this_type & operator=(const data_type &value_)
SC_VIRTUAL_ void bind(inout_port_type &parent_)
sc_inout< data_type > base_type
sc_in(this_type &parent_)
sc_port< if_type, 1, SC_ONE_OR_MORE_BOUND > base_type
sc_event_finder & value_changed() const
void add_trace_internal(sc_trace_file *, const std::string &) const
sc_port< if_type, 1, SC_ONE_OR_MORE_BOUND > base_type
sc_out(const char *name_, inout_if_type &interface_)
sc_in(const char *name_, in_port_type &parent_)
sc_event_finder & neg() const
sc_in(inout_port_type &parent_)
sc_in(this_type &parent_)
const sc_event & default_event() const
void add_trace(sc_trace_file *, const std::string &) const
sc_simcontext * sc_get_curr_simcontext()
const sc_event & default_event() const
const sc_signal_in_if< T > * get_interface(int iface_i) const
virtual const sc_event & value_changed_event() const =0
sc_in(const char *name_, const in_if_type &interface_)
sc_event_finder & neg() const
virtual const char * kind() const
virtual int vbind(sc_interface &)
sc_port< inout_if_type, 1, SC_ONE_OR_MORE_BOUND > inout_port_type
sc_event_finder & value_changed() const
sc_in(const char *name_, this_type &parent_)
sc_out(const char *name_, inout_port_type &parent_)
sc_in(const in_if_type &interface_)
sc_out< data_type > this_type
const sc_event & negedge_event() const
const sc_event & value_changed_event() const
sc_out(const char *name_, this_type &parent_)
sc_inout(const char *name_, this_type &parent_)
const sc_event & value_changed_event() const
const data_type & read() const
sc_inout(inout_port_type &parent_)
void remove_traces() const
sc_in< data_type > this_type
sc_in(const char *name_, inout_port_type &parent_)
sc_in(const in_if_type &interface_)
const sc_event & default_event() const
sc_port< inout_if_type, 1, SC_ONE_OR_MORE_BOUND > inout_port_type
sc_inout(const char *name_, this_type &parent_)
sc_in(const char *name_, inout_port_type &parent_)
const sc_event & posedge_event() const
sc_signal_in_if< data_type > in_if_type
base_type inout_port_type
const sc_event & default_event() const
sc_in(in_port_type &parent_)
base_type::port_type base_port_type
sc_inout(const char *name_, inout_port_type &parent_)
sc_signal_in_if< data_type > in_if_type
virtual const T & read() const =0
base_type inout_port_type
virtual const char * kind() const
virtual const char * kind() const
sc_inout(const char *name_)
sc_port< in_if_type, 1, SC_ONE_OR_MORE_BOUND > in_port_type
sc_signal_inout_if< data_type > if_type
SC_VIRTUAL_ void bind(base_port_type &parent_)
sc_in(const char *name_, this_type &parent_)
SC_VIRTUAL_ void bind(const in_if_type &interface_)
const data_type & read() const
void initialize(const in_if_type &interface_)
base_type::in_port_type in_port_type
sc_inout(this_type &parent_)
void add_trace_internal(sc_trace_file *, const std::string &) const
sc_trace_params(sc_trace_file *tf_, const std::string &name_)
sc_out(this_type &parent_)
sc_inout(const char *name_, inout_if_type &interface_)
sc_dt::sc_logic data_type
base_type::in_if_type in_if_type
sc_in(const in_if_type &interface_)
sc_inout(const char *name_)
sc_inout< data_type > this_type
base_type::inout_if_type inout_if_type
sc_signal_inout_if< data_type > inout_if_type
sc_port< inout_if_type, 1, SC_ONE_OR_MORE_BOUND > inout_port_type
virtual void write(const T &)=0
sc_in(const char *name_, const in_if_type &interface_)
virtual const char * kind() const
sc_port< if_type, 1, SC_ONE_OR_MORE_BOUND > base_type
sc_out(const char *name_)
sc_signal_in_if< data_type > in_if_type
base_type::inout_port_type inout_port_type
void remove_traces() const
sc_inout(inout_if_type &interface_)
SC_VIRTUAL_ void bind(base_port_type &parent_)
sc_trace_params_vec * m_traces
sc_dt::sc_logic data_type
base_type inout_port_type
const sc_event & value_changed_event() const
const data_type & read() const
sc_in(const char *name_, const in_if_type &interface_)
SC_VIRTUAL_ void bind(in_port_type &parent_)
sc_in(const char *name_, inout_port_type &parent_)
void add_trace(sc_trace_file *, const std::string &) const
sc_in< data_type > this_type
sc_signal_inout_if< data_type > inout_if_type
void write(const data_type &value_)
const sc_event & default_event() const
void sc_trace(sc_trace_file *tf, const sc_in< T > &port, const std::string &name)
sc_event_finder & value_changed() const
sc_inout(const char *name_, this_type &parent_)
void initialize(const in_if_type &interface_)
sc_inout< data_type > this_type
void bind(sc_interface &interface_)
const sc_event & default_event() const
sc_inout< data_type > this_type
void write(const data_type &value_)
void sc_deprecated_add_trace()
base_type::port_type base_port_type
sc_in(inout_port_type &parent_)
sc_trace_params_vec * m_traces
sc_event_finder & neg() const
sc_in(this_type &parent_)
virtual int vbind(sc_interface &)
base_type::port_type base_port_type
sc_inout(const char *name_, inout_if_type &interface_)
sc_in(const char *name_, in_port_type &parent_)
sc_trace_params_vec * m_traces
sc_signal_in_if< data_type > if_type
const sc_event & value_changed_event() const
SC_VIRTUAL_ void bind(in_if_type &interface_)
sc_in(inout_port_type &parent_)
sc_event_finder & value_changed() const