diff options
author | Andreas Sandberg <andreas.sandberg@arm.com> | 2016-01-29 12:14:21 +0000 |
---|---|---|
committer | Andreas Sandberg <andreas.sandberg@arm.com> | 2016-01-29 12:14:21 +0000 |
commit | b99fea78a6b0db9dcf7133c302991b8a7a8f8538 (patch) | |
tree | d92f89fbd5a03e9ce64ab74009687c1b8ec4f441 /ext/nomali/lib/regutils.hh | |
parent | 1285d639eba6b95e31fb2b4aacae524d04ddf981 (diff) | |
download | gem5-b99fea78a6b0db9dcf7133c302991b8a7a8f8538.tar.xz |
ext: Update NoMali to external rev f08e0a5
Update NoMali from external revision 9adf9d6 to f08e0a5 and bring in
the following changes:
f08e0a5 Add support for tracking address space state
f11099e Fix job slot register handling when running new jobs
b28c98e api: Add a reset callback
29ac4c3 tests: Update gitignore to cover all future test cases
1c6b893 Propagate reset calls to all job slots
8f8ec15 Remove redundant reg vector in MMU
85d90d2 tests: Fix incorrect extern declaration
Diffstat (limited to 'ext/nomali/lib/regutils.hh')
-rw-r--r-- | ext/nomali/lib/regutils.hh | 46 |
1 files changed, 45 insertions, 1 deletions
diff --git a/ext/nomali/lib/regutils.hh b/ext/nomali/lib/regutils.hh index 7957df2b7..841c684c5 100644 --- a/ext/nomali/lib/regutils.hh +++ b/ext/nomali/lib/regutils.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015 ARM Limited + * Copyright (c) 2014-2016 ARM Limited * All rights reserved * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -95,9 +95,53 @@ getJobSlotAddr(const RegAddr &addr) return addr - slot_base; } + /** Number of registers per job slot */ static const unsigned JSn_NO_REGS = 0x20; +/** + * Does this MMU register belong to an address space block? + * + * @return 1 if the address maps to a valid address space block, 0 + * otherwise. + */ +static inline bool +isAddrSpaceReg(const RegAddr &addr) +{ + return addr.value >= MMU_AS0 && addr.value <= 0x7FF; +} + +/** + * Get the address space number owning an address within the MMU + * block. + * + * @param addr Address relative to the JobControl block. + */ +static inline unsigned +getAddrSpaceNo(const RegAddr &addr) +{ + assert(isAddrSpaceReg(addr)); + return (addr.value - MMU_AS0) >> 6; +} + +/** + * Get a AS-relative address from a MMU-relative + * address. + * + * @param addr Address relative to the MMU block. + * @return Address relative the start of the address space block. + */ +static inline RegAddr +getAddrSpaceAddr(const RegAddr &addr) +{ + const unsigned as_no(getAddrSpaceNo(addr)); + const RegAddr as_base(RegAddr(MMU_AS0 + as_no * 0x40)); + return addr - as_base; +} + +/** Number of registers per address space */ +static const unsigned ASn_NO_REGS = 0x10; + } #endif //_LIBNOMALIMODEL_REGUTILS_HH |