Skip to content

Crash when compiling Skywater ReRAM model: index out of bounds in bitset #10

@robtaylor

Description

@robtaylor

Description

OpenVAF crashes with an index out of bounds panic when compiling the Skywater PDK ReRAM model.

Steps to Reproduce

  1. Obtain the Skywater PDK ReRAM model from: https://github.com/google/skywater-pdk/tree/main/libraries/sky130_fd_pr_reram
  2. Compile with OpenVAF:
openvaf sky130_fd_pr_reram__reram_cell.va -o reram.osdi

Expected Behavior

The model should compile successfully or produce a meaningful error message.

Actual Behavior

OpenVAF crashes with:

Panic occurred in file 'lib/bitset/src/lib.rs' at line 133
index out of bounds: the len is 3 but the index is 67108863

Stack Trace

   0: bitset::BitSet<T>::insert::ha8ec904b50560df2
      at lib/bitset/src/lib.rs:133
   0: sim_back::context::Context::compute_outputs::h29cfda05f1d089c8
      at openvaf/sim_back/src/context.rs:120
   0: sim_back::dae::builder::Builder::new::h7e312b05da5b0018
      at openvaf/sim_back/src/dae/builder.rs:70
   0: sim_back::dae::DaeSystem::new::h734b86705eda2457
      at openvaf/sim_back/src/dae.rs:60
   0: sim_back::CompiledModule::new::h416a6863298a9f8a
      at openvaf/sim_back/src/lib.rs:180

Analysis

The crash occurs in sim_back::context::Context::compute_outputs when trying to insert index 67108863 (0x3FFFFFF) into a bitset of length 3. The value 67108863 appears to be an invalid/uninitialized value or a sentinel that's being treated as a valid index.

Model Features

The ReRAM model uses several features that may be relevant:

  • @(initial_step) event for initialization
  • $bound_step() for time step control
  • $abstime for accessing simulation time
  • Complex transient state with manual Euler integration
  • analog function definitions

Environment

  • OpenVAF version: 23.5.0
  • Platform: macOS (aarch64)
  • Model: sky130_fd_pr_reram__reram_cell.va v2.0.3

Attachments

The model source is available at:
https://github.com/google/skywater-pdk/blob/main/libraries/sky130_fd_pr_reram/latest/cells/reram_cell/sky130_fd_pr_reram__reram_cell.va

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions