summaryrefslogtreecommitdiffstats
path: root/utils/regtools
diff options
context:
space:
mode:
Diffstat (limited to 'utils/regtools')
-rw-r--r--utils/regtools/qeditor/backend.cpp25
-rw-r--r--utils/regtools/qeditor/backend.h6
2 files changed, 25 insertions, 6 deletions
diff --git a/utils/regtools/qeditor/backend.cpp b/utils/regtools/qeditor/backend.cpp
index c2db1f2a3e..e9d7941ab1 100644
--- a/utils/regtools/qeditor/backend.cpp
+++ b/utils/regtools/qeditor/backend.cpp
@@ -587,10 +587,17 @@ bool BackendHelper::ReadRegisterField(const QString& dev, const QString& reg,
return true;
}
-bool BackendHelper::DumpAllRegisters(const QString& filename)
+bool BackendHelper::DumpAllRegisters(const QString& filename, bool ignore_errors)
{
FileIoBackend b(filename, QString::fromStdString(m_soc.GetSoc().name));
- BackendHelper bh(&b, m_soc);
+ bool ret = DumpAllRegisters(&b, ignore_errors);
+ return ret && b.Commit();
+}
+
+bool BackendHelper::DumpAllRegisters(IoBackend *backend, bool ignore_errors)
+{
+ BackendHelper bh(backend, m_soc);
+ bool ret = true;
for(size_t i = 0; i < m_soc.GetSoc().dev.size(); i++)
{
const soc_dev_t& dev = m_soc.GetSoc().dev[i];
@@ -605,12 +612,20 @@ bool BackendHelper::DumpAllRegisters(const QString& filename)
QString regname = QString::fromStdString(reg.addr[l].name);
soc_word_t val;
if(!ReadRegister(devname, regname, val))
- return false;
+ {
+ ret = false;
+ if(!ignore_errors)
+ return false;
+ }
if(!bh.WriteRegister(devname, regname, val))
- return false;
+ {
+ ret = false;
+ if(!ignore_errors)
+ return false;
+ }
}
}
}
}
- return b.Commit();
+ return ret;
}
diff --git a/utils/regtools/qeditor/backend.h b/utils/regtools/qeditor/backend.h
index c8adbc474f..b2f53c9ed5 100644
--- a/utils/regtools/qeditor/backend.h
+++ b/utils/regtools/qeditor/backend.h
@@ -363,7 +363,11 @@ public:
bool GetRegRef(const SocDevRef& dev, const QString& reg, SocRegRef& ref);
bool GetFieldRef(const SocRegRef& reg, const QString& field, SocFieldRef& ref);
bool GetRegisterAddress(const QString& dev, const QString& reg, soc_addr_t& addr);
- bool DumpAllRegisters(const QString& filename);
+ /* NOTE: does not commit writes to the backend
+ * if ignore_errors is true, the dump will continue even on errors, and the
+ * function will return false if one or more errors occured */
+ bool DumpAllRegisters(IoBackend *backend, bool ignore_errors = true);
+ bool DumpAllRegisters(const QString& filename, bool ignore_errors = true);
private:
IoBackend *m_io_backend;