In DML 1.2 it's possible to use parameter banks to iterate over banks in device:
foreach node_bank in (banks) {
<some logic>
}
But in DML 1.4 it produces error:
error: undefined value: 'undefined'
I tried to create a list with all banks in device to iterate over it:
param banks_list = [bank1, bank2, bank2]
but i got an error:
error: unknown identifier: 'bank1'
I also tried to create a session variable with banks (like it described here: Cannot use variable index in a constant list):
session bank banks_array = {bank1, bank2, bank3}
but i also got an error:
error: invalid data initializer: compound initializer not supported for type trait bank
In DML 1.4, you can use
foreach X in (each T in (N))to iterate over sets of objects of a certain template type inside a certain namespace. See the documentation foreach ... in. You can use thedevas the namespace to get all objects in the entire device model.You can use
#foreach X in ( [list] )to iterate over a compile-time list.For example:
In this example,
init_bb_bankswill count 4 banks overall and 3 countable banks, as there are three banks with thecountable_banktemplate set. Since all banks inherit thebanktemplate, you iterate over all banks by doingeach bank in (dev).The fixed list will count the 4 banks listed.