📄 scx_signal_unsigned.h
字号:
{ return simcontext()->delta_count() == m_event_delta + 1;}SC_TEMPLATE // Return this object's sc_dt::sc_biguint<W> object instance.inline const sc_dt::sc_biguint<W>& sc_signal<sc_dt::sc_biguint<W> >::base_read() const{ return *this;}SC_TEMPLATE // Return the value changed event, allocating it if necessary.inline const sc_event& sc_signal<sc_dt::sc_biguint<W> >::base_value_changed_event() const{ if ( !m_changed_event_p ) m_changed_event_p = new sc_event; return *m_changed_event_p;}SC_TEMPLATE // Write a const sc_dt::sc_signed& value to this object instance.inline void sc_signal<sc_dt::sc_biguint<W> >::base_write( const sc_dt::sc_signed& value ){# if defined(DEBUG_SYSTEMC) check_writer();# endif m_new_val = value; request_update();}SC_TEMPLATE // Write a const sc_dt::sc_unsigned& value to this object instance.inline void sc_signal<sc_dt::sc_biguint<W> >::base_write( const sc_dt::sc_unsigned& value ){# if defined(DEBUG_SYSTEMC) check_writer();# endif m_new_val = value; request_update();}SC_TEMPLATE // Write a sc_dt::int64 value to this object instance.inline void sc_signal<sc_dt::sc_biguint<W> >::base_write( sc_dt::int64 value ){# if defined(DEBUG_SYSTEMC) check_writer();# endif m_new_val = value; request_update();}SC_TEMPLATE // Write a sc_dt::uint64 value to this object instance.inline void sc_signal<sc_dt::sc_biguint<W> >::base_write( sc_dt::uint64 value ){# if defined(DEBUG_SYSTEMC) check_writer();# endif m_new_val = value; request_update();}//------------------------------------------------------------------------------//"sc_signal<sc_dt::sc_biguint<W> >::check_writer"//// This method checks to see if there is more than one writer for this // object instance by keeping track of the process performing the write.//------------------------------------------------------------------------------SC_TEMPLATEinline void sc_signal<sc_dt::sc_biguint<W> >::check_writer(){ sc_process_b* writer_p = sc_get_current_process_b(); if( m_writer_p == 0 ) { m_writer_p = writer_p; } else if( m_writer_p != writer_p ) { sc_signal_invalid_writer( name(), kind(), m_writer_p->name(), writer_p->name() ); }}//------------------------------------------------------------------------------//"sc_signal<sc_dt::sc_biguint<W> >::concat_set"//// These virtual methods allow value assignments to this object instance// from various sources. The position within the supplied source of the // low order bit for this object instance's value is low_i.// src = source value.// low_i = bit within src to serve as low order bit of this object // instance's value.//------------------------------------------------------------------------------SC_TEMPLATEinline void sc_signal<sc_dt::sc_biguint<W> >::concat_set(sc_dt::int64 src, int low_i){ if ( low_i < 64 ) { base_write(src >> low_i); } else { base_write( (sc_dt::int64)((src < 0 ) ? -1 : 0 )); } }SC_TEMPLATEinline void sc_signal<sc_dt::sc_biguint<W> >::concat_set( const sc_dt::sc_lv_base& src, int low_i){ sc_dt::sc_unsigned tmp(src.length()); tmp = src >> low_i; base_write( tmp );}SC_TEMPLATEinline void sc_signal<sc_dt::sc_biguint<W> >::concat_set( const sc_dt::sc_signed& src, int low_i){ base_write( (src >> low_i) );}SC_TEMPLATEinline void sc_signal<sc_dt::sc_biguint<W> >::concat_set( const sc_dt::sc_unsigned& src, int low_i){ base_write( (src >> low_i) );}SC_TEMPLATEinline void sc_signal<sc_dt::sc_biguint<W> >::concat_set(sc_dt::uint64 src, int low_i){ base_write( (sc_dt::uint64)(( low_i < 64 ) ? src >> low_i : 0));}SC_TEMPLATE // Return the default event for this object instance.inline const sc_event& sc_signal<sc_dt::sc_biguint<W> >::default_event() const { return base_value_changed_event(); }SC_TEMPLATE // Return true if a changed event happened in the last delta cycle.inline bool sc_signal<sc_dt::sc_biguint<W> >::event() const { return base_event(); }SC_TEMPLATE // Return a reference to the value of this object instance.inline const sc_dt::sc_biguint<W>& sc_signal<sc_dt::sc_biguint<W> >::get_data_ref() const { return *this; }SC_TEMPLATE // Return a pointer to this object instance.inline sc_signal<sc_dt::sc_biguint<W> >& sc_signal<sc_dt::sc_biguint<W> >::get_signal() { return *this; }SC_TEMPLATE // Return a kind value of "sc_signal".inline const char* sc_signal<sc_dt::sc_biguint<W> >::kind() const{ return "sc_signal";}//------------------------------------------------------------------------------//"sc_signal_uint::operator ()//// This operator returns a part selection of this object instance.// left = left-hand bit of the selection.// right = right-hand bit of the selection.//------------------------------------------------------------------------------SC_TEMPLATEinline sc_unsigned_sigref& sc_signal<sc_dt::sc_biguint<W> >::operator () (int left, int right){ sc_unsigned_sigref* result_p; // Value to return. result_p = sc_unsigned_sigref::m_pool.allocate(); result_p->initialize(this, left, right); return *result_p;}//------------------------------------------------------------------------------//"sc_signal_uint::operator []"//// This operator returns a bit selection of this object instance.// i = bit to be selected.//------------------------------------------------------------------------------SC_TEMPLATEinline sc_unsigned_sigref& sc_signal<sc_dt::sc_biguint<W> >::operator [] ( int bit ){ return operator () (bit,bit);}SC_TEMPLATEinline void sc_signal<sc_dt::sc_biguint<W> >::operator = ( const this_type& new_val ) { base_write( new_val ); }SC_TEMPLATE inline void sc_signal<sc_dt::sc_biguint<W> >::operator = ( const char* new_val ) { sc_dt::sc_biguint<W> tmp = new_val; m_new_val = tmp; request_update(); }SC_TEMPLATEinline void sc_signal<sc_dt::sc_biguint<W> >::operator = ( const sc_dt::sc_unsigned& new_val ) { base_write(new_val); }SC_TEMPLATEinline void sc_signal<sc_dt::sc_biguint<W> >::operator = ( sc_dt::uint64 new_val ) { base_write(new_val); }SC_TEMPLATEinline void sc_signal<sc_dt::sc_biguint<W> >::operator = ( sc_dt::int64 new_val ) { base_write(new_val); }SC_TEMPLATEinline void sc_signal<sc_dt::sc_biguint<W> >::operator = ( int new_val ) { base_write((sc_dt::int64)new_val); }SC_TEMPLATEinline void sc_signal<sc_dt::sc_biguint<W> >::operator = ( long new_val ) { base_write((sc_dt::int64)new_val); }SC_TEMPLATEinline void sc_signal<sc_dt::sc_biguint<W> >::operator = ( short new_val ) { base_write((sc_dt::int64)new_val); }SC_TEMPLATEinline void sc_signal<sc_dt::sc_biguint<W> >::operator = ( unsigned int new_val ) { base_write((sc_dt::int64)new_val); }SC_TEMPLATEinline void sc_signal<sc_dt::sc_biguint<W> >::operator = ( unsigned long new_val ) { base_write((sc_dt::int64)new_val); }SC_TEMPLATEinline void sc_signal<sc_dt::sc_biguint<W> >::operator = ( unsigned short new_val ) { base_write((sc_dt::int64)new_val); }SC_TEMPLATEtemplate<typename T>inline void sc_signal<sc_dt::sc_biguint<W> >::operator = ( const sc_dt::sc_generic_base<T>& new_val ){ sc_dt::sc_unsigned temp(W); new_val->to_sc_unsigned(temp); base_write(temp);}SC_TEMPLATEinline void sc_signal<sc_dt::sc_biguint<W> >::operator = ( const sc_dt::sc_signed& new_val ) { base_write(new_val); }SC_TEMPLATEinline void sc_signal<sc_dt::sc_biguint<W> >::operator = ( const sc_dt::sc_bv_base& new_val ) { base_write( (sc_dt::sc_biguint<W>)new_val ); }SC_TEMPLATEinline void sc_signal<sc_dt::sc_biguint<W> >::operator = ( const sc_dt::sc_lv_base& new_val ) { base_write( (sc_dt::sc_biguint<W>)new_val ); }SC_TEMPLATEinline sc_dt::sc_unsigned* sc_signal<sc_dt::sc_biguint<W> >::part_read_target() { return this; }SC_TEMPLATEinline const sc_dt::sc_biguint<W>& sc_signal<sc_dt::sc_biguint<W> >::read() const { return *this; }SC_TEMPLATE // Read a portion of a value.inline sc_dt::sc_unsigned sc_signal<sc_dt::sc_biguint<W> >::read_part( int left, int right ) const{ sc_dt::sc_unsigned tmp(left-right+1); tmp = (*(const sc_dt::sc_biguint<W>*)this)(left,right); return tmp;}SC_TEMPLATEinline void sc_signal<sc_dt::sc_biguint<W> >::register_port( sc_port_base& port_, const char* if_typename_ ){# ifdef DEBUG_SYSTEMC std::string nm( if_typename_ ); if( nm == typeid( sc_signal_inout_if<sc_dt::sc_biguint<W> > ).name() ) { if( m_output_p != 0 ) { sc_signal_invalid_writer( name(), kind(), m_output_p->name(), port_.name() ); } m_output_p = &port_; }# endif}SC_TEMPLATE // Autogenerated name object instance constructor.inline sc_signal<sc_dt::sc_biguint<W> >::sc_signal() : sc_prim_channel(sc_gen_unique_name( "signal" )), m_changed_event_p(0), m_new_val(W), m_output_p(0), m_writer_p(0){ }SC_TEMPLATE // Explicitly named object instance constructor.inline sc_signal<sc_dt::sc_biguint<W> >::sc_signal(const char* name_) : sc_prim_channel(name_), m_changed_event_p(0), m_new_val(W), m_output_p(0), m_writer_p(0){ }SC_TEMPLATE // Object instance destructor.inline sc_signal<sc_dt::sc_biguint<W> >::~sc_signal() { if ( m_changed_event_p ) delete m_changed_event_p;}SC_TEMPLATE // Update the current value from new value.inline void sc_signal<sc_dt::sc_biguint<W> >::update(){ if ( m_changed_event_p ) { if ( m_new_val != *this ) { m_changed_event_p->notify_delayed(); m_event_delta = simcontext()->delta_count(); } } sc_dt::sc_unsigned::operator = (m_new_val);}SC_TEMPLATE // Return the value changed event.inline const sc_event& sc_signal<sc_dt::sc_biguint<W> >::value_changed_event() const { return base_value_changed_event(); }SC_TEMPLATE // Write a sc_in<sc_dt::sc_biguint<W> > value to this object instance.inline void sc_signal<sc_dt::sc_biguint<W> >::write( const sc_in<sc_dt::sc_biguint<W> >& value ) { base_write( value ); }SC_TEMPLATE // Write a sc_inout<sc_dt::sc_biguint<W> > value to this object instance.inline void sc_signal<sc_dt::sc_biguint<W> >::write( const sc_inout<sc_dt::sc_biguint<W> >& value ) { base_write( value ); }SC_TEMPLATE // Write a sc_dt::sc_biguint<W> value to this object instance.inline void sc_signal<sc_dt::sc_biguint<W> >::write( const sc_dt::sc_biguint<W>& value ) { base_write( value); }SC_TEMPLATE // Write a portion of a value. If this is the first write in // a delta cycle we copy the existing value before setting the bits.inline void sc_signal<sc_dt::sc_biguint<W> >::write_part(sc_dt::int64 v, int left, int right) { m_new_val(left, right) = v; request_update();}SC_TEMPLATE // Select a portion of a value. inline sc_unsigned_sigref& sc_signal<sc_dt::sc_biguint<W> >::select_part( int left, int right){ sc_unsigned_sigref* result_p = sc_unsigned_sigref::m_pool.allocate(); result_p->initialize(DCAST<sc_unsigned_part_if*>(this), left, right); return *result_p;}SC_TEMPLATE // Write a portion of a value. If this is the first write in // a delta cycle we copy the existing value before setting the bits.inline void sc_signal<sc_dt::sc_biguint<W> >::write_part(sc_dt::uint64 v, int left, int right){ m_new_val(left, right) = v; request_update();}SC_TEMPLATE // Write a portion of a value. If this is the first write in // a delta cycle we copy the existing value before setting the bits.inline void sc_signal<sc_dt::sc_biguint<W> >::write_part( const sc_dt::sc_signed& v, int left, int right ) { m_new_val(left, right) = v;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -