A Post-Compiler Approach to Scratchpad Mapping of Code