SystemC  Recoding Infrastructure for SystemC v0.6.3 derived from Accellera SystemC 2.3.1
Accellera SystemC proof-of-concept library
sc_signal.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.h -- The sc_signal<T> primitive channel 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 #ifndef SC_SIGNAL_H
28 #define SC_SIGNAL_H
29 
34 #include "sysc/kernel/sc_event.h"
35 #include "sysc/kernel/sc_process.h"
38 #include "sysc/tracing/sc_trace.h"
39 #include <typeinfo>
40 
41 namespace sc_core {
42 
43 // to avoid code bloat in sc_signal<T>
44 
45 extern void sc_deprecated_get_data_ref();
46 extern void sc_deprecated_get_new_value();
47 extern void sc_deprecated_trace();
48 extern sc_event * sc_lazy_kernel_event( sc_event**, const char* name );
49 
50 inline
51 bool
53 {
55  if( SC_UNLIKELY_(m_writer_p == 0) ) {
56  m_writer_p = writer_p;
57  } else if( SC_UNLIKELY_(m_writer_p != writer_p && writer_p != 0) ) {
59  // error has been suppressed, ignore check as well
60  // return false;
61  }
62  return true;
63 }
64 
65 /**************************************************************************/
71 template< class T, sc_writer_policy POL /* = SC_DEFAULT_WRITER_POLICY */ >
72 class sc_signal
73  : public sc_signal_inout_if<T>
74  , public sc_prim_channel
75  , protected sc_writer_policy_check<POL>
76 {
77 protected:
81 
82 public: // constructors and destructor:
83 
85  : sc_prim_channel( sc_gen_unique_name( "signal" ) ),
86  m_change_event_p( 0 ), m_cur_val( T() ),
87  m_change_stamp( ~sc_dt::UINT64_ONE ), m_new_val( T() )
88  {}
89 
90  explicit sc_signal( const char* name_)
91  : sc_prim_channel( name_ ),
92  m_change_event_p( 0 ), m_cur_val( T() ),
93  m_change_stamp( ~sc_dt::UINT64_ONE ), m_new_val( T() )
94  {}
95 
96  sc_signal( const char* name_, const T& initial_value_ )
97  : sc_prim_channel( name_ )
98  , m_change_event_p( 0 )
99  , m_cur_val( initial_value_ )
100  , m_change_stamp( ~sc_dt::UINT64_ONE )
101  , m_new_val( initial_value_ )
102  {}
103 
104  virtual ~sc_signal()
105  {
106  delete m_change_event_p;
107  }
108 
109 
110  // interface methods
111 
112  virtual void register_port( sc_port_base&, const char* );
113 
115  { return POL; }
116 
117  // get the default event
118  virtual const sc_event& default_event() const
119  { return value_changed_event(); }
120 
121  // get the value changed event
122  virtual const sc_event& value_changed_event() const
123  {
124  // 02/22/2015 GL: add a lock to protect concurrent communication
125  chnl_scoped_lock lock( m_mutex );
126 
128  , "value_changed_event");
129  // 02/22/2015 GL: return releases the lock
130  }
131 
132 
133  // read the current value
134  virtual const T& read() const
135  { return m_cur_val; }
136 
137  // get a reference to the current value (for tracing)
138  virtual const T& get_data_ref() const
139  {
140  // 02/22/2015 GL: add a lock to protect sc_deprecated_get_data_ref,
141  // later we may refine this for performance enhancement
142  chnl_scoped_lock lock( m_mutex );
143 
145  // 02/22/2015 GL: return releases the lock
146  }
147 
148 
149  // was there an event?
150  virtual bool event() const
152 
153  // write the new value
154  virtual void write( const T& );
155 
156 
157  // other methods
158 
159  operator const T& () const
160  { return read(); }
161 
162 
163  this_type& operator = ( const T& a )
164  { write( a ); return *this; }
165 
167  { write( a.read() ); return *this; }
168 
170  { write( a.read() ); return *this; }
171 
172 
173  const T& get_new_value() const
174  {
175  // 02/22/2015 GL: add a lock to protect sc_deprecated_get_new_value &
176  // m_new_val
177  chnl_scoped_lock lock( m_mutex );
179  // 02/22/2015 GL: return releases the lock
180  }
181 
182 
183  // 02/05/2015 GL: take care of tracing later, and sc_trace is not MT-safe
184  // now
185  void trace( sc_trace_file* tf ) const
186  {
188 # ifdef DEBUG_SYSTEMC
189  sc_trace( tf, read(), name() );
190 # else
191  if ( tf ) {}
192 # endif
193  }
194 
195 
196  virtual void print( ::std::ostream& = ::std::cout ) const;
197  virtual void dump( ::std::ostream& = ::std::cout ) const;
198 
199  virtual const char* kind() const
200  { return "sc_signal"; }
201 
202 protected:
203 
204  virtual void update();
205  void do_update();
206 
207 protected:
208 
211  sc_dt::uint64 m_change_stamp; // delta of last event
213 
214 private:
215 
216  // disabled
217  sc_signal( const this_type& );
218 };
219 
220 
221 // IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
222 
223 
224 template< class T, sc_writer_policy POL >
225 inline
226 void
228  , const char* if_typename_ )
229 {
230  bool is_output = std::string( if_typename_ ) == typeid(if_type).name();
231  if( !policy_type::check_port( this, &port_, is_output ) )
232  ((void)0); // fallback? error has been suppressed ...
233 }
234 
235 
236 // write the new value
237 
238 template< class T, sc_writer_policy POL >
239 inline
240 void
241 sc_signal<T,POL>::write( const T& value_ )
242 {
243  // 02/22/2015 GL: add a lock to protect concurrent communication, but
244  // sc_signal should have a single write port?!
245  chnl_scoped_lock lock( m_mutex );
246 
247  bool value_changed = !( m_cur_val == value_ );
248  if ( !policy_type::check_write(this, value_changed) )
249  return;
250 
251  m_new_val = value_;
252  if( value_changed ) {
253  request_update();
254  }
255  // 02/22/2015 GL: return releases the lock
256 }
257 
258 
259 template< class T, sc_writer_policy POL >
260 inline
261 void
262 sc_signal<T,POL>::print( ::std::ostream& os ) const
263 {
264  os << m_cur_val;
265 }
266 
267 template< class T, sc_writer_policy POL >
268 void
269 sc_signal<T,POL>::dump( ::std::ostream& os ) const
270 {
271  // 02/22/2015 GL: add a lock to protect concurrent communication
272  chnl_scoped_lock lock( m_mutex );
273 
274  os << " name = " << name() << ::std::endl;
275  os << " value = " << m_cur_val << ::std::endl;
276  os << "new value = " << m_new_val << ::std::endl;
277  // 02/22/2015 GL: return releases the lock
278 }
279 
280 
281 // 02/05/2015 GL: only executed by the root thread in the evaluate-update phase
282 template< class T, sc_writer_policy POL >
283 void
285 {
286  policy_type::update();
287  if( !( m_new_val == m_cur_val ) ) {
288  do_update();
289  }
290 }
291 
292 template< class T, sc_writer_policy POL >
293 void
295 {
296  m_cur_val = m_new_val;
297  if ( m_change_event_p ) m_change_event_p->notify(SC_ZERO_TIME); //DM
298  m_change_stamp = simcontext()->change_stamp();
299 }
300 
301 /**************************************************************************/
307 class sc_reset;
308 
309 template< sc_writer_policy POL >
310 class sc_signal<bool,POL>
311  : public sc_signal_inout_if<bool>
312  , public sc_prim_channel
313  , protected sc_writer_policy_check<POL>
314 {
315 protected:
319 
320 public: // constructors and destructor:
321 
323  : sc_prim_channel( sc_gen_unique_name( "signal" ) ),
324  m_change_event_p( 0 ),
325  m_cur_val( false ),
326  m_change_stamp( ~sc_dt::UINT64_ONE ),
327  m_negedge_event_p( 0 ),
328  m_new_val( false ),
329  m_posedge_event_p( 0 ),
330  m_reset_p( 0 )
331  {}
332 
333  explicit sc_signal( const char* name_ )
334  : sc_prim_channel( name_ ),
335  m_change_event_p( 0 ),
336  m_cur_val( false ),
337  m_change_stamp( ~sc_dt::UINT64_ONE ),
338  m_negedge_event_p( 0 ),
339  m_new_val( false ),
340  m_posedge_event_p( 0 ),
341  m_reset_p( 0 )
342  {}
343 
344  sc_signal( const char* name_, bool initial_value_ )
345  : sc_prim_channel( name_ )
346  , m_change_event_p( 0 )
347  , m_cur_val( initial_value_ )
348  , m_change_stamp( ~sc_dt::UINT64_ONE )
349  , m_negedge_event_p( 0 )
350  , m_new_val( initial_value_ )
351  , m_posedge_event_p( 0 )
352  , m_reset_p( 0 )
353  {}
354 
355  virtual ~sc_signal();
356 
357 
358  // interface methods
359 
360  virtual void register_port( sc_port_base&, const char* );
361 
363  { return POL; }
364 
365  // get the default event
366  virtual const sc_event& default_event() const
367  { return value_changed_event(); }
368 
369  // get the value changed event
370  virtual const sc_event& value_changed_event() const;
371 
372  // get the positive edge event
373  virtual const sc_event& posedge_event() const;
374 
375  // get the negative edge event
376  virtual const sc_event& negedge_event() const;
377 
378 
379  // read the current value
380  virtual const bool& read() const
381  { return m_cur_val; }
382 
383  // get a reference to the current value (for tracing)
384  virtual const bool& get_data_ref() const
385  {
386  // 02/22/2015 GL: add a lock to protect sc_deprecated_get_data_ref,
387  // later we may refine this for performance enhancement
388  chnl_scoped_lock lock( m_mutex );
389 
391  // 02/22/2015 GL: return releases the lock
392  }
393 
394 
395  // was there a value changed event?
396  virtual bool event() const
398 
399  // was there a positive edge event?
400  virtual bool posedge() const
401  { return ( event() && m_cur_val ); }
402 
403  // was there a negative edge event?
404  virtual bool negedge() const
405  { return ( event() && ! m_cur_val ); }
406 
407  // write the new value
408  virtual void write( const bool& );
409 
410  // other methods
411 
412  operator const bool& () const
413  { return read(); }
414 
415 
416  this_type& operator = ( const bool& a )
417  { write( a ); return *this; }
418 
420  { write( a.read() ); return *this; }
421 
423  { write( a.read() ); return *this; }
424 
425 
426  const bool& get_new_value() const
427  {
428  // 02/22/2015 GL: add a lock to protect sc_deprecated_get_new_value &
429  // m_new_val
430  chnl_scoped_lock lock( m_mutex );
431 
433  // 02/22/2015 GL: return releases the lock
434  }
435 
436 
437  // 02/08/2015 GL: take care of tracing later, and sc_trace is not MT-safe
438  // now
439  void trace( sc_trace_file* tf ) const
440  {
442 # ifdef DEBUG_SYSTEMC
443  sc_trace( tf, read(), name() );
444 # else
445  if ( tf ) {}
446 # endif
447  }
448 
449 
450  virtual void print( ::std::ostream& = ::std::cout ) const;
451  virtual void dump( ::std::ostream& = ::std::cout ) const;
452 
453  virtual const char* kind() const
454  { return "sc_signal"; }
455 
456 protected:
457 
458  virtual void update();
459  void do_update();
460 
461  virtual bool is_clock() const { return false; }
462 
463 protected:
464  mutable sc_event* m_change_event_p; // value change event if present.
465  bool m_cur_val; // current value of object.
466  sc_dt::uint64 m_change_stamp; // delta of last event
467  mutable sc_event* m_negedge_event_p; // negative edge event if present.
468  bool m_new_val; // next value of object.
469  mutable sc_event* m_posedge_event_p; // positive edge event if present.
470  mutable sc_reset* m_reset_p; // reset mechanism if present.
471 
472 private:
473 
474  // 02/08/2015 GL: taking care of sc_reset later, and this function is not
475  // MT-safe now
476  // reset creation
477  virtual sc_reset* is_reset() const;
478 
479  // disabled
480  sc_signal( const this_type& );
481 };
482 
483 
484 /**************************************************************************/
490 template< sc_writer_policy POL >
491 class sc_signal<sc_dt::sc_logic,POL>
492  : public sc_signal_inout_if<sc_dt::sc_logic>
493  , public sc_prim_channel
494  , protected sc_writer_policy_check<POL>
495 {
496 protected:
500 
501 public: // constructors and destructor:
502 
504  : sc_prim_channel( sc_gen_unique_name( "signal" ) ),
505  m_change_event_p( 0 ),
506  m_cur_val(),
507  m_change_stamp( ~sc_dt::UINT64_ONE ),
508  m_negedge_event_p( 0 ),
509  m_new_val(),
510  m_posedge_event_p( 0 )
511  {}
512 
513  explicit sc_signal( const char* name_ )
514  : sc_prim_channel( name_ ),
515  m_change_event_p( 0 ),
516  m_cur_val(),
517  m_change_stamp( ~sc_dt::UINT64_ONE ),
518  m_negedge_event_p( 0 ),
519  m_new_val(),
520  m_posedge_event_p( 0 )
521  {}
522 
523  sc_signal( const char* name_, sc_dt::sc_logic initial_value_ )
524  : sc_prim_channel( name_ )
525  , m_change_event_p( 0 )
526  , m_cur_val( initial_value_ )
527  , m_change_stamp( ~sc_dt::UINT64_ONE )
528  , m_negedge_event_p( 0 )
529  , m_new_val( initial_value_ )
530  , m_posedge_event_p( 0 )
531  {}
532 
533  virtual ~sc_signal()
534  {
535  delete m_change_event_p;
536  delete m_negedge_event_p;
537  delete m_posedge_event_p;
538  }
539 
540 
541  // interface methods
542 
543  virtual void register_port( sc_port_base&, const char* );
544 
546  { return POL; }
547 
548  // get the default event
549  virtual const sc_event& default_event() const
550  { return value_changed_event(); }
551 
552  // get the value changed event
553  virtual const sc_event& value_changed_event() const;
554 
555  // get the positive edge event
556  virtual const sc_event& posedge_event() const;
557 
558  // get the negative edge event
559  virtual const sc_event& negedge_event() const;
560 
561 
562  // read the current value
563  virtual const sc_dt::sc_logic& read() const
564  { return m_cur_val; }
565 
566  // get a reference to the current value (for tracing)
567  virtual const sc_dt::sc_logic& get_data_ref() const
568  {
569  // 02/22/2015 GL: add a lock to protect sc_deprecated_get_data_ref,
570  // later we may refine this for performance enhancement
571  chnl_scoped_lock lock( m_mutex );
572 
574  // 02/22/2015 GL: return releases the lock
575  }
576 
577 
578  // was there an event?
579  virtual bool event() const
581 
582  // was there a positive edge event?
583  virtual bool posedge() const
584  { return ( event() && m_cur_val == sc_dt::SC_LOGIC_1 ); }
585 
586  // was there a negative edge event?
587  virtual bool negedge() const
588  { return ( event() && m_cur_val == sc_dt::SC_LOGIC_0 ); }
589 
590 
591  // write the new value
592  virtual void write( const sc_dt::sc_logic& );
593 
594 
595  // other methods
596 
597  operator const sc_dt::sc_logic& () const
598  { return read(); }
599 
600 
602  { write( a ); return *this; }
603 
605  { write( a.read() ); return *this; }
606 
608  { write( a.read() ); return *this; }
609 
610 
612  {
613  // 02/22/2015 GL: add a lock to protect sc_deprecated_get_new_value &
614  // m_new_val
615  chnl_scoped_lock lock( m_mutex );
616 
618  // 02/22/2015 GL: return releases the lock
619  }
620 
621 
622  // 02/08/2015 GL: take care of tracing later, and sc_trace is not MT-safe
623  // now
624  void trace( sc_trace_file* tf ) const
625  {
627 # ifdef DEBUG_SYSTEMC
628  sc_trace( tf, read(), name() );
629 # else
630  if ( tf ) {}
631 # endif
632  }
633 
634  virtual void print( ::std::ostream& = ::std::cout ) const;
635  virtual void dump( ::std::ostream& = ::std::cout ) const;
636 
637  virtual const char* kind() const
638  { return "sc_signal"; }
639 
640 protected:
641 
642  virtual void update();
643  void do_update();
644 
645 protected:
646 
647  mutable sc_event* m_change_event_p; // value change event if present.
648  sc_dt::sc_logic m_cur_val; // current value of object.
649  sc_dt::uint64 m_change_stamp; // delta of last event
650  mutable sc_event* m_negedge_event_p; // negative edge event if present.
651  sc_dt::sc_logic m_new_val; // next value of object.
652  mutable sc_event* m_posedge_event_p; // positive edge event if present.
653 
654 private:
655 
656  // disabled
657  sc_signal( const this_type& );
658 };
659 
660 // ----------------------------------------------------------------------------
661 
662 template< typename T, sc_writer_policy POL >
663 inline
664 ::std::ostream&
665 operator << ( ::std::ostream& os, const sc_signal<T,POL>& a )
666 {
667  return ( os << a.read() );
668 }
669 
670 
671 
672 } // namespace sc_core
673 
674 /*****************************************************************************
675 
676  MODIFICATION LOG - modifiers, enter your name, affiliation, date and
677  changes you are making here.
678 
679  Name, Affiliation, Date:
680  Description of Modification:
681 
682  *****************************************************************************/
683 //$Log: sc_signal.h,v $
684 //Revision 1.16 2011/08/26 20:45:42 acg
685 // Andy Goodrich: moved the modification log to the end of the file to
686 // eliminate source line number skew when check-ins are done.
687 //
688 //Revision 1.15 2011/08/15 16:43:24 acg
689 // Torsten Maehne: changes to remove unused argument warnings.
690 //
691 //Revision 1.14 2011/06/25 17:08:38 acg
692 // Andy Goodrich: Jerome Cornet's changes to use libtool to build the
693 // library.
694 //
695 //Revision 1.13 2011/04/13 02:59:09 acg
696 // Andy Goodrich: made events internal to signals into kernel events.
697 //
698 //Revision 1.12 2011/04/08 18:22:46 acg
699 // Philipp A. Hartmann: use the context of the primitive channel to get
700 // the change stamp value.
701 //
702 //Revision 1.11 2011/04/05 20:48:09 acg
703 // Andy Goodrich: changes to make sure that event(), posedge() and negedge()
704 // only return true if the clock has not moved.
705 //
706 //Revision 1.10 2011/04/05 07:10:55 acg
707 // Andy Goodrich: added line that I dropped in sc_signal<sc_dt::sc_logic>.
708 //
709 //Revision 1.9 2011/04/05 06:15:18 acg
710 // Philipp A. Hartmann: sc_writer_policy: ignore no-ops in delta check.
711 //
712 //Revision 1.8 2011/03/23 16:17:22 acg
713 // Andy Goodrich: hide the sc_events that are kernel related.
714 //
715 //Revision 1.7 2011/03/06 15:55:08 acg
716 // Andy Goodrich: Changes for named events.
717 //
718 //Revision 1.6 2011/02/18 20:23:45 acg
719 // Andy Goodrich: Copyright update.
720 //
721 //Revision 1.5 2011/02/07 19:16:50 acg
722 // Andy Goodrich: changes for handling multiple writers.
723 //
724 //Revision 1.4 2011/01/25 20:50:37 acg
725 // Andy Goodrich: changes for IEEE 1666 2011.
726 //
727 //Revision 1.3 2010/12/07 19:50:37 acg
728 // Andy Goodrich: addition of writer policies, courtesy of Philipp Hartmann.
729 //
730 //Revision 1.1.1.1 2006/12/15 20:20:04 acg
731 //SystemC 2.3
732 //
733 //Revision 1.14 2006/05/08 17:52:47 acg
734 // Andy Goodrich:
735 // (1) added David Long's forward declarations for friend functions,
736 // methods, and operators to keep the Microsoft compiler happy.
737 // (2) Added delta_count() method to sc_prim_channel for use by
738 // sc_signal so that the friend declaration in sc_simcontext.h
739 // can be for a non-templated class (i.e., sc_prim_channel.)
740 //
741 //Revision 1.12 2006/04/11 23:11:57 acg
742 // Andy Goodrich: Changes for reset support that only includes
743 // sc_cthread_process instances.
744 //
745 //Revision 1.11 2006/03/13 20:19:44 acg
746 // Andy Goodrich: changed sc_event instances into pointers to sc_event instances
747 // that are allocated as needed. This saves considerable storage for large
748 // numbers of signals, etc.
749 //
750 //Revision 1.10 2006/01/26 21:00:50 acg
751 // Andy Goodrich: conversion to use sc_event::notify(SC_ZERO_TIME) instead of
752 // sc_event::notify_delayed()
753 //
754 //Revision 1.9 2006/01/24 20:45:41 acg
755 //Andy Goodrich: converted notify_delayed() calls into notify_next_delta() calls
756 //to eliminate deprecation warnings. notify_next_delta() is an implemenation-
757 //dependent method of sc_event. It is simpler than notify_delayed(), and should
758 //speed up simulation speeds.
759 //
760 //Revision 1.8 2006/01/19 19:18:25 acg
761 //Andy Goodrich: eliminated check_writer in favor of inline code within the
762 //write() method since we always execute the check_writer code even when
763 //check writing is turned off.
764 //
765 //Revision 1.7 2006/01/19 00:30:57 acg
766 //Andy Goodrich: Yet another implementation for disabling write checks on
767 //signals. This version uses an environment variable, SC_SIGNAL_WRITE_CHECK,
768 //that when set to DISABLE will turn off write checking.
769 //
770 //Revision 1.6 2006/01/18 21:42:26 acg
771 //Andy Goodrich: Changes for check writer support, and tightening up sc_clock
772 //port usage.
773 //
774 //Revision 1.5 2006/01/13 20:41:59 acg
775 //Andy Goodrich: Changes to add port registration to the things that are
776 //checked when SC_NO_WRITE_CHECK is not defined.
777 //
778 //Revision 1.4 2006/01/13 18:47:20 acg
779 //Reversed sense of multiwriter signal check. It now defaults to ON unless the
780 //user defines SC_NO_WRITE_CHEK before inclusion of the file.
781 //
782 //Revision 1.3 2006/01/03 23:18:26 acg
783 //Changed copyright to include 2006.
784 //
785 //Revision 1.2 2005/12/20 21:58:18 acg
786 //Removed Makefile.in, changed the event() methods to use sc_simcontext::event_occurred.
787 //
788 //Revision 1.1.1.1 2005/12/19 23:16:43 acg
789 //First check in of SystemC 2.1 into its own archive.
790 //
791 //Revision 1.19 2005/09/15 23:01:51 acg
792 //Added std:: prefix to appropriate methods and types to get around
793 //issues with the Edison Front End.
794 //
795 //Revision 1.18 2005/06/10 22:43:55 acg
796 //Added CVS change log annotation.
797 //
798 
799 #endif
800 
801 // Taf!
virtual sc_writer_policy get_writer_policy() const
Definition: sc_signal.h:362
sc_signal(const char *name_)
Definition: sc_signal.h:90
sc_event * m_change_event_p
Definition: sc_signal.h:209
virtual bool negedge() const
Definition: sc_signal.h:404
Specialization of sc_signal_in_if&lt;T&gt; for type bool.
Definition: sc_signal_ifs.h:96
const sc_dt::sc_logic & get_new_value() const
Definition: sc_signal.h:611
sc_event * sc_lazy_kernel_event(sc_event **, const char *name)
virtual const sc_event & default_event() const
Definition: sc_signal.h:118
virtual void dump(::std::ostream &=::std::cout) const
Definition: sc_signal.h:269
sc_object * get_current_writer() const
sc_writer_policy_check< POL > policy_type
Definition: sc_signal.h:318
sc_signal(const char *name_, sc_dt::sc_logic initial_value_)
Definition: sc_signal.h:523
CHNL_MTX_TYPE_ m_mutex
A mutex to protect concurrent communication.
virtual const sc_event & default_event() const
Definition: sc_signal.h:366
virtual sc_writer_policy get_writer_policy() const
Definition: sc_signal.h:114
const T & get_new_value() const
Definition: sc_signal.h:173
virtual const char * kind() const
Definition: sc_signal.h:199
void trace(sc_trace_file *tf) const
Definition: sc_signal.h:439
#define SC_UNLIKELY_(x)
Definition: sc_cmnhdr.h:85
virtual void update()
The update method (does nothing by default).
Definition: sc_signal.h:284
virtual const sc_event & default_event() const
Definition: sc_signal.h:549
const char * name() const
Definition: sc_object.h:71
sc_simcontext * simcontext() const
Definition: sc_object.h:85
void sc_deprecated_get_new_value()
bool event_occurred(sc_dt::uint64 last_change_count) const
sc_signal< bool, POL > this_type
Definition: sc_signal.h:317
sc_writer_policy_check< POL > policy_type
Definition: sc_signal.h:80
void sc_deprecated_trace()
virtual const char * kind() const
Definition: sc_signal.h:637
sc_signal< T, POL > this_type
Definition: sc_signal.h:79
The sc_signal&lt;T&gt; input/output interface class.
const char * sc_gen_unique_name(const char *, bool preserve_first)
The sc_signal&lt;T&gt; input interface class.
Definition: sc_signal_ifs.h:43
this_type & operator=(const T &a)
Definition: sc_signal.h:163
sc_signal_inout_if< T > if_type
Definition: sc_signal.h:78
const uint64 UINT64_ONE
virtual const bool & get_data_ref() const
Definition: sc_signal.h:384
virtual const sc_dt::sc_logic & get_data_ref() const
Definition: sc_signal.h:567
virtual void register_port(sc_port_base &, const char *)
Definition: sc_signal.h:227
virtual const sc_dt::sc_logic & read() const =0
virtual void write(const T &)
Definition: sc_signal.h:241
void trace(sc_trace_file *tf) const
Definition: sc_signal.h:624
virtual const sc_event & value_changed_event() const
Definition: sc_signal.h:122
virtual const T & read() const
Definition: sc_signal.h:134
The event class.
Definition: sc_event.h:260
uint64_t uint64
Definition: sc_nbdefs.h:183
void sc_deprecated_get_data_ref()
virtual bool event() const
Definition: sc_signal.h:396
sc_signal_inout_if< bool > if_type
Definition: sc_signal.h:316
Specialization of sc_signal_in_if&lt;T&gt; for type sc_dt::sc_logic.
Abstract base class for class sc_port_b.
Definition: sc_port.h:69
virtual const bool & read() const
Definition: sc_signal.h:380
bool check_write(sc_object *target, bool value_changed)
Definition: sc_signal.h:52
sc_dt::uint64 m_change_stamp
Definition: sc_signal.h:211
virtual ~sc_signal()
Definition: sc_signal.h:104
sc_writer_policy_check< POL > policy_type
Definition: sc_signal.h:499
virtual sc_writer_policy get_writer_policy() const
Definition: sc_signal.h:545
virtual const char * kind() const
Definition: sc_signal.h:453
const sc_logic SC_LOGIC_0
virtual bool is_clock() const
Definition: sc_signal.h:461
virtual void print(::std::ostream &=::std::cout) const
Definition: sc_signal.h:262
virtual const T & get_data_ref() const
Definition: sc_signal.h:138
const bool & get_new_value() const
Definition: sc_signal.h:426
sc_simcontext * sc_get_curr_simcontext()
sc_signal< sc_dt::sc_logic, POL > this_type
Definition: sc_signal.h:498
virtual bool event() const
Definition: sc_signal.h:150
const sc_time SC_ZERO_TIME
virtual const sc_dt::sc_logic & read() const
Definition: sc_signal.h:563
void trace(sc_trace_file *tf) const
Definition: sc_signal.h:185
sc_signal(const char *name_, bool initial_value_)
Definition: sc_signal.h:344
void sc_trace(sc_trace_file *tf, const sc_in< T > &port, const std::string &name)
const sc_logic SC_LOGIC_1
sc_signal_inout_if< sc_dt::sc_logic > if_type
Definition: sc_signal.h:497
virtual const bool & read() const =0
sc_signal(const char *name_, const T &initial_value_)
Definition: sc_signal.h:96
The chnl_scoped_lock class to lock (and automatically release) a mutex.
sc_signal(const char *name_)
Definition: sc_signal.h:333
virtual bool posedge() const
Definition: sc_signal.h:400
void sc_signal_invalid_writer(sc_object *target, sc_object *first_writer, sc_object *second_writer, bool check_delta)
Abstract base class of all primitive channel classes.
Abstract base class of all SystemC `simulation&#39; objects.
Definition: sc_object.h:51