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 --- 25 unchanged lines hidden (view full) --- 34 35#include "../utils/sc_report_handler.hh" 36#include "sc_module.hh" // for sc_gen_unique_name 37#include "sc_object.hh" 38 39namespace sc_gem5 40{ 41 |
42class Port; |
43 44}; 45 46namespace sc_core 47{ 48 49class sc_interface; 50 51enum sc_port_policy 52{ 53 SC_ONE_OR_MORE_BOUND, // Default 54 SC_ZERO_OR_MORE_BOUND, 55 SC_ALL_BOUND 56}; 57 58class sc_port_base : public sc_object 59{ 60 public: 61 sc_port_base(const char *name, int n, sc_port_policy p); |
62 virtual ~sc_port_base(); |
63 64 void warn_unimpl(const char *func) const; 65 66 int maxSize() const; 67 int size() const; 68 69 const char *kind() const { return "sc_port_base"; } 70 --- 9 unchanged lines hidden (view full) --- 80 virtual int vbind(sc_port_base &) = 0; 81 82 virtual void before_end_of_elaboration() = 0; 83 virtual void end_of_elaboration() = 0; 84 virtual void start_of_simulation() = 0; 85 virtual void end_of_simulation() = 0; 86 87 private: |
88 friend class ::sc_gem5::Port; |
89 friend class ::sc_gem5::Kernel; 90 |
91 virtual sc_interface *_gem5Interface(int n) const = 0; 92 virtual void _gem5AddInterface(sc_interface *i) = 0; 93 |
94 ::sc_gem5::Port *_gem5Port; |
95}; 96 97template <class IF> 98class sc_port_b : public sc_port_base 99{ 100 public: 101 void operator () (IF &i) { bind(i); } 102 void operator () (sc_port_b<IF> &p) { bind(p); } --- 159 unchanged lines hidden --- |