【问题标题】:Why Quartus Prime does not want to ignore systemverilog assertion used for simulation?为什么 Quartus Prime 不想忽略用于仿真的 systemverilog 断言?
【发布时间】:2017-10-25 12:18:23
【问题描述】:

我有以下属性声明并签入我的系统 verilog 文件之一:

   property StepOutP_pulse_width;
      int count;
      @(posedge ClkRs_ix.clk)
    ($rose(mc.outvec.StepOutP_o),count=STEPPER_PULSE_WIDTH) |->
      (mc.outvec.StepOutP_o,count--)[*] ##1 (~mc.outvec.StepOutP_o && count==0);
   endproperty // StepOutP_pulse_width
   assert property (StepOutP_pulse_width);

这基本上是检查信号 mc.outvec.StepOutP_o 产生的脉冲宽度

当我尝试编译设计时,Quartus Prime 在这个属性声明上失败了

错误 (10170):steppingcontroller.sv(404) 处的 Verilog HDL 语法错误 靠近文字:“]”;期待一个操作数。检查并修复任何语法 紧接在指定关键字之前或处出现的错误。这 英特尔 FPGA 知识数据库包含许多具有特定 有关如何解决此错误的详细信息。访问知识数据库 https://www.altera.com/support/support-resources/knowledge-base/search.html 并搜索此特定错误消息编号。

现在,我会想,在分析和综合过程中,这些属性声明和相关断言被完全忽略,因为它们只涉及模拟。但显然情况并非如此。 Modelsim(原始导师图形版本)编译它没有问题,并且断言也符合预期。 Quartus verilog 编译设置设置为 'SystemVerilog'

如何:

  • 使属性规范与 quartus 编译器兼容?

  • 或设置编译器忽略这些断言?

谢谢

【问题讨论】:

  • 我一直在使用的所有方法都建议将ifdef/ifndef 放在断言代码周围。所以,你可以做到。它优于使用翻译开/关指令。
  • 错误消息表明它将文件视为 Verilog 而不是 SystemVerilog。如果注释掉断言,它是否接受其他 SystemVerilog 关键字,例如 always_combalways_ff
  • 我已经检查过了,Quartus 编译器确实是在 SystemVerilog 模式下设置的。除非除了 Assignments/Settings/Compiler Settings/Verilog HDL 输入之外还有其他设置。 ifdef 比 on/off 指令更受欢迎的确切原因是什么?

标签: system-verilog system-verilog-assertions


【解决方案1】:

解决此问题的一种方法是使用综合指令。您可以指定综合 translate_off 和综合 translate_on 如下所示:

// synthesis translate_off    
property StepOutP_pulse_width;
      int count;
      @(posedge ClkRs_ix.clk)
    ($rose(mc.outvec.StepOutP_o),count=STEPPER_PULSE_WIDTH) |->
      (mc.outvec.StepOutP_o,count--)[*] ##1 (~mc.outvec.StepOutP_o && count==0);
   endproperty // StepOutP_pulse_width
   assert property (StepOutP_pulse_width);    
// synthesis translate_on

编译器会忽略 translate_off 和 translate_on cmets 之间编写的任何代码。请注意,可以通过设置选项ignore_translate_off_and_synthesis_off来禁用/启用此功能

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-19
    • 2011-01-26
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多