addr_range.hh (14047:91279ed7ec5e) addr_range.hh (14056:d8e21ca49871)
1/*
2 * Copyright (c) 2012, 2014, 2017-2019 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

--- 199 unchanged lines hidden (view full) ---

208 AddrRange(const std::vector<AddrRange>& ranges)
209 : _start(1), _end(0), intlvMatch(0)
210 {
211 if (!ranges.empty()) {
212 // get the values from the first one and check the others
213 _start = ranges.front()._start;
214 _end = ranges.front()._end;
215 masks = ranges.front().masks;
1/*
2 * Copyright (c) 2012, 2014, 2017-2019 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

--- 199 unchanged lines hidden (view full) ---

208 AddrRange(const std::vector<AddrRange>& ranges)
209 : _start(1), _end(0), intlvMatch(0)
210 {
211 if (!ranges.empty()) {
212 // get the values from the first one and check the others
213 _start = ranges.front()._start;
214 _end = ranges.front()._end;
215 masks = ranges.front().masks;
216 intlvMatch = ranges.front().intlvMatch;
217 }
218 // either merge if got all ranges or keep this equal to the single
219 // interleaved range
220 if (ranges.size() > 1) {
216
217 if (ranges.size() != (ULL(1) << masks.size()))
218 fatal("Got %d ranges spanning %d interleaving bits\n",
219 ranges.size(), masks.size());
220
221 uint8_t match = 0;
222 for (const auto& r : ranges) {
223 if (!mergesWith(r))
224 fatal("Can only merge ranges with the same start, end "
225 "and interleaving bits, %s %s\n", to_string(),
226 r.to_string());
227
228 if (r.intlvMatch != match)
229 fatal("Expected interleave match %d but got %d when "
230 "merging\n", match, r.intlvMatch);
231 ++match;
232 }
233 masks.clear();
221
222 if (ranges.size() != (ULL(1) << masks.size()))
223 fatal("Got %d ranges spanning %d interleaving bits\n",
224 ranges.size(), masks.size());
225
226 uint8_t match = 0;
227 for (const auto& r : ranges) {
228 if (!mergesWith(r))
229 fatal("Can only merge ranges with the same start, end "
230 "and interleaving bits, %s %s\n", to_string(),
231 r.to_string());
232
233 if (r.intlvMatch != match)
234 fatal("Expected interleave match %d but got %d when "
235 "merging\n", match, r.intlvMatch);
236 ++match;
237 }
238 masks.clear();
239 intlvMatch = 0;
234 }
235 }
236
237 /**
238 * Determine if the range is interleaved or not.
239 *
240 * @return true if interleaved
241 */

--- 300 unchanged lines hidden ---
240 }
241 }
242
243 /**
244 * Determine if the range is interleaved or not.
245 *
246 * @return true if interleaved
247 */

--- 300 unchanged lines hidden ---