VHDL: How to create a memory block with some elements being constant?
Instead of special-casing the writes, do it on the reads. The optimizer will automatically delete any registers that are written but never read.
          if TEST_MEMORY_RD_IN = '1' then
            case address_int is
              when special_address_a =&gt; TEST_MEMORY_RDATA_OUT &lt;= special_data_a;
              when special_address_b =&gt; TEST_MEMORY_RDATA_OUT &lt;= special_data_b;
              when others =&gt; TEST_MEMORY_RDATA_OUT &lt;= TEST_DATA_MEM (address_int);
            end case;
          end if;