modefied STATEMACHINE at gmii_rec.v