1

我的验证环境中有下一个代码:

// 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..

但是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..无法投driver下线some_event..

谢谢您的帮助

4

1 回答 1

1

您的观察是正确的:字段访问(和方法调用)考虑了类型约束,但不考虑事件采样。这是一个限制,可能会在即将发布的版本中删除。我建议联系 Specman 官方支持以获取有关计划的确切信息。

于 2018-07-05T19:02:05.193 回答