Traditional memories, such as DRAM and SRAM, are widely used in embedded systems. With the increasing integration of CMOS, the static energy consumption of traditional memories is becoming more and more severe. Scratchpad memory belongs to on-chip memory, which acts on the cache layer, and it can be controlled by software. Random-access memory is usually used as the on-chip memory of the cache layer, but it has the problems of poor scalability, small storage density, and high static energy consumption, which seriously affects the system performance. Non-volatile memory has the advantages of reading speed, ultralow static energy consumption, and high density compared with traditional memory. It is regarded as a new type of memory that is expected to replace traditional memory. In order to solve the problems of traditional memory, this article will combine the two types of storage units of NVM SLC/MLC, which can be converted to each other and the complementary advantages of the two storage units in performance and storage capacity, to achieve a new architecture of variable SPM, and design the corresponding task allocation algorithm to achieve the task set to meet the real-time schedulable requirements, while achieving the goal of the lowest energy consumption of the system.