Moving files to simulator module

This commit is contained in:
Quentin Legot 2023-01-11 14:58:12 +01:00
parent 27cd7d35c7
commit b1909e3280
5 changed files with 9 additions and 8 deletions

View File

@ -1,7 +1,6 @@
mod decode;
mod print;
mod machine;
use machine::Machine;
mod simulator;
use simulator::machine::Machine;
fn main() {
let mut m = Machine::_init_machine();

View File

@ -1,5 +1,4 @@
use crate::decode::*;
use crate::print::*;
use super::{decode::{Instruction, decode}, print::*};
/// doit disparaitre
const MEM_SIZE : usize= 4096;

3
src/simulator/mod.rs Normal file
View File

@ -0,0 +1,3 @@
pub mod machine;
pub mod decode;
pub mod print;

View File

@ -1,6 +1,6 @@
#![allow(dead_code)]
#![allow(unused_variables)]
use crate::decode::Instruction;
use super::decode::{Instruction};
pub const RISCV_LUI: u8 = 0x37;
@ -307,8 +307,8 @@ pub fn print(ins: Instruction, pc: i32) -> String { //TODO pc should be u64
#[cfg(test)]
mod test {
use crate::simulator::{decode, print};
use crate::{print, decode};
#[test]
fn test_op() {