Code to simulate the pipeline described in Patterson and Hennesy