Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added explicit net types to verilog ports #1228

Conversation

RiceShelley
Copy link
Contributor

Closes #1225

Context, Motivation & Description

Adds explicit net types to the top level ports of Verilog modules. Specifying the net type will keep some vendor synthesis flows from failing or giving warnings.

Example:
ERROR: net type must be explicitly specified for 'io_sdClk' when default_nettype is none (VERI-1906)

In addition to the above since the net type is not specified or is "none" it is susceptible to being changed if the user has set `default_nettype elsewhere in the project.

Notes:
Did not add unit test because the change is small. I did run all existing sbt tests to ensure everything still passes.

Impact on code generation

Impacts Verilog code generation.

Generated Verilog file WishboneSimpleSlave.v as an example.
Before change:

module WishboneSimpleSlave (
  input               io_bus_CYC,
  input               io_bus_STB,
  output              io_bus_ACK,
  input               io_bus_WE,
  input      [7:0]    io_bus_ADR,
  output reg [7:0]    io_bus_DAT_MISO,
  input      [7:0]    io_bus_DAT_MOSI,
  input               clk,
  input               reset
);

After change:

module WishboneSimpleSlave (
  input  wire          io_bus_CYC,
  input  wire          io_bus_STB,
  output wire          io_bus_ACK,
  input  wire          io_bus_WE,
  input  wire [7:0]    io_bus_ADR,
  output reg  [7:0]    io_bus_DAT_MISO,
  input  wire [7:0]    io_bus_DAT_MOSI,
  input  wire          clk,
  input  wire          reset
);

Checklist

  • Unit tests were added
  • API changes are or will be documented:

@andreasWallner andreasWallner merged commit ac09d1c into SpinalHDL:dev Oct 26, 2023
12 checks passed
@andreasWallner
Copy link
Collaborator

Thanks!

@RiceShelley RiceShelley deleted the rice/adding_toplevel_nettypes_to_verilog branch October 27, 2023 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The signals in the toplevel port of a Verilog module should be explicitly given a net-type.
2 participants