Specman e: "keep type .. is a" 无法细化字段类型
Specman e: "keep type .. is a" fails to refine the type of a field
我的验证环境中有下一段代码:
// seq_file.e
extend SPECIFIC_TYPE sequence {
keep type driver is a SPECIFIC_TYPE sequence_driver;
event some_event is @driver.as_a(SPECIFIC_TYPE sequence_driver).some_event;
};
extend SPECIFIC_TYPE SEQ_NAME sequence {
body()@driver.clock is only {
var foo := driver.specific_type_field;
};
};
请注意,由于 keep type driver is a..
,driver
无需在 var foo..
行中进行转换
BUT,keep type driver is a..
不影响 some_event
,即如果从行中删除 as_a
转换,则有编译错误显示 'driver' does not have 'some_event' though its subtype do. use driver.as_a(SPECIFIC_TYPE sequence_driver)
.
为什么 keep type driver is a..
无法在 some_event..
行中转换 driver
?
感谢您的帮助
您的观察是正确的:字段访问(和方法调用)考虑了类型约束,但事件采样未考虑类型约束。这是一个限制,可能会在即将发布的版本中删除。我建议联系官方 Specman 支持以获取有关计划的确切信息。
我的验证环境中有下一段代码:
// seq_file.e
extend SPECIFIC_TYPE sequence {
keep type driver is a SPECIFIC_TYPE sequence_driver;
event some_event is @driver.as_a(SPECIFIC_TYPE sequence_driver).some_event;
};
extend SPECIFIC_TYPE SEQ_NAME sequence {
body()@driver.clock is only {
var foo := driver.specific_type_field;
};
};
请注意,由于 keep type driver is a..
,driver
无需在 var foo..
BUT,keep type driver is a..
不影响 some_event
,即如果从行中删除 as_a
转换,则有编译错误显示 'driver' does not have 'some_event' though its subtype do. use driver.as_a(SPECIFIC_TYPE sequence_driver)
.
为什么 keep type driver is a..
无法在 some_event..
行中转换 driver
?
感谢您的帮助
您的观察是正确的:字段访问(和方法调用)考虑了类型约束,但事件采样未考虑类型约束。这是一个限制,可能会在即将发布的版本中删除。我建议联系官方 Specman 支持以获取有关计划的确切信息。