diff options
| author | Dan Nicolaescu | 2008-03-28 15:47:25 +0000 |
|---|---|---|
| committer | Dan Nicolaescu | 2008-03-28 15:47:25 +0000 |
| commit | 1dd4b004656363e5c8e8d8090f120e9b7905c776 (patch) | |
| tree | 8bb895ae9d01c994744b64b9e0456e2348444870 | |
| parent | 0d22595df58136551ee4e6a8f54d71034e3a73ee (diff) | |
| download | emacs-1dd4b004656363e5c8e8d8090f120e9b7905c776.tar.gz emacs-1dd4b004656363e5c8e8d8090f120e9b7905c776.zip | |
* progmodes/verilog-mode.el (verilog-auto-inout-module):
Add optional regular expression to AUTOINOUTMODULE.
(verilog-inject-auto, verilog-auto-arg, verilog-auto-inst)
(verilog-auto-inst-param, verilog-auto-reg)
(verilog-auto-reg-input, verilog-auto-wire, verilog-auto-output)
(verilog-auto-output-every, verilog-auto-input)
(verilog-auto-inout, verilog-auto-sense, verilog-auto-tieoff)
(verilog-auto-unused, verilog-auto): Update documentation to use
more obvious instance module names versus cell names.
| -rw-r--r-- | lisp/ChangeLog | 12 | ||||
| -rw-r--r-- | lisp/progmodes/verilog-mode.el | 273 |
2 files changed, 168 insertions, 117 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1139f40eb51..15c07a27b7d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,15 @@ | |||
| 1 | 2008-03-28 Wilson Snyder <wsnyder@wsnyder.org> | ||
| 2 | |||
| 3 | * progmodes/verilog-mode.el (verilog-auto-inout-module): | ||
| 4 | Add optional regular expression to AUTOINOUTMODULE. | ||
| 5 | (verilog-inject-auto, verilog-auto-arg, verilog-auto-inst) | ||
| 6 | (verilog-auto-inst-param, verilog-auto-reg) | ||
| 7 | (verilog-auto-reg-input, verilog-auto-wire, verilog-auto-output) | ||
| 8 | (verilog-auto-output-every, verilog-auto-input) | ||
| 9 | (verilog-auto-inout, verilog-auto-sense, verilog-auto-tieoff) | ||
| 10 | (verilog-auto-unused, verilog-auto): Update documentation to use | ||
| 11 | more obvious instance module names versus cell names. | ||
| 12 | |||
| 1 | 2008-03-28 Jan Djärv <jan.h.d@swipnet.se> | 13 | 2008-03-28 Jan Djärv <jan.h.d@swipnet.se> |
| 2 | 14 | ||
| 3 | * progmodes/compile.el (compilation-mode-tool-bar-map): Only enable | 15 | * progmodes/compile.el (compilation-mode-tool-bar-map): Only enable |
diff --git a/lisp/progmodes/verilog-mode.el b/lisp/progmodes/verilog-mode.el index d156637f261..1cf5ee53e49 100644 --- a/lisp/progmodes/verilog-mode.el +++ b/lisp/progmodes/verilog-mode.el | |||
| @@ -6354,7 +6354,7 @@ component library to determine connectivity of the design. | |||
| 6354 | One work around for this problem is to manually create // Inputs and // | 6354 | One work around for this problem is to manually create // Inputs and // |
| 6355 | Outputs comments above subcell signals, for example: | 6355 | Outputs comments above subcell signals, for example: |
| 6356 | 6356 | ||
| 6357 | module1 instance1x ( | 6357 | module ModuleName ( |
| 6358 | // Outputs | 6358 | // Outputs |
| 6359 | .out (out), | 6359 | .out (out), |
| 6360 | // Inputs | 6360 | // Inputs |
| @@ -7705,29 +7705,31 @@ support adding new ports. You may wish to delete older ports yourself. | |||
| 7705 | 7705 | ||
| 7706 | For example: | 7706 | For example: |
| 7707 | 7707 | ||
| 7708 | module ex_inject (i, o); | 7708 | module ExampInject (i, o); |
| 7709 | input i; | 7709 | input i; |
| 7710 | input j; | 7710 | input j; |
| 7711 | output o; | 7711 | output o; |
| 7712 | always @ (i or j) | 7712 | always @ (i or j) |
| 7713 | o = i | j; | 7713 | o = i | j; |
| 7714 | cell cell (.foobar(baz), | 7714 | InstModule instName |
| 7715 | .j(j)); | 7715 | (.foobar(baz), |
| 7716 | j(j)); | ||
| 7716 | endmodule | 7717 | endmodule |
| 7717 | 7718 | ||
| 7718 | Typing \\[verilog-inject-auto] will make this into: | 7719 | Typing \\[verilog-inject-auto] will make this into: |
| 7719 | 7720 | ||
| 7720 | module ex_inject (i, o/*AUTOARG*/ | 7721 | module ExampInject (i, o/*AUTOARG*/ |
| 7721 | // Inputs | 7722 | // Inputs |
| 7722 | j); | 7723 | j); |
| 7723 | input i; | 7724 | input i; |
| 7724 | output o; | 7725 | output o; |
| 7725 | always @ (/*AS*/i or j) | 7726 | always @ (/*AS*/i or j) |
| 7726 | o = i | j; | 7727 | o = i | j; |
| 7727 | cell cell (.foobar(baz), | 7728 | InstModule instName |
| 7728 | /*AUTOINST*/ | 7729 | (.foobar(baz), |
| 7729 | // Outputs | 7730 | /*AUTOINST*/ |
| 7730 | .j(j)); | 7731 | // Outputs |
| 7732 | j(j)); | ||
| 7731 | endmodule" | 7733 | endmodule" |
| 7732 | (interactive) | 7734 | (interactive) |
| 7733 | (verilog-auto t)) | 7735 | (verilog-auto t)) |
| @@ -7893,14 +7895,14 @@ Limitations: | |||
| 7893 | 7895 | ||
| 7894 | For example: | 7896 | For example: |
| 7895 | 7897 | ||
| 7896 | module ex_arg (/*AUTOARG*/); | 7898 | module ExampArg (/*AUTOARG*/); |
| 7897 | input i; | 7899 | input i; |
| 7898 | output o; | 7900 | output o; |
| 7899 | endmodule | 7901 | endmodule |
| 7900 | 7902 | ||
| 7901 | Typing \\[verilog-auto] will make this into: | 7903 | Typing \\[verilog-auto] will make this into: |
| 7902 | 7904 | ||
| 7903 | module ex_arg (/*AUTOARG*/ | 7905 | module ExampArg (/*AUTOARG*/ |
| 7904 | // Outputs | 7906 | // Outputs |
| 7905 | o, | 7907 | o, |
| 7906 | // Inputs | 7908 | // Inputs |
| @@ -8082,9 +8084,9 @@ Limitations: | |||
| 8082 | 8084 | ||
| 8083 | SystemVerilog multidimensional input/output has only experimental support. | 8085 | SystemVerilog multidimensional input/output has only experimental support. |
| 8084 | 8086 | ||
| 8085 | For example, first take the submodule inst.v: | 8087 | For example, first take the submodule InstModule.v: |
| 8086 | 8088 | ||
| 8087 | module inst (o,i) | 8089 | module InstModule (o,i) |
| 8088 | output [31:0] o; | 8090 | output [31:0] o; |
| 8089 | input i; | 8091 | input i; |
| 8090 | wire [31:0] o = {32{i}}; | 8092 | wire [31:0] o = {32{i}}; |
| @@ -8092,22 +8094,24 @@ For example, first take the submodule inst.v: | |||
| 8092 | 8094 | ||
| 8093 | This is then used in a upper level module: | 8095 | This is then used in a upper level module: |
| 8094 | 8096 | ||
| 8095 | module ex_inst (o,i) | 8097 | module ExampInst (o,i) |
| 8096 | output o; | 8098 | output o; |
| 8097 | input i; | 8099 | input i; |
| 8098 | inst inst (/*AUTOINST*/); | 8100 | InstModule instName |
| 8101 | (/*AUTOINST*/); | ||
| 8099 | endmodule | 8102 | endmodule |
| 8100 | 8103 | ||
| 8101 | Typing \\[verilog-auto] will make this into: | 8104 | Typing \\[verilog-auto] will make this into: |
| 8102 | 8105 | ||
| 8103 | module ex_inst (o,i) | 8106 | module ExampInst (o,i) |
| 8104 | output o; | 8107 | output o; |
| 8105 | input i; | 8108 | input i; |
| 8106 | inst inst (/*AUTOINST*/ | 8109 | InstModule instName |
| 8107 | // Outputs | 8110 | (/*AUTOINST*/ |
| 8108 | .ov (ov[31:0]), | 8111 | // Outputs |
| 8109 | // Inputs | 8112 | .ov (ov[31:0]), |
| 8110 | .i (i)); | 8113 | // Inputs |
| 8114 | .i (i)); | ||
| 8111 | endmodule | 8115 | endmodule |
| 8112 | 8116 | ||
| 8113 | Where the list of inputs and outputs came from the inst module. | 8117 | Where the list of inputs and outputs came from the inst module. |
| @@ -8129,11 +8133,12 @@ Exceptions: | |||
| 8129 | you have the appropriate // Input or // Output comment, and exactly the | 8133 | you have the appropriate // Input or // Output comment, and exactly the |
| 8130 | same line formatting as AUTOINST itself uses. | 8134 | same line formatting as AUTOINST itself uses. |
| 8131 | 8135 | ||
| 8132 | inst inst (// Inputs | 8136 | InstModule instName |
| 8133 | .i (my_i_dont_mess_with_it), | 8137 | (// Inputs |
| 8134 | /*AUTOINST*/ | 8138 | .i (my_i_dont_mess_with_it), |
| 8135 | // Outputs | 8139 | /*AUTOINST*/ |
| 8136 | .ov (ov[31:0])); | 8140 | // Outputs |
| 8141 | .ov (ov[31:0])); | ||
| 8137 | 8142 | ||
| 8138 | 8143 | ||
| 8139 | Templates: | 8144 | Templates: |
| @@ -8141,7 +8146,7 @@ Templates: | |||
| 8141 | For multiple instantiations based upon a single template, create a | 8146 | For multiple instantiations based upon a single template, create a |
| 8142 | commented out template: | 8147 | commented out template: |
| 8143 | 8148 | ||
| 8144 | /* instantiating_module_name AUTO_TEMPLATE ( | 8149 | /* InstModule AUTO_TEMPLATE ( |
| 8145 | .sig3 (sigz[]), | 8150 | .sig3 (sigz[]), |
| 8146 | ); | 8151 | ); |
| 8147 | */ | 8152 | */ |
| @@ -8170,15 +8175,15 @@ Templates: | |||
| 8170 | 8175 | ||
| 8171 | For example: | 8176 | For example: |
| 8172 | 8177 | ||
| 8173 | /* psm_mas AUTO_TEMPLATE ( | 8178 | /* InstModule AUTO_TEMPLATE ( |
| 8174 | .ptl_bus (ptl_busnew[]), | 8179 | .ptl_bus (ptl_busnew[]), |
| 8175 | ); | 8180 | ); |
| 8176 | */ | 8181 | */ |
| 8177 | psm_mas ms2m (/*AUTOINST*/); | 8182 | InstModule ms2m (/*AUTOINST*/); |
| 8178 | 8183 | ||
| 8179 | Typing \\[verilog-auto] will make this into: | 8184 | Typing \\[verilog-auto] will make this into: |
| 8180 | 8185 | ||
| 8181 | psm_mas ms2m (/*AUTOINST*/ | 8186 | InstModule ms2m (/*AUTOINST*/ |
| 8182 | // Outputs | 8187 | // Outputs |
| 8183 | .NotInTemplate (NotInTemplate), | 8188 | .NotInTemplate (NotInTemplate), |
| 8184 | .ptl_bus (ptl_busnew[3:0]), // Templated | 8189 | .ptl_bus (ptl_busnew[3:0]), // Templated |
| @@ -8189,7 +8194,7 @@ Templates: | |||
| 8189 | It is common to instantiate a cell multiple times, so templates make it | 8194 | It is common to instantiate a cell multiple times, so templates make it |
| 8190 | trivial to substitute part of the cell name into the connection name. | 8195 | trivial to substitute part of the cell name into the connection name. |
| 8191 | 8196 | ||
| 8192 | /* cell_type AUTO_TEMPLATE <optional \"REGEXP\"> ( | 8197 | /* InstName AUTO_TEMPLATE <optional \"REGEXP\"> ( |
| 8193 | .sig1 (sigx[@]), | 8198 | .sig1 (sigx[@]), |
| 8194 | .sig2 (sigy[@\"(% (+ 1 @) 4)\"]), | 8199 | .sig2 (sigy[@\"(% (+ 1 @) 4)\"]), |
| 8195 | ); | 8200 | ); |
| @@ -8211,16 +8216,16 @@ Templates: | |||
| 8211 | 8216 | ||
| 8212 | For example: | 8217 | For example: |
| 8213 | 8218 | ||
| 8214 | /* psm_mas AUTO_TEMPLATE ( | 8219 | /* InstModule AUTO_TEMPLATE ( |
| 8215 | .ptl_mapvalidx (ptl_mapvalid[@]), | 8220 | .ptl_mapvalidx (ptl_mapvalid[@]), |
| 8216 | .ptl_mapvalidp1x (ptl_mapvalid[@\"(% (+ 1 @) 4)\"]), | 8221 | .ptl_mapvalidp1x (ptl_mapvalid[@\"(% (+ 1 @) 4)\"]), |
| 8217 | ); | 8222 | ); |
| 8218 | */ | 8223 | */ |
| 8219 | psm_mas ms2m (/*AUTOINST*/); | 8224 | InstModule ms2m (/*AUTOINST*/); |
| 8220 | 8225 | ||
| 8221 | Typing \\[verilog-auto] will make this into: | 8226 | Typing \\[verilog-auto] will make this into: |
| 8222 | 8227 | ||
| 8223 | psm_mas ms2m (/*AUTOINST*/ | 8228 | InstModule ms2m (/*AUTOINST*/ |
| 8224 | // Outputs | 8229 | // Outputs |
| 8225 | .ptl_mapvalidx (ptl_mapvalid[2]), | 8230 | .ptl_mapvalidx (ptl_mapvalid[2]), |
| 8226 | .ptl_mapvalidp1x (ptl_mapvalid[3])); | 8231 | .ptl_mapvalidp1x (ptl_mapvalid[3])); |
| @@ -8229,21 +8234,21 @@ Templates: | |||
| 8229 | 8234 | ||
| 8230 | Alternatively, using a regular expression for @: | 8235 | Alternatively, using a regular expression for @: |
| 8231 | 8236 | ||
| 8232 | /* psm_mas AUTO_TEMPLATE \"_\\([a-z]+\\)\" ( | 8237 | /* InstModule AUTO_TEMPLATE \"_\\([a-z]+\\)\" ( |
| 8233 | .ptl_mapvalidx (@_ptl_mapvalid), | 8238 | .ptl_mapvalidx (@_ptl_mapvalid), |
| 8234 | .ptl_mapvalidp1x (ptl_mapvalid_@), | 8239 | .ptl_mapvalidp1x (ptl_mapvalid_@), |
| 8235 | ); | 8240 | ); |
| 8236 | */ | 8241 | */ |
| 8237 | psm_mas ms2_FOO (/*AUTOINST*/); | 8242 | InstModule ms2_FOO (/*AUTOINST*/); |
| 8238 | psm_mas ms2_BAR (/*AUTOINST*/); | 8243 | InstModule ms2_BAR (/*AUTOINST*/); |
| 8239 | 8244 | ||
| 8240 | Typing \\[verilog-auto] will make this into: | 8245 | Typing \\[verilog-auto] will make this into: |
| 8241 | 8246 | ||
| 8242 | psm_mas ms2_FOO (/*AUTOINST*/ | 8247 | InstModule ms2_FOO (/*AUTOINST*/ |
| 8243 | // Outputs | 8248 | // Outputs |
| 8244 | .ptl_mapvalidx (FOO_ptl_mapvalid), | 8249 | .ptl_mapvalidx (FOO_ptl_mapvalid), |
| 8245 | .ptl_mapvalidp1x (ptl_mapvalid_FOO)); | 8250 | .ptl_mapvalidp1x (ptl_mapvalid_FOO)); |
| 8246 | psm_mas ms2_BAR (/*AUTOINST*/ | 8251 | InstModule ms2_BAR (/*AUTOINST*/ |
| 8247 | // Outputs | 8252 | // Outputs |
| 8248 | .ptl_mapvalidx (BAR_ptl_mapvalid), | 8253 | .ptl_mapvalidx (BAR_ptl_mapvalid), |
| 8249 | .ptl_mapvalidp1x (ptl_mapvalid_BAR)); | 8254 | .ptl_mapvalidp1x (ptl_mapvalid_BAR)); |
| @@ -8289,8 +8294,8 @@ Lisp Templates: | |||
| 8289 | vl-width Width of the input/output port ('3' for [2:0]). | 8294 | vl-width Width of the input/output port ('3' for [2:0]). |
| 8290 | May be a (...) expression if bits isn't a constant. | 8295 | May be a (...) expression if bits isn't a constant. |
| 8291 | vl-dir Direction of the pin input/output/inout. | 8296 | vl-dir Direction of the pin input/output/inout. |
| 8292 | vl-cell-type Module name/type of the cell ('psm_mas'). | 8297 | vl-cell-type Module name/type of the cell ('InstModule'). |
| 8293 | vl-cell-name Instance name of the cell ('ms2m'). | 8298 | vl-cell-name Instance name of the cell ('instName'). |
| 8294 | 8299 | ||
| 8295 | Normal Lisp variables may be used in expressions. See | 8300 | Normal Lisp variables may be used in expressions. See |
| 8296 | `verilog-read-defines' which can set vh-{definename} variables for use | 8301 | `verilog-read-defines' which can set vh-{definename} variables for use |
| @@ -8400,29 +8405,29 @@ automatically derived from the module header of the instantiated netlist. | |||
| 8400 | See \\[verilog-auto-inst] for limitations, and templates to customize the | 8405 | See \\[verilog-auto-inst] for limitations, and templates to customize the |
| 8401 | output. | 8406 | output. |
| 8402 | 8407 | ||
| 8403 | For example, first take the submodule inst.v: | 8408 | For example, first take the submodule InstModule.v: |
| 8404 | 8409 | ||
| 8405 | module inst (o,i) | 8410 | module InstModule (o,i) |
| 8406 | parameter PAR; | 8411 | parameter PAR; |
| 8407 | endmodule | 8412 | endmodule |
| 8408 | 8413 | ||
| 8409 | This is then used in a upper level module: | 8414 | This is then used in a upper level module: |
| 8410 | 8415 | ||
| 8411 | module ex_inst (o,i) | 8416 | module ExampInst (o,i) |
| 8412 | parameter PAR; | 8417 | parameter PAR; |
| 8413 | inst #(/*AUTOINSTPARAM*/) | 8418 | InstModule #(/*AUTOINSTPARAM*/) |
| 8414 | inst (/*AUTOINST*/); | 8419 | instName (/*AUTOINST*/); |
| 8415 | endmodule | 8420 | endmodule |
| 8416 | 8421 | ||
| 8417 | Typing \\[verilog-auto] will make this into: | 8422 | Typing \\[verilog-auto] will make this into: |
| 8418 | 8423 | ||
| 8419 | module ex_inst (o,i) | 8424 | module ExampInst (o,i) |
| 8420 | output o; | 8425 | output o; |
| 8421 | input i; | 8426 | input i; |
| 8422 | inst (/*AUTOINSTPARAM*/ | 8427 | InstModule #(/*AUTOINSTPARAM*/ |
| 8423 | // Parameters | 8428 | // Parameters |
| 8424 | .PAR (PAR)); | 8429 | .PAR (PAR)); |
| 8425 | inst (/*AUTOINST*/); | 8430 | instName (/*AUTOINST*/); |
| 8426 | endmodule | 8431 | endmodule |
| 8427 | 8432 | ||
| 8428 | Where the list of parameter connections come from the inst module. | 8433 | Where the list of parameter connections come from the inst module. |
| @@ -8506,7 +8511,7 @@ Limitations: | |||
| 8506 | 8511 | ||
| 8507 | An example: | 8512 | An example: |
| 8508 | 8513 | ||
| 8509 | module ex_reg (o,i) | 8514 | module ExampReg (o,i) |
| 8510 | output o; | 8515 | output o; |
| 8511 | input i; | 8516 | input i; |
| 8512 | /*AUTOREG*/ | 8517 | /*AUTOREG*/ |
| @@ -8515,12 +8520,12 @@ An example: | |||
| 8515 | 8520 | ||
| 8516 | Typing \\[verilog-auto] will make this into: | 8521 | Typing \\[verilog-auto] will make this into: |
| 8517 | 8522 | ||
| 8518 | module ex_reg (o,i) | 8523 | module ExampReg (o,i) |
| 8519 | output o; | 8524 | output o; |
| 8520 | input i; | 8525 | input i; |
| 8521 | /*AUTOREG*/ | 8526 | /*AUTOREG*/ |
| 8522 | // Beginning of automatic regs (for this module's undeclared outputs) | 8527 | // Beginning of automatic regs (for this module's undeclared outputs) |
| 8523 | reg o; | 8528 | reg o; |
| 8524 | // End of automatics | 8529 | // End of automatics |
| 8525 | always o = i; | 8530 | always o = i; |
| 8526 | endmodule" | 8531 | endmodule" |
| @@ -8557,27 +8562,29 @@ Limitations: | |||
| 8557 | 8562 | ||
| 8558 | An example (see `verilog-auto-inst' for what else is going on here): | 8563 | An example (see `verilog-auto-inst' for what else is going on here): |
| 8559 | 8564 | ||
| 8560 | module ex_reg_input (o,i) | 8565 | module ExampRegInput (o,i) |
| 8561 | output o; | 8566 | output o; |
| 8562 | input i; | 8567 | input i; |
| 8563 | /*AUTOREGINPUT*/ | 8568 | /*AUTOREGINPUT*/ |
| 8564 | inst inst (/*AUTOINST*/); | 8569 | InstModule instName |
| 8570 | (/*AUTOINST*/); | ||
| 8565 | endmodule | 8571 | endmodule |
| 8566 | 8572 | ||
| 8567 | Typing \\[verilog-auto] will make this into: | 8573 | Typing \\[verilog-auto] will make this into: |
| 8568 | 8574 | ||
| 8569 | module ex_reg_input (o,i) | 8575 | module ExampRegInput (o,i) |
| 8570 | output o; | 8576 | output o; |
| 8571 | input i; | 8577 | input i; |
| 8572 | /*AUTOREGINPUT*/ | 8578 | /*AUTOREGINPUT*/ |
| 8573 | // Beginning of automatic reg inputs (for undeclared ... | 8579 | // Beginning of automatic reg inputs (for undeclared ... |
| 8574 | reg [31:0] iv; // From inst of inst.v | 8580 | reg [31:0] iv; // From inst of inst.v |
| 8575 | // End of automatics | 8581 | // End of automatics |
| 8576 | inst inst (/*AUTOINST*/ | 8582 | InstModule instName |
| 8577 | // Outputs | 8583 | (/*AUTOINST*/ |
| 8578 | .o (o[31:0]), | 8584 | // Outputs |
| 8579 | // Inputs | 8585 | .o (o[31:0]), |
| 8580 | .iv (iv)); | 8586 | // Inputs |
| 8587 | .iv (iv)); | ||
| 8581 | endmodule" | 8588 | endmodule" |
| 8582 | (save-excursion | 8589 | (save-excursion |
| 8583 | ;; Point must be at insertion point. | 8590 | ;; Point must be at insertion point. |
| @@ -8615,27 +8622,29 @@ Limitations: | |||
| 8615 | 8622 | ||
| 8616 | An example (see `verilog-auto-inst' for what else is going on here): | 8623 | An example (see `verilog-auto-inst' for what else is going on here): |
| 8617 | 8624 | ||
| 8618 | module ex_wire (o,i) | 8625 | module ExampWire (o,i) |
| 8619 | output o; | 8626 | output o; |
| 8620 | input i; | 8627 | input i; |
| 8621 | /*AUTOWIRE*/ | 8628 | /*AUTOWIRE*/ |
| 8622 | inst inst (/*AUTOINST*/); | 8629 | InstModule instName |
| 8630 | (/*AUTOINST*/); | ||
| 8623 | endmodule | 8631 | endmodule |
| 8624 | 8632 | ||
| 8625 | Typing \\[verilog-auto] will make this into: | 8633 | Typing \\[verilog-auto] will make this into: |
| 8626 | 8634 | ||
| 8627 | module ex_wire (o,i) | 8635 | module ExampWire (o,i) |
| 8628 | output o; | 8636 | output o; |
| 8629 | input i; | 8637 | input i; |
| 8630 | /*AUTOWIRE*/ | 8638 | /*AUTOWIRE*/ |
| 8631 | // Beginning of automatic wires | 8639 | // Beginning of automatic wires |
| 8632 | wire [31:0] ov; // From inst of inst.v | 8640 | wire [31:0] ov; // From inst of inst.v |
| 8633 | // End of automatics | 8641 | // End of automatics |
| 8634 | inst inst (/*AUTOINST*/ | 8642 | InstModule instName |
| 8635 | // Outputs | 8643 | (/*AUTOINST*/ |
| 8636 | .ov (ov[31:0]), | 8644 | // Outputs |
| 8637 | // Inputs | 8645 | .ov (ov[31:0]), |
| 8638 | .i (i)); | 8646 | // Inputs |
| 8647 | .i (i)); | ||
| 8639 | wire o = | ov; | 8648 | wire o = | ov; |
| 8640 | endmodule" | 8649 | endmodule" |
| 8641 | (save-excursion | 8650 | (save-excursion |
| @@ -8681,25 +8690,27 @@ Limitations: | |||
| 8681 | 8690 | ||
| 8682 | An example (see `verilog-auto-inst' for what else is going on here): | 8691 | An example (see `verilog-auto-inst' for what else is going on here): |
| 8683 | 8692 | ||
| 8684 | module ex_output (ov,i) | 8693 | module ExampOutput (ov,i) |
| 8685 | input i; | 8694 | input i; |
| 8686 | /*AUTOOUTPUT*/ | 8695 | /*AUTOOUTPUT*/ |
| 8687 | inst inst (/*AUTOINST*/); | 8696 | InstModule instName |
| 8697 | (/*AUTOINST*/); | ||
| 8688 | endmodule | 8698 | endmodule |
| 8689 | 8699 | ||
| 8690 | Typing \\[verilog-auto] will make this into: | 8700 | Typing \\[verilog-auto] will make this into: |
| 8691 | 8701 | ||
| 8692 | module ex_output (ov,i) | 8702 | module ExampOutput (ov,i) |
| 8693 | input i; | 8703 | input i; |
| 8694 | /*AUTOOUTPUT*/ | 8704 | /*AUTOOUTPUT*/ |
| 8695 | // Beginning of automatic outputs (from unused autoinst outputs) | 8705 | // Beginning of automatic outputs (from unused autoinst outputs) |
| 8696 | output [31:0] ov; // From inst of inst.v | 8706 | output [31:0] ov; // From inst of inst.v |
| 8697 | // End of automatics | 8707 | // End of automatics |
| 8698 | inst inst (/*AUTOINST*/ | 8708 | InstModule instName |
| 8699 | // Outputs | 8709 | (/*AUTOINST*/ |
| 8700 | .ov (ov[31:0]), | 8710 | // Outputs |
| 8701 | // Inputs | 8711 | .ov (ov[31:0]), |
| 8702 | .i (i)); | 8712 | // Inputs |
| 8713 | .i (i)); | ||
| 8703 | endmodule | 8714 | endmodule |
| 8704 | 8715 | ||
| 8705 | You may also provide an optional regular expression, in which case only | 8716 | You may also provide an optional regular expression, in which case only |
| @@ -8743,7 +8754,7 @@ won't optimize away the outputs. | |||
| 8743 | 8754 | ||
| 8744 | An example: | 8755 | An example: |
| 8745 | 8756 | ||
| 8746 | module ex_output_every (o,i,tempa,tempb) | 8757 | module ExampOutputEvery (o,i,tempa,tempb) |
| 8747 | output o; | 8758 | output o; |
| 8748 | input i; | 8759 | input i; |
| 8749 | /*AUTOOUTPUTEVERY*/ | 8760 | /*AUTOOUTPUTEVERY*/ |
| @@ -8754,13 +8765,13 @@ An example: | |||
| 8754 | 8765 | ||
| 8755 | Typing \\[verilog-auto] will make this into: | 8766 | Typing \\[verilog-auto] will make this into: |
| 8756 | 8767 | ||
| 8757 | module ex_output_every (o,i,tempa,tempb) | 8768 | module ExampOutputEvery (o,i,tempa,tempb) |
| 8758 | output o; | 8769 | output o; |
| 8759 | input i; | 8770 | input i; |
| 8760 | /*AUTOOUTPUTEVERY*/ | 8771 | /*AUTOOUTPUTEVERY*/ |
| 8761 | // Beginning of automatic outputs (every signal) | 8772 | // Beginning of automatic outputs (every signal) |
| 8762 | output tempb; | 8773 | output tempb; |
| 8763 | output tempa; | 8774 | output tempa; |
| 8764 | // End of automatics | 8775 | // End of automatics |
| 8765 | wire tempa = i; | 8776 | wire tempa = i; |
| 8766 | wire tempb = tempa; | 8777 | wire tempb = tempa; |
| @@ -8805,25 +8816,27 @@ Limitations: | |||
| 8805 | 8816 | ||
| 8806 | An example (see `verilog-auto-inst' for what else is going on here): | 8817 | An example (see `verilog-auto-inst' for what else is going on here): |
| 8807 | 8818 | ||
| 8808 | module ex_input (ov,i) | 8819 | module ExampInput (ov,i) |
| 8809 | output [31:0] ov; | 8820 | output [31:0] ov; |
| 8810 | /*AUTOINPUT*/ | 8821 | /*AUTOINPUT*/ |
| 8811 | inst inst (/*AUTOINST*/); | 8822 | InstModule instName |
| 8823 | (/*AUTOINST*/); | ||
| 8812 | endmodule | 8824 | endmodule |
| 8813 | 8825 | ||
| 8814 | Typing \\[verilog-auto] will make this into: | 8826 | Typing \\[verilog-auto] will make this into: |
| 8815 | 8827 | ||
| 8816 | module ex_input (ov,i) | 8828 | module ExampInput (ov,i) |
| 8817 | output [31:0] ov; | 8829 | output [31:0] ov; |
| 8818 | /*AUTOINPUT*/ | 8830 | /*AUTOINPUT*/ |
| 8819 | // Beginning of automatic inputs (from unused autoinst inputs) | 8831 | // Beginning of automatic inputs (from unused autoinst inputs) |
| 8820 | input i; // From inst of inst.v | 8832 | input i; // From inst of inst.v |
| 8821 | // End of automatics | 8833 | // End of automatics |
| 8822 | inst inst (/*AUTOINST*/ | 8834 | InstModule instName |
| 8823 | // Outputs | 8835 | (/*AUTOINST*/ |
| 8824 | .ov (ov[31:0]), | 8836 | // Outputs |
| 8825 | // Inputs | 8837 | .ov (ov[31:0]), |
| 8826 | .i (i)); | 8838 | // Inputs |
| 8839 | .i (i)); | ||
| 8827 | endmodule | 8840 | endmodule |
| 8828 | 8841 | ||
| 8829 | You may also provide an optional regular expression, in which case only | 8842 | You may also provide an optional regular expression, in which case only |
| @@ -8881,25 +8894,27 @@ Limitations: | |||
| 8881 | 8894 | ||
| 8882 | An example (see `verilog-auto-inst' for what else is going on here): | 8895 | An example (see `verilog-auto-inst' for what else is going on here): |
| 8883 | 8896 | ||
| 8884 | module ex_inout (ov,i) | 8897 | module ExampInout (ov,i) |
| 8885 | input i; | 8898 | input i; |
| 8886 | /*AUTOINOUT*/ | 8899 | /*AUTOINOUT*/ |
| 8887 | inst inst (/*AUTOINST*/); | 8900 | InstModule instName |
| 8901 | (/*AUTOINST*/); | ||
| 8888 | endmodule | 8902 | endmodule |
| 8889 | 8903 | ||
| 8890 | Typing \\[verilog-auto] will make this into: | 8904 | Typing \\[verilog-auto] will make this into: |
| 8891 | 8905 | ||
| 8892 | module ex_inout (ov,i) | 8906 | module ExampInout (ov,i) |
| 8893 | input i; | 8907 | input i; |
| 8894 | /*AUTOINOUT*/ | 8908 | /*AUTOINOUT*/ |
| 8895 | // Beginning of automatic inouts (from unused autoinst inouts) | 8909 | // Beginning of automatic inouts (from unused autoinst inouts) |
| 8896 | inout [31:0] ov; // From inst of inst.v | 8910 | inout [31:0] ov; // From inst of inst.v |
| 8897 | // End of automatics | 8911 | // End of automatics |
| 8898 | inst inst (/*AUTOINST*/ | 8912 | InstModule instName |
| 8899 | // Inouts | 8913 | (/*AUTOINST*/ |
| 8900 | .ov (ov[31:0]), | 8914 | // Inouts |
| 8901 | // Inputs | 8915 | .ov (ov[31:0]), |
| 8902 | .i (i)); | 8916 | // Inputs |
| 8917 | .i (i)); | ||
| 8903 | endmodule | 8918 | endmodule |
| 8904 | 8919 | ||
| 8905 | You may also provide an optional regular expression, in which case only | 8920 | You may also provide an optional regular expression, in which case only |
| @@ -8956,11 +8971,11 @@ Limitations: | |||
| 8956 | 8971 | ||
| 8957 | An example: | 8972 | An example: |
| 8958 | 8973 | ||
| 8959 | module ex_shell (/*AUTOARG*/) | 8974 | module ExampShell (/*AUTOARG*/) |
| 8960 | /*AUTOINOUTMODULE(\"ex_main\")*/ | 8975 | /*AUTOINOUTMODULE(\"ExampMain\")*/ |
| 8961 | endmodule | 8976 | endmodule |
| 8962 | 8977 | ||
| 8963 | module ex_main (i,o,io) | 8978 | module ExampMain (i,o,io) |
| 8964 | input i; | 8979 | input i; |
| 8965 | output o; | 8980 | output o; |
| 8966 | inout io; | 8981 | inout io; |
| @@ -8968,16 +8983,25 @@ An example: | |||
| 8968 | 8983 | ||
| 8969 | Typing \\[verilog-auto] will make this into: | 8984 | Typing \\[verilog-auto] will make this into: |
| 8970 | 8985 | ||
| 8971 | module ex_shell (/*AUTOARG*/i,o,io) | 8986 | module ExampShell (/*AUTOARG*/i,o,io) |
| 8972 | /*AUTOINOUTMODULE(\"ex_main\")*/ | 8987 | /*AUTOINOUTMODULE(\"ExampMain\")*/ |
| 8973 | // Beginning of automatic in/out/inouts (from specific module) | 8988 | // Beginning of automatic in/out/inouts (from specific module) |
| 8974 | input i; | 8989 | input i; |
| 8975 | output o; | 8990 | output o; |
| 8976 | inout io; | 8991 | inout io; |
| 8977 | // End of automatics | 8992 | // End of automatics |
| 8978 | endmodule" | 8993 | endmodule |
| 8994 | |||
| 8995 | You may also provide an optional regular expression, in which case only | ||
| 8996 | signals matching the regular expression will be included. For example the | ||
| 8997 | same expansion will result from only extracting signals starting with i: | ||
| 8998 | |||
| 8999 | /*AUTOINOUTMODULE(\"ExampMain\",\"^i\")*/" | ||
| 8979 | (save-excursion | 9000 | (save-excursion |
| 8980 | (let* ((submod (car (verilog-read-auto-params 1))) submodi) | 9001 | (let* ((params (verilog-read-auto-params 1 2)) |
| 9002 | (submod (nth 0 params)) | ||
| 9003 | (regexp (nth 1 params)) | ||
| 9004 | submodi) | ||
| 8981 | ;; Lookup position, etc of co-module | 9005 | ;; Lookup position, etc of co-module |
| 8982 | ;; Note this may raise an error | 9006 | ;; Note this may raise an error |
| 8983 | (when (setq submodi (verilog-modi-lookup submod t)) | 9007 | (when (setq submodi (verilog-modi-lookup submod t)) |
| @@ -8994,6 +9018,13 @@ Typing \\[verilog-auto] will make this into: | |||
| 8994 | (verilog-modi-get-inouts submodi) | 9018 | (verilog-modi-get-inouts submodi) |
| 8995 | (append (verilog-modi-get-inouts modi))))) | 9019 | (append (verilog-modi-get-inouts modi))))) |
| 8996 | (forward-line 1) | 9020 | (forward-line 1) |
| 9021 | (when regexp | ||
| 9022 | (setq sig-list-i (verilog-signals-matching-regexp | ||
| 9023 | sig-list-i regexp) | ||
| 9024 | sig-list-o (verilog-signals-matching-regexp | ||
| 9025 | sig-list-o regexp) | ||
| 9026 | sig-list-io (verilog-signals-matching-regexp | ||
| 9027 | sig-list-io regexp))) | ||
| 8997 | (when v2k (verilog-repair-open-comma)) | 9028 | (when v2k (verilog-repair-open-comma)) |
| 8998 | (when (or sig-list-i sig-list-o sig-list-io) | 9029 | (when (or sig-list-i sig-list-o sig-list-io) |
| 8999 | (verilog-insert-indent "// Beginning of automatic in/out/inouts (from specific module)\n") | 9030 | (verilog-insert-indent "// Beginning of automatic in/out/inouts (from specific module)\n") |
| @@ -9052,7 +9083,7 @@ OOps! | |||
| 9052 | 9083 | ||
| 9053 | An example: | 9084 | An example: |
| 9054 | 9085 | ||
| 9055 | always @ (/*AUTOSENSE*/) begin | 9086 | always @ (/*AS*/) begin |
| 9056 | /* AUTO_CONSTANT (`constant) */ | 9087 | /* AUTO_CONSTANT (`constant) */ |
| 9057 | outin = ina | inb | `constant; | 9088 | outin = ina | inb | `constant; |
| 9058 | out = outin; | 9089 | out = outin; |
| @@ -9060,10 +9091,18 @@ An example: | |||
| 9060 | 9091 | ||
| 9061 | Typing \\[verilog-auto] will make this into: | 9092 | Typing \\[verilog-auto] will make this into: |
| 9062 | 9093 | ||
| 9063 | always @ (/*AUTOSENSE*/ina or inb) begin | 9094 | always @ (/*AS*/ina or inb) begin |
| 9064 | /* AUTO_CONSTANT (`constant) */ | 9095 | /* AUTO_CONSTANT (`constant) */ |
| 9065 | outin = ina | inb | `constant; | 9096 | outin = ina | inb | `constant; |
| 9066 | out = outin; | 9097 | out = outin; |
| 9098 | end | ||
| 9099 | |||
| 9100 | Note in Verilog 2001, you can often get the same result from the new @* | ||
| 9101 | operator. (This was added to the language in part due to AUTOSENSE!) | ||
| 9102 | |||
| 9103 | always @* begin | ||
| 9104 | outin = ina | inb | `constant; | ||
| 9105 | out = outin; | ||
| 9067 | end" | 9106 | end" |
| 9068 | (save-excursion | 9107 | (save-excursion |
| 9069 | ;; Find beginning | 9108 | ;; Find beginning |
| @@ -9219,7 +9258,7 @@ them to a one. | |||
| 9219 | 9258 | ||
| 9220 | An example of making a stub for another module: | 9259 | An example of making a stub for another module: |
| 9221 | 9260 | ||
| 9222 | module FooStub (/*AUTOINST*/); | 9261 | module ExampStub (/*AUTOINST*/); |
| 9223 | /*AUTOINOUTMODULE(\"Foo\")*/ | 9262 | /*AUTOINOUTMODULE(\"Foo\")*/ |
| 9224 | /*AUTOTIEOFF*/ | 9263 | /*AUTOTIEOFF*/ |
| 9225 | // verilator lint_off UNUSED | 9264 | // verilator lint_off UNUSED |
| @@ -9231,7 +9270,7 @@ An example of making a stub for another module: | |||
| 9231 | 9270 | ||
| 9232 | Typing \\[verilog-auto] will make this into: | 9271 | Typing \\[verilog-auto] will make this into: |
| 9233 | 9272 | ||
| 9234 | module FooStub (/*AUTOINST*/...); | 9273 | module ExampStub (/*AUTOINST*/...); |
| 9235 | /*AUTOINOUTMODULE(\"Foo\")*/ | 9274 | /*AUTOINOUTMODULE(\"Foo\")*/ |
| 9236 | // Beginning of autotieoff | 9275 | // Beginning of autotieoff |
| 9237 | output [2:0] foo; | 9276 | output [2:0] foo; |
| @@ -9300,8 +9339,8 @@ You can add signals you do not want included in AUTOUNUSED with | |||
| 9300 | 9339 | ||
| 9301 | An example of making a stub for another module: | 9340 | An example of making a stub for another module: |
| 9302 | 9341 | ||
| 9303 | module FooStub (/*AUTOINST*/); | 9342 | module ExampStub (/*AUTOINST*/); |
| 9304 | /*AUTOINOUTMODULE(\"Foo\")*/ | 9343 | /*AUTOINOUTMODULE(\"Examp\")*/ |
| 9305 | /*AUTOTIEOFF*/ | 9344 | /*AUTOTIEOFF*/ |
| 9306 | // verilator lint_off UNUSED | 9345 | // verilator lint_off UNUSED |
| 9307 | wire _unused_ok = &{1'b0, | 9346 | wire _unused_ok = &{1'b0, |
| @@ -9524,12 +9563,12 @@ The hooks `verilog-before-auto-hook' and `verilog-auto-hook' are | |||
| 9524 | called before and after this function, respectively. | 9563 | called before and after this function, respectively. |
| 9525 | 9564 | ||
| 9526 | For example: | 9565 | For example: |
| 9527 | module (/*AUTOARG*/) | 9566 | module ModuleName (/*AUTOARG*/) |
| 9528 | /*AUTOINPUT*/ | 9567 | /*AUTOINPUT*/ |
| 9529 | /*AUTOOUTPUT*/ | 9568 | /*AUTOOUTPUT*/ |
| 9530 | /*AUTOWIRE*/ | 9569 | /*AUTOWIRE*/ |
| 9531 | /*AUTOREG*/ | 9570 | /*AUTOREG*/ |
| 9532 | somesub sub #(/*AUTOINSTPARAM*/) (/*AUTOINST*/); | 9571 | InstMod instName #(/*AUTOINSTPARAM*/) (/*AUTOINST*/); |
| 9533 | 9572 | ||
| 9534 | You can also update the AUTOs from the shell using: | 9573 | You can also update the AUTOs from the shell using: |
| 9535 | emacs --batch <filenames.v> -f verilog-batch-auto | 9574 | emacs --batch <filenames.v> -f verilog-batch-auto |