gem5 v24.0.0.0
Loading...
Searching...
No Matches
ide_ctrl.cc
Go to the documentation of this file.
1/*
2 * Copyright 2022 Google, Inc.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
6 * met: redistributions of source code must retain the above copyright
7 * notice, this list of conditions and the following disclaimer;
8 * redistributions in binary form must reproduce the above copyright
9 * notice, this list of conditions and the following disclaimer in the
10 * documentation and/or other materials provided with the distribution;
11 * neither the name of the copyright holders nor the names of its
12 * contributors may be used to endorse or promote products derived from
13 * this software without specific prior written permission.
14 *
15 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
18 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
19 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
21 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28#include "dev/x86/ide_ctrl.hh"
29
30namespace gem5
31{
32
34{
35 for (int i = 0; i < p.port_int_primary_connection_count; i++) {
37 csprintf("%s.int_primary[%d]", name(), i), i, this));
38 }
39 for (int i = 0; i < p.port_int_secondary_connection_count; i++) {
41 csprintf("%s.int_secondary[%d]", name(), i), i, this));
42 }
43}
44
45void
47{
48 auto &pin = is_primary ? intPrimary : intSecondary;
49 for (auto *wire: pin)
50 wire->raise();
51}
52
53void
55{
56 auto &pin = is_primary ? intPrimary : intSecondary;
57 for (auto *wire: pin)
58 wire->lower();
59}
60
61Port &
62X86IdeController::getPort(const std::string &if_name, PortID idx)
63{
64 if (if_name == "int_primary")
65 return *intPrimary.at(idx);
66 else if (if_name == "int_secondary")
67 return *intSecondary.at(idx);
68 else
69 return IdeController::getPort(if_name, idx);
70}
71
72} // namespace gem5
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
Get a port with a given name and index.
DmaDeviceParams Params
Device model for an Intel PIIX4 IDE controller.
Definition ide_ctrl.hh:53
Ports are used to interface objects to each other.
Definition port.hh:62
std::vector< IntSourcePin< X86IdeController > * > intPrimary
Definition ide_ctrl.hh:43
void clearInterrupt(bool is_primary) override
Definition ide_ctrl.cc:54
X86IdeController(const Params &p)
Definition ide_ctrl.cc:33
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
Get a port with a given name and index.
Definition ide_ctrl.cc:62
void postInterrupt(bool is_primary) override
Definition ide_ctrl.cc:46
std::vector< IntSourcePin< X86IdeController > * > intSecondary
Definition ide_ctrl.hh:44
Bitfield< 7 > i
Definition misc_types.hh:67
Bitfield< 0 > p
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Definition binary32.hh:36
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
Definition types.hh:245
std::string csprintf(const char *format, const Args &...args)
Definition cprintf.hh:161
const std::string & name()
Definition trace.cc:48

Generated on Tue Jun 18 2024 16:24:03 for gem5 by doxygen 1.11.0