13 releases

0.2.6 Aug 31, 2022
0.2.5 Aug 14, 2022
0.2.0 Feb 24, 2022
0.1.2 Feb 17, 2022
0.0.3 Feb 17, 2022

#218 in Simulation

39 downloads per month
Used in gcn_agg

MIT license

355KB
7.5K SLoC

C++ 7K SLoC // 0.1% comments Rust 255 SLoC // 0.0% comments Python 225 SLoC // 0.1% comments Forge Config 215 SLoC // 0.5% comments Lua 4 SLoC

a wrapper for ramulator

Rust

this is a binding to c++ ramulator simulator


lib.rs:

a wrapper for ramulator

Example

use ramulator_wrapper::RamulatorWrapper;
use std::collections::HashSet;
let mut ramulator = RamulatorWrapper::new("HBM-config.cfg","test2.txt");
let mut cycle = 0;
let count = 10u64;
let mut all_req: HashSet<_> = (1..count).into_iter().map(|i| i * 64).collect();
for i in 1..count {
    while !ramulator.available(i * 64, false) {
        ramulator.cycle();
        cycle += 1;
    }
    ramulator.send(i * 64, false);
    ramulator.cycle();
}
for _i in 1..count {
    while !ramulator.ret_available() {
        ramulator.cycle();
        cycle += 1;
    }
    let result = ramulator.pop();
    ramulator.cycle();

    //assert!(all_req.contains(&result));
    println!("{}", result);
    all_req.remove(&result);
}
for _i in 0..1000 {
    ramulator.cycle();
}
assert_eq!(ramulator.ret_available(), false);

println!("cycle: {}", cycle);

Dependencies

~0.3–1.3MB
~30K SLoC