--- Quote Start ---
To reset the RAM in modelsim to get rid of x you could use the mem load command:
mem load -filltype value -filldata 0 -fillradix symbolic /tb/the_ram_to_be_resetted/altsyncram_component/m_default/altsyncram_inst/mem_data
or emulate random data:
mem load -filltype rand -filldata 0 -fillradix symbolic /tb/the_ram_to_be_resetted/altsyncram_component/m_default/altsyncram_inst/mem_data
In a real design you need a memory initialization file. If not supplied or not found Quartus sets all initial values to 0. This behaviour is may depending on the type of FPGA.
--- Quote End ---
The code the OP has posted indicates the ram is already initialised to 0. The Xs are likely the results of code problems elsewhere.