The STCAM requires a minimum number of RAM read accesses depending on the number of masks. For small STCAMs it is therefore beneficial to use block RAM.
Each RAM has associated logic, therefore as the STCAM size increases, less logic resources will be used if the total number of RAMs is kept low. This can be accomplished by using deeper RAMs, such as UltraRAM, or depth cascaded block RAMs.
The API software calculates and selects the optimum solution in terms of hardware resources. If the target device has more spare capacity for a certain RAM type, the MEMORY_PRIMITIVE parameter can be forced to this RAM type even if it is less efficient, because it will provide better overall device utilization.