1<?xml version="1.0" encoding="utf-8"?> 2 3 4<!--**************************************************************************** 5* \file hfclk.cypersonality 6* \version 3.0 7* 8* \brief 9* CLK_HF personality description file. It Supports CAT1A, CAT1B and CAT1C family of devices. 10* 11******************************************************************************** 12* \copyright 13* Copyright 2022 Cypress Semiconductor Corporation 14* SPDX-License-Identifier: Apache-2.0 15* 16* Licensed under the Apache License, Version 2.0 (the "License"); 17* you may not use this file except in compliance with the License. 18* You may obtain a copy of the License at 19* 20* http://www.apache.org/licenses/LICENSE-2.0 21* 22* Unless required by applicable law or agreed to in writing, software 23* distributed under the License is distributed on an "AS IS" BASIS, 24* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 25* See the License for the specific language governing permissions and 26* limitations under the License. 27*****************************************************************************--> 28 29<Personality id="hfclk" name="CLK_HF" version="3.0" xmlns="http://cypress.com/xsd/cyhwpersonality_v7"> 30 <Dependencies> 31 <IpBlock name="mxs40srss,mxs40ssrss,mxs40srss_ver3" /> 32 <Resource name="srss\.clock\.hfclk" /> 33 </Dependencies> 34 <ExposedMembers> 35 <ExposedMember key="frequency" paramId="frequency" /> 36 <ExposedMember key="accuracy" paramId="accuracy" /> 37 <ExposedMember key="error" paramId="error" /> 38 </ExposedMembers> 39 <Parameters> 40 <!-- PDL documentation --> 41 <ParamDoc id="pdlDoc" name="Configuration Help" group="Overview" default="file:///`${cy_libs_path()}`/docs/pdl_api_reference_manual/html/group__group__sysclk__clk__hf.html" linkText="Open High-Frequency Clocks Documentation" visible="true" desc="Opens the Peripheral Driver Library Documentation" /> 42 43 <ParamRange id="clockInst" name="clockInst" group="Internal" default="`${getInstNumber("hfclk")}`" min="0" max="`${NUM_HFROOT-1}`" resolution="1" visible="false" editable="false" desc="" /> 44 <ParamChoice id="sourceClockNumber" name="Source Clock" group="General" default="0" visible="true" editable="true" desc="The clock source for CLK_HF`${clockInst}`"> 45 <Entry name="CLK_PATH0" value="0" visible="`${NUM_CLKPATH >= 1}`"/> 46 <Entry name="CLK_PATH1" value="1" visible="`${NUM_CLKPATH >= 2}`"/> 47 <Entry name="CLK_PATH2" value="2" visible="`${NUM_CLKPATH >= 3}`"/> 48 <Entry name="CLK_PATH3" value="3" visible="`${NUM_CLKPATH >= 4}`"/> 49 <Entry name="CLK_PATH4" value="4" visible="`${NUM_CLKPATH >= 5}`"/> 50 <Entry name="CLK_PATH5" value="5" visible="`${NUM_CLKPATH >= 6}`"/> 51 <Entry name="CLK_PATH6" value="6" visible="`${NUM_CLKPATH >= 7}`"/> 52 <Entry name="CLK_PATH7" value="7" visible="`${NUM_CLKPATH >= 8}`"/> 53 <Entry name="CLK_PATH8" value="8" visible="`${NUM_CLKPATH >= 9}`"/> 54 <Entry name="CLK_PATH9" value="9" visible="`${NUM_CLKPATH >= 10}`"/> 55 <Entry name="CLK_PATH10" value="10" visible="`${NUM_CLKPATH >= 11}`"/> 56 <Entry name="CLK_PATH11" value="11" visible="`${NUM_CLKPATH >= 12}`"/> 57 <Entry name="CLK_PATH12" value="12" visible="`${NUM_CLKPATH >= 13}`"/> 58 <Entry name="CLK_PATH13" value="13" visible="`${NUM_CLKPATH >= 14}`"/> 59 <Entry name="CLK_PATH14" value="14" visible="`${NUM_CLKPATH >= 15}`"/> 60 <Entry name="CLK_PATH15" value="15" visible="`${NUM_CLKPATH >= 16}`"/> 61 </ParamChoice> 62 63 <!-- If the FLL/PLL are enabled, their output drive the corresponding clock path --> 64 65 <ParamBool id="isFllUsed" name="Is FLL Used" group="Internal" default="`${(sourceClockNumber eq 0) && isBlockUsed("srss[0].clock[0].fll[0]")}`" visible="false" editable="false" desc="" /> 66 67 <ParamBool id="isPll400mUsed" name="Is PLL-400MHz Used" group="Internal" default="`${(("mxs40srss_ver3" eq getIpBlockName())) && ((sourceClockNumber > 0) && (sourceClockNumber <= NUM_PLL400M) && isBlockUsed("srss[0].clock[0].pll400m[" . (sourceClockNumber-1) . "]"))}`" visible="false" editable="false" desc="" /> 68 69 <ParamBool id="isPllUsed" name="Is PLL Used" group="Internal" default="`${ ("mxs40ssrss" eq getIpBlockName()) ? 0 : (("mxs40srss" eq getIpBlockName()) ? (sourceClockNumber > 0) && (sourceClockNumber <= NUM_PLL) && isBlockUsed("srss[0].clock[0].pll[" . (sourceClockNumber-1) . "]") : (sourceClockNumber > NUM_PLL) && (sourceClockNumber <= (NUM_PLL + NUM_PLL400M)) && isBlockUsed("srss[0].clock[0].pll[" . (sourceClockNumber-3) . "]")) }`" visible="false" editable="false" desc="" /> 70 71 <ParamBool id="isPll250mUsed" name="Is PLL-250MHz Used" group="Internal" default="`${("mxs40ssrss" eq getIpBlockName()) ? (NUM_TOTAL_PLL ne 0 ? ((sourceClockNumber ne 0 && sourceClockNumber <= NUM_DPLL250) && isBlockUsed("srss[0].clock[0].pll250m[" . (sourceClockNumber - 1 ) . "]")) : false) : false}`" visible="false" editable="false" desc="" /> 72 73 <ParamString id="sourceClock" name="Source clock resource" group="Internal" default="`${isFllUsed ? "fll[0]" : 74 isPll400mUsed ? "pll400m[" . (sourceClockNumber-1) . "]" : 75 isPllUsed && ("mxs40srss" eq getIpBlockName()) ? "pll[" . (sourceClockNumber-1) . "]" : 76 isPll250mUsed && ("mxs40ssrss" eq getIpBlockName()) ? "pll[" . (sourceClockNumber-1) . "]" : 77 isPllUsed && ("mxs40srss_ver3" eq getIpBlockName()) ? "pll[" . (sourceClockNumber-(NUM_PLL+1)) . "]" : 78 "pathmux[" . sourceClockNumber . "]"}`" visible="false" editable="false" desc="" /> 79 80 <ParamString id="sourceClockRsc" name="Source Clock" group="Internal" default="srss[0].clock[0].`${sourceClock}`" visible="false" editable="false" desc="" /> 81 82 <!-- Set an error if the source clock is not enabled or contains an error --> 83 <ParamBool id="srcNotUsed" name="Clock Source Enabled" group="Internal" default="`${!isBlockUsed(sourceClockRsc)}`" visible="false" editable="false" desc="" /> 84 <ParamBool id="error" name="Clock Error" group="Internal" default="`${srcNotUsed || getExposedMember(sourceClockRsc, "error")}`" visible="false" editable="false" desc="" /> 85 <ParamRange id="sourceFreq" name="sourceFrequency" group="Internal" default="`${!error ? getExposedMember(sourceClockRsc, "frequency") : 0}`" min="0" max="400000000" resolution="0.001" visible="false" editable="false" desc="" /> 86 <ParamString id="accuracy" name="accuracy" group="Internal" default="`${!error ? getExposedMember(sourceClockRsc, "accuracy") : 0}`" visible="false" editable="false" desc="" /> 87 <ParamString id="sourceFrequencyInfo" name="Source Frequency" group="General" default="`${formatFrequency(sourceFreq,accuracy)}`" visible="true" editable="false" desc="Source clock frequency" /> 88 89 90 <ParamChoice id="divider" name="Divider" group="General" default="1" visible="true" editable="true" desc="The source clock frequency divider"> 91 <Entry name="1" value="1" visible="true"/> 92 <Entry name="2" value="2" visible="true"/> 93 <Entry name="3" value="3" visible="`${("mxs40ssrss" eq getIpBlockName()) ? (NUM_TOTAL_PLL ne 0 ? true : false) : false}`"/> 94 <Entry name="4" value="4" visible="true"/> 95 <Entry name="5" value="5" visible="`${("mxs40ssrss" eq getIpBlockName()) ? (NUM_TOTAL_PLL ne 0 ? true : false) : false}`"/> 96 <Entry name="6" value="6" visible="`${("mxs40ssrss" eq getIpBlockName()) ? (NUM_TOTAL_PLL ne 0 ? true : false) : false}`"/> 97 <Entry name="7" value="7" visible="`${("mxs40ssrss" eq getIpBlockName()) ? (NUM_TOTAL_PLL ne 0 ? true : false) : false}`"/> 98 <Entry name="8" value="8" visible="true"/> 99 <Entry name="9" value="9" visible="`${("mxs40ssrss" eq getIpBlockName()) ? (NUM_TOTAL_PLL ne 0 ? true : false) : false}`"/> 100 <Entry name="10" value="10" visible="`${("mxs40ssrss" eq getIpBlockName()) ? (NUM_TOTAL_PLL ne 0 ? true : false) : false}`"/> 101 <Entry name="11" value="11" visible="`${("mxs40ssrss" eq getIpBlockName()) ? (NUM_TOTAL_PLL ne 0 ? true : false) : false}`"/> 102 <Entry name="12" value="12" visible="`${("mxs40ssrss" eq getIpBlockName()) ? (NUM_TOTAL_PLL ne 0 ? true : false) : false}`"/> 103 <Entry name="13" value="13" visible="`${("mxs40ssrss" eq getIpBlockName()) ? (NUM_TOTAL_PLL ne 0 ? true : false) : false}`"/> 104 <Entry name="14" value="14" visible="`${("mxs40ssrss" eq getIpBlockName()) ? (NUM_TOTAL_PLL ne 0 ? true : false) : false}`"/> 105 <Entry name="15" value="15" visible="`${("mxs40ssrss" eq getIpBlockName()) ? (NUM_TOTAL_PLL ne 0 ? true : false) : false}`"/> 106 <Entry name="16" value="16" visible="`${("mxs40ssrss" eq getIpBlockName()) ? (NUM_TOTAL_PLL ne 0 ? true : false) : false}`"/> 107 </ParamChoice> 108 <ParamRange id="frequency" name="Frequency" group="Internal" default="`${sourceFreq / divider}`" min="0" max="400000000" resolution="1" visible="false" editable="false" desc="" /> 109 <!-- If the frequency is less than one MHz, display its value in kHz --> 110 <ParamString id="frequencyInfo" name="Frequency" group="General" default="`${formatFrequency(frequency,accuracy)}`" visible="true" editable="false" desc="The resulting CLK_HF`${clockInst}` output clock frequency" /> 111 <ParamSignal port="root_clk[0]" name="Clock Output" group="General" visible="`${hasVisibleOption("root_clk[0]")}`" desc="A high-frequency clock output driving specific peripherals" canBeEmpty="true" > 112 <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" > 113 <Parameter id="DriveModes" severity="DEFAULT" reason=""> 114 <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" /> 115 </Parameter> 116 </Constraint> 117 <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" > 118 <Parameter id="DriveModes" severity="WARNING" reason=""> 119 <Choice> 120 <Option value="CY_GPIO_DM_STRONG_IN_OFF"/> 121 <Option value="CY_GPIO_DM_STRONG"/> 122 <Option value="CY_GPIO_DM_OD_DRIVESLOW_IN_OFF"/> 123 <Option value="CY_GPIO_DM_OD_DRIVESHIGH_IN_OFF"/> 124 <Option value="CY_GPIO_DM_OD_DRIVESLOW"/> 125 <Option value="CY_GPIO_DM_OD_DRIVESHIGH"/> 126 <Option value="CY_GPIO_DM_PULLUP_IN_OFF"/> 127 <Option value="CY_GPIO_DM_PULLDOWN_IN_OFF"/> 128 <Option value="CY_GPIO_DM_PULLUP_DOWN_IN_OFF"/> 129 <Option value="CY_GPIO_DM_PULLUP"/> 130 <Option value="CY_GPIO_DM_PULLDOWN"/> 131 <Option value="CY_GPIO_DM_PULLUP_DOWN"/> 132 </Choice> 133 </Parameter> 134 </Constraint> 135 <!--Constraint type="REQUIRE" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" > 136 <Parameter id="DriveModes" severity="ERROR" reason=""> 137 <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" /> 138 </Parameter> 139 </Constraint--> 140 <Constraint type="ACCEPT" targetLocation=".*" valid="true" /> 141 </ParamSignal> 142 </Parameters> 143 <DRCs> 144 <DRC type="ERROR" text="Source clock for CLK_HF`${clockInst}` is not enabled" condition="`${srcNotUsed}`" > 145 <FixIt action="ENABLE_BLOCK" target="`${sourceClockRsc}`" value="" valid="true" /> 146 </DRC> 147 <DRC type="ERROR" text="CLK_HF0 is slower than legal min 200 kHz." condition="`${!error && ((clockInst == 0) && (sourceFreq < 200000))}`" /> 148 <DRC type="INFO" text="The top-level System Clocks must be enabled to generate the clock initialization code" condition="`${!isBlockUsed("srss[0].clock[0]") && clockInst == 0}`" location="srss[0].clock[0]" > 149 <FixIt action="ENABLE_BLOCK" target="srss[0].clock[0]" value="" valid="true" /> 150 </DRC> 151 <!-- Generate a DRC from HFCLK0 that prevents IMO from being disabled --> 152 <DRC type="ERROR" text="The IMO cannot be disabled." condition="`${(clockInst eq 0) && !isBlockUsed("srss[0].clock[0].imo[0]")}`" location="srss[0].clock[0]"> 153 <FixIt action="ENABLE_BLOCK" target="srss[0].clock[0].imo[0]" value="" valid="true" /> 154 </DRC> 155 <DRC type="ERROR" text="CLK_HF2 should be equal to 48MHz." condition="`${((clockInst == 2) && (frequency ne 48000000) && ("mxs40ssrss" eq getIpBlockName()) && NUM_TOTAL_PLL eq 0)}`" /> 156 <DRC type="ERROR" text="CLK_HF3 should be less than 24MHz." condition="`${((clockInst == 3) && (frequency > 24000000) && ("mxs40ssrss" eq getIpBlockName()))}`" /> 157 <!--DRC type="ERROR" text="Only one connection between the clock system and GPIO pins is possible, either EXTCLK or CLK_HF4." condition="`${hasConnection("root_clk", 0) && isBlockUsed("srss[0].clock[0].ext[0]")}`" /--> 158 </DRCs> 159 <ConfigFirmware> 160 <ConfigInclude value="cy_sysclk.h" include="true" /> 161 <ConfigDefine name="CY_CFG_SYSCLK_CLKHF`${clockInst}`_ENABLED" public="false" value="1" include="true" /> 162 <ConfigDefine name="CY_CFG_SYSCLK_CLKHF`${clockInst}`_DIVIDER" public="false" value="CY_SYSCLK_CLKHF_`${divider == 1 ? "NO_DIVIDE" : (("DIVIDE_BY_") . divider)}`" include="true" /> 163 <ConfigDefine name="CY_CFG_SYSCLK_CLKHF`${clockInst}`" public="true" value="`${clockInst}`UL" include="true" /> 164 <ConfigDefine name="CY_CFG_SYSCLK_CLKHF`${clockInst}`_FREQ_MHZ" public="false" value="`${frequency / 1000000}`UL" include="true" /> 165 <ConfigDefine name="CY_CFG_SYSCLK_CLKHF`${clockInst}`_CLKPATH" public="false" value="CY_SYSCLK_CLKHF_IN_CLKPATH`${sourceClockNumber}`" include="true" /> 166 <ConfigDefine name="CY_CFG_SYSCLK_CLKHF`${clockInst}`_CLKPATH_NUM" public="true" value="`${sourceClockNumber}`UL" include="true" /> 167 168 <ConfigFunction signature="__STATIC_INLINE void Cy_SysClk_ClkHf`${clockInst}`Init()" body=" Cy_SysClk_ClkHfSetSource(`${clockInst}`U, CY_CFG_SYSCLK_CLKHF`${clockInst}`_CLKPATH);
 Cy_SysClk_ClkHfSetDivider(`${clockInst}`U, CY_SYSCLK_CLKHF_`${divider == 1 ? "NO_DIVIDE" : (("DIVIDE_BY_") . divider)}`);
 Cy_SysClk_ClkHfDirectSel(CY_CFG_SYSCLK_CLKHF`${clockInst}`, false);" public="false" include="`${("mxs40srss_ver3" eq getIpBlockName()) && (clockInst eq 0)}`" /> 169 170 <ConfigFunction signature="__STATIC_INLINE void Cy_SysClk_ClkHf`${clockInst}`Init()" body=" Cy_SysClk_ClkHfSetSource(CY_CFG_SYSCLK_CLKHF`${clockInst}`, CY_CFG_SYSCLK_CLKHF`${clockInst}`_CLKPATH);
 Cy_SysClk_ClkHfSetDivider(CY_CFG_SYSCLK_CLKHF`${clockInst}`, CY_SYSCLK_CLKHF_`${divider == 1 ? "NO_DIVIDE" : (("DIVIDE_BY_") . divider)}`);
 Cy_SysClk_ClkHfDirectSel(CY_CFG_SYSCLK_CLKHF`${clockInst}`, false);
 Cy_SysClk_ClkHfEnable(CY_CFG_SYSCLK_CLKHF`${clockInst}`);" public="false" include="`${("mxs40srss_ver3" eq getIpBlockName()) && (clockInst gt 0)}`" /> 171 172 <ConfigFunction signature="__STATIC_INLINE void Cy_SysClk_ClkHf`${clockInst}`Init()" body=" Cy_SysClk_ClkHfSetSource(`${clockInst}`U, CY_CFG_SYSCLK_CLKHF`${clockInst}`_CLKPATH);
 Cy_SysClk_ClkHfSetDivider(`${clockInst}`U, CY_SYSCLK_CLKHF_`${divider == 1 ? "NO_DIVIDE" : (("DIVIDE_BY_") . divider)}`);" public="false" include="`${("mxs40srss_ver3" ne getIpBlockName()) && (clockInst eq 0)}`" guard="(!defined(CY_DEVICE_SECURE))"/> 173 174 <ConfigFunction signature="__STATIC_INLINE void Cy_SysClk_ClkHf`${clockInst}`Init()" body=" Cy_SysClk_ClkHfSetSource(CY_CFG_SYSCLK_CLKHF`${clockInst}`, CY_CFG_SYSCLK_CLKHF`${clockInst}`_CLKPATH);
 Cy_SysClk_ClkHfSetDivider(CY_CFG_SYSCLK_CLKHF`${clockInst}`, CY_SYSCLK_CLKHF_`${divider == 1 ? "NO_DIVIDE" : (("DIVIDE_BY_") . divider)}`);
 Cy_SysClk_ClkHfEnable(CY_CFG_SYSCLK_CLKHF`${clockInst}`);" public="false" include="`${("mxs40srss_ver3" ne getIpBlockName()) && (clockInst gt 0)}`" guard="(!defined(CY_DEVICE_SECURE))"/> 175 176 </ConfigFirmware> 177</Personality> 178