Skip to content

Commit

Permalink
fpga: lib: Add default wiretypes to synchronizer
Browse files Browse the repository at this point in the history
The module was failing with missing wire types when instantiated from
another module with a default wiretype of 'none'. To fix this, this
module was also moved to no default wire type.
  • Loading branch information
mbr0wn authored and wordimont committed Nov 14, 2023
1 parent 2c4f46c commit 9d1e200
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
12 changes: 8 additions & 4 deletions fpga/usrp3/lib/control/synchronizer.v
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,18 @@
// tool analyze this path.
//

`default_nettype none

module synchronizer #(
parameter WIDTH = 1,
parameter STAGES = 2,
parameter INITIAL_VAL = 0,
parameter FALSE_PATH_TO_IN = 1
)(
input clk,
input rst,
input [WIDTH-1:0] in,
output [WIDTH-1:0] out
input wire clk,
input wire rst,
input wire [WIDTH-1:0] in,
output wire [WIDTH-1:0] out
);

generate if (FALSE_PATH_TO_IN == 1) begin
Expand All @@ -70,3 +72,5 @@ module synchronizer #(
end endgenerate

endmodule //synchronizer
//
`default_nettype wire
12 changes: 8 additions & 4 deletions fpga/usrp3/lib/control/synchronizer_impl.v
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,17 @@
// SPDX-License-Identifier: LGPL-3.0-or-later
//

`default_nettype none

module synchronizer_impl #(
parameter WIDTH = 1,
parameter STAGES = 2,
parameter INITIAL_VAL = 0
)(
input clk,
input rst,
input [WIDTH-1:0] in,
output [WIDTH-1:0] out
input wire clk,
input wire rst,
input wire [WIDTH-1:0] in,
output wire [WIDTH-1:0] out
);

(* ASYNC_REG = "TRUE" *) reg [WIDTH-1:0] value[0:STAGES-1];
Expand Down Expand Up @@ -45,3 +47,5 @@ module synchronizer_impl #(
assign out = value[STAGES-1];

endmodule //synchronizer_impl

`default_nettype wire

0 comments on commit 9d1e200

Please sign in to comment.