cocotb icon indicating copy to clipboard operation
cocotb copied to clipboard

Merge C++ libraries

Open ktbarrett opened this issue 10 months ago • 4 comments

Closes #2274. Closes #2312. Closes #678.

  • Random cleanup and fixing leak in handle_gpi_callback in simulator.so
  • libgpilog, libgpi, libembed, and half of libcocotb_utils were merged into libgpi.
  • libpygpilog, libcocotb, and simulator.so were merged into simulator.so.
  • Introduced (currently) private GPI_USERS envvar which loads simulator.so dynamically rather than hardcoding it into the binary.

The GPI_USERS and entire embed code will be refactored into a more general purpose feature for loading libraries dynamically. LIBPYTHON_LOC will be transitioned to a GPI_USERS method so there will be no more hardcoding the assumption of Python in the GPI.

I purposefully didn't do any shuffling of code and renaming of things to keep this diff small. Those cleanups can come later.

We can also probably drop the SXS appconfig and RPATH stuff in a follow on. All libraries are now explicitly dynamically loaded.

ktbarrett avatar Feb 21 '25 06:02 ktbarrett

Oh cool. That thing I didn't touch broke. Windows is heckin awesorino.

ktbarrett avatar Feb 21 '25 22:02 ktbarrett

The failures on Windows mean that

We can also probably drop the SXS appconfig and RPATH stuff in a follow on. All libraries are now explicitly dynamically loaded.

Will have to wait until #1994 is fixed and there is no dependency in libgpi on any unbound function in the user library.

ktbarrett avatar Feb 21 '25 22:02 ktbarrett

Well... Maybe I'll just try fixing #1994 while I'm at it =/

ktbarrett avatar Feb 21 '25 23:02 ktbarrett

I'm actually going to pause on this to focus on 2.0 features.

ktbarrett avatar Feb 22 '25 04:02 ktbarrett