#ifndef CROSSBAR_GENERATOR_H #define CROSSBAR_GENERATOR_H #include typedef struct { /* Physical crossbar dimensions. */ size_t rows; size_t columns; /* * Flat row-major input voltages. Offline generation reads * input_series[sample * rows + row] for num_samples samples. Online * generation uses external voltage sources and does not read the values. */ const double *input_series; size_t num_samples; /* * Flat row-major initial resistances with rows * columns elements: * initial_resistance[row * columns + column]. */ const double *initial_resistance; /* Path to the SPICE model included by the generated netlist. */ const char *model_path; /* Name of the model's SPICE subcircuit. */ const char *subcircuit_name; /* Resistance from each physical column to ground. */ double load_resistance; /* Transient-analysis sample interval and stop time. */ double time_step; double stop_time; /* Reserved for state-node output; currently must be 0 or 1. */ int print_state_nodes; } Crossbar_Config; int generate_crossbar(const char *output_filename, const Crossbar_Config *config); /* Generate a netlist whose row voltages are supplied by libngspice callbacks. */ int generate_online_crossbar(const char *output_filename, const Crossbar_Config *config); #endif