original_docstring:  Adds a set of ULPI registers to the active design. 
docstring: Adds a set of ULPI registers to the active design.
docstring_tokens: Adds a set of ULPI registers to the active design .
code: def add_ulpi_registers(self, m, platform, *, ulpi_bus, clock, register_base):
          """ Adds a set of ULPI registers to the active design. """
  
          target_ulpi      = platform.request(ulpi_bus)
  
          ulpi_reg_window  = ULPIRegisterWindow()
          m.submodules  += ulpi_reg_window
  
          m.d.comb += [
              ulpi_reg_window.ulpi_data_in  .eq(target_ulpi.data.i),
              ulpi_reg_window.ulpi_dir      .eq(target_ulpi.dir),
              ulpi_reg_window.ulpi_next     .eq(target_ulpi.nxt),
  
              target_ulpi.clk      .eq(ClockSignal("ulpi")),
              target_ulpi.rst      .eq(ResetSignal("ulpi")),
              target_ulpi.stp      .eq(ulpi_reg_window.ulpi_stop),
              target_ulpi.data.o   .eq(ulpi_reg_window.ulpi_data_out),
              target_ulpi.data.oe  .eq(~target_ulpi.dir)
          ]
  
          register_address_change  = Signal()
          register_value_change    = Signal()
  
          # ULPI register address.
          spi_registers = m.submodules.spi_registers
          spi_registers.add_register(register_base + 0,
              write_strobe=register_address_change,
              value_signal=ulpi_reg_window.address,
              size=6
          )
          m.submodules.clocking.stretch_sync_strobe_to_ulpi(m,
              strobe=register_address_change,
              output=ulpi_reg_window.read_request,
          )
  
          # ULPI register value.
          spi_registers.add_sfr(register_base + 1,
              read=ulpi_reg_window.read_data,
              write_signal=ulpi_reg_window.write_data,
              write_strobe=register_value_change
          )
          m.submodules.clocking.stretch_sync_strobe_to_ulpi(m,
              strobe=register_value_change,
              output=ulpi_reg_window.write_request
          )
code_tokens: def add_ulpi_registers ( self , m , platform , * , ulpi_bus , clock , register_base ) : target_ulpi = platform . request ( ulpi_bus ) ulpi_reg_window = ULPIRegisterWindow ( ) m . submodules += ulpi_reg_window m . d . comb += [ ulpi_reg_window . ulpi_data_in . eq ( target_ulpi . data . i ) , ulpi_reg_window . ulpi_dir . eq ( target_ulpi . dir ) , ulpi_reg_window . ulpi_next . eq ( target_ulpi . nxt ) , target_ulpi . clk . eq ( ClockSignal ( "ulpi" ) ) , target_ulpi . rst . eq ( ResetSignal ( "ulpi" ) ) , target_ulpi . stp . eq ( ulpi_reg_window . ulpi_stop ) , target_ulpi . data . o . eq ( ulpi_reg_window . ulpi_data_out ) , target_ulpi . data . oe . eq ( ~ target_ulpi . dir ) ] register_address_change = Signal ( ) register_value_change = Signal ( ) spi_registers = m . submodules . spi_registers spi_registers . add_register ( register_base + 0 , write_strobe = register_address_change , value_signal = ulpi_reg_window . address , size = 6 ) m . submodules . clocking . stretch_sync_strobe_to_ulpi ( m , strobe = register_address_change , output = ulpi_reg_window . read_request , ) spi_registers . add_sfr ( register_base + 1 , read = ulpi_reg_window . read_data , write_signal = ulpi_reg_window . write_data , write_strobe = register_value_change ) m . submodules . clocking . stretch_sync_strobe_to_ulpi ( m , strobe = register_value_change , output = ulpi_reg_window . write_request )
short_docstring: Adds a set of ULPI registers to the active design.
short_docstring_tokens: Adds a set of ULPI registers to the active design .
comment: """ Adds a set of ULPI registers to the active design. """$SEP$# ULPI register address.$SEP$# ULPI register value.