1<?xml version="1.0" encoding="utf-8"?>
2
3
4<!--****************************************************************************
5* \file pathmux.cypersonality
6* \version 3.0
7*
8* \brief
9* PATH_MUX personality description file. It supports CAT1A, CAT1B, CAT1C and
10* CAT1D devices.
11*
12********************************************************************************
13* \copyright
14* Copyright 2022 Cypress Semiconductor Corporation
15* SPDX-License-Identifier: Apache-2.0
16*
17* Licensed under the Apache License, Version 2.0 (the "License");
18* you may not use this file except in compliance with the License.
19* You may obtain a copy of the License at
20*
21*     http://www.apache.org/licenses/LICENSE-2.0
22*
23* Unless required by applicable law or agreed to in writing, software
24* distributed under the License is distributed on an "AS IS" BASIS,
25* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
26* See the License for the specific language governing permissions and
27* limitations under the License.
28*****************************************************************************-->
29
30<Personality id="pathmux" name="PATH_MUX" version="3.0" xmlns="http://cypress.com/xsd/cyhwpersonality_v7">
31  <Dependencies>
32    <IpBlock name="mxs40srss,mxs40ssrss,mxs40srss_ver3,mxs22srss" />
33    <Resource name="srss\.clock\.pathmux" />
34  </Dependencies>
35  <ExposedMembers>
36    <ExposedMember key="frequency"     paramId="frequency" />
37    <ExposedMember key="accuracy"      paramId="accuracy" />
38    <ExposedMember key="sourceClock"   paramId="sourceClock" />
39    <ExposedMember key="error"         paramId="error" />
40  </ExposedMembers>
41  <Parameters>
42    <!-- PDL documentation -->
43    <ParamDoc id="pdlDoc" name="Configuration Help" group="Overview" default="file:///`${cy_libs_path()}`/docs/pdl_api_reference_manual/html/group__group__sysclk__path__src.html" linkText="Open Clock Path Source Documentation" visible="true" desc="Opens the Peripheral Driver Library Documentation" />
44
45    <ParamString id="isECOPresent" name="ECO Present" group="Internal" default="`${lookupExpression(&quot;ECO_PRESENT&quot;, 0)}`" visible="false" editable="false" desc="ECO Present" />
46    <ParamString id="isWCOPresent" name="WCO Present" group="Internal" default="`${lookupExpression(&quot;WCO_PRESENT&quot;, 0)}`" visible="false" editable="false" desc="WCO Present" />
47    <ParamString id="isILOPresent" name="ILO Present" group="Internal" default="`${lookupExpression(&quot;ILO_PRESENT&quot;, 0)}`" visible="false" editable="false" desc="ILO Present" />
48    <ParamString id="isPILOPresent" name="PILO Present" group="Internal" default="`${lookupExpression(&quot;PILO_PRESENT&quot;, 0)}`" visible="false" editable="false" desc="PILO Present" />
49    <ParamString id="isALTHFPresent" name="ALTHF Present" group="Internal" default="`${lookupExpression(&quot;ALTHF_PRESENT&quot;, 0)}`" visible="false" editable="false" desc="ALTHF Present" />
50    <ParamString id="isChipTopALTHFPresent" name="CHIP_TOP.ALTHF Present" group="Internal" default="`${lookupExpression(&quot;CHIP_TOP.ALTHF_PRESENT&quot;, 0)}`" visible="false" editable="false" desc="CHIP_TOP.ALTHF Present" />
51
52    <ParamRange id="clockInst" name="CLK_PATH Instance" group="Internal" default="`${getInstNumber(&quot;pathmux&quot;)}`" min="0" max="`${NUM_CLKPATH-1}`" resolution="1" visible="false" editable="false" desc="" />
53    <ParamChoice id="sourceClock" name="Source Clock" group="General" default="`${(&quot;mxs22srss&quot; eq getIpBlockName()) ? iho : imo}`" visible="true" editable="true" desc="The clock source for Clock Path `${clockInst}`">
54      <Entry name="IMO"    value="imo"    visible="`${(&quot;mxs40ssrss&quot; eq getIpBlockName()) || (&quot;mxs40srss&quot; eq getIpBlockName()) || (&quot;mxs40srss_ver3&quot; eq getIpBlockName())}`"/>
55      <Entry name="ECO"    value="eco"    visible="`${hasBlock(&quot;srss[0].clock[0].eco[0]&quot;)}`"/>
56      <Entry name="EXTCLK" value="ext"    visible="true"/>
57      <Entry name="ALTHF"  value="althf"  visible="`${(isALTHFPresent) || (isChipTopALTHFPresent)}`"/>
58      <Entry name="ILO"    value="ilo"    visible="`${(&quot;mxs40srss&quot; eq getIpBlockName()) || (isILOPresent)}`"/>
59      <Entry name="ILO0"   value="ilo0"   visible="`${(isILOPresent) || (&quot;mxs40srss_ver3&quot; eq getIpBlockName())}`"/>
60      <Entry name="ILO1"   value="ilo1"   visible="`${(isILOPresent) || (&quot;mxs40srss_ver3&quot; eq getIpBlockName())}`"/>
61      <Entry name="PILO"   value="pilo"   visible="`${isPILOPresent}`"/>
62      <Entry name="WCO"    value="wco"    visible="`${(&quot;mxs40srss&quot; eq getIpBlockName()) || (&quot;mxs40srss_ver3&quot; eq getIpBlockName()) || (isWCOPresent)}`"/>
63      <Entry name="IHO"    value="iho"    visible="`${(&quot;mxs40ssrss&quot; eq getIpBlockName()) || (&quot;mxs22srss&quot; eq getIpBlockName())}`"/>
64
65    </ParamChoice>
66    <ParamString id="sourceClockRsc" name="Source Clock Resource" group="Internal" default="`${sourceClock eq ilo1 ? &quot;srss[0].clock[0].&quot; . ilo . &quot;[1]&quot; : sourceClock eq ilo0 ? &quot;srss[0].clock[0].&quot; . ilo . &quot;[0]&quot; : &quot;srss[0].clock[0].&quot; . sourceClock . &quot;[0]&quot;}`" visible="false" editable="false" desc="" />
67    <ParamString id="sourceClockApiName" name="Source Clock Name" group="Internal" default="`${sourceClock eq imo      ? &quot;IMO&quot; :
68                                                                                               sourceClock eq eco      ? &quot;ECO&quot; :
69                                                                                               sourceClock eq ext      ? &quot;EXT&quot; :
70                                                                                               sourceClock eq althf    ? &quot;ALTHF&quot; :
71                                                                                               sourceClock eq ilo      ? &quot;ILO&quot; :
72                                                                                               sourceClock eq pilo     ? &quot;PILO&quot; :
73                                                                                               sourceClock eq iho      ? &quot;IHO&quot; :
74                                                                                               sourceClock eq wco      ? &quot;WCO&quot; :
75                                                                                                                         &quot;ILO1&quot;}`" visible="false" editable="false" desc="" />
76
77    <ParamString id="sourceClockNumber" name="Source Clock Number" group="Internal" default="`${sourceClock eq imo    ? 0 :
78                                                                                               sourceClock eq eco     ? 1 :
79                                                                                               sourceClock eq ext     ? 2 :
80                                                                                               sourceClock eq althf   ? 3 :
81                                                                                               sourceClock eq ilo     ? 4 :
82                                                                                               sourceClock eq pilo    ? 5 :
83                                                                                               sourceClock eq iho     ? 7 :
84                                                                                                                        6}`" visible="false" editable="false" desc="" />
85    <!-- Set an error if the source clock is not enabled -->
86    <ParamBool id="error" name="Clock Error" group="Internal" default="`${!isBlockUsed(sourceClockRsc)}`" visible="false" editable="false" desc="" />
87    <!-- Use default values in case of error -->
88    <ParamRange id="frequency" name="Frequency" group="Internal" default="`${!error ? getExposedMember(sourceClockRsc, &quot;frequency&quot;) : 0}`" min="0" max="100000000" resolution="1" visible="false" editable="false" desc="" />
89    <ParamString id="accuracy" name="accuracy" group="Internal" default="`${!error ? getExposedMember(sourceClockRsc, &quot;accuracy&quot;) : 0}`" visible="false" editable="false" desc="" />
90
91    <!-- If the frequency is less than one MHz, display its value in kHz -->
92    <ParamString id="frequencyInfo" name="Source Frequency" group="General" default="`${formatFrequency(frequency,accuracy)}`" visible="true" editable="false" desc="The Clock Path frequency provided by the chosen clock source" />
93  </Parameters>
94  <DRCs>
95    <DRC type="ERROR" text="Source clock for PATH_MUX`${clockInst}` is not enabled" condition="`${error}`" >
96      <FixIt action="ENABLE_BLOCK" target="`${sourceClockRsc}`" value="" valid="true" />
97    </DRC>
98  </DRCs>
99  <ConfigFirmware>
100    <ConfigInclude value="cy_sysclk.h" include="true" />
101    <ConfigInclude value="cyhal_hwmgr.h" include="true" guard="defined (CY_USING_HAL)" />
102    <ConfigDefine name="CY_CFG_SYSCLK_CLKPATH`${clockInst}`_ENABLED" value="1" public="false" include="true" />
103    <ConfigDefine name="CY_CFG_SYSCLK_CLKPATH`${clockInst}`_SOURCE" value="CY_SYSCLK_CLKPATH_IN_`${sourceClockApiName}`" public="false" include="true" />
104    <ConfigDefine name="CY_CFG_SYSCLK_CLKPATH`${clockInst}`_SOURCE_NUM" value="`${sourceClockNumber}`UL"  public="false" include="true" />
105
106    <ConfigStruct name="`${INST_NAME}`_obj" type="cyhal_resource_inst_t" const="true" public="true" include="true" guard="defined (CY_USING_HAL)">
107      <Member name="type" value="CYHAL_RSC_CLKPATH" />
108      <Member name="block_num" value="`${clockInst}`U" />
109      <Member name="channel_num" value="0U" />
110    </ConfigStruct>
111    <ConfigFunction signature="__STATIC_INLINE void Cy_SysClk_ClkPath`${clockInst}`Init()" body="    Cy_SysClk_ClkPathSetSource(`${clockInst}`U, CY_CFG_SYSCLK_CLKPATH`${clockInst}`_SOURCE);" public="false" include="true" guard="(!defined(CY_DEVICE_SECURE))" />
112    <ConfigInstruction value="cyhal_hwmgr_reserve(&amp;`${INST_NAME}`_obj);" include="true" guard="defined (CY_USING_HAL)" />
113  </ConfigFirmware>
114</Personality>
115