From 0c5f62681b1070cf36262c2bc0ffbac55b348be9 Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 22 Jul 2026 11:49:23 -0700 Subject: Read/store ngspice simulation output --- src/read_crossbar.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/read_crossbar.h (limited to 'src/read_crossbar.h') diff --git a/src/read_crossbar.h b/src/read_crossbar.h new file mode 100644 index 0000000..81aad02 --- /dev/null +++ b/src/read_crossbar.h @@ -0,0 +1,24 @@ +#ifndef READ_CROSSBAR_H +#define READ_CROSSBAR_H + +#include + +typedef struct { + size_t num_samples; //number of time-steps + size_t num_outputs; //number of columns + + double *time; + + // stored in row major order + // voltages[sameple * num_outputs + output] + double *voltages; +} Crossbar_Output_Matrix; + +int run_ngspice(const char *crossbar_path); + +int read_crossbar(const char *data_path, size_t num_outputs, + Crossbar_Output_Matrix *result); + +void free_crossbar_output_matrix(Crossbar_Output_Matrix *result); + +#endif -- cgit v1.2.3