Modular Abstractions for Efficient Hardware Design