diff options
| author | Your Name <[email protected]> | 2026-07-22 11:49:23 -0700 |
|---|---|---|
| committer | Your Name <[email protected]> | 2026-07-22 11:49:23 -0700 |
| commit | 0c5f62681b1070cf36262c2bc0ffbac55b348be9 (patch) | |
| tree | d1f3275446fe0ebf56c25284f9e8e04eff865bdb /src/read_crossbar.h | |
| parent | a4edd40c35e2784691936662a8a89463cc434f9a (diff) | |
Read/store ngspice simulation output
Diffstat (limited to 'src/read_crossbar.h')
| -rw-r--r-- | src/read_crossbar.h | 24 |
1 files changed, 24 insertions, 0 deletions
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 <stddef.h> + +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 |
