aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorDavid Li <li.davidm96@gmail.com>2016-01-13 09:42:18 -0700
committerDavid Li <li.davidm96@gmail.com>2016-01-13 09:42:18 -0700
commit56bf151b4fd091360246b2cfe230997e4082b0bc (patch)
tree68648edceada6302c8896efd878e54b7b3bbea73 /src/main.rs
parent12e3bb51af09c56f306a1a365e989e8fb96b8a99 (diff)
Start working on updating global data structures
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs
index 0667401..615a965 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -6,6 +6,7 @@ extern crate rustc_serialize;
extern crate rustv;
extern crate time;
+mod globals;
mod memory_tracker;
mod shareable_cache;
mod system;
@@ -82,6 +83,7 @@ fn main() {
let payload2 = rand::random::<u8>();
let memory = MemoryTracker::new(memory, payload1, payload2);
+ // TODO: initialize global data
let memory_ref = Rc::new(RefCell::new(memory));
let cache = memory::DirectMappedCache::new(2, 64, memory_ref.clone());
@@ -118,7 +120,8 @@ fn main() {
cores.push(core);
}
- let steppable_caches = vec![cache_ref.clone() as memory::SharedMemory, cache2_ref];
+ let steppable_caches: Vec<memory::SharedMemory> =
+ vec![cache_ref, cache2_ref];
let system = SyscallHandler::new(memory_ref.clone(), core_caches);
let mut simulator = simulator::Simulator::new(
cores, memory_ref.clone(), steppable_caches, system);
@@ -129,7 +132,8 @@ fn main() {
simulator.run_max(cycles);
let end = time::precise_time_s();
- println!("{} cycles in {:04} seconds ({} cycles/sec)", cycles, end - start, (cycles as f64) / (end - start));
+ println!("{} cycles in {:04} seconds ({} cycles/sec)",
+ cycles, end - start, (cycles as f64) / (end - start));
let (p1, p2) = memory_ref.borrow().score();
println!("Program 1 bytes written: {}", p1);
println!("Program 2 bytes written: {}", p2);