Matlab to RTL - Block RAM Enable
Afficher commentaires plus anciens
An array will get recognized as block RAM. So foo_ary(index) = write_value_at_index will write to the block RAM Question - how to use the enable of the block ram i.e. Above value should be written only when foo_ary_enable is '1'. So on certain index values the array should not be updated, what is the syntax for that? foo_ary_enable is calculated in another loop
Réponse acceptée
Plus de réponses (1)
Girish Venkataramani
le 1 Déc 2014
HDL Coder supports mapping to RAMs in two ways: 1. Manual mapping using the hdl.Ram system object 2. Automatic mapping from MATLAB code
If you know exactly how the RAM should be connected, it may be better to use the manual approach. When using the hdl.Ram system object, you must fully specify all the port connections, including read-address, write-address, write-data and write-enable. See the documentation for an example of using hdl.RAM, but the following is a snippet of usage:
persistent hRam; if isempty(hRam)
hRam = hdl.RAM('RAMType', 'Dual port');
end
% execute single step of RAM
[~, ramRdDout] = step(hRam, ramWriteData, ramWriteAddr, ramWriteEnable, ramReadAddr);
However, you can also do this with the automatic approach. If you want to control using an enable line, all you may want to do is put it in a conditional:
if foo_ary_enable
foo_ary(index) = write_value;
end
2 commentaires
Arun
le 1 Déc 2014
krishna amar
le 5 Fév 2015
Hi, I am unable to gernerate the VHDL test bench for the example code given On RGB to YUV convertion. Mtlab is running for long time but I am not getting the Output. I have got the VHDL code but unable to generate Test bench.Please help me with this...................
Catégories
En savoir plus sur Speed and Area Optimization dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!