SystemC  2.3.2
Accellera SystemC proof-of-concept library
sc_signal_resolved.h
Go to the documentation of this file.
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 */
34 #ifndef SC_SIGNAL_RESOLVED_H
35 #define SC_SIGNAL_RESOLVED_H
36 
37 
39 
40 #if defined(_MSC_VER) && !defined(SC_WIN_DLL_WARN)
41 #pragma warning(push)
42 #pragma warning(disable: 4251) // DLL import for std::vector
43 #endif
44 
45 namespace sc_core {
46 
47 class sc_process_b;
48 
50 
51 
59 : public sc_signal<sc_dt::sc_logic,SC_MANY_WRITERS>
60 {
61 public:
62 
63  // typedefs
64 
68 
69 public:
70 
71  // constructors
72 
74  : base_type( sc_gen_unique_name( "signal_resolved" ) )
75  , m_proc_vec(), m_val_vec()
76  {}
77 
78  explicit sc_signal_resolved( const char* name_ )
79  : base_type( name_ )
80  , m_proc_vec(), m_val_vec()
81  {}
82 
83  sc_signal_resolved( const char* name_, const value_type& initial_value_ )
84  : base_type( name_, initial_value_ )
85  , m_proc_vec() , m_val_vec()
86  {}
87 
88  // interface methods
89 
90  virtual void register_port( sc_port_base&, const char* )
91  {}
92 
93 
94  // write the new value
95  virtual void write( const value_type& );
96 
97 
98  // other methods
99  virtual const char* kind() const
100  { return "sc_signal_resolved"; }
101 
102 
103  // assignment
104  this_type& operator = ( const value_type& a )
105  { base_type::operator=(a); return *this; }
106 
107  this_type& operator = ( const sc_signal_in_if<value_type>& a )
108  { base_type::operator=(a); return *this; }
109 
110  this_type& operator = ( const this_type& a )
111  { base_type::operator=(a); return *this; }
112 
113 protected:
114  virtual void update();
115 
116 protected:
117  std::vector<sc_process_b*> m_proc_vec; // processes writing this signal
118  std::vector<value_type> m_val_vec; // new values written this signal
119 
120 private:
121 
122  // disabled
123  sc_signal_resolved( const this_type& );
124 };
125 
126 } // namespace sc_core
127 
128 #if defined(_MSC_VER) && !defined(SC_WIN_DLL_WARN)
129 #pragma warning(pop)
130 #endif
131 
132 //$Log: sc_signal_resolved.h,v $
133 //Revision 1.6 2011/08/26 20:45:44 acg
134 // Andy Goodrich: moved the modification log to the end of the file to
135 // eliminate source line number skew when check-ins are done.
136 //
137 //Revision 1.5 2011/08/24 22:05:36 acg
138 // Torsten Maehne: initialization changes to remove warnings.
139 //
140 //Revision 1.4 2011/04/19 02:36:26 acg
141 // Philipp A. Hartmann: new aysnc_update and mutex support.
142 //
143 //Revision 1.3 2011/02/18 20:23:45 acg
144 // Andy Goodrich: Copyright update.
145 //
146 //Revision 1.2 2011/01/20 16:52:15 acg
147 // Andy Goodrich: changes for IEEE 1666 2011.
148 //
149 //Revision 1.1.1.1 2006/12/15 20:20:04 acg
150 //SystemC 2.3
151 //
152 //Revision 1.2 2006/01/03 23:18:26 acg
153 //Changed copyright to include 2006.
154 //
155 //Revision 1.1.1.1 2005/12/19 23:16:43 acg
156 //First check in of SystemC 2.1 into its own archive.
157 //
158 //Revision 1.10 2005/09/15 23:01:52 acg
159 //Added std:: prefix to appropriate methods and types to get around
160 //issues with the Edison Front End.
161 //
162 //Revision 1.9 2005/06/10 22:43:55 acg
163 //Added CVS change log annotation.
164 //
165 
166 #endif
167 
168 // Taf!
The resolved signal class.
sc_signal< sc_dt::sc_logic, SC_MANY_WRITERS > base_type
The sc_signal<T> primitive channel class.
Abstract base class for class sc_port_b.
Definition: sc_port.h:81
Four-valued logic type.
Definition: sc_logic.h:104
sc_logic_value_t
Enumeration of values for sc_logic.
Definition: sc_logic.h:90
std::vector< value_type > m_val_vec
virtual void register_port(sc_port_base &, const char *)
SC_API const sc_dt::sc_logic_value_t sc_logic_resolution_tbl[4][4]
Definition: sc_signal_rv.h:41
sc_signal_resolved(const char *name_)
std::vector< sc_process_b * > m_proc_vec
virtual const char * kind() const
SC_API const char * sc_gen_unique_name(const char *, bool preserve_first)
sc_signal_resolved(const char *name_, const value_type &initial_value_)
sc_process_b sc_process_b
Definition: sc_process.h:458
#define SC_API
Definition: sc_cmnhdr.h:168