# OSDI Models

`OsdiModel` (`osdimodel.h`/`osdimodel.cpp`) is the [`Model`](devbase.md) implementation for an OSDI-backed device - the counterpart to [`BuiltinModel<...>`](devbuiltin.md), but non-templated like [`OsdiDevice`](osdidevice.md).

Where `BuiltinModel` owns a typed `IStruct<ModelParams>` reflected via [`Introspection`](introspection.md), `OsdiModel` owns an opaque `void* core_` - the OSDI ABI's own per-model data block, whose size and layout are determined entirely by the compiled Verilog-A module, not by any C++ struct the simulator defines. Every `Parameterized` method (`parameterCount()`, `getParameter()`, `setParameter()`, ...) is implemented by forwarding through `device()` (the owning [`OsdiDevice`](osdidevice.md)) to its `access()`-callback-based parameter API instead of `Introspection<T>`'s offset-based one - the same information, reached through the OSDI ABI boundary instead of C++ reflection.

`setupWrapper()` mirrors `BuiltinModel::setupWrapper()`'s role: model-level setup bookkeeping (populating `OsdiSimParas` for the current temperature, invoking the descriptor's model-setup entry point) shared across every OSDI device, called from `OsdiInstance`'s own setup path.

The constructor adds the new model to its owning `OsdiDevice`'s model list (so destroying the device destroys every model built from it, and in turn every instance built from each model); the destructor releases the `core_` block.
