如何将约束应用于列表列表,类似于我可以对简单列表执行的操作:
list_size: uint;
my_list: list of uint;
keep my_list.size() == list_size;
keep for each (item) using index (item_index) in my_list { item == item_index;};
我的目的是创造类似的东西:
list_size:uint;
grosslist_size:uint;
my_grosslist: list of list of uint;
keep my_grosslist.size() == grosslist_size;
keep for each (grossitem) using index (grossindex)in my_grosslist {
grossitem.size() == list_size;
// keep for each (item) using index (item_index) in grossitem {
// item == item_index + grossindex * 100;
// };
};
如何使用Specman语法编写上面评论的3行? 请注意,约束仅作为示例,实际上我需要应用更复杂的约束而不是索引列表项...
提前致谢。
答案 0 :(得分:0)
您编写的代码确实是list-of-list的正确用法。请注意,缺少空间,并且每个内部都不需要额外的“保留”。除此之外,它有效。
<'
extend sys {
list_size:uint;
grosslist_size:uint;
my_grosslist: list of list of uint;
keep my_grosslist.size() == grosslist_size;
keep for each (grossitem) using index (grossindex) in my_grosslist {
grossitem.size() == list_size;
for each (item) using index (item_index) in grossitem {
item == item_index + grossindex * 100;
};
};
};
'>