source: sources/src/sc_clock.cc @ 12

Last change on this file since 12 was 1, checked in by buchmann, 17 years ago

Initial import from CVS repository

File size: 3.1 KB
Line 
1/*------------------------------------------------------------\
2|                                                             |
3| Tool    :                  systemcass                       |
4|                                                             |
5| File    :                  sc_clock.cc                      |
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#include"sc_clock.h"
38#include"assert.h"
39
40using namespace std;
41
42namespace sc_core {
43
44const char *const sc_clock::kind_string = "sc_clock";
45
46// ----------------------------------------------------------------------------
47//  CLASS : sc_clock
48//
49// ----------------------------------------------------------------------------
50
51
52sc_clock::sc_clock(): base_type() 
53{
54        init ();
55  posedge_first = true;
56}
57
58sc_clock::sc_clock(const char *name_): base_type(name_)
59{
60        init ();
61  posedge_first = true;
62}
63
64sc_clock::sc_clock(const char *name_,
65           const          sc_time& period_,
66           double         duty_cycle_,
67           const sc_time& start_time_,
68           bool           posedge_first_) : base_type(name_)
69{
70        init ();
71  ASSERT(period_     == 1);
72  ASSERT(duty_cycle_ == 0.5);
73  ASSERT(start_time_ == SC_ZERO_TIME);
74  posedge_first = posedge_first_;
75}
76
77sc_clock::sc_clock(const char *name_,
78           double         period_,
79           double         duty_cycle_,
80           double         start_time_,
81           bool           posedge_first_) : base_type(name_)
82{
83        init ();
84  ASSERT(period_     == 1);
85  ASSERT(duty_cycle_ == 0.5);
86  ASSERT(start_time_ == SC_ZERO_TIME);
87  posedge_first = posedge_first_;
88}
89
90sc_clock::~sc_clock ()
91{
92}
93
94void
95sc_clock::init ()
96{
97        set_kind (kind_string);
98}
99
100sc_clock::this_type& sc_clock::operator = ( const data_type& value_) {
101  write(value_);
102  return *this;
103}
104
105} // end of sc_core namespace
106
Note: See TracBrowser for help on using the repository browser.