1. A system, comprising: a plurality of functional blocks, wherein each functional block contains software configured to set the power state for the functional block in a register associated with the functional block; at least one power control domain associated with a power control switch, wherein each functional block is associated with a respective power control domain; and hardware configured to set the power state of each power control domain by switching the power control switch associated with the power control domain based on the power states in the registers associated with the functional blocks within the respective power control domains.