Forum Discussion

alexislms's avatar
alexislms
Icon for Contributor rankContributor
3 years ago
Solved

22.1 PRO: (*preserve_for_debug*) signals not preserved

1. I follow the steps "2.4.1. Preserving Signals for Monitoring and Debugging" in 683819

2. I watched and followed this Intel-FPGA video: https://www.youtube.com/watch?v=sEKc2ut42gU

What do I do wrong?

Quartus Pro 22.1

Regards,

  • Hello,


    Alright thanks for the feedback. I've let them know that you expect this fix to apply to all data types.

    In the meantime your only workaround is to have the signal connected to an i/o port.

    With that, I now transition this thread to community support. If you have a new question, feel free to open a new thread to get the support from Intel experts. Otherwise, the community users will continue to help you on this thread. Thank you.


    Regards,

    Nurina


    P/S: If you like my comment, feel free to give Kudos. If my comment solved your problem, feel free to accept my comment as solution.


30 Replies

  • sstrell's avatar
    sstrell
    Icon for Super Contributor rankSuper Contributor

    Yes, and then it says "by specifying assignments in the Assignment Editor or project .qsf file directly." There are multiple methods for using this.

    I'm not saying you did anything wrong but again, what you are trying to preserve with this is not what this feature is for. Use virtual pin assignments and you will be good to go.

    preserve_for_debug is for internal signals, not outputs.

    • alexislms's avatar
      alexislms
      Icon for Contributor rankContributor

      @sstrell wrote:

      Yes, and then it says "by specifying assignments in the Assignment Editor or project .qsf file directly." There are multiple methods for using this.

      I'm not saying you did anything wrong but again, what you are trying to preserve with this is not what this feature is for.


      I quoted the documentation showing it is meant for my situation.

      Use virtual pin assignments and you will be good to go.

      virtual pins aren't mentioned in the doc, nowhere for debugging purpose.

      I feel like this "technique" is just a work-around that people have been used and advised for years (and convinced themselves it's the way to go) just due to the lack of proper support for debugging.

      After the Xilinx's mark_debug experience, this technique seems very inefficient and a huge step back to the past.

      preserve_for_debug is for internal signals, not outputs.


      there no such limitations written in the doc, quite the opposite

      "sigtodebug" is an output of a module, not an output pin, therefore it is an internal signal

  • sstrell's avatar
    sstrell
    Icon for Super Contributor rankSuper Contributor

    I don't want to argue. I'm just explaining how I use the features. Virtual pins have been around in the software forever to prevent unconnected I/O from being optimized away. Preserve for debug was only recently introduced because it was frustrating if you wanted to tap a deeply buried signal that was post-fit (as opposed to pre-synthesis directly from your RTL). A happy side effect of doing this is it can reduce or eliminate recompiles since tapping post-fit signals uses incremental routing (aka available post-fit routing wires).

    • alexislms's avatar
      alexislms
      Icon for Contributor rankContributor

      Indeed, not for debugging purpose. My signal is not an I/O pin.

      If that's the way to go, I'll waste my time with manual work the tool should do.

      Thanks for your help.

    • alexislms's avatar
      alexislms
      Icon for Contributor rankContributor

      Hello@Nurina ,

      Not really.

      The scope of the verilog pragma is still unclear. I see in the documentation that my use case should work but @sstrell says otherwise.

      There are lots of cases where the signals aren't preserved, either by setting the pragma in the code or using the contextual menu link in Platform Designer.

      Could you confirm as an official answer that the sigtodebug in the code below should be preserved?

      module top(
        ...
      );
      
      (*preserve_for_debug*)logic sigtodebug; //not used, just want to see it in Signaltap
      
      mymod mymod_inst (
        .out_a (sigtodebug),
        .in_b ('0),
        .in_c ('0)
      );
      
      endmodule

      This code example is a perfect example to see in SignalTap some status/debug signals left unconnected.

      Basically, should any signals marked as preserve_to_debug be preserved?

      Either it's a bug and I'd expect a fix, or it's normal and I'll just stop using it and move to another technique to debug signals.

      As a comment to Quartus's development team, the difference of the debugging feature between the Xilinx's mark_debug and Intel's preserve_for_debug/SignalTap/virtual pins, is a real pain.

      Best regards,

  • Nurina's avatar
    Nurina
    Icon for Regular Contributor rankRegular Contributor

    Hi,


    I've tried to reproduce your problem on my machine. It would only be preserved if you use the sigtodebug in your design.

    Maybe this is happening because it's been synthesised away.


    I'll bring this up to our internal team and ask if this is intentional.


    Regards,

    Nurina


    • alexislms's avatar
      alexislms
      Icon for Contributor rankContributor

      Hi @Nurina,

      Please define "use". The signal exists, it's driven by something but doesn't have any fanouts. (it can be a link_up, some counters or anything meaningful only for debugging purpose)

      Also, as @sstrell suggested, adding the signal as virtual pin doesn't change anything, the signal is still optimized out.

      After Analysis&Synthesis:

      This needs to be fixed.

      Regards,

      • alexislms's avatar
        alexislms
        Icon for Contributor rankContributor

        I've also tried via the Assignment Editor:

        set_instance_assignment -name PRESERVE_FOR_DEBUG ON -to *sigtodebug*

        without success. The signal isn't kept.

  • Nurina's avatar
    Nurina
    Icon for Regular Contributor rankRegular Contributor

    Hi,


    By use, I meant that it's driven by something with fanouts. Although with this attribute we should expect it to be preserved no matter what.

    This looks like a bug, I'm reporting this issue to our engineering team. I will let you know of any updates.


    Regards,

    Nurina


    • alexislms's avatar
      alexislms
      Icon for Contributor rankContributor

      Thank you for the confirmation @Nurina.

      I've been trying to use this attribute for few days now, it has never worked properly.

      Some times I can see the signal under "Preserved for debugging" in the "Node Finder" but the signals are driven and have fanouts, nevertheless even without the attribute they wouldn't be optimized away and are present under "Pre-synthesis".

      My question was about a very simple case to show the bug, my use case is mostly using typedef and struct (packed).

      typedef struct {
        logic init;
        logic [3:0] b;
      } t_data;
      (*preserve_for_debug*)t_data tx;
      (*preserve_for_debug*)t_data rx;
      (*preserve_for_debug*)t_data tx_array[4];
      (*preserve_for_debug*)t_data rx_array[4];
      

      Please make sure this is also possible using any data types of Verilog/SystemVerilog.

      Regards,

  • Quartus pro 23.1, we still have issues with preserve_for_debug...

    This will never ends...

    IPS case opened, I just comment here for tracking purpose.