tests: add some exec tests
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
This commit is contained in:
		@@ -156,6 +156,10 @@ struct Instruction {
 | 
			
		||||
    InstructionData data;
 | 
			
		||||
 | 
			
		||||
    Instruction(uint32_t insn);
 | 
			
		||||
    Instruction(Condition condition, InstructionData data) noexcept
 | 
			
		||||
      : condition(condition)
 | 
			
		||||
      , data(data){};
 | 
			
		||||
 | 
			
		||||
    std::string disassemble();
 | 
			
		||||
};
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										3
									
								
								include/cpu/arm/meson.build
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								include/cpu/arm/meson.build
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,3 @@
 | 
			
		||||
headers += files(
 | 
			
		||||
  'instruction.hh',
 | 
			
		||||
)
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
#pragma once
 | 
			
		||||
 | 
			
		||||
#include "arm/instruction.hh"
 | 
			
		||||
#include "bus.hh"
 | 
			
		||||
#include "instruction.hh"
 | 
			
		||||
#include "psr.hh"
 | 
			
		||||
 | 
			
		||||
#include <cstdint>
 | 
			
		||||
@@ -10,7 +10,7 @@ using std::size_t;
 | 
			
		||||
 | 
			
		||||
class Cpu {
 | 
			
		||||
  public:
 | 
			
		||||
    Cpu(Bus& bus);
 | 
			
		||||
    Cpu(const Bus& bus);
 | 
			
		||||
    void step();
 | 
			
		||||
 | 
			
		||||
  private:
 | 
			
		||||
@@ -30,7 +30,9 @@ class Cpu {
 | 
			
		||||
    Psr spsr; // status program status register
 | 
			
		||||
 | 
			
		||||
    static constexpr uint8_t PC_INDEX = 15;
 | 
			
		||||
    uint32_t& pc                      = gpr[PC_INDEX];
 | 
			
		||||
    static_assert(PC_INDEX < GPR_COUNT);
 | 
			
		||||
 | 
			
		||||
    uint32_t& pc = gpr[PC_INDEX];
 | 
			
		||||
 | 
			
		||||
    bool is_flushed;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,7 @@
 | 
			
		||||
headers += files(
 | 
			
		||||
  'cpu.hh',
 | 
			
		||||
  'instruction.hh',
 | 
			
		||||
  'psr.hh',
 | 
			
		||||
  'utility.hh'
 | 
			
		||||
)
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
subdir('arm')
 | 
			
		||||
		Reference in New Issue
	
	Block a user