Refer to Block RAM mapping guidelines in this HDL Coder eval reference document.
Getting Started with RAM and ROM in Simulink
web(fullfile(docroot, 'hdlcoder/ug/getting-started-with-ram-and-rom-in-simulink.html'))
Here are some other resources about RAM/ROM Mapping in MATLAB and Simulink to HDL code generation using HDL Coder
web(fullfile(docroot, 'hdlcoder/ug/appropriate-usage-of-delay-blocks-as-registers.html'))
web(fullfile(docroot, 'hdlcoder/ug/generate-fpga-block-ram-lookup-tables.html'))
web(fullfile(docroot, 'hdlcoder/ref/hdl.ram-system-object.html'))
web(fullfile(docroot, 'hdlcoder/ug/persistent-variables-1.html'))
web(fullfile(docroot, 'hdlcoder/ug/model-state-with-persistent-variables-and-system-objects.html'))
web(fullfile(docroot, 'hdlcoder/ug/map-matrices-to-block-rams-to-reduce-area.html'))
web(fullfile(docroot, 'hdlcoder/ug/how-to-map-persistent-arrays-to-ram.html'))
web(fullfile(docroot, 'hdlcoder/ug/appropriate-usage-of-delay-blocks-as-registers.html'))
Please share a sample model for specific guidance to your usecase.
Best Answer