sc_clock.cc revision 12931
112841Sgabeblack@google.com/*
212841Sgabeblack@google.com * Copyright 2018 Google, Inc.
312841Sgabeblack@google.com *
412841Sgabeblack@google.com * Redistribution and use in source and binary forms, with or without
512841Sgabeblack@google.com * modification, are permitted provided that the following conditions are
612841Sgabeblack@google.com * met: redistributions of source code must retain the above copyright
712841Sgabeblack@google.com * notice, this list of conditions and the following disclaimer;
812841Sgabeblack@google.com * redistributions in binary form must reproduce the above copyright
912841Sgabeblack@google.com * notice, this list of conditions and the following disclaimer in the
1012841Sgabeblack@google.com * documentation and/or other materials provided with the distribution;
1112841Sgabeblack@google.com * neither the name of the copyright holders nor the names of its
1212841Sgabeblack@google.com * contributors may be used to endorse or promote products derived from
1312841Sgabeblack@google.com * this software without specific prior written permission.
1412841Sgabeblack@google.com *
1512841Sgabeblack@google.com * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1612841Sgabeblack@google.com * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1712841Sgabeblack@google.com * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
1812841Sgabeblack@google.com * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
1912841Sgabeblack@google.com * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2012841Sgabeblack@google.com * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
2112841Sgabeblack@google.com * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2212841Sgabeblack@google.com * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2312841Sgabeblack@google.com * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2412841Sgabeblack@google.com * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2512841Sgabeblack@google.com * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2612841Sgabeblack@google.com *
2712841Sgabeblack@google.com * Authors: Gabe Black
2812841Sgabeblack@google.com */
2912841Sgabeblack@google.com
3012841Sgabeblack@google.com#include "base/logging.hh"
3113065Sgabeblack@google.com#include "systemc/ext/channel/sc_clock.hh"
3213065Sgabeblack@google.com#include "systemc/ext/core/sc_module.hh" // for sc_gen_unique_name
3313065Sgabeblack@google.com
3413065Sgabeblack@google.comnamespace sc_core
3513135Sgabeblack@google.com{
3613065Sgabeblack@google.com
3713065Sgabeblack@google.comsc_clock::sc_clock() :
3812841Sgabeblack@google.com        sc_interface(), sc_signal<bool>(sc_gen_unique_name("clock"))
3913200Sgabeblack@google.com{
4012841Sgabeblack@google.com    warn("%s not implemented.\n", __PRETTY_FUNCTION__);
4113297Sgabeblack@google.com}
4212841Sgabeblack@google.com
4313065Sgabeblack@google.comsc_clock::sc_clock(const char *name) : sc_interface(), sc_signal<bool>(name)
4413065Sgabeblack@google.com{
4513065Sgabeblack@google.com    warn("%s not implemented.\n", __PRETTY_FUNCTION__);
4613065Sgabeblack@google.com}
4713065Sgabeblack@google.com
4813065Sgabeblack@google.comsc_clock::sc_clock(const char *name, const sc_time &period,
4913065Sgabeblack@google.com                   double duty_cycle, const sc_time &start_time,
5013065Sgabeblack@google.com                   bool posedge_first)
5113190Sgabeblack@google.com{
5213065Sgabeblack@google.com    warn("%s not implemented.\n", __PRETTY_FUNCTION__);
5313065Sgabeblack@google.com}
5413065Sgabeblack@google.com
5513065Sgabeblack@google.comsc_clock::sc_clock(const char *name, double period_v, sc_time_unit period_tu,
5613065Sgabeblack@google.com                   double duty_cycle)
5713065Sgabeblack@google.com{
5813065Sgabeblack@google.com    warn("%s not implemented.\n", __PRETTY_FUNCTION__);
5913190Sgabeblack@google.com}
6013065Sgabeblack@google.com
6113065Sgabeblack@google.comsc_clock::sc_clock(const char *name, double period_v, sc_time_unit period_tu,
6213065Sgabeblack@google.com                   double duty_cycle, double start_time_v,
6313190Sgabeblack@google.com                   sc_time_unit start_time_tu, bool posedge_first)
6413190Sgabeblack@google.com{
6513190Sgabeblack@google.com    warn("%s not implemented.\n", __PRETTY_FUNCTION__);
6613190Sgabeblack@google.com}
6713190Sgabeblack@google.com
6813190Sgabeblack@google.comsc_clock::sc_clock(const char *name, double period, double duty_cycle,
6913190Sgabeblack@google.com                   double start_time, bool posedge_first)
7013190Sgabeblack@google.com{
7113194Sgabeblack@google.com    warn("%s not implemented.\n", __PRETTY_FUNCTION__);
7213135Sgabeblack@google.com}
7313065Sgabeblack@google.com
7413065Sgabeblack@google.comsc_clock::~sc_clock() {}
7513065Sgabeblack@google.com
7613065Sgabeblack@google.comvoid
7713065Sgabeblack@google.comsc_clock::write(const bool &)
7813065Sgabeblack@google.com{
7913190Sgabeblack@google.com    warn("%s not implemented.\n", __PRETTY_FUNCTION__);
8013190Sgabeblack@google.com}
8113065Sgabeblack@google.com
8213065Sgabeblack@google.comconst sc_time &
8313065Sgabeblack@google.comsc_clock::period() const
8413065Sgabeblack@google.com{
8513065Sgabeblack@google.com    warn("%s not implemented.\n", __PRETTY_FUNCTION__);
8613065Sgabeblack@google.com    return *(const sc_time *)nullptr;
8713065Sgabeblack@google.com}
8813065Sgabeblack@google.com
8913065Sgabeblack@google.comdouble
9013065Sgabeblack@google.comsc_clock::duty_cycle() const
9113065Sgabeblack@google.com{
9213065Sgabeblack@google.com    warn("%s not implemented.\n", __PRETTY_FUNCTION__);
9312841Sgabeblack@google.com    return 0.0;
9412841Sgabeblack@google.com}
9512841Sgabeblack@google.com
9612841Sgabeblack@google.comconst sc_time &
9713065Sgabeblack@google.comsc_clock::start_time() const
9813065Sgabeblack@google.com{
9913065Sgabeblack@google.com    warn("%s not implemented.\n", __PRETTY_FUNCTION__);
10012841Sgabeblack@google.com    return *(const sc_time *)nullptr;
10113065Sgabeblack@google.com}
10213065Sgabeblack@google.com
10313065Sgabeblack@google.combool
10412841Sgabeblack@google.comsc_clock::posedge_first() const
10512841Sgabeblack@google.com{
10612841Sgabeblack@google.com    warn("%s not implemented.\n", __PRETTY_FUNCTION__);
10713065Sgabeblack@google.com    return false;
10813065Sgabeblack@google.com}
10913065Sgabeblack@google.com
11013065Sgabeblack@google.comconst sc_time &
11112841Sgabeblack@google.comsc_clock::time_stamp()
11213297Sgabeblack@google.com{
11313297Sgabeblack@google.com    warn("%s not implemented.\n", __PRETTY_FUNCTION__);
11413297Sgabeblack@google.com    return *(const sc_time *)nullptr;
11513297Sgabeblack@google.com}
11613297Sgabeblack@google.com
11713297Sgabeblack@google.comconst char *sc_clock::kind() const { return "sc_clock"; }
11813297Sgabeblack@google.com
11913297Sgabeblack@google.comvoid sc_clock::before_end_of_elaboration() {}
12013297Sgabeblack@google.com
12113297Sgabeblack@google.com} // namespace sc_core
12213297Sgabeblack@google.com