0

如何将约束应用于列表列表,类似于我可以对简单列表执行的操作:

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 行?请注意,约束只是举例,实际上我需要应用更复杂的约束,而不是索引列表项......

提前致谢。

4

1 回答 1

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;
        }; 
    };
};
'>
于 2016-02-16T09:49:52.313 回答