(hls backend with ram) correct bugs