add scratchpad memory interface
minor error fix
add wpm allocate (not working for moment)