#isa #instructions #architecture #gpcas #cpu #simulator #set

gpcas_isa

Interface and utilities for GPCAS ISA implementations

10 releases (5 breaking)

0.6.1 Oct 28, 2022
0.6.0 Sep 1, 2022
0.5.0 Aug 17, 2022
0.4.0 Jan 25, 2022
0.1.1 Jul 9, 2021

#84 in Emulators

41 downloads per month
Used in 4 crates

LGPL-3.0-or-later

57KB
886 lines

GPCAS isa crate

This crate provides an interface to implement for ISAs (instruction set architectures) to be supported in GPCAS. GPCAS stands for General Purpose Core Architecture Simulator, a simulator for CPUs.

Each ISA has to provide an emulator capable of executing a program of said ISA, and some additional properties.

Example

To properly interface with the simulator, an ISA should provide its information as so:

extern crate gpcas_isa;
use gpcas_isa::{Isa, MemoryAccessType};

pub fn get_isa(executable_data: Vec<u8>) -> Isa {
    Isa {
        emulator: Box::new(YourEmulator::new(executable_data)),
        memory_access_type: MemoryAccessType::LoadStore,
        general_purpose_register_count: 16,
        vector_register_count: 0,
        special_register_count: 0,
        instruction_word_alignment: 1,
        max_instruction_len: 2,
    }
}

License

gpcas_isa is distributed under the LGPLv3 license. See COPYING and COPYING.LESSER in the crate root.

No runtime deps