data/full_repos/permissive/414822257/ip/randsack/rtl/collapsering_macro.v
1: b"%Error: data/full_repos/permissive/414822257/ip/randsack/rtl/collapsering_macro.v:33: Cannot find file containing module: 'collapsering'\n  collapsering ring (\n  ^~~~~~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/414822257/ip/randsack/rtl,data/full_repos/permissive/414822257/collapsering\n             data/full_repos/permissive/414822257/ip/randsack/rtl,data/full_repos/permissive/414822257/collapsering.v\n             data/full_repos/permissive/414822257/ip/randsack/rtl,data/full_repos/permissive/414822257/collapsering.sv\n             collapsering\n             collapsering.v\n             collapsering.sv\n             obj_dir/collapsering\n             obj_dir/collapsering.v\n             obj_dir/collapsering.sv\n%Error: Exiting due to 1 error(s)\n"
module collapsering_macro #(
  parameter TRIM_BITS = 28
) (
`ifdef USE_POWER_PINS
    inout vccd1,
    inout vssd1,
`endif

  input start,
  input [TRIM_BITS-1:0] trim_a,
  input [TRIM_BITS-1:0] trim_b,
  input [2:0] clkmux,

  output clk_out
);

`ifndef SIM
  collapsering ring (
    .CLKBUFOUT(clk_out),
    .START(start),
    .TRIMA(trim_a),
    .TRIMB(trim_b),
    .CLKMUX(clkmux)
  );
`else

  reg [31:0] clk_cnt;
  reg fake_clk;

  wire [31:0] max_cnt = trim_a + trim_b + clkmux;

  always @(max_cnt) begin
    $display("collapsering_macro max count = 'h%h", max_cnt);
  end

  initial begin
    clk_cnt <= 0;
    fake_clk <= 1'b0;
  end

  always @(posedge fake_clk) begin
    if (start == 1'b1) begin
      clk_cnt <= clk_cnt + 32'b1;
    end else begin
      clk_cnt <= 32'b0;
    end
  end

  always #5 fake_clk <= ~fake_clk;

  assign clk_out = fake_clk & start & (clk_cnt < max_cnt);
`endif

endmodule
module collapsering_macro #(
  parameter TRIM_BITS = 28
) (
`ifdef USE_POWER_PINS
    inout vccd1,
    inout vssd1,
`endif

  input start,
  input [TRIM_BITS-1:0] trim_a,
  input [TRIM_BITS-1:0] trim_b,
  input [2:0] clkmux,

  output clk_out
);


`ifndef SIM
  collapsering ring (
    .CLKBUFOUT(clk_out),
    .START(start),
    .TRIMA(trim_a),
    .TRIMB(trim_b),
    .CLKMUX(clkmux)
  );
`else

  reg [31:0] clk_cnt;
  reg fake_clk;

  wire [31:0] max_cnt = trim_a + trim_b + clkmux;

  always @(max_cnt) begin
    $display("collapsering_macro max count = 'h%h", max_cnt);
  end

  initial begin
    clk_cnt <= 0;
    fake_clk <= 1'b0;
  end

  always @(posedge fake_clk) begin
    if (start == 1'b1) begin
      clk_cnt <= clk_cnt + 32'b1;
    end else begin
      clk_cnt <= 32'b0;
    end
  end

  always #5 fake_clk <= ~fake_clk;

  assign clk_out = fake_clk & start & (clk_cnt < max_cnt);
`endif

endmodule