system-verilogsystem-verilog-assertions

Why Quartus Prime does not want to ignore systemverilog assertion used for simulation?


I have following property declaration and check in one of my system verilog files:

   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);

This basically checks the width of a pulse generated by signal mc.outvec.StepOutP_o

When I try to compile the design, Quartus Prime fails on this property declaration saying

Error (10170): Verilog HDL syntax error at steppingcontroller.sv(404) near text: "]"; expecting an operand. Check for and fix any syntax errors that appear immediately before or at the specified keyword. The Intel FPGA Knowledge Database contains many articles with specific details on how to resolve this error. Visit the Knowledge Database at https://www.altera.com/support/support-resources/knowledge-base/search.html and search for this specific error message number.

Now, I would be thinking, that during analysis&synthesis these property declarations and associated assertions are completely ignored as they only concern simulation. But apparently it is not the case. Modelsim (original mentor graphics version) does not have a problem to compile it, and as well the assertion does what is expected. Quartus verilog compilation settings are set to 'SystemVerilog'

How to:

Thanks


Solution

  • One way to solve this is to use synthesis directives. You can specify synthesis translate_off and synthesis translate_on as shown below:

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

    Any code written between the translate_off , translate_on comments is ignored by the compiler. Please note that this feature can be disabled/enabled by setting the option ignore_translate_off_and_synthesis_off