etherint.cc revision 2665
17110Sgblack@eecs.umich.edu/* 27110Sgblack@eecs.umich.edu * Copyright (c) 2002-2005 The Regents of The University of Michigan 37110Sgblack@eecs.umich.edu * All rights reserved. 47110Sgblack@eecs.umich.edu * 57110Sgblack@eecs.umich.edu * Redistribution and use in source and binary forms, with or without 67110Sgblack@eecs.umich.edu * modification, are permitted provided that the following conditions are 77110Sgblack@eecs.umich.edu * met: redistributions of source code must retain the above copyright 87110Sgblack@eecs.umich.edu * notice, this list of conditions and the following disclaimer; 97110Sgblack@eecs.umich.edu * redistributions in binary form must reproduce the above copyright 107110Sgblack@eecs.umich.edu * notice, this list of conditions and the following disclaimer in the 117110Sgblack@eecs.umich.edu * documentation and/or other materials provided with the distribution; 127110Sgblack@eecs.umich.edu * neither the name of the copyright holders nor the names of its 137110Sgblack@eecs.umich.edu * contributors may be used to endorse or promote products derived from 147110Sgblack@eecs.umich.edu * this software without specific prior written permission. 156253Sgblack@eecs.umich.edu * 166253Sgblack@eecs.umich.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 176253Sgblack@eecs.umich.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 186253Sgblack@eecs.umich.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 196253Sgblack@eecs.umich.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 206253Sgblack@eecs.umich.edu * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 216253Sgblack@eecs.umich.edu * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 226253Sgblack@eecs.umich.edu * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 236253Sgblack@eecs.umich.edu * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 246253Sgblack@eecs.umich.edu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 256253Sgblack@eecs.umich.edu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 266253Sgblack@eecs.umich.edu * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 276253Sgblack@eecs.umich.edu * 286253Sgblack@eecs.umich.edu * Authors: Nathan Binkert 296253Sgblack@eecs.umich.edu */ 306253Sgblack@eecs.umich.edu 316253Sgblack@eecs.umich.edu#include "dev/etherint.hh" 326253Sgblack@eecs.umich.edu#include "base/misc.hh" 336253Sgblack@eecs.umich.edu#include "sim/param.hh" 346253Sgblack@eecs.umich.edu#include "sim/sim_object.hh" 356253Sgblack@eecs.umich.edu 366253Sgblack@eecs.umich.eduvoid 376253Sgblack@eecs.umich.eduEtherInt::setPeer(EtherInt *p) 386253Sgblack@eecs.umich.edu{ 396253Sgblack@eecs.umich.edu if (peer && peer != p) 406253Sgblack@eecs.umich.edu panic("You cannot change the peer once it is set.\n" 416253Sgblack@eecs.umich.edu "Current peer=%s Desired peer=%s", peer->name(), p->name()); 426253Sgblack@eecs.umich.edu 436253Sgblack@eecs.umich.edu peer = p; 446253Sgblack@eecs.umich.edu} 456253Sgblack@eecs.umich.edu 466253Sgblack@eecs.umich.eduDEFINE_SIM_OBJECT_CLASS_NAME("EtherInt", EtherInt) 476253Sgblack@eecs.umich.edu 486253Sgblack@eecs.umich.edu