How to decipher comments in generated Verilog from chisel?












2















Here is some genereated Verilog from the PassTrough module found in:
https://github.com/freechipsproject/chisel-bootcamp/blob/master/2.1_first_module.ipynb



module PassTrough( // @[:@3.2]
input clock, // @[:@4.4]
input reset, // @[:@5.4]
input [9:0] io_in, // @[:@6.4]
output [9:0] io_out // @[:@6.4]
);
assign io_out = io_in; // @[buffer.scala 10:10:@8.4]
endmodule


Are there any resources about understanding what is in the comments. I can see that they related to the code location in the original scala file but would like to know more details.



// @[buffer.scala 10:10:@8.4]


A more detailed explanation of this line would be useful.










share|improve this question



























    2















    Here is some genereated Verilog from the PassTrough module found in:
    https://github.com/freechipsproject/chisel-bootcamp/blob/master/2.1_first_module.ipynb



    module PassTrough( // @[:@3.2]
    input clock, // @[:@4.4]
    input reset, // @[:@5.4]
    input [9:0] io_in, // @[:@6.4]
    output [9:0] io_out // @[:@6.4]
    );
    assign io_out = io_in; // @[buffer.scala 10:10:@8.4]
    endmodule


    Are there any resources about understanding what is in the comments. I can see that they related to the code location in the original scala file but would like to know more details.



    // @[buffer.scala 10:10:@8.4]


    A more detailed explanation of this line would be useful.










    share|improve this question

























      2












      2








      2








      Here is some genereated Verilog from the PassTrough module found in:
      https://github.com/freechipsproject/chisel-bootcamp/blob/master/2.1_first_module.ipynb



      module PassTrough( // @[:@3.2]
      input clock, // @[:@4.4]
      input reset, // @[:@5.4]
      input [9:0] io_in, // @[:@6.4]
      output [9:0] io_out // @[:@6.4]
      );
      assign io_out = io_in; // @[buffer.scala 10:10:@8.4]
      endmodule


      Are there any resources about understanding what is in the comments. I can see that they related to the code location in the original scala file but would like to know more details.



      // @[buffer.scala 10:10:@8.4]


      A more detailed explanation of this line would be useful.










      share|improve this question














      Here is some genereated Verilog from the PassTrough module found in:
      https://github.com/freechipsproject/chisel-bootcamp/blob/master/2.1_first_module.ipynb



      module PassTrough( // @[:@3.2]
      input clock, // @[:@4.4]
      input reset, // @[:@5.4]
      input [9:0] io_in, // @[:@6.4]
      output [9:0] io_out // @[:@6.4]
      );
      assign io_out = io_in; // @[buffer.scala 10:10:@8.4]
      endmodule


      Are there any resources about understanding what is in the comments. I can see that they related to the code location in the original scala file but would like to know more details.



      // @[buffer.scala 10:10:@8.4]


      A more detailed explanation of this line would be useful.







      chisel






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 21 '18 at 17:04









      cayluscaylus

      13316




      13316
























          1 Answer
          1






          active

          oldest

          votes


















          3














          These are source locators and will show up in generated FIRRTL or Verilog. These tell you what line in a source file (Chisel or FIRRTL) was used to generate a specific line in the downstream FIRRTL or Verilog.



          The format is generally: @[<file> <line>:<column> ...]



          More than one source locator may be present.



          Example



          Consider the following example pulled from the BoringUtilsSpec. The line numbers (which do not start at zero as this was extracted from a larger file) are shown along with the column numbers. You can see how things line up between them. For example, the declaration of notA happens on line 27 column 20 and the assignment notA := ~a happens on line 30, column 10. You see 27:20 and 30:10 show up in the FIRRTL. In the Verilog, these get merged somewhat and you wind up with source locators indicating both 27:20 and 30:10:



          // -------------------------------------------+----+
          // File: BoringUtilsSpec.scala | |
          // -------------------------------------------+----+
          // Column Number | |
          // -------------------------------------------+----+
          // 1 2 3 4 | |
          // 01234567890123456789012345678901234567890 | |
          // -------------------------------------------+----|
          class BoringInverter extends Module { // | 24 | Line Number
          val io = IO(new Bundle{}) // | 5 |
          val a = Wire(UInt(1.W)) // | 6 |
          val notA = Wire(UInt(1.W)) // | 7 |
          val b = Wire(UInt(1.W)) // | 8 |
          a := 0.U // | 9 |
          notA := ~a // | 30 |
          b := a // | 1 |
          chisel3.assert(b === 1.U) // | 2 |
          BoringUtils.addSource(notA, "x") // | 3 |
          BoringUtils.addSink(b, "x") // | 4 |
          } // | 5 |
          // -------------------------------------------+----+


          This produces the following FIRRTL:



          module BoringUtilsSpecBoringInverter : 
          input clock : Clock
          input reset : UInt<1>
          output io : {}

          wire a : UInt<1> @[BoringUtilsSpec.scala 26:17]
          wire notA : UInt<1> @[BoringUtilsSpec.scala 27:20]
          wire b : UInt<1> @[BoringUtilsSpec.scala 28:17]
          a <= UInt<1>("h00") @[BoringUtilsSpec.scala 29:7]
          node _T = not(a) @[BoringUtilsSpec.scala 30:13]
          notA <= _T @[BoringUtilsSpec.scala 30:10]
          b <= a @[BoringUtilsSpec.scala 31:7]
          node _T_1 = eq(b, UInt<1>("h01")) @[BoringUtilsSpec.scala 32:22]
          node _T_2 = bits(reset, 0, 0) @[BoringUtilsSpec.scala 32:19]
          node _T_3 = or(_T_1, _T_2) @[BoringUtilsSpec.scala 32:19]
          node _T_4 = eq(_T_3, UInt<1>("h00")) @[BoringUtilsSpec.scala 32:19]
          // assert not shown


          And the following Verilog:



          module BoringUtilsSpecBoringInverter(
          input clock,
          input reset
          );
          wire _T; // @[BoringUtilsSpec.scala 30:13]
          wire notA; // @[BoringUtilsSpec.scala 27:20 BoringUtilsSpec.scala 30:10]
          wire _T_3; // @[BoringUtilsSpec.scala 32:19]
          wire _T_4; // @[BoringUtilsSpec.scala 32:19]
          assign _T = 1'h1; // @[BoringUtilsSpec.scala 30:13]
          assign notA = 1'h1; // @[BoringUtilsSpec.scala 27:20 BoringUtilsSpec.scala 30:10]
          assign _T_3 = _T | reset; // @[BoringUtilsSpec.scala 32:19]
          assign _T_4 = _T_3 == 1'h0; // @[BoringUtilsSpec.scala 32:19]
          // assert not shown
          endmodule


          Caveats



          Generator Bootcamp



          If you are running this in the Chisel Bootcamp Jupyter Notebook or through an sbt console/REPL, the source locators may not make as much sense as there really isn't a file here with lines.



          Difference with Annotation



          These source locators are not Annotations, in case anyone has come across that name.



          Annotations are metadata associated with circuit components. Source locators (which map to Info in the FIRRTL IR) are associated with specific statements in some source file. Under the hood they're just strings that get generated and then copied around. There is no guarantee that source locators will be preserved---they may be changed or deleted arbitrarily. Conversely, Annotations are preserved and renamed across transformations and have strong guarantees on how they behave.



          Consequently, do not rely on source locators for anything other than an aid if you need to debug the Chisel or FIRRTL compiler stages.






          share|improve this answer


























            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53417212%2fhow-to-decipher-comments-in-generated-verilog-from-chisel%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            3














            These are source locators and will show up in generated FIRRTL or Verilog. These tell you what line in a source file (Chisel or FIRRTL) was used to generate a specific line in the downstream FIRRTL or Verilog.



            The format is generally: @[<file> <line>:<column> ...]



            More than one source locator may be present.



            Example



            Consider the following example pulled from the BoringUtilsSpec. The line numbers (which do not start at zero as this was extracted from a larger file) are shown along with the column numbers. You can see how things line up between them. For example, the declaration of notA happens on line 27 column 20 and the assignment notA := ~a happens on line 30, column 10. You see 27:20 and 30:10 show up in the FIRRTL. In the Verilog, these get merged somewhat and you wind up with source locators indicating both 27:20 and 30:10:



            // -------------------------------------------+----+
            // File: BoringUtilsSpec.scala | |
            // -------------------------------------------+----+
            // Column Number | |
            // -------------------------------------------+----+
            // 1 2 3 4 | |
            // 01234567890123456789012345678901234567890 | |
            // -------------------------------------------+----|
            class BoringInverter extends Module { // | 24 | Line Number
            val io = IO(new Bundle{}) // | 5 |
            val a = Wire(UInt(1.W)) // | 6 |
            val notA = Wire(UInt(1.W)) // | 7 |
            val b = Wire(UInt(1.W)) // | 8 |
            a := 0.U // | 9 |
            notA := ~a // | 30 |
            b := a // | 1 |
            chisel3.assert(b === 1.U) // | 2 |
            BoringUtils.addSource(notA, "x") // | 3 |
            BoringUtils.addSink(b, "x") // | 4 |
            } // | 5 |
            // -------------------------------------------+----+


            This produces the following FIRRTL:



            module BoringUtilsSpecBoringInverter : 
            input clock : Clock
            input reset : UInt<1>
            output io : {}

            wire a : UInt<1> @[BoringUtilsSpec.scala 26:17]
            wire notA : UInt<1> @[BoringUtilsSpec.scala 27:20]
            wire b : UInt<1> @[BoringUtilsSpec.scala 28:17]
            a <= UInt<1>("h00") @[BoringUtilsSpec.scala 29:7]
            node _T = not(a) @[BoringUtilsSpec.scala 30:13]
            notA <= _T @[BoringUtilsSpec.scala 30:10]
            b <= a @[BoringUtilsSpec.scala 31:7]
            node _T_1 = eq(b, UInt<1>("h01")) @[BoringUtilsSpec.scala 32:22]
            node _T_2 = bits(reset, 0, 0) @[BoringUtilsSpec.scala 32:19]
            node _T_3 = or(_T_1, _T_2) @[BoringUtilsSpec.scala 32:19]
            node _T_4 = eq(_T_3, UInt<1>("h00")) @[BoringUtilsSpec.scala 32:19]
            // assert not shown


            And the following Verilog:



            module BoringUtilsSpecBoringInverter(
            input clock,
            input reset
            );
            wire _T; // @[BoringUtilsSpec.scala 30:13]
            wire notA; // @[BoringUtilsSpec.scala 27:20 BoringUtilsSpec.scala 30:10]
            wire _T_3; // @[BoringUtilsSpec.scala 32:19]
            wire _T_4; // @[BoringUtilsSpec.scala 32:19]
            assign _T = 1'h1; // @[BoringUtilsSpec.scala 30:13]
            assign notA = 1'h1; // @[BoringUtilsSpec.scala 27:20 BoringUtilsSpec.scala 30:10]
            assign _T_3 = _T | reset; // @[BoringUtilsSpec.scala 32:19]
            assign _T_4 = _T_3 == 1'h0; // @[BoringUtilsSpec.scala 32:19]
            // assert not shown
            endmodule


            Caveats



            Generator Bootcamp



            If you are running this in the Chisel Bootcamp Jupyter Notebook or through an sbt console/REPL, the source locators may not make as much sense as there really isn't a file here with lines.



            Difference with Annotation



            These source locators are not Annotations, in case anyone has come across that name.



            Annotations are metadata associated with circuit components. Source locators (which map to Info in the FIRRTL IR) are associated with specific statements in some source file. Under the hood they're just strings that get generated and then copied around. There is no guarantee that source locators will be preserved---they may be changed or deleted arbitrarily. Conversely, Annotations are preserved and renamed across transformations and have strong guarantees on how they behave.



            Consequently, do not rely on source locators for anything other than an aid if you need to debug the Chisel or FIRRTL compiler stages.






            share|improve this answer






























              3














              These are source locators and will show up in generated FIRRTL or Verilog. These tell you what line in a source file (Chisel or FIRRTL) was used to generate a specific line in the downstream FIRRTL or Verilog.



              The format is generally: @[<file> <line>:<column> ...]



              More than one source locator may be present.



              Example



              Consider the following example pulled from the BoringUtilsSpec. The line numbers (which do not start at zero as this was extracted from a larger file) are shown along with the column numbers. You can see how things line up between them. For example, the declaration of notA happens on line 27 column 20 and the assignment notA := ~a happens on line 30, column 10. You see 27:20 and 30:10 show up in the FIRRTL. In the Verilog, these get merged somewhat and you wind up with source locators indicating both 27:20 and 30:10:



              // -------------------------------------------+----+
              // File: BoringUtilsSpec.scala | |
              // -------------------------------------------+----+
              // Column Number | |
              // -------------------------------------------+----+
              // 1 2 3 4 | |
              // 01234567890123456789012345678901234567890 | |
              // -------------------------------------------+----|
              class BoringInverter extends Module { // | 24 | Line Number
              val io = IO(new Bundle{}) // | 5 |
              val a = Wire(UInt(1.W)) // | 6 |
              val notA = Wire(UInt(1.W)) // | 7 |
              val b = Wire(UInt(1.W)) // | 8 |
              a := 0.U // | 9 |
              notA := ~a // | 30 |
              b := a // | 1 |
              chisel3.assert(b === 1.U) // | 2 |
              BoringUtils.addSource(notA, "x") // | 3 |
              BoringUtils.addSink(b, "x") // | 4 |
              } // | 5 |
              // -------------------------------------------+----+


              This produces the following FIRRTL:



              module BoringUtilsSpecBoringInverter : 
              input clock : Clock
              input reset : UInt<1>
              output io : {}

              wire a : UInt<1> @[BoringUtilsSpec.scala 26:17]
              wire notA : UInt<1> @[BoringUtilsSpec.scala 27:20]
              wire b : UInt<1> @[BoringUtilsSpec.scala 28:17]
              a <= UInt<1>("h00") @[BoringUtilsSpec.scala 29:7]
              node _T = not(a) @[BoringUtilsSpec.scala 30:13]
              notA <= _T @[BoringUtilsSpec.scala 30:10]
              b <= a @[BoringUtilsSpec.scala 31:7]
              node _T_1 = eq(b, UInt<1>("h01")) @[BoringUtilsSpec.scala 32:22]
              node _T_2 = bits(reset, 0, 0) @[BoringUtilsSpec.scala 32:19]
              node _T_3 = or(_T_1, _T_2) @[BoringUtilsSpec.scala 32:19]
              node _T_4 = eq(_T_3, UInt<1>("h00")) @[BoringUtilsSpec.scala 32:19]
              // assert not shown


              And the following Verilog:



              module BoringUtilsSpecBoringInverter(
              input clock,
              input reset
              );
              wire _T; // @[BoringUtilsSpec.scala 30:13]
              wire notA; // @[BoringUtilsSpec.scala 27:20 BoringUtilsSpec.scala 30:10]
              wire _T_3; // @[BoringUtilsSpec.scala 32:19]
              wire _T_4; // @[BoringUtilsSpec.scala 32:19]
              assign _T = 1'h1; // @[BoringUtilsSpec.scala 30:13]
              assign notA = 1'h1; // @[BoringUtilsSpec.scala 27:20 BoringUtilsSpec.scala 30:10]
              assign _T_3 = _T | reset; // @[BoringUtilsSpec.scala 32:19]
              assign _T_4 = _T_3 == 1'h0; // @[BoringUtilsSpec.scala 32:19]
              // assert not shown
              endmodule


              Caveats



              Generator Bootcamp



              If you are running this in the Chisel Bootcamp Jupyter Notebook or through an sbt console/REPL, the source locators may not make as much sense as there really isn't a file here with lines.



              Difference with Annotation



              These source locators are not Annotations, in case anyone has come across that name.



              Annotations are metadata associated with circuit components. Source locators (which map to Info in the FIRRTL IR) are associated with specific statements in some source file. Under the hood they're just strings that get generated and then copied around. There is no guarantee that source locators will be preserved---they may be changed or deleted arbitrarily. Conversely, Annotations are preserved and renamed across transformations and have strong guarantees on how they behave.



              Consequently, do not rely on source locators for anything other than an aid if you need to debug the Chisel or FIRRTL compiler stages.






              share|improve this answer




























                3












                3








                3







                These are source locators and will show up in generated FIRRTL or Verilog. These tell you what line in a source file (Chisel or FIRRTL) was used to generate a specific line in the downstream FIRRTL or Verilog.



                The format is generally: @[<file> <line>:<column> ...]



                More than one source locator may be present.



                Example



                Consider the following example pulled from the BoringUtilsSpec. The line numbers (which do not start at zero as this was extracted from a larger file) are shown along with the column numbers. You can see how things line up between them. For example, the declaration of notA happens on line 27 column 20 and the assignment notA := ~a happens on line 30, column 10. You see 27:20 and 30:10 show up in the FIRRTL. In the Verilog, these get merged somewhat and you wind up with source locators indicating both 27:20 and 30:10:



                // -------------------------------------------+----+
                // File: BoringUtilsSpec.scala | |
                // -------------------------------------------+----+
                // Column Number | |
                // -------------------------------------------+----+
                // 1 2 3 4 | |
                // 01234567890123456789012345678901234567890 | |
                // -------------------------------------------+----|
                class BoringInverter extends Module { // | 24 | Line Number
                val io = IO(new Bundle{}) // | 5 |
                val a = Wire(UInt(1.W)) // | 6 |
                val notA = Wire(UInt(1.W)) // | 7 |
                val b = Wire(UInt(1.W)) // | 8 |
                a := 0.U // | 9 |
                notA := ~a // | 30 |
                b := a // | 1 |
                chisel3.assert(b === 1.U) // | 2 |
                BoringUtils.addSource(notA, "x") // | 3 |
                BoringUtils.addSink(b, "x") // | 4 |
                } // | 5 |
                // -------------------------------------------+----+


                This produces the following FIRRTL:



                module BoringUtilsSpecBoringInverter : 
                input clock : Clock
                input reset : UInt<1>
                output io : {}

                wire a : UInt<1> @[BoringUtilsSpec.scala 26:17]
                wire notA : UInt<1> @[BoringUtilsSpec.scala 27:20]
                wire b : UInt<1> @[BoringUtilsSpec.scala 28:17]
                a <= UInt<1>("h00") @[BoringUtilsSpec.scala 29:7]
                node _T = not(a) @[BoringUtilsSpec.scala 30:13]
                notA <= _T @[BoringUtilsSpec.scala 30:10]
                b <= a @[BoringUtilsSpec.scala 31:7]
                node _T_1 = eq(b, UInt<1>("h01")) @[BoringUtilsSpec.scala 32:22]
                node _T_2 = bits(reset, 0, 0) @[BoringUtilsSpec.scala 32:19]
                node _T_3 = or(_T_1, _T_2) @[BoringUtilsSpec.scala 32:19]
                node _T_4 = eq(_T_3, UInt<1>("h00")) @[BoringUtilsSpec.scala 32:19]
                // assert not shown


                And the following Verilog:



                module BoringUtilsSpecBoringInverter(
                input clock,
                input reset
                );
                wire _T; // @[BoringUtilsSpec.scala 30:13]
                wire notA; // @[BoringUtilsSpec.scala 27:20 BoringUtilsSpec.scala 30:10]
                wire _T_3; // @[BoringUtilsSpec.scala 32:19]
                wire _T_4; // @[BoringUtilsSpec.scala 32:19]
                assign _T = 1'h1; // @[BoringUtilsSpec.scala 30:13]
                assign notA = 1'h1; // @[BoringUtilsSpec.scala 27:20 BoringUtilsSpec.scala 30:10]
                assign _T_3 = _T | reset; // @[BoringUtilsSpec.scala 32:19]
                assign _T_4 = _T_3 == 1'h0; // @[BoringUtilsSpec.scala 32:19]
                // assert not shown
                endmodule


                Caveats



                Generator Bootcamp



                If you are running this in the Chisel Bootcamp Jupyter Notebook or through an sbt console/REPL, the source locators may not make as much sense as there really isn't a file here with lines.



                Difference with Annotation



                These source locators are not Annotations, in case anyone has come across that name.



                Annotations are metadata associated with circuit components. Source locators (which map to Info in the FIRRTL IR) are associated with specific statements in some source file. Under the hood they're just strings that get generated and then copied around. There is no guarantee that source locators will be preserved---they may be changed or deleted arbitrarily. Conversely, Annotations are preserved and renamed across transformations and have strong guarantees on how they behave.



                Consequently, do not rely on source locators for anything other than an aid if you need to debug the Chisel or FIRRTL compiler stages.






                share|improve this answer















                These are source locators and will show up in generated FIRRTL or Verilog. These tell you what line in a source file (Chisel or FIRRTL) was used to generate a specific line in the downstream FIRRTL or Verilog.



                The format is generally: @[<file> <line>:<column> ...]



                More than one source locator may be present.



                Example



                Consider the following example pulled from the BoringUtilsSpec. The line numbers (which do not start at zero as this was extracted from a larger file) are shown along with the column numbers. You can see how things line up between them. For example, the declaration of notA happens on line 27 column 20 and the assignment notA := ~a happens on line 30, column 10. You see 27:20 and 30:10 show up in the FIRRTL. In the Verilog, these get merged somewhat and you wind up with source locators indicating both 27:20 and 30:10:



                // -------------------------------------------+----+
                // File: BoringUtilsSpec.scala | |
                // -------------------------------------------+----+
                // Column Number | |
                // -------------------------------------------+----+
                // 1 2 3 4 | |
                // 01234567890123456789012345678901234567890 | |
                // -------------------------------------------+----|
                class BoringInverter extends Module { // | 24 | Line Number
                val io = IO(new Bundle{}) // | 5 |
                val a = Wire(UInt(1.W)) // | 6 |
                val notA = Wire(UInt(1.W)) // | 7 |
                val b = Wire(UInt(1.W)) // | 8 |
                a := 0.U // | 9 |
                notA := ~a // | 30 |
                b := a // | 1 |
                chisel3.assert(b === 1.U) // | 2 |
                BoringUtils.addSource(notA, "x") // | 3 |
                BoringUtils.addSink(b, "x") // | 4 |
                } // | 5 |
                // -------------------------------------------+----+


                This produces the following FIRRTL:



                module BoringUtilsSpecBoringInverter : 
                input clock : Clock
                input reset : UInt<1>
                output io : {}

                wire a : UInt<1> @[BoringUtilsSpec.scala 26:17]
                wire notA : UInt<1> @[BoringUtilsSpec.scala 27:20]
                wire b : UInt<1> @[BoringUtilsSpec.scala 28:17]
                a <= UInt<1>("h00") @[BoringUtilsSpec.scala 29:7]
                node _T = not(a) @[BoringUtilsSpec.scala 30:13]
                notA <= _T @[BoringUtilsSpec.scala 30:10]
                b <= a @[BoringUtilsSpec.scala 31:7]
                node _T_1 = eq(b, UInt<1>("h01")) @[BoringUtilsSpec.scala 32:22]
                node _T_2 = bits(reset, 0, 0) @[BoringUtilsSpec.scala 32:19]
                node _T_3 = or(_T_1, _T_2) @[BoringUtilsSpec.scala 32:19]
                node _T_4 = eq(_T_3, UInt<1>("h00")) @[BoringUtilsSpec.scala 32:19]
                // assert not shown


                And the following Verilog:



                module BoringUtilsSpecBoringInverter(
                input clock,
                input reset
                );
                wire _T; // @[BoringUtilsSpec.scala 30:13]
                wire notA; // @[BoringUtilsSpec.scala 27:20 BoringUtilsSpec.scala 30:10]
                wire _T_3; // @[BoringUtilsSpec.scala 32:19]
                wire _T_4; // @[BoringUtilsSpec.scala 32:19]
                assign _T = 1'h1; // @[BoringUtilsSpec.scala 30:13]
                assign notA = 1'h1; // @[BoringUtilsSpec.scala 27:20 BoringUtilsSpec.scala 30:10]
                assign _T_3 = _T | reset; // @[BoringUtilsSpec.scala 32:19]
                assign _T_4 = _T_3 == 1'h0; // @[BoringUtilsSpec.scala 32:19]
                // assert not shown
                endmodule


                Caveats



                Generator Bootcamp



                If you are running this in the Chisel Bootcamp Jupyter Notebook or through an sbt console/REPL, the source locators may not make as much sense as there really isn't a file here with lines.



                Difference with Annotation



                These source locators are not Annotations, in case anyone has come across that name.



                Annotations are metadata associated with circuit components. Source locators (which map to Info in the FIRRTL IR) are associated with specific statements in some source file. Under the hood they're just strings that get generated and then copied around. There is no guarantee that source locators will be preserved---they may be changed or deleted arbitrarily. Conversely, Annotations are preserved and renamed across transformations and have strong guarantees on how they behave.



                Consequently, do not rely on source locators for anything other than an aid if you need to debug the Chisel or FIRRTL compiler stages.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Nov 21 '18 at 17:49

























                answered Nov 21 '18 at 17:41









                seldridgeseldridge

                65559




                65559
































                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53417212%2fhow-to-decipher-comments-in-generated-verilog-from-chisel%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Guess what letter conforming each word

                    Port of Spain

                    Run scheduled task as local user group (not BUILTIN)