source: sources/src/sc_clock.cc @ 37

Last change on this file since 37 was 27, checked in by buchmann, 16 years ago

SystemCASS now uses autoconf/automake to build the API. Regression tests still
use the old Makefiles.
(thanks to Nicolas Pouillon)

The library directory no longer is "lib-arch-system". The directory now is "lib-linux". Everyone needs to pay attention about SYSTEMCASS environment variable.

Changes:

  • system header includes
  • Add includes to config.h (generated by autoconf/automake)
  • test:
    • linux preprocessor macro instead of _WIN32
    • CONFIG_DEBUG instead of DEBUG

Removes:

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