我有这段代码:
<'
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'。
如果有人可以向我推销,我将不胜感激。
谢谢,
答案 0 :(得分:1)
我在阅读了有关CFA的更多信息后尝试了你的代码,看起来似乎在Specman中发生了一些可疑的事情。就像汉尼斯说的那样,这可能是一个错误。
答案 1 :(得分:1)
这确实看起来很奇怪。特别是如果你打开跟踪生成。其中,日志显示了这一点:
- &GT; 0#GEN&gt;解决生成行动#3的连通字段集#12 :(在sys-@1.pkt.header中)
pkt.header
- &GT; 0#GEN&gt;减少:
pkt.header -> [6]
due to constraints:
keep read_only(pkt.t == GOOD) => pkt.header == 6 at line 10 in @cfa_depr
**with the input state:**
read_only(pkt.t == GOOD): TRUE
- &GT; 0#GEN&gt;已完成的连接字段解决方案:(在sys-@1.pkt.header中)
pkt.header: 6
constrained by:
keep read_only(pkt.t == GOOD) => pkt.header == 6 at line 10 in @cfa_depr
这可能是一个错误,我会与开发人员核实。
答案 2 :(得分:1)
首先,标题字段用“!
”表示,这是一个不生成字段,删除它并且警告将消失。
如果在生成pkt.header之前未生成pkt,则可能会因尝试访问未分配的内存区域而遇到OS11错误。
第二,行:
keep read_only(pkt.t==GOOD) => pkt.header==6;
应该驻留在结构本身内部(使用“soft
”或不使用它。)
答案 3 :(得分:1)
测试用例中的行为确实是一个错误。在此方案中不应发出警告。可以从Cadence支持部门获得该问题的可用补丁。
有关上述约束的具体细节,特别是此警告,您可以考虑Specman文档(Specman Generation用户指南中的1.10节)。