changeset 89fd4a775287 in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=89fd4a775287
description:
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:
ext/nomali/.gitignore | 4 +-
ext/nomali/SConscript | 1 +
ext/nomali/include/libnomali/nomali.h | 5 +-
ext/nomali/lib/Rules.mk | 1 +
ext/nomali/lib/addrspace.cc | 125 +++++++++++++++++++++++++++++++++
ext/nomali/lib/addrspace.hh | 114 ++++++++++++++++++++++++++++++
ext/nomali/lib/jobcontrol.cc | 9 ++
ext/nomali/lib/jobcontrol.hh | 2 +
ext/nomali/lib/jobslot.cc | 13 +-
ext/nomali/lib/mmu.cc | 52 ++++++++++++-
ext/nomali/lib/mmu.hh | 12 ++-
ext/nomali/lib/nomali_api.cc | 17 ++++-
ext/nomali/lib/regutils.hh | 46 +++++++++++-
ext/nomali/tests/Rules.mk | 2 +
ext/nomali/tests/nomali_test_helpers.h | 16 +++-
ext/nomali/tests/nomali_test_ints.c | 2 -
ext/nomali/tests/nomali_test_mmu.c | 65 +++++++++++++++++
ext/nomali/tests/nomali_test_reset.c | 68 +++++++++++++++++
ext/nomali/tests/test_helpers.h | 2 +-
19 files changed, 535 insertions(+), 21 deletions(-)
diffs (truncated from 848 to 300 lines):
diff -r 3d7a85d71bd1 -r 89fd4a775287 ext/nomali/.gitignore
--- a/ext/nomali/.gitignore Fri Jan 22 10:42:13 2016 -0500
+++ b/ext/nomali/.gitignore Fri Jan 29 12:14:21 2016 +0000
@@ -1,6 +1,6 @@
/docs
-/tests/nomali_test0
-/tests/nomali_test_ints
+/tests/nomali_test*
+!/tests/nomali_test*.*
*~
*.o
*.d
diff -r 3d7a85d71bd1 -r 89fd4a775287 ext/nomali/SConscript
--- a/ext/nomali/SConscript Fri Jan 22 10:42:13 2016 -0500
+++ b/ext/nomali/SConscript Fri Jan 29 12:14:21 2016 +0000
@@ -53,6 +53,7 @@
"lib/mali_midgard.cc",
"lib/mali_t6xx.cc",
"lib/mali_t7xx.cc",
+ "lib/addrspace.cc",
"lib/mmu.cc",
"lib/nomali_api.cc",
]
diff -r 3d7a85d71bd1 -r 89fd4a775287 ext/nomali/include/libnomali/nomali.h
--- a/ext/nomali/include/libnomali/nomali.h Fri Jan 22 10:42:13 2016 -0500
+++ b/ext/nomali/include/libnomali/nomali.h Fri Jan 29 12:14:21 2016 +0000
@@ -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");
@@ -85,6 +85,8 @@
NOMALI_CALLBACK_MEMREAD,
/** Model write physical memory callback */
NOMALI_CALLBACK_MEMWRITE,
+ /** Model reset callback */
+ NOMALI_CALLBACK_RESET,
/** Number of defined callbacks */
NOMALI_CALLBACK_NUM_CALLBACKS
@@ -125,6 +127,7 @@
nomali_addr_t addr, uint32_t value);
uint32_t (*memread)(nomali_handle_t h, void *usr,
nomali_addr_t addr);
+ void (*reset)(nomali_handle_t h, void *usr);
} func;
} nomali_callback_t;
diff -r 3d7a85d71bd1 -r 89fd4a775287 ext/nomali/lib/Rules.mk
--- a/ext/nomali/lib/Rules.mk Fri Jan 22 10:42:13 2016 -0500
+++ b/ext/nomali/lib/Rules.mk Fri Jan 29 12:14:21 2016 +0000
@@ -26,6 +26,7 @@
gpucontrol.o \
jobcontrol.o \
jobslot.o \
+ addrspace.o \
mmu.o \
\
mali_midgard.o \
diff -r 3d7a85d71bd1 -r 89fd4a775287 ext/nomali/lib/addrspace.cc
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/ext/nomali/lib/addrspace.cc Fri Jan 29 12:14:21 2016 +0000
@@ -0,0 +1,125 @@
+/*
+ * Copyright (c) 2016 ARM Limited
+ * All rights reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Authors: Andreas Sandberg
+ */
+
+#include "jobslot.hh"
+
+#include <cassert>
+#include <cstdlib>
+
+#include "addrspace.hh"
+#include "gpu.hh"
+#include "regutils.hh"
+
+namespace NoMali {
+
+const std::vector<AddrSpace::cmd_t> AddrSpace::cmds {
+ &AddrSpace::cmdNop, // ASn_COMMAND_NOP
+ &AddrSpace::cmdUpdate, // ASn_COMMAND_UPDATE
+ &AddrSpace::cmdLock, // ASn_COMMAND_LOCK
+ &AddrSpace::cmdUnlock, // ASn_COMMAND_UNLOCK
+ &AddrSpace::cmdFlushPT, // ASn_COMMAND_FLUSH_PT
+ &AddrSpace::cmdFlushMem, // ASn_COMMAND_FLUSH_MEM
+};
+
+AddrSpace::AddrSpace(GPU &_gpu, MMU &_mmu, uint8_t _id)
+ : GPUBlock(_gpu, ASn_NO_REGS),
+ id(_id),
+ mmu(_mmu)
+{
+}
+
+AddrSpace::AddrSpace(AddrSpace &&rhs)
+ : GPUBlock(std::move(rhs)),
+ id(std::move(rhs.id)),
+ mmu(rhs.mmu)
+{
+}
+
+AddrSpace::~AddrSpace()
+{
+}
+
+void
+AddrSpace::writeReg(RegAddr addr, uint32_t value)
+{
+ switch (addr.value) {
+ case ASn_COMMAND:
+ asCommand(value);
+ break;
+
+ case ASn_TRANSTAB_LO:
+ case ASn_TRANSTAB_HI:
+ case ASn_MEMATTR_LO:
+ case ASn_MEMATTR_HI:
+ case ASn_LOCKADDR_LO:
+ case ASn_LOCKADDR_HI:
+ GPUBlock::writeReg(addr, value);
+ break;
+
+ default:
+ // Ignore writes by default
+ break;
+ };
+}
+
+void
+AddrSpace::asCommand(uint32_t cmd)
+{
+ if (cmd < cmds.size())
+ (this->*cmds[cmd])(cmd);
+}
+
+void
+AddrSpace::cmdNop(uint32_t cmd)
+{
+ assert(cmd == ASn_COMMAND_NOP);
+}
+
+
+void
+AddrSpace::cmdUpdate(uint32_t cmd)
+{
+ assert(cmd == ASn_COMMAND_UPDATE);
+}
+
+void
+AddrSpace::cmdLock(uint32_t cmd)
+{
+ assert(cmd == ASn_COMMAND_LOCK);
+}
+
+void
+AddrSpace::cmdUnlock(uint32_t cmd)
+{
+ assert(cmd == ASn_COMMAND_UNLOCK);
+}
+
+void
+AddrSpace::cmdFlushPT(uint32_t cmd)
+{
+ assert(cmd == ASn_COMMAND_FLUSH_PT);
+}
+
+void
+AddrSpace::cmdFlushMem(uint32_t cmd)
+{
+ assert(cmd == ASn_COMMAND_FLUSH_MEM);
+}
+
+}
diff -r 3d7a85d71bd1 -r 89fd4a775287 ext/nomali/lib/addrspace.hh
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/ext/nomali/lib/addrspace.hh Fri Jan 29 12:14:21 2016 +0000
@@ -0,0 +1,114 @@
+/*
+ * Copyright (c) 2016 ARM Limited
+ * All rights reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Authors: Andreas Sandberg
+ */
+
+#ifndef _LIBNOMALIMODEL_ADDRSPACE_HH
+#define _LIBNOMALIMODEL_ADDRSPACE_HH
+
+#include <vector>
+
+#include "gpublock.hh"
+#include "types.hh"
+
+namespace NoMali {
+
+class GPU;
+
+class MMU;
+
+/**
+ * Midgard job slot implementation.
+ *
+ * A job slot is a part of a JobControl block that controls the state
+ * of one out of 16 active jobs. Each slot can contain one running job
+ * and a pending job.
+ */
+class AddrSpace
+ : public GPUBlock
+{
+ public:
+ AddrSpace(GPU &_gpu, MMU &_mmu, uint8_t slot_id);
+ AddrSpace(AddrSpace &&rhs);
+ virtual ~AddrSpace();
+
+ void writeReg(RegAddr idx, uint32_t value) override;
+
+ protected:
+ /**
+ * @{
+ * @name Address Space Control
+ */
+
+
+ /** @} */
+
+ /**
+ * @{
+ * @name Job slot commands
+ */
+
+ /**
+ * Address space command dispatcher.
+ *
+ * This method is called whenever there is a write to the
+ * ASn_COMMAND register. The method uses a lookup table to call
+ * the right command handling method.
+ *
+ * @param cmd Command number (see the Midgard architecture
+ * specification)
+ */
+ void asCommand(uint32_t cmd);
+
+ /**
+ * Command handler for No-ops.
+ *
+ * @param cmd Command number (see the Midgard architecture
+ * specification)
+ */
+ void cmdNop(uint32_t cmd);
+
+ void cmdUpdate(uint32_t cmd);
+ void cmdLock(uint32_t cmd);
+ void cmdUnlock(uint32_t cmd);
+ void cmdFlushPT(uint32_t cmd);
+ void cmdFlushMem(uint32_t cmd);
+
+ /** @} */
+
+ /** Address space ID */
+ const uint8_t id;
+
+ /** Parent MMU block */
+ MMU &mmu;
+
+ private:
+ typedef void (AddrSpace::*cmd_t)(uint32_t);
+
+ /**
+ * Mapping between command IDs and command handling methods.
+ *
+ * @note The order of this vector <i>MUST</i> correspond to the
+ * address space command IDs in the Midgard architecture
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev