我在specman中有以下代码:
var x := some.very.long.path.to.a.variable.in.another.struct;
while (x == some_value) {
//do something that uses x;
//wait for something
//get a new value for x
x = some.very.long.path.to.a.variable.in.another.struct;
};
x
现在,将作业写两次似乎很浪费;初始化期间一次,循环期间一次。
我真正想要使用的是对长变量名的引用,这样我就可以这样做:
var x := reference to some.very.long.path.to.a.variable.in.another.struct;
while (x == some_value) {
//do something that uses x;
//wait for something
//no need to update x now since it's a reference
};
这可以在specman中完成吗?