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

1 view (last 30 days)
Dominik Hiltbrunner
Dominik Hiltbrunner on 7 Aug 2020
Closed: MATLAB Answer Bot on 20 Aug 2021
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?

Answers (1)

Fangjun Jiang
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.
Dominik Hiltbrunner
Dominik Hiltbrunner on 19 Aug 2020
Hello, thanks for your answer.
I have been playing around with the fixed-point designer for a couple of days now. Seems like there is no way around this issue. So far I use a workaround where I replace my RAM and the counters by other blocks that yield the same functional behaviour.
I will write a ticket to the support by time.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by