Matlab to RTL - Block RAM Enable
1 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
采纳的回答
Girish Venkataramani
2014-12-4
Hi Arun,
I am from MathWorks. So, the example was written a while back. Many of the features were developed in later releases. The examples need to be updated - we have not yet done that.
Remember, if you want maximum efficiency (i.e., avoiding additional muxes etc), you should use the system object.
0 个评论
更多回答(1 个)
Girish Venkataramani
2014-12-1
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 个评论
krishna amar
2015-2-5
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...................
另请参阅
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!