Verilog - how to overcome the fact that I cannot mixed edge and level triggers,writing to memory
You need to change your testbench because you have a simulation race condition. Use non-blocking assignments to your inputs, or change your inputs on the negative edge of the clock. That way they will be settled in the RAM inputs before the posedge clock.