test02.cpp revision 12855:588919e0e4aa
1/*****************************************************************************
2
3  Licensed to Accellera Systems Initiative Inc. (Accellera) under one or
4  more contributor license agreements.  See the NOTICE file distributed
5  with this work for additional information regarding copyright ownership.
6  Accellera licenses this file to you under the Apache License, Version 2.0
7  (the "License"); you may not use this file except in compliance with the
8  License.  You may obtain a copy of the License at
9
10    http://www.apache.org/licenses/LICENSE-2.0
11
12  Unless required by applicable law or agreed to in writing, software
13  distributed under the License is distributed on an "AS IS" BASIS,
14  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
15  implied.  See the License for the specific language governing
16  permissions and limitations under the License.
17
18 *****************************************************************************/
19
20/*****************************************************************************
21
22  test02.cpp --
23
24  Original Author: Ucar Aziz, Synopsys, Inc., 2002-02-15
25                   Martin Janssen, Synopsys, Inc., 2002-02-15
26
27 *****************************************************************************/
28
29/*****************************************************************************
30
31  MODIFICATION LOG - modifiers, enter your name, affiliation, date and
32  changes you are making here.
33
34      Name, Affiliation, Date:
35  Description of Modification:
36
37 *****************************************************************************/
38
39// test of the sc_clock::print
40
41#include "systemc.h"
42
43
44int
45sc_main( int, char*[] )
46{
47    sc_time t1( 8, SC_NS );
48    sc_time t2( 2, SC_NS );
49
50
51    sc_clock c1( "c1", t1, 0.1, t2 );
52    cout <<  "m_cur_val for c1( \"c1\", t1, 0.1, t2 ) is: ";
53    c1.print(cout);
54    cout << "\n";
55
56    sc_clock c2( "c2", t1, 0.1, t2, false );
57    cout <<  "m_cur_val for c2( \"c2\", t1, 0.1, t2, false ) is: ";
58    c2.print(cout);
59    cout << "\n";
60
61
62    sc_clock c3( "c3", 8, SC_NS, 0.1 );
63    cout <<  "m_cur_val for c3( \"c3\", t1, 0.1, t2 ) is: ";
64    c3.print(cout);
65    cout << "\n";
66
67    sc_clock c4( "c4", 8, SC_NS, 0.1, false );
68    cout <<  "m_cur_val for c4( \"c4\", t1, 0.1, t2, false ) is: ";
69    c4.print(cout);
70    cout << "\n";
71
72    sc_clock c5( "c5", 8, SC_NS, 0.1, 2, SC_NS );
73    cout <<  "m_cur_val for c5( \"c5\", t1, 0.1, t2 ) is: ";
74    c5.print(cout);
75    cout<< "\n";
76
77    sc_clock c6( "c6", 8, SC_NS, 0.1, 2, SC_NS, false );
78    cout <<  "m_cur_val for c6( \"c6\", t1, 0.1, t2, false ) is: ";
79    c6.print(cout);
80    cout<< "\n";
81
82    return 0;
83}
84