add pimsim-nn simulator

This commit is contained in:
NiccoloN
2026-02-23 16:17:52 +01:00
parent 9c716d2582
commit 9ba08a6780
66 changed files with 8 additions and 4 deletions

3
.gitmodules vendored
View File

@@ -1,3 +1,6 @@
[submodule "onnx-mlir"]
path = onnx-mlir
url = https://github.com/onnx/onnx-mlir.git
[submodule "backend-simulators/pim/pimsim-nn"]
path = backend-simulators/pim/pimsim-nn
url = https://github.com/wangxy-2000/pimsim-nn.git

View File

@@ -20,11 +20,11 @@ where
let mut cpu = CPU::new(0);
cpu.reserve_crossbar(1, 1024 * size_of::<f32>(), 1024);
let (memory, crossbars) = cpu.host().get_memory_crossbar();
let matrix = simple_read(Path::new("./tests/B.txt")) ;
let matrix = simple_read(Path::new("B.txt")) ;
crossbars.get_mut(0).unwrap().execute_store( &matrix).unwrap();
let vector = simple_read(Path::new("./tests/A.txt"));
let vector = simple_read(Path::new("A.txt"));
memory.execute_store(0, &vector).unwrap();
let mut inst_builder = InstructionsBuilder::new();
@@ -57,7 +57,7 @@ where
.cpu_mut()
.host()
.load::<f32>(1024 * size_of::<f32>(), 1024*size_of::<f32>()).unwrap()[0].iter().zip(
simple_read(Path::new("./tests/X.txt")) ).all(|(&a,b) : (&f32, f32)| {a-b < 0.001}),
simple_read(Path::new("X.txt")) ).all(|(&a,b) : (&f32, f32)| {a-b < 0.001}),
"Wrong result for {}",
err
);

View File

@@ -43,7 +43,7 @@ fn collect_json_from_subfolders<P: AsRef<Path>>(root: P) -> Result<Vec<(Value, V
#[test]
fn json_folder_tester() {
let examples = collect_json_from_subfolders("./tests/data").unwrap();
let examples = collect_json_from_subfolders("data").unwrap();
for example in examples {
let (config, cores) = example;
json_to_executor::json_to_executor(config, cores.iter()).execute();