112922Sgabeblack@google.com/*****************************************************************************
212922Sgabeblack@google.com
312922Sgabeblack@google.com  Licensed to Accellera Systems Initiative Inc. (Accellera) under one or
412922Sgabeblack@google.com  more contributor license agreements.  See the NOTICE file distributed
512922Sgabeblack@google.com  with this work for additional information regarding copyright ownership.
612922Sgabeblack@google.com  Accellera licenses this file to you under the Apache License, Version 2.0
712922Sgabeblack@google.com  (the "License"); you may not use this file except in compliance with the
812922Sgabeblack@google.com  License.  You may obtain a copy of the License at
912922Sgabeblack@google.com
1012922Sgabeblack@google.com    http://www.apache.org/licenses/LICENSE-2.0
1112922Sgabeblack@google.com
1212922Sgabeblack@google.com  Unless required by applicable law or agreed to in writing, software
1312922Sgabeblack@google.com  distributed under the License is distributed on an "AS IS" BASIS,
1412922Sgabeblack@google.com  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
1512922Sgabeblack@google.com  implied.  See the License for the specific language governing
1612922Sgabeblack@google.com  permissions and limitations under the License.
1712922Sgabeblack@google.com
1812922Sgabeblack@google.com *****************************************************************************/
1912922Sgabeblack@google.com
2012922Sgabeblack@google.com/*****************************************************************************
2112922Sgabeblack@google.com
2212922Sgabeblack@google.com  sc_signal_unsigned.cpp -- The sc_signal<sc_unsigned<W> > implementations.
2312922Sgabeblack@google.com
2412922Sgabeblack@google.com  Original Author: Andy Goodrich, Forte Design Systems, 2002-10-22
2512922Sgabeblack@google.com
2612922Sgabeblack@google.com *****************************************************************************/
2712922Sgabeblack@google.com
2812922Sgabeblack@google.com/*****************************************************************************
2912922Sgabeblack@google.com
3012922Sgabeblack@google.com  MODIFICATION LOG - modifiers, enter your name, affiliation, date and
3112922Sgabeblack@google.com  changes you are making here.
3212922Sgabeblack@google.com
3312922Sgabeblack@google.com      Name, Affiliation, Date:
3412922Sgabeblack@google.com  Description of Modification:
3512922Sgabeblack@google.com
3612922Sgabeblack@google.com *****************************************************************************/
3712922Sgabeblack@google.com
3812922Sgabeblack@google.com/*
3912922Sgabeblack@google.com$Log: scx_signal_unsigned.h,v $
4012922Sgabeblack@google.comRevision 1.1  2011/08/15 17:31:11  acg
4112922Sgabeblack@google.com Andy Goodrich: moved specialized signals from examples to this tree.
4212922Sgabeblack@google.com
4312922Sgabeblack@google.comRevision 1.2  2011/08/15 16:43:24  acg
4412922Sgabeblack@google.com Torsten Maehne: changes to remove unused argument warnings.
4512922Sgabeblack@google.com
4612922Sgabeblack@google.comRevision 1.1.1.1  2006/12/15 20:20:03  acg
4712922Sgabeblack@google.comSystemC 2.3
4812922Sgabeblack@google.com
4912922Sgabeblack@google.comRevision 1.2  2005/12/26 20:11:14  acg
5012922Sgabeblack@google.comFixed up copyright.
5112922Sgabeblack@google.com
5212922Sgabeblack@google.comRevision 1.1.1.1  2005/12/19 23:16:42  acg
5312922Sgabeblack@google.comFirst check in of SystemC 2.1 into its own archive.
5412922Sgabeblack@google.com
5512922Sgabeblack@google.comRevision 1.17  2005/09/15 23:01:52  acg
5612922Sgabeblack@google.comAdded std:: prefix to appropriate methods and types to get around
5712922Sgabeblack@google.comissues with the Edison Front End.
5812922Sgabeblack@google.com
5912922Sgabeblack@google.comRevision 1.16  2005/05/03 19:52:26  acg
6012922Sgabeblack@google.comGet proper header locations on includes.
6112922Sgabeblack@google.com
6212922Sgabeblack@google.comRevision 1.15  2005/05/03 19:50:20  acg
6312922Sgabeblack@google.comName space version.
6412922Sgabeblack@google.com
6512922Sgabeblack@google.comRevision 1.12  2005/04/11 19:05:36  acg
6612922Sgabeblack@google.comChange to sc_clock for Microsoft VCC 6.0. Changes for namespaces
6712922Sgabeblack@google.com
6812922Sgabeblack@google.comRevision 1.11  2005/04/03 22:52:52  acg
6912922Sgabeblack@google.comNamespace changes.
7012922Sgabeblack@google.com
7112922Sgabeblack@google.comRevision 1.10  2005/03/21 22:31:33  acg
7212922Sgabeblack@google.comChanges to sc_core namespace.
7312922Sgabeblack@google.com
7412922Sgabeblack@google.comRevision 1.9  2004/09/27 21:01:59  acg
7512922Sgabeblack@google.comAndy Goodrich - Forte Design Systems, Inc.
7612922Sgabeblack@google.com   - This is specialized signal support that allows better use of signals
7712922Sgabeblack@google.com     and ports whose target value is a SystemC native type.
7812922Sgabeblack@google.com
7912922Sgabeblack@google.com*/
8012922Sgabeblack@google.com
8112922Sgabeblack@google.com
8212922Sgabeblack@google.com
8312922Sgabeblack@google.com#include <systemc>
8412922Sgabeblack@google.com#include <typeinfo>
8512922Sgabeblack@google.com
8612922Sgabeblack@google.com/*****************************************************************************
8712922Sgabeblack@google.com
8812922Sgabeblack@google.com  sc_signal_unsigned.h -- The sc_signal<sc_dt::sc_biguint<W> > definitions.
8912922Sgabeblack@google.com
9012922Sgabeblack@google.com  Original Author: Andy Goodrich, Forte Design Systems, 2002-10-22
9112922Sgabeblack@google.com
9212922Sgabeblack@google.com *****************************************************************************/
9312922Sgabeblack@google.com
9412922Sgabeblack@google.com/*****************************************************************************
9512922Sgabeblack@google.com
9612922Sgabeblack@google.com  MODIFICATION LOG - modifiers, enter your name, affiliation, date and
9712922Sgabeblack@google.com  changes you are making here.
9812922Sgabeblack@google.com
9912922Sgabeblack@google.com      Name, Affiliation, Date:
10012922Sgabeblack@google.com  Description of Modification:
10112922Sgabeblack@google.com
10212922Sgabeblack@google.com *****************************************************************************/
10312922Sgabeblack@google.com
10412922Sgabeblack@google.com/*
10512922Sgabeblack@google.com$Log: scx_signal_unsigned.h,v $
10612922Sgabeblack@google.comRevision 1.1  2011/08/15 17:31:11  acg
10712922Sgabeblack@google.com Andy Goodrich: moved specialized signals from examples to this tree.
10812922Sgabeblack@google.com
10912922Sgabeblack@google.comRevision 1.3  2011/08/15 16:43:24  acg
11012922Sgabeblack@google.com Torsten Maehne: changes to remove unused argument warnings.
11112922Sgabeblack@google.com
11212922Sgabeblack@google.comRevision 1.2  2011/06/28 21:23:02  acg
11312922Sgabeblack@google.com Andy Goodrich: merging of SCV tree.
11412922Sgabeblack@google.com
11512922Sgabeblack@google.comRevision 1.1.1.1  2006/12/15 20:20:03  acg
11612922Sgabeblack@google.comSystemC 2.3
11712922Sgabeblack@google.com
11812922Sgabeblack@google.comRevision 1.4  2006/10/23 19:40:36  acg
11912922Sgabeblack@google.com Andy Goodrich: added an explicit dynamic cast to keep gcc 4.x happy.
12012922Sgabeblack@google.com
12112922Sgabeblack@google.comRevision 1.3  2006/03/21 01:31:49  acg
12212922Sgabeblack@google.com Andy Goodrich: changed over to sc_get_current_process_b() from
12312922Sgabeblack@google.com sc_get_current_process_base() since the function's name changed.
12412922Sgabeblack@google.com
12512922Sgabeblack@google.comRevision 1.2  2005/12/26 20:11:14  acg
12612922Sgabeblack@google.comFixed up copyright.
12712922Sgabeblack@google.com
12812922Sgabeblack@google.comRevision 1.1.1.1  2005/12/19 23:16:42  acg
12912922Sgabeblack@google.comFirst check in of SystemC 2.1 into its own archive.
13012922Sgabeblack@google.com
13112922Sgabeblack@google.comRevision 1.28  2005/09/15 23:01:52  acg
13212922Sgabeblack@google.comAdded std:: prefix to appropriate methods and types to get around
13312922Sgabeblack@google.comissues with the Edison Front End.
13412922Sgabeblack@google.com
13512922Sgabeblack@google.comRevision 1.27  2005/07/30 03:44:11  acg
13612922Sgabeblack@google.comChanges from 2.1.
13712922Sgabeblack@google.com
13812922Sgabeblack@google.comRevision 1.26  2005/05/09 17:17:12  acg
13912922Sgabeblack@google.comChanges from 2.1.
14012922Sgabeblack@google.com
14112922Sgabeblack@google.comRevision 1.25  2005/05/08 19:04:06  acg
14212922Sgabeblack@google.comFix bug in concat_set(int64,off). Other changes from 2.1 examples usage.
14312922Sgabeblack@google.com
14412922Sgabeblack@google.comRevision 1.24  2005/05/03 19:50:20  acg
14512922Sgabeblack@google.comName space version.
14612922Sgabeblack@google.com
14712922Sgabeblack@google.comRevision 1.22  2005/03/21 22:31:33  acg
14812922Sgabeblack@google.comChanges to sc_core namespace.
14912922Sgabeblack@google.com
15012922Sgabeblack@google.comRevision 1.21  2005/01/10 17:51:58  acg
15112922Sgabeblack@google.comImprovements.
15212922Sgabeblack@google.com
15312922Sgabeblack@google.comRevision 1.20  2004/11/09 00:11:27  acg
15412922Sgabeblack@google.comAdded support for sc_generic_base<T> in place of sc_concatref. sc_concatref
15512922Sgabeblack@google.comnow is derived from sc_generic_base<sc_concatref>.
15612922Sgabeblack@google.com
15712922Sgabeblack@google.comRevision 1.19  2004/09/27 21:01:59  acg
15812922Sgabeblack@google.comAndy Goodrich - Forte Design Systems, Inc.
15912922Sgabeblack@google.com   - This is specialized signal support that allows better use of signals
16012922Sgabeblack@google.com     and ports whose target value is a SystemC native type.
16112922Sgabeblack@google.com
16212922Sgabeblack@google.com*/
16312922Sgabeblack@google.com
16412922Sgabeblack@google.com
16512922Sgabeblack@google.com#if !defined(SC_SIGNAL_UNSIGNED_H)
16612922Sgabeblack@google.com#define SC_SIGNAL_UNSIGNED_H
16712922Sgabeblack@google.com
16812922Sgabeblack@google.com#if ( !defined(_MSC_VER) || _MSC_VER > 1200 )
16912922Sgabeblack@google.com#    define SC_TEMPLATE template<int W>
17012922Sgabeblack@google.com#else
17112922Sgabeblack@google.com#    define SC_TEMPLATE template<> template<int W>
17212922Sgabeblack@google.com#endif
17312922Sgabeblack@google.com
17412922Sgabeblack@google.com
17512922Sgabeblack@google.com// FORWARD REFERENCES AND USINGS:
17612922Sgabeblack@google.com
17712922Sgabeblack@google.comusing sc_dt::sc_signed;
17812922Sgabeblack@google.comusing sc_dt::int64;
17912922Sgabeblack@google.comusing sc_dt::uint64;
18012922Sgabeblack@google.com
18112922Sgabeblack@google.comnamespace sc_core {
18212922Sgabeblack@google.com
18312922Sgabeblack@google.comclass sc_unsigned_sigref;
18412922Sgabeblack@google.com
18512922Sgabeblack@google.com//==============================================================================
18612922Sgabeblack@google.com// CLASS sc_unsigned_part_if
18712922Sgabeblack@google.com//
18812922Sgabeblack@google.com// This class provides generic access to part selections for signals whose
18912922Sgabeblack@google.com// data type is sc_dt::sc_biguint<W>. This class serves as the base class for the
19012922Sgabeblack@google.com// sc_dt::sc_biguint<W> specialization of the sc_signal_in_if<T> class. The methods
19112922Sgabeblack@google.com// in this class may be over-ridden individually, those that are not overridden
19212922Sgabeblack@google.com// will produce an error message when called. The methods are used by the
19312922Sgabeblack@google.com// sc_unsigned_sigref class.
19412922Sgabeblack@google.com//
19512922Sgabeblack@google.com// Notes:
19612922Sgabeblack@google.com//   (1) Descriptions of the methods and operators in this class appear with
19712922Sgabeblack@google.com//       their implementations in sc_signal<sc_dt::sc_biguint<W> >.
19812922Sgabeblack@google.com//==============================================================================
19912922Sgabeblack@google.comclass sc_unsigned_part_if : virtual public sc_interface {
20012922Sgabeblack@google.com  protected:
20112922Sgabeblack@google.com	// constructor:
20212922Sgabeblack@google.com  	sc_unsigned_part_if() {}
20312922Sgabeblack@google.com
20412922Sgabeblack@google.com  public:
20512922Sgabeblack@google.com    // perform a part read.
20612922Sgabeblack@google.com	virtual sc_dt::sc_unsigned* part_read_target();
20712922Sgabeblack@google.com  	virtual sc_dt::sc_unsigned read_part( int left, int right ) const;
20812922Sgabeblack@google.com
20912922Sgabeblack@google.com    // perform a part write.
21012922Sgabeblack@google.com	virtual sc_unsigned_sigref& select_part( int left, int right );
21112922Sgabeblack@google.com    virtual void write_part( sc_dt::int64 v, int left, int right );
21212922Sgabeblack@google.com    virtual void write_part( sc_dt::uint64 v, int left, int right );
21312922Sgabeblack@google.com    virtual void write_part( const sc_dt::sc_signed& v, int left, int right );
21412922Sgabeblack@google.com    virtual void write_part( const sc_dt::sc_unsigned& v, int left, int right );
21512922Sgabeblack@google.com
21612922Sgabeblack@google.com
21712922Sgabeblack@google.com  private:
21812922Sgabeblack@google.com  	sc_unsigned_part_if( const sc_unsigned_part_if& );
21912922Sgabeblack@google.com  	sc_unsigned_part_if& operator = ( const sc_unsigned_part_if& );
22012922Sgabeblack@google.com};
22112922Sgabeblack@google.com
22212922Sgabeblack@google.com
22312922Sgabeblack@google.com//==============================================================================
22412922Sgabeblack@google.com// CLASS sc_signal_in_if<sc_dt::sc_biguint<W> >
22512922Sgabeblack@google.com//
22612922Sgabeblack@google.com// This is the class specializations for the sc_signal_in_if<T> class to
22712922Sgabeblack@google.com// provide additional features for sc_signal instances whose template is
22812922Sgabeblack@google.com// sc_dt::sc_biguint<W>, including part access.
22912922Sgabeblack@google.com//
23012922Sgabeblack@google.com// Notes:
23112922Sgabeblack@google.com//   (1) Descriptions of the methods and operators in this class appear with
23212922Sgabeblack@google.com//       their implementations in sc_signal<sc_dt::sc_biguint<W> >.
23312922Sgabeblack@google.com//==============================================================================
23412922Sgabeblack@google.comtemplate< int W >
23512922Sgabeblack@google.comclass sc_signal_in_if<sc_dt::sc_biguint<W> > : public sc_unsigned_part_if {
23612922Sgabeblack@google.com	friend class sc_unsigned_sigref;
23712922Sgabeblack@google.com  public:
23812922Sgabeblack@google.com    typedef sc_signal_in_if<sc_dt::sc_biguint<W> > this_type;
23912922Sgabeblack@google.com
24012922Sgabeblack@google.com    // get the value changed event
24112922Sgabeblack@google.com    virtual const sc_event& value_changed_event() const = 0;
24212922Sgabeblack@google.com
24312922Sgabeblack@google.com
24412922Sgabeblack@google.com    // read the current value
24512922Sgabeblack@google.com    virtual const sc_dt::sc_biguint<W>& read() const = 0;
24612922Sgabeblack@google.com
24712922Sgabeblack@google.com    // get a reference to the current value (for tracing)
24812922Sgabeblack@google.com    virtual const sc_dt::sc_biguint<W>& get_data_ref() const = 0;
24912922Sgabeblack@google.com
25012922Sgabeblack@google.com
25112922Sgabeblack@google.com    // was there a value changed event?
25212922Sgabeblack@google.com    virtual bool event() const = 0;
25312922Sgabeblack@google.com
25412922Sgabeblack@google.com  protected:
25512922Sgabeblack@google.com    // constructor
25612922Sgabeblack@google.com    sc_signal_in_if()
25712922Sgabeblack@google.com    {}
25812922Sgabeblack@google.com
25912922Sgabeblack@google.com  private: // disabled
26012922Sgabeblack@google.com    sc_signal_in_if( const this_type& );
26112922Sgabeblack@google.com    this_type& operator = ( const this_type& );
26212922Sgabeblack@google.com};
26312922Sgabeblack@google.com
26412922Sgabeblack@google.com//=============================================================================
26512922Sgabeblack@google.com//  CLASS : sc_unsigned_sigref
26612922Sgabeblack@google.com//
26712922Sgabeblack@google.com//  Proxy class for sc_signal_uint bit and part selection.
26812922Sgabeblack@google.com//=============================================================================
26912922Sgabeblack@google.comclass sc_unsigned_sigref : public sc_dt::sc_unsigned_subref_r
27012922Sgabeblack@google.com{
27112922Sgabeblack@google.com  public:
27212922Sgabeblack@google.com    sc_unsigned_sigref() : sc_dt::sc_unsigned_subref_r() {}
27312922Sgabeblack@google.com    virtual ~sc_unsigned_sigref() {}
27412922Sgabeblack@google.com    virtual void concat_set(sc_dt::int64 src, int low_i);
27512922Sgabeblack@google.com    virtual void concat_set(const sc_dt::sc_signed& src, int low_i);
27612922Sgabeblack@google.com    virtual void concat_set(const sc_dt::sc_unsigned& src, int low_i);
27712922Sgabeblack@google.com    virtual void concat_set(const sc_dt::sc_lv_base& src, int low_i);
27812922Sgabeblack@google.com    virtual void concat_set(sc_dt::uint64 src, int low_i);
27912922Sgabeblack@google.com
28012922Sgabeblack@google.com  public:
28112922Sgabeblack@google.com    inline void initialize( sc_unsigned_part_if* if_p, int left_, int right_ );
28212922Sgabeblack@google.com
28312922Sgabeblack@google.com  public:
28412922Sgabeblack@google.com    inline void operator = ( sc_dt::uint64 v );
28512922Sgabeblack@google.com    inline void operator = ( const char* v );
28612922Sgabeblack@google.com    inline void operator = ( unsigned long v );
28712922Sgabeblack@google.com    inline void operator = ( long v );
28812922Sgabeblack@google.com    inline void operator = ( unsigned int v );
28912922Sgabeblack@google.com    inline void operator = ( int v );
29012922Sgabeblack@google.com    inline void operator = ( sc_dt::int64 v );
29112922Sgabeblack@google.com    inline void operator = ( double v );
29212922Sgabeblack@google.com    inline void operator = ( const sc_unsigned_sigref& v );
29312922Sgabeblack@google.com    template<typename T>
29412922Sgabeblack@google.com    inline void operator = ( const sc_dt::sc_generic_base<T>& v );
29512922Sgabeblack@google.com    inline void operator = ( const sc_dt::sc_signed& v );
29612922Sgabeblack@google.com    inline void operator = ( const sc_dt::sc_unsigned& v );
29712922Sgabeblack@google.com    inline void operator = ( const sc_dt::sc_bv_base& v );
29812922Sgabeblack@google.com    inline void operator = ( const sc_dt::sc_lv_base& v );
29912922Sgabeblack@google.com
30012922Sgabeblack@google.com  public:
30112922Sgabeblack@google.com    static sc_vpool<sc_unsigned_sigref> m_pool; // Pool of objects to use.
30212922Sgabeblack@google.com
30312922Sgabeblack@google.com  protected:
30412922Sgabeblack@google.com    sc_unsigned_part_if*                m_if_p; // Target for selection.
30512922Sgabeblack@google.com
30612922Sgabeblack@google.com  private:
30712922Sgabeblack@google.com
30812922Sgabeblack@google.com    // disabled
30912922Sgabeblack@google.com    sc_unsigned_sigref( const sc_unsigned_sigref& a );
31012922Sgabeblack@google.com};
31112922Sgabeblack@google.com
31212922Sgabeblack@google.com
31312922Sgabeblack@google.com//==============================================================================
31412922Sgabeblack@google.com// CLASS sc_signal<sc_dt::sc_biguint<W> >
31512922Sgabeblack@google.com//
31612922Sgabeblack@google.com// This class implements a signal whose value acts like an sc_dt::sc_biguint<W> data
31712922Sgabeblack@google.com// value. This class is a specialization of the generic sc_signal class to
31812922Sgabeblack@google.com// implement tailored support for the sc_dt::sc_biguint<W> class.
31912922Sgabeblack@google.com//
32012922Sgabeblack@google.com// Notes:
32112922Sgabeblack@google.com//   (1) Descriptions of the methods and operators in this class appear with
32212922Sgabeblack@google.com//       their implementations.
32312922Sgabeblack@google.com//==============================================================================
32412922Sgabeblack@google.comSC_TEMPLATE
32512922Sgabeblack@google.comclass sc_signal<sc_dt::sc_biguint<W> > :
32612922Sgabeblack@google.com    public sc_dt::sc_biguint<W>,
32712922Sgabeblack@google.com	public sc_prim_channel,
32812922Sgabeblack@google.com    public sc_signal_inout_if<sc_dt::sc_biguint<W> >
32912922Sgabeblack@google.com{
33012922Sgabeblack@google.com  public: // typedefs
33112922Sgabeblack@google.com    typedef sc_signal<sc_dt::sc_biguint<W> > this_type;
33212922Sgabeblack@google.com
33312922Sgabeblack@google.com  public: // constructors and destructor:
33412922Sgabeblack@google.com    inline sc_signal();
33512922Sgabeblack@google.com    explicit inline sc_signal(const char* name_);
33612922Sgabeblack@google.com    virtual inline ~sc_signal();
33712922Sgabeblack@google.com
33812922Sgabeblack@google.com  public: // base methods:
33912922Sgabeblack@google.com    inline bool base_event() const;
34012922Sgabeblack@google.com    inline const sc_dt::sc_biguint<W>& base_read() const;
34112922Sgabeblack@google.com    inline const sc_event& base_value_changed_event() const;
34212922Sgabeblack@google.com    inline void base_write( sc_dt::int64 value );
34312922Sgabeblack@google.com    inline void base_write( sc_dt::uint64 value );
34412922Sgabeblack@google.com    inline void base_write( const sc_dt::sc_signed& value );
34512922Sgabeblack@google.com    inline void base_write( const sc_dt::sc_unsigned& value );
34612922Sgabeblack@google.com
34712922Sgabeblack@google.com  public: // sc_prim_channel virtual methods:
34812922Sgabeblack@google.com    virtual inline const char* kind() const;
34912922Sgabeblack@google.com    virtual inline void update();
35012922Sgabeblack@google.com
35112922Sgabeblack@google.com  public: // sc_interface virtual methods:
35212922Sgabeblack@google.com    virtual inline const sc_event& default_event() const;
35312922Sgabeblack@google.com    virtual inline void register_port(
35412922Sgabeblack@google.com		sc_port_base& port_, const char* if_typename_ );
35512922Sgabeblack@google.com
35612922Sgabeblack@google.com  public: // sc_unsigned_channel virtual methods:
35712922Sgabeblack@google.com    virtual inline sc_dt::sc_unsigned* part_read_target();
35812922Sgabeblack@google.com    virtual inline sc_dt::sc_unsigned read_part(int left, int right) const;
35912922Sgabeblack@google.com	virtual sc_unsigned_sigref& select_part( int left, int right );
36012922Sgabeblack@google.com	virtual inline void write_part( sc_dt::int64 v, int left, int right );
36112922Sgabeblack@google.com	virtual inline void write_part( sc_dt::uint64 v, int left, int right );
36212922Sgabeblack@google.com	virtual inline void write_part( const sc_dt::sc_signed& v, int left, int right );
36312922Sgabeblack@google.com	virtual inline void write_part(const sc_dt::sc_unsigned& v, int left, int right);
36412922Sgabeblack@google.com
36512922Sgabeblack@google.com  public: // interface virtual methods:
36612922Sgabeblack@google.com    virtual inline bool event() const;
36712922Sgabeblack@google.com    virtual inline const sc_dt::sc_biguint<W>& get_data_ref() const;
36812922Sgabeblack@google.com    virtual inline sc_signal<sc_dt::sc_biguint<W> >& get_signal();
36912922Sgabeblack@google.com    virtual inline const sc_dt::sc_biguint<W>& read() const;
37012922Sgabeblack@google.com    virtual inline const sc_event& value_changed_event() const;
37112922Sgabeblack@google.com    virtual inline void write( const sc_in<sc_dt::sc_biguint<W> >& value );
37212922Sgabeblack@google.com    virtual inline void write( const sc_inout<sc_dt::sc_biguint<W> >& value );
37312922Sgabeblack@google.com    virtual inline void write( const sc_dt::sc_biguint<W>& value );
37412922Sgabeblack@google.com
37512922Sgabeblack@google.com  public: // part selections:
37612922Sgabeblack@google.com  	inline sc_unsigned_sigref& operator () ( int left, int right );
37712922Sgabeblack@google.com	// #### Need to add range() and bit()!
37812922Sgabeblack@google.com  	inline sc_unsigned_sigref& operator [] ( int bit );
37912922Sgabeblack@google.com
38012922Sgabeblack@google.com  public: // operators:
38112922Sgabeblack@google.com    inline void operator = ( const this_type& new_val );
38212922Sgabeblack@google.com    inline void operator = ( const char* new_val );
38312922Sgabeblack@google.com    inline void operator = ( sc_dt::uint64 new_val );
38412922Sgabeblack@google.com    inline void operator = ( sc_dt::int64 new_val );
38512922Sgabeblack@google.com    inline void operator = ( int new_val );
38612922Sgabeblack@google.com    inline void operator = ( long new_val );
38712922Sgabeblack@google.com    inline void operator = ( short new_val );
38812922Sgabeblack@google.com    inline void operator = ( unsigned int new_val );
38912922Sgabeblack@google.com    inline void operator = ( unsigned long new_val );
39012922Sgabeblack@google.com    inline void operator = ( unsigned short new_val );
39112922Sgabeblack@google.com    template<typename T>
39212922Sgabeblack@google.com    inline void operator = ( const sc_dt::sc_generic_base<T>& new_val );
39312922Sgabeblack@google.com    inline void operator = ( const sc_dt::sc_signed& new_val );
39412922Sgabeblack@google.com    inline void operator = ( const sc_dt::sc_unsigned& new_val );
39512922Sgabeblack@google.com    inline void operator = ( const sc_dt::sc_bv_base& new_val );
39612922Sgabeblack@google.com    inline void operator = ( const sc_dt::sc_lv_base& new_val );
39712922Sgabeblack@google.com
39812922Sgabeblack@google.com    // concatenation methods (we inherit length and gets from sc_dt::sc_biguint<W>):
39912922Sgabeblack@google.com
40012922Sgabeblack@google.com    virtual inline void concat_set(sc_dt::int64 src, int low_i);
40112922Sgabeblack@google.com    virtual inline void concat_set(const sc_dt::sc_lv_base& src, int low_i);
40212922Sgabeblack@google.com    virtual inline void concat_set(const sc_dt::sc_signed& src, int low_i);
40312922Sgabeblack@google.com    virtual inline void concat_set(const sc_dt::sc_unsigned& src, int low_i);
40412922Sgabeblack@google.com    virtual inline void concat_set(sc_dt::uint64 src, int low_i);
40512922Sgabeblack@google.com
40612922Sgabeblack@google.com  protected: // debugging methods:
40712922Sgabeblack@google.com    // #### void check_port();
40812922Sgabeblack@google.com	void check_writer();
40912922Sgabeblack@google.com
41012922Sgabeblack@google.com  private: // Disabled operations that sc_dt::sc_biguint<W> supports:
41112922Sgabeblack@google.com    sc_dt::sc_unsigned& operator ++ ();          // prefix
41212922Sgabeblack@google.com    const sc_dt::sc_unsigned& operator ++ (int); // postfix
41312922Sgabeblack@google.com    sc_dt::sc_unsigned& operator -- ();          // prefix
41412922Sgabeblack@google.com    const sc_dt::sc_unsigned& operator -- (int); // postfix
41512922Sgabeblack@google.com    sc_dt::sc_unsigned& operator += (const sc_dt::sc_signed&    );
41612922Sgabeblack@google.com    sc_dt::sc_unsigned& operator += (const sc_dt::sc_unsigned&  );
41712922Sgabeblack@google.com    sc_dt::sc_unsigned& operator += (sc_dt::int64               );
41812922Sgabeblack@google.com    sc_dt::sc_unsigned& operator += (sc_dt::uint64              );
41912922Sgabeblack@google.com    sc_dt::sc_unsigned& operator += (long                );
42012922Sgabeblack@google.com    sc_dt::sc_unsigned& operator += (unsigned long       );
42112922Sgabeblack@google.com    sc_dt::sc_unsigned& operator += (int                 );
42212922Sgabeblack@google.com    sc_dt::sc_unsigned& operator += (unsigned int        );
42312922Sgabeblack@google.com    sc_dt::sc_unsigned& operator -= (const sc_dt::sc_signed&    );
42412922Sgabeblack@google.com    sc_dt::sc_unsigned& operator -= (const sc_dt::sc_unsigned&  );
42512922Sgabeblack@google.com    sc_dt::sc_unsigned& operator -= (sc_dt::int64               );
42612922Sgabeblack@google.com    sc_dt::sc_unsigned& operator -= (sc_dt::uint64              );
42712922Sgabeblack@google.com    sc_dt::sc_unsigned& operator -= (long                );
42812922Sgabeblack@google.com    sc_dt::sc_unsigned& operator -= (unsigned long       );
42912922Sgabeblack@google.com    sc_dt::sc_unsigned& operator -= (int                 );
43012922Sgabeblack@google.com    sc_dt::sc_unsigned& operator -= (unsigned int        );
43112922Sgabeblack@google.com    sc_dt::sc_unsigned& operator *= (const sc_dt::sc_signed&    );
43212922Sgabeblack@google.com    sc_dt::sc_unsigned& operator *= (const sc_dt::sc_unsigned&  );
43312922Sgabeblack@google.com    sc_dt::sc_unsigned& operator *= (sc_dt::int64               );
43412922Sgabeblack@google.com    sc_dt::sc_unsigned& operator *= (sc_dt::uint64              );
43512922Sgabeblack@google.com    sc_dt::sc_unsigned& operator *= (long                );
43612922Sgabeblack@google.com    sc_dt::sc_unsigned& operator *= (unsigned long       );
43712922Sgabeblack@google.com    sc_dt::sc_unsigned& operator *= (int                 );
43812922Sgabeblack@google.com    sc_dt::sc_unsigned& operator *= (unsigned int        );
43912922Sgabeblack@google.com    sc_dt::sc_unsigned& operator /= (const sc_dt::sc_signed&    );
44012922Sgabeblack@google.com    sc_dt::sc_unsigned& operator /= (const sc_dt::sc_unsigned&  );
44112922Sgabeblack@google.com    sc_dt::sc_unsigned& operator /= (sc_dt::int64               );
44212922Sgabeblack@google.com    sc_dt::sc_unsigned& operator /= (sc_dt::uint64              );
44312922Sgabeblack@google.com    sc_dt::sc_unsigned& operator /= (long                );
44412922Sgabeblack@google.com    sc_dt::sc_unsigned& operator /= (unsigned long       );
44512922Sgabeblack@google.com    sc_dt::sc_unsigned& operator /= (int                 );
44612922Sgabeblack@google.com    sc_dt::sc_unsigned& operator /= (unsigned int        );
44712922Sgabeblack@google.com    sc_dt::sc_unsigned& operator %= (const sc_dt::sc_signed&    );
44812922Sgabeblack@google.com    sc_dt::sc_unsigned& operator %= (const sc_dt::sc_unsigned&  );
44912922Sgabeblack@google.com    sc_dt::sc_unsigned& operator %= (sc_dt::int64               );
45012922Sgabeblack@google.com    sc_dt::sc_unsigned& operator %= (sc_dt::uint64              );
45112922Sgabeblack@google.com    sc_dt::sc_unsigned& operator %= (long                );
45212922Sgabeblack@google.com    sc_dt::sc_unsigned& operator %= (unsigned long       );
45312922Sgabeblack@google.com    sc_dt::sc_unsigned& operator %= (int                 );
45412922Sgabeblack@google.com    sc_dt::sc_unsigned& operator %= (unsigned int        );
45512922Sgabeblack@google.com    sc_dt::sc_unsigned& operator &= (const sc_dt::sc_signed&    );
45612922Sgabeblack@google.com    sc_dt::sc_unsigned& operator &= (const sc_dt::sc_unsigned&  );
45712922Sgabeblack@google.com    sc_dt::sc_unsigned& operator &= (sc_dt::int64               );
45812922Sgabeblack@google.com    sc_dt::sc_unsigned& operator &= (sc_dt::uint64              );
45912922Sgabeblack@google.com    sc_dt::sc_unsigned& operator &= (long                );
46012922Sgabeblack@google.com    sc_dt::sc_unsigned& operator &= (unsigned long       );
46112922Sgabeblack@google.com    sc_dt::sc_unsigned& operator &= (int                 );
46212922Sgabeblack@google.com    sc_dt::sc_unsigned& operator &= (unsigned int        );
46312922Sgabeblack@google.com    sc_dt::sc_unsigned& operator |= (const sc_dt::sc_signed&    );
46412922Sgabeblack@google.com    sc_dt::sc_unsigned& operator |= (const sc_dt::sc_unsigned&  );
46512922Sgabeblack@google.com    sc_dt::sc_unsigned& operator |= (sc_dt::int64               );
46612922Sgabeblack@google.com    sc_dt::sc_unsigned& operator |= (sc_dt::uint64              );
46712922Sgabeblack@google.com    sc_dt::sc_unsigned& operator |= (long                );
46812922Sgabeblack@google.com    sc_dt::sc_unsigned& operator |= (unsigned long       );
46912922Sgabeblack@google.com    sc_dt::sc_unsigned& operator |= (int                 );
47012922Sgabeblack@google.com    sc_dt::sc_unsigned& operator |= (unsigned int        );
47112922Sgabeblack@google.com    sc_dt::sc_unsigned& operator ^= (const sc_dt::sc_signed&    );
47212922Sgabeblack@google.com    sc_dt::sc_unsigned& operator ^= (const sc_dt::sc_unsigned&  );
47312922Sgabeblack@google.com    sc_dt::sc_unsigned& operator ^= (sc_dt::int64               );
47412922Sgabeblack@google.com    sc_dt::sc_unsigned& operator ^= (sc_dt::uint64              );
47512922Sgabeblack@google.com    sc_dt::sc_unsigned& operator ^= (long                );
47612922Sgabeblack@google.com    sc_dt::sc_unsigned& operator ^= (unsigned long       );
47712922Sgabeblack@google.com    sc_dt::sc_unsigned& operator ^= (int                 );
47812922Sgabeblack@google.com    sc_dt::sc_unsigned& operator ^= (unsigned int        );
47912922Sgabeblack@google.com
48012922Sgabeblack@google.com  protected:
48112922Sgabeblack@google.com    mutable sc_event*  m_changed_event_p; // Value changed event this object.
48212922Sgabeblack@google.com    sc_dt::uint64      m_event_delta;     // Delta cycle of last event.
48312922Sgabeblack@google.com    sc_dt::sc_unsigned m_new_val;         // New value for this object instance.
48412922Sgabeblack@google.com    sc_port_base*      m_output_p;        // Single write port verify field.
48512922Sgabeblack@google.com    sc_process_b*   m_writer_p;        // Single writer verify field.
48612922Sgabeblack@google.com};
48712922Sgabeblack@google.com
48812922Sgabeblack@google.com
48912922Sgabeblack@google.comSC_TEMPLATE // Return true if a changed event happened in the last delta cycle.
49012922Sgabeblack@google.cominline bool sc_signal<sc_dt::sc_biguint<W> >::base_event() const
49112922Sgabeblack@google.com{
49212922Sgabeblack@google.com    return simcontext()->delta_count() == m_event_delta + 1;
49312922Sgabeblack@google.com}
49412922Sgabeblack@google.com
49512922Sgabeblack@google.com
49612922Sgabeblack@google.comSC_TEMPLATE // Return this object's sc_dt::sc_biguint<W> object instance.
49712922Sgabeblack@google.cominline const sc_dt::sc_biguint<W>& sc_signal<sc_dt::sc_biguint<W> >::base_read() const
49812922Sgabeblack@google.com{
49912922Sgabeblack@google.com	return *this;
50012922Sgabeblack@google.com}
50112922Sgabeblack@google.com
50212922Sgabeblack@google.com
50312922Sgabeblack@google.comSC_TEMPLATE // Return the value changed event, allocating it if necessary.
50412922Sgabeblack@google.cominline const sc_event& sc_signal<sc_dt::sc_biguint<W> >::base_value_changed_event() const
50512922Sgabeblack@google.com{
50612922Sgabeblack@google.com    if ( !m_changed_event_p ) m_changed_event_p = new sc_event;
50712922Sgabeblack@google.com    return *m_changed_event_p;
50812922Sgabeblack@google.com}
50912922Sgabeblack@google.com
51012922Sgabeblack@google.com
51112922Sgabeblack@google.comSC_TEMPLATE // Write a const sc_dt::sc_signed& value to this object instance.
51212922Sgabeblack@google.cominline void sc_signal<sc_dt::sc_biguint<W> >::base_write( const sc_dt::sc_signed& value )
51312922Sgabeblack@google.com{
51412922Sgabeblack@google.com#   if defined(DEBUG_SYSTEMC)
51512922Sgabeblack@google.com        check_writer();
51612922Sgabeblack@google.com#   endif
51712922Sgabeblack@google.com    m_new_val = value;
51812922Sgabeblack@google.com    request_update();
51912922Sgabeblack@google.com}
52012922Sgabeblack@google.com
52112922Sgabeblack@google.comSC_TEMPLATE // Write a const sc_dt::sc_unsigned& value to this object instance.
52212922Sgabeblack@google.cominline void sc_signal<sc_dt::sc_biguint<W> >::base_write( const sc_dt::sc_unsigned& value )
52312922Sgabeblack@google.com{
52412922Sgabeblack@google.com#   if defined(DEBUG_SYSTEMC)
52512922Sgabeblack@google.com        check_writer();
52612922Sgabeblack@google.com#   endif
52712922Sgabeblack@google.com    m_new_val = value;
52812922Sgabeblack@google.com    request_update();
52912922Sgabeblack@google.com}
53012922Sgabeblack@google.com
53112922Sgabeblack@google.comSC_TEMPLATE // Write a sc_dt::int64 value to this object instance.
53212922Sgabeblack@google.cominline void sc_signal<sc_dt::sc_biguint<W> >::base_write( sc_dt::int64 value )
53312922Sgabeblack@google.com{
53412922Sgabeblack@google.com#   if defined(DEBUG_SYSTEMC)
53512922Sgabeblack@google.com        check_writer();
53612922Sgabeblack@google.com#   endif
53712922Sgabeblack@google.com    m_new_val = value;
53812922Sgabeblack@google.com    request_update();
53912922Sgabeblack@google.com}
54012922Sgabeblack@google.com
54112922Sgabeblack@google.com
54212922Sgabeblack@google.comSC_TEMPLATE // Write a sc_dt::uint64 value to this object instance.
54312922Sgabeblack@google.cominline void sc_signal<sc_dt::sc_biguint<W> >::base_write( sc_dt::uint64 value )
54412922Sgabeblack@google.com{
54512922Sgabeblack@google.com#   if defined(DEBUG_SYSTEMC)
54612922Sgabeblack@google.com        check_writer();
54712922Sgabeblack@google.com#   endif
54812922Sgabeblack@google.com    m_new_val = value;
54912922Sgabeblack@google.com    request_update();
55012922Sgabeblack@google.com}
55112922Sgabeblack@google.com
55212922Sgabeblack@google.com
55312922Sgabeblack@google.com//------------------------------------------------------------------------------
55412922Sgabeblack@google.com//"sc_signal<sc_dt::sc_biguint<W> >::check_writer"
55512922Sgabeblack@google.com//
55612922Sgabeblack@google.com// This method checks to see if there is more than one writer for this
55712922Sgabeblack@google.com// object instance by keeping track of the process performing the write.
55812922Sgabeblack@google.com//------------------------------------------------------------------------------
55912922Sgabeblack@google.comSC_TEMPLATE
56012922Sgabeblack@google.cominline void sc_signal<sc_dt::sc_biguint<W> >::check_writer()
56112922Sgabeblack@google.com{
56212922Sgabeblack@google.com    sc_process_b* writer_p = sc_get_current_process_b();
56312922Sgabeblack@google.com    if( m_writer_p == 0 )
56412922Sgabeblack@google.com    {
56512922Sgabeblack@google.com        m_writer_p = writer_p;
56612922Sgabeblack@google.com    }
56712922Sgabeblack@google.com    else if( m_writer_p != writer_p )
56812922Sgabeblack@google.com    {
56912922Sgabeblack@google.com        sc_signal_invalid_writer( name(), kind(),
57012922Sgabeblack@google.com                                  m_writer_p->name(), writer_p->name() );
57112922Sgabeblack@google.com    }
57212922Sgabeblack@google.com}
57312922Sgabeblack@google.com
57412922Sgabeblack@google.com
57512922Sgabeblack@google.com//------------------------------------------------------------------------------
57612922Sgabeblack@google.com//"sc_signal<sc_dt::sc_biguint<W> >::concat_set"
57712922Sgabeblack@google.com//
57812922Sgabeblack@google.com// These virtual methods allow value assignments to this object instance
57912922Sgabeblack@google.com// from various sources. The position within the supplied source of the
58012922Sgabeblack@google.com// low order bit for this object instance's value is low_i.
58112922Sgabeblack@google.com//     src   = source value.
58212922Sgabeblack@google.com//     low_i = bit within src to serve as low order bit of this object
58312922Sgabeblack@google.com//             instance's value.
58412922Sgabeblack@google.com//------------------------------------------------------------------------------
58512922Sgabeblack@google.comSC_TEMPLATE
58612922Sgabeblack@google.cominline void sc_signal<sc_dt::sc_biguint<W> >::concat_set(sc_dt::int64 src, int low_i)
58712922Sgabeblack@google.com{
58812922Sgabeblack@google.com    if ( low_i < 64 )
58912922Sgabeblack@google.com    {
59012922Sgabeblack@google.com        base_write(src >> low_i);
59112922Sgabeblack@google.com    }
59212922Sgabeblack@google.com    else
59312922Sgabeblack@google.com    {
59412922Sgabeblack@google.com        base_write( (sc_dt::int64)((src < 0 ) ?  -1 : 0 ));
59512922Sgabeblack@google.com    }
59612922Sgabeblack@google.com}
59712922Sgabeblack@google.com
59812922Sgabeblack@google.comSC_TEMPLATE
59912922Sgabeblack@google.cominline void sc_signal<sc_dt::sc_biguint<W> >::concat_set(
60012922Sgabeblack@google.com	const sc_dt::sc_lv_base& src, int low_i)
60112922Sgabeblack@google.com{
60212922Sgabeblack@google.com    sc_dt::sc_unsigned tmp(src.length());
60312922Sgabeblack@google.com    tmp = src >> low_i;
60412922Sgabeblack@google.com    base_write( tmp );
60512922Sgabeblack@google.com}
60612922Sgabeblack@google.com
60712922Sgabeblack@google.comSC_TEMPLATE
60812922Sgabeblack@google.cominline void sc_signal<sc_dt::sc_biguint<W> >::concat_set(
60912922Sgabeblack@google.com	const sc_dt::sc_signed& src, int low_i)
61012922Sgabeblack@google.com{
61112922Sgabeblack@google.com    base_write( (src >> low_i) );
61212922Sgabeblack@google.com}
61312922Sgabeblack@google.com
61412922Sgabeblack@google.comSC_TEMPLATE
61512922Sgabeblack@google.cominline void sc_signal<sc_dt::sc_biguint<W> >::concat_set(
61612922Sgabeblack@google.com	const sc_dt::sc_unsigned& src, int low_i)
61712922Sgabeblack@google.com{
61812922Sgabeblack@google.com    base_write( (src >> low_i) );
61912922Sgabeblack@google.com}
62012922Sgabeblack@google.com
62112922Sgabeblack@google.comSC_TEMPLATE
62212922Sgabeblack@google.cominline void sc_signal<sc_dt::sc_biguint<W> >::concat_set(sc_dt::uint64 src, int low_i)
62312922Sgabeblack@google.com{
62412922Sgabeblack@google.com	base_write( (sc_dt::uint64)(( low_i < 64 ) ? src >> low_i : 0));
62512922Sgabeblack@google.com}
62612922Sgabeblack@google.com
62712922Sgabeblack@google.com
62812922Sgabeblack@google.com
62912922Sgabeblack@google.comSC_TEMPLATE // Return the default event for this object instance.
63012922Sgabeblack@google.cominline const sc_event& sc_signal<sc_dt::sc_biguint<W> >::default_event() const
63112922Sgabeblack@google.com	{ return base_value_changed_event(); }
63212922Sgabeblack@google.com
63312922Sgabeblack@google.com
63412922Sgabeblack@google.comSC_TEMPLATE // Return true if a changed event happened in the last delta cycle.
63512922Sgabeblack@google.cominline bool sc_signal<sc_dt::sc_biguint<W> >::event() const
63612922Sgabeblack@google.com	{ return base_event(); }
63712922Sgabeblack@google.com
63812922Sgabeblack@google.com
63912922Sgabeblack@google.comSC_TEMPLATE // Return a reference to the value of this object instance.
64012922Sgabeblack@google.cominline const sc_dt::sc_biguint<W>& sc_signal<sc_dt::sc_biguint<W> >::get_data_ref() const
64112922Sgabeblack@google.com	{ return *this; }
64212922Sgabeblack@google.com
64312922Sgabeblack@google.com
64412922Sgabeblack@google.comSC_TEMPLATE // Return a pointer to this object instance.
64512922Sgabeblack@google.cominline sc_signal<sc_dt::sc_biguint<W> >& sc_signal<sc_dt::sc_biguint<W> >::get_signal()
64612922Sgabeblack@google.com	{ return *this; }
64712922Sgabeblack@google.com
64812922Sgabeblack@google.com
64912922Sgabeblack@google.comSC_TEMPLATE // Return a kind value of "sc_signal".
65012922Sgabeblack@google.cominline const char* sc_signal<sc_dt::sc_biguint<W> >::kind() const
65112922Sgabeblack@google.com{
65212922Sgabeblack@google.com	return "sc_signal";
65312922Sgabeblack@google.com}
65412922Sgabeblack@google.com
65512922Sgabeblack@google.com
65612922Sgabeblack@google.com//------------------------------------------------------------------------------
65712922Sgabeblack@google.com//"sc_signal_uint::operator ()
65812922Sgabeblack@google.com//
65912922Sgabeblack@google.com// This operator returns a part selection of this object instance.
66012922Sgabeblack@google.com//     left  = left-hand bit of the selection.
66112922Sgabeblack@google.com//     right = right-hand bit of the selection.
66212922Sgabeblack@google.com//------------------------------------------------------------------------------
66312922Sgabeblack@google.comSC_TEMPLATE
66412922Sgabeblack@google.cominline sc_unsigned_sigref& sc_signal<sc_dt::sc_biguint<W> >::operator () (int left, int right)
66512922Sgabeblack@google.com{
66612922Sgabeblack@google.com    sc_unsigned_sigref* result_p;   // Value to return.
66712922Sgabeblack@google.com
66812922Sgabeblack@google.com	result_p = sc_unsigned_sigref::m_pool.allocate();
66912922Sgabeblack@google.com	result_p->initialize(this, left, right);
67012922Sgabeblack@google.com	return *result_p;
67112922Sgabeblack@google.com}
67212922Sgabeblack@google.com
67312922Sgabeblack@google.com
67412922Sgabeblack@google.com//------------------------------------------------------------------------------
67512922Sgabeblack@google.com//"sc_signal_uint::operator []"
67612922Sgabeblack@google.com//
67712922Sgabeblack@google.com// This operator returns a bit selection of this object instance.
67812922Sgabeblack@google.com//     i = bit to be selected.
67912922Sgabeblack@google.com//------------------------------------------------------------------------------
68012922Sgabeblack@google.comSC_TEMPLATE
68112922Sgabeblack@google.cominline sc_unsigned_sigref& sc_signal<sc_dt::sc_biguint<W> >::operator [] ( int bit )
68212922Sgabeblack@google.com{
68312922Sgabeblack@google.com    return operator () (bit,bit);
68412922Sgabeblack@google.com}
68512922Sgabeblack@google.com
68612922Sgabeblack@google.com
68712922Sgabeblack@google.comSC_TEMPLATE
68812922Sgabeblack@google.cominline void sc_signal<sc_dt::sc_biguint<W> >::operator = ( const this_type& new_val )
68912922Sgabeblack@google.com	{ base_write( new_val ); }
69012922Sgabeblack@google.com
69112922Sgabeblack@google.comSC_TEMPLATE
69212922Sgabeblack@google.cominline void sc_signal<sc_dt::sc_biguint<W> >::operator = ( const char* new_val )
69312922Sgabeblack@google.com	{ sc_dt::sc_biguint<W> tmp = new_val; m_new_val = tmp; request_update(); }
69412922Sgabeblack@google.com
69512922Sgabeblack@google.com
69612922Sgabeblack@google.comSC_TEMPLATE
69712922Sgabeblack@google.cominline void sc_signal<sc_dt::sc_biguint<W> >::operator = ( const sc_dt::sc_unsigned& new_val )
69812922Sgabeblack@google.com	{ base_write(new_val); }
69912922Sgabeblack@google.com
70012922Sgabeblack@google.com
70112922Sgabeblack@google.comSC_TEMPLATE
70212922Sgabeblack@google.cominline void sc_signal<sc_dt::sc_biguint<W> >::operator = ( sc_dt::uint64 new_val )
70312922Sgabeblack@google.com	{ base_write(new_val); }
70412922Sgabeblack@google.com
70512922Sgabeblack@google.com
70612922Sgabeblack@google.comSC_TEMPLATE
70712922Sgabeblack@google.cominline void sc_signal<sc_dt::sc_biguint<W> >::operator = ( sc_dt::int64 new_val )
70812922Sgabeblack@google.com	{ base_write(new_val); }
70912922Sgabeblack@google.com
71012922Sgabeblack@google.com
71112922Sgabeblack@google.comSC_TEMPLATE
71212922Sgabeblack@google.cominline void sc_signal<sc_dt::sc_biguint<W> >::operator = ( int new_val )
71312922Sgabeblack@google.com	{ base_write((sc_dt::int64)new_val); }
71412922Sgabeblack@google.com
71512922Sgabeblack@google.com
71612922Sgabeblack@google.comSC_TEMPLATE
71712922Sgabeblack@google.cominline void sc_signal<sc_dt::sc_biguint<W> >::operator = ( long new_val )
71812922Sgabeblack@google.com	{ base_write((sc_dt::int64)new_val); }
71912922Sgabeblack@google.com
72012922Sgabeblack@google.com
72112922Sgabeblack@google.comSC_TEMPLATE
72212922Sgabeblack@google.cominline void sc_signal<sc_dt::sc_biguint<W> >::operator = ( short new_val )
72312922Sgabeblack@google.com	{ base_write((sc_dt::int64)new_val); }
72412922Sgabeblack@google.com
72512922Sgabeblack@google.com
72612922Sgabeblack@google.comSC_TEMPLATE
72712922Sgabeblack@google.cominline void sc_signal<sc_dt::sc_biguint<W> >::operator = ( unsigned int new_val )
72812922Sgabeblack@google.com	{ base_write((sc_dt::int64)new_val); }
72912922Sgabeblack@google.com
73012922Sgabeblack@google.com
73112922Sgabeblack@google.comSC_TEMPLATE
73212922Sgabeblack@google.cominline void sc_signal<sc_dt::sc_biguint<W> >::operator = ( unsigned long new_val )
73312922Sgabeblack@google.com	{ base_write((sc_dt::int64)new_val); }
73412922Sgabeblack@google.com
73512922Sgabeblack@google.com
73612922Sgabeblack@google.comSC_TEMPLATE
73712922Sgabeblack@google.cominline void sc_signal<sc_dt::sc_biguint<W> >::operator = ( unsigned short new_val )
73812922Sgabeblack@google.com	{ base_write((sc_dt::int64)new_val); }
73912922Sgabeblack@google.com
74012922Sgabeblack@google.com
74112922Sgabeblack@google.comSC_TEMPLATE
74212922Sgabeblack@google.comtemplate<typename T>
74312922Sgabeblack@google.cominline void sc_signal<sc_dt::sc_biguint<W> >::operator = (
74412922Sgabeblack@google.com	const sc_dt::sc_generic_base<T>& new_val )
74512922Sgabeblack@google.com{
74612922Sgabeblack@google.com	sc_dt::sc_unsigned temp(W);
74712922Sgabeblack@google.com    new_val->to_sc_unsigned(temp);
74812922Sgabeblack@google.com    base_write(temp);
74912922Sgabeblack@google.com}
75012922Sgabeblack@google.com
75112922Sgabeblack@google.com
75212922Sgabeblack@google.comSC_TEMPLATE
75312922Sgabeblack@google.cominline void sc_signal<sc_dt::sc_biguint<W> >::operator = ( const sc_dt::sc_signed& new_val )
75412922Sgabeblack@google.com	{ base_write(new_val); }
75512922Sgabeblack@google.com
75612922Sgabeblack@google.comSC_TEMPLATE
75712922Sgabeblack@google.cominline void sc_signal<sc_dt::sc_biguint<W> >::operator = ( const sc_dt::sc_bv_base& new_val )
75812922Sgabeblack@google.com	{ base_write( (sc_dt::sc_biguint<W>)new_val ); }
75912922Sgabeblack@google.com
76012922Sgabeblack@google.comSC_TEMPLATE
76112922Sgabeblack@google.cominline void sc_signal<sc_dt::sc_biguint<W> >::operator = ( const sc_dt::sc_lv_base& new_val )
76212922Sgabeblack@google.com	{ base_write( (sc_dt::sc_biguint<W>)new_val ); }
76312922Sgabeblack@google.com
76412922Sgabeblack@google.com
76512922Sgabeblack@google.comSC_TEMPLATE
76612922Sgabeblack@google.cominline sc_dt::sc_unsigned* sc_signal<sc_dt::sc_biguint<W> >::part_read_target()
76712922Sgabeblack@google.com	{ return this; }
76812922Sgabeblack@google.com
76912922Sgabeblack@google.com
77012922Sgabeblack@google.comSC_TEMPLATE
77112922Sgabeblack@google.cominline const sc_dt::sc_biguint<W>& sc_signal<sc_dt::sc_biguint<W> >::read() const
77212922Sgabeblack@google.com	{ return *this; }
77312922Sgabeblack@google.com
77412922Sgabeblack@google.com
77512922Sgabeblack@google.comSC_TEMPLATE // Read a portion of a value.
77612922Sgabeblack@google.cominline sc_dt::sc_unsigned sc_signal<sc_dt::sc_biguint<W> >::read_part(
77712922Sgabeblack@google.com	int left, int right ) const
77812922Sgabeblack@google.com{
77912922Sgabeblack@google.com	sc_dt::sc_unsigned tmp(left-right+1);
78012922Sgabeblack@google.com	tmp = (*(const sc_dt::sc_biguint<W>*)this)(left,right);
78112922Sgabeblack@google.com    return tmp;
78212922Sgabeblack@google.com}
78312922Sgabeblack@google.com
78412922Sgabeblack@google.comSC_TEMPLATE
78512922Sgabeblack@google.cominline void sc_signal<sc_dt::sc_biguint<W> >::register_port(
78612922Sgabeblack@google.com	sc_port_base& port_, const char* if_typename_ )
78712922Sgabeblack@google.com{
78812922Sgabeblack@google.com#       ifdef DEBUG_SYSTEMC
78912922Sgabeblack@google.com		std::string nm( if_typename_ );
79012922Sgabeblack@google.com		if( nm == typeid( sc_signal_inout_if<sc_dt::sc_biguint<W> > ).name() )
79112922Sgabeblack@google.com		{
79212922Sgabeblack@google.com			if( m_output_p != 0 )
79312922Sgabeblack@google.com			{
79412922Sgabeblack@google.com				sc_signal_invalid_writer( name(), kind(),
79512922Sgabeblack@google.com					 m_output_p->name(), port_.name() );
79612922Sgabeblack@google.com			}
79712922Sgabeblack@google.com			m_output_p = &port_;
79812922Sgabeblack@google.com		}
79912922Sgabeblack@google.com#       else
80012922Sgabeblack@google.com            if ( &port_ && if_typename_ ) {} // Silence unused args warning.
80112922Sgabeblack@google.com#       endif
80212922Sgabeblack@google.com}
80312922Sgabeblack@google.com
80412922Sgabeblack@google.com
80512922Sgabeblack@google.comSC_TEMPLATE // Autogenerated name object instance constructor.
80612922Sgabeblack@google.cominline sc_signal<sc_dt::sc_biguint<W> >::sc_signal() :
80712922Sgabeblack@google.com	sc_prim_channel(sc_gen_unique_name( "signal" )),
80812922Sgabeblack@google.com	m_changed_event_p(0),
80912922Sgabeblack@google.com	m_new_val(W),
81012922Sgabeblack@google.com	m_output_p(0),
81112922Sgabeblack@google.com	m_writer_p(0)
81212922Sgabeblack@google.com{ }
81312922Sgabeblack@google.com
81412922Sgabeblack@google.com
81512922Sgabeblack@google.comSC_TEMPLATE // Explicitly named object instance constructor.
81612922Sgabeblack@google.cominline sc_signal<sc_dt::sc_biguint<W> >::sc_signal(const char* name_) :
81712922Sgabeblack@google.com	sc_prim_channel(name_),
81812922Sgabeblack@google.com	m_changed_event_p(0),
81912922Sgabeblack@google.com	m_new_val(W),
82012922Sgabeblack@google.com	m_output_p(0),
82112922Sgabeblack@google.com	m_writer_p(0)
82212922Sgabeblack@google.com{ }
82312922Sgabeblack@google.com
82412922Sgabeblack@google.com
82512922Sgabeblack@google.comSC_TEMPLATE // Object instance destructor.
82612922Sgabeblack@google.cominline sc_signal<sc_dt::sc_biguint<W> >::~sc_signal()
82712922Sgabeblack@google.com{
82812922Sgabeblack@google.com	if ( m_changed_event_p ) delete m_changed_event_p;
82912922Sgabeblack@google.com}
83012922Sgabeblack@google.com
83112922Sgabeblack@google.com
83212922Sgabeblack@google.comSC_TEMPLATE // Update the current value from new value.
83312922Sgabeblack@google.cominline void sc_signal<sc_dt::sc_biguint<W> >::update()
83412922Sgabeblack@google.com{
83512922Sgabeblack@google.com    if ( m_changed_event_p )
83612922Sgabeblack@google.com    {
83712922Sgabeblack@google.com        if ( m_new_val != *this )
83812922Sgabeblack@google.com        {
83912922Sgabeblack@google.com            m_changed_event_p->notify_delayed();
84012922Sgabeblack@google.com            m_event_delta = simcontext()->delta_count();
84112922Sgabeblack@google.com        }
84212922Sgabeblack@google.com    }
84312922Sgabeblack@google.com	sc_dt::sc_unsigned::operator = (m_new_val);
84412922Sgabeblack@google.com}
84512922Sgabeblack@google.com
84612922Sgabeblack@google.com
84712922Sgabeblack@google.comSC_TEMPLATE // Return the value changed event.
84812922Sgabeblack@google.cominline const sc_event& sc_signal<sc_dt::sc_biguint<W> >::value_changed_event() const
84912922Sgabeblack@google.com	{ return base_value_changed_event(); }
85012922Sgabeblack@google.com
85112922Sgabeblack@google.com
85212922Sgabeblack@google.comSC_TEMPLATE // Write a sc_in<sc_dt::sc_biguint<W> > value to this object instance.
85312922Sgabeblack@google.cominline void sc_signal<sc_dt::sc_biguint<W> >::write(
85412922Sgabeblack@google.com	const sc_in<sc_dt::sc_biguint<W> >& value )
85512922Sgabeblack@google.com	{ base_write( value ); }
85612922Sgabeblack@google.com
85712922Sgabeblack@google.com
85812922Sgabeblack@google.comSC_TEMPLATE // Write a sc_inout<sc_dt::sc_biguint<W> > value to this object instance.
85912922Sgabeblack@google.cominline void sc_signal<sc_dt::sc_biguint<W> >::write(
86012922Sgabeblack@google.com	const sc_inout<sc_dt::sc_biguint<W> >& value )
86112922Sgabeblack@google.com{ base_write( value ); }
86212922Sgabeblack@google.com
86312922Sgabeblack@google.com
86412922Sgabeblack@google.comSC_TEMPLATE // Write a sc_dt::sc_biguint<W> value to this object instance.
86512922Sgabeblack@google.cominline void sc_signal<sc_dt::sc_biguint<W> >::write( const sc_dt::sc_biguint<W>& value )
86612922Sgabeblack@google.com	{ base_write( value); }
86712922Sgabeblack@google.com
86812922Sgabeblack@google.com
86912922Sgabeblack@google.comSC_TEMPLATE // Write a portion of a value. If this is the first write in
87012922Sgabeblack@google.com            // a delta cycle we copy the existing value before setting the bits.
87112922Sgabeblack@google.cominline void sc_signal<sc_dt::sc_biguint<W> >::write_part(sc_dt::int64 v, int left, int right)
87212922Sgabeblack@google.com{
87312922Sgabeblack@google.com	m_new_val(left, right) = v;
87412922Sgabeblack@google.com	request_update();
87512922Sgabeblack@google.com}
87612922Sgabeblack@google.com
87712922Sgabeblack@google.com
87812922Sgabeblack@google.comSC_TEMPLATE // Select a portion of a value.
87912922Sgabeblack@google.cominline sc_unsigned_sigref& sc_signal<sc_dt::sc_biguint<W> >::select_part(
88012922Sgabeblack@google.com	int left, int right)
88112922Sgabeblack@google.com{
88212922Sgabeblack@google.com    sc_unsigned_sigref* result_p = sc_unsigned_sigref::m_pool.allocate();
88312922Sgabeblack@google.com    result_p->initialize(dynamic_cast<sc_unsigned_part_if*>(this), left, right);
88412922Sgabeblack@google.com    return *result_p;
88512922Sgabeblack@google.com}
88612922Sgabeblack@google.com
88712922Sgabeblack@google.com
88812922Sgabeblack@google.comSC_TEMPLATE // Write a portion of a value. If this is the first write in
88912922Sgabeblack@google.com            // a delta cycle we copy the existing value before setting the bits.
89012922Sgabeblack@google.cominline void sc_signal<sc_dt::sc_biguint<W> >::write_part(sc_dt::uint64 v, int left, int right)
89112922Sgabeblack@google.com{
89212922Sgabeblack@google.com	m_new_val(left, right) = v;
89312922Sgabeblack@google.com	request_update();
89412922Sgabeblack@google.com}
89512922Sgabeblack@google.com
89612922Sgabeblack@google.com
89712922Sgabeblack@google.comSC_TEMPLATE // Write a portion of a value. If this is the first write in
89812922Sgabeblack@google.com            // a delta cycle we copy the existing value before setting the bits.
89912922Sgabeblack@google.cominline void sc_signal<sc_dt::sc_biguint<W> >::write_part(
90012922Sgabeblack@google.com	const sc_dt::sc_signed& v, int left, int right )
90112922Sgabeblack@google.com{
90212922Sgabeblack@google.com	m_new_val(left, right) = v;
90312922Sgabeblack@google.com	request_update();
90412922Sgabeblack@google.com}
90512922Sgabeblack@google.com
90612922Sgabeblack@google.com
90712922Sgabeblack@google.comSC_TEMPLATE // Write a portion of a value. If this is the first write in
90812922Sgabeblack@google.com            // a delta cycle we copy the existing value before setting the bits.
90912922Sgabeblack@google.cominline void sc_signal<sc_dt::sc_biguint<W> >::write_part(
91012922Sgabeblack@google.com	const sc_dt::sc_unsigned& v, int left, int right )
91112922Sgabeblack@google.com{
91212922Sgabeblack@google.com	m_new_val(left, right) = v;
91312922Sgabeblack@google.com	request_update();
91412922Sgabeblack@google.com}
91512922Sgabeblack@google.com
91612922Sgabeblack@google.com
91712922Sgabeblack@google.com//==============================================================================
91812922Sgabeblack@google.com// CLASS sc_in<sc_dt::sc_biguint<W> >
91912922Sgabeblack@google.com//
92012922Sgabeblack@google.com// This class implements an input port whose target acts like an sc_dt::sc_biguint<W> data
92112922Sgabeblack@google.com// value. This class is a specialization of the generic sc_in class to
92212922Sgabeblack@google.com// implement tailored support for the sc_dt::sc_biguint<W> class.
92312922Sgabeblack@google.com//==============================================================================
92412922Sgabeblack@google.comSC_TEMPLATE
92512922Sgabeblack@google.comclass sc_in<sc_dt::sc_biguint<W> > :
92612922Sgabeblack@google.com    public sc_port<sc_signal_in_if<sc_dt::sc_biguint<W> >, 1,
92712922Sgabeblack@google.com                   SC_ONE_OR_MORE_BOUND>,
92812922Sgabeblack@google.com    public sc_dt::sc_value_base
92912922Sgabeblack@google.com{
93012922Sgabeblack@google.com  public:
93112922Sgabeblack@google.com
93212922Sgabeblack@google.com    // typedefs
93312922Sgabeblack@google.com
93412922Sgabeblack@google.com    typedef sc_dt::sc_biguint<W>                      data_type;
93512922Sgabeblack@google.com    typedef sc_signal_in_if<sc_dt::sc_biguint<W> >    if_type;
93612922Sgabeblack@google.com    typedef sc_port<if_type,1,SC_ONE_OR_MORE_BOUND>   base_type;
93712922Sgabeblack@google.com    typedef sc_in<sc_dt::sc_biguint<W> >              this_type;
93812922Sgabeblack@google.com
93912922Sgabeblack@google.com    typedef if_type                                   in_if_type;
94012922Sgabeblack@google.com    typedef base_type                                 in_port_type;
94112922Sgabeblack@google.com    typedef sc_signal_inout_if<sc_dt::sc_biguint<W> > inout_if_type;
94212922Sgabeblack@google.com    typedef sc_inout<sc_dt::sc_biguint<W> >           inout_port_type;
94312922Sgabeblack@google.com
94412922Sgabeblack@google.com  public:
94512922Sgabeblack@google.com
94612922Sgabeblack@google.com    // bind methods and operators:
94712922Sgabeblack@google.com
94812922Sgabeblack@google.com    void bind( const in_if_type& interface_ )
94912922Sgabeblack@google.com        { sc_port_base::bind( const_cast<in_if_type&>( interface_) );}
95012922Sgabeblack@google.com    void operator () ( const in_if_type& interface_ )
95112922Sgabeblack@google.com        { sc_port_base::bind( const_cast<in_if_type&>( interface_) );}
95212922Sgabeblack@google.com    void bind( in_port_type& parent_ )
95312922Sgabeblack@google.com        { sc_port_base::bind(parent_);}
95412922Sgabeblack@google.com    void operator () ( in_port_type& parent_ )
95512922Sgabeblack@google.com        { sc_port_base::bind(parent_);}
95612922Sgabeblack@google.com    void bind( inout_port_type& parent_ )
95712922Sgabeblack@google.com        { sc_port_base::bind(parent_);}
95812922Sgabeblack@google.com    void operator () ( inout_port_type& parent_ )
95912922Sgabeblack@google.com        { sc_port_base::bind(parent_);}
96012922Sgabeblack@google.com
96112922Sgabeblack@google.com  protected:
96212922Sgabeblack@google.com    // called by pbind (for internal use only)
96312922Sgabeblack@google.com    virtual inline int vbind( sc_interface& interface_ )
96412922Sgabeblack@google.com        {
96512922Sgabeblack@google.com            return sc_port_b<if_type>::vbind( interface_ );
96612922Sgabeblack@google.com        }
96712922Sgabeblack@google.com    virtual inline int vbind( sc_port_base& parent_ )
96812922Sgabeblack@google.com        {
96912922Sgabeblack@google.com            in_port_type* in_parent = dynamic_cast<in_port_type*>( &parent_ );
97012922Sgabeblack@google.com            if( in_parent != 0 ) {
97112922Sgabeblack@google.com                sc_port_base::bind( *in_parent );
97212922Sgabeblack@google.com                return 0;
97312922Sgabeblack@google.com            }
97412922Sgabeblack@google.com            inout_port_type* inout_parent = dynamic_cast<inout_port_type*>( &parent_ );
97512922Sgabeblack@google.com            if( inout_parent != 0 ) {
97612922Sgabeblack@google.com                sc_port_base::bind( *inout_parent );
97712922Sgabeblack@google.com                return 0;
97812922Sgabeblack@google.com            }
97912922Sgabeblack@google.com            // type mismatch
98012922Sgabeblack@google.com            return 2;
98112922Sgabeblack@google.com        }
98212922Sgabeblack@google.com
98312922Sgabeblack@google.com
98412922Sgabeblack@google.com    // constructors
98512922Sgabeblack@google.com
98612922Sgabeblack@google.com  public:
98712922Sgabeblack@google.com    sc_in()
98812922Sgabeblack@google.com        : base_type(), m_traces( 0 )
98912922Sgabeblack@google.com        {}
99012922Sgabeblack@google.com
99112922Sgabeblack@google.com    explicit sc_in( const char* name_ )
99212922Sgabeblack@google.com        : base_type( name_ ), m_traces( 0 )
99312922Sgabeblack@google.com        {}
99412922Sgabeblack@google.com
99512922Sgabeblack@google.com    explicit sc_in( const in_if_type& interface_ )
99612922Sgabeblack@google.com        : base_type( const_cast<in_if_type&>( interface_ ) ), m_traces( 0 )
99712922Sgabeblack@google.com        {}
99812922Sgabeblack@google.com
99912922Sgabeblack@google.com    sc_in( const char* name_, const in_if_type& interface_ )
100012922Sgabeblack@google.com        : base_type( name_, const_cast<in_if_type&>( interface_ ) ), m_traces( 0 )
100112922Sgabeblack@google.com        {}
100212922Sgabeblack@google.com
100312922Sgabeblack@google.com    explicit sc_in( in_port_type& parent_ )
100412922Sgabeblack@google.com        : base_type( parent_ ), m_traces( 0 )
100512922Sgabeblack@google.com        {}
100612922Sgabeblack@google.com
100712922Sgabeblack@google.com    sc_in( const char* name_, in_port_type& parent_ )
100812922Sgabeblack@google.com        : base_type( name_, parent_ ), m_traces( 0 )
100912922Sgabeblack@google.com        {}
101012922Sgabeblack@google.com
101112922Sgabeblack@google.com    explicit sc_in( inout_port_type& parent_ )
101212922Sgabeblack@google.com        : base_type(), m_traces( 0 )
101312922Sgabeblack@google.com        { sc_port_base::bind( parent_ ); }
101412922Sgabeblack@google.com
101512922Sgabeblack@google.com    sc_in( const char* name_, inout_port_type& parent_ )
101612922Sgabeblack@google.com        : base_type( name_ ), m_traces( 0 )
101712922Sgabeblack@google.com        { sc_port_base::bind( parent_ ); }
101812922Sgabeblack@google.com
101912922Sgabeblack@google.com    sc_in( this_type& parent_ )
102012922Sgabeblack@google.com        : base_type( parent_ ), m_traces( 0 )
102112922Sgabeblack@google.com        {}
102212922Sgabeblack@google.com
102312922Sgabeblack@google.com    sc_in( const char* name_, this_type& parent_ )
102412922Sgabeblack@google.com        : base_type( name_, parent_ ), m_traces( 0 )
102512922Sgabeblack@google.com        {}
102612922Sgabeblack@google.com
102712922Sgabeblack@google.com
102812922Sgabeblack@google.com    // destructor
102912922Sgabeblack@google.com
103012922Sgabeblack@google.com    virtual inline ~sc_in()
103112922Sgabeblack@google.com        {
103212922Sgabeblack@google.com            remove_traces();
103312922Sgabeblack@google.com        }
103412922Sgabeblack@google.com
103512922Sgabeblack@google.com    // bit and part selection
103612922Sgabeblack@google.com
103712922Sgabeblack@google.com    sc_dt::sc_unsigned_bitref_r operator [] ( int i ) const
103812922Sgabeblack@google.com        { return (*this)->read()[i]; }
103912922Sgabeblack@google.com    sc_dt::sc_unsigned_bitref_r bit( int i ) const
104012922Sgabeblack@google.com        { return (*this)->read()[i]; }
104112922Sgabeblack@google.com    sc_dt::sc_unsigned_subref_r operator () ( int left, int right ) const
104212922Sgabeblack@google.com        { return (*this)->read()(left,right); }
104312922Sgabeblack@google.com    sc_dt::sc_unsigned_subref_r range( int left, int right ) const
104412922Sgabeblack@google.com        { return (*this)->read()(left,right); }
104512922Sgabeblack@google.com
104612922Sgabeblack@google.com
104712922Sgabeblack@google.com    // interface access shortcut methods
104812922Sgabeblack@google.com
104912922Sgabeblack@google.com    // get the default event
105012922Sgabeblack@google.com
105112922Sgabeblack@google.com    const sc_event& default_event() const
105212922Sgabeblack@google.com        { return (*this)->value_changed_event(); }
105312922Sgabeblack@google.com
105412922Sgabeblack@google.com
105512922Sgabeblack@google.com    // get the value changed event
105612922Sgabeblack@google.com
105712922Sgabeblack@google.com    const sc_event& value_changed_event() const
105812922Sgabeblack@google.com        { return (*this)->value_changed_event(); }
105912922Sgabeblack@google.com
106012922Sgabeblack@google.com
106112922Sgabeblack@google.com    // read the current value
106212922Sgabeblack@google.com
106312922Sgabeblack@google.com    const sc_dt::sc_biguint<W>& read() const
106412922Sgabeblack@google.com        { return (*this)->read(); }
106512922Sgabeblack@google.com
106612922Sgabeblack@google.com    operator const sc_dt::sc_biguint<W>& () const
106712922Sgabeblack@google.com        { return (*this)->read(); }
106812922Sgabeblack@google.com
106912922Sgabeblack@google.com    // was there a value changed event?
107012922Sgabeblack@google.com
107112922Sgabeblack@google.com    bool event() const
107212922Sgabeblack@google.com        { return (*this)->event(); }
107312922Sgabeblack@google.com
107412922Sgabeblack@google.com
107512922Sgabeblack@google.com    // (other) event finder method(s)
107612922Sgabeblack@google.com
107712922Sgabeblack@google.com    sc_event_finder& value_changed() const
107812922Sgabeblack@google.com        {
107912922Sgabeblack@google.com            return *new sc_event_finder_t<in_if_type>(
108012922Sgabeblack@google.com                *this, &in_if_type::value_changed_event );
108112922Sgabeblack@google.com        }
108212922Sgabeblack@google.com
108312922Sgabeblack@google.com
108412922Sgabeblack@google.com
108512922Sgabeblack@google.com    // reduction methods:
108612922Sgabeblack@google.com
108712922Sgabeblack@google.com    inline bool and_reduce() const
108812922Sgabeblack@google.com        { return (*this)->read().and_reduce(); }
108912922Sgabeblack@google.com    inline bool nand_reduce() const
109012922Sgabeblack@google.com        { return (*this)->read().nand_reduce(); }
109112922Sgabeblack@google.com    inline bool nor_reduce() const
109212922Sgabeblack@google.com        { return (*this)->read().nor_reduce(); }
109312922Sgabeblack@google.com    inline bool or_reduce() const
109412922Sgabeblack@google.com        { return (*this)->read().or_reduce(); }
109512922Sgabeblack@google.com    inline bool xnor_reduce() const
109612922Sgabeblack@google.com        { return (*this)->read().xnor_reduce(); }
109712922Sgabeblack@google.com    inline bool xor_reduce() const
109812922Sgabeblack@google.com        { return (*this)->read().xor_reduce(); }
109912922Sgabeblack@google.com
110012922Sgabeblack@google.com
110112922Sgabeblack@google.com    // called when elaboration is done
110212922Sgabeblack@google.com    /*  WHEN DEFINING THIS METHOD IN A DERIVED CLASS, */
110312922Sgabeblack@google.com    /*  MAKE SURE THAT THIS METHOD IS CALLED AS WELL. */
110412922Sgabeblack@google.com
110512922Sgabeblack@google.com    virtual inline void end_of_elaboration()
110612922Sgabeblack@google.com        {
110712922Sgabeblack@google.com            if( m_traces != 0 ) {
110812922Sgabeblack@google.com                for( unsigned int i = 0; i < m_traces->size(); ++ i ) {
110912922Sgabeblack@google.com                    sc_trace_params* p = (*m_traces)[i];
111012922Sgabeblack@google.com                    sc_trace( p->tf, read(), p->name );
111112922Sgabeblack@google.com                }
111212922Sgabeblack@google.com                remove_traces();
111312922Sgabeblack@google.com            }
111412922Sgabeblack@google.com        }
111512922Sgabeblack@google.com
111612922Sgabeblack@google.com    virtual inline const char* kind() const
111712922Sgabeblack@google.com        { return "sc_in"; }
111812922Sgabeblack@google.com
111912922Sgabeblack@google.com
112012922Sgabeblack@google.com    // called by sc_trace
112112922Sgabeblack@google.com    void add_trace( sc_trace_file* tf_, const std::string& name_ ) const
112212922Sgabeblack@google.com        {
112312922Sgabeblack@google.com            if( tf_ != 0 ) {
112412922Sgabeblack@google.com                if( m_traces == 0 ) {
112512922Sgabeblack@google.com                    m_traces = new sc_trace_params_vec;
112612922Sgabeblack@google.com                }
112712922Sgabeblack@google.com                m_traces->push_back( new sc_trace_params( tf_, name_ ) );
112812922Sgabeblack@google.com            }
112912922Sgabeblack@google.com        }
113012922Sgabeblack@google.com
113112922Sgabeblack@google.com
113212922Sgabeblack@google.com    // concatenation methods
113312922Sgabeblack@google.com
113412922Sgabeblack@google.com    virtual inline int concat_length(bool* xz_present_p) const
113512922Sgabeblack@google.com        { return (*this)->read().concat_length( xz_present_p ); }
113612922Sgabeblack@google.com    virtual inline sc_dt::uint64 concat_get_uint64() const
113712922Sgabeblack@google.com        { return (*this)->read().concat_get_uint64(); }
113812922Sgabeblack@google.com    virtual inline bool concat_get_ctrl( sc_dt::sc_digit* dst_p, int low_i ) const
113912922Sgabeblack@google.com        { return (*this)->read().concat_get_ctrl(dst_p, low_i); }
114012922Sgabeblack@google.com    virtual inline bool concat_get_data( sc_dt::sc_digit* dst_p, int low_i ) const
114112922Sgabeblack@google.com        { return (*this)->read().concat_get_data(dst_p, low_i); }
114212922Sgabeblack@google.com
114312922Sgabeblack@google.com  protected:
114412922Sgabeblack@google.com    void remove_traces() const
114512922Sgabeblack@google.com        {
114612922Sgabeblack@google.com            if( m_traces != 0 ) {
114712922Sgabeblack@google.com                for( int i = m_traces->size() - 1; i >= 0; -- i ) {
114812922Sgabeblack@google.com                    delete (*m_traces)[i];
114912922Sgabeblack@google.com                }
115012922Sgabeblack@google.com                delete m_traces;
115112922Sgabeblack@google.com                m_traces = 0;
115212922Sgabeblack@google.com            }
115312922Sgabeblack@google.com        }
115412922Sgabeblack@google.com
115512922Sgabeblack@google.com    mutable sc_trace_params_vec* m_traces;
115612922Sgabeblack@google.com
115712922Sgabeblack@google.com
115812922Sgabeblack@google.com  private:
115912922Sgabeblack@google.com
116012922Sgabeblack@google.com    // disabled
116112922Sgabeblack@google.com    sc_in( const sc_in<sc_dt::sc_biguint<W> >& );
116212922Sgabeblack@google.com    sc_in<sc_dt::sc_biguint<W> >& operator = ( const sc_in<sc_dt::sc_biguint<W> >& );
116312922Sgabeblack@google.com
116412922Sgabeblack@google.com#ifdef __GNUC__
116512922Sgabeblack@google.com    // Needed to circumvent a problem in the g++-2.95.2 compiler:
116612922Sgabeblack@google.com    // This unused variable forces the compiler to instantiate
116712922Sgabeblack@google.com    // an object of T template so an implicit conversion from
116812922Sgabeblack@google.com    // read() to a C++ intrinsic data type will work.
116912922Sgabeblack@google.com    static data_type dummy;
117012922Sgabeblack@google.com#endif
117112922Sgabeblack@google.com
117212922Sgabeblack@google.com};
117312922Sgabeblack@google.com
117412922Sgabeblack@google.com
117512922Sgabeblack@google.com
117612922Sgabeblack@google.comSC_TEMPLATE
117712922Sgabeblack@google.cominline std::ostream& operator << (
117812922Sgabeblack@google.com    std::ostream& os, const sc_in<sc_dt::sc_biguint<W> >& a )
117912922Sgabeblack@google.com{
118012922Sgabeblack@google.com    a.read().print( os );
118112922Sgabeblack@google.com    return os;
118212922Sgabeblack@google.com}
118312922Sgabeblack@google.com
118412922Sgabeblack@google.com
118512922Sgabeblack@google.com//==============================================================================
118612922Sgabeblack@google.com// CLASS sc_inout<sc_dt::sc_biguint<W> >
118712922Sgabeblack@google.com//
118812922Sgabeblack@google.com// This class implements an input/output port whose target acts like an
118912922Sgabeblack@google.com// sc_dt::sc_biguint<W> data value. It is derived from the sc_unsigned_in. This class is a
119012922Sgabeblack@google.com// specialization of the generic sc_inout class to implement tailored support
119112922Sgabeblack@google.com// for the sc_dt::sc_biguint<W> class.
119212922Sgabeblack@google.com//==============================================================================
119312922Sgabeblack@google.comSC_TEMPLATE
119412922Sgabeblack@google.comclass sc_inout<sc_dt::sc_biguint<W> > :
119512922Sgabeblack@google.com    public sc_port<sc_signal_inout_if<sc_dt::sc_biguint<W> >, 1,
119612922Sgabeblack@google.com                   SC_ONE_OR_MORE_BOUND>,
119712922Sgabeblack@google.com    public sc_dt::sc_value_base
119812922Sgabeblack@google.com{
119912922Sgabeblack@google.com  public:
120012922Sgabeblack@google.com
120112922Sgabeblack@google.com    // typedefs
120212922Sgabeblack@google.com
120312922Sgabeblack@google.com    typedef sc_dt::sc_biguint<W>                      data_type;
120412922Sgabeblack@google.com    typedef sc_signal_inout_if<sc_dt::sc_biguint<W> > if_type;
120512922Sgabeblack@google.com    typedef sc_port<if_type,1,SC_ONE_OR_MORE_BOUND>   base_type;
120612922Sgabeblack@google.com    typedef sc_inout<sc_dt::sc_biguint<W> >           this_type;
120712922Sgabeblack@google.com
120812922Sgabeblack@google.com    typedef if_type                                   inout_if_type;
120912922Sgabeblack@google.com    typedef base_type                                 inout_port_type;
121012922Sgabeblack@google.com
121112922Sgabeblack@google.com  public:
121212922Sgabeblack@google.com
121312922Sgabeblack@google.com    // bind methods and operators:
121412922Sgabeblack@google.com
121512922Sgabeblack@google.com    void bind( const inout_if_type& interface_ )
121612922Sgabeblack@google.com        { sc_port_base::bind( const_cast<inout_if_type&>( interface_) ); }
121712922Sgabeblack@google.com    void operator () ( const inout_if_type& interface_ )
121812922Sgabeblack@google.com        { sc_port_base::bind( const_cast<inout_if_type&>( interface_) ); }
121912922Sgabeblack@google.com    void bind( inout_port_type& parent_ )
122012922Sgabeblack@google.com        { sc_port_base::bind(parent_); }
122112922Sgabeblack@google.com    void operator () ( inout_port_type& parent_ )
122212922Sgabeblack@google.com        { sc_port_base::bind(parent_); }
122312922Sgabeblack@google.com
122412922Sgabeblack@google.com  protected:
122512922Sgabeblack@google.com    // called by pbind (for internal use only)
122612922Sgabeblack@google.com    virtual inline int vbind( sc_interface& interface_ )
122712922Sgabeblack@google.com        {
122812922Sgabeblack@google.com            return sc_port_b<if_type>::vbind( interface_ );
122912922Sgabeblack@google.com        }
123012922Sgabeblack@google.com    virtual inline int vbind( sc_port_base& parent_ )
123112922Sgabeblack@google.com        {
123212922Sgabeblack@google.com            inout_port_type* inout_parent = dynamic_cast<inout_port_type*>( &parent_ );
123312922Sgabeblack@google.com            if( inout_parent != 0 ) {
123412922Sgabeblack@google.com                sc_port_base::bind( *inout_parent );
123512922Sgabeblack@google.com                return 0;
123612922Sgabeblack@google.com            }
123712922Sgabeblack@google.com            // type mismatch
123812922Sgabeblack@google.com            return 2;
123912922Sgabeblack@google.com        }
124012922Sgabeblack@google.com
124112922Sgabeblack@google.com
124212922Sgabeblack@google.com    // constructors
124312922Sgabeblack@google.com
124412922Sgabeblack@google.com  public:
124512922Sgabeblack@google.com    sc_inout()
124612922Sgabeblack@google.com        : base_type(), m_init_val_p(0), m_traces( 0 )
124712922Sgabeblack@google.com        {}
124812922Sgabeblack@google.com
124912922Sgabeblack@google.com    explicit sc_inout( const char* name_ )
125012922Sgabeblack@google.com        : base_type( name_ ), m_init_val_p(0), m_traces( 0 )
125112922Sgabeblack@google.com        {}
125212922Sgabeblack@google.com
125312922Sgabeblack@google.com    explicit sc_inout( inout_if_type& interface_ )
125412922Sgabeblack@google.com        : base_type( interface_ ), m_init_val_p(0), m_traces( 0 )
125512922Sgabeblack@google.com        {}
125612922Sgabeblack@google.com
125712922Sgabeblack@google.com    sc_inout( const char* name_, inout_if_type& interface_ )
125812922Sgabeblack@google.com        : base_type( name_, interface_ ), m_init_val_p(0), m_traces( 0 )
125912922Sgabeblack@google.com        {}
126012922Sgabeblack@google.com
126112922Sgabeblack@google.com    explicit sc_inout( inout_port_type& parent_ )
126212922Sgabeblack@google.com        : base_type( parent_ ), m_init_val_p(0), m_traces( 0 )
126312922Sgabeblack@google.com        {}
126412922Sgabeblack@google.com
126512922Sgabeblack@google.com    sc_inout( const char* name_, inout_port_type& parent_ )
126612922Sgabeblack@google.com        : base_type( name_, parent_ ), m_init_val_p(0), m_traces( 0 )
126712922Sgabeblack@google.com        {}
126812922Sgabeblack@google.com
126912922Sgabeblack@google.com    sc_inout( this_type& parent_ )
127012922Sgabeblack@google.com        : base_type( parent_ ), m_init_val_p(0), m_traces( 0 )
127112922Sgabeblack@google.com        {}
127212922Sgabeblack@google.com
127312922Sgabeblack@google.com    sc_inout( const char* name_, this_type& parent_ )
127412922Sgabeblack@google.com        : base_type( name_, parent_ ), m_init_val_p(0), m_traces( 0 )
127512922Sgabeblack@google.com        {}
127612922Sgabeblack@google.com
127712922Sgabeblack@google.com
127812922Sgabeblack@google.com    // destructor
127912922Sgabeblack@google.com
128012922Sgabeblack@google.com    virtual inline ~sc_inout()
128112922Sgabeblack@google.com        {
128212922Sgabeblack@google.com            remove_traces();
128312922Sgabeblack@google.com        }
128412922Sgabeblack@google.com
128512922Sgabeblack@google.com    // bit and part selection
128612922Sgabeblack@google.com
128712922Sgabeblack@google.com    sc_dt::sc_unsigned_bitref_r operator [] ( int i ) const
128812922Sgabeblack@google.com        { return (*this)->read()[i]; }
128912922Sgabeblack@google.com    sc_dt::sc_unsigned_bitref_r bit( int i ) const
129012922Sgabeblack@google.com        { return (*this)->read()[i]; }
129112922Sgabeblack@google.com    sc_unsigned_sigref& operator [] ( int i )
129212922Sgabeblack@google.com        { return (*this)->select_part(i,i); }
129312922Sgabeblack@google.com    sc_unsigned_sigref& bit( int i )
129412922Sgabeblack@google.com        { return (*this)->select_part(i,i); }
129512922Sgabeblack@google.com    sc_dt::sc_unsigned_subref_r operator () ( int left, int right ) const
129612922Sgabeblack@google.com        { return (*this)->read()(left,right); }
129712922Sgabeblack@google.com    sc_dt::sc_unsigned_subref_r range( int left, int right ) const
129812922Sgabeblack@google.com        { return (*this)->read()(left,right); }
129912922Sgabeblack@google.com    sc_unsigned_sigref& operator () ( int left, int right )
130012922Sgabeblack@google.com        { return (*this)->select_part(left,right); }
130112922Sgabeblack@google.com    sc_unsigned_sigref& range( int left, int right )
130212922Sgabeblack@google.com        { return (*this)->select_part(left,right); }
130312922Sgabeblack@google.com
130412922Sgabeblack@google.com
130512922Sgabeblack@google.com    // interface access shortcut methods
130612922Sgabeblack@google.com
130712922Sgabeblack@google.com    // get the default event
130812922Sgabeblack@google.com
130912922Sgabeblack@google.com    const sc_event& default_event() const
131012922Sgabeblack@google.com        { return (*this)->value_changed_event(); }
131112922Sgabeblack@google.com
131212922Sgabeblack@google.com
131312922Sgabeblack@google.com    // get the value changed event
131412922Sgabeblack@google.com
131512922Sgabeblack@google.com    const sc_event& value_changed_event() const
131612922Sgabeblack@google.com        { return (*this)->value_changed_event(); }
131712922Sgabeblack@google.com
131812922Sgabeblack@google.com
131912922Sgabeblack@google.com    // read the current value
132012922Sgabeblack@google.com
132112922Sgabeblack@google.com    const sc_dt::sc_biguint<W>& read() const
132212922Sgabeblack@google.com        { return (*this)->read(); }
132312922Sgabeblack@google.com
132412922Sgabeblack@google.com    operator const sc_dt::sc_biguint<W>& () const
132512922Sgabeblack@google.com        { return (*this)->read(); }
132612922Sgabeblack@google.com
132712922Sgabeblack@google.com    // was there a value changed event?
132812922Sgabeblack@google.com
132912922Sgabeblack@google.com    bool event() const
133012922Sgabeblack@google.com        { return (*this)->event(); }
133112922Sgabeblack@google.com
133212922Sgabeblack@google.com
133312922Sgabeblack@google.com    // (other) event finder method(s)
133412922Sgabeblack@google.com
133512922Sgabeblack@google.com    sc_event_finder& value_changed() const
133612922Sgabeblack@google.com        {
133712922Sgabeblack@google.com            return *new sc_event_finder_t<inout_if_type>(
133812922Sgabeblack@google.com                *this, &inout_if_type::value_changed_event );
133912922Sgabeblack@google.com        }
134012922Sgabeblack@google.com
134112922Sgabeblack@google.com
134212922Sgabeblack@google.com
134312922Sgabeblack@google.com    // reduction methods:
134412922Sgabeblack@google.com
134512922Sgabeblack@google.com    inline bool and_reduce() const
134612922Sgabeblack@google.com        { return (*this)->read().and_reduce(); }
134712922Sgabeblack@google.com    inline bool nand_reduce() const
134812922Sgabeblack@google.com        { return (*this)->read().nand_reduce(); }
134912922Sgabeblack@google.com    inline bool nor_reduce() const
135012922Sgabeblack@google.com        { return (*this)->read().nor_reduce(); }
135112922Sgabeblack@google.com    inline bool or_reduce() const
135212922Sgabeblack@google.com        { return (*this)->read().or_reduce(); }
135312922Sgabeblack@google.com    inline bool xnor_reduce() const
135412922Sgabeblack@google.com        { return (*this)->read().xnor_reduce(); }
135512922Sgabeblack@google.com    inline bool xor_reduce() const
135612922Sgabeblack@google.com        { return (*this)->read().xor_reduce(); }
135712922Sgabeblack@google.com
135812922Sgabeblack@google.com
135912922Sgabeblack@google.com    // called when elaboration is done
136012922Sgabeblack@google.com    /*  WHEN DEFINING THIS METHOD IN A DERIVED CLASS, */
136112922Sgabeblack@google.com    /*  MAKE SURE THAT THIS METHOD IS CALLED AS WELL. */
136212922Sgabeblack@google.com
136312922Sgabeblack@google.com    virtual inline void end_of_elaboration()
136412922Sgabeblack@google.com        {
136512922Sgabeblack@google.com            if( m_init_val_p != 0 ) {
136612922Sgabeblack@google.com                (*this)->write( *m_init_val_p );
136712922Sgabeblack@google.com                delete m_init_val_p;
136812922Sgabeblack@google.com                m_init_val_p = 0;
136912922Sgabeblack@google.com            }
137012922Sgabeblack@google.com            if( m_traces != 0 ) {
137112922Sgabeblack@google.com                for( unsigned int i = 0; i < m_traces->size(); ++ i ) {
137212922Sgabeblack@google.com                    sc_trace_params* p = (*m_traces)[i];
137312922Sgabeblack@google.com                    sc_trace( p->tf, read(), p->name );
137412922Sgabeblack@google.com                }
137512922Sgabeblack@google.com                remove_traces();
137612922Sgabeblack@google.com            }
137712922Sgabeblack@google.com        }
137812922Sgabeblack@google.com
137912922Sgabeblack@google.com    virtual inline const char* kind() const
138012922Sgabeblack@google.com        { return "sc_inout"; }
138112922Sgabeblack@google.com
138212922Sgabeblack@google.com    // value initialization
138312922Sgabeblack@google.com
138412922Sgabeblack@google.com    inline void initialize( const sc_dt::sc_biguint<W>& value_ )
138512922Sgabeblack@google.com    {
138612922Sgabeblack@google.com        inout_if_type* iface = dynamic_cast<inout_if_type*>( this->get_interface() );
138712922Sgabeblack@google.com        if( iface != 0 ) {
138812922Sgabeblack@google.com            iface->write( value_ );
138912922Sgabeblack@google.com        } else {
139012922Sgabeblack@google.com            if( m_init_val_p == 0 ) {
139112922Sgabeblack@google.com                m_init_val_p = new sc_dt::sc_biguint<W>;
139212922Sgabeblack@google.com            }
139312922Sgabeblack@google.com            *m_init_val_p = value_;
139412922Sgabeblack@google.com        }
139512922Sgabeblack@google.com    }
139612922Sgabeblack@google.com
139712922Sgabeblack@google.com
139812922Sgabeblack@google.com    // called by sc_trace
139912922Sgabeblack@google.com    void add_trace( sc_trace_file* tf_, const std::string& name_ ) const
140012922Sgabeblack@google.com        {
140112922Sgabeblack@google.com            if( tf_ != 0 ) {
140212922Sgabeblack@google.com                if( m_traces == 0 ) {
140312922Sgabeblack@google.com                    m_traces = new sc_trace_params_vec;
140412922Sgabeblack@google.com                }
140512922Sgabeblack@google.com                m_traces->push_back( new sc_trace_params( tf_, name_ ) );
140612922Sgabeblack@google.com            }
140712922Sgabeblack@google.com        }
140812922Sgabeblack@google.com
140912922Sgabeblack@google.com
141012922Sgabeblack@google.com    // concatenation methods
141112922Sgabeblack@google.com
141212922Sgabeblack@google.com    virtual inline int concat_length(bool* xz_present_p) const
141312922Sgabeblack@google.com        { return (*this)->read().concat_length( xz_present_p ); }
141412922Sgabeblack@google.com    virtual inline sc_dt::uint64 concat_get_uint64() const
141512922Sgabeblack@google.com        { return (*this)->read().concat_get_uint64(); }
141612922Sgabeblack@google.com    virtual inline bool concat_get_ctrl( sc_dt::sc_digit* dst_p, int low_i ) const
141712922Sgabeblack@google.com        { return (*this)->read().concat_get_ctrl(dst_p, low_i); }
141812922Sgabeblack@google.com    virtual inline bool concat_get_data( sc_dt::sc_digit* dst_p, int low_i ) const
141912922Sgabeblack@google.com        { return (*this)->read().concat_get_data(dst_p, low_i); }
142012922Sgabeblack@google.com    virtual inline void concat_set(sc_dt::int64 src, int low_i)
142112922Sgabeblack@google.com        { *this = (src >> ((low_i < 64) ? low_i : 63)); }
142212922Sgabeblack@google.com#if 0 // ####
142312922Sgabeblack@google.com    virtual inline void concat_set(const sc_dt::sc_lv_base& src, int low_i)
142412922Sgabeblack@google.com        { *this = src >> low_i; }
142512922Sgabeblack@google.com#endif // 0 ####
142612922Sgabeblack@google.com    virtual inline void concat_set(const sc_dt::sc_signed& src, int low_i)
142712922Sgabeblack@google.com        { *this = (src >> low_i); }
142812922Sgabeblack@google.com    virtual inline void concat_set(const sc_dt::sc_unsigned& src, int low_i)
142912922Sgabeblack@google.com        { *this = (src >> low_i); }
143012922Sgabeblack@google.com    virtual inline void concat_set(sc_dt::uint64 src, int low_i)
143112922Sgabeblack@google.com        { *this = (low_i < 64 ) ? src >> low_i : (sc_dt::uint64)0; }
143212922Sgabeblack@google.com
143312922Sgabeblack@google.com    // assignment operators:
143412922Sgabeblack@google.com
143512922Sgabeblack@google.com  public:
143612922Sgabeblack@google.com	inline void operator = ( const this_type& new_val )
143712922Sgabeblack@google.com		{ (*this)->write( (const sc_dt::sc_unsigned&)new_val ); }
143812922Sgabeblack@google.com    inline void operator = ( const char* new_val )
143912922Sgabeblack@google.com		{ sc_dt::sc_unsigned aa(W); aa = new_val; (*this)->write( aa ); }
144012922Sgabeblack@google.com    inline void operator = ( sc_dt::uint64 new_val )
144112922Sgabeblack@google.com        { (*this)->write(new_val); }
144212922Sgabeblack@google.com    inline void operator = ( sc_dt::int64 new_val )
144312922Sgabeblack@google.com        { (*this)->write((sc_dt::int64)new_val); }
144412922Sgabeblack@google.com    inline void operator = ( int new_val )
144512922Sgabeblack@google.com        { (*this)->write((sc_dt::int64)new_val); }
144612922Sgabeblack@google.com    inline void operator = ( long new_val )
144712922Sgabeblack@google.com        { (*this)->write((sc_dt::int64)new_val); }
144812922Sgabeblack@google.com    inline void operator = ( short new_val )
144912922Sgabeblack@google.com        { (*this)->write((sc_dt::uint64)new_val); }
145012922Sgabeblack@google.com    inline void operator = ( unsigned int new_val )
145112922Sgabeblack@google.com        { (*this)->write((sc_dt::uint64)new_val); }
145212922Sgabeblack@google.com    inline void operator = ( unsigned long new_val )
145312922Sgabeblack@google.com        { (*this)->write((sc_dt::uint64)new_val); }
145412922Sgabeblack@google.com    inline void operator = ( unsigned short new_val )
145512922Sgabeblack@google.com        { (*this)->write((sc_dt::uint64)new_val); }
145612922Sgabeblack@google.com    template<typename T>
145712922Sgabeblack@google.com    inline void operator = ( const sc_dt::sc_generic_base<T>& new_val )
145812922Sgabeblack@google.com		{
145912922Sgabeblack@google.com			sc_dt::sc_unsigned temp(W);
146012922Sgabeblack@google.com			new_val->to_sc_unsigned(temp);
146112922Sgabeblack@google.com            (*this)->write(temp);
146212922Sgabeblack@google.com		}
146312922Sgabeblack@google.com    inline void operator = ( const sc_dt::sc_signed& new_val )
146412922Sgabeblack@google.com        { (*this)->write(new_val); }
146512922Sgabeblack@google.com    inline void operator = ( const sc_dt::sc_unsigned& new_val )
146612922Sgabeblack@google.com        { (*this)->write(new_val); }
146712922Sgabeblack@google.com    inline void operator = ( const sc_dt::sc_bv_base& new_val )
146812922Sgabeblack@google.com        { (*this)->write((sc_dt::sc_biguint<W>)new_val); }
146912922Sgabeblack@google.com    inline void operator = ( const sc_dt::sc_lv_base& new_val )
147012922Sgabeblack@google.com        { (*this)->write((sc_dt::sc_biguint<W>)new_val); }
147112922Sgabeblack@google.com
147212922Sgabeblack@google.com    inline void write( const sc_in<sc_dt::sc_biguint<W> >& new_val )
147312922Sgabeblack@google.com        { (*this)->write( new_val.read() ); }
147412922Sgabeblack@google.com    inline void write( const sc_inout<sc_dt::sc_biguint<W> >& new_val )
147512922Sgabeblack@google.com        { (*this)->write( new_val.read() ); }
147612922Sgabeblack@google.com    inline void write( const sc_dt::sc_biguint<W>& new_val )
147712922Sgabeblack@google.com        { (*this)->write( new_val ); }
147812922Sgabeblack@google.com
147912922Sgabeblack@google.com  protected:
148012922Sgabeblack@google.com    void remove_traces() const
148112922Sgabeblack@google.com        {
148212922Sgabeblack@google.com            if( m_traces != 0 ) {
148312922Sgabeblack@google.com                for( int i = m_traces->size() - 1; i >= 0; -- i ) {
148412922Sgabeblack@google.com                    delete (*m_traces)[i];
148512922Sgabeblack@google.com                }
148612922Sgabeblack@google.com                delete m_traces;
148712922Sgabeblack@google.com                m_traces = 0;
148812922Sgabeblack@google.com            }
148912922Sgabeblack@google.com        }
149012922Sgabeblack@google.com
149112922Sgabeblack@google.com    sc_dt::sc_biguint<W>*               m_init_val_p;
149212922Sgabeblack@google.com    mutable sc_trace_params_vec* m_traces;
149312922Sgabeblack@google.com
149412922Sgabeblack@google.com
149512922Sgabeblack@google.com  private:
149612922Sgabeblack@google.com
149712922Sgabeblack@google.com    // disabled
149812922Sgabeblack@google.com    sc_inout( const sc_inout<sc_dt::sc_biguint<W> >& );
149912922Sgabeblack@google.com
150012922Sgabeblack@google.com#ifdef __GNUC__
150112922Sgabeblack@google.com    // Needed to circumvent a problem in the g++-2.95.2 compiler:
150212922Sgabeblack@google.com    // This unused variable forces the compiler to instantiate
150312922Sgabeblack@google.com    // an object of T template so an implicit conversion from
150412922Sgabeblack@google.com    // read() to a C++ intrinsic data type will work.
150512922Sgabeblack@google.com    static data_type dummy;
150612922Sgabeblack@google.com#endif
150712922Sgabeblack@google.com
150812922Sgabeblack@google.com};
150912922Sgabeblack@google.com
151012922Sgabeblack@google.com
151112922Sgabeblack@google.com
151212922Sgabeblack@google.comSC_TEMPLATE
151312922Sgabeblack@google.cominline std::ostream& operator << (
151412922Sgabeblack@google.com    std::ostream& os, const sc_inout<sc_dt::sc_biguint<W> >& a )
151512922Sgabeblack@google.com{
151612922Sgabeblack@google.com    a.read().print( os );
151712922Sgabeblack@google.com    return os;
151812922Sgabeblack@google.com}
151912922Sgabeblack@google.com
152012922Sgabeblack@google.com
152112922Sgabeblack@google.com//==============================================================================
152212922Sgabeblack@google.com// CLASS sc_out<sc_dt::sc_biguint<W> >
152312922Sgabeblack@google.com//
152412922Sgabeblack@google.com// This class implements an output port whose target acts like an
152512922Sgabeblack@google.com// sc_dt::sc_biguint<W> data value. This class is a derivation of sc_inout, since
152612922Sgabeblack@google.com// output ports are really no different from input/output ports.
152712922Sgabeblack@google.com//==============================================================================
152812922Sgabeblack@google.comSC_TEMPLATE
152912922Sgabeblack@google.comclass sc_out<sc_dt::sc_biguint<W> > : public sc_inout<sc_dt::sc_biguint<W> >
153012922Sgabeblack@google.com{
153112922Sgabeblack@google.com  public:
153212922Sgabeblack@google.com
153312922Sgabeblack@google.com    // typedefs
153412922Sgabeblack@google.com
153512922Sgabeblack@google.com    typedef sc_dt::sc_biguint<W>                          data_type;
153612922Sgabeblack@google.com
153712922Sgabeblack@google.com    typedef sc_out<data_type>                   this_type;
153812922Sgabeblack@google.com    typedef sc_inout<data_type>                 base_type;
153912922Sgabeblack@google.com
154012922Sgabeblack@google.com    typedef typename base_type::inout_if_type   inout_if_type;
154112922Sgabeblack@google.com    typedef typename base_type::inout_port_type inout_port_type;
154212922Sgabeblack@google.com
154312922Sgabeblack@google.com    // constructors
154412922Sgabeblack@google.com
154512922Sgabeblack@google.com    sc_out()
154612922Sgabeblack@google.com        : base_type()
154712922Sgabeblack@google.com        {}
154812922Sgabeblack@google.com
154912922Sgabeblack@google.com    explicit sc_out( const char* name_ )
155012922Sgabeblack@google.com        : base_type( name_ )
155112922Sgabeblack@google.com        {}
155212922Sgabeblack@google.com
155312922Sgabeblack@google.com    explicit sc_out( inout_if_type& interface_ )
155412922Sgabeblack@google.com        : base_type( interface_ )
155512922Sgabeblack@google.com        {}
155612922Sgabeblack@google.com
155712922Sgabeblack@google.com    sc_out( const char* name_, inout_if_type& interface_ )
155812922Sgabeblack@google.com        : base_type( name_, interface_ )
155912922Sgabeblack@google.com        {}
156012922Sgabeblack@google.com
156112922Sgabeblack@google.com    explicit sc_out( inout_port_type& parent_ )
156212922Sgabeblack@google.com        : base_type( parent_ )
156312922Sgabeblack@google.com        {}
156412922Sgabeblack@google.com
156512922Sgabeblack@google.com    sc_out( const char* name_, inout_port_type& parent_ )
156612922Sgabeblack@google.com        : base_type( name_, parent_ )
156712922Sgabeblack@google.com        {}
156812922Sgabeblack@google.com
156912922Sgabeblack@google.com    sc_out( this_type& parent_ )
157012922Sgabeblack@google.com        : base_type( parent_ )
157112922Sgabeblack@google.com        {}
157212922Sgabeblack@google.com
157312922Sgabeblack@google.com    sc_out( const char* name_, this_type& parent_ )
157412922Sgabeblack@google.com        : base_type( name_, parent_ )
157512922Sgabeblack@google.com        {}
157612922Sgabeblack@google.com
157712922Sgabeblack@google.com
157812922Sgabeblack@google.com    // destructor (does nothing)
157912922Sgabeblack@google.com
158012922Sgabeblack@google.com    virtual inline ~sc_out()
158112922Sgabeblack@google.com        {}
158212922Sgabeblack@google.com
158312922Sgabeblack@google.com
158412922Sgabeblack@google.com    // assignment operators:
158512922Sgabeblack@google.com
158612922Sgabeblack@google.com  public:
158712922Sgabeblack@google.com	inline void operator = ( const this_type& new_val )
158812922Sgabeblack@google.com		{ (*this)->write( (const sc_dt::sc_unsigned&)new_val ); }
158912922Sgabeblack@google.com    inline void operator = ( const char* new_val )
159012922Sgabeblack@google.com		{ sc_dt::sc_unsigned aa(W); aa = new_val; (*this)->write( aa ); }
159112922Sgabeblack@google.com    inline void operator = ( sc_dt::uint64 new_val )
159212922Sgabeblack@google.com        { (*this)->write(new_val); }
159312922Sgabeblack@google.com    inline void operator = ( sc_dt::int64 new_val )
159412922Sgabeblack@google.com        { (*this)->write((sc_dt::uint64)new_val); }
159512922Sgabeblack@google.com    inline void operator = ( int new_val )
159612922Sgabeblack@google.com        { (*this)->write((sc_dt::uint64)new_val); }
159712922Sgabeblack@google.com    inline void operator = ( long new_val )
159812922Sgabeblack@google.com        { (*this)->write((sc_dt::uint64)new_val); }
159912922Sgabeblack@google.com    inline void operator = ( short new_val )
160012922Sgabeblack@google.com        { (*this)->write((sc_dt::uint64)new_val); }
160112922Sgabeblack@google.com    inline void operator = ( unsigned int new_val )
160212922Sgabeblack@google.com        { (*this)->write((sc_dt::uint64)new_val); }
160312922Sgabeblack@google.com    inline void operator = ( unsigned long new_val )
160412922Sgabeblack@google.com        { (*this)->write((sc_dt::uint64)new_val); }
160512922Sgabeblack@google.com    inline void operator = ( unsigned short new_val )
160612922Sgabeblack@google.com        { (*this)->write((sc_dt::uint64)new_val); }
160712922Sgabeblack@google.com    template<typename T>
160812922Sgabeblack@google.com    inline void operator = ( const sc_dt::sc_generic_base<T>& new_val )
160912922Sgabeblack@google.com		{
161012922Sgabeblack@google.com			sc_dt::sc_unsigned temp(W);
161112922Sgabeblack@google.com			new_val->to_sc_unsigned(temp);
161212922Sgabeblack@google.com            (*this)->write(temp);
161312922Sgabeblack@google.com		}
161412922Sgabeblack@google.com    inline void operator = ( const sc_dt::sc_signed& new_val )
161512922Sgabeblack@google.com        { (*this)->write(new_val); }
161612922Sgabeblack@google.com    inline void operator = ( const sc_dt::sc_unsigned& new_val )
161712922Sgabeblack@google.com        { (*this)->write(new_val); }
161812922Sgabeblack@google.com    inline void operator = ( const sc_dt::sc_bv_base& new_val )
161912922Sgabeblack@google.com        { (*this)->write((sc_dt::sc_biguint<W>)new_val); }
162012922Sgabeblack@google.com    inline void operator = ( const sc_dt::sc_lv_base& new_val )
162112922Sgabeblack@google.com        { (*this)->write((sc_dt::sc_biguint<W>)new_val); }
162212922Sgabeblack@google.com
162312922Sgabeblack@google.com  private:
162412922Sgabeblack@google.com
162512922Sgabeblack@google.com    // disabled
162612922Sgabeblack@google.com    sc_out( const this_type& );
162712922Sgabeblack@google.com};
162812922Sgabeblack@google.com
162912922Sgabeblack@google.com
163012922Sgabeblack@google.com
163112922Sgabeblack@google.com//------------------------------------------------------------------------------
163212922Sgabeblack@google.com//"sc_unsigned_sigref::initialize"
163312922Sgabeblack@google.com//
163412922Sgabeblack@google.com// This method initializes an object instance from the supplied arguments.
163512922Sgabeblack@google.com//     if_p   -> target of this selection.
163612922Sgabeblack@google.com//     left_  =  left-most bit in selection.
163712922Sgabeblack@google.com//     right_ =  right-most bit in selection.
163812922Sgabeblack@google.com//------------------------------------------------------------------------------
163912922Sgabeblack@google.cominline void sc_unsigned_sigref::initialize(
164012922Sgabeblack@google.com	sc_unsigned_part_if* if_p, int left_, int right_ )
164112922Sgabeblack@google.com{
164212922Sgabeblack@google.com    m_if_p = if_p;
164312922Sgabeblack@google.com    m_left = left_;
164412922Sgabeblack@google.com    m_right = right_;
164512922Sgabeblack@google.com	m_obj_p = if_p->part_read_target();
164612922Sgabeblack@google.com}
164712922Sgabeblack@google.com
164812922Sgabeblack@google.com
164912922Sgabeblack@google.com//------------------------------------------------------------------------------
165012922Sgabeblack@google.com//"sc_unsigned_sigref::operator ="
165112922Sgabeblack@google.com//
165212922Sgabeblack@google.com// These operators assign a value to the bits associated with this object
165312922Sgabeblack@google.com// instance within this object instance's target signal.
165412922Sgabeblack@google.com//------------------------------------------------------------------------------
165512922Sgabeblack@google.cominline void sc_unsigned_sigref::operator = ( sc_dt::uint64 v )
165612922Sgabeblack@google.com{
165712922Sgabeblack@google.com	m_if_p->write_part( v, m_left, m_right );
165812922Sgabeblack@google.com}
165912922Sgabeblack@google.com
166012922Sgabeblack@google.cominline void sc_unsigned_sigref::operator = ( const char* v )
166112922Sgabeblack@google.com{
166212922Sgabeblack@google.com	sc_dt::sc_unsigned tmp(length());
166312922Sgabeblack@google.com	tmp = v;
166412922Sgabeblack@google.com	*this = tmp;
166512922Sgabeblack@google.com}
166612922Sgabeblack@google.com
166712922Sgabeblack@google.cominline void sc_unsigned_sigref:: operator = ( sc_dt::int64 v )
166812922Sgabeblack@google.com{
166912922Sgabeblack@google.com    *this = (sc_dt::uint64)v;
167012922Sgabeblack@google.com}
167112922Sgabeblack@google.com
167212922Sgabeblack@google.cominline void sc_unsigned_sigref:: operator = ( int v )
167312922Sgabeblack@google.com{
167412922Sgabeblack@google.com    *this = (sc_dt::uint64)v;
167512922Sgabeblack@google.com}
167612922Sgabeblack@google.com
167712922Sgabeblack@google.cominline void sc_unsigned_sigref:: operator = ( long v )
167812922Sgabeblack@google.com{
167912922Sgabeblack@google.com    *this = (sc_dt::uint64)v;
168012922Sgabeblack@google.com}
168112922Sgabeblack@google.com
168212922Sgabeblack@google.cominline void sc_unsigned_sigref:: operator = ( unsigned int v )
168312922Sgabeblack@google.com{
168412922Sgabeblack@google.com    *this = (sc_dt::uint64)v;
168512922Sgabeblack@google.com}
168612922Sgabeblack@google.com
168712922Sgabeblack@google.cominline void sc_unsigned_sigref:: operator = ( unsigned long v )
168812922Sgabeblack@google.com{
168912922Sgabeblack@google.com    *this = (sc_dt::uint64)v;
169012922Sgabeblack@google.com}
169112922Sgabeblack@google.com
169212922Sgabeblack@google.comvoid sc_unsigned_sigref::operator = ( const sc_unsigned_sigref& v )
169312922Sgabeblack@google.com{
169412922Sgabeblack@google.com    *this = (sc_dt::sc_unsigned)v;
169512922Sgabeblack@google.com}
169612922Sgabeblack@google.com
169712922Sgabeblack@google.com
169812922Sgabeblack@google.cominline void sc_unsigned_sigref:: operator = ( const sc_dt::sc_signed& v )
169912922Sgabeblack@google.com{
170012922Sgabeblack@google.com	m_if_p->write_part( v, m_left, m_right );
170112922Sgabeblack@google.com}
170212922Sgabeblack@google.com
170312922Sgabeblack@google.cominline void sc_unsigned_sigref:: operator = ( const sc_dt::sc_unsigned& v )
170412922Sgabeblack@google.com{
170512922Sgabeblack@google.com	m_if_p->write_part( v, m_left, m_right );
170612922Sgabeblack@google.com}
170712922Sgabeblack@google.com
170812922Sgabeblack@google.comtemplate<typename T>
170912922Sgabeblack@google.cominline void sc_unsigned_sigref:: operator = (
171012922Sgabeblack@google.com	const sc_dt::sc_generic_base<T>& v )
171112922Sgabeblack@google.com{
171212922Sgabeblack@google.com	sc_dt::sc_unsigned temp(m_left-m_right+1);
171312922Sgabeblack@google.com    v->to_sc_unsigned(temp);
171412922Sgabeblack@google.com	m_if_p->write_part( temp, m_left, m_right );
171512922Sgabeblack@google.com}
171612922Sgabeblack@google.com
171712922Sgabeblack@google.com#undef SC_TEMPLATE
171812922Sgabeblack@google.com} // namespace sc_core
171912922Sgabeblack@google.com#endif // !defined(SC_SIGNAL_UNSIGNED_H)
172012922Sgabeblack@google.com
172112922Sgabeblack@google.comnamespace sc_core {
172212922Sgabeblack@google.com
172312922Sgabeblack@google.comextern
172412922Sgabeblack@google.comvoid
172512922Sgabeblack@google.comsc_signal_invalid_writer( const char* name,
172612922Sgabeblack@google.com                          const char* kind,
172712922Sgabeblack@google.com                          const char* first_writer,
172812922Sgabeblack@google.com                          const char* second_writer );
172912922Sgabeblack@google.com
173012922Sgabeblack@google.com//------------------------------------------------------------------------------
173112922Sgabeblack@google.com// POOL OF TEMPORARY INSTANCES OF sc_unsigned_sigref
173212922Sgabeblack@google.com//
173312922Sgabeblack@google.com// This allows use to pass const references for part and bit selections
173412922Sgabeblack@google.com// on sc_signal_signed object instances.
173512922Sgabeblack@google.com//------------------------------------------------------------------------------
173612922Sgabeblack@google.comsc_vpool<sc_unsigned_sigref> sc_unsigned_sigref::m_pool(8);
173712922Sgabeblack@google.com
173812922Sgabeblack@google.com
173912922Sgabeblack@google.com//------------------------------------------------------------------------------
174012922Sgabeblack@google.com//"sc_unsigned_part_if::default methods"
174112922Sgabeblack@google.com//
174212922Sgabeblack@google.com// These versions just produce errors if they are not overloaded but used.
174312922Sgabeblack@google.com//------------------------------------------------------------------------------
174412922Sgabeblack@google.comsc_dt::sc_unsigned* sc_unsigned_part_if::part_read_target()
174512922Sgabeblack@google.com{
174613324Sgabeblack@google.com    SC_REPORT_ERROR( SC_ID_OPERATION_ON_NON_SPECIALIZED_SIGNAL_, "int" );
174712922Sgabeblack@google.com    return 0;
174812922Sgabeblack@google.com}
174912922Sgabeblack@google.comsc_dt::sc_unsigned sc_unsigned_part_if::read_part( int /*left*/, int /*right*/ ) const
175012922Sgabeblack@google.com{
175113324Sgabeblack@google.com    SC_REPORT_ERROR( SC_ID_OPERATION_ON_NON_SPECIALIZED_SIGNAL_, "int" );
175212922Sgabeblack@google.com    return sc_dt::sc_unsigned(1);
175312922Sgabeblack@google.com}
175412922Sgabeblack@google.comsc_unsigned_sigref& sc_unsigned_part_if::select_part(int /*left*/, int /*right*/)
175512922Sgabeblack@google.com{
175613324Sgabeblack@google.com    SC_REPORT_ERROR( SC_ID_OPERATION_ON_NON_SPECIALIZED_SIGNAL_, "int" );
175712922Sgabeblack@google.com    return *(sc_unsigned_sigref*)0;
175812922Sgabeblack@google.com}
175912922Sgabeblack@google.comvoid sc_unsigned_part_if::write_part( sc_dt::int64 v, int /*left*/, int /*right*/ )
176012922Sgabeblack@google.com{
176113324Sgabeblack@google.com    SC_REPORT_ERROR( SC_ID_OPERATION_ON_NON_SPECIALIZED_SIGNAL_, "int" );
176212922Sgabeblack@google.com}
176312922Sgabeblack@google.comvoid sc_unsigned_part_if::write_part( sc_dt::uint64 v, int /*left*/, int /*right*/ )
176412922Sgabeblack@google.com{
176513324Sgabeblack@google.com    SC_REPORT_ERROR( SC_ID_OPERATION_ON_NON_SPECIALIZED_SIGNAL_, "int" );
176612922Sgabeblack@google.com}
176712922Sgabeblack@google.comvoid sc_unsigned_part_if::write_part(
176812922Sgabeblack@google.com    const sc_dt::sc_signed& v, int /*left*/, int /*right*/ )
176912922Sgabeblack@google.com{
177013324Sgabeblack@google.com    SC_REPORT_ERROR( SC_ID_OPERATION_ON_NON_SPECIALIZED_SIGNAL_, "int" );
177112922Sgabeblack@google.com}
177212922Sgabeblack@google.comvoid sc_unsigned_part_if::write_part(
177312922Sgabeblack@google.com    const sc_dt::sc_unsigned& v, int /*left*/, int /*right*/ )
177412922Sgabeblack@google.com{
177513324Sgabeblack@google.com    SC_REPORT_ERROR( SC_ID_OPERATION_ON_NON_SPECIALIZED_SIGNAL_, "int" );
177612922Sgabeblack@google.com}
177712922Sgabeblack@google.com
177812922Sgabeblack@google.com
177912922Sgabeblack@google.com
178012922Sgabeblack@google.com//------------------------------------------------------------------------------
178112922Sgabeblack@google.com//"sc_unsigned_sigref::concate_set"
178212922Sgabeblack@google.com//
178312922Sgabeblack@google.com// These methods assign this object instance's value from the supplied
178412922Sgabeblack@google.com// value starting at the supplied bit within that value.
178512922Sgabeblack@google.com//     src = value to use to set this object instance's value.
178612922Sgabeblack@google.com//     low_i = bit in src that is to be the low order bit of the value to set.
178712922Sgabeblack@google.com// #### OPTIMIZE
178812922Sgabeblack@google.com//------------------------------------------------------------------------------
178912922Sgabeblack@google.comvoid sc_unsigned_sigref::concat_set(sc_dt::int64 src, int low_i)
179012922Sgabeblack@google.com{
179112922Sgabeblack@google.com    sc_dt::int64 tmp;
179212922Sgabeblack@google.com    if ( low_i < 63 )
179312922Sgabeblack@google.com        tmp = src >> low_i;
179412922Sgabeblack@google.com    else
179512922Sgabeblack@google.com        tmp = (src < 0) ? -1 : 0;
179612922Sgabeblack@google.com    m_if_p->write_part( tmp, m_left, m_right );
179712922Sgabeblack@google.com}
179812922Sgabeblack@google.com
179912922Sgabeblack@google.com
180012922Sgabeblack@google.comvoid sc_unsigned_sigref::concat_set(const sc_dt::sc_signed& src, int low_i)
180112922Sgabeblack@google.com{
180212922Sgabeblack@google.com    m_if_p->write_part( src >> low_i, m_left, m_right );
180312922Sgabeblack@google.com}
180412922Sgabeblack@google.com
180512922Sgabeblack@google.com
180612922Sgabeblack@google.comvoid sc_unsigned_sigref::concat_set(const sc_dt::sc_lv_base& src, int low_i)
180712922Sgabeblack@google.com{
180812922Sgabeblack@google.com    sc_dt::sc_unsigned tmp(src.length());
180912922Sgabeblack@google.com    tmp = src;
181012922Sgabeblack@google.com    m_if_p->write_part( tmp >> low_i, m_left, m_right );
181112922Sgabeblack@google.com}
181212922Sgabeblack@google.com
181312922Sgabeblack@google.com
181412922Sgabeblack@google.comvoid sc_unsigned_sigref::concat_set(const sc_dt::sc_unsigned& src, int low_i)
181512922Sgabeblack@google.com{
181612922Sgabeblack@google.com    m_if_p->write_part( src >> low_i, m_left, m_right );
181712922Sgabeblack@google.com}
181812922Sgabeblack@google.com
181912922Sgabeblack@google.com
182012922Sgabeblack@google.comvoid sc_unsigned_sigref::concat_set(sc_dt::uint64 src, int low_i)
182112922Sgabeblack@google.com{
182212922Sgabeblack@google.com    sc_dt::uint64 tmp = (low_i < 63) ? (src >> low_i) : 0;
182312922Sgabeblack@google.com    m_if_p->write_part( tmp, m_left, m_right );
182412922Sgabeblack@google.com}
182512922Sgabeblack@google.com
182612922Sgabeblack@google.com
182712922Sgabeblack@google.com} // namespace sc_core
1828