RubyDirectedTester.cc (8232:b28d06a175be) | RubyDirectedTester.cc (8851:7e966326ef5b) |
---|---|
1/* | 1/* |
2 * Copyright (c) 2012 ARM Limited 3 * All rights reserved 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software 9 * licensed hereunder. You may use the software subject to the license 10 * terms below provided that you ensure that this notice is replicated 11 * unmodified and in its entirety in all distributions of the software, 12 * modified or unmodified, in source code or in binary form. 13 * |
|
2 * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood 3 * Copyright (c) 2009-2010 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 9 * notice, this list of conditions and the following disclaimer; --- 25 unchanged lines hidden (view full) --- 35 36RubyDirectedTester::RubyDirectedTester(const Params *p) 37 : MemObject(p), directedStartEvent(this), 38 m_requests_to_complete(p->requests_to_complete), 39 generator(p->generator) 40{ 41 m_requests_completed = 0; 42 | 14 * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood 15 * Copyright (c) 2009-2010 Advanced Micro Devices, Inc. 16 * All rights reserved. 17 * 18 * Redistribution and use in source and binary forms, with or without 19 * modification, are permitted provided that the following conditions are 20 * met: redistributions of source code must retain the above copyright 21 * notice, this list of conditions and the following disclaimer; --- 25 unchanged lines hidden (view full) --- 47 48RubyDirectedTester::RubyDirectedTester(const Params *p) 49 : MemObject(p), directedStartEvent(this), 50 m_requests_to_complete(p->requests_to_complete), 51 generator(p->generator) 52{ 53 m_requests_completed = 0; 54 |
55 // create the ports 56 for (int i = 0; i < p->port_cpuPort_connection_count; ++i) { 57 ports.push_back(new CpuPort(csprintf("%s-port%d", name(), i), 58 this, i)); 59 } 60 |
|
43 // add the check start event to the event queue 44 schedule(directedStartEvent, 1); 45} 46 47RubyDirectedTester::~RubyDirectedTester() 48{ 49 for (int i = 0; i < ports.size(); i++) 50 delete ports[i]; --- 5 unchanged lines hidden (view full) --- 56 assert(ports.size() > 0); 57 generator->setDirectedTester(this); 58} 59 60Port * 61RubyDirectedTester::getPort(const std::string &if_name, int idx) 62{ 63 if (if_name != "cpuPort") { | 61 // add the check start event to the event queue 62 schedule(directedStartEvent, 1); 63} 64 65RubyDirectedTester::~RubyDirectedTester() 66{ 67 for (int i = 0; i < ports.size(); i++) 68 delete ports[i]; --- 5 unchanged lines hidden (view full) --- 74 assert(ports.size() > 0); 75 generator->setDirectedTester(this); 76} 77 78Port * 79RubyDirectedTester::getPort(const std::string &if_name, int idx) 80{ 81 if (if_name != "cpuPort") { |
64 panic("RubyDirectedTester::getPort: unknown port %s requested", if_name); | 82 panic("RubyDirectedTester::getPort: unknown port %s requested", 83 if_name); |
65 } 66 | 84 } 85 |
67 if (idx >= (int)ports.size()) { 68 ports.resize(idx + 1); | 86 if (idx >= static_cast<int>(ports.size())) { 87 panic("RubyDirectedTester::getPort: unknown index %d requested\n", idx); |
69 } 70 | 88 } 89 |
71 if (ports[idx] != NULL) { 72 panic("RubyDirectedTester::getPort: port %d already assigned", idx); 73 } 74 75 CpuPort *port = new CpuPort(csprintf("%s-port%d", name(), idx), this, idx); 76 77 ports[idx] = port; 78 return port; | 90 return ports[idx]; |
79} 80 81Tick 82RubyDirectedTester::CpuPort::recvAtomic(PacketPtr pkt) 83{ 84 panic("RubyDirectedTester::CpuPort::recvAtomic() not implemented!\n"); 85 return 0; 86} --- 51 unchanged lines hidden --- | 91} 92 93Tick 94RubyDirectedTester::CpuPort::recvAtomic(PacketPtr pkt) 95{ 96 panic("RubyDirectedTester::CpuPort::recvAtomic() not implemented!\n"); 97 return 0; 98} --- 51 unchanged lines hidden --- |