开发者

How to use instances of a module with instances' index?

开发者 https://www.devze.com 2023-02-13 23:46 出处:网络
For example, m开发者_开发技巧odule MM; MM mm[128](); I want to get mm[i].signle1,i from 0 to 120.

For example,

m开发者_开发技巧odule MM;

MM mm[128]();

I want to get mm[i].signle1,i from 0 to 120. but I cannot use "for", and I do not want to write 120 statments.

what can I do?


You can create a list of ports and you can use a for loop:

signals : list of simple_port of bit is instance;
keep signals.size() == 128;
keep for each (s) in signals {
    s.hdl_path() == append("mm[",dec(i),"].signal1");
};
0

精彩评论

暂无评论...
验证码 换一张
取 消