In reply to ccelie:
If the set()/get() calls work with an integer but not with a class variable, then the issue has to do with the class variables not being type compatible. This is due to compiling spi_env_config multiple times in different scopes.
To fix this, you need to use a package and import the package everywhere that you reference spi_env_config.