-
-
Notifications
You must be signed in to change notification settings - Fork 277
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Move instruction set vector from Assembler to ISAInfo * Fix clang-format * Add back runtime errors to assembler initializations * Change ISA-specific assemblers into a single template class This change should complete #303. * Throw runtime error in `constructAssemblerDynamic()` Also added doc comment.
- Loading branch information
Showing
30 changed files
with
347 additions
and
329 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#include "assembler.h" | ||
|
||
namespace Ripes { | ||
namespace Assembler { | ||
|
||
std::shared_ptr<AssemblerBase> | ||
constructAssemblerDynamic(const std::shared_ptr<const ISAInfoBase> &isa) { | ||
if (auto rv32isa = | ||
std::dynamic_pointer_cast<const ISAInfo<ISA::RV32I>>(isa)) { | ||
return std::make_shared<ISA_Assembler<ISA::RV32I>>(rv32isa); | ||
} else if (auto rv64isa = | ||
std::dynamic_pointer_cast<const ISAInfo<ISA::RV64I>>(isa)) { | ||
return std::make_shared<ISA_Assembler<ISA::RV64I>>(rv64isa); | ||
} | ||
|
||
throw std::runtime_error( | ||
std::string("Cannot dynamically construct assembler for isa: ") + | ||
isa->name().toStdString()); | ||
} | ||
|
||
} // namespace Assembler | ||
} // namespace Ripes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.