WriteMask.cc revision 11307
111307Santhony.gutierrez@amd.com/* 211307Santhony.gutierrez@amd.com * Copyright (c) 2012-2015 Advanced Micro Devices, Inc. 311307Santhony.gutierrez@amd.com * All rights reserved. 411307Santhony.gutierrez@amd.com * 511307Santhony.gutierrez@amd.com * Redistribution and use in source and binary forms, with or without 611307Santhony.gutierrez@amd.com * modification, are permitted provided that the following conditions are 711307Santhony.gutierrez@amd.com * met: redistributions of source code must retain the above copyright 811307Santhony.gutierrez@amd.com * notice, this list of conditions and the following disclaimer; 911307Santhony.gutierrez@amd.com * redistributions in binary form must reproduce the above copyright 1011307Santhony.gutierrez@amd.com * notice, this list of conditions and the following disclaimer in the 1111307Santhony.gutierrez@amd.com * documentation and/or other materials provided with the distribution; 1211307Santhony.gutierrez@amd.com * neither the name of the copyright holders nor the names of its 1311307Santhony.gutierrez@amd.com * contributors may be used to endorse or promote products derived from 1411307Santhony.gutierrez@amd.com * this software without specific prior written permission. 1511307Santhony.gutierrez@amd.com * 1611307Santhony.gutierrez@amd.com * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 1711307Santhony.gutierrez@amd.com * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 1811307Santhony.gutierrez@amd.com * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 1911307Santhony.gutierrez@amd.com * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 2011307Santhony.gutierrez@amd.com * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 2111307Santhony.gutierrez@amd.com * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 2211307Santhony.gutierrez@amd.com * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 2311307Santhony.gutierrez@amd.com * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 2411307Santhony.gutierrez@amd.com * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 2511307Santhony.gutierrez@amd.com * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 2611307Santhony.gutierrez@amd.com * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 2711307Santhony.gutierrez@amd.com */ 2811307Santhony.gutierrez@amd.com 2911307Santhony.gutierrez@amd.com#include "mem/ruby/common/WriteMask.hh" 3011307Santhony.gutierrez@amd.com 3111307Santhony.gutierrez@amd.com#include <string> 3211307Santhony.gutierrez@amd.com 3311307Santhony.gutierrez@amd.com#include "mem/ruby/system/RubySystem.hh" 3411307Santhony.gutierrez@amd.com 3511307Santhony.gutierrez@amd.comvoid 3611307Santhony.gutierrez@amd.comWriteMask::print(std::ostream& out) const 3711307Santhony.gutierrez@amd.com{ 3811307Santhony.gutierrez@amd.com std::string str(mSize,'0'); 3911307Santhony.gutierrez@amd.com for (int i = 0; i < mSize; i++) { 4011307Santhony.gutierrez@amd.com str[i] = mMask[i] ? ('1') : ('0'); 4111307Santhony.gutierrez@amd.com } 4211307Santhony.gutierrez@amd.com out << "dirty mask=" 4311307Santhony.gutierrez@amd.com << str 4411307Santhony.gutierrez@amd.com << std::flush; 4511307Santhony.gutierrez@amd.com} 4611307Santhony.gutierrez@amd.com 47