image.png
# openlane
m
image.png
j
Shouldn't it be
Copy code
module #(
...
) frequency_counter (
...
);
If you actually want localparams I think you'll need to declare them below, in the body of the module.
m
Yep thanks I figured it out 🙂
t
Also, if you want to parameterise your ports using
localparam
instead of
parameter
I think you'll nee to take the Verilog 2005 approach of having a coma separated port list and then declaring the ports under your
localparam
deceleration in the module body. A bit of a nuisance I know.
Copy code
module mymodule
    (
        bin_i,
        onehot_o
    );

    parameter SZX;

    localparam SZ=2**SZX;

    input  wire [SZX-1:0] bin_i;
    output wire  [SZ-1:0] onehot_o;
j
In which case, this would also do the trick
Copy code
module mymodule #
(
   parameter DATA_WIDTH = 32                // width of data bus in bits (8, 16, 32, or 64)
)
(
   input [DATA_WIDTH-1:0] bin_i
)