The international proposal standard of R46 is the key to influence new demand of the next-generation smart meter in the country. In particular, a new software inspection project has been added, which places high demands on the requirements of smart meter software. A software testing environment of smart meters meeting R46 was designed based on FPGA technology, used FPGA to simulate peripheral devices of MCU, such as EEPROM, Flash, measurement chip, communication module, etc. It can carry on software interface testing and fault injection testing between measurement MCU and management MCU or MCU and peripheral modules, realize the separation testing of software legal measurement,software protection testing, parameter protection testing, and online upgrade testing of R46 meter software based on object codes, which provides methods and detection device for software detection of smart meters based on R46 standard.