update bram addr generation and fix previous pipeline bugs.