<?xml version="1.0"?>
<lsccip:ip version="1.0"
    xmlns:lsccip="http://www.latticesemi.com/XMLSchema/Radiant/ip"
    xmlns:xi="http://www.w3.org/2001/XInclude">

  <lsccip:general>
    <lsccip:vendor>latticesemi.com</lsccip:vendor>
    <lsccip:library>ip</lsccip:library>
    <lsccip:name>i3c_controller</lsccip:name>
    <lsccip:display_name>I3C Controller</lsccip:display_name>
    <lsccip:version>3.7.1</lsccip:version>
    <lsccip:category>Processors_Controllers_and_Peripherals</lsccip:category>
    <lsccip:keywords>BusType_AHB-Lite,BusType_APB</lsccip:keywords>
    <lsccip:min_radiant_version>2023.2</lsccip:min_radiant_version>
    <lsccip:supported_products>
	<lsccip:supported_family name="LIFCL"/>
	   <lsccip:supported_family name="LFD2NX"/>
	   <lsccip:supported_family name="iCE40UP"/>
	   <lsccip:supported_family name="LFCPNX"/>
	   <lsccip:supported_family name="LFMXO5"/>
	   <lsccip:supported_family name="UT24C"/>
	   <lsccip:supported_family name="UT24CP"/>
	   <lsccip:supported_family name="LAV-AT"/>
	   <lsccip:supported_family name="LFMNX"/>
	   <lsccip:supported_family name="LCMXO3D"/>
	   <lsccip:supported_family name="MachXO3D"/>
	   <lsccip:supported_family name="LKH-CT"/>
	   <lsccip:supported_family name="LKH-MH"/>
	   <lsccip:supported_family name="LN2-CT"/>
	   <lsccip:supported_family name="LN2-MH"/>
	  </lsccip:supported_products>
    <lsccip:supported_platforms>
      <lsccip:supported_platform name="esi" />
      <lsccip:supported_platform name="radiant" />
    </lsccip:supported_platforms>
  </lsccip:general>

  <lsccip:settings>
  <!-- Bus Characteristics -->
  <lsccip:setting id               = "DEVICE_ROLE"
                  type             = "param"
                  conn_mod         = "lscc_i3c_controller"
                  value_type       = "int"
                  title            = "Device Role"
                  options          = "[('Secondary Controller', 0), ('Primary Controller', 1)]"
                  default          = "1"
                  editable         = "ENABLE_SMI"
                  group1           = "Bus Characteristics"
  />

  <lsccip:setting id               = "FAMILY"
                  conn_mod         = "lscc_i3c_controller"
                  value_type       = "string"
                  type             = "param"
                  title            = "Device Architecture"
                  value_expr       = "runtime_info.device_info.architecture(1)"
                  editable         = "False"
                  hidden           = "True"
                  group1           = "Bus Characteristics"
  />

  <lsccip:setting id               = "DUT_INST_NAME"
                  type             = "verilog_macro"
                  conn_mod         = "lscc_i3c_controller"
                  value_type       = "path"
                  value_expr       = "runtime_info.ip_inst_name"
                  editable         = "0"
                  hidden           = "bool(1)"
                  group1           = "Bus Characteristics"
  />

  <lsccip:setting id               = "BFM_PATH"
                  type             = "verilog_macro"
                  conn_mod         = "lscc_i3c_controller"
                  value_type       = "path"
                  value_expr       = "get_bfm_path(SEL_INTF)"
                  editable         = "0"
                  hidden           = "bool(1)"
                  group1           = "Bus Characteristics"
  />

  <lsccip:setting id               = "ENABLE_SMI"
                  type             = "param"
                  conn_mod         = "lscc_i3c_controller"
                  value_type       = "bool"
                  title            = "Secondary Controller Capable"
                  default          = "False"
                  editable         = "True"
                  group1           = "Bus Characteristics"
    />

  <lsccip:setting id               = "ENABLE_IBI"
                  type             = "param"
                  conn_mod         = "lscc_i3c_controller"
                  value_type       = "bool"
                  title            = "IBI Capable"
                  default          = "False"
                  value_expr       = "bool(ENABLE_SMI)"
                  editable         = "not ENABLE_SMI"
                  group1           = "Bus Characteristics"
  />

  <lsccip:setting id               = "ENABLE_HJI"
                  type             = "param"
                  conn_mod         = "lscc_i3c_controller"
                  value_type       = "bool"
                  title            = "Hot-Join Capable"
                  default          = "False"
                  value_expr       = "bool(ENABLE_SMI)"
                  editable         = "not ENABLE_SMI"
                  group1           = "Bus Characteristics"
  />

  <lsccip:setting   id             = "ENABLE_HDR_DDR"
                    type           = "param"
                    conn_mod       = "lscc_i3c_controller"
                    value_type     = "int"
                    title          = "Data Rate Mode"
                    options        = "[('SDR-only', 0), ('HDR-DDR-capable', 1)]"
                    default        = "0"
                    editable       = "True"
                    group1         = "Bus Characteristics"
  />

  <lsccip:setting id               = "SEL_INTF"
                  type             = "param"
                  conn_mod         = "lscc_i3c_controller"
                  value_type       = "string"
                  title            = "Interface"
                  options          = "['LMMI', 'APB', 'AHBL']"
                  default          = "APB"
                  group1           = "Register Interface"
  />

  <lsccip:setting id               = "REG_MAPPING"
                  type             = "param"
                  conn_mod         = "lscc_i3c_controller"
                  value_type       = "int"
                  options          = "[('Address offset in Bytes',0), ('Address offset in DWORD',1)]"
                  title            = "Register Offset"
                  value_expr       = "1 if (SEL_INTF != 'LMMI') else 0"
                  editable         = "(SEL_INTF != 'LMMI')"
                  group1           = "Register Interface"
  />

  <lsccip:setting id               = "MEM_IMPL"
                  type             = "param"
                  conn_mod         = "lscc_i3c_controller"
                  value_type       = "string"
                  options          = "['EBR', 'LUT', 'HARD_IP']"
                  default          = "EBR"
                  title            = "FIFO Implementation"
                  editable         = "True"
                  hidden           = "False"
                  group1           = "FIFO"
  />

  <lsccip:setting id               = "FIFO_DEPTH"
                  type             = "param"
                  conn_mod         = "lscc_i3c_controller"
                  value_type       = "int"
                  options          = "[64, 128, 256, 512, 1024]"
                  default          = "512"
                  title            = "FIFO Depth"
                  editable         = "True"
                  hidden           = "False"
                  group1           = "FIFO"
  />

  <lsccip:setting id               = "EN_FIFOINTF"
                  type             = "param"
                  conn_mod         = "lscc_i3c_controller"
                  value_type       = "bool"
                  title            = "Enable Direct FIFO Interface"
                  default          = "False"
                  group1           = "Optional Interface"
  />

  <lsccip:setting id               = "EN_FIFOINTF_M"
                  type             = "verilog_macro"
                  conn_mod         = "lscc_i3c_controller"
                  value_type       = "int"
                  value_expr       = "EN_FIFOINTF"
                  editable         = "0"
                  hidden           = "bool(1)"
                  group1           = "Optional Interface"
  />

  <lsccip:setting id               = "TXDWID"
                  type             = "param"
                  conn_mod         = "lscc_i3c_controller"
                  value_type       = "int"
                  options          = "[8,16,32]"
                  title            = "Tx Data Width"
                  default          = "8"
                  editable         = "False"
                  hidden           = "not EN_FIFOINTF"
                  group1           = "Optional Interface"
  />

  <lsccip:setting id               = "RXDWID"
                  type             = "param"
                  conn_mod         = "lscc_i3c_controller"
                  value_type       = "int"
                  options          = "[8,16,32]"
                  title            = "Rx Data Width"
                  default          = "8"
                  editable         = "False"
                  hidden           = "not EN_FIFOINTF"
                  group1           = "Optional Interface"
  />

  <lsccip:setting id               = "CLKDOMAIN"
                  type             = "param"
                  conn_mod         = "lscc_i3c_controller"
                  value_type       = "string"
                  title            = "Bus Clock Domain"
                  options          = "['SYNC', 'ASYNC']"
                  default          = "ASYNC"
                  editable         = "False"
                  group1           = "SCL Clocking"
  />

  <lsccip:setting id               = "USE_INTCLKDIV"
                  type             = "param"
                  conn_mod         = "lscc_i3c_controller"
                  value_type       = "bool"
                  title            = "Use Internal Clock Divider"
                  default          = "False"
                  editable         = "CLKDOMAIN == 'ASYNC'"
                  hidden           = "CLKDOMAIN != 'ASYNC'"
                  group1           = "SCL Clocking"
  />

  <lsccip:setting id               = "gui_sysclk_freq"
                  type             = "input"
                  conn_mod         = "lscc_i3c_controller"
                  value_type       = "float"
                  title            = "System Clock Frequency (MHz) (clk_i)"
                  default          = "25.0"
                  value_range      = "(0.8,50) if(CLKDOMAIN == 'ASYNC') else (0.8,25)"
                  editable         = "True"
                  group1           = "SCL Clocking"
  />

  <lsccip:setting id               = "gui_int_sysclk_freq"
                  type             = "input"
                  conn_mod         = "lscc_i3c_controller"
                  value_type       = "float"
                  title            = "Core Clock Frequency (MHz)"
                  value_expr       = "calc_int_sysclk_freq(gui_sysclk_freq) if(USE_INTCLKDIV) else 25.0"
                  editable         = "not (USE_INTCLKDIV)"
                  value_range      = "(0.02,25)"
                  group1           = "SCL Clocking"
  />

  <lsccip:setting id               = "SYSCLK_FREQ"
                  type             = "verilog_macro"
                  conn_mod         = "lscc_i3c_controller"
                  value_type       = "float"
                  value_expr       = "gui_sysclk_freq"
                  editable         = "0"
                  hidden           = "bool(1)"
                  group1           = "SCL Clocking"
  />


  <lsccip:setting id               = "CORECLK_FREQ"
                  type             = "verilog_macro"
                  conn_mod         = "lscc_i3c_controller"
                  value_type       = "float"
                  value_expr       = "gui_int_sysclk_freq"
                  editable         = "0"
                  hidden           = "bool(1)"
                  group1           = "SCL Clocking"
                  />

  <lsccip:setting id               = "EXT_SCL_FREQ"
                  type             = "verilog_macro"
                  conn_mod         = "lscc_i3c_controller"
                  value_type       = "float"
                  value_expr       = "gui_scl_freq"
                  editable         = "0"
                  hidden           = "bool(1)"
                  group1           = "SCL Clocking"
  />

  <lsccip:setting id               = "gui_scl_pulse_width"
                  type             = "input"
                  conn_mod         = "lscc_i3c_controller"
                  value_type       = "int"
                  title            = "SCL Pulse width (Number of internal clock cycles)"
                  default          = "1"
                  value_range      = "(1,256) if(not USE_INTCLKDIV) else (int((gui_int_sysclk_freq+25.71)/25.8),256)"
                  value_expr       = "1 if(not USE_INTCLKDIV) else 1"
                  editable         = "USE_INTCLKDIV"
                  hidden           = "not USE_INTCLKDIV"
                  drc              = "(gui_scl_freq &gt;= 0.01 and gui_scl_freq &lt;= 12.9) if(USE_INTCLKDIV) else 1"
                  group1           = "SCL Clocking"
  />

  <lsccip:setting id               = "gui_scl_freq"
                  type             = "input"
                  conn_mod         = "lscc_i3c_controller"
                  value_type       = "float"
                  title            = "SCL Clock Frequency (MHz)"
                  default          = "12.5"
                  value_range      = "(0.01,12.5)"
                  value_expr       = "(gui_int_sysclk_freq/(2*gui_scl_pulse_width)) if(CLKDOMAIN == 'ASYNC') else gui_int_sysclk_freq"
                  editable         = "False"
                  group1           = "SCL Clocking"
  />

  <lsccip:setting id               = "gui_scl_period"
                  type             = "input"
                  conn_mod         = "lscc_i3c_controller"
                  value_type       = "float"
                  title            = "SCL Clock Period (ns)"
                  value_expr       = "1000/gui_scl_freq"
                  editable         = "False"
                  group1           = "SCL Clocking"
  />

  <lsccip:setting id               = "gui_odscl_pulse_width"
                  type             = "input"
                  conn_mod         = "lscc_i3c_controller"
                  value_type       = "int"
                  title            = "Open-drain Pulse width (Number of SCL cycles)"
                  default          = "3"
                  value_range      = "(calc_od_timer(gui_int_sysclk_freq,gui_scl_pulse_width),15) if(USE_INTCLKDIV) else (1,15)"
                  editable         = "True"
                  group1           = "SCL Clocking"
  />

  <lsccip:setting id               = "gui_odscl_freq"
                  type             = "input"
                  conn_mod         = "lscc_i3c_controller"
                  value_type       = "float"
                  title            = "Open-drain Clock Frequency (MHz)"
                  value_expr       = "(gui_scl_freq/(2*gui_odscl_pulse_width)) if(gui_odscl_pulse_width > 0) else gui_scl_freq"
                  editable         = "False"
                  group1           = "SCL Clocking"
  />

  <lsccip:setting id               = "gui_osscl_period"
                  type             = "input"
                  conn_mod         = "lscc_i3c_controller"
                  value_type       = "float"
                  title            = "Open-drain Pulse width (ns)"
                  value_expr       = "500/gui_odscl_freq"
                  editable         = "False"
                  group1           = "SCL Clocking"
  />

  <lsccip:setting id               = "TIMEOUT_100US"
                  type             = "param"
                  conn_mod         = "lscc_i3c_controller"
                  value_type       = "int"
                  value_expr       = "int(100*SYSCLK_FREQ)"
                  editable         = "False"
                  hidden           = "True"
                  group1           = "SCL Clocking"
  />

  <lsccip:setting id               = "DEFAULT_RATE"
                  type             = "param"
                  conn_mod         = "lscc_i3c_controller"
                  value_type       = "int"
                  value_expr       = "gui_scl_pulse_width-1"
                  editable         = "False"
                  hidden           = "True"
                  group1           = "SCL Clocking"
  />

  <lsccip:setting id               = "DEFAULT_ODTIMER"
                  type             = "param"
                  conn_mod         = "lscc_i3c_controller"
                  value_type       = "int"
                  value_expr       = "gui_odscl_pulse_width"
                  editable         = "False"
                  hidden           = "True"
                  group1           = "SCL Clocking"
  />

  <lsccip:setting id               = "gui_en_dyn_i2c_switching"
                  type             = "input"
                  conn_mod         = "lscc_i3c_controller"
                  value_type       = "bool"
                  title            = "Enable Dynamic I3C&lt;-&gt;I2C clock switching"
                  default          = "True"
                  editable         = "True"
                  group1           = "SCL Clocking"
  />

  <lsccip:setting id               = "gui_i2c_scl_pulse_width"
                  type             = "input"
                  conn_mod         = "lscc_i3c_controller"
                  value_type       = "int"
                  title            = "I2C SCL Pulse width (Number of clk_i cycles)"
                  default          = "13"
                  value_range      = "(1,256) if(not USE_INTCLKDIV) else (int((gui_int_sysclk_freq+25.71)/25.8),256)"
                  value_expr       = "13"
                  editable         = "gui_en_dyn_i2c_switching"
                  hidden           = "not gui_en_dyn_i2c_switching"
                  group1           = "SCL Clocking"
  />

  <lsccip:setting id               = "gui_i2cscl_freq"
                  type             = "input"
                  conn_mod         = "lscc_i3c_controller"
                  value_type       = "float"
                  title            = "I2C Clock Frequency (MHz)"
                  value_expr       = "(gui_int_sysclk_freq/(2*gui_i2c_scl_pulse_width))"
                  editable         = "False"
                  hidden           = "not gui_en_dyn_i2c_switching"
                  group1           = "SCL Clocking"
  />

  <lsccip:setting id               = "gui_i2cscl_period"
                  type             = "input"
                  conn_mod         = "lscc_i3c_controller"
                  value_type       = "float"
                  title            = "I2C Clock Pulse width (ns)"
                  value_expr       = "500/gui_i2cscl_freq"
                  editable         = "False"
                  hidden           = "not gui_en_dyn_i2c_switching"
                  group1           = "SCL Clocking"
  />

  <lsccip:setting id               = "EN_DYN_I2C_SWITCHING"
                  type             = "param"
                  conn_mod         = "lscc_i3c_controller"
                  value_type       = "int"
                  value_expr       = "gui_en_dyn_i2c_switching"
                  editable         = "False"
                  hidden           = "True"
                  group1           = "SCL Clocking"
  />

  <lsccip:setting id               = "I2C_RATE"
                  type             = "param"
                  conn_mod         = "lscc_i3c_controller"
                  value_type       = "int"
                  value_expr       = "gui_i2c_scl_pulse_width-1"
                  editable         = "False"
                  hidden           = "True"
                  group1           = "SCL Clocking"
  />

  <lsccip:setting id               = "ENABLE_IO_PRIMITIVE"
                  type             = "param"
                  conn_mod         = "lscc_i3c_controller"
                  value_type       = "bool"
                  title            = "Include IO Primitive"
                  value_expr       = "False if(FAMILY == 'LFMNX') else True"
                  editable         = "True"
                  group1           = "IO Primitive"
  />

  <!-- Secondary Controller -->
  <lsccip:setting id               = "IBI_DATA_PAY"
                  type             = "param"
                  conn_mod         = "lscc_i3c_controller"
                  value_type       = "int"
                  title            = "IBI Payload Size (including MDB)"
                  value_range      = "(0, 255)"
                  default          = "1"
                  editable         = "ENABLE_IBI"
                  hidden           = "not ENABLE_SMI"
                  group1           = "Bus Characteristics"
                  group2           = "Secondary Controller"
  />

  <lsccip:setting id               = "MAX_D_SPEED_LIMIT"
                  type             = "param"
                  conn_mod         = "lscc_i3c_controller"
                  value_type       = "bool"
                  title            = "Max Data Speed Limitation"
                  default          = "True"
                  editable         = "bool(ENABLE_SMI)"
                  hidden           = "not ENABLE_SMI"
                  group1           = "Bus Characteristics"
                  group2           = "Secondary Controller"
  />

  <lsccip:setting id               = "DCR_tmp"
                  type             = "input"
                  conn_mod         = "lscc_i3c_controller"
                  value_type       = "string"
                  title            = "DCR (HEX) [00 - FF]"
                  drc              = "ext_check_hex_value(DCR_tmp, 'FF', 'DCR Value')"
                  default          = "00"
                  hidden           = "not ENABLE_SMI"
                  group1           = "Device Characteristics"
                  group2           = "Secondary Controller"
  />

  <lsccip:setting id               = "DCR"
                  type             = "param"
                  conn_mod         = "lscc_i3c_controller"
                  value_type       = "int"
                  title            = "DCR (HEX) [00 - FF] (param)"
                  value_expr       = "int(DCR_tmp, 16)"
                  editable         = "False"
                  hidden           = "True"
                  group1           = "Device Characteristics"
                  group2           = "Secondary Controller"
  />

  <lsccip:setting id               = "PID_MANUF"
                  type             = "param"
                  conn_mod         = "lscc_i3c_controller"
                  value_type       = "int"
                  title            = "Manufacturer ID"
                  value_range      = "(0, 32767)"
                  default          = "414"
                  hidden           = "not ENABLE_SMI"
                  group1           = "Device Characteristics"
                  group2           = "Secondary Controller"
  />

  <lsccip:setting id               = "PID_PART"
                  type             = "param"
                  conn_mod         = "lscc_i3c_controller"
                  value_type       = "int"
                  title            = "Part ID"
                  value_range      = "(0, 65535)"
                  default          = "1"
                  hidden           = "not ENABLE_SMI"
                  group1           = "Device Characteristics"
                  group2           = "Secondary Controller"
  />

  <lsccip:setting id               = "PID_INST"
                  type             = "param"
                  conn_mod         = "lscc_i3c_controller"
                  value_type       = "int"
                  title            = "Instance ID"
                  value_range      = "(0, 15)"
                  default          = "1"
                  hidden           = "not ENABLE_SMI"
                  group1           = "Device Characteristics"
                  group2           = "Secondary Controller"
  />

  <lsccip:setting id               = "PID_ADD"
                  type             = "param"
                  conn_mod         = "lscc_i3c_controller"
                  value_type       = "int"
                  title            = "Additional ID"
                  value_range      = "(0, 4095)"
                  default          = "0"
                  hidden           = "not ENABLE_SMI"
                  group1           = "Device Characteristics"
                  group2           = "Secondary Controller"
  />

  <lsccip:setting id               = "STATIC_ADDR_EN"
                  type             = "param"
                  conn_mod         = "lscc_i3c_controller"
                  value_type       = "bool"
                  title            = "Static Address Enable"
                  default          = "True"
                  hidden           = "not ENABLE_SMI"
                  group1           = "Device Characteristics"
                  group2           = "Secondary Controller"
  />

  <lsccip:setting id               = "STAT_ADDR_tmp"
                  type             = "input"
                  conn_mod         = "lscc_i3c_controller"
                  value_type       = "string"
                  title            = "Static Address (HEX) [00-7F]"
                  drc              = "ext_check_hex_and_valid(STAT_ADDR_tmp, '7D', 'Static Address')"
                  default          = "08"
                  editable         = "STATIC_ADDR_EN"
                  hidden           = "not (ENABLE_SMI and STATIC_ADDR_EN)"
                  group1           = "Device Characteristics"
                  group2           = "Secondary Controller"
  />

  <lsccip:setting id               = "STATIC_ADDR"
                  type             = "param"
                  conn_mod         = "lscc_i3c_controller"
                  value_type       = "int"
                  title            = "Static Address (HEX) [00-7F] (param)"
                  value_expr       = "int(STAT_ADDR_tmp, 16)"
                  editable         = "False"
                  hidden           = "True"
                  group1           = "Device Characteristics"
                  group2           = "Secondary Controller"
  />

  <lsccip:setting id               = "DYN_ADDR_tmp"
                  type             = "input"
                  conn_mod         = "lscc_i3c_controller"
                  value_type       = "string"
                  title            = "Dynamic Address (HEX) [00-7F]"
                  drc              = "ext_check_hex_and_valid(DYN_ADDR_tmp, '7D', 'Dynamic Address')"
                  default          = "08"
                  editable         = "True"
                  hidden           = "not (ENABLE_SMI and DEVICE_ROLE)"
                  group1           = "Device Characteristics"
                  group2           = "Secondary Controller"
                  />

  <lsccip:setting id               = "DYNAMIC_ADDR"
                  type             = "param"
                  conn_mod         = "lscc_i3c_controller"
                  value_type       = "int"
                  title            = "Dynamic Address (HEX) [00-7F] (param)"
                  value_expr       = "int(DYN_ADDR_tmp, 16)"
                  editable         = "False"
                  hidden           = "True"
                  group1           = "Device Characteristics"
                  group2           = "Secondary Controller"
                  />

  <lsccip:setting id               = "CLKI_FREQ"
                  type             = "param"
                  conn_mod         = "lscc_i3c_controller"
                  value_type       = "int"
                  value_expr       = "int(SYSCLK_FREQ)"
                  editable         = "False"
                  hidden           = "True"
                  group1           = "Timing Characteristics"
                  group2           = "Secondary Controller"
  />

  <lsccip:setting id               = "MXDS_W"
                  type             = "param"
                  conn_mod         = "lscc_i3c_controller"
                  value_type       = "int"
                  title            = "Write Maximum Data Rate (MHz)"
                  default          = "0"
                  editable         = "False"
                  options          = "get_mxds_maxwr()"
                  hidden           = "not(ENABLE_SMI) or not(MAX_D_SPEED_LIMIT)"
                  group1           = "Timing Characteristics"
                  group2           = "Secondary Controller"
  />
  <lsccip:setting id               = "MXDS_TSCO"
                  type             = "param"
                  conn_mod         = "lscc_i3c_controller"
                  value_type       = "int"
                  title            = "Clock-to-data Turnaround Delay (ns)"
                  default          = "0"
                  editable         = "False"
                  options          = "get_mxds_tsco()"
                  hidden           = "not(ENABLE_SMI) or not(MAX_D_SPEED_LIMIT)"
                  group1           = "Timing Characteristics"
                  group2           = "Secondary Controller"
  />
  <lsccip:setting id               = "MXDS_R"
                  type             = "param"
                  conn_mod         = "lscc_i3c_controller"
                  value_type       = "int"
                  title            = "Read Maximum Data Rate (MHz)"
                  default          = "0"
                  editable         = "False"
                  options          = "get_mxds_maxrd()"
                  hidden           = "not(ENABLE_SMI) or not(MAX_D_SPEED_LIMIT)"
                  group1           = "Timing Characteristics"
                  group2           = "Secondary Controller"
  />
  <lsccip:setting id               = "MXDS_RD_TURN_tmp"
                  type             = "input"
                  conn_mod         = "lscc_i3c_controller"
                  value_type       = "float"
                  title            = "Maximum Read Turnaround Time (us)"
                  default          = "0.0"
                  editable         = "False"
                  hidden           = "not(ENABLE_SMI) or not(MAX_D_SPEED_LIMIT)"
                  group1           = "Timing Characteristics"
                  group2           = "Secondary Controller"
  />
  <lsccip:setting id               = "MXDS_RD_TURN"
                  type             = "param"
                  conn_mod         = "lscc_i3c_controller"
                  value_type       = "int"
                  title            = "Maximum Read Turnaround Time (us) (param)"
                  value_expr       = "int(MXDS_RD_TURN_tmp)"
                  editable         = "False"
                  hidden           = "True"
                  group1           = "Timing Characteristics"
                  group2           = "Secondary Controller"
  />

  <!-- Simulation -->
  <lsccip:setting id               = "gui_sim_type"
                  type             = "input"
                  conn_mod         = "lscc_i3c_controller"
                  value_type       = "int"
                  title            = "Simulation Type"
                  default          = "0"
                  options          = "[('RTL_SIM',0),('GATE_SIM',1)]"
                  editable         = "bool(1)"
                  hidden           = "bool(1)"
                  group2           = "Simulation"
  />

  <lsccip:setting id               = "GATE_SIM"
                  type             = "verilog_macro"
                  conn_mod         = "lscc_i3c_controller"
                  value_type       = "bool"
                  value_expr       = "True if(gui_sim_type) else False"
                  editable         = "bool(0)"
                  hidden           = "bool(1)"
                  group1           = "Simulation"
  />

  </lsccip:settings>

  <lsccip:ports>
    <!-- I3C system related pins -->
    <lsccip:port name       = "clk_i"
                 dir        = "in"
                 conn_mod   = "lscc_i3c_controller"
                 conn_port  = "clk_i"
    />

    <lsccip:port name       = "src_clk_scl_i"
                 dir        = "in"
                 conn_mod   = "lscc_i3c_controller"
                 conn_port  = "src_clk_scl_i"
                 stick_low  = "CLKDOMAIN == 'SYNC' or (CLKDOMAIN == 'ASYNC' and USE_INTCLKDIV)"
    />

    <lsccip:port name       = "rst_n_i"
                 dir        = "in"
                 conn_mod   = "lscc_i3c_controller"
                 conn_port  = "rst_n_i"
    />

    <!-- I3C inouts -->
    <lsccip:port name       = "scl_io"
                 dir        = "inout"
                 conn_mod   = "lscc_i3c_controller"
                 conn_port  = "scl_io"
                 dangling   = "not ENABLE_IO_PRIMITIVE"
    />

    <lsccip:port name       = "sda_io"
                 dir        = "inout"
                 conn_mod   = "lscc_i3c_controller"
                 conn_port  = "sda_io"
                 dangling   = "not ENABLE_IO_PRIMITIVE"
    />

    <!-- LMMI inputs -->

    <lsccip:port name       = "lmmi_request_i"
                 dir        = "in"
                 conn_mod   = "lscc_i3c_controller"
                 conn_port  = "lmmi_request_i"
                 stick_low  = "SEL_INTF != 'LMMI'"
                 bus_interface = "LMMI_SLV"
    />

    <lsccip:port name       = "lmmi_wr_rdn_i"
                 dir        = "in"
                 conn_mod   = "lscc_i3c_controller"
                 conn_port  = "lmmi_wr_rdn_i"
                 stick_high = "SEL_INTF != 'LMMI'"
                 bus_interface = "LMMI_SLV"
    />

    <lsccip:port name       = "lmmi_offset_i"
                 dir        = "in"
                 conn_mod   = "lscc_i3c_controller"
                 conn_port  = "lmmi_offset_i"
                 range      = "(7, 0)"
                 stick_high = "SEL_INTF != 'LMMI'"
                 bus_interface = "LMMI_SLV"
    />

    <lsccip:port name       = "lmmi_wdata_i"
                 dir        = "in"
                 conn_mod   = "lscc_i3c_controller"
                 conn_port  = "lmmi_wdata_i"
                 range      = "(7, 0)"
                 stick_high = "SEL_INTF != 'LMMI'"
                 bus_interface = "LMMI_SLV"
    />

    <!-- LMMI outputs -->
    <lsccip:port name       = "lmmi_rdata_o"
                 dir        = "out"
                 conn_mod   = "lscc_i3c_controller"
                 conn_port  = "lmmi_rdata_o"
                 range      = "(7, 0)"
                 dangling   = "SEL_INTF != 'LMMI'"
                 bus_interface = "LMMI_SLV"
    />

    <lsccip:port name       = "lmmi_rdata_valid_o"
                 dir        = "out"
                 conn_mod   = "lscc_i3c_controller"
                 conn_port  = "lmmi_rdata_valid_o"
                 dangling   = "SEL_INTF != 'LMMI'"
                 bus_interface = "LMMI_SLV"
    />

    <lsccip:port name       = "lmmi_ready_o"
                 dir        = "out"
                 conn_mod   = "lscc_i3c_controller"
                 conn_port  = "lmmi_ready_o"
                 dangling   = "SEL_INTF != 'LMMI'"
                 bus_interface = "LMMI_SLV"
    />

    <lsccip:port name       = "lmmi_error_o"
                 dir        = "out"
                 conn_mod   = "lscc_i3c_controller"
                 conn_port  = "lmmi_error_o"
                 dangling   = "True"
                 bus_interface = "LMMI_SLV"
    />

    <!-- Interrupt output -->
    <lsccip:port name          = "int_o"
                 dir           = "out"
                 conn_mod      = "lscc_i3c_controller"
                 conn_port     = "int_o"
                 bus_interface = "INTR"
    />

    <lsccip:port name          = "sc_rst_o"
                 dir           = "out"
                 conn_mod      = "lscc_i3c_controller"
                 conn_port     = "sc_rst_o"
                 dangling      = "not ENABLE_SMI"
    />

    <!-- APB inputs -->
    <lsccip:port name          = "apb_penable_i"
                 dir           = "in"
                 conn_mod      = "lscc_i3c_controller"
                 conn_port     = "apb_penable_i"
                 stick_low     = "SEL_INTF != 'APB'"
                 bus_interface = "APB_S0"
    />

    <lsccip:port name          = "apb_psel_i"
                 dir           = "in"
                 conn_mod      = "lscc_i3c_controller"
                 conn_port     = "apb_psel_i"
                 stick_low     = "SEL_INTF != 'APB'"
                 bus_interface = "APB_S0"
    />

    <lsccip:port name          = "apb_pwrite_i"
                 dir           = "in"
                 conn_mod      = "lscc_i3c_controller"
                 conn_port     = "apb_pwrite_i"
                 stick_low     = "SEL_INTF != 'APB'"
                 bus_interface = "APB_S0"
    />

    <lsccip:port name          = "apb_paddr_i"
                 dir           = "in"
                 conn_mod      = "lscc_i3c_controller"
                 conn_port     = "apb_paddr_i"
                 range         = "(31, 0)"
                 stick_low     = "SEL_INTF != 'APB'"
                 bus_interface = "APB_S0"
    />

    <lsccip:port name          = "apb_pwdata_i"
                 dir           = "in"
                 conn_mod      = "lscc_i3c_controller"
                 conn_port     = "apb_pwdata_i"
                 range         = "(31, 0)"
                 stick_low     = "SEL_INTF != 'APB'"
                 bus_interface = "APB_S0"
    />

    <!-- APB outputs -->
    <lsccip:port name          = "apb_pready_o"
                 dir           = "out"
                 conn_mod      = "lscc_i3c_controller"
                 conn_port     = "apb_pready_o"
                 dangling      = "SEL_INTF != 'APB'"
                 bus_interface = "APB_S0"
    />

    <lsccip:port name          = "apb_pslverr_o"
                 dir           = "out"
                 conn_mod      = "lscc_i3c_controller"
                 conn_port     = "apb_pslverr_o"
                 dangling      = "SEL_INTF != 'APB'"
                 bus_interface = "APB_S0"
    />

    <lsccip:port name          = "apb_prdata_o"
                 dir           = "out"
                 conn_mod      = "lscc_i3c_controller"
                 conn_port     = "apb_prdata_o"
                 range         = "(31, 0)"
                 dangling      = "SEL_INTF != 'APB'"
                 bus_interface = "APB_S0"
    />

    <!--AHB-Lite inputs-->
    <lsccip:port name          = "ahbl_hsel_i"
                 dir           = "in"
                 conn_mod      = "lscc_i3c_controller"
                 conn_port     = "ahbl_hsel_i"
                 stick_low     = "SEL_INTF != 'AHBL'"
                 bus_interface = "AHBL_S0"
    />

    <lsccip:port name          = "ahbl_hready_i"
                 dir           = "in"
                 conn_mod      = "lscc_i3c_controller"
                 conn_port     = "ahbl_hready_i"
                 stick_low     = "SEL_INTF != 'AHBL'"
                 bus_interface = "AHBL_S0"
    />

    <lsccip:port name          = "ahbl_haddr_i"
                 dir           = "in"
                 conn_mod      = "lscc_i3c_controller"
                 conn_port     = "ahbl_haddr_i"
                 range         = "(31, 0)"
                 stick_low     = "SEL_INTF != 'AHBL'"
                 bus_interface = "AHBL_S0"
    />

    <lsccip:port name          = "ahbl_hburst_i"
                 dir           = "in"
                 conn_mod      = "lscc_i3c_controller"
                 conn_port     = "ahbl_hburst_i"
                 range         = "(2, 0)"
                 stick_low     = "SEL_INTF != 'AHBL'"
                 bus_interface = "AHBL_S0"
    />

    <lsccip:port name          = "ahbl_hsize_i"
                 dir           = "in"
                 conn_mod      = "lscc_i3c_controller"
                 conn_port     = "ahbl_hsize_i"
                 range         = "(2, 0)"
                 stick_low     = "SEL_INTF != 'AHBL'"
                 bus_interface = "AHBL_S0"
    />

    <lsccip:port name          = "ahbl_hmastlock_i"
                 dir           = "in"
                 conn_mod      = "lscc_i3c_controller"
                 conn_port     = "ahbl_hmastlock_i"
                 stick_low     = "SEL_INTF != 'AHBL'"
                 bus_interface = "AHBL_S0"
    />

    <lsccip:port name          = "ahbl_hprot_i"
                 dir           = "in"
                 conn_mod      = "lscc_i3c_controller"
                 conn_port     = "ahbl_hprot_i"
                 range         = "(3, 0)"
                 stick_low     = "SEL_INTF != 'AHBL'"
                 bus_interface = "AHBL_S0"
    />

    <lsccip:port name          = "ahbl_htrans_i"
                 dir           = "in"
                 conn_mod      = "lscc_i3c_controller"
                 conn_port     = "ahbl_htrans_i"
                 range         = "(1, 0)"
                 stick_low     = "SEL_INTF != 'AHBL'"
                 bus_interface = "AHBL_S0"
    />

    <lsccip:port name          = "ahbl_hwrite_i"
                 dir           = "in"
                 conn_mod      = "lscc_i3c_controller"
                 conn_port     = "ahbl_hwrite_i"
                 stick_low     = "SEL_INTF != 'AHBL'"
                 bus_interface = "AHBL_S0"
    />

    <lsccip:port name          = "ahbl_hwdata_i"
                 dir           = "in"
                 conn_mod      = "lscc_i3c_controller"
                 conn_port     = "ahbl_hwdata_i"
                 range         = "(31, 0)"
                 stick_low     = "SEL_INTF != 'AHBL'"
                 bus_interface = "AHBL_S0"
    />

    <!--AHB-Lite outputs-->
    <lsccip:port name          = "ahbl_hreadyout_o"
                 dir           = "out"
                 conn_mod      = "lscc_i3c_controller"
                 conn_port     = "ahbl_hreadyout_o"
                 dangling      = "SEL_INTF != 'AHBL'"
                 bus_interface = "AHBL_S0"
    />

    <lsccip:port name          = "ahbl_hresp_o"
                 dir           = "out"
                 conn_mod      = "lscc_i3c_controller"
                 conn_port     = "ahbl_hresp_o"
                 dangling      = "SEL_INTF != 'AHBL'"
                 bus_interface = "AHBL_S0"
    />

    <lsccip:port name          = "ahbl_hrdata_o"
                 dir           = "out"
                 conn_mod      = "lscc_i3c_controller"
                 conn_port     = "ahbl_hrdata_o"
                 range         = "(31, 0)"
                 dangling      = "SEL_INTF != 'AHBL'"
                 bus_interface = "AHBL_S0"
    />

    <!--FIFO Interface-->
    <lsccip:port name          = "tx_valid_i"
                 dir           = "in"
                 conn_mod      = "lscc_i3c_controller"
                 conn_port     = "tx_valid_i"
                 range         = "((TXDWID//8)-1, 0)"
                 stick_low     = "not EN_FIFOINTF"
                 bus_interface = "FIFO_INTF"
    />

    <lsccip:port name          = "tx_data_i"
                 dir           = "in"
                 conn_mod      = "lscc_i3c_controller"
                 conn_port     = "tx_data_i"
                 range         = "(TXDWID-1, 0)"
                 stick_low     = "not EN_FIFOINTF"
                 bus_interface = "FIFO_INTF"
    />

    <lsccip:port name          = "rx_ready_i"
                 dir           = "in"
                 conn_mod      = "lscc_i3c_controller"
                 conn_port     = "rx_ready_i"
                 stick_low     = "not EN_FIFOINTF"
                 bus_interface = "FIFO_INTF"
    />

    <lsccip:port name          = "tx_ready_o"
                 dir           = "out"
                 conn_mod      = "lscc_i3c_controller"
                 conn_port     = "tx_ready_o"
                 dangling      = "not EN_FIFOINTF"
                 bus_interface = "FIFO_INTF"
    />

    <lsccip:port name          = "rx_valid_o"
                 dir           = "out"
                 conn_mod      = "lscc_i3c_controller"
                 conn_port     = "rx_valid_o"
                 range         = "((RXDWID//8)-1, 0)"
                 dangling      = "not EN_FIFOINTF"
                 bus_interface = "FIFO_INTF"
    />

    <lsccip:port name          = "rx_data_o"
                 dir           = "out"
                 conn_mod      = "lscc_i3c_controller"
                 conn_port     = "rx_data_o"
                 range         = "(RXDWID-1, 0)"
                 dangling      = "not EN_FIFOINTF"
                 bus_interface = "FIFO_INTF"
    />

    <!--external IO-->
    <lsccip:port name       = "ext_io_sda_i"
                 dir        = "in"
                 conn_mod   = "lscc_i3c_controller"
                 conn_port  = "ext_io_sda_i"
                 stick_high = "ENABLE_IO_PRIMITIVE"
    />

    <lsccip:port name       = "ext_io_scl_i"
                 dir        = "in"
                 conn_mod   = "lscc_i3c_controller"
                 conn_port  = "ext_io_scl_i"
                 stick_high = "ENABLE_IO_PRIMITIVE"
    />

    <lsccip:port name       = "ext_io_sda_o"
                 dir        = "out"
                 conn_mod   = "lscc_i3c_controller"
                 conn_port  = "ext_io_sda_o"
                 dangling   = "ENABLE_IO_PRIMITIVE"
    />

    <lsccip:port name       = "ext_io_scl_o"
                 dir        = "out"
                 conn_mod   = "lscc_i3c_controller"
                 conn_port  = "ext_io_scl_o"
                 dangling   = "ENABLE_IO_PRIMITIVE"
    />

    <lsccip:port name       = "ext_io_sda_oe"
                 dir        = "out"
                 conn_mod   = "lscc_i3c_controller"
                 conn_port  = "ext_io_sda_oe"
                 dangling   = "ENABLE_IO_PRIMITIVE"
    />

    <lsccip:port name       = "ext_io_scl_oe"
                 dir        = "out"
                 conn_mod   = "lscc_i3c_controller"
                 conn_port  = "ext_io_scl_oe"
                 dangling   = "ENABLE_IO_PRIMITIVE"
    />

    <lsccip:port name       = "ext_io_sda_spu_n"
                 dir        = "out"
                 conn_mod   = "lscc_i3c_controller"
                 conn_port  = "ext_io_sda_spu_n"
                 dangling   = "ENABLE_IO_PRIMITIVE"
    />

    <lsccip:port name       = "ext_io_scl_spu_n"
                 dir        = "out"
                 conn_mod   = "lscc_i3c_controller"
                 conn_port  = "ext_io_scl_spu_n"
                 dangling   = "ENABLE_IO_PRIMITIVE"
    />

    <lsccip:port name       = "ext_io_sda_wpu_n"
                 dir        = "out"
                 conn_mod   = "lscc_i3c_controller"
                 conn_port  = "ext_io_sda_wpu_n"
                 dangling   = "ENABLE_IO_PRIMITIVE"
    />

    <lsccip:port name       = "ext_io_scl_wpu_n"
                 dir        = "out"
                 conn_mod   = "lscc_i3c_controller"
                 conn_port  = "ext_io_scl_wpu_n"
                 dangling   = "ENABLE_IO_PRIMITIVE"
    />



  </lsccip:ports>

  <xi:include href="bus_interface.xml" parse="xml" />
  <xi:include href="memory_map.xml" parse="xml" />

  <lsccip:componentGenerators>
    <lsccip:componentGenerator>
      <lsccip:name>create_constraint_file</lsccip:name>
      <lsccip:generatorExe>eval/create_constraint.py</lsccip:generatorExe>
    </lsccip:componentGenerator>
  </lsccip:componentGenerators>


</lsccip:ip>
