You are an expert Verilog hardware designer working on a complete FPGA or ASIC project. You are given the full source code of a Verilog project. One of the modules in the project is incomplete — its implementation is missing and marked with:

// >>> Module Implementation Begin

// <<< Module Implementation End

Your task is to complete the missing implementation so that the entire project functions correctly. You must infer what the missing module or logic is supposed to do by analyzing the rest of the codebase: module names, signal connections, instantiations, comments, and usage patterns.

Follow these rules:

1. Only generate Verilog code to go between the `// >>> Module Implementation Begin` and `// <<< Module Implementation End` comments.
2. Use Verilog-2001 syntax. Ensure the code is synthesizable.
3. Assume the goal is a working, integrated hardware design — your code must make the whole system function as intended.
4. Analyze the naming, I/O ports, and how the module is instantiated or used in other parts of the project.
5. Implement correct behavior based on design context. Do not guess randomly — reason it out.
6. Avoid vendor-specific features unless explicitly required.
7. Do not output comments, explanation, or anything outside the required code region unless explicitly asked.

Your output should contain **only the Verilog code** that fits inside the marked region.

/*
 * Copyright (c) 2024 Applied Invention, LLC
 * SPDX-License-Identifier: Apache-2.0
 */

`default_nettype none

module tt_um_adia_psu_seq_test (
    input  wire [7:0] ui_in,    // Dedicated inputs
    output wire [7:0] uo_out,   // Dedicated outputs
    input  wire [7:0] uio_in,   // IOs: Input path
    output wire [7:0] uio_out,  // IOs: Output path
    output wire [7:0] uio_oe,   // IOs: Enable path (active high: 0=input, 1=output)
    input  wire       ena,      // always 1 when the design is powered, so you can ignore it
    input  wire       clk,      // clock
    input  wire       rst_n     // reset_n - low to reset
);
// >>> Module Implementation Begin

// <<< Module Implementation End
endmodule




/*
 * Copyright (c) 2024 Applied Invention, LLC
 * SPDX-License-Identifier: Apache-2.0
 */

`default_nettype none

module psu_sequencer #(parameter integer steps = 8) (
  input wire clk, input wire rst_n,
  output wire [steps:0] ctl0, output wire [steps:0] ctl1,
  output wire r0_w2_en, output wire r1_w3_en,
  output wire r2_w0_en, output wire r3_w1_en
);
  reg [3:0] phase;
  reg [steps-1:0] step;

  always @(posedge clk or negedge rst_n)
    if (!rst_n) begin
      phase <= 4'b1000;
      step <= 1 << (steps-1);
    end else begin
      step <= {step[steps-2:0], step[steps-1]};
      phase <= step[steps-1] ? {phase[2:0], phase[3]} : phase;
    end

  assign ctl0[0] = (phase[2] & step[steps-1]) | phase[3];
  assign ctl1[0] = (phase[3] & step[steps-1]) | phase[0];

  generate
    genvar i;
    for (i = 1; i < steps; i = i + 1) begin
      assign ctl0[i] = (phase[0] & step[i-1]) | (phase[2] & step[steps-i-1]);
      assign ctl1[i] = (phase[1] & step[i-1]) | (phase[3] & step[steps-i-1]);
    end
  endgenerate

  assign ctl0[steps] = (phase[0] & step[steps-1]) | phase[1];
  assign ctl1[steps] = (phase[1] & step[steps-1]) | phase[2];

  assign r0_w2_en = phase[1] & step[steps-1];
  assign r1_w3_en = phase[2] & step[steps-1];
  assign r2_w0_en = phase[3] & step[steps-1];
  assign r3_w1_en = phase[0] & step[steps-1];

endmodule


Reference solution:
rtl/generated.v: 
  wire [8:0] ctl0;
  wire [8:0] ctl1;
  wire r0_w2_en, r1_w3_en, r2_w0_en, r3_w1_en;

  psu_sequencer #(8) seq (clk, rst_n, ctl0, ctl1, r0_w2_en, r1_w3_en, r2_w0_en, r3_w1_en);

  assign uo_out[0] = ui_in[0];
  assign uo_out[7:1] = ui_in[0] ? ctl1[7:1] : ctl0[7:1];
  assign uio_out[0] = ctl0[0];
  assign uio_out[1] = ctl0[8];
  assign uio_out[2] = ctl1[0];
  assign uio_out[3] = ctl1[8];
  assign uio_out[4] = r0_w2_en;
  assign uio_out[5] = r1_w3_en;
  assign uio_out[6] = r2_w0_en;
  assign uio_out[7] = r3_w1_en;

  assign uio_oe = 'hff;

  // List all unused inputs to prevent warnings
  wire _unused = &{ena, 1'b0};