All Downloads are FREE. Search and download functionalities are using the official Maven repository.

inalhdl.spinalhdl-sim_2.11.1.11.0.source-code.XSIIface.i Maven / Gradle / Ivy

There is a newer version: 1.12.0
Show newest version
%module JNIXSIIface

%include "stdint.i"
%include "std_vector.i"
%include "std_string.i"

%{
 #include "XSIIface.hpp"
%}

namespace std {
    %template(VecI8) vector;
};

%exception {
  try {
    $action
  } catch (XSIException &e) {
    jclass clazz = jenv->FindClass("spinal/sim/XSIException");
    jenv->ThrowNew(clazz, e.what());
    return $null;
  } catch (std::exception &e) {
    jclass clazz = jenv->FindClass("java/lang/Exception");
    jenv->ThrowNew(clazz, e.what());
    return $null;
  } catch (...) {
    jclass clazz = jenv->FindClass("java/lang/Exception");
    jenv->ThrowNew(clazz, "unknown exception");
    return $null;
  }
}

class XSIIface {
public:
    XSIIface();
    ~XSIIface();
    int32_t get_signal_handle(const std::string& handle_name);
    std::vector read(int32_t handle, int32_t width);
    int64_t read64(int32_t handle);
    int32_t read32(int32_t handle);
    void write(int32_t handle, int32_t width, const std::vector& data);
    void write64(int32_t handle, int64_t data);
    void write32(int32_t handle, int32_t data);

    int32_t get_time_precision();
    void sleep(int64_t sleep_cycles);
    void check_status();
};

%exception;




© 2015 - 2025 Weber Informatics LLC | Privacy Policy