A Novel Design Methodology for Synthesizing Application-Specific Logic-in-Memory Blocks