[1] | 1 | /*------------------------------------------------------------\ |
---|
| 2 | | | |
---|
| 3 | | Tool : systemcass | |
---|
| 4 | | | |
---|
| 5 | | File : sc_clock_ext.h | |
---|
| 6 | | | |
---|
| 7 | | Author : Buchmann Richard | |
---|
| 8 | | Taktak Sami | |
---|
| 9 | | | |
---|
| 10 | | Date : 09_09_2005 | |
---|
| 11 | | | |
---|
| 12 | \------------------------------------------------------------*/ |
---|
| 13 | |
---|
| 14 | /* |
---|
| 15 | * This file is part of the Disydent Project |
---|
| 16 | * Copyright (C) Laboratoire LIP6 - Département ASIM |
---|
| 17 | * Universite Pierre et Marie Curie |
---|
| 18 | * |
---|
| 19 | * Home page : http://www-asim.lip6.fr/disydent |
---|
| 20 | * E-mail : mailto:richard.buchmann@lip6.fr |
---|
| 21 | * |
---|
| 22 | * This library is free software; you can redistribute it and/or modify it |
---|
| 23 | * under the terms of the GNU Library General Public License as published |
---|
| 24 | * by the Free Software Foundation; either version 2 of the License, or (at |
---|
| 25 | * your option) any later version. |
---|
| 26 | * |
---|
| 27 | * Disydent is distributed in the hope that it will be |
---|
| 28 | * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 29 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
---|
| 30 | * Public License for more details. |
---|
| 31 | * |
---|
| 32 | * You should have received a copy of the GNU General Public License along |
---|
| 33 | * with the GNU C Library; see the file COPYING. If not, write to the Free |
---|
| 34 | * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
---|
| 35 | */ |
---|
| 36 | |
---|
| 37 | #ifndef __SC_CLOCK_EXT_H__ |
---|
| 38 | #define __SC_CLOCK_EXT_H__ |
---|
| 39 | |
---|
| 40 | #include "sc_signal.h" |
---|
| 41 | |
---|
| 42 | namespace sc_core { |
---|
| 43 | |
---|
| 44 | // ---------------------------------------------------------------------------- |
---|
| 45 | // CLASS : sc_clock |
---|
| 46 | // |
---|
| 47 | // ---------------------------------------------------------------------------- |
---|
| 48 | |
---|
| 49 | class sc_clock : public sc_signal<bool> |
---|
| 50 | { |
---|
| 51 | ////// |
---|
| 52 | // Internal |
---|
| 53 | void init (); |
---|
| 54 | ////// |
---|
| 55 | private: |
---|
| 56 | typedef bool data_type; |
---|
| 57 | typedef sc_signal<bool> base_type; |
---|
| 58 | typedef sc_clock this_type; |
---|
| 59 | |
---|
| 60 | public: |
---|
| 61 | sc_clock(); |
---|
| 62 | /*virtual */~sc_clock(); |
---|
| 63 | // Changes from LRM : |
---|
| 64 | // We use "const char *" instead of "sc_module_name" because we don't need |
---|
| 65 | // to add a module name in the stack when constructing sc_clock ! |
---|
| 66 | explicit sc_clock(const char *name_); |
---|
| 67 | sc_clock(const char *name_, |
---|
| 68 | const sc_time& period_, |
---|
| 69 | double duty_cycle_ = 0.5, |
---|
| 70 | const sc_time& start_time_ = SC_ZERO_TIME, |
---|
| 71 | bool posedge_first_ = true ); |
---|
| 72 | sc_clock(const char *name_, |
---|
| 73 | double period_, |
---|
| 74 | double duty_cycle_ = 0.5, |
---|
| 75 | double start_time_ = 0.0, |
---|
| 76 | bool posedge_first_ = true ); |
---|
| 77 | |
---|
| 78 | static const char *const kind_string; |
---|
| 79 | //virtual const char *kind () const; |
---|
| 80 | |
---|
| 81 | /*inline*/ this_type& operator = ( const data_type& value_); |
---|
| 82 | |
---|
| 83 | bool posedge_first; |
---|
| 84 | }; |
---|
| 85 | |
---|
| 86 | } // end of sc_core namespace |
---|
| 87 | |
---|
| 88 | #endif /* __SC_CLOCK_EXT_H__ */ |
---|
| 89 | |
---|