Skip to content

Commit

Permalink
Move the vm into a library so we can use it in the debugger
Browse files Browse the repository at this point in the history
  • Loading branch information
rope-hmg committed Apr 27, 2024
1 parent 2cc0506 commit e92df36
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 6 deletions.
4 changes: 4 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ syn = { version = "2.0" }

byte_code = { path = "libs/byte_code" }
instr_codegen = { path = "libs/instr_codegen" }
vm = { path = "libs/vm" }
1 change: 1 addition & 0 deletions apps/beagle/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ edition = "2021"

[dependencies]
byte_code = { workspace = true }
vm = { workspace = true }
7 changes: 1 addition & 6 deletions apps/beagle/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
#![allow(non_camel_case_types)]

mod convert;
mod memory;
mod program;
mod vm;

use std::io;

use byte_code::Instruction;

use crate::{program::Program, vm::Virtual_Machine};
use vm::{Program, Virtual_Machine};

fn main() {
let mut vm = Virtual_Machine::new(1024 * 1024);
Expand Down
9 changes: 9 additions & 0 deletions libs/vm/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[package]
name = "vm"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
byte_code = { workspace = true }
File renamed without changes.
8 changes: 8 additions & 0 deletions libs/vm/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#![allow(non_camel_case_types)]

mod convert;
mod memory;
mod program;
mod vm;

pub use crate::{program::Program, vm::Virtual_Machine};
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit e92df36

Please sign in to comment.