我有这个代码:
<'
type type_t:[GOOD,BAD];
struct packet {
t:type_t;
!header:uint(bits:3);
};
extend sys {
!pkt:packet;
keep read_only(pkt.t==GOOD) => pkt.header==6;
run() is also {
gen pkt;
gen pkt.header;
print pkt;
};
};
'>
当我运行它时,当我尝试生成 pkt.header 时,会收到这个奇怪的警告:
*** Warning: WARN_GEN_CFA_UNSUPPORTED:
The following constraint-from-above includes input(s) which cannot be sampled
during the allocation of packet-@1.
keep read_only(pkt.t == GOOD) => pkt.header == 6 at line 9 in @gen
Enforcing the constraint through later sampling of these inputs is not
supported yet, and therefore it will not be enforced in the following
gen-action.
at line 12 in @gen
gen pkt.header;
这个错误信息很奇怪,因为当我发出 'gen pkt.header' 时,pkt 已经生成(分配)了,'t' 也是如此。
如果有人可以向我解释这一点,我将不胜感激。
谢谢,