Info
This question is closed. Reopen it to edit or answer.
I cannot use the Fixed-point Tool when using dual-port RAMs in my design - strange bug
2 views (last 30 days)
Show older comments
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 Comments
Answers (1)
Fangjun Jiang
on 7 Aug 2020
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 Comments
Fangjun Jiang
on 8 Aug 2020
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.
This question is closed.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!