Skip to content

define is not properly considering #2033

@justincdas

Description

@justincdas

Code

`include "defines.svh"

module top (
                                       clk,
                                       rst_n_sync,
                                       in,
                                       out
);

   input                                clk;
   input 			        rst_n_sync;
   input                                in;
   output reg                           out;

`ifdef ASYNC_RESET_N
   always@(posedge clk or negedge rst_n_sync)begin
`else   
   always@(posedge clk)begin
`endif
     if(!rst_n_sync) begin
       out <= 1'b0;
     end else begin
`include "defines.svh"

module top (
                                       clk,
                                       rst_n_sync,
                                       in,
                                       out
);

   input                                clk;
   input 			        rst_n_sync;
   input                                in;
   output reg                           out;

`ifdef ASYNC_RESET_N
   always@(posedge clk or negedge rst_n_sync)begin
`else   
   always@(posedge clk)begin
`endif
     if(!rst_n_sync) begin
       out <= 1'b0;
     end else begin
`include "defines.svh"

module top (
                                       clk,
                                       rst_n_sync,
                                       in,
                                       out
);

   input                                clk;
   input 			        rst_n_sync;
   input                                in;
   output reg                           out;

`ifdef ASYNC_RESET_N
   always@(posedge clk or negedge rst_n_sync)begin
`else   
   always@(posedge clk)begin
`endif
     if(/*!rst_n*/!rst_n_sync) begin
       out <= 1'b0;
     end else begin
       out <= in;
     end
   end //always
endmodule

Command used
verible-verilog-format --inplace temp.v

**Error **
temp.v: temp.v:18:1-5: syntax error at token "`else"
temp.v:23:10-13: syntax error at token "else"
temp.v:25:6-8: syntax error at token "end"

Metadata

Metadata

Assignees

No one assigned

    Labels

    formatterVerilog code formatter issuespreprocessoranything related to preprocessing (conditionals, macros, etc.)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions