gpcas_forwardcom 0.1.1

ForwardCom instruction set architecture (ISA) properties for use with the General Purpose Core Architecture Simulator (GPCAS).
Documentation
// Filename: lib.rs
// Author:	 Kai Rese
// Version:	 0.5
// Date:	 01-09-2021 (DD-MM-YYYY)
// Library:  gpcas_forwardcom
//
// Copyright (c) 2022 Kai Rese
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this program. If not, see
// <https://www.gnu.org/licenses/>.

//! This crate provides the ForwardCom emulation front end to the simulator.
//!
//! It is a full ForwardCom emulator that additionally sends information for the timing simulation
//! back to the simulator.
#![warn(missing_docs)]

mod emulator;
mod program;

pub use emulator::ForwardComEmulator;
pub use program::Segment;

use gpcas_isa::{Isa, MemoryAccessType};

/// Returns all needed ForwardCom-specific data.
pub fn get_isa(executable_data: Vec<u8>, max_vector_size: usize) -> Isa {
    Isa {
        emulator: Box::new(ForwardComEmulator::new(executable_data, max_vector_size)),
        memory_access_type: MemoryAccessType::RegisterMemory,
        general_purpose_register_count: 32,
        vector_register_count: 32,
        special_register_count: 32,
        instruction_word_alignment: 2,
        max_instruction_len: 12,
    }
}