fastmodel: Fix an index parsing bug on PL330::gem5_getPort

Change-Id: I2cf1abb0eb21c6bd65f81628be52650ef9250fbb
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/59369
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Angie Lee
2022-05-04 06:22:09 +00:00
parent dfc8614ee2
commit a8e8d64e5d

View File

@@ -246,7 +246,7 @@ PL330::gem5_getPort(const std::string &if_name, int idx)
port = suffix[0] - '0';
} else if (suffix.size() == 2 && isdigit(suffix[0]) &&
isdigit(suffix[1])) {
port = (suffix[1] - '0') * 10 + (suffix[0] - '0');
port = (suffix[0] - '0') * 10 + (suffix[1] - '0');
}
if (port != -1 && port < irqPort.size())
return *irqPort[port].at(idx);