Moving files to simulator module
This commit is contained in:
parent
27cd7d35c7
commit
b1909e3280
@ -1,7 +1,6 @@
|
|||||||
mod decode;
|
mod simulator;
|
||||||
mod print;
|
|
||||||
mod machine;
|
use simulator::machine::Machine;
|
||||||
use machine::Machine;
|
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let mut m = Machine::_init_machine();
|
let mut m = Machine::_init_machine();
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
use crate::decode::*;
|
use super::{decode::{Instruction, decode}, print::*};
|
||||||
use crate::print::*;
|
|
||||||
|
|
||||||
/// doit disparaitre
|
/// doit disparaitre
|
||||||
const MEM_SIZE : usize= 4096;
|
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(dead_code)]
|
||||||
#![allow(unused_variables)]
|
#![allow(unused_variables)]
|
||||||
use crate::decode::Instruction;
|
use super::decode::{Instruction};
|
||||||
|
|
||||||
|
|
||||||
pub const RISCV_LUI: u8 = 0x37;
|
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)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod test {
|
||||||
|
use crate::simulator::{decode, print};
|
||||||
|
|
||||||
use crate::{print, decode};
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_op() {
|
fn test_op() {
|
Loading…
Reference in New Issue
Block a user