Text this: Cost-driven design of smart microsystems