SlickEdit Community

Archived Beta Discussions => SlickEdit 201x Beta Discussions => SlickEdit 2015 v20 Beta Discussion => Topic started by: tim_k on October 30, 2015, 08:05:49 PM

Title: RC4 - System Verilog Beautify selection - really broken
Post by: tim_k on October 30, 2015, 08:05:49 PM
Start with this:

          if (roiEnable)
            begin
              if (roiLoad)
                begin
                  roiFrameBuffer0StartAddr  <= frameBuffer0StartAddr + roiStartOffset;
                  roiFrameBuffer1StartAddr  <= frameBuffer1StartAddr + roiStartOffset;
                  roiFrameBuffer2StartAddr  <= frameBuffer2StartAddr + roiStartOffset;
                  roiFrameBuffer3StartAddr  <= frameBuffer3StartAddr + roiStartOffset;
                end
            end
          else
            begin
              roiFrameBuffer0StartAddr  <= frameBuffer0StartAddr;
              roiFrameBuffer1StartAddr  <= frameBuffer1StartAddr;
              roiFrameBuffer2StartAddr  <= frameBuffer2StartAddr;
              roiFrameBuffer3StartAddr  <= frameBuffer3StartAddr;
            end

Select it, then beautify with the default, or modified formatting. Get this:

        if(roiEnable)
        begin
        if(roiLoad)
        begin
        roiFrameBuffer0StartAddr  <= frameBuffer0StartAddr + roiStartOffset;
        roiFrameBuffer1StartAddr  <= frameBuffer1StartAddr + roiStartOffset;
        roiFrameBuffer2StartAddr  <= frameBuffer2StartAddr + roiStartOffset;
        roiFrameBuffer3StartAddr  <= frameBuffer3StartAddr + roiStartOffset;
        end
        end
        else
        begin
        roiFrameBuffer0StartAddr  <= frameBuffer0StartAddr;
        roiFrameBuffer1StartAddr  <= frameBuffer1StartAddr;
        roiFrameBuffer2StartAddr  <= frameBuffer2StartAddr;
        roiFrameBuffer3StartAddr  <= frameBuffer3StartAddr;
        end

It doesn't matter what I do to the beautify format options, I always get this. If I beautify an entire file, it works fine.
Same behavior on Mac or Linux.

-Tim
Title: Re: RC4 - System Verilog Beautify selection - really broken
Post by: patrick on October 30, 2015, 08:20:28 PM
Reproduced it, I'm taking a look at it.  Thanks for the report.
Title: Re: RC4 - System Verilog Beautify selection - really broken
Post by: tim_k on October 30, 2015, 09:08:05 PM
Wow, that was fast.

While you're at it, this doesn't change if beautified as a selection:

      localRoiEnable             <= roiEnable;
      localRoiStartLine     <= roiStartLine;
      localRoiStartPix           <= roiStartPix;
      localRoiWidth          <= roiWidth;
      localRoiHeight             <= roiHeight;


But as a file beautifiy it gets fixed to this:

      localRoiEnable             <= roiEnable;
      localRoiStartLine          <= roiStartLine;
      localRoiStartPix           <= roiStartPix;
      localRoiWidth              <= roiWidth;
      localRoiHeight             <= roiHeight;


-Tim
Title: Re: RC4 - System Verilog Beautify selection - really broken
Post by: patrick on October 30, 2015, 09:20:36 PM
Yeah, I introduced a bug at a high level for the beautification of selections, so there aren't many selections that will do the right thing.  On the good side, it's easy enough to fix, I'm testing the fix now...
Title: Re: RC4 - System Verilog Beautify selection - really broken
Post by: patrick on November 04, 2015, 02:43:56 PM
Fixed in rc5.
Title: Re: RC4 - System Verilog Beautify selection - really broken
Post by: tim_k on November 04, 2015, 10:48:54 PM
Better, but not quite there for my purposes.
Snippet (already manually beautified):

          begin
            fieldID               <= 0;
            hBlank                <= 0;
            vBlank                <= 0;
            trsDecodeState        <= waitForTrs;
            pixelCounter          <= 0;
            lineCounter           <= 0;
            statusLineCount       <= 0;
            statusPixelCount      <= 0;
            fidToFrameBuff        <= 0;
            fieldSyncToFrameBuff  <= 0;
          end


If i select between the begin/end, but not including them and beautify I get this:

          begin
            fieldID <= 0;
            hBlank <= 0;
            vBlank <= 0;
            trsDecodeState <= waitForTrs;
            pixelCounter <= 0;
            lineCounter <= 0;
            statusLineCount <= 0;
            statusPixelCount <= 0;
            fidToFrameBuff <= 0;
            fieldSyncToFrameBuff <= 0;
          end


If I include the begin/end in the selection I get this:

        begin
            fieldID              <= 0;
            hBlank               <= 0;
            vBlank               <= 0;
            trsDecodeState       <= waitForTrs;
            pixelCounter         <= 0;
            lineCounter          <= 0;
            statusLineCount      <= 0;
            statusPixelCount     <= 0;
            fidToFrameBuff       <= 0;
            fieldSyncToFrameBuff <= 0;
        end


It's clearly not aligning the assignments in the first case.

-Tim
Title: Re: RC4 - System Verilog Beautify selection - really broken
Post by: patrick on November 05, 2015, 02:37:22 PM
Reproduced.  The alignment is implemented by a state machine, and it looks like the code that should ensure transitions to the final state for snippets does not. For the cases that work, its the following syntax (like the 'end') that get it into the final state.  Good catch.
Title: Re: RC4 - System Verilog Beautify selection - really broken
Post by: patrick on November 09, 2015, 02:56:46 PM
This is fixed for the 2015 point release.  Thanks for the report.