Ad-hoc Architectures for modern DBMS: a HW/SW Co-Design Approach