Trace-Based Learning for Agile Hardware Design and Design Automation