Add ISA extension descriptions
MODIFY
README.md
README.md
@@ -18,7 +18,7 @@ For bugs or issues, please report these at the [issues page](https://github.com/
## Usage
Ripes may be used to explore concepts such as:
-- How machine code is executed on a variety of microarchitectures (RV32IM/RV64IM based)
+- How machine code is executed on a variety of microarchitectures (RV32IMC/RV64IMC based)
- How different cache designs influence performance
- How C and assembly code is compiled and assembled to executable machine code
- How a processor interacts with memory-mapped I/O

MODIFY
src/STLExtras.h
src/STLExtras.h
@@ -365,6 +365,19 @@ template <typename R, typename OutputIt, typename UnaryFunction>
OutputIt transform(R&& Range, OutputIt d_first, UnaryFunction F) {
return std::transform(adl_begin(Range), adl_end(Range), d_first, F);
}
+
+/// Provide wrappers to std::find_if which take ranges instead of having to pass
+/// begin/end explicitly.
+template <typename R, typename UnaryPredicate>
+auto find_if(R&& Range, UnaryPredicate P) {
+ return std::find_if(adl_begin(Range), adl_end(Range), P);
+}
+
+template <typename R, typename UnaryPredicate>
+auto find_if_not(R&& Range, UnaryPredicate P) {
+ return std::find_if_not(adl_begin(Range), adl_end(Range), P);
+}
+
} // namespace llvm
#endif // LLVM_ADT_STLEXTRAS_H

MODIFY
src/isa/isainfo.h
src/isa/isainfo.h
@@ -76,6 +76,7 @@ public:
virtual const QStringList& enabledExtensions() const = 0;
bool extensionEnabled(const QString& ext) const { return enabledExtensions().contains(ext); }
bool supportsExtension(const QString& ext) const { return supportedExtensions().contains(ext); }
+ virtual QString extensionDescription(const QString& ext) const = 0;
/**
* ISA equality is defined as a separate function rather than the == operator, given that we might need to check for

MODIFY
src/isa/rvisainfo_common.h
src/isa/rvisainfo_common.h
@@ -117,6 +117,13 @@ public:
const QStringList& supportedExtensions() const override { return m_supportedExtensions; }
const QStringList& enabledExtensions() const override { return m_enabledExtensions; }
+ QString extensionDescription(const QString& ext) const override {
+ if (ext == "M")
+ return "Integer multiplication and division";
+ if (ext == "C")
+ return "Compressed instructions";
+ Q_UNREACHABLE();
+ }
protected:
QStringList m_enabledExtensions;

MODIFY
src/processorselectiondialog.cpp
src/processorselectiondialog.cpp
@@ -119,11 +119,12 @@ void ProcessorSelectionDialog::selectionChanged(QTreeWidgetItem* current, QTreeW
const ProcessorID id = qvariant_cast<ProcessorID>(current->data(ProcessorColumn, Qt::UserRole));
const auto& desc = ProcessorRegistry::getAvailableProcessors().at(id);
+ auto isaInfo = desc->isaInfo();
// Update information widgets with the current processor info
m_selectedID = id;
m_ui->name->setText(desc->name);
- m_ui->ISA->setText(desc->isaInfo().isa->name());
+ m_ui->ISA->setText(isaInfo.isa->name());
m_ui->description->setPlainText(desc->description);
m_ui->regInitWidget->processorSelectionChanged(id);
@@ -140,8 +141,9 @@ void ProcessorSelectionDialog::selectionChanged(QTreeWidgetItem* current, QTreeW
delete item;
}
- for (const auto& ext : desc->isaInfo().supportedExtensions) {
+ for (const auto& ext : isaInfo.supportedExtensions) {
auto chkbox = new QCheckBox(ext);
+ chkbox->setToolTip(isaInfo.isa->extensionDescription(ext));
m_ui->extensions->addWidget(chkbox);
if (m_selectedExtensionsForID[desc->id].contains(ext)) {
chkbox->setChecked(true);

Add ISA extension descriptions