data/full_repos/permissive/428611613/cores/pulse_generator_v1_0/pulse_generator.v
1: b'%Error: data/full_repos/permissive/428611613/cores/pulse_generator_v1_0/pulse_generator.v:51: Unsupported in C: Block has the same name as variable: \'CONTINUOUS\'\n    begin : CONTINUOUS\n            ^~~~~~~~~~\n        data/full_repos/permissive/428611613/cores/pulse_generator_v1_0/pulse_generator.v:6: ... Location of original declaration\n  parameter         CONTINUOUS = "FALSE"\n                    ^~~~~~~~~~\n%Error: data/full_repos/permissive/428611613/cores/pulse_generator_v1_0/pulse_generator.v:50: Found definition of \'CONTINUOUS\' as a BEGIN but expected a variable\n    if(CONTINUOUS == "TRUE")\n       ^~~~~~~~~~\n%Error: data/full_repos/permissive/428611613/cores/pulse_generator_v1_0/pulse_generator.v:50: Unsupported in C: Variable has the same name as block: \'CONTINUOUS\'\n    if(CONTINUOUS == "TRUE")\n       ^~~~~~~~~~\n        data/full_repos/permissive/428611613/cores/pulse_generator_v1_0/pulse_generator.v:51: ... Location of original declaration\n    begin : CONTINUOUS\n            ^~~~~~~~~~\n%Error: Exiting due to 3 error(s)\n        ... See the manual and https://verilator.org for more assistance.\n'
module pulse_generator #
(
  parameter         CONTINUOUS = "FALSE"
)
(
  input  wire        aclk,
  input  wire        aresetn,

  input  wire [95:0] cfg,

  output wire        dout
);

  reg int_dout_reg, int_dout_next;
  reg [31:0] int_cntr_reg, int_cntr_next;

  always @(posedge aclk)
  begin
    if(~aresetn)
    begin
      int_dout_reg <= 1'b0;
      int_cntr_reg <= 32'd0;
    end
    else
    begin
      int_dout_reg <= int_dout_next;
      int_cntr_reg <= int_cntr_next;
    end
  end

  always @*
  begin
    int_dout_next = int_dout_reg;

    if(int_cntr_reg == cfg[31:0])
    begin
      int_dout_next = 1'b1;
    end

    if(int_cntr_reg == cfg[63:32])
    begin
      int_dout_next = 1'b0;
    end
  end

  generate
    if(CONTINUOUS == "TRUE")
    begin : CONTINUOUS
      always @*
      begin
        int_cntr_next = int_cntr_reg;

        if(int_cntr_reg < cfg[95:64])
        begin
          int_cntr_next = int_cntr_reg + 1'b1;
        end
        else
        begin
          int_cntr_next = 32'd0;
        end
      end
    end
    else
    begin : STOP
      always @*
      begin
        int_cntr_next = int_cntr_reg;

        if(int_cntr_reg < cfg[95:64])
        begin
          int_cntr_next = int_cntr_reg + 1'b1;
        end
      end
    end
  endgenerate

  assign dout = int_dout_reg;

endmodule
module pulse_generator #
(
  parameter         CONTINUOUS = "FALSE"
)
(
  input  wire        aclk,
  input  wire        aresetn,

  input  wire [95:0] cfg,

  output wire        dout
);


  reg int_dout_reg, int_dout_next;
  reg [31:0] int_cntr_reg, int_cntr_next;

  always @(posedge aclk)
  begin
    if(~aresetn)
    begin
      int_dout_reg <= 1'b0;
      int_cntr_reg <= 32'd0;
    end
    else
    begin
      int_dout_reg <= int_dout_next;
      int_cntr_reg <= int_cntr_next;
    end
  end

  always @*
  begin
    int_dout_next = int_dout_reg;

    if(int_cntr_reg == cfg[31:0])
    begin
      int_dout_next = 1'b1;
    end

    if(int_cntr_reg == cfg[63:32])
    begin
      int_dout_next = 1'b0;
    end
  end

  generate
    if(CONTINUOUS == "TRUE")
    begin : CONTINUOUS
      always @*
      begin
        int_cntr_next = int_cntr_reg;

        if(int_cntr_reg < cfg[95:64])
        begin
          int_cntr_next = int_cntr_reg + 1'b1;
        end
        else
        begin
          int_cntr_next = 32'd0;
        end
      end
    end
    else
    begin : STOP
      always @*
      begin
        int_cntr_next = int_cntr_reg;

        if(int_cntr_reg < cfg[95:64])
        begin
          int_cntr_next = int_cntr_reg + 1'b1;
        end
      end
    end
  endgenerate

  assign dout = int_dout_reg;

endmodule