Software Design of SOPC Custom Peripherals