I also had the same problem here quad with quartus 4.1 when i was trying to use all of the available M4Ks in a single memory block. It seems that there is a bug in the way the altsyncram megafunction allocates memory resources when the requested memory is not a power of 2 in terms of M4Ks. The workarround i have found is to also constrain the maximum depth parameter to 512 bytes. This is an available parameter during the memory generation if you are using the altsyncram wizzard. Of course if you are trying to instantiate onchip memory inside SOPC this parameter is not available. Perhaps in this case you could edit the onchip.v (the name depends on how you have named the memory inside SOPC) generated file after generating the system in SOPC and add there the 512 byte parameter in the defparam section. Maybe this could work.