SystemC  Recoding Infrastructure for SystemC v0.6.3 derived from Accellera SystemC 2.3.1
Accellera SystemC proof-of-concept library
sc_signal_resolved.h
Go to the documentation of this file.
1 /*****************************************************************************
2 
3  The following code is derived, directly or indirectly, from the SystemC
4  source code Copyright (c) 1996-2014 by all Contributors.
5  All Rights reserved.
6 
7  The contents of this file are subject to the restrictions and limitations
8  set forth in the SystemC Open Source License (the "License");
9  You may not use this file except in compliance with such restrictions and
10  limitations. You may obtain instructions on how to receive a copy of the
11  License at http://www.accellera.org/. Software distributed by Contributors
12  under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
13  ANY KIND, either express or implied. See the License for the specific
14  language governing rights and limitations under the License.
15 
16  *****************************************************************************/
17 
18 /*****************************************************************************
19 
20  sc_signal_resolved.h -- The resolved signal class.
21 
22  Original Author: Martin Janssen, Synopsys, Inc., 2001-05-21
23 
24  CHANGE LOG IS AT THE END OF THE FILE
25  *****************************************************************************/
26 
27 
28 #ifndef SC_SIGNAL_RESOLVED_H
29 #define SC_SIGNAL_RESOLVED_H
30 
31 
33 
34 namespace sc_core {
35 
36 class sc_process_b;
37 
39 
40 
41 /**************************************************************************/
48 : public sc_signal<sc_dt::sc_logic,SC_MANY_WRITERS>
49 {
50 public:
51 
52  // typedefs
53 
57 
58 public:
59 
60  // constructors
61 
63  base_type( sc_gen_unique_name( "signal_resolved" ) ), m_proc_vec(),
64  m_val_vec()
65  {}
66 
67  explicit sc_signal_resolved( const char* name_ ):
68  base_type( name_ ), m_proc_vec(), m_val_vec()
69  {}
70 
71  sc_signal_resolved( const char* name_, const data_type & initial_value_ )
72  : base_type( name_, initial_value_ )
73  , m_proc_vec()
74  , m_val_vec()
75  {}
76 
77  // interface methods
78 
79  virtual void register_port( sc_port_base&, const char* )
80  {}
81 
82 
83  // write the new value
84  virtual void write( const data_type& );
85 
86 
87  // other methods
88 
90  { write( a ); return *this; }
91 
93  { write( a.read() ); return *this; }
94 
95  virtual const char* kind() const
96  { return "sc_signal_resolved"; }
97 
98 protected:
99 
100  virtual void update();
101 
102 protected:
103 
104  std::vector<sc_process_b*> m_proc_vec; // processes writing this signal
105  std::vector<data_type> m_val_vec; // new values written this signal
106 
107 private:
108 
109  // disabled
110  sc_signal_resolved( const this_type& );
111 };
112 
113 } // namespace sc_core
114 
115 //$Log: sc_signal_resolved.h,v $
116 //Revision 1.6 2011/08/26 20:45:44 acg
117 // Andy Goodrich: moved the modification log to the end of the file to
118 // eliminate source line number skew when check-ins are done.
119 //
120 //Revision 1.5 2011/08/24 22:05:36 acg
121 // Torsten Maehne: initialization changes to remove warnings.
122 //
123 //Revision 1.4 2011/04/19 02:36:26 acg
124 // Philipp A. Hartmann: new aysnc_update and mutex support.
125 //
126 //Revision 1.3 2011/02/18 20:23:45 acg
127 // Andy Goodrich: Copyright update.
128 //
129 //Revision 1.2 2011/01/20 16:52:15 acg
130 // Andy Goodrich: changes for IEEE 1666 2011.
131 //
132 //Revision 1.1.1.1 2006/12/15 20:20:04 acg
133 //SystemC 2.3
134 //
135 //Revision 1.2 2006/01/03 23:18:26 acg
136 //Changed copyright to include 2006.
137 //
138 //Revision 1.1.1.1 2005/12/19 23:16:43 acg
139 //First check in of SystemC 2.1 into its own archive.
140 //
141 //Revision 1.10 2005/09/15 23:01:52 acg
142 //Added std:: prefix to appropriate methods and types to get around
143 //issues with the Edison Front End.
144 //
145 //Revision 1.9 2005/06/10 22:43:55 acg
146 //Added CVS change log annotation.
147 //
148 
149 #endif
150 
151 // Taf!
sc_process_b sc_process_b
Definition: sc_process.h:977
The resolved signal class.
virtual void update()
The update method (does nothing by default).
this_type & operator=(const data_type &a)
virtual void register_port(sc_port_base &, const char *)
sc_signal_resolved(const char *name_, const data_type &initial_value_)
sc_signal_resolved(const char *name_)
const char * sc_gen_unique_name(const char *, bool preserve_first)
const sc_dt::sc_logic_value_t sc_logic_resolution_tbl[4][4]
Definition: sc_signal_rv.h:44
virtual const T & read() const
Definition: sc_signal.h:134
std::vector< data_type > m_val_vec
sc_signal< sc_dt::sc_logic, SC_MANY_WRITERS > base_type
virtual const char * kind() const
Abstract base class for class sc_port_b.
Definition: sc_port.h:69
virtual void write(const data_type &)
sc_logic_value_t
Definition: sc_logic.h:85
std::vector< sc_process_b * > m_proc_vec