1
0
mirror of https://github.com/TomHarte/CLK.git synced 2025-02-11 15:30:52 +00:00

Fix model name.

This commit is contained in:
Thomas Harte 2024-03-02 21:47:09 -05:00
parent c0dd96eb7c
commit 37499d493a
2 changed files with 6 additions and 5 deletions

View File

@ -556,10 +556,10 @@ private:
/// Provides an analogue of the @c OperationMapper -affiliated @c dispatch that also updates the /// Provides an analogue of the @c OperationMapper -affiliated @c dispatch that also updates the
/// program counter in an executor's register bank appropriately. /// program counter in an executor's register bank appropriately.
template <typename MemoryT> template <Model model, typename MemoryT>
void dispatch(uint32_t pc, uint32_t instruction, Executor<MemoryT> &executor) { void dispatch(uint32_t pc, uint32_t instruction, Executor<MemoryT> &executor) {
executor.set_pc(pc); executor.set_pc(pc);
dispatch(instruction, executor); dispatch<model>(instruction, executor);
} }
} }

View File

@ -14,7 +14,7 @@
namespace InstructionSet::ARM { namespace InstructionSet::ARM {
enum class Model { enum class Model {
ARM2, ARMv2,
}; };
enum class Condition { enum class Condition {
@ -389,6 +389,7 @@ private:
}; };
/// Operation mapper; use the free function @c dispatch as defined below. /// Operation mapper; use the free function @c dispatch as defined below.
template <Model>
struct OperationMapper { struct OperationMapper {
static Condition condition(uint32_t instruction) { static Condition condition(uint32_t instruction) {
return Condition(instruction >> 28); return Condition(instruction >> 28);
@ -506,8 +507,8 @@ struct SampleScheduler {
/// Decodes @c instruction, making an appropriate call into @c scheduler. /// Decodes @c instruction, making an appropriate call into @c scheduler.
/// ///
/// In lieu of C++20, see the sample definition of SampleScheduler above for the expected interface. /// In lieu of C++20, see the sample definition of SampleScheduler above for the expected interface.
template <typename SchedulerT> void dispatch(uint32_t instruction, SchedulerT &scheduler) { template <Model model, typename SchedulerT> void dispatch(uint32_t instruction, SchedulerT &scheduler) {
OperationMapper mapper; OperationMapper<model> mapper;
// Test condition. // Test condition.
const auto condition = mapper.condition(instruction); const auto condition = mapper.condition(instruction);