// Simulates the C++ Wrapper that Verilator generates
// In a real env, we run `verilator --cc rtl/systolic_array_4x4.v`
// This file bridges PyTorch (Python/C) to that Verilated model.

#include <iostream>
#include <vector>

extern "C" {

void run_cosim(const int* a_data, const int* b_data, int* c_data, int steps) {
    // Instantiate Verilated Model
    // Vsystolic_array_4x4* top = new Vsystolic_array_4x4;

    // Reset
    // top->rst_n = 0; top->eval();
    // top->rst_n = 1;

    // Cycle Loop
    for(int i=0; i<steps; ++i) {
        // Drive Inputs
        // top->a0 = a_data[i]; ...

        // Clock
        // top->clk = 1; top->eval();
        // top->clk = 0; top->eval();

        // Read Outputs
        // c_data[i] = top->c00;
    }

    // delete top;
    std::cout << "[CoSim] Ran " << steps << " cycles." << std::endl;
}

}
