Software-defined hardware without sacrificing performance