Add memory controller test function test_memctrl