Integrated and Programmable Chip-Scale millimeter-wave and Terahertz systems for Communication, Sensing, and Imaging