genpipe: support write mode and updated test script