1
0
forked from Rativel/BurritOS

Documentation for mem_cmp.rs and mmu.rs modules

This commit is contained in:
Rémi Rativel
2023-05-09 19:15:56 +02:00
parent d35314bead
commit 692c3bfa03
2 changed files with 53 additions and 16 deletions

View File

@@ -1,14 +1,31 @@
///! FILE.TXT FORMAT Representing machine memory memory
/// - PC
/// - SP
/// - Section_1
/// - Section_2
/// - ...
/// - Section_n
///
/// Each section is divided in 3 parts, on two lines of text
/// addr SPACE len
/// content
//! # mem_cmp
//!
//! This module contains a MemChecker.
//!
//! It's used to compare state memory obtained after a dump memory from NachOS and BurritOS.
//!
//! This module is used exclusively for testing the instruction simulator.
//!
//! Basic usage:
//!
//! ```
//! let mut m = Machine::new(true, get_debug_configuration());
//! let mut MemChecker = mem_cmp::MemChecker::from(get_full_path!("memory", expr));
//! mem_cmp::MemChecker::fill_memory_from_mem_checker(&MemChecker, &mut m);
//! ```
//!
//!
//! ! FILE.TXT FORMAT Representing machine memory memory
//! - PC
//! - SP
//! - Section_1
//! - Section_2
//! - ...
//! - Section_n
//!
//! Each section is divided in 3 parts, on two lines of text
//! addr SPACE len
//! content
use std::{fs, io::{BufRead, BufReader, Lines, Error}};
use crate::Machine;
@@ -94,7 +111,7 @@ impl MemChecker{
/// Extract the values of pc, sp and sections
///
/// ### Parameter
/// -**path** addr to the file
/// - **path** addr to the file
///
/// ### Return
/// Mem-checker filled