1/*****************************************************************************
2
3  Licensed to Accellera Systems Initiative Inc. (Accellera) under one or
4  more contributor license agreements.  See the NOTICE file distributed
5  with this work for additional information regarding copyright ownership.
6  Accellera licenses this file to you under the Apache License, Version 2.0
7  (the "License"); you may not use this file except in compliance with the
8  License.  You may obtain a copy of the License at
9
10    http://www.apache.org/licenses/LICENSE-2.0
11
12  Unless required by applicable law or agreed to in writing, software
13  distributed under the License is distributed on an "AS IS" BASIS,
14  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
15  implied.  See the License for the specific language governing
16  permissions and limitations under the License.
17
18 *****************************************************************************/
19
20/*****************************************************************************
21
22  sc_signal_resolved.h -- The resolved signal class.
23
24  Original Author: Martin Janssen, Synopsys, Inc., 2001-05-21
25
26  CHANGE LOG IS AT THE END OF THE FILE
27 *****************************************************************************/
28
29
30#ifndef SC_SIGNAL_RESOLVED_H
31#define SC_SIGNAL_RESOLVED_H
32
33
34#include "sysc/communication/sc_signal.h"
35
36namespace sc_core {
37
38class sc_process_b;
39
40extern const sc_dt::sc_logic_value_t sc_logic_resolution_tbl[4][4];
41
42
43// ----------------------------------------------------------------------------
44//  CLASS : sc_signal_resolved
45//
46//  The resolved signal class.
47// ----------------------------------------------------------------------------
48
49class sc_signal_resolved
50: public sc_signal<sc_dt::sc_logic,SC_MANY_WRITERS>
51{
52public:
53
54    // typedefs
55
56    typedef sc_signal_resolved                         this_type;
57    typedef sc_signal<sc_dt::sc_logic,SC_MANY_WRITERS> base_type;
58    typedef sc_dt::sc_logic                            data_type;
59
60public:
61
62    // constructors
63
64    sc_signal_resolved() :
65        base_type( sc_gen_unique_name( "signal_resolved" ) ), m_proc_vec(),
66	m_val_vec()
67        {}
68
69    explicit sc_signal_resolved( const char* name_ ):
70        base_type( name_ ), m_proc_vec(), m_val_vec()
71	{}
72
73    sc_signal_resolved( const char* name_, const data_type & initial_value_ )
74      : base_type( name_, initial_value_ )
75      , m_proc_vec()
76      , m_val_vec()
77    {}
78
79    // interface methods
80
81    virtual void register_port( sc_port_base&, const char* )
82	{}
83
84
85    // write the new value
86    virtual void write( const data_type& );
87
88
89    // other methods
90
91    this_type& operator = ( const data_type& a )
92        { write( a ); return *this; }
93
94    this_type& operator = ( const this_type& a )
95        { write( a.read() ); return *this; }
96
97    virtual const char* kind() const
98        { return "sc_signal_resolved"; }
99
100protected:
101
102    virtual void update();
103
104protected:
105
106    std::vector<sc_process_b*> m_proc_vec; // processes writing this signal
107    std::vector<data_type>     m_val_vec;  // new values written this signal
108
109private:
110
111    // disabled
112    sc_signal_resolved( const this_type& );
113};
114
115} // namespace sc_core
116
117//$Log: sc_signal_resolved.h,v $
118//Revision 1.6  2011/08/26 20:45:44  acg
119// Andy Goodrich: moved the modification log to the end of the file to
120// eliminate source line number skew when check-ins are done.
121//
122//Revision 1.5  2011/08/24 22:05:36  acg
123// Torsten Maehne: initialization changes to remove warnings.
124//
125//Revision 1.4  2011/04/19 02:36:26  acg
126// Philipp A. Hartmann: new aysnc_update and mutex support.
127//
128//Revision 1.3  2011/02/18 20:23:45  acg
129// Andy Goodrich: Copyright update.
130//
131//Revision 1.2  2011/01/20 16:52:15  acg
132// Andy Goodrich: changes for IEEE 1666 2011.
133//
134//Revision 1.1.1.1  2006/12/15 20:20:04  acg
135//SystemC 2.3
136//
137//Revision 1.2  2006/01/03 23:18:26  acg
138//Changed copyright to include 2006.
139//
140//Revision 1.1.1.1  2005/12/19 23:16:43  acg
141//First check in of SystemC 2.1 into its own archive.
142//
143//Revision 1.10  2005/09/15 23:01:52  acg
144//Added std:: prefix to appropriate methods and types to get around
145//issues with the Edison Front End.
146//
147//Revision 1.9  2005/06/10 22:43:55  acg
148//Added CVS change log annotation.
149//
150
151#endif
152
153// Taf!
154