sc_clock.cc revision 12931
15548Snate@binkert.org/* 25548Snate@binkert.org * Copyright 2018 Google, Inc. 35548Snate@binkert.org * 45548Snate@binkert.org * Redistribution and use in source and binary forms, with or without 55548Snate@binkert.org * modification, are permitted provided that the following conditions are 65548Snate@binkert.org * met: redistributions of source code must retain the above copyright 75548Snate@binkert.org * notice, this list of conditions and the following disclaimer; 85548Snate@binkert.org * redistributions in binary form must reproduce the above copyright 95548Snate@binkert.org * notice, this list of conditions and the following disclaimer in the 105548Snate@binkert.org * documentation and/or other materials provided with the distribution; 115548Snate@binkert.org * neither the name of the copyright holders nor the names of its 125548Snate@binkert.org * contributors may be used to endorse or promote products derived from 135548Snate@binkert.org * this software without specific prior written permission. 145548Snate@binkert.org * 155548Snate@binkert.org * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 165548Snate@binkert.org * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 175548Snate@binkert.org * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 185548Snate@binkert.org * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 195548Snate@binkert.org * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 205548Snate@binkert.org * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 215548Snate@binkert.org * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 225548Snate@binkert.org * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 235548Snate@binkert.org * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 245548Snate@binkert.org * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 255548Snate@binkert.org * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 265548Snate@binkert.org * 275548Snate@binkert.org * Authors: Gabe Black 285548Snate@binkert.org */ 295548Snate@binkert.org 305548Snate@binkert.org#include "base/logging.hh" 315548Snate@binkert.org#include "systemc/ext/channel/sc_clock.hh" 325548Snate@binkert.org#include "systemc/ext/core/sc_module.hh" // for sc_gen_unique_name 335548Snate@binkert.org 345548Snate@binkert.orgnamespace sc_core 355548Snate@binkert.org{ 365548Snate@binkert.org 375548Snate@binkert.orgsc_clock::sc_clock() : 385548Snate@binkert.org sc_interface(), sc_signal<bool>(sc_gen_unique_name("clock")) 395548Snate@binkert.org{ 405548Snate@binkert.org warn("%s not implemented.\n", __PRETTY_FUNCTION__); 415548Snate@binkert.org} 425548Snate@binkert.org 435548Snate@binkert.orgsc_clock::sc_clock(const char *name) : sc_interface(), sc_signal<bool>(name) 4411235Sandreas.sandberg@arm.com{ 4511235Sandreas.sandberg@arm.com warn("%s not implemented.\n", __PRETTY_FUNCTION__); 4611235Sandreas.sandberg@arm.com} 4711235Sandreas.sandberg@arm.com 4811235Sandreas.sandberg@arm.comsc_clock::sc_clock(const char *name, const sc_time &period, 4911235Sandreas.sandberg@arm.com double duty_cycle, const sc_time &start_time, 5011235Sandreas.sandberg@arm.com bool posedge_first) 5111235Sandreas.sandberg@arm.com{ 5211235Sandreas.sandberg@arm.com warn("%s not implemented.\n", __PRETTY_FUNCTION__); 5311235Sandreas.sandberg@arm.com} 5411235Sandreas.sandberg@arm.com 5511235Sandreas.sandberg@arm.comsc_clock::sc_clock(const char *name, double period_v, sc_time_unit period_tu, 5611321Ssteve.reinhardt@amd.com double duty_cycle) 5711235Sandreas.sandberg@arm.com{ 5811235Sandreas.sandberg@arm.com warn("%s not implemented.\n", __PRETTY_FUNCTION__); 5911235Sandreas.sandberg@arm.com} 6011235Sandreas.sandberg@arm.com 6111235Sandreas.sandberg@arm.comsc_clock::sc_clock(const char *name, double period_v, sc_time_unit period_tu, 6211235Sandreas.sandberg@arm.com double duty_cycle, double start_time_v, 6311235Sandreas.sandberg@arm.com sc_time_unit start_time_tu, bool posedge_first) 6411235Sandreas.sandberg@arm.com{ 6511235Sandreas.sandberg@arm.com warn("%s not implemented.\n", __PRETTY_FUNCTION__); 6611235Sandreas.sandberg@arm.com} 6711235Sandreas.sandberg@arm.com 685548Snate@binkert.orgsc_clock::sc_clock(const char *name, double period, double duty_cycle, 69 double start_time, bool posedge_first) 70{ 71 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 72} 73 74sc_clock::~sc_clock() {} 75 76void 77sc_clock::write(const bool &) 78{ 79 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 80} 81 82const sc_time & 83sc_clock::period() const 84{ 85 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 86 return *(const sc_time *)nullptr; 87} 88 89double 90sc_clock::duty_cycle() const 91{ 92 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 93 return 0.0; 94} 95 96const sc_time & 97sc_clock::start_time() const 98{ 99 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 100 return *(const sc_time *)nullptr; 101} 102 103bool 104sc_clock::posedge_first() const 105{ 106 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 107 return false; 108} 109 110const sc_time & 111sc_clock::time_stamp() 112{ 113 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 114 return *(const sc_time *)nullptr; 115} 116 117const char *sc_clock::kind() const { return "sc_clock"; } 118 119void sc_clock::before_end_of_elaboration() {} 120 121} // namespace sc_core 122