sc_module.cc revision 12930
1/* 2 * Copyright 2018 Google, Inc. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions are 6 * met: redistributions of source code must retain the above copyright 7 * notice, this list of conditions and the following disclaimer; 8 * redistributions in binary form must reproduce the above copyright 9 * notice, this list of conditions and the following disclaimer in the 10 * documentation and/or other materials provided with the distribution; 11 * neither the name of the copyright holders nor the names of its 12 * contributors may be used to endorse or promote products derived from 13 * this software without specific prior written permission. 14 * 15 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 16 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 17 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 18 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 * 27 * Authors: Gabe Black 28 */ 29 30#include <memory> 31#include <vector> 32 33#include "base/logging.hh" 34#include "systemc/ext/core/sc_module.hh" 35 36namespace sc_core 37{ 38 39sc_bind_proxy::sc_bind_proxy(const sc_interface &interface) 40{ 41 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 42} 43 44sc_bind_proxy::sc_bind_proxy(const sc_port_base &port) 45{ 46 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 47} 48 49const sc_bind_proxy SC_BIND_PROXY_NUL(*(const sc_port_base *)nullptr); 50 51sc_module::~sc_module() 52{ 53 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 54} 55 56const char * 57sc_module::kind() const 58{ 59 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 60 return ""; 61} 62 63const sc_bind_proxy SC_BIND_PROXY_NIL(*(const sc_port_base *)nullptr); 64 65void 66sc_module::operator () (const sc_bind_proxy &p001, 67 const sc_bind_proxy &p002, 68 const sc_bind_proxy &p003, 69 const sc_bind_proxy &p004, 70 const sc_bind_proxy &p005, 71 const sc_bind_proxy &p006, 72 const sc_bind_proxy &p007, 73 const sc_bind_proxy &p008, 74 const sc_bind_proxy &p009, 75 const sc_bind_proxy &p010, 76 const sc_bind_proxy &p011, 77 const sc_bind_proxy &p012, 78 const sc_bind_proxy &p013, 79 const sc_bind_proxy &p014, 80 const sc_bind_proxy &p015, 81 const sc_bind_proxy &p016, 82 const sc_bind_proxy &p017, 83 const sc_bind_proxy &p018, 84 const sc_bind_proxy &p019, 85 const sc_bind_proxy &p020, 86 const sc_bind_proxy &p021, 87 const sc_bind_proxy &p022, 88 const sc_bind_proxy &p023, 89 const sc_bind_proxy &p024, 90 const sc_bind_proxy &p025, 91 const sc_bind_proxy &p026, 92 const sc_bind_proxy &p027, 93 const sc_bind_proxy &p028, 94 const sc_bind_proxy &p029, 95 const sc_bind_proxy &p030, 96 const sc_bind_proxy &p031, 97 const sc_bind_proxy &p032, 98 const sc_bind_proxy &p033, 99 const sc_bind_proxy &p034, 100 const sc_bind_proxy &p035, 101 const sc_bind_proxy &p036, 102 const sc_bind_proxy &p037, 103 const sc_bind_proxy &p038, 104 const sc_bind_proxy &p039, 105 const sc_bind_proxy &p040, 106 const sc_bind_proxy &p041, 107 const sc_bind_proxy &p042, 108 const sc_bind_proxy &p043, 109 const sc_bind_proxy &p044, 110 const sc_bind_proxy &p045, 111 const sc_bind_proxy &p046, 112 const sc_bind_proxy &p047, 113 const sc_bind_proxy &p048, 114 const sc_bind_proxy &p049, 115 const sc_bind_proxy &p050, 116 const sc_bind_proxy &p051, 117 const sc_bind_proxy &p052, 118 const sc_bind_proxy &p053, 119 const sc_bind_proxy &p054, 120 const sc_bind_proxy &p055, 121 const sc_bind_proxy &p056, 122 const sc_bind_proxy &p057, 123 const sc_bind_proxy &p058, 124 const sc_bind_proxy &p059, 125 const sc_bind_proxy &p060, 126 const sc_bind_proxy &p061, 127 const sc_bind_proxy &p062, 128 const sc_bind_proxy &p063, 129 const sc_bind_proxy &p064) 130{ 131 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 132} 133 134const std::vector<sc_object *> & 135sc_module::get_child_objects() const 136{ 137 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 138 return *(const std::vector<sc_object *> *)nullptr; 139} 140 141const std::vector<sc_event *> & 142sc_module::get_child_events() const 143{ 144 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 145 return *(const std::vector<sc_event *> *)nullptr; 146} 147 148sc_module::sc_module(const sc_module_name &) 149{ 150 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 151} 152 153sc_module::sc_module() 154{ 155 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 156} 157 158sc_module::sc_module(const char *) 159{ 160 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 161} 162 163sc_module::sc_module(const std::string &) 164{ 165 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 166} 167 168void 169sc_module::reset_signal_is(const sc_in<bool> &, bool) 170{ 171 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 172} 173 174void 175sc_module::reset_signal_is(const sc_inout<bool> &, bool) 176{ 177 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 178} 179 180void 181sc_module::reset_signal_is(const sc_out<bool> &, bool) 182{ 183 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 184} 185 186void 187sc_module::reset_signal_is(const sc_signal_in_if<bool> &, bool) 188{ 189 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 190} 191 192 193void 194sc_module::async_reset_signal_is(const sc_in<bool> &, bool) 195{ 196 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 197} 198 199void 200sc_module::async_reset_signal_is(const sc_inout<bool> &, bool) 201{ 202 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 203} 204 205void 206sc_module::async_reset_signal_is(const sc_out<bool> &, bool) 207{ 208 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 209} 210 211void 212sc_module::async_reset_signal_is(const sc_signal_in_if<bool> &, bool) 213{ 214 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 215} 216 217 218void 219sc_module::dont_initialize() 220{ 221 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 222} 223 224void 225sc_module::set_stack_size(size_t) 226{ 227 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 228} 229 230 231void 232sc_module::next_trigger() 233{ 234 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 235} 236 237void 238sc_module::next_trigger(const sc_event &) 239{ 240 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 241} 242 243void 244sc_module::next_trigger(const sc_event_or_list &) 245{ 246 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 247} 248 249void 250sc_module::next_trigger(const sc_event_and_list &) 251{ 252 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 253} 254 255void 256sc_module::next_trigger(const sc_time &) 257{ 258 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 259} 260 261void 262sc_module::next_trigger(double, sc_time_unit) 263{ 264 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 265} 266 267void 268sc_module::next_trigger(const sc_time &, const sc_event &) 269{ 270 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 271} 272 273void 274sc_module::next_trigger(double, sc_time_unit, const sc_event &) 275{ 276 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 277} 278 279void 280sc_module::next_trigger(const sc_time &, const sc_event_or_list &) 281{ 282 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 283} 284 285void 286sc_module::next_trigger(double, sc_time_unit, const sc_event_or_list &) 287{ 288 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 289} 290 291void 292sc_module::next_trigger(const sc_time &, const sc_event_and_list &) 293{ 294 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 295} 296 297void 298sc_module::next_trigger(double, sc_time_unit, const sc_event_and_list &) 299{ 300 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 301} 302 303 304bool 305sc_module::timed_out() 306{ 307 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 308 return false; 309} 310 311 312void 313sc_module::wait() 314{ 315 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 316} 317 318void 319sc_module::wait(int) 320{ 321 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 322} 323 324void 325sc_module::wait(const sc_event &) 326{ 327 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 328} 329 330void 331sc_module::wait(const sc_event_or_list &) 332{ 333 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 334} 335 336void 337sc_module::wait(const sc_event_and_list &) 338{ 339 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 340} 341 342void 343sc_module::wait(const sc_time &) 344{ 345 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 346} 347 348void 349sc_module::wait(double, sc_time_unit) 350{ 351 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 352} 353 354void 355sc_module::wait(const sc_time &, const sc_event &) 356{ 357 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 358} 359 360void 361sc_module::wait(double, sc_time_unit, const sc_event &) 362{ 363 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 364} 365 366void 367sc_module::wait(const sc_time &, const sc_event_or_list &) 368{ 369 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 370} 371 372void 373sc_module::wait(double, sc_time_unit, const sc_event_or_list &) 374{ 375 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 376} 377 378void 379sc_module::wait(const sc_time &, const sc_event_and_list &) 380{ 381 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 382} 383 384void 385sc_module::wait(double, sc_time_unit, const sc_event_and_list &) 386{ 387 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 388} 389 390 391void 392sc_module::halt() 393{ 394 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 395} 396 397void 398sc_module::at_posedge(const sc_signal_in_if<bool> &) 399{ 400 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 401} 402 403void 404sc_module::at_posedge(const sc_signal_in_if<sc_dt::sc_logic> &) 405{ 406 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 407} 408 409void 410sc_module::at_negedge(const sc_signal_in_if<bool> &) 411{ 412 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 413} 414 415void 416sc_module::at_negedge(const sc_signal_in_if<sc_dt::sc_logic> &) 417{ 418 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 419} 420 421 422void 423next_trigger() 424{ 425 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 426} 427 428void 429next_trigger(const sc_event &) 430{ 431 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 432} 433 434void 435next_trigger(const sc_event_or_list &) 436{ 437 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 438} 439 440void 441next_trigger(const sc_event_and_list &) 442{ 443 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 444} 445 446void 447next_trigger(const sc_time &) 448{ 449 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 450} 451 452void 453next_trigger(double, sc_time_unit) 454{ 455 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 456} 457 458void 459next_trigger(const sc_time &, const sc_event &) 460{ 461 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 462} 463 464void 465next_trigger(double, sc_time_unit, const sc_event &) 466{ 467 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 468} 469 470void 471next_trigger(const sc_time &, const sc_event_or_list &) 472{ 473 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 474} 475 476void 477next_trigger(double, sc_time_unit, const sc_event_or_list &) 478{ 479 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 480} 481 482void 483next_trigger(const sc_time &, const sc_event_and_list &) 484{ 485 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 486} 487 488void 489next_trigger(double, sc_time_unit, const sc_event_and_list &) 490{ 491 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 492} 493 494bool 495timed_out() 496{ 497 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 498 return false; 499} 500 501 502void 503wait() 504{ 505 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 506} 507 508void 509wait(int) 510{ 511 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 512} 513 514void 515wait(const sc_event &) 516{ 517 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 518} 519 520void 521wait(const sc_event_or_list &) 522{ 523 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 524} 525 526void 527wait(const sc_event_and_list &) 528{ 529 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 530} 531 532void 533wait(const sc_time &) 534{ 535 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 536} 537 538void 539wait(double, sc_time_unit) 540{ 541 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 542} 543 544void 545wait(const sc_time &, const sc_event &) 546{ 547 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 548} 549 550void 551wait(double, sc_time_unit, const sc_event &) 552{ 553 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 554} 555 556void 557wait(const sc_time &, const sc_event_or_list &) 558{ 559 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 560} 561 562void 563wait(double, sc_time_unit, const sc_event_or_list &) 564{ 565 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 566} 567 568void 569wait(const sc_time &, const sc_event_and_list &) 570{ 571 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 572} 573 574void 575wait(double, sc_time_unit, const sc_event_and_list &) 576{ 577 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 578} 579 580void 581halt() 582{ 583 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 584} 585 586void 587at_posedge(const sc_signal_in_if<bool> &) 588{ 589 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 590} 591 592void 593at_posedge(const sc_signal_in_if<sc_dt::sc_logic> &) 594{ 595 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 596} 597 598void 599at_negedge(const sc_signal_in_if<bool> &) 600{ 601 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 602} 603 604void 605at_negedge(const sc_signal_in_if<sc_dt::sc_logic> &) 606{ 607 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 608} 609 610const char * 611sc_gen_unique_name(const char *) 612{ 613 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 614 return ""; 615} 616 617bool 618sc_hierarchical_name_exists(const char *name) 619{ 620 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 621 return false; 622} 623 624bool 625sc_start_of_simulation_invoked() 626{ 627 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 628 return false; 629} 630 631bool 632sc_end_of_simulation_invoked() 633{ 634 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 635 return false; 636} 637 638sc_module * 639sc_module_sc_new(sc_module *mod) 640{ 641 static std::vector<std::unique_ptr<sc_module> > modules; 642 modules.emplace_back(mod); 643 return mod; 644} 645 646} // namespace sc_core 647