An Energy-efficient ASIP Synthesis Method Using Scratchpad Memory and Code Placement Optimization