Added documentation
This commit is contained in:
parent
95dde6e2c9
commit
8193bcda46
5 changed files with 161 additions and 35 deletions
11
src/lib.rs
11
src/lib.rs
|
|
@ -1,3 +1,14 @@
|
|||
//! # Rusty Emulator Library
|
||||
//!
|
||||
//! A comprehensive Intel MCS-4 microprocessor simulator written in Rust.
|
||||
//!
|
||||
//! This library provides:
|
||||
//! - JSON-configurable system architecture for flexible system definition
|
||||
//! - Cycle-accurate hardware simulation of Intel 4004/4001/4002/4003 components
|
||||
//! - Comprehensive testing framework with multiple testing strategies
|
||||
//! - Extensible component system with trait-based architecture
|
||||
//! - Professional project organization with clean separation of concerns
|
||||
|
||||
mod bus;
|
||||
pub mod component;
|
||||
pub mod components;
|
||||
|
|
|
|||
26
src/main.rs
26
src/main.rs
|
|
@ -1,3 +1,29 @@
|
|||
//! # Rusty Emulator - Main Binary
|
||||
//!
|
||||
//! Command-line interface for the Intel MCS-4 microprocessor simulator.
|
||||
//!
|
||||
//! This binary provides:
|
||||
//! - JSON-based system configuration loading
|
||||
//! - Binary program file loading and execution
|
||||
//! - Real-time system monitoring and status display
|
||||
//! - Multiple system type support (basic, max, fig1, custom JSON)
|
||||
//!
|
||||
//! ## Usage
|
||||
//!
|
||||
//! ```bash
|
||||
//! # Run basic MCS-4 system with default fibonacci program
|
||||
//! cargo run -- --system basic
|
||||
//!
|
||||
//! # Run Fig.1 MCS-4 Max system
|
||||
//! cargo run -- --system max
|
||||
//!
|
||||
//! # Run with custom program
|
||||
//! cargo run -- --system basic --file programs/myprogram.bin
|
||||
//!
|
||||
//! # Show help
|
||||
//! cargo run -- --help
|
||||
//! ```
|
||||
|
||||
use rusty_emu::system_config::{SystemFactory, ConfigurableSystem};
|
||||
use std::env;
|
||||
use std::fs;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,53 @@
|
|||
//! # JSON Configuration System
|
||||
//!
|
||||
//! This module provides a flexible, JSON-based system for configuring and creating MCS-4 systems.
|
||||
//!
|
||||
//! ## Key Features
|
||||
//!
|
||||
//! - **JSON System Definition**: Complete system configurations stored in JSON files
|
||||
//! - **Component Factory**: Dynamic creation of components from configuration
|
||||
//! - **Automatic Wiring**: Pin-level connection management between components
|
||||
//! - **Extensible Design**: Easy addition of new component types and connection patterns
|
||||
//! - **Runtime Configuration**: Support for multiple system configurations
|
||||
//!
|
||||
//! ## Usage
|
||||
//!
|
||||
//! ```rust
|
||||
//! use rusty_emu::system_config::SystemFactory;
|
||||
//!
|
||||
//! // Create system from JSON configuration
|
||||
//! let factory = SystemFactory::new();
|
||||
//! let mut system = factory.create_from_json("configs/mcs4_basic.json")?;
|
||||
//!
|
||||
//! // Run the configured system
|
||||
//! system.run();
|
||||
//! ```
|
||||
//!
|
||||
//! ## Configuration File Format
|
||||
//!
|
||||
//! ```json
|
||||
//! {
|
||||
//! "name": "MySystem",
|
||||
//! "description": "Custom MCS-4 system",
|
||||
//! "components": {
|
||||
//! "CPU": {
|
||||
//! "single": {
|
||||
//! "component_type": "intel_4004",
|
||||
//! "name": "CPU_4004",
|
||||
//! "properties": {"clock_speed": 750000}
|
||||
//! }
|
||||
//! }
|
||||
//! },
|
||||
//! "connections": {
|
||||
//! "clock_signals": {
|
||||
//! "connection_type": "clock",
|
||||
//! "source": {"component": "CLOCK", "pin": "CLK"},
|
||||
//! "targets": [{"component": "CPU", "pin": "PHI1"}]
|
||||
//! }
|
||||
//! }
|
||||
//! }
|
||||
//! ```
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::collections::HashMap;
|
||||
use crate::component::Component;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue