CheckTable.cc (9108:ad76a669e9d9) | CheckTable.cc (10348:c91b23c72d5e) |
---|---|
1/* 2 * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood 3 * Copyright (c) 2009 Advanced Micro Devices, Inc. 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions are 8 * met: redistributions of source code must retain the above copyright --- 14 unchanged lines hidden (view full) --- 23 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 */ 29 30#include "base/intmath.hh" | 1/* 2 * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood 3 * Copyright (c) 2009 Advanced Micro Devices, Inc. 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions are 8 * met: redistributions of source code must retain the above copyright --- 14 unchanged lines hidden (view full) --- 23 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 */ 29 30#include "base/intmath.hh" |
31#include "base/random.hh" |
|
31#include "cpu/testers/rubytest/Check.hh" 32#include "cpu/testers/rubytest/CheckTable.hh" 33#include "debug/RubyTest.hh" 34 35CheckTable::CheckTable(int _num_writers, int _num_readers, RubyTester* _tester) 36 : m_num_writers(_num_writers), m_num_readers(_num_readers), 37 m_tester_ptr(_tester) 38{ --- 63 unchanged lines hidden (view full) --- 102 } 103 m_check_vector.push_back(check_ptr); 104} 105 106Check* 107CheckTable::getRandomCheck() 108{ 109 assert(m_check_vector.size() > 0); | 32#include "cpu/testers/rubytest/Check.hh" 33#include "cpu/testers/rubytest/CheckTable.hh" 34#include "debug/RubyTest.hh" 35 36CheckTable::CheckTable(int _num_writers, int _num_readers, RubyTester* _tester) 37 : m_num_writers(_num_writers), m_num_readers(_num_readers), 38 m_tester_ptr(_tester) 39{ --- 63 unchanged lines hidden (view full) --- 103 } 104 m_check_vector.push_back(check_ptr); 105} 106 107Check* 108CheckTable::getRandomCheck() 109{ 110 assert(m_check_vector.size() > 0); |
110 return m_check_vector[random() % m_check_vector.size()]; | 111 return m_check_vector[random_mt.random<unsigned>(0, m_check_vector.size() - 1)]; |
111} 112 113Check* 114CheckTable::getCheck(const Address& address) 115{ 116 DPRINTF(RubyTest, "Looking for check by address: %s", address); 117 118 m5::hash_map<Address, Check*>::iterator i = m_lookup_map.find(address); --- 13 unchanged lines hidden --- | 112} 113 114Check* 115CheckTable::getCheck(const Address& address) 116{ 117 DPRINTF(RubyTest, "Looking for check by address: %s", address); 118 119 m5::hash_map<Address, Check*>::iterator i = m_lookup_map.find(address); --- 13 unchanged lines hidden --- |