HDL generation and BRAM estimation fixes.