dummy_port.hh revision 13892
113784Sgabeblack@google.com/* 213784Sgabeblack@google.com * Copyright 2019 Google, Inc. 313784Sgabeblack@google.com * 413784Sgabeblack@google.com * Redistribution and use in source and binary forms, with or without 513784Sgabeblack@google.com * modification, are permitted provided that the following conditions are 613784Sgabeblack@google.com * met: redistributions of source code must retain the above copyright 713784Sgabeblack@google.com * notice, this list of conditions and the following disclaimer; 813784Sgabeblack@google.com * redistributions in binary form must reproduce the above copyright 913784Sgabeblack@google.com * notice, this list of conditions and the following disclaimer in the 1013784Sgabeblack@google.com * documentation and/or other materials provided with the distribution; 1113784Sgabeblack@google.com * neither the name of the copyright holders nor the names of its 1213784Sgabeblack@google.com * contributors may be used to endorse or promote products derived from 1313784Sgabeblack@google.com * this software without specific prior written permission. 1413784Sgabeblack@google.com * 1513784Sgabeblack@google.com * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 1613784Sgabeblack@google.com * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 1713784Sgabeblack@google.com * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 1813784Sgabeblack@google.com * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 1913784Sgabeblack@google.com * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 2013784Sgabeblack@google.com * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 2113784Sgabeblack@google.com * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 2213784Sgabeblack@google.com * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 2313784Sgabeblack@google.com * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 2413784Sgabeblack@google.com * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 2513784Sgabeblack@google.com * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 2613784Sgabeblack@google.com * 2713784Sgabeblack@google.com * Authors: Gabe Black 2813784Sgabeblack@google.com */ 2913784Sgabeblack@google.com 3013784Sgabeblack@google.com#ifndef __MEM_RUBY_NETWORK_DUMMY_PORT_HH__ 3113784Sgabeblack@google.com#define __MEM_RUBY_NETWORK_DUMMY_PORT_HH__ 3213784Sgabeblack@google.com 3313784Sgabeblack@google.com#include "mem/port.hh" 3413784Sgabeblack@google.com 3513784Sgabeblack@google.comclass RubyDummyPort : public Port 3613784Sgabeblack@google.com{ 3713784Sgabeblack@google.com public: 3813784Sgabeblack@google.com RubyDummyPort() : Port("DummyPort", -1) {} 3913784Sgabeblack@google.com 4013784Sgabeblack@google.com void 4113784Sgabeblack@google.com bind(Port &peer) override 4213784Sgabeblack@google.com { 4313784Sgabeblack@google.com // No need to connect anything here currently. MessageBuffer 4413784Sgabeblack@google.com // port connections only serve to print the connections in 4513784Sgabeblack@google.com // the config output. 4613892Sgabeblack@google.com // TODO: Add real ports to MessageBuffers and use SimObject connect 4713784Sgabeblack@google.com // code below to bind MessageBuffer senders and receivers 4813784Sgabeblack@google.com } 4913784Sgabeblack@google.com void unbind() override {} 5013784Sgabeblack@google.com 5113784Sgabeblack@google.com static RubyDummyPort & 5213784Sgabeblack@google.com instance() 5313784Sgabeblack@google.com { 5413784Sgabeblack@google.com static RubyDummyPort dummy; 5513784Sgabeblack@google.com return dummy; 5613784Sgabeblack@google.com } 5713784Sgabeblack@google.com}; 5813784Sgabeblack@google.com 5913784Sgabeblack@google.com#endif //__MEM_RUBY_NETWORK_DUMMY_PORT_HH__ 60