Info
Questa domanda è chiusa. Riaprila per modificarla o per rispondere.
I cannot use the Fixed-point Tool when using dual-port RAMs in my design - strange bug
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
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.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/342913/image.png)
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 Commenti
Risposte (1)
Fangjun Jiang
il 7 Ago 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 Commenti
Fangjun Jiang
il 8 Ago 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.
Questa domanda è chiusa.
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!