Memory dump of Simulink block 'Single Port RAM'

2 ビュー (過去 30 日間)
Michel Bondy
Michel Bondy 2021 年 11 月 26 日
I have added a 'Single port RAM' block to my simulink model.
I am feeding it data through the 'din' while setting the 'addr' line to the address where I want to write the data (in my case the address is counting down from 100 to 1). All while holding the 'wr_en' line to 1.
The model runs and produces no errors.
Is there a way to visualize the contents of the memory after the simulation has run? The Data Inspector doesn't seem to have a way to look into the memory of the 'Single port RAM' to see what is in there.
Thanks.

採用された回答

Harikrishnan Balachandran Nair
Harikrishnan Balachandran Nair 2021 年 11 月 30 日
Hi,
'To workspace' Blocks in simulink can be used to write the signal data to the base workspace. Using this block, you can log the signal 'din' that is being written to the 'single port RAM', to the base workspace, so that further analysis can be done on this data.
Hope this helps!
  2 件のコメント
Michel Bondy
Michel Bondy 2021 年 12 月 15 日
Right, ok. but the data on the port 'din' is sequential in time, if I just put that to a workspace variable the values will be sequential in time, and not be scattered by the address - that's what I am after.
As I run the simulation, the 'addr'ess of the data on 'din' is given. When the simulation is done I want to be able to see at which memory location each piece of data ended up. Can I dump the memory somehow?
Harikrishnan Balachandran Nair
Harikrishnan Balachandran Nair 2021 年 12 月 21 日
One possible workaround would be to store both 'Addresses' and 'Input Data' to the Workspace using 'To workspace' Blocks. This way, you can form the relation between the 'Address' and Input Data'.
You can also try using 'Map containers' to store the relationship between the Address and Data using the available workspace variables.
Hope this helps!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSignal Attributes and Indexing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by