Moving files to simulator module
This commit is contained in:
parent
27cd7d35c7
commit
b1909e3280
@ -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();
|
||||
|
@ -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
3
src/simulator/mod.rs
Normal file
@ -0,0 +1,3 @@
|
||||
pub mod machine;
|
||||
pub mod decode;
|
||||
pub mod print;
|
@ -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() {
|
Loading…
Reference in New Issue
Block a user