0

Is it possible to have wire as default for inputs, but not default declare module internal signals?

As I understand `default_nettype` controls

  1. port kind of input and inout ports (As discussed in Question Implicit net-type declaration and `default-nettype)
  2. kind for signals in the design (for example logic)

Example, setting `default_nettype wire makes this code

module m1 (
   input  logic i1,
   output logic o1
   );

   logic  l1;
   assign l1 = i1;
   assign o1 = l1;
endmodule

mean the same thing as:

module m1 (
   input  wire logic i1,    // <-- default wire
   output logic o1
   );

   wire logic l1;          // <-- default wire
   assign l1 = i1;
   assign o1 = l1;
endmodule

Is there some setting that allows input to get default nettype wire but still cause failure in the case when an undefined signal is used:

module m1 (
   input  logic i1,   // <-- let this one default to wire
   output logic o1
   );

   logic  l1;
   logic banana;
   assign l1 = i1;
   assign hanana = i1;   // typo, should give error since no default declaration
   assign o1 = l1;
endmodule

2 Answers 2

0

No, your only choice for a default input net type is `default_nettype.

Sign up to request clarification or add additional context in comments.

Comments

0

Without the directive, input logic i1 always makes i1 a net, with a implicit nettype of wire. Had you used `default_nettype tri1, i1 would have had made the nettype tri1.

Unfortunately, the `default_nettype none directive does not distinguish between levels on implicitness. Your best options is to be fully explicit with input wire logic i1

Otherwise, you can downgrade this error to a warning.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.