Info
此问题已关闭。 请重新打开它进行编辑或回答。
I cannot use the Fixed-point Tool when using dual-port RAMs in my design - strange bug
1 次查看(过去 30 天)
显示 更早的评论
Hello Community
I have a Simulink design which requires quite a large word lenght (64bit signed fixed-point) to run without overflows.
Now I want to optimize my design by using the Fixed-point Tool Add-On in order to identify the required resolution of sub-blocks in my design.
However, I get a strange error when I try to collect the ranges.
The block "select" is inside the "Simple dual-port RAM" block and is locked, i.e. cannot be edited. The signal "Idx1", which is connected to the "rd_addr" port, is driven by a unsigned integer (unsigned fixed-point number with no fraction). By monitoring this signal I can confirm that no signal with the value "-16" enters the RAM block. Therefore, I do not know what causes this error. Unfortunately, the RAM block is locked and I cannot monitor the internal signals.
I attached a simple Simulink model which reproduces the problem.
How can I fix this?
0 个评论
回答(1 个)
Fangjun Jiang
2020-8-7
Internal "Idx1" traces back to input port "rd_addr". The error is complaining that the "rd_addr" can't be negative. In your model, the "rd_addr" could be negative due to the subtraction of 16.
3 个评论
Fangjun Jiang
2020-8-8
For "Range Collection Mode", select "Derived ranges", not "Simulation ranges". It will give you the analysis result. It shows overflows.
Although you wrap it, the value between 0 to 63 subtracted by 16 will cause negative value. Maybe the analysis tool didn't consider the wrap.
It might be worth to report this to the Mathworks tech support.
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!