USER_DEFS_PKG.vhd is one of (4) auto-generated files that SpeakHDL creates or updates inside the top directory when the 'ok' command is given. The USER_DEFS_PKG.vhd file contains all necessary compile time constants that are necessary for simulation and synthesis. Before compile time, SpeakHDL analyses the config_file and application module files and generates the USER_DEFS_PKG.vhd file based on the consolidation of input parameters of each API call. The primary purpose of the file is to:
1) Setup the compile time constants that are needed in the SPEAKHDL_API_PKG.vhdp library.
2) Define the module_index for each application module.
3) Constrain the maximum range of integers values in order to achieve an efficient synthesis result.
It is important to note that the SPEAKHDL_API_PKG.vhdp library file has a dependency on the constants defined in USER_DEFS_PKG.vhd. The subtle implications are that if changes are made to an application module in a text editor without the USER_DEFS_PKG.vhd being updated, it is likely that an error is generated by the library file inside the simulation/synthesis tool. Thus, the user is required to run the 'ok' command within an application module as the last step before simulation/synthesis. This is to ensures that the constants defined in USER_DEFS_PKG.vhd file are up to date.