Update repo
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
<projectSpec>
|
||||
<project
|
||||
name="clb_empty"
|
||||
device="TMS320F28377D"
|
||||
products="sysconfig;C2000WARE"
|
||||
launchWizard="False"
|
||||
linkerCommandFile=""
|
||||
outputFormat="ELF"
|
||||
enableSysConfigTool="true"
|
||||
sysConfigBuildOptions="--product ${CLB_SYSCFG_ROOT}/.metadata/product.json --device F2837xD"
|
||||
>
|
||||
<configuration name="Debug" postBuildStep="mkdir "${BuildDirectory}/simulation"
|
||||
;${CLB_SIM_COMPILER}/g++ -c -DCLB_SIM -I${SYSTEMC_INSTALL}/src -I${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/include -I${PROJECT_ROOT} -I${CLB_SIM_COMPILER}/include -Og -g -gdwarf-3 -gstrict-dwarf -Wall -MMD -MP -MF${BuildDirectory}/simulation/clb_sim.d -MT${BuildDirectory}/simulation/clb_sim.o -I${BuildDirectory}/syscfg -fno-threadsafe-statics -o${BuildDirectory}/simulation/clb_sim.o ${BuildDirectory}/syscfg/clb_sim.cpp
|
||||
;${CLB_SIM_COMPILER}/g++ -DCLB_SIM -Og -g -gdwarf-3 -gstrict-dwarf -Wall -Wl,-Map,${BuildDirectory}/simulation/simulation_output.map -L${SYSTEMC_INSTALL}/build/src -o${BuildDirectory}/simulation/simulation_output.exe ${BuildDirectory}/simulation/clb_sim.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_FSM_SC_model.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_HLC_SC_model.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_LUT4_SC_model.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_OutputLUT_SC_model.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_counter_SC_model.o -Wl,--start-group -lsystemc -Wl,--end-group;./simulation/simulation_output.exe
|
||||
;${NODE_TOOL} "${CLB_SYSCFG_ROOT}/dot_file_libraries/clbDotUtility.js" "${CLB_SYSCFG_ROOT}" "${BuildDirectory}/syscfg" "${BuildDirectory}/syscfg/clb.dot""
|
||||
compilerBuildOptions="--opt_level=off --opt_for_speed=2 --fp_mode=strict -I${C2000WARE_DLIB_ROOT} -I${C2000WARE_DEVICESUPPORT_ROOT}/common/include -I${PROJECT_ROOT}/device -I${CLB_SYSCFG_ROOT}/systemc/include -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --define=CPU1 -g --diag_warning=225 --diag_wrap=off --display_error_number " linkerBuildOptions="--stack_size=0x200 -l driverlib.lib -l libc.a -I${C2000WARE_DLIB_ROOT}/ccs/Debug" />
|
||||
|
||||
<pathVariable name="C2000WARE_ROOT" path="../../../../../../" scope="project" />
|
||||
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../driverlib/" scope="project" />
|
||||
<pathVariable name="C2000WARE_DEVICESUPPORT_ROOT" path="../../../../../../device_support/F2837xD/" scope="project" />
|
||||
<pathVariable name="CLB_SYSCFG_ROOT" path="../../../../../../utilities/clb_tool/clb_syscfg/" scope="project" />
|
||||
<pathVariable name="SYSTEMC_INSTALL" path="../../../../../../utilities/clb_tool/clb_syscfg/systemc-2.3.3" scope="project" />
|
||||
<pathVariable name="CLB_SIM_COMPILER" path="C:/TDM-GCC-64/bin" scope="project" />
|
||||
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/targetConfigs/TMS320F28377D.ccxml" targetDirectory="targetConfigs" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/driverlib.h" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/device.h" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/device.c" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/cmd/2837xD_RAM_lnk_cpu1.cmd" targetDirectory=""/>
|
||||
<file action="copy" path="../../../../driverlib/" targetDirectory="device" excludeFromBuild="True" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/F2837xD_CodeStartBranch.asm" targetDirectory="device" />
|
||||
|
||||
<file action="copy" path="../empty.c" targetDirectory="" />
|
||||
<file action="copy" path="../empty.syscfg" targetDirectory="" />
|
||||
</project>
|
||||
</projectSpec>
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
<projectSpec>
|
||||
<project
|
||||
name="clb_ex10_timer_two_states"
|
||||
device="TMS320F28377D"
|
||||
products="sysconfig;C2000WARE"
|
||||
launchWizard="False"
|
||||
linkerCommandFile=""
|
||||
outputFormat="ELF"
|
||||
enableSysConfigTool="true"
|
||||
sysConfigBuildOptions="--product ${CLB_SYSCFG_ROOT}/.metadata/product.json --device F2837xD"
|
||||
>
|
||||
<configuration name="Debug" postBuildStep="mkdir "${BuildDirectory}/simulation"
|
||||
;${CLB_SIM_COMPILER}/g++ -c -DCLB_SIM -I${SYSTEMC_INSTALL}/src -I${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/include -I${PROJECT_ROOT} -I${CLB_SIM_COMPILER}/include -Og -g -gdwarf-3 -gstrict-dwarf -Wall -MMD -MP -MF${BuildDirectory}/simulation/clb_sim.d -MT${BuildDirectory}/simulation/clb_sim.o -I${BuildDirectory}/syscfg -fno-threadsafe-statics -o${BuildDirectory}/simulation/clb_sim.o ${BuildDirectory}/syscfg/clb_sim.cpp
|
||||
;${CLB_SIM_COMPILER}/g++ -DCLB_SIM -Og -g -gdwarf-3 -gstrict-dwarf -Wall -Wl,-Map,${BuildDirectory}/simulation/simulation_output.map -L${SYSTEMC_INSTALL}/build/src -o${BuildDirectory}/simulation/simulation_output.exe ${BuildDirectory}/simulation/clb_sim.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_FSM_SC_model.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_HLC_SC_model.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_LUT4_SC_model.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_OutputLUT_SC_model.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_counter_SC_model.o -Wl,--start-group -lsystemc -Wl,--end-group;./simulation/simulation_output.exe
|
||||
;${NODE_TOOL} "${CLB_SYSCFG_ROOT}/dot_file_libraries/clbDotUtility.js" "${CLB_SYSCFG_ROOT}" "${BuildDirectory}/syscfg" "${BuildDirectory}/syscfg/clb.dot""
|
||||
compilerBuildOptions="--opt_level=off --opt_for_speed=2 --fp_mode=strict -I${C2000WARE_DLIB_ROOT} -I${C2000WARE_DEVICESUPPORT_ROOT}/common/include -I${PROJECT_ROOT}/device -I${CLB_SYSCFG_ROOT}/systemc/include -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --define=CPU1 -g --diag_warning=225 --diag_wrap=off --display_error_number " linkerBuildOptions="--stack_size=0x200 -l driverlib.lib -l libc.a -I${C2000WARE_DLIB_ROOT}/ccs/Debug" />
|
||||
|
||||
<pathVariable name="C2000WARE_ROOT" path="../../../../../../" scope="project" />
|
||||
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../driverlib/" scope="project" />
|
||||
<pathVariable name="C2000WARE_DEVICESUPPORT_ROOT" path="../../../../../../device_support/F2837xD/" scope="project" />
|
||||
<pathVariable name="CLB_SYSCFG_ROOT" path="../../../../../../utilities/clb_tool/clb_syscfg/" scope="project" />
|
||||
<pathVariable name="SYSTEMC_INSTALL" path="../../../../../../utilities/clb_tool/clb_syscfg/systemc-2.3.3" scope="project" />
|
||||
<pathVariable name="CLB_SIM_COMPILER" path="C:/TDM-GCC-64/bin" scope="project" />
|
||||
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/targetConfigs/TMS320F28377D.ccxml" targetDirectory="targetConfigs" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/driverlib.h" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/device.h" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/device.c" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/cmd/2837xD_RAM_lnk_cpu1.cmd" targetDirectory=""/>
|
||||
<file action="copy" path="../../../../driverlib/" targetDirectory="device" excludeFromBuild="True" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/F2837xD_CodeStartBranch.asm" targetDirectory="device" />
|
||||
|
||||
<file action="copy" path="../clb_ex10_timer_two_states.c" targetDirectory="" />
|
||||
<file action="copy" path="../clb_ex10_timer_two_states.syscfg" targetDirectory="" />
|
||||
</project>
|
||||
</projectSpec>
|
||||
@@ -0,0 +1,36 @@
|
||||
<projectSpec>
|
||||
<project
|
||||
name="clb_ex11_interrupt_tag"
|
||||
device="TMS320F28377D"
|
||||
products="sysconfig;C2000WARE"
|
||||
launchWizard="False"
|
||||
linkerCommandFile=""
|
||||
outputFormat="ELF"
|
||||
enableSysConfigTool="true"
|
||||
sysConfigBuildOptions="--product ${CLB_SYSCFG_ROOT}/.metadata/product.json --device F2837xD"
|
||||
>
|
||||
<configuration name="Debug" postBuildStep="mkdir "${BuildDirectory}/simulation"
|
||||
;${CLB_SIM_COMPILER}/g++ -c -DCLB_SIM -I${SYSTEMC_INSTALL}/src -I${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/include -I${PROJECT_ROOT} -I${CLB_SIM_COMPILER}/include -Og -g -gdwarf-3 -gstrict-dwarf -Wall -MMD -MP -MF${BuildDirectory}/simulation/clb_sim.d -MT${BuildDirectory}/simulation/clb_sim.o -I${BuildDirectory}/syscfg -fno-threadsafe-statics -o${BuildDirectory}/simulation/clb_sim.o ${BuildDirectory}/syscfg/clb_sim.cpp
|
||||
;${CLB_SIM_COMPILER}/g++ -DCLB_SIM -Og -g -gdwarf-3 -gstrict-dwarf -Wall -Wl,-Map,${BuildDirectory}/simulation/simulation_output.map -L${SYSTEMC_INSTALL}/build/src -o${BuildDirectory}/simulation/simulation_output.exe ${BuildDirectory}/simulation/clb_sim.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_FSM_SC_model.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_HLC_SC_model.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_LUT4_SC_model.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_OutputLUT_SC_model.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_counter_SC_model.o -Wl,--start-group -lsystemc -Wl,--end-group;./simulation/simulation_output.exe
|
||||
;${NODE_TOOL} "${CLB_SYSCFG_ROOT}/dot_file_libraries/clbDotUtility.js" "${CLB_SYSCFG_ROOT}" "${BuildDirectory}/syscfg" "${BuildDirectory}/syscfg/clb.dot""
|
||||
compilerBuildOptions="--opt_level=off --opt_for_speed=2 --fp_mode=strict -I${C2000WARE_DLIB_ROOT} -I${C2000WARE_DEVICESUPPORT_ROOT}/common/include -I${PROJECT_ROOT}/device -I${CLB_SYSCFG_ROOT}/systemc/include -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --define=CPU1 -g --diag_warning=225 --diag_wrap=off --display_error_number " linkerBuildOptions="--stack_size=0x200 -l driverlib.lib -l libc.a -I${C2000WARE_DLIB_ROOT}/ccs/Debug" />
|
||||
|
||||
<pathVariable name="C2000WARE_ROOT" path="../../../../../../" scope="project" />
|
||||
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../driverlib/" scope="project" />
|
||||
<pathVariable name="C2000WARE_DEVICESUPPORT_ROOT" path="../../../../../../device_support/F2837xD/" scope="project" />
|
||||
<pathVariable name="CLB_SYSCFG_ROOT" path="../../../../../../utilities/clb_tool/clb_syscfg/" scope="project" />
|
||||
<pathVariable name="SYSTEMC_INSTALL" path="../../../../../../utilities/clb_tool/clb_syscfg/systemc-2.3.3" scope="project" />
|
||||
<pathVariable name="CLB_SIM_COMPILER" path="C:/TDM-GCC-64/bin" scope="project" />
|
||||
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/targetConfigs/TMS320F28377D.ccxml" targetDirectory="targetConfigs" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/driverlib.h" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/device.h" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/device.c" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/cmd/2837xD_RAM_lnk_cpu1.cmd" targetDirectory=""/>
|
||||
<file action="copy" path="../../../../driverlib/" targetDirectory="device" excludeFromBuild="True" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/F2837xD_CodeStartBranch.asm" targetDirectory="device" />
|
||||
|
||||
<file action="copy" path="../clb_ex11_interrupt_tag.c" targetDirectory="" />
|
||||
<file action="copy" path="../clb_ex11_interrupt_tag.syscfg" targetDirectory="" />
|
||||
</project>
|
||||
</projectSpec>
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
<projectSpec>
|
||||
<project
|
||||
name="clb_ex12_output_intersect"
|
||||
device="TMS320F28377D"
|
||||
products="sysconfig;C2000WARE"
|
||||
launchWizard="False"
|
||||
linkerCommandFile=""
|
||||
outputFormat="ELF"
|
||||
enableSysConfigTool="true"
|
||||
sysConfigBuildOptions="--product ${CLB_SYSCFG_ROOT}/.metadata/product.json --device F2837xD"
|
||||
>
|
||||
<configuration name="Debug" postBuildStep="mkdir "${BuildDirectory}/simulation"
|
||||
;${CLB_SIM_COMPILER}/g++ -c -DCLB_SIM -I${SYSTEMC_INSTALL}/src -I${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/include -I${PROJECT_ROOT} -I${CLB_SIM_COMPILER}/include -Og -g -gdwarf-3 -gstrict-dwarf -Wall -MMD -MP -MF${BuildDirectory}/simulation/clb_sim.d -MT${BuildDirectory}/simulation/clb_sim.o -I${BuildDirectory}/syscfg -fno-threadsafe-statics -o${BuildDirectory}/simulation/clb_sim.o ${BuildDirectory}/syscfg/clb_sim.cpp
|
||||
;${CLB_SIM_COMPILER}/g++ -DCLB_SIM -Og -g -gdwarf-3 -gstrict-dwarf -Wall -Wl,-Map,${BuildDirectory}/simulation/simulation_output.map -L${SYSTEMC_INSTALL}/build/src -o${BuildDirectory}/simulation/simulation_output.exe ${BuildDirectory}/simulation/clb_sim.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_FSM_SC_model.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_HLC_SC_model.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_LUT4_SC_model.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_OutputLUT_SC_model.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_counter_SC_model.o -Wl,--start-group -lsystemc -Wl,--end-group;./simulation/simulation_output.exe
|
||||
;${NODE_TOOL} "${CLB_SYSCFG_ROOT}/dot_file_libraries/clbDotUtility.js" "${CLB_SYSCFG_ROOT}" "${BuildDirectory}/syscfg" "${BuildDirectory}/syscfg/clb.dot""
|
||||
compilerBuildOptions="--opt_level=off --opt_for_speed=2 --fp_mode=strict -I${C2000WARE_DLIB_ROOT} -I${C2000WARE_DEVICESUPPORT_ROOT}/common/include -I${PROJECT_ROOT}/device -I${CLB_SYSCFG_ROOT}/systemc/include -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --define=CPU1 -g --diag_warning=225 --diag_wrap=off --display_error_number " linkerBuildOptions="--stack_size=0x200 -l driverlib.lib -l libc.a -I${C2000WARE_DLIB_ROOT}/ccs/Debug" />
|
||||
|
||||
<pathVariable name="C2000WARE_ROOT" path="../../../../../../" scope="project" />
|
||||
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../driverlib/" scope="project" />
|
||||
<pathVariable name="C2000WARE_DEVICESUPPORT_ROOT" path="../../../../../../device_support/F2837xD/" scope="project" />
|
||||
<pathVariable name="CLB_SYSCFG_ROOT" path="../../../../../../utilities/clb_tool/clb_syscfg/" scope="project" />
|
||||
<pathVariable name="SYSTEMC_INSTALL" path="../../../../../../utilities/clb_tool/clb_syscfg/systemc-2.3.3" scope="project" />
|
||||
<pathVariable name="CLB_SIM_COMPILER" path="C:/TDM-GCC-64/bin" scope="project" />
|
||||
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/targetConfigs/TMS320F28377D.ccxml" targetDirectory="targetConfigs" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/driverlib.h" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/device.h" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/device.c" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/cmd/2837xD_RAM_lnk_cpu1.cmd" targetDirectory=""/>
|
||||
<file action="copy" path="../../../../driverlib/" targetDirectory="device" excludeFromBuild="True" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/F2837xD_CodeStartBranch.asm" targetDirectory="device" />
|
||||
|
||||
<file action="copy" path="../clb_ex12_output_intersect.c" targetDirectory="" />
|
||||
<file action="copy" path="../clb_ex12_output_intersect.syscfg" targetDirectory="" />
|
||||
</project>
|
||||
</projectSpec>
|
||||
@@ -0,0 +1,36 @@
|
||||
<projectSpec>
|
||||
<project
|
||||
name="clb_ex13_push_pull"
|
||||
device="TMS320F28377D"
|
||||
products="sysconfig;C2000WARE"
|
||||
launchWizard="False"
|
||||
linkerCommandFile=""
|
||||
outputFormat="ELF"
|
||||
enableSysConfigTool="true"
|
||||
sysConfigBuildOptions="--product ${CLB_SYSCFG_ROOT}/.metadata/product.json --device F2837xD"
|
||||
>
|
||||
<configuration name="Debug" postBuildStep="mkdir "${BuildDirectory}/simulation"
|
||||
;${CLB_SIM_COMPILER}/g++ -c -DCLB_SIM -I${SYSTEMC_INSTALL}/src -I${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/include -I${PROJECT_ROOT} -I${CLB_SIM_COMPILER}/include -Og -g -gdwarf-3 -gstrict-dwarf -Wall -MMD -MP -MF${BuildDirectory}/simulation/clb_sim.d -MT${BuildDirectory}/simulation/clb_sim.o -I${BuildDirectory}/syscfg -fno-threadsafe-statics -o${BuildDirectory}/simulation/clb_sim.o ${BuildDirectory}/syscfg/clb_sim.cpp
|
||||
;${CLB_SIM_COMPILER}/g++ -DCLB_SIM -Og -g -gdwarf-3 -gstrict-dwarf -Wall -Wl,-Map,${BuildDirectory}/simulation/simulation_output.map -L${SYSTEMC_INSTALL}/build/src -o${BuildDirectory}/simulation/simulation_output.exe ${BuildDirectory}/simulation/clb_sim.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_FSM_SC_model.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_HLC_SC_model.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_LUT4_SC_model.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_OutputLUT_SC_model.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_counter_SC_model.o -Wl,--start-group -lsystemc -Wl,--end-group;./simulation/simulation_output.exe
|
||||
;${NODE_TOOL} "${CLB_SYSCFG_ROOT}/dot_file_libraries/clbDotUtility.js" "${CLB_SYSCFG_ROOT}" "${BuildDirectory}/syscfg" "${BuildDirectory}/syscfg/clb.dot""
|
||||
compilerBuildOptions="--opt_level=off --opt_for_speed=2 --fp_mode=strict -I${C2000WARE_DLIB_ROOT} -I${C2000WARE_DEVICESUPPORT_ROOT}/common/include -I${PROJECT_ROOT}/device -I${CLB_SYSCFG_ROOT}/systemc/include -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --define=CPU1 -g --diag_warning=225 --diag_wrap=off --display_error_number " linkerBuildOptions="--stack_size=0x200 -l driverlib.lib -l libc.a -I${C2000WARE_DLIB_ROOT}/ccs/Debug" />
|
||||
|
||||
<pathVariable name="C2000WARE_ROOT" path="../../../../../../" scope="project" />
|
||||
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../driverlib/" scope="project" />
|
||||
<pathVariable name="C2000WARE_DEVICESUPPORT_ROOT" path="../../../../../../device_support/F2837xD/" scope="project" />
|
||||
<pathVariable name="CLB_SYSCFG_ROOT" path="../../../../../../utilities/clb_tool/clb_syscfg/" scope="project" />
|
||||
<pathVariable name="SYSTEMC_INSTALL" path="../../../../../../utilities/clb_tool/clb_syscfg/systemc-2.3.3" scope="project" />
|
||||
<pathVariable name="CLB_SIM_COMPILER" path="C:/TDM-GCC-64/bin" scope="project" />
|
||||
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/targetConfigs/TMS320F28377D.ccxml" targetDirectory="targetConfigs" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/driverlib.h" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/device.h" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/device.c" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/cmd/2837xD_RAM_lnk_cpu1.cmd" targetDirectory=""/>
|
||||
<file action="copy" path="../../../../driverlib/" targetDirectory="device" excludeFromBuild="True" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/F2837xD_CodeStartBranch.asm" targetDirectory="device" />
|
||||
|
||||
<file action="copy" path="../clb_ex13_push_pull.c" targetDirectory="" />
|
||||
<file action="copy" path="../clb_ex13_push_pull.syscfg" targetDirectory="" />
|
||||
</project>
|
||||
</projectSpec>
|
||||
@@ -0,0 +1,36 @@
|
||||
<projectSpec>
|
||||
<project
|
||||
name="clb_ex14_multi_tile"
|
||||
device="TMS320F28377D"
|
||||
products="sysconfig;C2000WARE"
|
||||
launchWizard="False"
|
||||
linkerCommandFile=""
|
||||
outputFormat="ELF"
|
||||
enableSysConfigTool="true"
|
||||
sysConfigBuildOptions="--product ${CLB_SYSCFG_ROOT}/.metadata/product.json --device F2837xD"
|
||||
>
|
||||
<configuration name="Debug" postBuildStep="mkdir "${BuildDirectory}/simulation"
|
||||
;${CLB_SIM_COMPILER}/g++ -c -DCLB_SIM -I${SYSTEMC_INSTALL}/src -I${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/include -I${PROJECT_ROOT} -I${CLB_SIM_COMPILER}/include -Og -g -gdwarf-3 -gstrict-dwarf -Wall -MMD -MP -MF${BuildDirectory}/simulation/clb_sim.d -MT${BuildDirectory}/simulation/clb_sim.o -I${BuildDirectory}/syscfg -fno-threadsafe-statics -o${BuildDirectory}/simulation/clb_sim.o ${BuildDirectory}/syscfg/clb_sim.cpp
|
||||
;${CLB_SIM_COMPILER}/g++ -DCLB_SIM -Og -g -gdwarf-3 -gstrict-dwarf -Wall -Wl,-Map,${BuildDirectory}/simulation/simulation_output.map -L${SYSTEMC_INSTALL}/build/src -o${BuildDirectory}/simulation/simulation_output.exe ${BuildDirectory}/simulation/clb_sim.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_FSM_SC_model.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_HLC_SC_model.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_LUT4_SC_model.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_OutputLUT_SC_model.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_counter_SC_model.o -Wl,--start-group -lsystemc -Wl,--end-group;./simulation/simulation_output.exe
|
||||
;${NODE_TOOL} "${CLB_SYSCFG_ROOT}/dot_file_libraries/clbDotUtility.js" "${CLB_SYSCFG_ROOT}" "${BuildDirectory}/syscfg" "${BuildDirectory}/syscfg/clb.dot""
|
||||
compilerBuildOptions="--opt_level=off --opt_for_speed=2 --fp_mode=strict -I${C2000WARE_DLIB_ROOT} -I${C2000WARE_DEVICESUPPORT_ROOT}/common/include -I${PROJECT_ROOT}/device -I${CLB_SYSCFG_ROOT}/systemc/include -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --define=CPU1 -g --diag_warning=225 --diag_wrap=off --display_error_number " linkerBuildOptions="--stack_size=0x200 -l driverlib.lib -l libc.a -I${C2000WARE_DLIB_ROOT}/ccs/Debug" />
|
||||
|
||||
<pathVariable name="C2000WARE_ROOT" path="../../../../../../" scope="project" />
|
||||
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../driverlib/" scope="project" />
|
||||
<pathVariable name="C2000WARE_DEVICESUPPORT_ROOT" path="../../../../../../device_support/F2837xD/" scope="project" />
|
||||
<pathVariable name="CLB_SYSCFG_ROOT" path="../../../../../../utilities/clb_tool/clb_syscfg/" scope="project" />
|
||||
<pathVariable name="SYSTEMC_INSTALL" path="../../../../../../utilities/clb_tool/clb_syscfg/systemc-2.3.3" scope="project" />
|
||||
<pathVariable name="CLB_SIM_COMPILER" path="C:/TDM-GCC-64/bin" scope="project" />
|
||||
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/targetConfigs/TMS320F28377D.ccxml" targetDirectory="targetConfigs" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/driverlib.h" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/device.h" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/device.c" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/cmd/2837xD_RAM_lnk_cpu1.cmd" targetDirectory=""/>
|
||||
<file action="copy" path="../../../../driverlib/" targetDirectory="device" excludeFromBuild="True" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/F2837xD_CodeStartBranch.asm" targetDirectory="device" />
|
||||
|
||||
<file action="copy" path="../clb_ex14_multi_tile.c" targetDirectory="" />
|
||||
<file action="copy" path="../clb_ex14_multi_tile.syscfg" targetDirectory="" />
|
||||
</project>
|
||||
</projectSpec>
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
<projectSpec>
|
||||
<project
|
||||
name="clb_ex15_tile_to_tile_delay"
|
||||
device="TMS320F28377D"
|
||||
products="sysconfig;C2000WARE"
|
||||
launchWizard="False"
|
||||
linkerCommandFile=""
|
||||
outputFormat="ELF"
|
||||
enableSysConfigTool="true"
|
||||
sysConfigBuildOptions="--product ${CLB_SYSCFG_ROOT}/.metadata/product.json --device F2837xD"
|
||||
>
|
||||
<configuration name="Debug" postBuildStep="mkdir "${BuildDirectory}/simulation"
|
||||
;${CLB_SIM_COMPILER}/g++ -c -DCLB_SIM -I${SYSTEMC_INSTALL}/src -I${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/include -I${PROJECT_ROOT} -I${CLB_SIM_COMPILER}/include -Og -g -gdwarf-3 -gstrict-dwarf -Wall -MMD -MP -MF${BuildDirectory}/simulation/clb_sim.d -MT${BuildDirectory}/simulation/clb_sim.o -I${BuildDirectory}/syscfg -fno-threadsafe-statics -o${BuildDirectory}/simulation/clb_sim.o ${BuildDirectory}/syscfg/clb_sim.cpp
|
||||
;${CLB_SIM_COMPILER}/g++ -DCLB_SIM -Og -g -gdwarf-3 -gstrict-dwarf -Wall -Wl,-Map,${BuildDirectory}/simulation/simulation_output.map -L${SYSTEMC_INSTALL}/build/src -o${BuildDirectory}/simulation/simulation_output.exe ${BuildDirectory}/simulation/clb_sim.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_FSM_SC_model.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_HLC_SC_model.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_LUT4_SC_model.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_OutputLUT_SC_model.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_counter_SC_model.o -Wl,--start-group -lsystemc -Wl,--end-group;./simulation/simulation_output.exe
|
||||
;${NODE_TOOL} "${CLB_SYSCFG_ROOT}/dot_file_libraries/clbDotUtility.js" "${CLB_SYSCFG_ROOT}" "${BuildDirectory}/syscfg" "${BuildDirectory}/syscfg/clb.dot""
|
||||
compilerBuildOptions="--opt_level=off --opt_for_speed=2 --fp_mode=strict -I${C2000WARE_DLIB_ROOT} -I${C2000WARE_DEVICESUPPORT_ROOT}/common/include -I${PROJECT_ROOT}/device -I${CLB_SYSCFG_ROOT}/systemc/include -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --define=CPU1 -g --diag_warning=225 --diag_wrap=off --display_error_number " linkerBuildOptions="--stack_size=0x200 -l driverlib.lib -l libc.a -I${C2000WARE_DLIB_ROOT}/ccs/Debug" />
|
||||
|
||||
<pathVariable name="C2000WARE_ROOT" path="../../../../../../" scope="project" />
|
||||
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../driverlib/" scope="project" />
|
||||
<pathVariable name="C2000WARE_DEVICESUPPORT_ROOT" path="../../../../../../device_support/F2837xD/" scope="project" />
|
||||
<pathVariable name="CLB_SYSCFG_ROOT" path="../../../../../../utilities/clb_tool/clb_syscfg/" scope="project" />
|
||||
<pathVariable name="SYSTEMC_INSTALL" path="../../../../../../utilities/clb_tool/clb_syscfg/systemc-2.3.3" scope="project" />
|
||||
<pathVariable name="CLB_SIM_COMPILER" path="C:/TDM-GCC-64/bin" scope="project" />
|
||||
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/targetConfigs/TMS320F28377D.ccxml" targetDirectory="targetConfigs" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/driverlib.h" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/device.h" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/device.c" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/cmd/2837xD_RAM_lnk_cpu1.cmd" targetDirectory=""/>
|
||||
<file action="copy" path="../../../../driverlib/" targetDirectory="device" excludeFromBuild="True" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/F2837xD_CodeStartBranch.asm" targetDirectory="device" />
|
||||
|
||||
<file action="copy" path="../clb_ex15_tile_to_tile_delay.c" targetDirectory="" />
|
||||
<file action="copy" path="../clb_ex15_tile_to_tile_delay.syscfg" targetDirectory="" />
|
||||
</project>
|
||||
</projectSpec>
|
||||
@@ -0,0 +1,36 @@
|
||||
<projectSpec>
|
||||
<project
|
||||
name="clb_ex17_one_shot_pwm"
|
||||
device="TMS320F28377D"
|
||||
products="sysconfig;C2000WARE"
|
||||
launchWizard="False"
|
||||
linkerCommandFile=""
|
||||
outputFormat="ELF"
|
||||
enableSysConfigTool="true"
|
||||
sysConfigBuildOptions="--product ${CLB_SYSCFG_ROOT}/.metadata/product.json --device F2837xD"
|
||||
>
|
||||
<configuration name="Debug" postBuildStep="mkdir "${BuildDirectory}/simulation"
|
||||
;${CLB_SIM_COMPILER}/g++ -c -DCLB_SIM -I${SYSTEMC_INSTALL}/src -I${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/include -I${PROJECT_ROOT} -I${CLB_SIM_COMPILER}/include -Og -g -gdwarf-3 -gstrict-dwarf -Wall -MMD -MP -MF${BuildDirectory}/simulation/clb_sim.d -MT${BuildDirectory}/simulation/clb_sim.o -I${BuildDirectory}/syscfg -fno-threadsafe-statics -o${BuildDirectory}/simulation/clb_sim.o ${BuildDirectory}/syscfg/clb_sim.cpp
|
||||
;${CLB_SIM_COMPILER}/g++ -DCLB_SIM -Og -g -gdwarf-3 -gstrict-dwarf -Wall -Wl,-Map,${BuildDirectory}/simulation/simulation_output.map -L${SYSTEMC_INSTALL}/build/src -o${BuildDirectory}/simulation/simulation_output.exe ${BuildDirectory}/simulation/clb_sim.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_FSM_SC_model.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_HLC_SC_model.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_LUT4_SC_model.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_OutputLUT_SC_model.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_counter_SC_model.o -Wl,--start-group -lsystemc -Wl,--end-group;./simulation/simulation_output.exe
|
||||
;${NODE_TOOL} "${CLB_SYSCFG_ROOT}/dot_file_libraries/clbDotUtility.js" "${CLB_SYSCFG_ROOT}" "${BuildDirectory}/syscfg" "${BuildDirectory}/syscfg/clb.dot""
|
||||
compilerBuildOptions="--opt_level=off --opt_for_speed=2 --fp_mode=strict -I${C2000WARE_DLIB_ROOT} -I${C2000WARE_DEVICESUPPORT_ROOT}/common/include -I${PROJECT_ROOT}/device -I${CLB_SYSCFG_ROOT}/systemc/include -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --define=CPU1 -g --diag_warning=225 --diag_wrap=off --display_error_number " linkerBuildOptions="--stack_size=0x200 -l driverlib.lib -l libc.a -I${C2000WARE_DLIB_ROOT}/ccs/Debug" />
|
||||
|
||||
<pathVariable name="C2000WARE_ROOT" path="../../../../../../" scope="project" />
|
||||
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../driverlib/" scope="project" />
|
||||
<pathVariable name="C2000WARE_DEVICESUPPORT_ROOT" path="../../../../../../device_support/F2837xD/" scope="project" />
|
||||
<pathVariable name="CLB_SYSCFG_ROOT" path="../../../../../../utilities/clb_tool/clb_syscfg/" scope="project" />
|
||||
<pathVariable name="SYSTEMC_INSTALL" path="../../../../../../utilities/clb_tool/clb_syscfg/systemc-2.3.3" scope="project" />
|
||||
<pathVariable name="CLB_SIM_COMPILER" path="C:/TDM-GCC-64/bin" scope="project" />
|
||||
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/targetConfigs/TMS320F28377D.ccxml" targetDirectory="targetConfigs" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/driverlib.h" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/device.h" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/device.c" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/cmd/2837xD_RAM_lnk_cpu1.cmd" targetDirectory=""/>
|
||||
<file action="copy" path="../../../../driverlib/" targetDirectory="device" excludeFromBuild="True" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/F2837xD_CodeStartBranch.asm" targetDirectory="device" />
|
||||
|
||||
<file action="copy" path="../clb_ex17_one_shot_pwm.c" targetDirectory="" />
|
||||
<file action="copy" path="../clb_ex17_one_shot_pwm.syscfg" targetDirectory="" />
|
||||
</project>
|
||||
</projectSpec>
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
<projectSpec>
|
||||
<project
|
||||
name="clb_ex1_combinatorial_logic"
|
||||
device="TMS320F28377D"
|
||||
products="sysconfig;C2000WARE"
|
||||
launchWizard="False"
|
||||
linkerCommandFile=""
|
||||
outputFormat="ELF"
|
||||
enableSysConfigTool="true"
|
||||
sysConfigBuildOptions="--product ${CLB_SYSCFG_ROOT}/.metadata/product.json --device F2837xD"
|
||||
>
|
||||
<configuration name="Debug" postBuildStep="mkdir "${BuildDirectory}/simulation"
|
||||
;${CLB_SIM_COMPILER}/g++ -c -DCLB_SIM -I${SYSTEMC_INSTALL}/src -I${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/include -I${PROJECT_ROOT} -I${CLB_SIM_COMPILER}/include -Og -g -gdwarf-3 -gstrict-dwarf -Wall -MMD -MP -MF${BuildDirectory}/simulation/clb_sim.d -MT${BuildDirectory}/simulation/clb_sim.o -I${BuildDirectory}/syscfg -fno-threadsafe-statics -o${BuildDirectory}/simulation/clb_sim.o ${BuildDirectory}/syscfg/clb_sim.cpp
|
||||
;${CLB_SIM_COMPILER}/g++ -DCLB_SIM -Og -g -gdwarf-3 -gstrict-dwarf -Wall -Wl,-Map,${BuildDirectory}/simulation/simulation_output.map -L${SYSTEMC_INSTALL}/build/src -o${BuildDirectory}/simulation/simulation_output.exe ${BuildDirectory}/simulation/clb_sim.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_FSM_SC_model.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_HLC_SC_model.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_LUT4_SC_model.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_OutputLUT_SC_model.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_counter_SC_model.o -Wl,--start-group -lsystemc -Wl,--end-group;./simulation/simulation_output.exe
|
||||
;${NODE_TOOL} "${CLB_SYSCFG_ROOT}/dot_file_libraries/clbDotUtility.js" "${CLB_SYSCFG_ROOT}" "${BuildDirectory}/syscfg" "${BuildDirectory}/syscfg/clb.dot""
|
||||
compilerBuildOptions="--opt_level=off --opt_for_speed=2 --fp_mode=strict -I${C2000WARE_DLIB_ROOT} -I${C2000WARE_DEVICESUPPORT_ROOT}/common/include -I${PROJECT_ROOT}/device -I${CLB_SYSCFG_ROOT}/systemc/include -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --define=CPU1 -g --diag_warning=225 --diag_wrap=off --display_error_number " linkerBuildOptions="--stack_size=0x200 -l driverlib.lib -l libc.a -I${C2000WARE_DLIB_ROOT}/ccs/Debug" />
|
||||
|
||||
<pathVariable name="C2000WARE_ROOT" path="../../../../../../" scope="project" />
|
||||
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../driverlib/" scope="project" />
|
||||
<pathVariable name="C2000WARE_DEVICESUPPORT_ROOT" path="../../../../../../device_support/F2837xD/" scope="project" />
|
||||
<pathVariable name="CLB_SYSCFG_ROOT" path="../../../../../../utilities/clb_tool/clb_syscfg/" scope="project" />
|
||||
<pathVariable name="SYSTEMC_INSTALL" path="../../../../../../utilities/clb_tool/clb_syscfg/systemc-2.3.3" scope="project" />
|
||||
<pathVariable name="CLB_SIM_COMPILER" path="C:/TDM-GCC-64/bin" scope="project" />
|
||||
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/targetConfigs/TMS320F28377D.ccxml" targetDirectory="targetConfigs" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/driverlib.h" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/device.h" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/device.c" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/cmd/2837xD_RAM_lnk_cpu1.cmd" targetDirectory=""/>
|
||||
<file action="copy" path="../../../../driverlib/" targetDirectory="device" excludeFromBuild="True" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/F2837xD_CodeStartBranch.asm" targetDirectory="device" />
|
||||
|
||||
<file action="copy" path="../clb_ex1_combinatorial_logic.c" targetDirectory="" />
|
||||
<file action="copy" path="../clb_ex1_combinatorial_logic.syscfg" targetDirectory="" />
|
||||
</project>
|
||||
</projectSpec>
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
<projectSpec>
|
||||
<project
|
||||
name="clb_ex2_gpio_input_filter"
|
||||
device="TMS320F28377D"
|
||||
products="sysconfig;C2000WARE"
|
||||
launchWizard="False"
|
||||
linkerCommandFile=""
|
||||
outputFormat="ELF"
|
||||
enableSysConfigTool="true"
|
||||
sysConfigBuildOptions="--product ${CLB_SYSCFG_ROOT}/.metadata/product.json --device F2837xD"
|
||||
>
|
||||
<configuration name="Debug" postBuildStep="mkdir "${BuildDirectory}/simulation"
|
||||
;${CLB_SIM_COMPILER}/g++ -c -DCLB_SIM -I${SYSTEMC_INSTALL}/src -I${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/include -I${PROJECT_ROOT} -I${CLB_SIM_COMPILER}/include -Og -g -gdwarf-3 -gstrict-dwarf -Wall -MMD -MP -MF${BuildDirectory}/simulation/clb_sim.d -MT${BuildDirectory}/simulation/clb_sim.o -I${BuildDirectory}/syscfg -fno-threadsafe-statics -o${BuildDirectory}/simulation/clb_sim.o ${BuildDirectory}/syscfg/clb_sim.cpp
|
||||
;${CLB_SIM_COMPILER}/g++ -DCLB_SIM -Og -g -gdwarf-3 -gstrict-dwarf -Wall -Wl,-Map,${BuildDirectory}/simulation/simulation_output.map -L${SYSTEMC_INSTALL}/build/src -o${BuildDirectory}/simulation/simulation_output.exe ${BuildDirectory}/simulation/clb_sim.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_FSM_SC_model.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_HLC_SC_model.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_LUT4_SC_model.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_OutputLUT_SC_model.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_counter_SC_model.o -Wl,--start-group -lsystemc -Wl,--end-group;./simulation/simulation_output.exe
|
||||
;${NODE_TOOL} "${CLB_SYSCFG_ROOT}/dot_file_libraries/clbDotUtility.js" "${CLB_SYSCFG_ROOT}" "${BuildDirectory}/syscfg" "${BuildDirectory}/syscfg/clb.dot""
|
||||
compilerBuildOptions="--opt_level=off --opt_for_speed=2 --fp_mode=strict -I${C2000WARE_DLIB_ROOT} -I${C2000WARE_DEVICESUPPORT_ROOT}/common/include -I${PROJECT_ROOT}/device -I${CLB_SYSCFG_ROOT}/systemc/include -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --define=CPU1 -g --diag_warning=225 --diag_wrap=off --display_error_number " linkerBuildOptions="--stack_size=0x200 -l driverlib.lib -l libc.a -I${C2000WARE_DLIB_ROOT}/ccs/Debug" />
|
||||
|
||||
<pathVariable name="C2000WARE_ROOT" path="../../../../../../" scope="project" />
|
||||
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../driverlib/" scope="project" />
|
||||
<pathVariable name="C2000WARE_DEVICESUPPORT_ROOT" path="../../../../../../device_support/F2837xD/" scope="project" />
|
||||
<pathVariable name="CLB_SYSCFG_ROOT" path="../../../../../../utilities/clb_tool/clb_syscfg/" scope="project" />
|
||||
<pathVariable name="SYSTEMC_INSTALL" path="../../../../../../utilities/clb_tool/clb_syscfg/systemc-2.3.3" scope="project" />
|
||||
<pathVariable name="CLB_SIM_COMPILER" path="C:/TDM-GCC-64/bin" scope="project" />
|
||||
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/targetConfigs/TMS320F28377D.ccxml" targetDirectory="targetConfigs" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/driverlib.h" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/device.h" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/device.c" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/cmd/2837xD_RAM_lnk_cpu1.cmd" targetDirectory=""/>
|
||||
<file action="copy" path="../../../../driverlib/" targetDirectory="device" excludeFromBuild="True" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/F2837xD_CodeStartBranch.asm" targetDirectory="device" />
|
||||
|
||||
<file action="copy" path="../clb_ex2_gpio_input_filter.c" targetDirectory="" />
|
||||
<file action="copy" path="../clb_ex2_gpio_input_filter.syscfg" targetDirectory="" />
|
||||
</project>
|
||||
</projectSpec>
|
||||
@@ -0,0 +1,36 @@
|
||||
<projectSpec>
|
||||
<project
|
||||
name="clb_ex3_auxiliary_pwm"
|
||||
device="TMS320F28377D"
|
||||
products="sysconfig;C2000WARE"
|
||||
launchWizard="False"
|
||||
linkerCommandFile=""
|
||||
outputFormat="ELF"
|
||||
enableSysConfigTool="true"
|
||||
sysConfigBuildOptions="--product ${CLB_SYSCFG_ROOT}/.metadata/product.json --device F2837xD"
|
||||
>
|
||||
<configuration name="Debug" postBuildStep="mkdir "${BuildDirectory}/simulation"
|
||||
;${CLB_SIM_COMPILER}/g++ -c -DCLB_SIM -I${SYSTEMC_INSTALL}/src -I${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/include -I${PROJECT_ROOT} -I${CLB_SIM_COMPILER}/include -Og -g -gdwarf-3 -gstrict-dwarf -Wall -MMD -MP -MF${BuildDirectory}/simulation/clb_sim.d -MT${BuildDirectory}/simulation/clb_sim.o -I${BuildDirectory}/syscfg -fno-threadsafe-statics -o${BuildDirectory}/simulation/clb_sim.o ${BuildDirectory}/syscfg/clb_sim.cpp
|
||||
;${CLB_SIM_COMPILER}/g++ -DCLB_SIM -Og -g -gdwarf-3 -gstrict-dwarf -Wall -Wl,-Map,${BuildDirectory}/simulation/simulation_output.map -L${SYSTEMC_INSTALL}/build/src -o${BuildDirectory}/simulation/simulation_output.exe ${BuildDirectory}/simulation/clb_sim.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_FSM_SC_model.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_HLC_SC_model.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_LUT4_SC_model.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_OutputLUT_SC_model.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_counter_SC_model.o -Wl,--start-group -lsystemc -Wl,--end-group;./simulation/simulation_output.exe
|
||||
;${NODE_TOOL} "${CLB_SYSCFG_ROOT}/dot_file_libraries/clbDotUtility.js" "${CLB_SYSCFG_ROOT}" "${BuildDirectory}/syscfg" "${BuildDirectory}/syscfg/clb.dot""
|
||||
compilerBuildOptions="--opt_level=off --opt_for_speed=2 --fp_mode=strict -I${C2000WARE_DLIB_ROOT} -I${C2000WARE_DEVICESUPPORT_ROOT}/common/include -I${PROJECT_ROOT}/device -I${CLB_SYSCFG_ROOT}/systemc/include -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --define=CPU1 -g --diag_warning=225 --diag_wrap=off --display_error_number " linkerBuildOptions="--stack_size=0x200 -l driverlib.lib -l libc.a -I${C2000WARE_DLIB_ROOT}/ccs/Debug" />
|
||||
|
||||
<pathVariable name="C2000WARE_ROOT" path="../../../../../../" scope="project" />
|
||||
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../driverlib/" scope="project" />
|
||||
<pathVariable name="C2000WARE_DEVICESUPPORT_ROOT" path="../../../../../../device_support/F2837xD/" scope="project" />
|
||||
<pathVariable name="CLB_SYSCFG_ROOT" path="../../../../../../utilities/clb_tool/clb_syscfg/" scope="project" />
|
||||
<pathVariable name="SYSTEMC_INSTALL" path="../../../../../../utilities/clb_tool/clb_syscfg/systemc-2.3.3" scope="project" />
|
||||
<pathVariable name="CLB_SIM_COMPILER" path="C:/TDM-GCC-64/bin" scope="project" />
|
||||
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/targetConfigs/TMS320F28377D.ccxml" targetDirectory="targetConfigs" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/driverlib.h" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/device.h" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/device.c" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/cmd/2837xD_RAM_lnk_cpu1.cmd" targetDirectory=""/>
|
||||
<file action="copy" path="../../../../driverlib/" targetDirectory="device" excludeFromBuild="True" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/F2837xD_CodeStartBranch.asm" targetDirectory="device" />
|
||||
|
||||
<file action="copy" path="../clb_ex3_auxiliary_pwm.c" targetDirectory="" />
|
||||
<file action="copy" path="../clb_ex3_auxiliary_pwm.syscfg" targetDirectory="" />
|
||||
</project>
|
||||
</projectSpec>
|
||||
@@ -0,0 +1,36 @@
|
||||
<projectSpec>
|
||||
<project
|
||||
name="clb_ex4_pwm_protection"
|
||||
device="TMS320F28377D"
|
||||
products="sysconfig;C2000WARE"
|
||||
launchWizard="False"
|
||||
linkerCommandFile=""
|
||||
outputFormat="ELF"
|
||||
enableSysConfigTool="true"
|
||||
sysConfigBuildOptions="--product ${CLB_SYSCFG_ROOT}/.metadata/product.json --device F2837xD"
|
||||
>
|
||||
<configuration name="Debug" postBuildStep="mkdir "${BuildDirectory}/simulation"
|
||||
;${CLB_SIM_COMPILER}/g++ -c -DCLB_SIM -I${SYSTEMC_INSTALL}/src -I${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/include -I${PROJECT_ROOT} -I${CLB_SIM_COMPILER}/include -Og -g -gdwarf-3 -gstrict-dwarf -Wall -MMD -MP -MF${BuildDirectory}/simulation/clb_sim.d -MT${BuildDirectory}/simulation/clb_sim.o -I${BuildDirectory}/syscfg -fno-threadsafe-statics -o${BuildDirectory}/simulation/clb_sim.o ${BuildDirectory}/syscfg/clb_sim.cpp
|
||||
;${CLB_SIM_COMPILER}/g++ -DCLB_SIM -Og -g -gdwarf-3 -gstrict-dwarf -Wall -Wl,-Map,${BuildDirectory}/simulation/simulation_output.map -L${SYSTEMC_INSTALL}/build/src -o${BuildDirectory}/simulation/simulation_output.exe ${BuildDirectory}/simulation/clb_sim.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_FSM_SC_model.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_HLC_SC_model.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_LUT4_SC_model.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_OutputLUT_SC_model.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_counter_SC_model.o -Wl,--start-group -lsystemc -Wl,--end-group;./simulation/simulation_output.exe
|
||||
;${NODE_TOOL} "${CLB_SYSCFG_ROOT}/dot_file_libraries/clbDotUtility.js" "${CLB_SYSCFG_ROOT}" "${BuildDirectory}/syscfg" "${BuildDirectory}/syscfg/clb.dot""
|
||||
compilerBuildOptions="--opt_level=off --opt_for_speed=2 --fp_mode=strict -I${C2000WARE_DLIB_ROOT} -I${C2000WARE_DEVICESUPPORT_ROOT}/common/include -I${PROJECT_ROOT}/device -I${CLB_SYSCFG_ROOT}/systemc/include -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --define=CPU1 -g --diag_warning=225 --diag_wrap=off --display_error_number " linkerBuildOptions="--stack_size=0x200 -l driverlib.lib -l libc.a -I${C2000WARE_DLIB_ROOT}/ccs/Debug" />
|
||||
|
||||
<pathVariable name="C2000WARE_ROOT" path="../../../../../../" scope="project" />
|
||||
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../driverlib/" scope="project" />
|
||||
<pathVariable name="C2000WARE_DEVICESUPPORT_ROOT" path="../../../../../../device_support/F2837xD/" scope="project" />
|
||||
<pathVariable name="CLB_SYSCFG_ROOT" path="../../../../../../utilities/clb_tool/clb_syscfg/" scope="project" />
|
||||
<pathVariable name="SYSTEMC_INSTALL" path="../../../../../../utilities/clb_tool/clb_syscfg/systemc-2.3.3" scope="project" />
|
||||
<pathVariable name="CLB_SIM_COMPILER" path="C:/TDM-GCC-64/bin" scope="project" />
|
||||
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/targetConfigs/TMS320F28377D.ccxml" targetDirectory="targetConfigs" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/driverlib.h" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/device.h" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/device.c" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/cmd/2837xD_RAM_lnk_cpu1.cmd" targetDirectory=""/>
|
||||
<file action="copy" path="../../../../driverlib/" targetDirectory="device" excludeFromBuild="True" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/F2837xD_CodeStartBranch.asm" targetDirectory="device" />
|
||||
|
||||
<file action="copy" path="../clb_ex4_pwm_protection.c" targetDirectory="" />
|
||||
<file action="copy" path="../clb_ex4_pwm_protection.syscfg" targetDirectory="" />
|
||||
</project>
|
||||
</projectSpec>
|
||||
@@ -0,0 +1,36 @@
|
||||
<projectSpec>
|
||||
<project
|
||||
name="clb_ex5_event_window"
|
||||
device="TMS320F28377D"
|
||||
products="sysconfig;C2000WARE"
|
||||
launchWizard="False"
|
||||
linkerCommandFile=""
|
||||
outputFormat="ELF"
|
||||
enableSysConfigTool="true"
|
||||
sysConfigBuildOptions="--product ${CLB_SYSCFG_ROOT}/.metadata/product.json --device F2837xD"
|
||||
>
|
||||
<configuration name="Debug" postBuildStep="mkdir "${BuildDirectory}/simulation"
|
||||
;${CLB_SIM_COMPILER}/g++ -c -DCLB_SIM -I${SYSTEMC_INSTALL}/src -I${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/include -I${PROJECT_ROOT} -I${CLB_SIM_COMPILER}/include -Og -g -gdwarf-3 -gstrict-dwarf -Wall -MMD -MP -MF${BuildDirectory}/simulation/clb_sim.d -MT${BuildDirectory}/simulation/clb_sim.o -I${BuildDirectory}/syscfg -fno-threadsafe-statics -o${BuildDirectory}/simulation/clb_sim.o ${BuildDirectory}/syscfg/clb_sim.cpp
|
||||
;${CLB_SIM_COMPILER}/g++ -DCLB_SIM -Og -g -gdwarf-3 -gstrict-dwarf -Wall -Wl,-Map,${BuildDirectory}/simulation/simulation_output.map -L${SYSTEMC_INSTALL}/build/src -o${BuildDirectory}/simulation/simulation_output.exe ${BuildDirectory}/simulation/clb_sim.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_FSM_SC_model.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_HLC_SC_model.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_LUT4_SC_model.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_OutputLUT_SC_model.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_counter_SC_model.o -Wl,--start-group -lsystemc -Wl,--end-group;./simulation/simulation_output.exe
|
||||
;${NODE_TOOL} "${CLB_SYSCFG_ROOT}/dot_file_libraries/clbDotUtility.js" "${CLB_SYSCFG_ROOT}" "${BuildDirectory}/syscfg" "${BuildDirectory}/syscfg/clb.dot""
|
||||
compilerBuildOptions="--opt_level=off --opt_for_speed=2 --fp_mode=strict -I${C2000WARE_DLIB_ROOT} -I${C2000WARE_DEVICESUPPORT_ROOT}/common/include -I${PROJECT_ROOT}/device -I${CLB_SYSCFG_ROOT}/systemc/include -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --define=CPU1 -g --diag_warning=225 --diag_wrap=off --display_error_number " linkerBuildOptions="--stack_size=0x200 -l driverlib.lib -l libc.a -I${C2000WARE_DLIB_ROOT}/ccs/Debug" />
|
||||
|
||||
<pathVariable name="C2000WARE_ROOT" path="../../../../../../" scope="project" />
|
||||
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../driverlib/" scope="project" />
|
||||
<pathVariable name="C2000WARE_DEVICESUPPORT_ROOT" path="../../../../../../device_support/F2837xD/" scope="project" />
|
||||
<pathVariable name="CLB_SYSCFG_ROOT" path="../../../../../../utilities/clb_tool/clb_syscfg/" scope="project" />
|
||||
<pathVariable name="SYSTEMC_INSTALL" path="../../../../../../utilities/clb_tool/clb_syscfg/systemc-2.3.3" scope="project" />
|
||||
<pathVariable name="CLB_SIM_COMPILER" path="C:/TDM-GCC-64/bin" scope="project" />
|
||||
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/targetConfigs/TMS320F28377D.ccxml" targetDirectory="targetConfigs" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/driverlib.h" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/device.h" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/device.c" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/cmd/2837xD_clb_ex5_RAM_lnk.cmd" targetDirectory=""/>
|
||||
<file action="copy" path="../../../../driverlib/" targetDirectory="device" excludeFromBuild="True" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/F2837xD_CodeStartBranch.asm" targetDirectory="device" />
|
||||
|
||||
<file action="copy" path="../clb_ex5_event_window.c" targetDirectory="" />
|
||||
<file action="copy" path="../clb_ex5_event_window.syscfg" targetDirectory="" />
|
||||
</project>
|
||||
</projectSpec>
|
||||
@@ -0,0 +1,36 @@
|
||||
<projectSpec>
|
||||
<project
|
||||
name="clb_ex6_siggen"
|
||||
device="TMS320F28377D"
|
||||
products="sysconfig;C2000WARE"
|
||||
launchWizard="False"
|
||||
linkerCommandFile=""
|
||||
outputFormat="ELF"
|
||||
enableSysConfigTool="true"
|
||||
sysConfigBuildOptions="--product ${CLB_SYSCFG_ROOT}/.metadata/product.json --device F2837xD"
|
||||
>
|
||||
<configuration name="Debug" postBuildStep="mkdir "${BuildDirectory}/simulation"
|
||||
;${CLB_SIM_COMPILER}/g++ -c -DCLB_SIM -I${SYSTEMC_INSTALL}/src -I${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/include -I${PROJECT_ROOT} -I${CLB_SIM_COMPILER}/include -Og -g -gdwarf-3 -gstrict-dwarf -Wall -MMD -MP -MF${BuildDirectory}/simulation/clb_sim.d -MT${BuildDirectory}/simulation/clb_sim.o -I${BuildDirectory}/syscfg -fno-threadsafe-statics -o${BuildDirectory}/simulation/clb_sim.o ${BuildDirectory}/syscfg/clb_sim.cpp
|
||||
;${CLB_SIM_COMPILER}/g++ -DCLB_SIM -Og -g -gdwarf-3 -gstrict-dwarf -Wall -Wl,-Map,${BuildDirectory}/simulation/simulation_output.map -L${SYSTEMC_INSTALL}/build/src -o${BuildDirectory}/simulation/simulation_output.exe ${BuildDirectory}/simulation/clb_sim.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_FSM_SC_model.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_HLC_SC_model.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_LUT4_SC_model.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_OutputLUT_SC_model.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_counter_SC_model.o -Wl,--start-group -lsystemc -Wl,--end-group;./simulation/simulation_output.exe
|
||||
;${NODE_TOOL} "${CLB_SYSCFG_ROOT}/dot_file_libraries/clbDotUtility.js" "${CLB_SYSCFG_ROOT}" "${BuildDirectory}/syscfg" "${BuildDirectory}/syscfg/clb.dot""
|
||||
compilerBuildOptions="--opt_level=off --opt_for_speed=2 --fp_mode=strict -I${C2000WARE_DLIB_ROOT} -I${C2000WARE_DEVICESUPPORT_ROOT}/common/include -I${PROJECT_ROOT}/device -I${CLB_SYSCFG_ROOT}/systemc/include -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --define=CPU1 -g --diag_warning=225 --diag_wrap=off --display_error_number " linkerBuildOptions="--stack_size=0x200 -l driverlib.lib -l libc.a -I${C2000WARE_DLIB_ROOT}/ccs/Debug" />
|
||||
|
||||
<pathVariable name="C2000WARE_ROOT" path="../../../../../../" scope="project" />
|
||||
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../driverlib/" scope="project" />
|
||||
<pathVariable name="C2000WARE_DEVICESUPPORT_ROOT" path="../../../../../../device_support/F2837xD/" scope="project" />
|
||||
<pathVariable name="CLB_SYSCFG_ROOT" path="../../../../../../utilities/clb_tool/clb_syscfg/" scope="project" />
|
||||
<pathVariable name="SYSTEMC_INSTALL" path="../../../../../../utilities/clb_tool/clb_syscfg/systemc-2.3.3" scope="project" />
|
||||
<pathVariable name="CLB_SIM_COMPILER" path="C:/TDM-GCC-64/bin" scope="project" />
|
||||
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/targetConfigs/TMS320F28377D.ccxml" targetDirectory="targetConfigs" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/driverlib.h" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/device.h" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/device.c" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/cmd/2837xD_RAM_lnk_cpu1.cmd" targetDirectory=""/>
|
||||
<file action="copy" path="../../../../driverlib/" targetDirectory="device" excludeFromBuild="True" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/F2837xD_CodeStartBranch.asm" targetDirectory="device" />
|
||||
|
||||
<file action="copy" path="../clb_ex6_siggen.c" targetDirectory="" />
|
||||
<file action="copy" path="../clb_ex6_siggen.syscfg" targetDirectory="" />
|
||||
</project>
|
||||
</projectSpec>
|
||||
@@ -0,0 +1,36 @@
|
||||
<projectSpec>
|
||||
<project
|
||||
name="clb_ex7_state_machine"
|
||||
device="TMS320F28377D"
|
||||
products="sysconfig;C2000WARE"
|
||||
launchWizard="False"
|
||||
linkerCommandFile=""
|
||||
outputFormat="ELF"
|
||||
enableSysConfigTool="true"
|
||||
sysConfigBuildOptions="--product ${CLB_SYSCFG_ROOT}/.metadata/product.json --device F2837xD"
|
||||
>
|
||||
<configuration name="Debug" postBuildStep="mkdir "${BuildDirectory}/simulation"
|
||||
;${CLB_SIM_COMPILER}/g++ -c -DCLB_SIM -I${SYSTEMC_INSTALL}/src -I${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/include -I${PROJECT_ROOT} -I${CLB_SIM_COMPILER}/include -Og -g -gdwarf-3 -gstrict-dwarf -Wall -MMD -MP -MF${BuildDirectory}/simulation/clb_sim.d -MT${BuildDirectory}/simulation/clb_sim.o -I${BuildDirectory}/syscfg -fno-threadsafe-statics -o${BuildDirectory}/simulation/clb_sim.o ${BuildDirectory}/syscfg/clb_sim.cpp
|
||||
;${CLB_SIM_COMPILER}/g++ -DCLB_SIM -Og -g -gdwarf-3 -gstrict-dwarf -Wall -Wl,-Map,${BuildDirectory}/simulation/simulation_output.map -L${SYSTEMC_INSTALL}/build/src -o${BuildDirectory}/simulation/simulation_output.exe ${BuildDirectory}/simulation/clb_sim.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_FSM_SC_model.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_HLC_SC_model.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_LUT4_SC_model.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_OutputLUT_SC_model.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_counter_SC_model.o -Wl,--start-group -lsystemc -Wl,--end-group;./simulation/simulation_output.exe
|
||||
;${NODE_TOOL} "${CLB_SYSCFG_ROOT}/dot_file_libraries/clbDotUtility.js" "${CLB_SYSCFG_ROOT}" "${BuildDirectory}/syscfg" "${BuildDirectory}/syscfg/clb.dot""
|
||||
compilerBuildOptions="--opt_level=off --opt_for_speed=2 --fp_mode=strict -I${C2000WARE_DLIB_ROOT} -I${C2000WARE_DEVICESUPPORT_ROOT}/common/include -I${PROJECT_ROOT}/device -I${CLB_SYSCFG_ROOT}/systemc/include -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --define=CPU1 -g --diag_warning=225 --diag_wrap=off --display_error_number " linkerBuildOptions="--stack_size=0x200 -l driverlib.lib -l libc.a -I${C2000WARE_DLIB_ROOT}/ccs/Debug" />
|
||||
|
||||
<pathVariable name="C2000WARE_ROOT" path="../../../../../../" scope="project" />
|
||||
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../driverlib/" scope="project" />
|
||||
<pathVariable name="C2000WARE_DEVICESUPPORT_ROOT" path="../../../../../../device_support/F2837xD/" scope="project" />
|
||||
<pathVariable name="CLB_SYSCFG_ROOT" path="../../../../../../utilities/clb_tool/clb_syscfg/" scope="project" />
|
||||
<pathVariable name="SYSTEMC_INSTALL" path="../../../../../../utilities/clb_tool/clb_syscfg/systemc-2.3.3" scope="project" />
|
||||
<pathVariable name="CLB_SIM_COMPILER" path="C:/TDM-GCC-64/bin" scope="project" />
|
||||
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/targetConfigs/TMS320F28377D.ccxml" targetDirectory="targetConfigs" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/driverlib.h" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/device.h" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/device.c" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/cmd/2837xD_RAM_lnk_cpu1.cmd" targetDirectory=""/>
|
||||
<file action="copy" path="../../../../driverlib/" targetDirectory="device" excludeFromBuild="True" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/F2837xD_CodeStartBranch.asm" targetDirectory="device" />
|
||||
|
||||
<file action="copy" path="../clb_ex7_state_machine.c" targetDirectory="" />
|
||||
<file action="copy" path="../clb_ex7_state_machine.syscfg" targetDirectory="" />
|
||||
</project>
|
||||
</projectSpec>
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
<projectSpec>
|
||||
<project
|
||||
name="clb_ex8_external_signal_AND_gate"
|
||||
device="TMS320F28377D"
|
||||
cgtVersion="22.6.0.LTS"
|
||||
products="sysconfig;C2000WARE"
|
||||
outputFormat="ELF"
|
||||
launchWizard="False"
|
||||
linkerCommandFile=""
|
||||
enableSysConfigTool="true"
|
||||
sysConfigBuildOptions="--product ${C2000WARE_ROOT}/.metadata/sdk.json --device F2837xD --package F2837xD_176PTP --part F2837xD_176PTP"
|
||||
>
|
||||
<configuration name="CPU1_RAM" compilerBuildOptions="--opt_level=off -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=DEBUG -v28 -ml -mt --define=CPU1 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x3F8 --heap_size=0x200 --define RAM" />
|
||||
<configuration name="CPU1_FLASH" compilerBuildOptions="--opt_level=off -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=DEBUG -v28 -ml -mt --define=CPU1 --define=_FLASH --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x3F8 --heap_size=0x200 " />
|
||||
|
||||
<configuration name="CPU1_CLB" postBuildStep="mkdir "${BuildDirectory}/simulation"
|
||||
;${CLB_SIM_COMPILER}/g++ -c -DCLB_SIM -I${SYSTEMC_INSTALL}/src -I${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/include -I${PROJECT_ROOT} -I${CLB_SIM_COMPILER}/include -Og -g -gdwarf-3 -gstrict-dwarf -Wall -MMD -MP -MF${BuildDirectory}/simulation/clb_sim.d -MT${BuildDirectory}/simulation/clb_sim.o -I${BuildDirectory}/syscfg -fno-threadsafe-statics -o${BuildDirectory}/simulation/clb_sim.o ${BuildDirectory}/syscfg/clb_sim.cpp
|
||||
;${CLB_SIM_COMPILER}/g++ -DCLB_SIM -Og -g -gdwarf-3 -gstrict-dwarf -Wall -Wl,-Map,${BuildDirectory}/simulation/simulation_output.map -L${SYSTEMC_INSTALL}/build/src -o${BuildDirectory}/simulation/simulation_output.exe ${BuildDirectory}/simulation/clb_sim.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_FSM_SC_model.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_HLC_SC_model.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_LUT4_SC_model.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_OutputLUT_SC_model.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_counter_SC_model.o -Wl,--start-group -lsystemc -Wl,--end-group;./simulation/simulation_output.exe
|
||||
;${NODE_TOOL} "${CLB_SYSCFG_ROOT}/dot_file_libraries/clbDotUtility.js" "${CLB_SYSCFG_ROOT}" "${BuildDirectory}/syscfg" "${BuildDirectory}/syscfg/clb.dot"" compilerBuildOptions="--opt_level=off -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=DEBUG -v28 -ml -mt --define=CPU1 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x3F8 --heap_size=0x200 --define RAM" />
|
||||
|
||||
<pathVariable name="CLB_SYSCFG_ROOT" path="../../../../../../utilities/clb_tool/clb_syscfg/" scope="project" />
|
||||
<pathVariable name="SYSTEMC_INSTALL" path="../../../../../../utilities/clb_tool/clb_syscfg/systemc-2.3.3" scope="project" />
|
||||
<pathVariable name="CLB_SIM_COMPILER" path="C:/TDM-GCC-64/bin" scope="project" />
|
||||
|
||||
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../driverlib/" scope="project" />
|
||||
<pathVariable name="C2000WARE_ROOT" path="../../../../../../" scope="project" />
|
||||
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/driverlib.h" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/device.h" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/device.c" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/targetConfigs/TMS320F28377D.ccxml" targetDirectory="targetConfigs" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/cmd/2837xD_RAM_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="CPU1_RAM,CPU1_CLB" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/cmd/2837xD_FLASH_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="CPU1_FLASH" />
|
||||
<file action="copy" path="../../../../driverlib/" targetDirectory="device" excludeFromBuild="True" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/F2837xD_CodeStartBranch.asm" targetDirectory="device" />
|
||||
<file action="link" path="../../../../driverlib/ccs/Debug/driverlib.lib" targetDirectory="" />
|
||||
|
||||
<file action="copy" path="../clb_ex8_external_signal_AND_gate.c" targetDirectory="" />
|
||||
<file action="copy" path="../clb_ex8_external_signal_AND_gate.syscfg" targetDirectory="" />
|
||||
</project>
|
||||
</projectSpec>
|
||||
@@ -0,0 +1,41 @@
|
||||
<projectSpec>
|
||||
<project
|
||||
name="clb_ex9_timer"
|
||||
device="TMS320F28377D"
|
||||
cgtVersion="22.6.0.LTS"
|
||||
products="sysconfig;C2000WARE"
|
||||
outputFormat="ELF"
|
||||
launchWizard="False"
|
||||
linkerCommandFile=""
|
||||
enableSysConfigTool="true"
|
||||
sysConfigBuildOptions="--product ${C2000WARE_ROOT}/.metadata/sdk.json --device F2837xD --package F2837xD_176PTP --part F2837xD_176PTP"
|
||||
>
|
||||
<configuration name="CPU1_RAM" compilerBuildOptions="--opt_level=off -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=DEBUG -v28 -ml -mt --define=CPU1 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x3F8 --heap_size=0x200 --define RAM" />
|
||||
<configuration name="CPU1_FLASH" compilerBuildOptions="--opt_level=off -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=DEBUG -v28 -ml -mt --define=CPU1 --define=_FLASH --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x3F8 --heap_size=0x200 " />
|
||||
|
||||
<configuration name="CPU1_CLB" postBuildStep="mkdir "${BuildDirectory}/simulation"
|
||||
;${CLB_SIM_COMPILER}/g++ -c -DCLB_SIM -I${SYSTEMC_INSTALL}/src -I${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/include -I${PROJECT_ROOT} -I${CLB_SIM_COMPILER}/include -Og -g -gdwarf-3 -gstrict-dwarf -Wall -MMD -MP -MF${BuildDirectory}/simulation/clb_sim.d -MT${BuildDirectory}/simulation/clb_sim.o -I${BuildDirectory}/syscfg -fno-threadsafe-statics -o${BuildDirectory}/simulation/clb_sim.o ${BuildDirectory}/syscfg/clb_sim.cpp
|
||||
;${CLB_SIM_COMPILER}/g++ -DCLB_SIM -Og -g -gdwarf-3 -gstrict-dwarf -Wall -Wl,-Map,${BuildDirectory}/simulation/simulation_output.map -L${SYSTEMC_INSTALL}/build/src -o${BuildDirectory}/simulation/simulation_output.exe ${BuildDirectory}/simulation/clb_sim.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_FSM_SC_model.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_HLC_SC_model.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_LUT4_SC_model.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_OutputLUT_SC_model.o ${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/systemc/src/CLB_counter_SC_model.o -Wl,--start-group -lsystemc -Wl,--end-group;./simulation/simulation_output.exe
|
||||
;${NODE_TOOL} "${CLB_SYSCFG_ROOT}/dot_file_libraries/clbDotUtility.js" "${CLB_SYSCFG_ROOT}" "${BuildDirectory}/syscfg" "${BuildDirectory}/syscfg/clb.dot"" compilerBuildOptions="--opt_level=off -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=DEBUG -v28 -ml -mt --define=CPU1 --diag_warning=225 --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x3F8 --heap_size=0x200 --define RAM" />
|
||||
|
||||
<pathVariable name="CLB_SYSCFG_ROOT" path="../../../../../../utilities/clb_tool/clb_syscfg/" scope="project" />
|
||||
<pathVariable name="SYSTEMC_INSTALL" path="../../../../../../utilities/clb_tool/clb_syscfg/systemc-2.3.3" scope="project" />
|
||||
<pathVariable name="CLB_SIM_COMPILER" path="C:/TDM-GCC-64/bin" scope="project" />
|
||||
|
||||
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../driverlib/" scope="project" />
|
||||
<pathVariable name="C2000WARE_ROOT" path="../../../../../../" scope="project" />
|
||||
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/driverlib.h" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/include/device.h" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/device.c" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/targetConfigs/TMS320F28377D.ccxml" targetDirectory="targetConfigs" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/cmd/2837xD_RAM_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="CPU1_RAM,CPU1_CLB" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/cmd/2837xD_FLASH_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="CPU1_FLASH" />
|
||||
<file action="copy" path="../../../../driverlib/" targetDirectory="device" excludeFromBuild="True" />
|
||||
<file action="copy" path="../../../../../../device_support/f2837xd/common/source/F2837xD_CodeStartBranch.asm" targetDirectory="device" />
|
||||
<file action="link" path="../../../../driverlib/ccs/Debug/driverlib.lib" targetDirectory="" />
|
||||
|
||||
<file action="copy" path="../clb_ex9_timer.c" targetDirectory="" />
|
||||
<file action="copy" path="../clb_ex9_timer.syscfg" targetDirectory="" />
|
||||
</project>
|
||||
</projectSpec>
|
||||
@@ -0,0 +1,180 @@
|
||||
//#############################################################################
|
||||
//
|
||||
// FILE: clb_ex10_timer_two_states.c
|
||||
//
|
||||
// TITLE: CLB Timer Two States.
|
||||
//
|
||||
//! \addtogroup driver_example_list
|
||||
//! <h1>CLB Timer Two States</h1>
|
||||
//!
|
||||
//! For the detailed description of this example, please refer to:
|
||||
//! C2000Ware_PATH\utilities\clb_tool\clb_syscfg\doc\CLB Tool Users Guide.pdf
|
||||
//!
|
||||
//
|
||||
//
|
||||
//#############################################################################
|
||||
//
|
||||
//
|
||||
// $Copyright:
|
||||
// Copyright (C) 2013-2024 Texas Instruments Incorporated - http://www.ti.com/
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions
|
||||
// are met:
|
||||
//
|
||||
// Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
//
|
||||
// Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
//
|
||||
// Neither the name of Texas Instruments Incorporated nor the names of
|
||||
// its contributors may be used to endorse or promote products derived
|
||||
// from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
// $
|
||||
//#############################################################################
|
||||
|
||||
|
||||
|
||||
#include "driverlib.h"
|
||||
#include "device.h"
|
||||
#include "clb_config.h"
|
||||
#include "clb.h"
|
||||
|
||||
__interrupt void clb1ISR(void);
|
||||
|
||||
#define RESET_TIMER 1
|
||||
#define ENABLE_TIMER 2
|
||||
#define COUNTUP_MODE 4
|
||||
|
||||
|
||||
void main(void)
|
||||
{
|
||||
Device_init();
|
||||
Device_initGPIO();
|
||||
|
||||
Interrupt_initModule();
|
||||
Interrupt_initVectorTable();
|
||||
|
||||
Interrupt_register(INT_CLB1, &clb1ISR);
|
||||
Interrupt_enable(INT_CLB1);
|
||||
|
||||
//
|
||||
// Enabling EPWM1 to enable CLB1
|
||||
//
|
||||
SysCtl_enablePeripheral(SYSCTL_PERIPH_CLK_EPWM1);
|
||||
|
||||
CLB_enableCLB(CLB1_BASE);
|
||||
initTILE1(CLB1_BASE);
|
||||
|
||||
//
|
||||
// Select Global input instead of local input for all CLB IN
|
||||
//
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN0, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN1, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN2, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN3, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN4, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN5, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN6, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN7, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
|
||||
|
||||
//
|
||||
// Unused Inputs below
|
||||
//
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN0, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN1, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN2, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN3, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN4, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN5, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN6, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN7, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
|
||||
|
||||
//
|
||||
// Inputs set to GP register
|
||||
//
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN0, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN1, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN2, CLB_GP_IN_MUX_GP_REG);
|
||||
|
||||
//
|
||||
// Unused inputs to GP register
|
||||
//
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN3, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN4, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN5, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN6, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN7, CLB_GP_IN_MUX_GP_REG);
|
||||
|
||||
//
|
||||
// Configure GPIO0 for Output
|
||||
//
|
||||
GPIO_setPinConfig(GPIO_0_GPIO0);
|
||||
GPIO_setDirectionMode(0, GPIO_DIR_MODE_OUT);
|
||||
GPIO_setPadConfig(0, GPIO_PIN_TYPE_STD);
|
||||
GPIO_writePin(0, 0);
|
||||
//
|
||||
// Configure GPIO24 for OUTPUTXBAR1
|
||||
//
|
||||
GPIO_setPinConfig(GPIO_24_OUTPUTXBAR1);
|
||||
GPIO_setDirectionMode(24, GPIO_DIR_MODE_OUT);
|
||||
GPIO_setPadConfig(24, GPIO_PIN_TYPE_STD);
|
||||
|
||||
//
|
||||
// Configure OUTPUT-XBAR OUTPUT1 as CLB1_OUT4
|
||||
//
|
||||
XBAR_setOutputMuxConfig(XBAR_OUTPUT1, XBAR_OUT_MUX01_CLB1_OUT4);
|
||||
XBAR_enableOutputMux(XBAR_OUTPUT1, XBAR_MUX01);
|
||||
|
||||
CLB_setGPREG(CLB1_BASE, ENABLE_TIMER | COUNTUP_MODE);
|
||||
|
||||
|
||||
|
||||
//
|
||||
// Enable Global Interrupt (INTM) and realtime interrupt (DBGM)
|
||||
//
|
||||
EINT;
|
||||
ERTM;
|
||||
|
||||
|
||||
CLB_clearInterruptTag(CLB1_BASE);
|
||||
|
||||
|
||||
while(1)
|
||||
{
|
||||
SysCtl_delay(20000000);
|
||||
// Change Timer Value to 2000
|
||||
CLB_configCounterLoadMatch(CLB1_BASE, CLB_CTR0, 0, 2000, 0);
|
||||
SysCtl_delay(20000000);
|
||||
// Change Timer Value to 1000
|
||||
CLB_configCounterLoadMatch(CLB1_BASE, CLB_CTR0, 0, 1000, 0);
|
||||
asm(" NOP");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
__interrupt void clb1ISR(void)
|
||||
{
|
||||
GPIO_togglePin(0);
|
||||
CLB_clearInterruptTag(CLB1_BASE);
|
||||
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP5);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
|
||||
var TILE = scripting.addModule("/utilities/clb_tool/clb_syscfg/source/TILE");
|
||||
var TILE1 = TILE.addInstance();
|
||||
// clock_period - Period of the clock (in Nano Seconds) used for simulation in System C
|
||||
TILE.clock_period = 10;
|
||||
// sim_duration - Duration of the simulation (in Nano Seconds)
|
||||
TILE.sim_duration = 100000;
|
||||
// Name
|
||||
TILE1.$name = "TILE1";
|
||||
// in_repeat_count0 - Number of periods the waveform is repeated
|
||||
TILE1.BOUNDARY.in_repeat_count0 = 50;
|
||||
// in_repeat_count3 - Number of periods the waveform is repeated
|
||||
TILE1.BOUNDARY.in_repeat_count3 = 1;
|
||||
// in0
|
||||
TILE1.BOUNDARY.in0 = "squareWave";
|
||||
// in_repeat_count1 - Number of periods the waveform is repeated
|
||||
TILE1.BOUNDARY.in_repeat_count1 = 50;
|
||||
// in_repeat_count2 - Number of periods the waveform is repeated
|
||||
TILE1.BOUNDARY.in_repeat_count2 = 50;
|
||||
// in_period0 - Period of the square wave
|
||||
TILE1.BOUNDARY.in_period0 = 10000;
|
||||
// in_duty0 - Duty or ON time of the square wave
|
||||
TILE1.BOUNDARY.in_duty0 = 5001;
|
||||
// in_period1 - Period of the square wave
|
||||
TILE1.BOUNDARY.in_period1 = 1000;
|
||||
// in_duty1 - Duty or ON time of the square wave
|
||||
TILE1.BOUNDARY.in_duty1 = 500;
|
||||
// in_period2 - Period of the square wave
|
||||
TILE1.BOUNDARY.in_period2 = 3000;
|
||||
// in_duty2 - Duty or ON time of the square wave
|
||||
TILE1.BOUNDARY.in_duty2 = 1500;
|
||||
// in1
|
||||
TILE1.BOUNDARY.in1 = "1";
|
||||
// in2
|
||||
TILE1.BOUNDARY.in2 = "1";
|
||||
// e0 - External Input 0.
|
||||
TILE1.FSM_0.e0 = "COUNTER_0.count_match1";
|
||||
// eqn_s0 - Boolean equation on the variables e1,e0,s1,s0 for the S0 output.
|
||||
TILE1.FSM_0.eqn_s0 = "e0 ^ s0";
|
||||
// What action should be taken on an event trigger?
|
||||
TILE1.COUNTER_0.action = "Load";
|
||||
// reset - Reset the counter to 0 on next clock cycle (triggers low to high)
|
||||
TILE1.COUNTER_0.reset = "COUNTER_0.count_match1";
|
||||
// event - Trigger actions in the counter.
|
||||
TILE1.COUNTER_0.event = "BOUNDARY.in0";
|
||||
// mode0 - Enables Counting when high
|
||||
TILE1.COUNTER_0.mode0 = "BOUNDARY.in1";
|
||||
// mode1 - Controls counting direction. High enables count up. Low enables count down.
|
||||
TILE1.COUNTER_0.mode1 = "BOUNDARY.in2";
|
||||
// match1_val - Sets the value of the Match reference 1 register.
|
||||
TILE1.COUNTER_0.match1_val = "1000";
|
||||
// eqn - Boolean equation on the variables i2,i1,i0 for the OUTLUT output.
|
||||
TILE1.OUTLUT_4.eqn = "i0";
|
||||
// i0 - Input 0.
|
||||
TILE1.OUTLUT_4.i0 = "FSM_0.S0";
|
||||
// Event 0 (e0) - Event 0
|
||||
TILE1.HLC.e0 = "COUNTER_0.count_match1";
|
||||
// instruct0
|
||||
TILE1.HLC.program0.instruct0 = "INTR 0";
|
||||
|
||||
@@ -0,0 +1,204 @@
|
||||
//#############################################################################
|
||||
//
|
||||
// FILE: clb_ex11_interrupt_tag.c
|
||||
//
|
||||
// TITLE: CLB Interrupt Tag.
|
||||
//
|
||||
//! \addtogroup driver_example_list
|
||||
//! <h1>CLB Interrupt Tag</h1>
|
||||
//!
|
||||
//! For the detailed description of this example, please refer to:
|
||||
//! C2000Ware_PATH\utilities\clb_tool\clb_syscfg\doc\CLB Tool Users Guide.pdf
|
||||
//!
|
||||
//
|
||||
//
|
||||
//#############################################################################
|
||||
//
|
||||
//
|
||||
// $Copyright:
|
||||
// Copyright (C) 2013-2024 Texas Instruments Incorporated - http://www.ti.com/
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions
|
||||
// are met:
|
||||
//
|
||||
// Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
//
|
||||
// Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
//
|
||||
// Neither the name of Texas Instruments Incorporated nor the names of
|
||||
// its contributors may be used to endorse or promote products derived
|
||||
// from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
// $
|
||||
//#############################################################################
|
||||
|
||||
|
||||
|
||||
#include "driverlib.h"
|
||||
#include "device.h"
|
||||
#include "clb_config.h"
|
||||
#include "clb.h"
|
||||
|
||||
__interrupt void clb1ISR(void);
|
||||
|
||||
#define COUNTER0_TIMER_ENABLE 0x1
|
||||
|
||||
|
||||
#define COUNTER0_INT_TAG 11
|
||||
#define COUNTER1_INT_TAG 12
|
||||
|
||||
|
||||
void main(void)
|
||||
{
|
||||
Device_init();
|
||||
Device_initGPIO();
|
||||
|
||||
Interrupt_initModule();
|
||||
Interrupt_initVectorTable();
|
||||
|
||||
Interrupt_register(INT_CLB1, &clb1ISR);
|
||||
Interrupt_enable(INT_CLB1);
|
||||
|
||||
//
|
||||
// Enabling EPWM1 to enable CLB1
|
||||
//
|
||||
SysCtl_enablePeripheral(SYSCTL_PERIPH_CLK_EPWM1);
|
||||
|
||||
CLB_enableCLB(CLB1_BASE);
|
||||
initTILE1(CLB1_BASE);
|
||||
|
||||
//
|
||||
// Select Global input instead of local input for all CLB IN
|
||||
//
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN0, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN1, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN2, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN3, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN4, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN5, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN6, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN7, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
|
||||
|
||||
//
|
||||
// Unused Inputs below
|
||||
//
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN0, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN1, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN2, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN3, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN4, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN5, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN6, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN7, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
|
||||
|
||||
//
|
||||
// Inputs set to GP register
|
||||
//
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN0, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN1, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN2, CLB_GP_IN_MUX_GP_REG);
|
||||
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN3, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN4, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN5, CLB_GP_IN_MUX_GP_REG);
|
||||
//
|
||||
// Unused inputs to GP register
|
||||
//
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN6, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN7, CLB_GP_IN_MUX_GP_REG);
|
||||
|
||||
//
|
||||
// Configure GPIO0 for Output
|
||||
//
|
||||
GPIO_setPinConfig(GPIO_0_GPIO0);
|
||||
GPIO_setDirectionMode(0, GPIO_DIR_MODE_OUT);
|
||||
GPIO_setPadConfig(0, GPIO_PIN_TYPE_STD);
|
||||
|
||||
//
|
||||
// Configure GPIO1 for Output
|
||||
//
|
||||
GPIO_setPinConfig(GPIO_1_GPIO1);
|
||||
GPIO_setDirectionMode(1, GPIO_DIR_MODE_OUT);
|
||||
GPIO_setPadConfig(1, GPIO_PIN_TYPE_STD);
|
||||
|
||||
//
|
||||
// Configure GPIO24 for OUTPUTXBAR1
|
||||
//
|
||||
GPIO_setPinConfig(GPIO_24_OUTPUTXBAR1);
|
||||
GPIO_setDirectionMode(24, GPIO_DIR_MODE_OUT);
|
||||
GPIO_setPadConfig(24, GPIO_PIN_TYPE_STD);
|
||||
|
||||
//
|
||||
// Configure GPIO16 for OUTPUTXBAR7
|
||||
//
|
||||
GPIO_setPinConfig(GPIO_16_OUTPUTXBAR7);
|
||||
GPIO_setDirectionMode(16, GPIO_DIR_MODE_OUT);
|
||||
GPIO_setPadConfig(16, GPIO_PIN_TYPE_STD);
|
||||
|
||||
//
|
||||
// Configure OUTPUT-XBAR OUTPUT1 as CLB1_OUT4
|
||||
//
|
||||
XBAR_setOutputMuxConfig(XBAR_OUTPUT1, XBAR_OUT_MUX01_CLB1_OUT4);
|
||||
XBAR_enableOutputMux(XBAR_OUTPUT1, XBAR_MUX01);
|
||||
|
||||
//
|
||||
// Configure OUTPUT-XBAR OUTPUT7 as CLB1_OUT5
|
||||
//
|
||||
XBAR_setOutputMuxConfig(XBAR_OUTPUT7, XBAR_OUT_MUX03_CLB1_OUT5);
|
||||
XBAR_enableOutputMux(XBAR_OUTPUT7, XBAR_MUX03);
|
||||
|
||||
CLB_setGPREG(CLB1_BASE, COUNTER0_TIMER_ENABLE);
|
||||
|
||||
|
||||
|
||||
//
|
||||
// Enable Global Interrupt (INTM) and realtime interrupt (DBGM)
|
||||
//
|
||||
EINT;
|
||||
ERTM;
|
||||
|
||||
|
||||
CLB_clearInterruptTag(CLB1_BASE);
|
||||
|
||||
|
||||
while(1)
|
||||
{
|
||||
asm(" NOP");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
__interrupt void clb1ISR(void)
|
||||
{
|
||||
uint16_t tag = CLB_getInterruptTag(CLB1_BASE);
|
||||
if (tag == COUNTER0_INT_TAG)
|
||||
{
|
||||
GPIO_togglePin(0);
|
||||
}
|
||||
if (tag == COUNTER1_INT_TAG)
|
||||
{
|
||||
GPIO_togglePin(1);
|
||||
}
|
||||
|
||||
CLB_clearInterruptTag(CLB1_BASE);
|
||||
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP5);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
|
||||
var TILE = scripting.addModule("/utilities/clb_tool/clb_syscfg/source/TILE");
|
||||
var TILE1 = TILE.addInstance();
|
||||
// clock_period - Period of the clock (in Nano Seconds) used for simulation in System C
|
||||
TILE.clock_period = 10;
|
||||
// sim_duration - Duration of the simulation (in Nano Seconds)
|
||||
TILE.sim_duration = 100000;
|
||||
// Name
|
||||
TILE1.$name = "TILE1";
|
||||
// in_repeat_count0 - Number of periods the waveform is repeated
|
||||
TILE1.BOUNDARY.in_repeat_count0 = 50;
|
||||
// in0
|
||||
TILE1.BOUNDARY.in0 = "squareWave";
|
||||
// in_repeat_count1 - Number of periods the waveform is repeated
|
||||
TILE1.BOUNDARY.in_repeat_count1 = 50;
|
||||
// in_repeat_count2 - Number of periods the waveform is repeated
|
||||
TILE1.BOUNDARY.in_repeat_count2 = 50;
|
||||
// in_period0 - Period of the square wave
|
||||
TILE1.BOUNDARY.in_period0 = 10000;
|
||||
// in_duty0 - Duty or ON time of the square wave
|
||||
TILE1.BOUNDARY.in_duty0 = 5001;
|
||||
// in_period1 - Period of the square wave
|
||||
TILE1.BOUNDARY.in_period1 = 1000;
|
||||
// in_duty1 - Duty or ON time of the square wave
|
||||
TILE1.BOUNDARY.in_duty1 = 500;
|
||||
// in_period2 - Period of the square wave
|
||||
TILE1.BOUNDARY.in_period2 = 3000;
|
||||
// in_duty2 - Duty or ON time of the square wave
|
||||
TILE1.BOUNDARY.in_duty2 = 1500;
|
||||
// in1
|
||||
TILE1.BOUNDARY.in1 = "1";
|
||||
// in2
|
||||
TILE1.BOUNDARY.in2 = "1";
|
||||
// in_period3 - Period of the square wave
|
||||
TILE1.BOUNDARY.in_period3 = 10000;
|
||||
// in_duty3 - Duty or ON time of the square wave
|
||||
TILE1.BOUNDARY.in_duty3 = 5001;
|
||||
// in_repeat_count3 - Number of periods the waveform is repeated
|
||||
TILE1.BOUNDARY.in_repeat_count3 = 50;
|
||||
// in3
|
||||
TILE1.BOUNDARY.in3 = "0";
|
||||
// in4
|
||||
TILE1.BOUNDARY.in4 = "0";
|
||||
// in5
|
||||
TILE1.BOUNDARY.in5 = "0";
|
||||
// match1_val - Sets the value of the Match reference 1 register.
|
||||
TILE1.COUNTER_0.match1_val = "700";
|
||||
// event - Trigger actions in the counter.
|
||||
TILE1.COUNTER_0.event = "COUNTER_0.count_zero";
|
||||
// match2_val - Sets the value of the Match reference 2 register.
|
||||
TILE1.COUNTER_0.match2_val = "1600";
|
||||
// event_load_val - Sets the value of the event load value register.
|
||||
TILE1.COUNTER_0.event_load_val = "2000";
|
||||
// mode0 - Enables Counting when high
|
||||
TILE1.COUNTER_0.mode0 = "BOUNDARY.in0";
|
||||
// What action should be taken on an event trigger?
|
||||
TILE1.COUNTER_0.action = "Load";
|
||||
// eqn - Boolean equation on the variables i2,i1,i0 for the OUTLUT output.
|
||||
TILE1.OUTLUT_4.eqn = "i0";
|
||||
// i0 - Input 0.
|
||||
TILE1.OUTLUT_4.i0 = "COUNTER_0.count_match1";
|
||||
// eqn - Boolean equation on the variables i2,i1,i0 for the OUTLUT output.
|
||||
TILE1.OUTLUT_5.eqn = "i0";
|
||||
// i0 - Input 0.
|
||||
TILE1.OUTLUT_5.i0 = "COUNTER_0.count_match2";
|
||||
// Event 0 (e0) - Event 0
|
||||
TILE1.HLC.e0 = "COUNTER_0.count_match1";
|
||||
// Event 1 (e1) - Event 1
|
||||
TILE1.HLC.e1 = "COUNTER_0.count_match2";
|
||||
// instruct0
|
||||
TILE1.HLC.program0.instruct0 = "INTR 11";
|
||||
// instruct0
|
||||
TILE1.HLC.program1.instruct0 = "INTR 12";
|
||||
|
||||
@@ -0,0 +1,333 @@
|
||||
//#############################################################################
|
||||
//
|
||||
// FILE: clb_ex12_output_intersect.c
|
||||
//
|
||||
// TITLE: CLB Output Intersect.
|
||||
//
|
||||
//! \addtogroup driver_example_list
|
||||
//! <h1>CLB Output Intersect</h1>
|
||||
//!
|
||||
//! For the detailed description of this example, please refer to:
|
||||
//! C2000Ware_PATH\utilities\clb_tool\clb_syscfg\doc\CLB Tool Users Guide.pdf
|
||||
//!
|
||||
//
|
||||
//
|
||||
//#############################################################################
|
||||
//
|
||||
//
|
||||
// $Copyright:
|
||||
// Copyright (C) 2013-2024 Texas Instruments Incorporated - http://www.ti.com/
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions
|
||||
// are met:
|
||||
//
|
||||
// Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
//
|
||||
// Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
//
|
||||
// Neither the name of Texas Instruments Incorporated nor the names of
|
||||
// its contributors may be used to endorse or promote products derived
|
||||
// from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
// $
|
||||
//#############################################################################
|
||||
|
||||
|
||||
|
||||
#include "driverlib.h"
|
||||
#include "device.h"
|
||||
#include "clb_config.h"
|
||||
#include "clb.h"
|
||||
|
||||
__interrupt void clb1ISR(void);
|
||||
|
||||
|
||||
#define EPWM_TIMER_TBPRD 2000
|
||||
|
||||
//
|
||||
// Function Prototypes
|
||||
//
|
||||
void initEPWM(uint32_t epwm_base);
|
||||
void initOff180EPWM(uint32_t epwm_base);
|
||||
uint16_t dutyValue = 0;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
Device_init();
|
||||
Device_initGPIO();
|
||||
|
||||
Interrupt_initModule();
|
||||
Interrupt_initVectorTable();
|
||||
|
||||
//
|
||||
// Disable sync(Freeze clock to PWM as well). GTBCLKSYNC is applicable
|
||||
// only for multiple core devices. Uncomment the below statement if
|
||||
// applicable.
|
||||
//
|
||||
// SysCtl_disablePeripheral(SYSCTL_PERIPH_CLK_GTBCLKSYNC);
|
||||
SysCtl_disablePeripheral(SYSCTL_PERIPH_CLK_TBCLKSYNC);
|
||||
initEPWM(EPWM2_BASE);
|
||||
initOff180EPWM(EPWM3_BASE);
|
||||
EPWM_setupEPWMLinks(EPWM3_BASE, EPWM_LINK_WITH_EPWM_2, EPWM_LINK_COMP_A);
|
||||
EPWM_setSyncOutPulseMode(EPWM2_BASE, EPWM_SYNC_OUT_PULSE_ON_COUNTER_ZERO);
|
||||
EPWM_enablePhaseShiftLoad(EPWM3_BASE);
|
||||
//
|
||||
// Enable sync and clock to PWM
|
||||
//
|
||||
|
||||
SysCtl_enablePeripheral(SYSCTL_PERIPH_CLK_TBCLKSYNC);
|
||||
|
||||
Interrupt_register(INT_CLB1, &clb1ISR);
|
||||
Interrupt_enable(INT_CLB1);
|
||||
|
||||
//
|
||||
// Enabling EPWM1 to enable CLB1
|
||||
//
|
||||
SysCtl_enablePeripheral(SYSCTL_PERIPH_CLK_EPWM1);
|
||||
|
||||
CLB_enableCLB(CLB1_BASE);
|
||||
initTILE1(CLB1_BASE);
|
||||
|
||||
//
|
||||
// Select Global input instead of local input for all CLB IN
|
||||
//
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN0, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN1, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN2, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN3, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN4, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN5, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN6, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN7, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
|
||||
//
|
||||
// Select EPWM2A and EPWM3A
|
||||
//
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN0, CLB_GLOBAL_IN_MUX_EPWM2A);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN1, CLB_GLOBAL_IN_MUX_EPWM3A);
|
||||
|
||||
//
|
||||
// Unused Inputs below
|
||||
//
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN2, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN3, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN4, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN5, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN6, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN7, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
|
||||
|
||||
//
|
||||
// Inputs set to External
|
||||
//
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN0, CLB_GP_IN_MUX_EXTERNAL);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN1, CLB_GP_IN_MUX_EXTERNAL);
|
||||
|
||||
//
|
||||
// Unused inputs to GP register
|
||||
//
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN2, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN3, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN4, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN5, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN6, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN7, CLB_GP_IN_MUX_GP_REG);
|
||||
|
||||
//
|
||||
// Configure GPIO0 for EPWM1A
|
||||
//
|
||||
GPIO_setPinConfig(GPIO_0_EPWM1A);
|
||||
GPIO_setDirectionMode(0, GPIO_DIR_MODE_OUT);
|
||||
GPIO_setPadConfig(0, GPIO_PIN_TYPE_STD);
|
||||
|
||||
//
|
||||
// Configure GPIO2 for EPWM2A
|
||||
//
|
||||
GPIO_setPinConfig(GPIO_2_EPWM2A);
|
||||
GPIO_setDirectionMode(2, GPIO_DIR_MODE_OUT);
|
||||
GPIO_setPadConfig(2, GPIO_PIN_TYPE_STD);
|
||||
|
||||
//
|
||||
// Configure GPIO2 for EPWM3A
|
||||
//
|
||||
GPIO_setPinConfig(GPIO_4_EPWM3A);
|
||||
GPIO_setDirectionMode(4, GPIO_DIR_MODE_OUT);
|
||||
GPIO_setPadConfig(4, GPIO_PIN_TYPE_STD);
|
||||
|
||||
|
||||
//
|
||||
// Enable Global Interrupt (INTM) and realtime interrupt (DBGM)
|
||||
//
|
||||
EINT;
|
||||
ERTM;
|
||||
|
||||
|
||||
CLB_clearInterruptTag(CLB1_BASE);
|
||||
|
||||
//
|
||||
// Enable OUT1 to replace EPWM1A
|
||||
//
|
||||
CLB_setOutputMask(CLB1_BASE, 1 << 0, true);
|
||||
|
||||
//EPWM1A is EPWM2A ANDED with EPWM3A
|
||||
|
||||
for(;;)
|
||||
{
|
||||
SysCtl_delay(100000);
|
||||
dutyValue ++;
|
||||
if (dutyValue >= EPWM_TIMER_TBPRD)
|
||||
dutyValue = 0;
|
||||
EPWM_setCounterCompareValue(EPWM2_BASE, EPWM_COUNTER_COMPARE_A, dutyValue);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
__interrupt void clb1ISR(void)
|
||||
{
|
||||
|
||||
CLB_clearInterruptTag(CLB1_BASE);
|
||||
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP5);
|
||||
}
|
||||
|
||||
|
||||
void initEPWM(uint32_t epwm_base)
|
||||
{
|
||||
//
|
||||
// Set-up TBCLK
|
||||
//
|
||||
EPWM_setTimeBasePeriod(epwm_base, EPWM_TIMER_TBPRD);
|
||||
EPWM_setPhaseShift(epwm_base, 0U);
|
||||
EPWM_setTimeBaseCounter(epwm_base, 0U);
|
||||
|
||||
//
|
||||
// Set Compare values
|
||||
//
|
||||
EPWM_setCounterCompareValue(epwm_base,
|
||||
EPWM_COUNTER_COMPARE_A,
|
||||
2*EPWM_TIMER_TBPRD/3);
|
||||
EPWM_setCounterCompareValue(epwm_base,
|
||||
EPWM_COUNTER_COMPARE_B,
|
||||
2*EPWM_TIMER_TBPRD/3);
|
||||
|
||||
//
|
||||
// Set up counter mode
|
||||
//
|
||||
EPWM_setTimeBaseCounterMode(epwm_base, EPWM_COUNTER_MODE_UP);
|
||||
EPWM_disablePhaseShiftLoad(epwm_base);
|
||||
EPWM_setClockPrescaler(epwm_base,
|
||||
EPWM_CLOCK_DIVIDER_8,
|
||||
EPWM_HSCLOCK_DIVIDER_1);
|
||||
|
||||
//
|
||||
// Set up shadowing
|
||||
//
|
||||
EPWM_setCounterCompareShadowLoadMode(epwm_base,
|
||||
EPWM_COUNTER_COMPARE_A,
|
||||
EPWM_COMP_LOAD_ON_CNTR_ZERO);
|
||||
EPWM_setCounterCompareShadowLoadMode(epwm_base,
|
||||
EPWM_COUNTER_COMPARE_B,
|
||||
EPWM_COMP_LOAD_ON_CNTR_ZERO);
|
||||
|
||||
//
|
||||
// Set actions
|
||||
//
|
||||
|
||||
EPWM_setActionQualifierAction(epwm_base,
|
||||
EPWM_AQ_OUTPUT_A,
|
||||
EPWM_AQ_OUTPUT_HIGH,
|
||||
EPWM_AQ_OUTPUT_ON_TIMEBASE_ZERO);
|
||||
|
||||
|
||||
EPWM_setActionQualifierAction(epwm_base,
|
||||
EPWM_AQ_OUTPUT_B,
|
||||
EPWM_AQ_OUTPUT_HIGH,
|
||||
EPWM_AQ_OUTPUT_ON_TIMEBASE_ZERO);
|
||||
|
||||
EPWM_setActionQualifierAction(epwm_base,
|
||||
EPWM_AQ_OUTPUT_A,
|
||||
EPWM_AQ_OUTPUT_LOW,
|
||||
EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPA);
|
||||
EPWM_setActionQualifierAction(epwm_base,
|
||||
EPWM_AQ_OUTPUT_B,
|
||||
EPWM_AQ_OUTPUT_LOW,
|
||||
EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPB);
|
||||
|
||||
}
|
||||
|
||||
|
||||
void initOff180EPWM(uint32_t epwm_base)
|
||||
{
|
||||
//
|
||||
// Set-up TBCLK
|
||||
//
|
||||
EPWM_selectPeriodLoadEvent(epwm_base, EPWM_SHADOW_LOAD_MODE_SYNC);
|
||||
EPWM_setTimeBasePeriod(epwm_base, EPWM_TIMER_TBPRD);
|
||||
EPWM_setPhaseShift(epwm_base, EPWM_TIMER_TBPRD/2);
|
||||
EPWM_setTimeBaseCounter(epwm_base, EPWM_TIMER_TBPRD/2);
|
||||
|
||||
//
|
||||
// Set Compare values
|
||||
//
|
||||
EPWM_setCounterCompareValue(epwm_base,
|
||||
EPWM_COUNTER_COMPARE_A,
|
||||
2*EPWM_TIMER_TBPRD/3);
|
||||
EPWM_setCounterCompareValue(epwm_base,
|
||||
EPWM_COUNTER_COMPARE_B,
|
||||
2*EPWM_TIMER_TBPRD/3);
|
||||
|
||||
//
|
||||
// Set up counter mode
|
||||
//
|
||||
EPWM_setTimeBaseCounterMode(epwm_base, EPWM_COUNTER_MODE_UP);
|
||||
EPWM_disablePhaseShiftLoad(epwm_base);
|
||||
EPWM_setClockPrescaler(epwm_base,
|
||||
EPWM_CLOCK_DIVIDER_8,
|
||||
EPWM_HSCLOCK_DIVIDER_1);
|
||||
|
||||
//
|
||||
// Set up shadowing
|
||||
//
|
||||
EPWM_setCounterCompareShadowLoadMode(epwm_base,
|
||||
EPWM_COUNTER_COMPARE_A,
|
||||
EPWM_COMP_LOAD_ON_CNTR_ZERO);
|
||||
EPWM_setCounterCompareShadowLoadMode(epwm_base,
|
||||
EPWM_COUNTER_COMPARE_B,
|
||||
EPWM_COMP_LOAD_ON_CNTR_ZERO);
|
||||
|
||||
//
|
||||
// Set actions
|
||||
//
|
||||
EPWM_setActionQualifierAction(epwm_base,
|
||||
EPWM_AQ_OUTPUT_A,
|
||||
EPWM_AQ_OUTPUT_HIGH,
|
||||
EPWM_AQ_OUTPUT_ON_TIMEBASE_ZERO);
|
||||
EPWM_setActionQualifierAction(epwm_base,
|
||||
EPWM_AQ_OUTPUT_B,
|
||||
EPWM_AQ_OUTPUT_HIGH,
|
||||
EPWM_AQ_OUTPUT_ON_TIMEBASE_ZERO);
|
||||
EPWM_setActionQualifierAction(epwm_base,
|
||||
EPWM_AQ_OUTPUT_A,
|
||||
EPWM_AQ_OUTPUT_LOW,
|
||||
EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPA);
|
||||
EPWM_setActionQualifierAction(epwm_base,
|
||||
EPWM_AQ_OUTPUT_B,
|
||||
EPWM_AQ_OUTPUT_LOW,
|
||||
EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPB);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
|
||||
var TILE = scripting.addModule("/utilities/clb_tool/clb_syscfg/source/TILE");
|
||||
var TILE1 = TILE.addInstance();
|
||||
// clock_period - Period of the clock (in Nano Seconds) used for simulation in System C
|
||||
TILE.clock_period = 10;
|
||||
// sim_duration - Duration of the simulation (in Nano Seconds)
|
||||
TILE.sim_duration = 100000;
|
||||
// Name
|
||||
TILE1.$name = "TILE1";
|
||||
// in_repeat_count0 - Number of periods the waveform is repeated
|
||||
TILE1.BOUNDARY.in_repeat_count0 = 50;
|
||||
// in0
|
||||
TILE1.BOUNDARY.in0 = "squareWave";
|
||||
// in_repeat_count1 - Number of periods the waveform is repeated
|
||||
TILE1.BOUNDARY.in_repeat_count1 = 50;
|
||||
// in_repeat_count2 - Number of periods the waveform is repeated
|
||||
TILE1.BOUNDARY.in_repeat_count2 = 50;
|
||||
// in_period2 - Period of the square wave
|
||||
TILE1.BOUNDARY.in_period2 = 3000;
|
||||
// in_duty2 - Duty or ON time of the square wave
|
||||
TILE1.BOUNDARY.in_duty2 = 1500;
|
||||
// in_period3 - Period of the square wave
|
||||
TILE1.BOUNDARY.in_period3 = 10000;
|
||||
// in_duty3 - Duty or ON time of the square wave
|
||||
TILE1.BOUNDARY.in_duty3 = 5001;
|
||||
// in_repeat_count3 - Number of periods the waveform is repeated
|
||||
TILE1.BOUNDARY.in_repeat_count3 = 50;
|
||||
// in3
|
||||
TILE1.BOUNDARY.in3 = "0";
|
||||
// in4
|
||||
TILE1.BOUNDARY.in4 = "0";
|
||||
// in5
|
||||
TILE1.BOUNDARY.in5 = "0";
|
||||
// in_period0 - Period of the square wave
|
||||
TILE1.BOUNDARY.in_period0 = 500;
|
||||
// in_duty0 - Duty or ON time of the square wave
|
||||
TILE1.BOUNDARY.in_duty0 = 250;
|
||||
// in1
|
||||
TILE1.BOUNDARY.in1 = "squareWave";
|
||||
// in_period1 - Period of the square wave
|
||||
TILE1.BOUNDARY.in_period1 = 750;
|
||||
// in_duty1 - Duty or ON time of the square wave
|
||||
TILE1.BOUNDARY.in_duty1 = 250;
|
||||
// in2
|
||||
TILE1.BOUNDARY.in2 = "0";
|
||||
// i0 - Input 0.
|
||||
TILE1.LUT_0.i0 = "BOUNDARY.in0";
|
||||
// i1 - Input 1.
|
||||
TILE1.LUT_0.i1 = "BOUNDARY.in1";
|
||||
// eqn - Boolean equation on the variables i3,i2,i1,i0 for the LUT output.
|
||||
TILE1.LUT_0.eqn = "i0 & i1";
|
||||
// eqn - Boolean equation on the variables i2,i1,i0 for the OUTLUT output.
|
||||
TILE1.OUTLUT_0.eqn = "i0";
|
||||
// i0 - Input 0.
|
||||
TILE1.OUTLUT_0.i0 = "LUT_0.OUT";
|
||||
// instruct0
|
||||
TILE1.HLC.program0.instruct0 = "INTR 11";
|
||||
// instruct0
|
||||
TILE1.HLC.program1.instruct0 = "INTR 12";
|
||||
|
||||
@@ -0,0 +1,196 @@
|
||||
//#############################################################################
|
||||
//
|
||||
// FILE: clb_ex13_push_pull.c
|
||||
//
|
||||
// TITLE: CLB PUSH PULL.
|
||||
//
|
||||
//! \addtogroup driver_example_list
|
||||
//! <h1>CLB PUSH PULL</h1>
|
||||
//!
|
||||
//! For the detailed description of this example, please refer to:
|
||||
//! C2000Ware_PATH\utilities\clb_tool\clb_syscfg\doc\CLB Tool Users Guide.pdf
|
||||
//!
|
||||
//
|
||||
//
|
||||
//#############################################################################
|
||||
//
|
||||
//
|
||||
// $Copyright:
|
||||
// Copyright (C) 2013-2024 Texas Instruments Incorporated - http://www.ti.com/
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions
|
||||
// are met:
|
||||
//
|
||||
// Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
//
|
||||
// Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
//
|
||||
// Neither the name of Texas Instruments Incorporated nor the names of
|
||||
// its contributors may be used to endorse or promote products derived
|
||||
// from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
// $
|
||||
//#############################################################################
|
||||
|
||||
|
||||
|
||||
#include "driverlib.h"
|
||||
#include "device.h"
|
||||
#include "clb_config.h"
|
||||
#include "clb.h"
|
||||
|
||||
__interrupt void clb1ISR(void);
|
||||
|
||||
#define FRC_LOAD 0x1
|
||||
|
||||
|
||||
void main(void)
|
||||
{
|
||||
Device_init();
|
||||
Device_initGPIO();
|
||||
|
||||
Interrupt_initModule();
|
||||
Interrupt_initVectorTable();
|
||||
|
||||
Interrupt_register(INT_CLB1, &clb1ISR);
|
||||
Interrupt_enable(INT_CLB1);
|
||||
|
||||
//
|
||||
// Enabling EPWM1 to enable CLB1
|
||||
//
|
||||
SysCtl_enablePeripheral(SYSCTL_PERIPH_CLK_EPWM1);
|
||||
|
||||
CLB_enableCLB(CLB1_BASE);
|
||||
initTILE1(CLB1_BASE);
|
||||
|
||||
//
|
||||
// Select Global input instead of local input for all CLB IN
|
||||
//
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN0, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN1, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN2, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN3, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN4, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN5, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN6, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN7, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
|
||||
|
||||
//
|
||||
// Unused Inputs below
|
||||
//
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN0, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN1, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN2, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN3, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN4, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN5, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN6, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN7, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
|
||||
|
||||
//
|
||||
// Inputs set to GP register
|
||||
//
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN0, CLB_GP_IN_MUX_GP_REG);
|
||||
//
|
||||
// Unused inputs to GP register
|
||||
//
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN1, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN2, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN3, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN4, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN5, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN6, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN7, CLB_GP_IN_MUX_GP_REG);
|
||||
|
||||
//
|
||||
// Configure GPIO0 for Output
|
||||
//
|
||||
GPIO_setPinConfig(GPIO_0_EPWM1A);
|
||||
GPIO_setDirectionMode(0, GPIO_DIR_MODE_OUT);
|
||||
GPIO_setPadConfig(0, GPIO_PIN_TYPE_STD);
|
||||
|
||||
//
|
||||
// Configure GPIO1 for Output
|
||||
//
|
||||
GPIO_setPinConfig(GPIO_1_EPWM1B);
|
||||
GPIO_setDirectionMode(1, GPIO_DIR_MODE_OUT);
|
||||
GPIO_setPadConfig(1, GPIO_PIN_TYPE_STD);
|
||||
|
||||
//
|
||||
// Configure GPIO24 for OUTPUTXBAR1
|
||||
//
|
||||
GPIO_setPinConfig(GPIO_24_OUTPUTXBAR1);
|
||||
GPIO_setDirectionMode(24, GPIO_DIR_MODE_OUT);
|
||||
GPIO_setPadConfig(24, GPIO_PIN_TYPE_STD);
|
||||
|
||||
//
|
||||
// Configure OUTPUT-XBAR OUTPUT1 as CLB1_OUT4
|
||||
//
|
||||
XBAR_setOutputMuxConfig(XBAR_OUTPUT1, XBAR_OUT_MUX01_CLB1_OUT4);
|
||||
XBAR_enableOutputMux(XBAR_OUTPUT1, XBAR_MUX01);
|
||||
|
||||
|
||||
CLB_setGPREG(CLB1_BASE, 0);
|
||||
|
||||
|
||||
|
||||
//
|
||||
// Enable Global Interrupt (INTM) and realtime interrupt (DBGM)
|
||||
//
|
||||
EINT;
|
||||
ERTM;
|
||||
|
||||
|
||||
CLB_clearInterruptTag(CLB1_BASE);
|
||||
//
|
||||
// Enable OUT4 & OUT0 & OUT2
|
||||
//
|
||||
CLB_setOutputMask(CLB1_BASE, 1 << 0 | 1 << 2, true);
|
||||
|
||||
while(1)
|
||||
{
|
||||
SysCtl_delay(20000000);
|
||||
HWREG(CLB1_BASE + CLB_LOGICCTL + CLB_O_BUF_PTR) = 0U;
|
||||
HWREG(CLB1_BASE + CLB_DATAEXCH + CLB_O_PULL(0)) = 500U;
|
||||
HWREG(CLB1_BASE + CLB_DATAEXCH + CLB_O_PULL(1)) = 1000U;
|
||||
HWREG(CLB1_BASE + CLB_DATAEXCH + CLB_O_PULL(2)) = 2000U;
|
||||
CLB_setGPREG(CLB1_BASE, FRC_LOAD);
|
||||
CLB_setGPREG(CLB1_BASE, 0);
|
||||
SysCtl_delay(20000000);
|
||||
HWREG(CLB1_BASE + CLB_LOGICCTL + CLB_O_BUF_PTR) = 0U;
|
||||
HWREG(CLB1_BASE + CLB_DATAEXCH + CLB_O_PULL(0)) = 1000U;
|
||||
HWREG(CLB1_BASE + CLB_DATAEXCH + CLB_O_PULL(1)) = 2000U;
|
||||
HWREG(CLB1_BASE + CLB_DATAEXCH + CLB_O_PULL(2)) = 4000U;
|
||||
CLB_setGPREG(CLB1_BASE, FRC_LOAD);
|
||||
CLB_setGPREG(CLB1_BASE, 0);
|
||||
asm(" NOP");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
__interrupt void clb1ISR(void)
|
||||
{
|
||||
|
||||
|
||||
CLB_clearInterruptTag(CLB1_BASE);
|
||||
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP5);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
|
||||
var TILE = scripting.addModule("/utilities/clb_tool/clb_syscfg/source/TILE");
|
||||
var TILE1 = TILE.addInstance();
|
||||
// clock_period - Period of the clock (in Nano Seconds) used for simulation in System C
|
||||
TILE.clock_period = 10;
|
||||
// sim_duration - Duration of the simulation (in Nano Seconds)
|
||||
TILE.sim_duration = 100000;
|
||||
// Name
|
||||
TILE1.$name = "TILE1";
|
||||
// in_repeat_count0 - Number of periods the waveform is repeated
|
||||
TILE1.BOUNDARY.in_repeat_count0 = 50;
|
||||
// in_repeat_count1 - Number of periods the waveform is repeated
|
||||
TILE1.BOUNDARY.in_repeat_count1 = 50;
|
||||
// in_repeat_count2 - Number of periods the waveform is repeated
|
||||
TILE1.BOUNDARY.in_repeat_count2 = 50;
|
||||
// in_period0 - Period of the square wave
|
||||
TILE1.BOUNDARY.in_period0 = 10000;
|
||||
// in_duty0 - Duty or ON time of the square wave
|
||||
TILE1.BOUNDARY.in_duty0 = 5001;
|
||||
// in_period1 - Period of the square wave
|
||||
TILE1.BOUNDARY.in_period1 = 1000;
|
||||
// in_duty1 - Duty or ON time of the square wave
|
||||
TILE1.BOUNDARY.in_duty1 = 500;
|
||||
// in_period2 - Period of the square wave
|
||||
TILE1.BOUNDARY.in_period2 = 3000;
|
||||
// in_duty2 - Duty or ON time of the square wave
|
||||
TILE1.BOUNDARY.in_duty2 = 1500;
|
||||
// in_period3 - Period of the square wave
|
||||
TILE1.BOUNDARY.in_period3 = 10000;
|
||||
// in_duty3 - Duty or ON time of the square wave
|
||||
TILE1.BOUNDARY.in_duty3 = 5001;
|
||||
// in_repeat_count3 - Number of periods the waveform is repeated
|
||||
TILE1.BOUNDARY.in_repeat_count3 = 50;
|
||||
// in3
|
||||
TILE1.BOUNDARY.in3 = "0";
|
||||
// in4
|
||||
TILE1.BOUNDARY.in4 = "0";
|
||||
// in5
|
||||
TILE1.BOUNDARY.in5 = "0";
|
||||
// in1
|
||||
TILE1.BOUNDARY.in1 = "0";
|
||||
// in2
|
||||
TILE1.BOUNDARY.in2 = "0";
|
||||
// e0 - External Input 0.
|
||||
TILE1.FSM_0.e0 = "COUNTER_0.count_match1";
|
||||
// eqn_s0 - Boolean equation on the variables e1,e0,s1,s0 for the S0 output.
|
||||
TILE1.FSM_0.eqn_s0 = "e0 ^ s0";
|
||||
// eqn_s1 - Boolean equation on the variables e1,e0,s1,s0 for the S1 output.
|
||||
TILE1.FSM_0.eqn_s1 = "e1 ^ s1";
|
||||
// e1 - External Input 1.
|
||||
TILE1.FSM_0.e1 = "COUNTER_1.count_match1";
|
||||
// e0 - External Input 0.
|
||||
TILE1.FSM_1.e0 = "COUNTER_2.count_match1";
|
||||
// eqn_s0 - Boolean equation on the variables e1,e0,s1,s0 for the S0 output.
|
||||
TILE1.FSM_1.eqn_s0 = "e0 ^ s0";
|
||||
// What action should be taken on an event trigger?
|
||||
TILE1.COUNTER_0.action = "Load";
|
||||
// mode0 - Enables Counting when high
|
||||
TILE1.COUNTER_0.mode0 = "1";
|
||||
// mode1 - Controls counting direction. High enables count up. Low enables count down.
|
||||
TILE1.COUNTER_0.mode1 = "1";
|
||||
// reset - Reset the counter to 0 on next clock cycle (triggers low to high)
|
||||
TILE1.COUNTER_0.reset = "COUNTER_0.count_match1";
|
||||
// match1_val - Sets the value of the Match reference 1 register.
|
||||
TILE1.COUNTER_0.match1_val = "2000";
|
||||
// event - Trigger actions in the counter.
|
||||
TILE1.COUNTER_0.event = "BOUNDARY.in0";
|
||||
// reset - Reset the counter to 0 on next clock cycle (triggers low to high)
|
||||
TILE1.COUNTER_1.reset = "COUNTER_1.count_match1";
|
||||
// mode0 - Enables Counting when high
|
||||
TILE1.COUNTER_1.mode0 = "1";
|
||||
// mode1 - Controls counting direction. High enables count up. Low enables count down.
|
||||
TILE1.COUNTER_1.mode1 = "1";
|
||||
// match1_val - Sets the value of the Match reference 1 register.
|
||||
TILE1.COUNTER_1.match1_val = "4000";
|
||||
// event - Trigger actions in the counter.
|
||||
TILE1.COUNTER_1.event = "BOUNDARY.in0";
|
||||
// What action should be taken on an event trigger?
|
||||
TILE1.COUNTER_1.action = "Load";
|
||||
// reset - Reset the counter to 0 on next clock cycle (triggers low to high)
|
||||
TILE1.COUNTER_2.reset = "COUNTER_2.count_match1";
|
||||
// mode0 - Enables Counting when high
|
||||
TILE1.COUNTER_2.mode0 = "1";
|
||||
// mode1 - Controls counting direction. High enables count up. Low enables count down.
|
||||
TILE1.COUNTER_2.mode1 = "1";
|
||||
// match1_val - Sets the value of the Match reference 1 register.
|
||||
TILE1.COUNTER_2.match1_val = "8000";
|
||||
// event - Trigger actions in the counter.
|
||||
TILE1.COUNTER_2.event = "BOUNDARY.in0";
|
||||
// What action should be taken on an event trigger?
|
||||
TILE1.COUNTER_2.action = "Load";
|
||||
// i0 - Input 0.
|
||||
TILE1.OUTLUT_0.i0 = "FSM_0.S0";
|
||||
// eqn - Boolean equation on the variables i2,i1,i0 for the OUTLUT output.
|
||||
TILE1.OUTLUT_0.eqn = "i0";
|
||||
// eqn - Boolean equation on the variables i2,i1,i0 for the OUTLUT output.
|
||||
TILE1.OUTLUT_2.eqn = "i0";
|
||||
// i0 - Input 0.
|
||||
TILE1.OUTLUT_2.i0 = "FSM_0.S1";
|
||||
// eqn - Boolean equation on the variables i2,i1,i0 for the OUTLUT output.
|
||||
TILE1.OUTLUT_4.eqn = "i0";
|
||||
// i0 - Input 0.
|
||||
TILE1.OUTLUT_4.i0 = "FSM_1.S0";
|
||||
// Event 0 (e0) - Event 0
|
||||
TILE1.HLC.e0 = "BOUNDARY.in0";
|
||||
// instruct0
|
||||
TILE1.HLC.program0.instruct0 = "PULL R0";
|
||||
// instruct1
|
||||
TILE1.HLC.program0.instruct1 = "MOV_T1 R0,C0";
|
||||
// instruct2
|
||||
TILE1.HLC.program0.instruct2 = "PULL R0";
|
||||
// instruct3
|
||||
TILE1.HLC.program0.instruct3 = "MOV_T1 R0,C1";
|
||||
// instruct4
|
||||
TILE1.HLC.program0.instruct4 = "PULL R0";
|
||||
// instruct5
|
||||
TILE1.HLC.program0.instruct5 = "MOV_T1 R0,C2";
|
||||
// instruct6
|
||||
TILE1.HLC.program0.instruct6 = "PULL R0";
|
||||
|
||||
@@ -0,0 +1,203 @@
|
||||
//#############################################################################
|
||||
//
|
||||
// FILE: clb_ex14_multi_tile.c
|
||||
//
|
||||
// TITLE: CLB Multi Tile.
|
||||
//
|
||||
//! \addtogroup driver_example_list
|
||||
//! <h1>CLB Multi Tile</h1>
|
||||
//!
|
||||
//! For the detailed description of this example, please refer to:
|
||||
//! C2000Ware_PATH\utilities\clb_tool\clb_syscfg\doc\CLB Tool Users Guide.pdf
|
||||
//!
|
||||
//
|
||||
//
|
||||
//#############################################################################
|
||||
//
|
||||
//
|
||||
// $Copyright:
|
||||
// Copyright (C) 2013-2024 Texas Instruments Incorporated - http://www.ti.com/
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions
|
||||
// are met:
|
||||
//
|
||||
// Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
//
|
||||
// Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
//
|
||||
// Neither the name of Texas Instruments Incorporated nor the names of
|
||||
// its contributors may be used to endorse or promote products derived
|
||||
// from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
// $
|
||||
//#############################################################################
|
||||
|
||||
|
||||
|
||||
#include "driverlib.h"
|
||||
#include "device.h"
|
||||
#include "clb_config.h"
|
||||
#include "clb.h"
|
||||
|
||||
|
||||
void main(void)
|
||||
{
|
||||
Device_init();
|
||||
Device_initGPIO();
|
||||
|
||||
Interrupt_initModule();
|
||||
Interrupt_initVectorTable();
|
||||
|
||||
//
|
||||
// Enabling EPWM1/2 to enable CLB1/2
|
||||
//
|
||||
SysCtl_enablePeripheral(SYSCTL_PERIPH_CLK_EPWM1);
|
||||
SysCtl_enablePeripheral(SYSCTL_PERIPH_CLK_EPWM2);
|
||||
|
||||
CLB_enableCLB(CLB2_BASE);
|
||||
initTILE1(CLB1_BASE);
|
||||
CLB_enableCLB(CLB1_BASE);
|
||||
initTILE2(CLB2_BASE);
|
||||
|
||||
//
|
||||
// Select Global input instead of local input for all CLB IN
|
||||
//
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN0, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN1, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN2, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN3, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN4, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN5, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN6, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN7, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
|
||||
//
|
||||
// Select Global input instead of local input for all CLB IN
|
||||
//
|
||||
CLB_configLocalInputMux(CLB2_BASE, CLB_IN0, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB2_BASE, CLB_IN1, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB2_BASE, CLB_IN2, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB2_BASE, CLB_IN3, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB2_BASE, CLB_IN4, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB2_BASE, CLB_IN5, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB2_BASE, CLB_IN6, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB2_BASE, CLB_IN7, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
|
||||
//
|
||||
// Use CLB AUXSIG0 for IN0
|
||||
//
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN0, CLB_GLOBAL_IN_MUX_CLB_AUXSIG0);
|
||||
//
|
||||
// Unused Inputs below
|
||||
//
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN1, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN2, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN3, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN4, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN5, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN6, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN7, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
|
||||
//
|
||||
// Unused Inputs below
|
||||
//
|
||||
CLB_configGlobalInputMux(CLB2_BASE, CLB_IN0, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
CLB_configGlobalInputMux(CLB2_BASE, CLB_IN1, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
CLB_configGlobalInputMux(CLB2_BASE, CLB_IN2, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
CLB_configGlobalInputMux(CLB2_BASE, CLB_IN3, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
CLB_configGlobalInputMux(CLB2_BASE, CLB_IN4, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
CLB_configGlobalInputMux(CLB2_BASE, CLB_IN5, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
CLB_configGlobalInputMux(CLB2_BASE, CLB_IN6, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
CLB_configGlobalInputMux(CLB2_BASE, CLB_IN7, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
|
||||
//
|
||||
// Use external signal from global input
|
||||
//
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN0, CLB_GP_IN_MUX_EXTERNAL);
|
||||
//
|
||||
// Unused inputs to GP register
|
||||
//
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN1, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN2, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN3, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN4, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN5, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN6, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN7, CLB_GP_IN_MUX_GP_REG);
|
||||
|
||||
//
|
||||
// Unused inputs to GP register
|
||||
//
|
||||
CLB_configGPInputMux(CLB2_BASE, CLB_IN0, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB2_BASE, CLB_IN1, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB2_BASE, CLB_IN2, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB2_BASE, CLB_IN3, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB2_BASE, CLB_IN4, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB2_BASE, CLB_IN5, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB2_BASE, CLB_IN6, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB2_BASE, CLB_IN7, CLB_GP_IN_MUX_GP_REG);
|
||||
|
||||
//
|
||||
// Configure GPIO2 for OUTPUTXBAR1
|
||||
//
|
||||
GPIO_setPinConfig(GPIO_2_EPWM2A);
|
||||
GPIO_setDirectionMode(2, GPIO_DIR_MODE_OUT);
|
||||
GPIO_setPadConfig(2, GPIO_PIN_TYPE_STD);
|
||||
|
||||
//
|
||||
// Configure Input-XBAR INPUT1 to GPIO2
|
||||
//
|
||||
XBAR_setInputPin(XBAR_INPUT1, 2);
|
||||
|
||||
//
|
||||
// Configure CLB-XBAR AUXSIG0 as INPUT1
|
||||
//
|
||||
XBAR_setCLBMuxConfig(XBAR_AUXSIG0, XBAR_CLB_MUX01_INPUTXBAR1);
|
||||
XBAR_enableCLBMux(XBAR_AUXSIG0, XBAR_MUX01);
|
||||
|
||||
//
|
||||
// Configure GPIO24 for OUTPUTXBAR1
|
||||
//
|
||||
GPIO_setPinConfig(GPIO_24_OUTPUTXBAR1);
|
||||
GPIO_setDirectionMode(24, GPIO_DIR_MODE_OUT);
|
||||
GPIO_setPadConfig(24, GPIO_PIN_TYPE_STD);
|
||||
|
||||
//
|
||||
// Configure OUTPUT-XBAR OUTPUT1 as CLB1_OUT4
|
||||
//
|
||||
XBAR_setOutputMuxConfig(XBAR_OUTPUT1, XBAR_OUT_MUX01_CLB1_OUT4);
|
||||
XBAR_enableOutputMux(XBAR_OUTPUT1, XBAR_MUX01);
|
||||
|
||||
//
|
||||
// Enable Global Interrupt (INTM) and realtime interrupt (DBGM)
|
||||
//
|
||||
EINT;
|
||||
ERTM;
|
||||
|
||||
//
|
||||
// Enable OUT0
|
||||
//
|
||||
CLB_setOutputMask(CLB2_BASE, 1 << 0, true);
|
||||
|
||||
|
||||
while(1)
|
||||
{
|
||||
asm(" NOP");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
|
||||
var TILE = scripting.addModule("/utilities/clb_tool/clb_syscfg/source/TILE");
|
||||
var TILE1 = TILE.addInstance();
|
||||
var TILE2 = TILE.addInstance();
|
||||
// clock_period - Period of the clock (in Nano Seconds) used for simulation in System C
|
||||
TILE.clock_period = 10;
|
||||
// sim_duration - Duration of the simulation (in Nano Seconds)
|
||||
TILE.sim_duration = 100000;
|
||||
// Name
|
||||
TILE1.$name = "TILE2";
|
||||
// in_repeat_count0 - Number of periods the waveform is repeated
|
||||
TILE1.BOUNDARY.in_repeat_count0 = 50;
|
||||
// in_repeat_count3 - Number of periods the waveform is repeated
|
||||
TILE1.BOUNDARY.in_repeat_count3 = 1;
|
||||
// in_repeat_count1 - Number of periods the waveform is repeated
|
||||
TILE1.BOUNDARY.in_repeat_count1 = 50;
|
||||
// in_repeat_count2 - Number of periods the waveform is repeated
|
||||
TILE1.BOUNDARY.in_repeat_count2 = 50;
|
||||
// in_period0 - Period of the square wave
|
||||
TILE1.BOUNDARY.in_period0 = 10000;
|
||||
// in_duty0 - Duty or ON time of the square wave
|
||||
TILE1.BOUNDARY.in_duty0 = 5001;
|
||||
// in_period1 - Period of the square wave
|
||||
TILE1.BOUNDARY.in_period1 = 1000;
|
||||
// in_duty1 - Duty or ON time of the square wave
|
||||
TILE1.BOUNDARY.in_duty1 = 500;
|
||||
// in_period2 - Period of the square wave
|
||||
TILE1.BOUNDARY.in_period2 = 3000;
|
||||
// in_duty2 - Duty or ON time of the square wave
|
||||
TILE1.BOUNDARY.in_duty2 = 1500;
|
||||
// mode0 - Enables Counting when high
|
||||
TILE1.COUNTER_0.mode0 = "1";
|
||||
// mode1 - Controls counting direction. High enables count up. Low enables count down.
|
||||
TILE1.COUNTER_0.mode1 = "1";
|
||||
// match1_val - Sets the value of the Match reference 1 register.
|
||||
TILE1.COUNTER_0.match1_val = "1000";
|
||||
// reset - Reset the counter to 0 on next clock cycle (triggers low to high)
|
||||
TILE1.COUNTER_0.reset = "COUNTER_0.count_match1";
|
||||
// i0 - Input 0.
|
||||
TILE1.OUTLUT_0.i0 = "COUNTER_0.count_match1";
|
||||
// eqn - Boolean equation on the variables i2,i1,i0 for the OUTLUT output.
|
||||
TILE1.OUTLUT_0.eqn = "i0";
|
||||
// instruct0
|
||||
TILE1.HLC.program0.instruct0 = "INTR 0";
|
||||
// Name
|
||||
TILE2.$name = "TILE1";
|
||||
// in0
|
||||
TILE2.BOUNDARY.in0 = "TILE2_BOUNDARY.out0";
|
||||
// e0 - External Input 0.
|
||||
TILE2.FSM_0.e0 = "BOUNDARY.in0";
|
||||
// eqn_s0 - Boolean equation on the variables e1,e0,s1,s0 for the S0 output.
|
||||
TILE2.FSM_0.eqn_s0 = "e0 ^ s0";
|
||||
// i0 - Input 0.
|
||||
TILE2.OUTLUT_4.i0 = "FSM_0.S0";
|
||||
// eqn - Boolean equation on the variables i2,i1,i0 for the OUTLUT output.
|
||||
TILE2.OUTLUT_4.eqn = "i0";
|
||||
|
||||
@@ -0,0 +1,419 @@
|
||||
//#############################################################################
|
||||
//
|
||||
// FILE: clb_ex15_tile_to_tile_delay.c
|
||||
//
|
||||
// TITLE: CLB Tile to Tile Delay.
|
||||
//
|
||||
//! \addtogroup driver_example_list
|
||||
//! <h1>CLB Tile to Tile Delay</h1>
|
||||
//!
|
||||
//! For the detailed description of this example, please refer to:
|
||||
//! C2000Ware_PATH\utilities\clb_tool\clb_syscfg\doc\CLB Tool Users Guide.pdf
|
||||
//!
|
||||
//
|
||||
//
|
||||
//#############################################################################
|
||||
//
|
||||
//
|
||||
// $Copyright:
|
||||
// Copyright (C) 2013-2024 Texas Instruments Incorporated - http://www.ti.com/
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions
|
||||
// are met:
|
||||
//
|
||||
// Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
//
|
||||
// Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
//
|
||||
// Neither the name of Texas Instruments Incorporated nor the names of
|
||||
// its contributors may be used to endorse or promote products derived
|
||||
// from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
// $
|
||||
//#############################################################################
|
||||
|
||||
|
||||
|
||||
#include "driverlib.h"
|
||||
#include "device.h"
|
||||
#include "clb_config.h"
|
||||
#include "clb.h"
|
||||
|
||||
uint32_t clb1delay = 0;
|
||||
uint32_t clb2delay = 0;
|
||||
uint32_t clb3delay = 0;
|
||||
uint32_t clb4delay = 0;
|
||||
|
||||
__interrupt void clb1ISR(void);
|
||||
__interrupt void clb2ISR(void);
|
||||
__interrupt void clb3ISR(void);
|
||||
__interrupt void clb4ISR(void);
|
||||
|
||||
void main(void)
|
||||
{
|
||||
Device_init();
|
||||
Device_initGPIO();
|
||||
|
||||
//
|
||||
// Configure GPIO0 for INPUTXBAR1
|
||||
//
|
||||
GPIO_setPinConfig(GPIO_0_GPIO0);
|
||||
GPIO_setDirectionMode(0, GPIO_DIR_MODE_OUT);
|
||||
GPIO_setPadConfig(0, GPIO_PIN_TYPE_STD);
|
||||
XBAR_setInputPin(XBAR_INPUT1, 0);
|
||||
GPIO_writePin(0, 0);
|
||||
|
||||
Interrupt_initModule();
|
||||
Interrupt_initVectorTable();
|
||||
|
||||
|
||||
Interrupt_register(INT_CLB1, &clb1ISR);
|
||||
Interrupt_enable(INT_CLB1);
|
||||
|
||||
Interrupt_register(INT_CLB2, &clb2ISR);
|
||||
Interrupt_enable(INT_CLB2);
|
||||
|
||||
Interrupt_register(INT_CLB3, &clb3ISR);
|
||||
Interrupt_enable(INT_CLB3);
|
||||
|
||||
Interrupt_register(INT_CLB4, &clb4ISR);
|
||||
Interrupt_enable(INT_CLB4);
|
||||
|
||||
//
|
||||
// Enabling EPWM1/2/3/4 to enable CLB1/2/3/4
|
||||
//
|
||||
SysCtl_enablePeripheral(SYSCTL_PERIPH_CLK_EPWM1);
|
||||
SysCtl_enablePeripheral(SYSCTL_PERIPH_CLK_EPWM2);
|
||||
SysCtl_enablePeripheral(SYSCTL_PERIPH_CLK_EPWM3);
|
||||
SysCtl_enablePeripheral(SYSCTL_PERIPH_CLK_EPWM4);
|
||||
|
||||
CLB_enableCLB(CLB1_BASE);
|
||||
CLB_enableCLB(CLB2_BASE);
|
||||
CLB_enableCLB(CLB3_BASE);
|
||||
CLB_enableCLB(CLB4_BASE);
|
||||
|
||||
initTILE1(CLB1_BASE);
|
||||
initTILE2(CLB2_BASE);
|
||||
initTILE3(CLB3_BASE);
|
||||
initTILE4(CLB4_BASE);
|
||||
|
||||
//
|
||||
// Configure CLB1 BOUNDARY IN
|
||||
//
|
||||
|
||||
//
|
||||
// Select Global input instead of local input for CLB IN
|
||||
//
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN0, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN1, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
|
||||
//
|
||||
// Select AUXSIG0 for CLB1, IN0
|
||||
// Select AUXSIG1 for CLB1, IN1
|
||||
//
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN0, CLB_GLOBAL_IN_MUX_CLB_AUXSIG0);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN1, CLB_GLOBAL_IN_MUX_CLB_AUXSIG1);
|
||||
|
||||
//
|
||||
// Select External for CLB1, IN0
|
||||
// Select External for CLB1, IN1
|
||||
//
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN0, CLB_GP_IN_MUX_EXTERNAL);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN1, CLB_GP_IN_MUX_EXTERNAL);
|
||||
|
||||
//
|
||||
// Configure CLB2 BOUNDARY IN
|
||||
//
|
||||
|
||||
//
|
||||
// Select Global input instead of local input for CLB IN
|
||||
//
|
||||
CLB_configLocalInputMux(CLB2_BASE, CLB_IN0, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB2_BASE, CLB_IN1, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
|
||||
//
|
||||
// Select AUXSIG0 for CLB2, IN0
|
||||
// Select AUXSIG2 for CLB2, IN1
|
||||
//
|
||||
CLB_configGlobalInputMux(CLB2_BASE, CLB_IN0, CLB_GLOBAL_IN_MUX_CLB_AUXSIG0);
|
||||
CLB_configGlobalInputMux(CLB2_BASE, CLB_IN1, CLB_GLOBAL_IN_MUX_CLB_AUXSIG2);
|
||||
|
||||
//
|
||||
// Select External for CLB2, IN0
|
||||
// Select External for CLB2, IN1
|
||||
//
|
||||
CLB_configGPInputMux(CLB2_BASE, CLB_IN0, CLB_GP_IN_MUX_EXTERNAL);
|
||||
CLB_configGPInputMux(CLB2_BASE, CLB_IN1, CLB_GP_IN_MUX_EXTERNAL);
|
||||
|
||||
|
||||
//
|
||||
// Configure CLB3 BOUNDARY IN
|
||||
//
|
||||
|
||||
//
|
||||
// Select Global input instead of local input for CLB IN
|
||||
//
|
||||
CLB_configLocalInputMux(CLB3_BASE, CLB_IN0, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB3_BASE, CLB_IN1, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
|
||||
//
|
||||
// Select AUXSIG0 for CLB3, IN0
|
||||
// Select AUXSIG3 for CLB3, IN1
|
||||
//
|
||||
CLB_configGlobalInputMux(CLB3_BASE, CLB_IN0, CLB_GLOBAL_IN_MUX_CLB_AUXSIG0);
|
||||
CLB_configGlobalInputMux(CLB3_BASE, CLB_IN1, CLB_GLOBAL_IN_MUX_CLB_AUXSIG3);
|
||||
|
||||
//
|
||||
// Select External for CLB3, IN0
|
||||
// Select External for CLB3, IN1
|
||||
//
|
||||
CLB_configGPInputMux(CLB3_BASE, CLB_IN0, CLB_GP_IN_MUX_EXTERNAL);
|
||||
CLB_configGPInputMux(CLB3_BASE, CLB_IN1, CLB_GP_IN_MUX_EXTERNAL);
|
||||
|
||||
//
|
||||
// Configure CLB4 BOUNDARY IN
|
||||
//
|
||||
|
||||
//
|
||||
// Select Global input instead of local input for CLB IN
|
||||
//
|
||||
CLB_configLocalInputMux(CLB4_BASE, CLB_IN0, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB4_BASE, CLB_IN1, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
|
||||
//
|
||||
// Select AUXSIG0 for CLB4, IN0
|
||||
// Select AUXSIG4 for CLB4, IN1
|
||||
//
|
||||
CLB_configGlobalInputMux(CLB4_BASE, CLB_IN0, CLB_GLOBAL_IN_MUX_CLB_AUXSIG0);
|
||||
CLB_configGlobalInputMux(CLB4_BASE, CLB_IN1, CLB_GLOBAL_IN_MUX_CLB_AUXSIG4);
|
||||
|
||||
//
|
||||
// Select External for CLB4, IN0
|
||||
// Select External for CLB4, IN1
|
||||
//
|
||||
CLB_configGPInputMux(CLB4_BASE, CLB_IN0, CLB_GP_IN_MUX_EXTERNAL);
|
||||
CLB_configGPInputMux(CLB4_BASE, CLB_IN1, CLB_GP_IN_MUX_EXTERNAL);
|
||||
|
||||
|
||||
//
|
||||
// Configure CLB-XBAR AUXSIG0 as INPUT1
|
||||
//
|
||||
XBAR_setCLBMuxConfig(XBAR_AUXSIG0, XBAR_CLB_MUX01_INPUTXBAR1);
|
||||
XBAR_enableCLBMux(XBAR_AUXSIG0, XBAR_MUX01);
|
||||
|
||||
//
|
||||
// Configure CLB-XBAR AUXSIG1 as CLB2 OUT4
|
||||
//
|
||||
XBAR_setCLBMuxConfig(XBAR_AUXSIG1, XBAR_CLB_MUX05_CLB2_OUT4);
|
||||
XBAR_enableCLBMux(XBAR_AUXSIG1, XBAR_MUX05);
|
||||
|
||||
//
|
||||
// Configure CLB-XBAR AUXSIG2 as CLB1 OUT4
|
||||
//
|
||||
XBAR_setCLBMuxConfig(XBAR_AUXSIG2, XBAR_CLB_MUX01_CLB1_OUT4);
|
||||
XBAR_enableCLBMux(XBAR_AUXSIG2, XBAR_MUX01);
|
||||
|
||||
//
|
||||
// Configure CLB-XBAR AUXSIG3 as Input XBAR2 = CLB4 OUT4
|
||||
//
|
||||
XBAR_setCLBMuxConfig(XBAR_AUXSIG3, XBAR_CLB_MUX03_INPUTXBAR2);
|
||||
XBAR_enableCLBMux(XBAR_AUXSIG3, XBAR_MUX03);
|
||||
|
||||
//
|
||||
// Configure CLB-XBAR AUXSIG4 as Input XBAR3 = CLB3 OUT4
|
||||
//
|
||||
XBAR_setCLBMuxConfig(XBAR_AUXSIG4, XBAR_CLB_MUX05_INPUTXBAR3);
|
||||
XBAR_enableCLBMux(XBAR_AUXSIG4, XBAR_MUX05);
|
||||
|
||||
//
|
||||
// Configure GPIO24 for OUTPUTXBAR1
|
||||
//
|
||||
GPIO_setPinConfig(GPIO_24_OUTPUTXBAR1);
|
||||
GPIO_setDirectionMode(24, GPIO_DIR_MODE_OUT);
|
||||
GPIO_setPadConfig(24, GPIO_PIN_TYPE_STD);
|
||||
|
||||
XBAR_setOutputMuxConfig(XBAR_OUTPUT1, XBAR_OUT_MUX01_CLB1_OUT4);
|
||||
XBAR_enableOutputMux(XBAR_OUTPUT1, XBAR_MUX01);
|
||||
|
||||
//
|
||||
// Configure GPIO16 for OUTPUTXBAR7
|
||||
//
|
||||
GPIO_setPinConfig(GPIO_16_OUTPUTXBAR7);
|
||||
GPIO_setDirectionMode(16, GPIO_DIR_MODE_OUT);
|
||||
GPIO_setPadConfig(16, GPIO_PIN_TYPE_STD);
|
||||
|
||||
XBAR_setOutputMuxConfig(XBAR_OUTPUT7, XBAR_OUT_MUX05_CLB2_OUT4);
|
||||
XBAR_enableOutputMux(XBAR_OUTPUT7, XBAR_MUX05);
|
||||
|
||||
|
||||
//
|
||||
// Configure GPIO14 for OUTPUTXBAR3
|
||||
//
|
||||
GPIO_setPinConfig(GPIO_14_OUTPUTXBAR3);
|
||||
GPIO_setDirectionMode(14, GPIO_DIR_MODE_OUT);
|
||||
GPIO_setPadConfig(14, GPIO_PIN_TYPE_STD);
|
||||
|
||||
XBAR_setOutputMuxConfig(XBAR_OUTPUT3, XBAR_OUT_MUX09_CLB3_OUT4);
|
||||
XBAR_enableOutputMux(XBAR_OUTPUT3, XBAR_MUX09);
|
||||
|
||||
//
|
||||
// Input XBAR3 = CLB3 OUT4 = GPIO14
|
||||
//
|
||||
XBAR_setInputPin(XBAR_INPUT3, 14);
|
||||
|
||||
//
|
||||
// Configure GPIO15 for OUTPUTXBAR4
|
||||
//
|
||||
GPIO_setPinConfig(GPIO_15_OUTPUTXBAR4);
|
||||
GPIO_setDirectionMode(15, GPIO_DIR_MODE_OUT);
|
||||
GPIO_setPadConfig(15, GPIO_PIN_TYPE_STD);
|
||||
|
||||
XBAR_setOutputMuxConfig(XBAR_OUTPUT4, XBAR_OUT_MUX13_CLB4_OUT4);
|
||||
XBAR_enableOutputMux(XBAR_OUTPUT4, XBAR_MUX13);
|
||||
|
||||
//
|
||||
// Input XBAR2 = CLB4 OUT4 = GPIO15
|
||||
//
|
||||
XBAR_setInputPin(XBAR_INPUT2, 15);
|
||||
|
||||
//
|
||||
// Configure GPIO1 for EPWM1B = CLB1 OUT2
|
||||
//
|
||||
GPIO_setPinConfig(GPIO_1_EPWM1B);
|
||||
GPIO_setDirectionMode(1, GPIO_DIR_MODE_OUT);
|
||||
GPIO_setPadConfig(1, GPIO_PIN_TYPE_STD);
|
||||
|
||||
//
|
||||
// Configure GPIO5 for EPWM3B = CLB3 OUT2
|
||||
//
|
||||
GPIO_setPinConfig(GPIO_5_EPWM3B);
|
||||
GPIO_setDirectionMode(5, GPIO_DIR_MODE_OUT);
|
||||
GPIO_setPadConfig(5, GPIO_PIN_TYPE_STD);
|
||||
|
||||
|
||||
CLB_enableSynchronization(CLB1_BASE, CLB_IN0);
|
||||
CLB_enableSynchronization(CLB1_BASE, CLB_IN1);
|
||||
CLB_enableSynchronization(CLB2_BASE, CLB_IN0);
|
||||
CLB_enableSynchronization(CLB2_BASE, CLB_IN1);
|
||||
CLB_enableSynchronization(CLB3_BASE, CLB_IN0);
|
||||
CLB_enableSynchronization(CLB3_BASE, CLB_IN1);
|
||||
CLB_enableSynchronization(CLB4_BASE, CLB_IN0);
|
||||
CLB_enableSynchronization(CLB4_BASE, CLB_IN1);
|
||||
|
||||
//
|
||||
// Uncomment to enable asynchronous GPIO inputs
|
||||
//
|
||||
//GPIO_setQualificationMode(0, GPIO_QUAL_ASYNC);
|
||||
//GPIO_setQualificationMode(24, GPIO_QUAL_ASYNC);
|
||||
//GPIO_setQualificationMode(16, GPIO_QUAL_ASYNC);
|
||||
//GPIO_setQualificationMode(14, GPIO_QUAL_ASYNC);
|
||||
//GPIO_setQualificationMode(15, GPIO_QUAL_ASYNC);
|
||||
//GPIO_setQualificationMode(1, GPIO_QUAL_ASYNC);
|
||||
//GPIO_setQualificationMode(5, GPIO_QUAL_ASYNC);
|
||||
|
||||
//
|
||||
// Enable Global Interrupt (INTM) and realtime interrupt (DBGM)
|
||||
//
|
||||
EINT;
|
||||
ERTM;
|
||||
|
||||
//
|
||||
// Enable CLB1 OUT2
|
||||
//
|
||||
CLB_setOutputMask(CLB1_BASE, 1 << 2, true);
|
||||
|
||||
//
|
||||
// Enable CLB3 OUT2
|
||||
//
|
||||
CLB_setOutputMask(CLB3_BASE, 1 << 2, true);
|
||||
|
||||
CLB_clearInterruptTag(CLB1_BASE);
|
||||
CLB_clearInterruptTag(CLB2_BASE);
|
||||
CLB_clearInterruptTag(CLB3_BASE);
|
||||
CLB_clearInterruptTag(CLB4_BASE);
|
||||
|
||||
SysCtl_delay(1000);
|
||||
GPIO_writePin(0, 1);
|
||||
|
||||
SysCtl_delay(10000);
|
||||
ESTOP0;
|
||||
|
||||
//
|
||||
// Read the clbxdelay values to see how many cycles of delay
|
||||
// was detected.
|
||||
//
|
||||
|
||||
while(1)
|
||||
{
|
||||
|
||||
asm(" NOP");
|
||||
}
|
||||
}
|
||||
|
||||
__interrupt void clb1ISR(void)
|
||||
{
|
||||
uint16_t tag = CLB_getInterruptTag(CLB1_BASE);
|
||||
if (tag == 1)
|
||||
{
|
||||
clb1delay = CLB_getRegister(CLB1_BASE, CLB_REG_CTR_C0);
|
||||
//ESTOP0;
|
||||
}
|
||||
|
||||
CLB_clearInterruptTag(CLB1_BASE);
|
||||
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP5);
|
||||
}
|
||||
|
||||
__interrupt void clb2ISR(void)
|
||||
{
|
||||
uint16_t tag = CLB_getInterruptTag(CLB2_BASE);
|
||||
if (tag == 1)
|
||||
{
|
||||
clb2delay = CLB_getRegister(CLB2_BASE, CLB_REG_CTR_C0);
|
||||
//ESTOP0;
|
||||
}
|
||||
|
||||
CLB_clearInterruptTag(CLB2_BASE);
|
||||
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP5);
|
||||
}
|
||||
|
||||
__interrupt void clb3ISR(void)
|
||||
{
|
||||
uint16_t tag = CLB_getInterruptTag(CLB3_BASE);
|
||||
if (tag == 1)
|
||||
{
|
||||
clb3delay = CLB_getRegister(CLB3_BASE, CLB_REG_CTR_C0);
|
||||
//ESTOP0;
|
||||
}
|
||||
|
||||
CLB_clearInterruptTag(CLB3_BASE);
|
||||
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP5);
|
||||
}
|
||||
|
||||
__interrupt void clb4ISR(void)
|
||||
{
|
||||
uint16_t tag = CLB_getInterruptTag(CLB4_BASE);
|
||||
if (tag == 1)
|
||||
{
|
||||
clb4delay = CLB_getRegister(CLB4_BASE, CLB_REG_CTR_C0);
|
||||
//ESTOP0;
|
||||
}
|
||||
|
||||
CLB_clearInterruptTag(CLB4_BASE);
|
||||
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP5);
|
||||
}
|
||||
@@ -0,0 +1,331 @@
|
||||
|
||||
var TILE = scripting.addModule("/utilities/clb_tool/clb_syscfg/source/TILE");
|
||||
var TILE1 = TILE.addInstance();
|
||||
var TILE2 = TILE.addInstance();
|
||||
var TILE3 = TILE.addInstance();
|
||||
var TILE4 = TILE.addInstance();
|
||||
// Name
|
||||
TILE1.$name = "TILE1";
|
||||
// Name
|
||||
TILE1.BOUNDARY.$name = "BOUNDARY0";
|
||||
// in1
|
||||
TILE1.BOUNDARY.in1 = "TILE2_BOUNDARY.out4";
|
||||
// in0
|
||||
TILE1.BOUNDARY.in0 = "squareWave";
|
||||
// in_edge0 - Edge detection on the inputs, generates 1 cycle pulse on chosen edges - for simulation purposes only
|
||||
TILE1.BOUNDARY.in_edge0 = "rising edge";
|
||||
// in_period0 - Period of the square wave
|
||||
TILE1.BOUNDARY.in_period0 = 1000;
|
||||
// in_duty0 - Duty or ON time of the square wave
|
||||
TILE1.BOUNDARY.in_duty0 = 500;
|
||||
// in_repeat_count0 - Number of periods the waveform is repeated
|
||||
TILE1.BOUNDARY.in_repeat_count0 = 1;
|
||||
// Name
|
||||
TILE1.LUT_0.$name = "LUT_0";
|
||||
// Name
|
||||
TILE1.LUT_1.$name = "LUT_1";
|
||||
// Name
|
||||
TILE1.LUT_2.$name = "LUT_2";
|
||||
// Name
|
||||
TILE1.FSM_0.$name = "FSM_0";
|
||||
// e0 - External Input 0.
|
||||
TILE1.FSM_0.e0 = "BOUNDARY.in0";
|
||||
// e1 - External Input 1.
|
||||
TILE1.FSM_0.e1 = "BOUNDARY.in1";
|
||||
// eqn_s0 - Boolean equation on the variables e1,e0,s1,s0 for the S0 output.
|
||||
TILE1.FSM_0.eqn_s0 = "e0&!e1";
|
||||
// Name
|
||||
TILE1.FSM_1.$name = "FSM_1";
|
||||
// Name
|
||||
TILE1.FSM_2.$name = "FSM_2";
|
||||
// Name
|
||||
TILE1.COUNTER_0.$name = "COUNTER_0";
|
||||
// mode0 - Enables Counting when high
|
||||
TILE1.COUNTER_0.mode0 = "FSM_0.S0";
|
||||
// mode1 - Controls counting direction. High enables count up. Low enables count down.
|
||||
TILE1.COUNTER_0.mode1 = "1";
|
||||
// Name
|
||||
TILE1.COUNTER_1.$name = "COUNTER_1";
|
||||
// Name
|
||||
TILE1.COUNTER_2.$name = "COUNTER_2";
|
||||
// Name
|
||||
TILE1.OUTLUT_0.$name = "OUTLUT_0";
|
||||
// Name
|
||||
TILE1.OUTLUT_1.$name = "OUTLUT_1";
|
||||
// Name
|
||||
TILE1.OUTLUT_2.$name = "OUTLUT_2";
|
||||
// i0 - Input 0.
|
||||
TILE1.OUTLUT_2.i0 = "BOUNDARY.in1";
|
||||
// eqn - Boolean equation on the variables i2,i1,i0 for the OUTLUT output.
|
||||
TILE1.OUTLUT_2.eqn = "i0";
|
||||
// Name
|
||||
TILE1.OUTLUT_3.$name = "OUTLUT_3";
|
||||
// Name
|
||||
TILE1.OUTLUT_4.$name = "OUTLUT_4";
|
||||
// i0 - Input 0.
|
||||
TILE1.OUTLUT_4.i0 = "BOUNDARY.in0";
|
||||
// eqn - Boolean equation on the variables i2,i1,i0 for the OUTLUT output.
|
||||
TILE1.OUTLUT_4.eqn = "i0";
|
||||
// Name
|
||||
TILE1.OUTLUT_5.$name = "OUTLUT_5";
|
||||
// Name
|
||||
TILE1.OUTLUT_6.$name = "OUTLUT_6";
|
||||
// Name
|
||||
TILE1.OUTLUT_7.$name = "OUTLUT_7";
|
||||
// Name
|
||||
TILE1.HLC.$name = "HLC_0";
|
||||
// Event 0 (e0) - Event 0
|
||||
TILE1.HLC.e0 = "BOUNDARY.in1";
|
||||
// Name
|
||||
TILE1.HLC.program0.$name = "HLCP_0";
|
||||
// instruct0
|
||||
TILE1.HLC.program0.instruct0 = "INTR 1";
|
||||
// Name
|
||||
TILE1.HLC.program1.$name = "HLCP_1";
|
||||
// Name
|
||||
TILE1.HLC.program2.$name = "HLCP_2";
|
||||
// Name
|
||||
TILE1.HLC.program3.$name = "HLCP_3";
|
||||
var clb_run_dynamic_template_clb_h = scripting.addModule("/utilities/clb_tool/clb_syscfg/source/clb_run_dynamic_template_clb_h.js");
|
||||
var clb_run_dynamic_template_clb_c = scripting.addModule("/utilities/clb_tool/clb_syscfg/source/clb_run_dynamic_template_clb_c.js");
|
||||
var clb_run_dynamic_template_clb_sim = scripting.addModule("/utilities/clb_tool/clb_syscfg/source/clb_run_dynamic_template_clb_sim.js");
|
||||
var clb_run_dynamic_template_clb_dot = scripting.addModule("/utilities/clb_tool/clb_syscfg/source/clb_run_dynamic_template_clb_dot.js");
|
||||
// Name
|
||||
TILE2.$name = "TILE2";
|
||||
// Name
|
||||
TILE2.BOUNDARY.$name = "BOUNDARY1";
|
||||
// in1
|
||||
TILE2.BOUNDARY.in1 = "TILE1_BOUNDARY.out4";
|
||||
// in0
|
||||
TILE2.BOUNDARY.in0 = "squareWave";
|
||||
// in_edge0 - Edge detection on the inputs, generates 1 cycle pulse on chosen edges - for simulation purposes only
|
||||
TILE2.BOUNDARY.in_edge0 = "rising edge";
|
||||
// in_period0 - Period of the square wave
|
||||
TILE2.BOUNDARY.in_period0 = 1000;
|
||||
// in_duty0 - Duty or ON time of the square wave
|
||||
TILE2.BOUNDARY.in_duty0 = 500;
|
||||
// in_repeat_count0 - Number of periods the waveform is repeated
|
||||
TILE2.BOUNDARY.in_repeat_count0 = 1;
|
||||
// Name
|
||||
TILE2.LUT_0.$name = "LUT_3";
|
||||
// Name
|
||||
TILE2.LUT_1.$name = "LUT_4";
|
||||
// Name
|
||||
TILE2.LUT_2.$name = "LUT_5";
|
||||
// Name
|
||||
TILE2.FSM_0.$name = "FSM_3";
|
||||
// e0 - External Input 0.
|
||||
TILE2.FSM_0.e0 = "BOUNDARY.in0";
|
||||
// e1 - External Input 1.
|
||||
TILE2.FSM_0.e1 = "BOUNDARY.in1";
|
||||
// eqn_s0 - Boolean equation on the variables e1,e0,s1,s0 for the S0 output.
|
||||
TILE2.FSM_0.eqn_s0 = "e0&!e1";
|
||||
// Name
|
||||
TILE2.FSM_1.$name = "FSM_4";
|
||||
// Name
|
||||
TILE2.FSM_2.$name = "FSM_5";
|
||||
// Name
|
||||
TILE2.COUNTER_0.$name = "COUNTER_3";
|
||||
// mode0 - Enables Counting when high
|
||||
TILE2.COUNTER_0.mode0 = "FSM_0.S0";
|
||||
// mode1 - Controls counting direction. High enables count up. Low enables count down.
|
||||
TILE2.COUNTER_0.mode1 = "1";
|
||||
// Name
|
||||
TILE2.COUNTER_1.$name = "COUNTER_4";
|
||||
// Name
|
||||
TILE2.COUNTER_2.$name = "COUNTER_5";
|
||||
// Name
|
||||
TILE2.OUTLUT_0.$name = "OUTLUT_8";
|
||||
// Name
|
||||
TILE2.OUTLUT_1.$name = "OUTLUT_9";
|
||||
// Name
|
||||
TILE2.OUTLUT_2.$name = "OUTLUT_10";
|
||||
// Name
|
||||
TILE2.OUTLUT_3.$name = "OUTLUT_11";
|
||||
// Name
|
||||
TILE2.OUTLUT_4.$name = "OUTLUT_12";
|
||||
// i0 - Input 0.
|
||||
TILE2.OUTLUT_4.i0 = "BOUNDARY.in0";
|
||||
// eqn - Boolean equation on the variables i2,i1,i0 for the OUTLUT output.
|
||||
TILE2.OUTLUT_4.eqn = "i0";
|
||||
// Name
|
||||
TILE2.OUTLUT_5.$name = "OUTLUT_13";
|
||||
// Name
|
||||
TILE2.OUTLUT_6.$name = "OUTLUT_14";
|
||||
// Name
|
||||
TILE2.OUTLUT_7.$name = "OUTLUT_15";
|
||||
// Name
|
||||
TILE2.HLC.$name = "HLC_1";
|
||||
// Event 0 (e0) - Event 0
|
||||
TILE2.HLC.e0 = "BOUNDARY.in1";
|
||||
// Name
|
||||
TILE2.HLC.program0.$name = "HLCP_4";
|
||||
// instruct0
|
||||
TILE2.HLC.program0.instruct0 = "INTR 1";
|
||||
// Name
|
||||
TILE2.HLC.program1.$name = "HLCP_5";
|
||||
// Name
|
||||
TILE2.HLC.program2.$name = "HLCP_6";
|
||||
// Name
|
||||
TILE2.HLC.program3.$name = "HLCP_7";
|
||||
// Name
|
||||
TILE3.$name = "TILE3";
|
||||
// Name
|
||||
TILE3.BOUNDARY.$name = "BOUNDARY2";
|
||||
// in1
|
||||
TILE3.BOUNDARY.in1 = "TILE4_BOUNDARY.out4";
|
||||
// in0
|
||||
TILE3.BOUNDARY.in0 = "squareWave";
|
||||
// in_edge0 - Edge detection on the inputs, generates 1 cycle pulse on chosen edges - for simulation purposes only
|
||||
TILE3.BOUNDARY.in_edge0 = "rising edge";
|
||||
// in_period0 - Period of the square wave
|
||||
TILE3.BOUNDARY.in_period0 = 1000;
|
||||
// in_duty0 - Duty or ON time of the square wave
|
||||
TILE3.BOUNDARY.in_duty0 = 500;
|
||||
// in_repeat_count0 - Number of periods the waveform is repeated
|
||||
TILE3.BOUNDARY.in_repeat_count0 = 1;
|
||||
// Name
|
||||
TILE3.LUT_0.$name = "LUT_6";
|
||||
// Name
|
||||
TILE3.LUT_1.$name = "LUT_7";
|
||||
// Name
|
||||
TILE3.LUT_2.$name = "LUT_8";
|
||||
// Name
|
||||
TILE3.FSM_0.$name = "FSM_6";
|
||||
// e0 - External Input 0.
|
||||
TILE3.FSM_0.e0 = "BOUNDARY.in0";
|
||||
// e1 - External Input 1.
|
||||
TILE3.FSM_0.e1 = "BOUNDARY.in1";
|
||||
// eqn_s0 - Boolean equation on the variables e1,e0,s1,s0 for the S0 output.
|
||||
TILE3.FSM_0.eqn_s0 = "e0&!e1";
|
||||
// Name
|
||||
TILE3.FSM_1.$name = "FSM_7";
|
||||
// Name
|
||||
TILE3.FSM_2.$name = "FSM_8";
|
||||
// Name
|
||||
TILE3.COUNTER_0.$name = "COUNTER_6";
|
||||
// mode0 - Enables Counting when high
|
||||
TILE3.COUNTER_0.mode0 = "FSM_0.S0";
|
||||
// mode1 - Controls counting direction. High enables count up. Low enables count down.
|
||||
TILE3.COUNTER_0.mode1 = "1";
|
||||
// Name
|
||||
TILE3.COUNTER_1.$name = "COUNTER_7";
|
||||
// Name
|
||||
TILE3.COUNTER_2.$name = "COUNTER_8";
|
||||
// Name
|
||||
TILE3.OUTLUT_0.$name = "OUTLUT_16";
|
||||
// Name
|
||||
TILE3.OUTLUT_1.$name = "OUTLUT_17";
|
||||
// Name
|
||||
TILE3.OUTLUT_2.$name = "OUTLUT_18";
|
||||
// i0 - Input 0.
|
||||
TILE3.OUTLUT_2.i0 = "BOUNDARY.in1";
|
||||
// eqn - Boolean equation on the variables i2,i1,i0 for the OUTLUT output.
|
||||
TILE3.OUTLUT_2.eqn = "i0";
|
||||
// Name
|
||||
TILE3.OUTLUT_3.$name = "OUTLUT_19";
|
||||
// Name
|
||||
TILE3.OUTLUT_4.$name = "OUTLUT_20";
|
||||
// i0 - Input 0.
|
||||
TILE3.OUTLUT_4.i0 = "BOUNDARY.in0";
|
||||
// eqn - Boolean equation on the variables i2,i1,i0 for the OUTLUT output.
|
||||
TILE3.OUTLUT_4.eqn = "i0";
|
||||
// Name
|
||||
TILE3.OUTLUT_5.$name = "OUTLUT_21";
|
||||
// Name
|
||||
TILE3.OUTLUT_6.$name = "OUTLUT_22";
|
||||
// Name
|
||||
TILE3.OUTLUT_7.$name = "OUTLUT_23";
|
||||
// Name
|
||||
TILE3.HLC.$name = "HLC_2";
|
||||
// Event 0 (e0) - Event 0
|
||||
TILE3.HLC.e0 = "BOUNDARY.in1";
|
||||
// Name
|
||||
TILE3.HLC.program0.$name = "HLCP_8";
|
||||
// instruct0
|
||||
TILE3.HLC.program0.instruct0 = "INTR 1";
|
||||
// Name
|
||||
TILE3.HLC.program1.$name = "HLCP_9";
|
||||
// Name
|
||||
TILE3.HLC.program2.$name = "HLCP_10";
|
||||
// Name
|
||||
TILE3.HLC.program3.$name = "HLCP_11";
|
||||
// Name
|
||||
TILE4.$name = "TILE4";
|
||||
// Name
|
||||
TILE4.BOUNDARY.$name = "BOUNDARY3";
|
||||
// in1
|
||||
TILE4.BOUNDARY.in1 = "TILE3_BOUNDARY.out4";
|
||||
// in0
|
||||
TILE4.BOUNDARY.in0 = "squareWave";
|
||||
// in_edge0 - Edge detection on the inputs, generates 1 cycle pulse on chosen edges - for simulation purposes only
|
||||
TILE4.BOUNDARY.in_edge0 = "rising edge";
|
||||
// in_period0 - Period of the square wave
|
||||
TILE4.BOUNDARY.in_period0 = 1000;
|
||||
// in_duty0 - Duty or ON time of the square wave
|
||||
TILE4.BOUNDARY.in_duty0 = 500;
|
||||
// in_repeat_count0 - Number of periods the waveform is repeated
|
||||
TILE4.BOUNDARY.in_repeat_count0 = 1;
|
||||
// Name
|
||||
TILE4.LUT_0.$name = "LUT_9";
|
||||
// Name
|
||||
TILE4.LUT_1.$name = "LUT_10";
|
||||
// Name
|
||||
TILE4.LUT_2.$name = "LUT_11";
|
||||
// Name
|
||||
TILE4.FSM_0.$name = "FSM_9";
|
||||
// e0 - External Input 0.
|
||||
TILE4.FSM_0.e0 = "BOUNDARY.in0";
|
||||
// e1 - External Input 1.
|
||||
TILE4.FSM_0.e1 = "BOUNDARY.in1";
|
||||
// eqn_s0 - Boolean equation on the variables e1,e0,s1,s0 for the S0 output.
|
||||
TILE4.FSM_0.eqn_s0 = "e0&!e1";
|
||||
// Name
|
||||
TILE4.FSM_1.$name = "FSM_10";
|
||||
// Name
|
||||
TILE4.FSM_2.$name = "FSM_11";
|
||||
// Name
|
||||
TILE4.COUNTER_0.$name = "COUNTER_9";
|
||||
// mode0 - Enables Counting when high
|
||||
TILE4.COUNTER_0.mode0 = "FSM_0.S0";
|
||||
// mode1 - Controls counting direction. High enables count up. Low enables count down.
|
||||
TILE4.COUNTER_0.mode1 = "1";
|
||||
// Name
|
||||
TILE4.COUNTER_1.$name = "COUNTER_10";
|
||||
// Name
|
||||
TILE4.COUNTER_2.$name = "COUNTER_11";
|
||||
// Name
|
||||
TILE4.OUTLUT_0.$name = "OUTLUT_24";
|
||||
// Name
|
||||
TILE4.OUTLUT_1.$name = "OUTLUT_25";
|
||||
// Name
|
||||
TILE4.OUTLUT_2.$name = "OUTLUT_26";
|
||||
// Name
|
||||
TILE4.OUTLUT_3.$name = "OUTLUT_27";
|
||||
// Name
|
||||
TILE4.OUTLUT_4.$name = "OUTLUT_28";
|
||||
// i0 - Input 0.
|
||||
TILE4.OUTLUT_4.i0 = "BOUNDARY.in0";
|
||||
// eqn - Boolean equation on the variables i2,i1,i0 for the OUTLUT output.
|
||||
TILE4.OUTLUT_4.eqn = "i0";
|
||||
// Name
|
||||
TILE4.OUTLUT_5.$name = "OUTLUT_29";
|
||||
// Name
|
||||
TILE4.OUTLUT_6.$name = "OUTLUT_30";
|
||||
// Name
|
||||
TILE4.OUTLUT_7.$name = "OUTLUT_31";
|
||||
// Name
|
||||
TILE4.HLC.$name = "HLC_3";
|
||||
// Event 0 (e0) - Event 0
|
||||
TILE4.HLC.e0 = "BOUNDARY.in1";
|
||||
// Name
|
||||
TILE4.HLC.program0.$name = "HLCP_12";
|
||||
// instruct0
|
||||
TILE4.HLC.program0.instruct0 = "INTR 1";
|
||||
// Name
|
||||
TILE4.HLC.program1.$name = "HLCP_13";
|
||||
// Name
|
||||
TILE4.HLC.program2.$name = "HLCP_14";
|
||||
// Name
|
||||
TILE4.HLC.program3.$name = "HLCP_15";
|
||||
|
||||
@@ -0,0 +1,302 @@
|
||||
//############################################################################
|
||||
//
|
||||
// FILE: clb_ex17_one_shot_pwm.c
|
||||
//
|
||||
// TITLE: CLB based One-shot PWM
|
||||
//
|
||||
//! \addtogroup driver_example_list
|
||||
//! <h1>CLB based One-shot PWM</h1>
|
||||
//!
|
||||
//! For the detailed description of this example, please refer to :
|
||||
//! C2000Ware_PATH\utilities\clb_tool\clb_syscfg\doc\CLB Tool Users Guide.pdf
|
||||
//
|
||||
//
|
||||
//############################################################################
|
||||
//
|
||||
//
|
||||
// $Copyright:
|
||||
// Copyright (C) 2013-2024 Texas Instruments Incorporated - http://www.ti.com/
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions
|
||||
// are met:
|
||||
//
|
||||
// Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
//
|
||||
// Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
//
|
||||
// Neither the name of Texas Instruments Incorporated nor the names of
|
||||
// its contributors may be used to endorse or promote products derived
|
||||
// from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
// $
|
||||
//############################################################################
|
||||
|
||||
|
||||
#include "driverlib.h"
|
||||
#include "device.h"
|
||||
#include "clb_config.h"
|
||||
#include "clb.h"
|
||||
|
||||
//
|
||||
// Defines
|
||||
//
|
||||
#define EXAMPLE_MODE 0U // '0' for software trigger mode and
|
||||
// '1' for external trigger mode
|
||||
#define TB_CLK DEVICE_SYSCLK_FREQ / 2 // Time base clock is SYSCLK/2
|
||||
#define PWM_CLK 1000000U // PWM frequency as 1 Mhz
|
||||
#define PRD_VAL (TB_CLK / (PWM_CLK)) // Calculate value period value
|
||||
// for up count mode
|
||||
|
||||
//
|
||||
// Function Prototypes
|
||||
//
|
||||
void initEPWM(void);
|
||||
__interrupt void clb1ISR(void);
|
||||
|
||||
//
|
||||
// Globals
|
||||
//
|
||||
uint16_t SOFT_TRIGGER = 0; // Set this from '0' to '1' (rising edge)
|
||||
// to provide software trigger for one-shot
|
||||
// PWM when "EXAMPLE_MODE = 0"
|
||||
volatile uint16_t dutyValue= 20; // Variable output pulse width
|
||||
|
||||
void main(void)
|
||||
{
|
||||
Device_init();
|
||||
Device_initGPIO();
|
||||
|
||||
Interrupt_initModule();
|
||||
Interrupt_initVectorTable();
|
||||
|
||||
Interrupt_register(INT_CLB1, &clb1ISR);
|
||||
Interrupt_enable(INT_CLB1);
|
||||
|
||||
CLB_enableCLB(CLB1_BASE);
|
||||
initTILE1(CLB1_BASE);
|
||||
|
||||
//
|
||||
// Select Global input instead of local input for all CLB IN
|
||||
//
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN0, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN1, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN2, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN3, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN4, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN5, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN6, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN7, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
|
||||
#if EXAMPLE_MODE == 1
|
||||
//
|
||||
// Select AUXSIG0 for CLB1, IN0
|
||||
//
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN0, CLB_GLOBAL_IN_MUX_CLB_AUXSIG0);
|
||||
#else
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN0, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
#endif
|
||||
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN1, CLB_GLOBAL_IN_MUX_EPWM1_CTRDIR);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN2, CLB_GLOBAL_IN_MUX_EPWM1_CTRDIR);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN3, CLB_GLOBAL_IN_MUX_EPWM1_CTRDIR);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN4, CLB_GLOBAL_IN_MUX_EPWM1_CTRDIR);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN5, CLB_GLOBAL_IN_MUX_EPWM1_CTRDIR);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN6, CLB_GLOBAL_IN_MUX_EPWM1_CTRDIR);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN7, CLB_GLOBAL_IN_MUX_EPWM1_CTRDIR);
|
||||
|
||||
#if EXAMPLE_MODE == 1
|
||||
//
|
||||
// Inputs set for external trigger
|
||||
//
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN0, CLB_GP_IN_MUX_EXTERNAL);
|
||||
#else
|
||||
//
|
||||
// Inputs set to GP register for software based trigger
|
||||
//
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN0, CLB_GP_IN_MUX_GP_REG);
|
||||
#endif
|
||||
|
||||
//
|
||||
// Unused inputs to GP register
|
||||
//
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN1, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN2, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN3, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN4, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN5, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN6, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN7, CLB_GP_IN_MUX_GP_REG);
|
||||
|
||||
//
|
||||
// Configure GPIO2 as OUTPUTXBAR1 to generate the one-shot
|
||||
// pulse output
|
||||
//
|
||||
GPIO_setPinConfig(GPIO_2_OUTPUTXBAR1);
|
||||
GPIO_setDirectionMode(2, GPIO_DIR_MODE_OUT);
|
||||
GPIO_setPadConfig(2, GPIO_PIN_TYPE_STD);
|
||||
|
||||
//
|
||||
// Configure Input-XBAR INPUT1 as GPIO0 to route the
|
||||
// EPWM1 output as input trigger for CLB
|
||||
//
|
||||
XBAR_setInputPin(XBAR_INPUT1, 0);
|
||||
|
||||
//
|
||||
// Configure CLB-XBAR AUXSIG0 as INPUT1
|
||||
//
|
||||
XBAR_setCLBMuxConfig(XBAR_AUXSIG0, XBAR_CLB_MUX01_INPUTXBAR1);
|
||||
XBAR_enableCLBMux(XBAR_AUXSIG0, XBAR_MUX01);
|
||||
|
||||
//
|
||||
// Configure OUTPUT-XBAR OUTPUT1 as CLB1_OUT4
|
||||
//
|
||||
XBAR_setOutputMuxConfig(XBAR_OUTPUT1, XBAR_OUT_MUX01_CLB1_OUT4);
|
||||
XBAR_enableOutputMux(XBAR_OUTPUT1, XBAR_MUX01);
|
||||
|
||||
#if EXAMPLE_MODE == 1
|
||||
//
|
||||
// Enable external trigger simulating signal using EPWM module
|
||||
//
|
||||
initEPWM();
|
||||
#endif
|
||||
|
||||
//
|
||||
// Enable Global Interrupt (INTM) and realtime interrupt (DBGM)
|
||||
//
|
||||
EINT;
|
||||
ERTM;
|
||||
|
||||
CLB_clearInterruptTag(CLB1_BASE);
|
||||
|
||||
|
||||
while(1)
|
||||
{
|
||||
|
||||
#if EXAMPLE_MODE == 0
|
||||
//
|
||||
// In case of software trigger mode, make sure to set
|
||||
// SOFT_TRIGGER first as '0' and then to '1' to simulate
|
||||
// the rising edge software trigger
|
||||
//
|
||||
CLB_setGPREG(CLB1_BASE, SOFT_TRIGGER);
|
||||
#else
|
||||
asm(" NOP");
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// initEPWM - Function to configure ePWM1 to generate a 1 MHz Trigger signal
|
||||
//
|
||||
void
|
||||
initEPWM(void)
|
||||
{
|
||||
//
|
||||
// Initialize GPIO0 for EPWM1A
|
||||
//
|
||||
GPIO_setPinConfig(GPIO_0_EPWM1A);
|
||||
GPIO_setPadConfig(0, GPIO_PIN_TYPE_STD);
|
||||
|
||||
//
|
||||
// Disable the ePWM time base clock before configuring the module
|
||||
//
|
||||
SysCtl_disablePeripheral(SYSCTL_PERIPH_CLK_TBCLKSYNC);
|
||||
|
||||
//
|
||||
// Set phase shift to 0 and clear the time base counter
|
||||
//
|
||||
EPWM_setPhaseShift(EPWM1_BASE, 0);
|
||||
EPWM_setTimeBaseCounter(EPWM1_BASE, 0);
|
||||
|
||||
//
|
||||
// Disable the shadow load; the load will be immediate instead
|
||||
//
|
||||
EPWM_disableCounterCompareShadowLoadMode(EPWM1_BASE,
|
||||
EPWM_COUNTER_COMPARE_A);
|
||||
|
||||
//
|
||||
// Set the compare A value for 10% duty to generate a short trigger pulse
|
||||
// as the CLB based system is designed such as to respond to a rising edge
|
||||
//
|
||||
EPWM_setCounterCompareValue(EPWM1_BASE, EPWM_COUNTER_COMPARE_A, PRD_VAL / 10);
|
||||
|
||||
//
|
||||
// Set action qualifier behavior on compare A events
|
||||
// - EPWM1A --> 1 when CTR = ZERO
|
||||
// - EPWM1A --> 0 when CTR = CMPA and increasing
|
||||
//
|
||||
EPWM_setActionQualifierAction(EPWM1_BASE, EPWM_AQ_OUTPUT_A,
|
||||
EPWM_AQ_OUTPUT_LOW,
|
||||
EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPA);
|
||||
EPWM_setActionQualifierAction(EPWM1_BASE, EPWM_AQ_OUTPUT_A,
|
||||
EPWM_AQ_OUTPUT_HIGH,
|
||||
EPWM_AQ_OUTPUT_ON_TIMEBASE_ZERO);
|
||||
|
||||
//
|
||||
// Set the time base clock prescaler to /1
|
||||
//
|
||||
EPWM_setClockPrescaler(EPWM1_BASE, EPWM_CLOCK_DIVIDER_1,
|
||||
EPWM_HSCLOCK_DIVIDER_1);
|
||||
|
||||
//
|
||||
// Set the period value; don't shadow the register
|
||||
//
|
||||
EPWM_setPeriodLoadMode(EPWM1_BASE, EPWM_PERIOD_DIRECT_LOAD);
|
||||
EPWM_setTimeBasePeriod(EPWM1_BASE, PRD_VAL - 1);
|
||||
|
||||
//
|
||||
// Put the time base counter into up count mode
|
||||
//
|
||||
EPWM_setTimeBaseCounterMode(EPWM1_BASE, EPWM_COUNTER_MODE_UP);
|
||||
|
||||
//
|
||||
// Sync the ePWM time base clock
|
||||
//
|
||||
SysCtl_enablePeripheral(SYSCTL_PERIPH_CLK_TBCLKSYNC);
|
||||
}
|
||||
|
||||
//
|
||||
// CLB ISR generated after every 3rd input trigger event
|
||||
//
|
||||
__interrupt void clb1ISR(void)
|
||||
{
|
||||
//
|
||||
// Increase pulse width by 50 ns till it reaches max
|
||||
// Range of pulse output : 0.2us - 0.8us
|
||||
//
|
||||
dutyValue += 5;
|
||||
if(dutyValue > 80)
|
||||
{
|
||||
dutyValue = 20;
|
||||
}
|
||||
|
||||
//
|
||||
// Load new duty cycle value in HLC Registers
|
||||
//
|
||||
CLB_writeInterface(CLB1_BASE, CLB_ADDR_HLC_R0, dutyValue);
|
||||
|
||||
//
|
||||
// Clear the interrupt flag and acknowledge
|
||||
//
|
||||
CLB_clearInterruptTag(CLB1_BASE);
|
||||
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP5);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,131 @@
|
||||
|
||||
var TILE = scripting.addModule("/utilities/clb_tool/clb_syscfg/source/TILE");
|
||||
var TILE1 = TILE.addInstance();
|
||||
// clock_period - Period of the clock (in Nano Seconds) used for simulation in System C
|
||||
TILE.clock_period = 10;
|
||||
// sim_duration - Duration of the simulation (in Nano Seconds)
|
||||
TILE.sim_duration = 100000;
|
||||
// Name
|
||||
TILE1.$name = "TILE1";
|
||||
// Name
|
||||
TILE1.BOUNDARY.$name = "BOUNDARY0";
|
||||
// in0
|
||||
TILE1.BOUNDARY.in0 = "squareWave";
|
||||
// in_duty1 - Duty or ON time of the square wave
|
||||
TILE1.BOUNDARY.in_duty1 = 50;
|
||||
// in_period1 - Period of the square wave
|
||||
TILE1.BOUNDARY.in_period1 = 100;
|
||||
// in_repeat_count3 - Number of periods the waveform is repeated
|
||||
TILE1.BOUNDARY.in_repeat_count3 = 1;
|
||||
// in_repeat_count1 - Number of periods the waveform is repeated
|
||||
TILE1.BOUNDARY.in_repeat_count1 = 1000;
|
||||
// in_period0 - Period of the square wave
|
||||
TILE1.BOUNDARY.in_period0 = 100;
|
||||
// in_repeat_count0 - Number of periods the waveform is repeated
|
||||
TILE1.BOUNDARY.in_repeat_count0 = 1000;
|
||||
// Name
|
||||
TILE1.LUT_0.$name = "LUT_0";
|
||||
// i0 - Input 0.
|
||||
TILE1.LUT_0.i0 = "FSM_0.S0";
|
||||
// eqn - Boolean equation on the variables i3,i2,i1,i0 for the LUT output.
|
||||
TILE1.LUT_0.eqn = "~i0";
|
||||
// Name
|
||||
TILE1.LUT_1.$name = "LUT_1";
|
||||
// Name
|
||||
TILE1.LUT_2.$name = "LUT_2";
|
||||
// Name
|
||||
TILE1.FSM_0.$name = "FSM_0";
|
||||
// e1 - External Input 1.
|
||||
TILE1.FSM_0.e1 = "COUNTER_0.count_match2";
|
||||
// eqn_s0 - Boolean equation on the variables e1,e0,s1,s0 for the S0 output.
|
||||
TILE1.FSM_0.eqn_s0 = "(~e0 & (~e1) & s0) | e0";
|
||||
// e0 - External Input 0.
|
||||
TILE1.FSM_0.e0 = "COUNTER_2.count_match1";
|
||||
// Name
|
||||
TILE1.FSM_1.$name = "FSM_1";
|
||||
// Name
|
||||
TILE1.FSM_2.$name = "FSM_2";
|
||||
// Name
|
||||
TILE1.COUNTER_0.$name = "COUNTER_0";
|
||||
// mode1 - Controls counting direction. High enables count up. Low enables count down.
|
||||
TILE1.COUNTER_0.mode1 = "1";
|
||||
// match1_val - Sets the value of the Match reference 1 register.
|
||||
TILE1.COUNTER_0.match1_val = "";
|
||||
// mode0 - Enables Counting when high
|
||||
TILE1.COUNTER_0.mode0 = "FSM_0.S0";
|
||||
// reset - Reset the counter to 0 on next clock cycle (triggers low to high)
|
||||
TILE1.COUNTER_0.reset = "COUNTER_0.count_match2";
|
||||
// match2_val - Sets the value of the Match reference 2 register.
|
||||
TILE1.COUNTER_0.match2_val = "20";
|
||||
// Name
|
||||
TILE1.COUNTER_1.$name = "COUNTER_1";
|
||||
// mode1 - Controls counting direction. High enables count up. Low enables count down.
|
||||
TILE1.COUNTER_1.mode1 = "1";
|
||||
// What action should be taken on an event trigger?
|
||||
TILE1.COUNTER_1.action = "Add";
|
||||
// event_load_val - Sets the value of the event load value register.
|
||||
TILE1.COUNTER_1.event_load_val = "1";
|
||||
// reset - Reset the counter to 0 on next clock cycle (triggers low to high)
|
||||
TILE1.COUNTER_1.reset = "COUNTER_1.count_match1";
|
||||
// event - Trigger actions in the counter.
|
||||
TILE1.COUNTER_1.event = "BOUNDARY.in0";
|
||||
// match1_val - Sets the value of the Match reference 1 register.
|
||||
TILE1.COUNTER_1.match1_val = "3";
|
||||
// Name
|
||||
TILE1.COUNTER_2.$name = "COUNTER_2";
|
||||
// event - Trigger actions in the counter.
|
||||
TILE1.COUNTER_2.event = "BOUNDARY.in0";
|
||||
// What action should be taken on an event trigger?
|
||||
TILE1.COUNTER_2.action = "Load";
|
||||
// event_load_val - Sets the value of the event load value register.
|
||||
TILE1.COUNTER_2.event_load_val = "1";
|
||||
// match1_val - Sets the value of the Match reference 1 register.
|
||||
TILE1.COUNTER_2.match1_val = "1";
|
||||
// reset - Reset the counter to 0 on next clock cycle (triggers low to high)
|
||||
TILE1.COUNTER_2.reset = "COUNTER_2.count_match1";
|
||||
// Name
|
||||
TILE1.OUTLUT_0.$name = "OUTLUT_0";
|
||||
// Name
|
||||
TILE1.OUTLUT_1.$name = "OUTLUT_1";
|
||||
// Name
|
||||
TILE1.OUTLUT_2.$name = "OUTLUT_2";
|
||||
// Name
|
||||
TILE1.OUTLUT_3.$name = "OUTLUT_3";
|
||||
// Name
|
||||
TILE1.OUTLUT_4.$name = "OUTLUT_4";
|
||||
// i0 - Input 0.
|
||||
TILE1.OUTLUT_4.i0 = "FSM_0.S0";
|
||||
// i1 - Input 1.
|
||||
TILE1.OUTLUT_4.i1 = "COUNTER_0.count_match2";
|
||||
// eqn - Boolean equation on the variables i2,i1,i0 for the OUTLUT output.
|
||||
TILE1.OUTLUT_4.eqn = "i0 & (~i1)";
|
||||
// Name
|
||||
TILE1.OUTLUT_5.$name = "OUTLUT_5";
|
||||
// Name
|
||||
TILE1.OUTLUT_6.$name = "OUTLUT_6";
|
||||
// Name
|
||||
TILE1.OUTLUT_7.$name = "OUTLUT_7";
|
||||
// Name
|
||||
TILE1.HLC.$name = "HLC_0";
|
||||
// Event 0 (e0) - Event 0
|
||||
TILE1.HLC.e0 = "BOUNDARY.in0";
|
||||
// Event 1 (e1) - Event 1
|
||||
TILE1.HLC.e1 = "COUNTER_1.count_match1";
|
||||
// R0_init - Initial value for register R0
|
||||
TILE1.HLC.R0_init = "20";
|
||||
// Name
|
||||
TILE1.HLC.program0.$name = "HLCP_0";
|
||||
// instruct0
|
||||
TILE1.HLC.program0.instruct0 = "MOV_T2 R0, C0";
|
||||
// Name
|
||||
TILE1.HLC.program1.$name = "HLCP_1";
|
||||
// instruct0
|
||||
TILE1.HLC.program1.instruct0 = "INTR 1";
|
||||
// Name
|
||||
TILE1.HLC.program2.$name = "HLCP_2";
|
||||
// Name
|
||||
TILE1.HLC.program3.$name = "HLCP_3";
|
||||
var clb_run_dynamic_template_clb_h = scripting.addModule("/utilities/clb_tool/clb_syscfg/source/clb_run_dynamic_template_clb_h.js");
|
||||
var clb_run_dynamic_template_clb_c = scripting.addModule("/utilities/clb_tool/clb_syscfg/source/clb_run_dynamic_template_clb_c.js");
|
||||
var clb_run_dynamic_template_clb_sim = scripting.addModule("/utilities/clb_tool/clb_syscfg/source/clb_run_dynamic_template_clb_sim.js");
|
||||
var clb_run_dynamic_template_clb_dot = scripting.addModule("/utilities/clb_tool/clb_syscfg/source/clb_run_dynamic_template_clb_dot.js");
|
||||
@@ -0,0 +1,208 @@
|
||||
//#############################################################################
|
||||
//
|
||||
// FILE: clb_ex1_combinatorial_logic.c
|
||||
//
|
||||
// TITLE: CLB Combinational Logic.
|
||||
//
|
||||
//! \addtogroup driver_example_list
|
||||
//! <h1>CLB Combinational Logic</h1>
|
||||
//!
|
||||
//! For the detailed description of this example, please refer to:
|
||||
//! C2000Ware_PATH\utilities\clb_tool\clb_syscfg\doc\CLB Tool Users Guide.pdf
|
||||
//!
|
||||
//
|
||||
//
|
||||
//#############################################################################
|
||||
//
|
||||
//
|
||||
// $Copyright:
|
||||
// Copyright (C) 2013-2024 Texas Instruments Incorporated - http://www.ti.com/
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions
|
||||
// are met:
|
||||
//
|
||||
// Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
//
|
||||
// Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
//
|
||||
// Neither the name of Texas Instruments Incorporated nor the names of
|
||||
// its contributors may be used to endorse or promote products derived
|
||||
// from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
// $
|
||||
//#############################################################################
|
||||
|
||||
|
||||
#include "driverlib.h"
|
||||
#include "device.h"
|
||||
#include "clb_config.h"
|
||||
#include "clb.h"
|
||||
|
||||
|
||||
#define EPWM1_TIMER_TBPRD 2000U
|
||||
#define EPWM1_CMPA 1333U
|
||||
#define EPWM1_CMPB 667U
|
||||
|
||||
#define EPWM2_TIMER_TBPRD 2000U
|
||||
#define EPWM2_CMPA 1333U
|
||||
#define EPWM2_CMPB 667U
|
||||
|
||||
void initEPWM1(void);
|
||||
void initEPWM2(void);
|
||||
void initCLB1(void);
|
||||
__interrupt void epwm1ISR(void);
|
||||
|
||||
uint32_t mode = 0;
|
||||
|
||||
|
||||
void main(void)
|
||||
{
|
||||
Device_init();
|
||||
Device_initGPIO();
|
||||
|
||||
Interrupt_initModule();
|
||||
Interrupt_initVectorTable();
|
||||
Interrupt_register(INT_EPWM1, &epwm1ISR);
|
||||
|
||||
GPIO_setPadConfig(0, GPIO_PIN_TYPE_STD);
|
||||
GPIO_setPinConfig(GPIO_0_EPWM1A);
|
||||
GPIO_setPadConfig(1, GPIO_PIN_TYPE_STD);
|
||||
GPIO_setPinConfig(GPIO_1_EPWM1B);
|
||||
|
||||
GPIO_setPadConfig(2, GPIO_PIN_TYPE_STD);
|
||||
GPIO_setPinConfig(GPIO_2_EPWM2A);
|
||||
GPIO_setPadConfig(3, GPIO_PIN_TYPE_STD);
|
||||
GPIO_setPinConfig(GPIO_3_EPWM2B);
|
||||
|
||||
SysCtl_disablePeripheral(SYSCTL_PERIPH_CLK_TBCLKSYNC);
|
||||
initEPWM1();
|
||||
initEPWM2();
|
||||
SysCtl_enablePeripheral(SYSCTL_PERIPH_CLK_TBCLKSYNC);
|
||||
//SysCtl_enablePeripheral((SysCtl_PeripheralPCLOCKCR)0x0011);
|
||||
|
||||
CLB_enableCLB(CLB1_BASE);
|
||||
initTILE1(CLB1_BASE);
|
||||
|
||||
//
|
||||
// Select Global input instead of local input for all CLB IN
|
||||
//
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN0, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN1, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN2, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN3, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN4, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN5, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN6, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN7, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN0, CLB_GLOBAL_IN_MUX_EPWM1_CTRDIR);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN1, CLB_GLOBAL_IN_MUX_EPWM1_CTRDIR);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN2, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN3, CLB_GLOBAL_IN_MUX_EPWM1B);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN4, CLB_GLOBAL_IN_MUX_EPWM1_CTRDIR);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN5, CLB_GLOBAL_IN_MUX_EPWM1_CTRDIR);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN6, CLB_GLOBAL_IN_MUX_EPWM1_CTRDIR);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN7, CLB_GLOBAL_IN_MUX_EPWM1_CTRDIR);
|
||||
|
||||
//
|
||||
// Inputs set to GP register
|
||||
//
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN0, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN1, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN2, CLB_GP_IN_MUX_EXTERNAL);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN3, CLB_GP_IN_MUX_EXTERNAL);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN4, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN5, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN6, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN7, CLB_GP_IN_MUX_GP_REG);
|
||||
|
||||
CLB_setGPREG(CLB1_BASE, mode);
|
||||
|
||||
CLB_setOutputMask(CLB1_BASE, 0x5, true);
|
||||
|
||||
Interrupt_enable(INT_EPWM1);
|
||||
EINT;
|
||||
EPWM_setTimeBaseCounterMode(EPWM1_BASE, EPWM_COUNTER_MODE_UP);
|
||||
EPWM_setTimeBaseCounterMode(EPWM2_BASE, EPWM_COUNTER_MODE_UP);
|
||||
|
||||
while(1)
|
||||
{
|
||||
asm(" NOP");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
__interrupt void epwm1ISR(void)
|
||||
{
|
||||
EPWM_clearEventTriggerInterruptFlag(EPWM1_BASE);
|
||||
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP3);
|
||||
CLB_setGPREG(CLB1_BASE, mode & 3UL);
|
||||
asm(" NOP");
|
||||
}
|
||||
|
||||
|
||||
void initEPWM1()
|
||||
{
|
||||
EPWM_setTimeBasePeriod(EPWM1_BASE, EPWM1_TIMER_TBPRD);
|
||||
EPWM_setPhaseShift(EPWM1_BASE, 0U);
|
||||
EPWM_setTimeBaseCounter(EPWM1_BASE, 0U);
|
||||
|
||||
EPWM_setSyncOutPulseMode(EPWM1_BASE, EPWM_SYNC_OUT_PULSE_ON_COUNTER_ZERO);
|
||||
|
||||
EPWM_setCounterCompareValue(EPWM1_BASE, EPWM_COUNTER_COMPARE_A, EPWM1_CMPA);
|
||||
EPWM_setCounterCompareValue(EPWM1_BASE, EPWM_COUNTER_COMPARE_B, EPWM1_CMPB);
|
||||
|
||||
EPWM_disablePhaseShiftLoad(EPWM1_BASE);
|
||||
EPWM_setClockPrescaler(EPWM1_BASE, EPWM_CLOCK_DIVIDER_1, EPWM_HSCLOCK_DIVIDER_1);
|
||||
|
||||
EPWM_setCounterCompareShadowLoadMode(EPWM1_BASE, EPWM_COUNTER_COMPARE_A, EPWM_COMP_LOAD_ON_CNTR_ZERO);
|
||||
EPWM_setCounterCompareShadowLoadMode(EPWM1_BASE, EPWM_COUNTER_COMPARE_B, EPWM_COMP_LOAD_ON_CNTR_ZERO);
|
||||
|
||||
EPWM_setActionQualifierAction(EPWM1_BASE, EPWM_AQ_OUTPUT_A, EPWM_AQ_OUTPUT_HIGH, EPWM_AQ_OUTPUT_ON_TIMEBASE_ZERO);
|
||||
EPWM_setActionQualifierAction(EPWM1_BASE, EPWM_AQ_OUTPUT_A, EPWM_AQ_OUTPUT_LOW, EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPA);
|
||||
EPWM_setActionQualifierAction(EPWM1_BASE, EPWM_AQ_OUTPUT_B, EPWM_AQ_OUTPUT_TOGGLE, EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPB);
|
||||
|
||||
EPWM_setInterruptSource(EPWM1_BASE, EPWM_INT_TBCTR_ZERO);
|
||||
EPWM_enableInterrupt(EPWM1_BASE);
|
||||
EPWM_setInterruptEventCount(EPWM1_BASE, 3U);
|
||||
}
|
||||
|
||||
|
||||
void initEPWM2()
|
||||
{
|
||||
EPWM_setTimeBasePeriod(EPWM2_BASE, EPWM2_TIMER_TBPRD);
|
||||
EPWM_setPhaseShift(EPWM2_BASE, 0U);
|
||||
EPWM_setTimeBaseCounter(EPWM2_BASE, 0U);
|
||||
|
||||
EPWM_enablePhaseShiftLoad(EPWM2_BASE);
|
||||
EPWM_setPhaseShift(EPWM2_BASE, 0U);
|
||||
|
||||
EPWM_setCounterCompareValue(EPWM2_BASE, EPWM_COUNTER_COMPARE_A, EPWM2_CMPA);
|
||||
EPWM_setCounterCompareValue(EPWM2_BASE, EPWM_COUNTER_COMPARE_B, EPWM2_CMPB);
|
||||
|
||||
EPWM_setClockPrescaler(EPWM2_BASE, EPWM_CLOCK_DIVIDER_1, EPWM_HSCLOCK_DIVIDER_1);
|
||||
|
||||
EPWM_setCounterCompareShadowLoadMode(EPWM2_BASE, EPWM_COUNTER_COMPARE_A, EPWM_COMP_LOAD_ON_CNTR_ZERO);
|
||||
EPWM_setCounterCompareShadowLoadMode(EPWM2_BASE, EPWM_COUNTER_COMPARE_B, EPWM_COMP_LOAD_ON_CNTR_ZERO);
|
||||
|
||||
EPWM_setActionQualifierAction(EPWM2_BASE, EPWM_AQ_OUTPUT_A, EPWM_AQ_OUTPUT_HIGH, EPWM_AQ_OUTPUT_ON_TIMEBASE_ZERO);
|
||||
EPWM_setActionQualifierAction(EPWM2_BASE, EPWM_AQ_OUTPUT_A, EPWM_AQ_OUTPUT_LOW, EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPA);
|
||||
EPWM_setActionQualifierAction(EPWM2_BASE, EPWM_AQ_OUTPUT_B, EPWM_AQ_OUTPUT_TOGGLE, EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPB);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
|
||||
var TILE = scripting.addModule("/utilities/clb_tool/clb_syscfg/source/TILE");
|
||||
var TILE1 = TILE.addInstance();
|
||||
// Name
|
||||
TILE1.$name = "TILE1";
|
||||
// in_period0
|
||||
TILE1.BOUNDARY.in_period0 = 4;
|
||||
// in_duty0
|
||||
TILE1.BOUNDARY.in_duty0 = 1;
|
||||
// i1 - Input 1.
|
||||
TILE1.LUT_0.i1 = "BOUNDARY.in1";
|
||||
// i2 - Input 2.
|
||||
TILE1.LUT_0.i2 = "BOUNDARY.in2";
|
||||
// i3 - Input 3.
|
||||
TILE1.LUT_0.i3 = "BOUNDARY.in3";
|
||||
// i0 - Input 0.
|
||||
TILE1.LUT_0.i0 = "BOUNDARY.in0";
|
||||
// eqn - Boolean equation on the variables i3,i2,i1,i0 for the LUT output.
|
||||
TILE1.LUT_0.eqn = "(!i0 & !i1 & i2) | (i0 & !i1 & !(i3 & !(i2 & i3))) | (!i0 & i1 & i2 & !(i2 & i3))";
|
||||
// i0 - Input 0.
|
||||
TILE1.LUT_1.i0 = "BOUNDARY.in0";
|
||||
// i1 - Input 1.
|
||||
TILE1.LUT_1.i1 = "BOUNDARY.in1";
|
||||
// i2 - Input 2.
|
||||
TILE1.LUT_1.i2 = "BOUNDARY.in2";
|
||||
// i3 - Input 3.
|
||||
TILE1.LUT_1.i3 = "BOUNDARY.in3";
|
||||
// eqn - Boolean equation on the variables i3,i2,i1,i0 for the LUT output.
|
||||
TILE1.LUT_1.eqn = "(!i0 & !i1 & i3) | (i0 & !i1 & !(i2 & !(i2 & i3))) | (!i0 & i1 & i3 & !(i2 & i3))";
|
||||
// i0 - Input 0.
|
||||
TILE1.LUT_2.i0 = "BOUNDARY.in0";
|
||||
// i1 - Input 1.
|
||||
TILE1.LUT_2.i1 = "BOUNDARY.in1";
|
||||
// i2 - Input 2.
|
||||
TILE1.LUT_2.i2 = "BOUNDARY.in2";
|
||||
// i3 - Input 3.
|
||||
TILE1.LUT_2.i3 = "BOUNDARY.in3";
|
||||
// eqn - Boolean equation on the variables i3,i2,i1,i0 for the LUT output.
|
||||
TILE1.LUT_2.eqn = "i3";
|
||||
// e0 - External Input 0.
|
||||
TILE1.FSM_0.e0 = "BOUNDARY.in1";
|
||||
// e1 - External Input 1.
|
||||
TILE1.FSM_0.e1 = "COUNTER_0.count_match1";
|
||||
// e0 - External Input 0.
|
||||
TILE1.FSM_1.e0 = "BOUNDARY.in0";
|
||||
// e1 - External Input 1.
|
||||
TILE1.FSM_1.e1 = "COUNTER_1.count_match1";
|
||||
// e0 - External Input 0.
|
||||
TILE1.FSM_2.e0 = "LUT_2.OUT";
|
||||
// e1 - External Input 1.
|
||||
TILE1.FSM_2.e1 = "COUNTER_2.count_zero";
|
||||
// eqn_out - Boolean equation on the variables e1,e0,s1,s0 for the LUT output.
|
||||
TILE1.FSM_2.eqn_out = "e1 | e0";
|
||||
// eqn_s0 - Boolean equation on the variables e1,e0,s1,s0 for the S0 output.
|
||||
TILE1.FSM_2.eqn_s0 = "e0 & e1";
|
||||
// eqn_s1 - Boolean equation on the variables e1,e0,s1,s0 for the S1 output.
|
||||
TILE1.FSM_2.eqn_s1 = "s0 | s1";
|
||||
// reset - Reset the counter to 0 on next clock cycle (triggers low to high)
|
||||
TILE1.COUNTER_0.reset = "FSM_0.OUT";
|
||||
// reset - Reset the counter to 0 on next clock cycle (triggers low to high)
|
||||
TILE1.COUNTER_1.reset = "FSM_1.OUT";
|
||||
// reset - Reset the counter to 0 on next clock cycle (triggers low to high)
|
||||
TILE1.COUNTER_2.reset = "BOUNDARY.in3";
|
||||
// event - Trigger actions in the counter.
|
||||
TILE1.COUNTER_2.event = "LUT_2.OUT";
|
||||
// What action should be taken on an event trigger?
|
||||
TILE1.COUNTER_2.action = "Add";
|
||||
// eqn - Boolean equation on the variables i2,i1,i0 for the OUTLUT output.
|
||||
TILE1.OUTLUT_0.eqn = "i0";
|
||||
// i0 - Input 0.
|
||||
TILE1.OUTLUT_0.i0 = "LUT_0.OUT";
|
||||
// eqn - Boolean equation on the variables i2,i1,i0 for the OUTLUT output.
|
||||
TILE1.OUTLUT_1.eqn = "0";
|
||||
// eqn - Boolean equation on the variables i2,i1,i0 for the OUTLUT output.
|
||||
TILE1.OUTLUT_2.eqn = "i0";
|
||||
// i0 - Input 0.
|
||||
TILE1.OUTLUT_2.i0 = "LUT_1.OUT";
|
||||
// eqn - Boolean equation on the variables i2,i1,i0 for the OUTLUT output.
|
||||
TILE1.OUTLUT_3.eqn = "0";
|
||||
// instruct0
|
||||
TILE1.HLC.program2.instruct0 = "mov r0,c0";
|
||||
|
||||
@@ -0,0 +1,161 @@
|
||||
//#############################################################################
|
||||
//
|
||||
// FILE: clb_ex2_gpio_input_filter.c
|
||||
//
|
||||
// TITLE: CLB GPIO Input Filter.
|
||||
//
|
||||
//! \addtogroup driver_example_list
|
||||
//! <h1>CLB GPIO Input Filter</h1>
|
||||
//!
|
||||
//! For the detailed description of this example, please refer to:
|
||||
//! C2000Ware_PATH\utilities\clb_tool\clb_syscfg\doc\CLB Tool Users Guide.pdf
|
||||
//!
|
||||
//
|
||||
//
|
||||
//#############################################################################
|
||||
//
|
||||
//
|
||||
// $Copyright:
|
||||
// Copyright (C) 2013-2024 Texas Instruments Incorporated - http://www.ti.com/
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions
|
||||
// are met:
|
||||
//
|
||||
// Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
//
|
||||
// Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
//
|
||||
// Neither the name of Texas Instruments Incorporated nor the names of
|
||||
// its contributors may be used to endorse or promote products derived
|
||||
// from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
// $
|
||||
//#############################################################################
|
||||
|
||||
|
||||
#include "driverlib.h"
|
||||
#include "device.h"
|
||||
#include "clb_config.h"
|
||||
#include "clb.h"
|
||||
|
||||
#define EPWM1_TIMER_TBPRD 0xFFFF
|
||||
#define EPWM1_CMPA 0x0003
|
||||
#define EPWM1_CMPB 0xFFFC
|
||||
#define MODE_CHG_COUNT 10000U
|
||||
|
||||
void initEPWM1(void);
|
||||
void initCLB1(void);
|
||||
|
||||
uint32_t ccount = 0UL;
|
||||
uint16_t cglitch = 3U;
|
||||
|
||||
|
||||
void main(void)
|
||||
{
|
||||
Device_init();
|
||||
Device_initGPIO();
|
||||
|
||||
Interrupt_initModule();
|
||||
Interrupt_initVectorTable();
|
||||
|
||||
GPIO_setPadConfig(0, GPIO_PIN_TYPE_STD);
|
||||
GPIO_setPinConfig(GPIO_0_EPWM1A);
|
||||
GPIO_setPadConfig(1, GPIO_PIN_TYPE_STD);
|
||||
GPIO_setPinConfig(GPIO_1_EPWM1B);
|
||||
|
||||
SysCtl_disablePeripheral(SYSCTL_PERIPH_CLK_TBCLKSYNC);
|
||||
initEPWM1();
|
||||
SysCtl_enablePeripheral(SYSCTL_PERIPH_CLK_TBCLKSYNC);
|
||||
//SysCtl_enablePeripheral((SysCtl_PeripheralPCLOCKCR)0x0011);
|
||||
|
||||
CLB_enableCLB(CLB1_BASE);
|
||||
initTILE1(CLB1_BASE);
|
||||
//
|
||||
// Select Global input instead of local input for all CLB IN
|
||||
//
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN0, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN1, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN2, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN3, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN4, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN5, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN6, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN7, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN0, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN1, CLB_GLOBAL_IN_MUX_EPWM1_CTRDIR);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN2, CLB_GLOBAL_IN_MUX_EPWM1_CTRDIR);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN3, CLB_GLOBAL_IN_MUX_EPWM1_CTRDIR);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN4, CLB_GLOBAL_IN_MUX_EPWM1_CTRDIR);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN5, CLB_GLOBAL_IN_MUX_EPWM1_CTRDIR);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN6, CLB_GLOBAL_IN_MUX_EPWM1_CTRDIR);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN7, CLB_GLOBAL_IN_MUX_EPWM1_CTRDIR);
|
||||
|
||||
//
|
||||
// Inputs set to GP register
|
||||
//
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN0, CLB_GP_IN_MUX_EXTERNAL);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN1, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN2, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN3, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN4, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN5, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN6, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN7, CLB_GP_IN_MUX_GP_REG);
|
||||
|
||||
CLB_setOutputMask(CLB1_BASE, 0x1, true);
|
||||
|
||||
EPWM_setTimeBaseCounterMode(EPWM1_BASE, EPWM_COUNTER_MODE_UP);
|
||||
|
||||
while(1)
|
||||
{
|
||||
if (ccount++ > MODE_CHG_COUNT)
|
||||
{
|
||||
EPWM_setCounterCompareValue (EPWM1_BASE, EPWM_COUNTER_COMPARE_A, cglitch);
|
||||
EPWM_setCounterCompareValue (EPWM1_BASE, EPWM_COUNTER_COMPARE_B, cglitch);
|
||||
ccount = 0;
|
||||
}
|
||||
asm(" NOP");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void initEPWM1()
|
||||
{
|
||||
EPWM_setTimeBasePeriod(EPWM1_BASE, EPWM1_TIMER_TBPRD);
|
||||
EPWM_setPhaseShift(EPWM1_BASE, 0U);
|
||||
EPWM_setTimeBaseCounter(EPWM1_BASE, 0U);
|
||||
|
||||
EPWM_setSyncOutPulseMode(EPWM1_BASE, EPWM_SYNC_OUT_PULSE_ON_COUNTER_ZERO);
|
||||
|
||||
EPWM_setCounterCompareValue(EPWM1_BASE, EPWM_COUNTER_COMPARE_A, EPWM1_CMPA);
|
||||
EPWM_setCounterCompareValue(EPWM1_BASE, EPWM_COUNTER_COMPARE_B, EPWM1_CMPB);
|
||||
|
||||
EPWM_disablePhaseShiftLoad(EPWM1_BASE);
|
||||
EPWM_setClockPrescaler(EPWM1_BASE, EPWM_CLOCK_DIVIDER_1, EPWM_HSCLOCK_DIVIDER_1);
|
||||
|
||||
EPWM_setCounterCompareShadowLoadMode(EPWM1_BASE, EPWM_COUNTER_COMPARE_A, EPWM_COMP_LOAD_ON_CNTR_ZERO);
|
||||
EPWM_setCounterCompareShadowLoadMode(EPWM1_BASE, EPWM_COUNTER_COMPARE_B, EPWM_COMP_LOAD_ON_CNTR_ZERO);
|
||||
|
||||
EPWM_setActionQualifierAction(EPWM1_BASE, EPWM_AQ_OUTPUT_A, EPWM_AQ_OUTPUT_HIGH, EPWM_AQ_OUTPUT_ON_TIMEBASE_ZERO);
|
||||
EPWM_setActionQualifierAction(EPWM1_BASE, EPWM_AQ_OUTPUT_A, EPWM_AQ_OUTPUT_LOW, EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPA);
|
||||
EPWM_setActionQualifierAction(EPWM1_BASE, EPWM_AQ_OUTPUT_B, EPWM_AQ_OUTPUT_HIGH, EPWM_AQ_OUTPUT_ON_TIMEBASE_ZERO);
|
||||
EPWM_setActionQualifierAction(EPWM1_BASE, EPWM_AQ_OUTPUT_B, EPWM_AQ_OUTPUT_LOW, EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPA);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
|
||||
var TILE = scripting.addModule("/utilities/clb_tool/clb_syscfg/source/TILE");
|
||||
var TILE1 = TILE.addInstance();
|
||||
// clock_period - Period of the clock (in Nano Seconds) used for simulation in System C
|
||||
TILE.clock_period = 10;
|
||||
// sim_duration - Duration of the simulation (in Nano Seconds)
|
||||
TILE.sim_duration = 100000;
|
||||
// Name
|
||||
TILE1.$name = "TILE1";
|
||||
// in1
|
||||
TILE1.BOUNDARY.in1 = "squareWave";
|
||||
// in0
|
||||
TILE1.BOUNDARY.in0 = "squareWave";
|
||||
// in4
|
||||
TILE1.BOUNDARY.in4 = "1";
|
||||
// in5
|
||||
TILE1.BOUNDARY.in5 = "0";
|
||||
// in_duty1 - Duty or ON time of the square wave
|
||||
TILE1.BOUNDARY.in_duty1 = 50;
|
||||
// in_period1 - Period of the square wave
|
||||
TILE1.BOUNDARY.in_period1 = 100;
|
||||
// in2
|
||||
TILE1.BOUNDARY.in2 = "1";
|
||||
// in6
|
||||
TILE1.BOUNDARY.in6 = "1";
|
||||
// in_repeat_count0 - Number of periods the waveform is repeated
|
||||
TILE1.BOUNDARY.in_repeat_count0 = 50;
|
||||
// in3
|
||||
TILE1.BOUNDARY.in3 = "squareWave";
|
||||
// in_repeat_count3 - Number of periods the waveform is repeated
|
||||
TILE1.BOUNDARY.in_repeat_count3 = 1;
|
||||
// in_repeat_count1 - Number of periods the waveform is repeated
|
||||
TILE1.BOUNDARY.in_repeat_count1 = 1000;
|
||||
// in_duty0 - Duty or ON time of the square wave
|
||||
TILE1.BOUNDARY.in_duty0 = 20;
|
||||
// in_period0 - Period of the square wave
|
||||
TILE1.BOUNDARY.in_period0 = 40;
|
||||
// eqn - Boolean equation on the variables i3,i2,i1,i0 for the LUT output.
|
||||
TILE1.LUT_0.eqn = "~i0";
|
||||
// i0 - Input 0.
|
||||
TILE1.LUT_0.i0 = "BOUNDARY.in0";
|
||||
// e0 - External Input 0.
|
||||
TILE1.FSM_0.e0 = "COUNTER_0.count_match1";
|
||||
// e1 - External Input 1.
|
||||
TILE1.FSM_0.e1 = "COUNTER_1.count_match1";
|
||||
// eqn_s0 - Boolean equation on the variables e1,e0,s1,s0 for the S0 output.
|
||||
TILE1.FSM_0.eqn_s0 = "(~s0 & e1) | (s0 & (~e0))";
|
||||
// match1_val - Sets the value of the Match reference 1 register.
|
||||
TILE1.COUNTER_0.match1_val = "8";
|
||||
// mode1 - Controls counting direction. High enables count up. Low enables count down.
|
||||
TILE1.COUNTER_0.mode1 = "1";
|
||||
// mode0 - Enables Counting when high
|
||||
TILE1.COUNTER_0.mode0 = "LUT_0.OUT";
|
||||
// reset - Reset the counter to 0 on next clock cycle (triggers low to high)
|
||||
TILE1.COUNTER_0.reset = "BOUNDARY.in0";
|
||||
// match1_val - Sets the value of the Match reference 1 register.
|
||||
TILE1.COUNTER_1.match1_val = "8";
|
||||
// mode1 - Controls counting direction. High enables count up. Low enables count down.
|
||||
TILE1.COUNTER_1.mode1 = "1";
|
||||
// mode0 - Enables Counting when high
|
||||
TILE1.COUNTER_1.mode0 = "BOUNDARY.in0";
|
||||
// reset - Reset the counter to 0 on next clock cycle (triggers low to high)
|
||||
TILE1.COUNTER_1.reset = "LUT_0.OUT";
|
||||
// mode1 - Controls counting direction. High enables count up. Low enables count down.
|
||||
TILE1.COUNTER_2.mode1 = "1";
|
||||
// mode0 - Enables Counting when high
|
||||
TILE1.COUNTER_2.mode0 = "1";
|
||||
// reset - Reset the counter to 0 on next clock cycle (triggers low to high)
|
||||
TILE1.COUNTER_2.reset = "COUNTER_2.count_match1";
|
||||
// eqn - Boolean equation on the variables i2,i1,i0 for the OUTLUT output.
|
||||
TILE1.OUTLUT_0.eqn = "i0";
|
||||
// i0 - Input 0.
|
||||
TILE1.OUTLUT_0.i0 = "FSM_0.S0";
|
||||
|
||||
@@ -0,0 +1,172 @@
|
||||
//#############################################################################
|
||||
//
|
||||
// FILE: clb_ex3_auxiliary_pwm.c
|
||||
//
|
||||
// TITLE: CLB Auxilary PWM.
|
||||
//
|
||||
//! \addtogroup driver_example_list
|
||||
//! <h1>CLB Auxilary PWM</h1>
|
||||
//!
|
||||
//! For the detailed description of this example, please refer to:
|
||||
//! C2000Ware_PATH\utilities\clb_tool\clb_syscfg\doc\CLB Tool Users Guide.pdf
|
||||
//!
|
||||
//
|
||||
//
|
||||
//#############################################################################
|
||||
//
|
||||
//
|
||||
// $Copyright:
|
||||
// Copyright (C) 2013-2024 Texas Instruments Incorporated - http://www.ti.com/
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions
|
||||
// are met:
|
||||
//
|
||||
// Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
//
|
||||
// Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
//
|
||||
// Neither the name of Texas Instruments Incorporated nor the names of
|
||||
// its contributors may be used to endorse or promote products derived
|
||||
// from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
// $
|
||||
//#############################################################################
|
||||
|
||||
|
||||
#include "driverlib.h"
|
||||
#include "device.h"
|
||||
#include "clb_config.h"
|
||||
#include "clb.h"
|
||||
|
||||
__interrupt void clb1ISR(void);
|
||||
|
||||
#define ENABLE_AUX_PWM 1
|
||||
volatile uint16_t dutyValue=200;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
Device_init();
|
||||
Device_initGPIO();
|
||||
|
||||
Interrupt_initModule();
|
||||
Interrupt_initVectorTable();
|
||||
|
||||
Interrupt_register(INT_CLB1, &clb1ISR);
|
||||
Interrupt_enable(INT_CLB1);
|
||||
|
||||
//SysCtl_enablePeripheral((SysCtl_PeripheralPCLOCKCR)0x0011);
|
||||
|
||||
CLB_enableCLB(CLB1_BASE);
|
||||
initTILE1(CLB1_BASE);
|
||||
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN0, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN1, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN2, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN3, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN4, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN5, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN6, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN7, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN0, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN1, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN2, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN3, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN4, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN5, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN6, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN7, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
|
||||
//
|
||||
// Inputs set to GP register
|
||||
//
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN0, CLB_GP_IN_MUX_GP_REG);
|
||||
|
||||
//
|
||||
// Unused inputs to GP register
|
||||
//
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN1, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN2, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN3, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN4, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN5, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN6, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN7, CLB_GP_IN_MUX_GP_REG);
|
||||
|
||||
//
|
||||
// Configure GPIO0 for Output
|
||||
// Used to see trigger of ISR
|
||||
//
|
||||
GPIO_setPinConfig(GPIO_0_GPIO0);
|
||||
GPIO_setDirectionMode(0, GPIO_DIR_MODE_OUT);
|
||||
GPIO_setPadConfig(0, GPIO_PIN_TYPE_STD);
|
||||
|
||||
//
|
||||
// Configure GPIO24 for OUTPUTXBAR1
|
||||
//
|
||||
GPIO_setPinConfig(GPIO_24_OUTPUTXBAR1);
|
||||
GPIO_setDirectionMode(24, GPIO_DIR_MODE_OUT);
|
||||
GPIO_setPadConfig(24, GPIO_PIN_TYPE_STD);
|
||||
|
||||
//
|
||||
// Configure OUTPUT-XBAR OUTPUT1 as CLB1_OUT4
|
||||
//
|
||||
XBAR_setOutputMuxConfig(XBAR_OUTPUT1, XBAR_OUT_MUX01_CLB1_OUT4);
|
||||
XBAR_enableOutputMux(XBAR_OUTPUT1, XBAR_MUX01);
|
||||
|
||||
CLB_setGPREG(CLB1_BASE, ENABLE_AUX_PWM);
|
||||
|
||||
//
|
||||
// Enable Global Interrupt (INTM) and realtime interrupt (DBGM)
|
||||
//
|
||||
EINT;
|
||||
ERTM;
|
||||
|
||||
CLB_clearInterruptTag(CLB1_BASE);
|
||||
|
||||
while(1)
|
||||
{
|
||||
asm(" NOP");
|
||||
}
|
||||
}
|
||||
|
||||
__interrupt void clb1ISR(void)
|
||||
{
|
||||
GPIO_togglePin(0); // Debug: Used to determine if interrupt is being set
|
||||
|
||||
//
|
||||
// Change duty cycle of PWM signal at the end of a period
|
||||
//
|
||||
if (dutyValue == 150)
|
||||
{
|
||||
dutyValue = 100U;
|
||||
}
|
||||
else
|
||||
{
|
||||
dutyValue = 150U;
|
||||
}
|
||||
|
||||
//
|
||||
// Load new duty cycle value in HLC Registers
|
||||
//
|
||||
CLB_setHLCRegisters(CLB1_BASE, dutyValue, 0, 0, 0);
|
||||
|
||||
CLB_clearInterruptTag(CLB1_BASE);
|
||||
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP5);
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
|
||||
var TILE = scripting.addModule("/utilities/clb_tool/clb_syscfg/source/TILE");
|
||||
var TILE1 = TILE.addInstance();
|
||||
// clock_period - Period of the clock (in Nano Seconds) used for simulation in System C
|
||||
TILE.clock_period = 10;
|
||||
// sim_duration - Duration of the simulation (in Nano Seconds)
|
||||
TILE.sim_duration = 100000;
|
||||
// Name
|
||||
TILE1.$name = "TILE1";
|
||||
// in0
|
||||
TILE1.BOUNDARY.in0 = "squareWave";
|
||||
// in_duty1 - Duty or ON time of the square wave
|
||||
TILE1.BOUNDARY.in_duty1 = 50;
|
||||
// in_period1 - Period of the square wave
|
||||
TILE1.BOUNDARY.in_period1 = 100;
|
||||
// in_repeat_count0 - Number of periods the waveform is repeated
|
||||
TILE1.BOUNDARY.in_repeat_count0 = 50;
|
||||
// in_repeat_count3 - Number of periods the waveform is repeated
|
||||
TILE1.BOUNDARY.in_repeat_count3 = 1;
|
||||
// in_repeat_count1 - Number of periods the waveform is repeated
|
||||
TILE1.BOUNDARY.in_repeat_count1 = 1000;
|
||||
// in_period0 - Period of the square wave
|
||||
TILE1.BOUNDARY.in_period0 = 50000;
|
||||
// in_duty0 - Duty or ON time of the square wave
|
||||
TILE1.BOUNDARY.in_duty0 = 49000;
|
||||
// i0 - Input 0.
|
||||
TILE1.LUT_0.i0 = "BOUNDARY.in0";
|
||||
// i1 - Input 1.
|
||||
TILE1.LUT_0.i1 = "COUNTER_0.count_match1";
|
||||
// eqn - Boolean equation on the variables i3,i2,i1,i0 for the LUT output.
|
||||
TILE1.LUT_0.eqn = "~i0 | i1";
|
||||
// eqn_s0 - Boolean equation on the variables e1,e0,s1,s0 for the S0 output.
|
||||
TILE1.FSM_0.eqn_s0 = "(~s0 & e0) | (s0 & (~e1))";
|
||||
// e0 - External Input 0.
|
||||
TILE1.FSM_0.e0 = "COUNTER_0.count_match2";
|
||||
// e1 - External Input 1.
|
||||
TILE1.FSM_0.e1 = "COUNTER_0.count_match1";
|
||||
// mode1 - Controls counting direction. High enables count up. Low enables count down.
|
||||
TILE1.COUNTER_0.mode1 = "1";
|
||||
// reset - Reset the counter to 0 on next clock cycle (triggers low to high)
|
||||
TILE1.COUNTER_0.reset = "LUT_0.OUT";
|
||||
// mode0 - Enables Counting when high
|
||||
TILE1.COUNTER_0.mode0 = "1";
|
||||
// match1_val - Sets the value of the Match reference 1 register.
|
||||
TILE1.COUNTER_0.match1_val = "300";
|
||||
// match2_val - Sets the value of the Match reference 2 register.
|
||||
TILE1.COUNTER_0.match2_val = "100";
|
||||
// eqn - Boolean equation on the variables i2,i1,i0 for the OUTLUT output.
|
||||
TILE1.OUTLUT_4.eqn = "i0";
|
||||
// i0 - Input 0.
|
||||
TILE1.OUTLUT_4.i0 = "FSM_0.S0";
|
||||
// R0_init - Initial value for register R0
|
||||
TILE1.HLC.R0_init = "200";
|
||||
// Event 0 (e0) - Event 0
|
||||
TILE1.HLC.e0 = "COUNTER_0.count_match1";
|
||||
// instruct0
|
||||
TILE1.HLC.program0.instruct0 = "MOV_T2 R0, C0";
|
||||
// instruct1
|
||||
TILE1.HLC.program0.instruct1 = "INTR 1";
|
||||
|
||||
@@ -0,0 +1,400 @@
|
||||
//#############################################################################
|
||||
//
|
||||
// FILE: clb_ex4_pwm_protection.c
|
||||
//
|
||||
// TITLE: CLB PWM Protection.
|
||||
//
|
||||
//! \addtogroup driver_example_list
|
||||
//! <h1>CLB PWM Protection</h1>
|
||||
//!
|
||||
//! For the detailed description of this example, please refer to:
|
||||
//! C2000Ware_PATH\utilities\clb_tool\clb_syscfg\doc\CLB Tool Users Guide.pdf
|
||||
//!
|
||||
//
|
||||
//
|
||||
//#############################################################################
|
||||
//
|
||||
//
|
||||
// $Copyright:
|
||||
// Copyright (C) 2013-2024 Texas Instruments Incorporated - http://www.ti.com/
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions
|
||||
// are met:
|
||||
//
|
||||
// Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
//
|
||||
// Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
//
|
||||
// Neither the name of Texas Instruments Incorporated nor the names of
|
||||
// its contributors may be used to endorse or promote products derived
|
||||
// from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
// $
|
||||
//#############################################################################
|
||||
|
||||
|
||||
#include "driverlib.h"
|
||||
#include "device.h"
|
||||
#include "clb_config.h"
|
||||
#include "clb.h"
|
||||
|
||||
#define EPWM1_TIMER_TBPRD 2000U
|
||||
#define EPWM1_CMPA 933U
|
||||
#define EPWM1_CMPB 933U
|
||||
|
||||
#define EPWM2_TIMER_TBPRD 2000U
|
||||
#define EPWM2_CMPA 933U
|
||||
#define EPWM2_CMPB 933U
|
||||
|
||||
#define EPWM3_TIMER_TBPRD 2000U
|
||||
#define EPWM3_CMPA 933U
|
||||
#define EPWM3_CMPB 933U
|
||||
|
||||
#define EPWM4_TIMER_TBPRD 2000U
|
||||
#define EPWM4_CMPA 933U
|
||||
#define EPWM4_CMPB 933U
|
||||
|
||||
|
||||
void initEPWM1(void);
|
||||
void initEPWM2(void);
|
||||
void initEPWM3(void);
|
||||
void initEPWM4(void);
|
||||
__interrupt void epwm1ISR(void);
|
||||
|
||||
uint32_t mode = 0;
|
||||
|
||||
|
||||
void main(void)
|
||||
{
|
||||
Device_init();
|
||||
Device_initGPIO();
|
||||
|
||||
Interrupt_initModule();
|
||||
Interrupt_initVectorTable();
|
||||
Interrupt_register(INT_EPWM1, &epwm1ISR);
|
||||
|
||||
GPIO_setPadConfig(0, GPIO_PIN_TYPE_STD);
|
||||
GPIO_setPinConfig(GPIO_0_EPWM1A);
|
||||
GPIO_setPadConfig(1, GPIO_PIN_TYPE_STD);
|
||||
GPIO_setPinConfig(GPIO_1_EPWM1B);
|
||||
|
||||
GPIO_setPadConfig(2, GPIO_PIN_TYPE_STD);
|
||||
GPIO_setPinConfig(GPIO_2_EPWM2A);
|
||||
GPIO_setPadConfig(3, GPIO_PIN_TYPE_STD);
|
||||
GPIO_setPinConfig(GPIO_3_EPWM2B);
|
||||
|
||||
GPIO_setPadConfig(4, GPIO_PIN_TYPE_STD);
|
||||
GPIO_setPinConfig(GPIO_4_EPWM3A);
|
||||
GPIO_setPadConfig(5, GPIO_PIN_TYPE_STD);
|
||||
GPIO_setPinConfig(GPIO_5_EPWM3B);
|
||||
|
||||
GPIO_setPadConfig(6, GPIO_PIN_TYPE_STD);
|
||||
GPIO_setPinConfig(GPIO_6_EPWM4A);
|
||||
GPIO_setPadConfig(7, GPIO_PIN_TYPE_STD);
|
||||
GPIO_setPinConfig(GPIO_7_EPWM4B);
|
||||
|
||||
SysCtl_disablePeripheral(SYSCTL_PERIPH_CLK_TBCLKSYNC);
|
||||
initEPWM1();
|
||||
initEPWM2();
|
||||
initEPWM3();
|
||||
initEPWM4();
|
||||
SysCtl_enablePeripheral(SYSCTL_PERIPH_CLK_TBCLKSYNC);
|
||||
//SysCtl_enablePeripheral((SysCtl_PeripheralPCLOCKCR)0x0011);
|
||||
SysCtl_enablePeripheral((SysCtl_PeripheralPCLOCKCR)0x0111);
|
||||
SysCtl_enablePeripheral((SysCtl_PeripheralPCLOCKCR)0x0211);
|
||||
SysCtl_enablePeripheral((SysCtl_PeripheralPCLOCKCR)0x0311);
|
||||
|
||||
// initialize all CLB tiles
|
||||
CLB_enableCLB(CLB1_BASE);
|
||||
CLB_enableCLB(CLB2_BASE);
|
||||
CLB_enableCLB(CLB3_BASE);
|
||||
CLB_enableCLB(CLB4_BASE);
|
||||
|
||||
initTILE1(CLB1_BASE);
|
||||
initTILE2(CLB2_BASE);
|
||||
initTILE3(CLB3_BASE);
|
||||
initTILE4(CLB4_BASE);
|
||||
|
||||
// CLB tile 1 configuration
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN0, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN1, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN2, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN3, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN4, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN5, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN6, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN7, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN0, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN1, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN2, CLB_GLOBAL_IN_MUX_EPWM1B);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN3, CLB_GLOBAL_IN_MUX_EPWM1B);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN4, CLB_GLOBAL_IN_MUX_EPWM1_CTRDIR);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN5, CLB_GLOBAL_IN_MUX_EPWM1_CTRDIR);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN6, CLB_GLOBAL_IN_MUX_EPWM1_CTRDIR);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN7, CLB_GLOBAL_IN_MUX_EPWM1_CTRDIR);
|
||||
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN0, CLB_GP_IN_MUX_EXTERNAL);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN1, CLB_GP_IN_MUX_EXTERNAL);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN2, CLB_GP_IN_MUX_EXTERNAL);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN3, CLB_GP_IN_MUX_EXTERNAL);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN4, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN5, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN6, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN7, CLB_GP_IN_MUX_GP_REG);
|
||||
|
||||
CLB_selectInputFilter(CLB1_BASE, CLB_IN0, CLB_FILTER_FALLING_EDGE);
|
||||
CLB_selectInputFilter(CLB1_BASE, CLB_IN2, CLB_FILTER_FALLING_EDGE);
|
||||
|
||||
// CLB tile 2 configuration
|
||||
CLB_configLocalInputMux(CLB2_BASE, CLB_IN0, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB2_BASE, CLB_IN1, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB2_BASE, CLB_IN2, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB2_BASE, CLB_IN3, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB2_BASE, CLB_IN4, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB2_BASE, CLB_IN5, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB2_BASE, CLB_IN6, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB2_BASE, CLB_IN7, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
|
||||
CLB_configGlobalInputMux(CLB2_BASE, CLB_IN0, CLB_GLOBAL_IN_MUX_EPWM2A);
|
||||
CLB_configGlobalInputMux(CLB2_BASE, CLB_IN1, CLB_GLOBAL_IN_MUX_EPWM2A);
|
||||
CLB_configGlobalInputMux(CLB2_BASE, CLB_IN2, CLB_GLOBAL_IN_MUX_EPWM2B);
|
||||
CLB_configGlobalInputMux(CLB2_BASE, CLB_IN3, CLB_GLOBAL_IN_MUX_EPWM2B);
|
||||
CLB_configGlobalInputMux(CLB2_BASE, CLB_IN4, CLB_GLOBAL_IN_MUX_EPWM2_CTRDIR);
|
||||
CLB_configGlobalInputMux(CLB2_BASE, CLB_IN5, CLB_GLOBAL_IN_MUX_EPWM2_CTRDIR);
|
||||
CLB_configGlobalInputMux(CLB2_BASE, CLB_IN6, CLB_GLOBAL_IN_MUX_EPWM2_CTRDIR);
|
||||
CLB_configGlobalInputMux(CLB2_BASE, CLB_IN7, CLB_GLOBAL_IN_MUX_EPWM2_CTRDIR);
|
||||
|
||||
CLB_configGPInputMux(CLB2_BASE, CLB_IN0, CLB_GP_IN_MUX_EXTERNAL);
|
||||
CLB_configGPInputMux(CLB2_BASE, CLB_IN1, CLB_GP_IN_MUX_EXTERNAL);
|
||||
CLB_configGPInputMux(CLB2_BASE, CLB_IN2, CLB_GP_IN_MUX_EXTERNAL);
|
||||
CLB_configGPInputMux(CLB2_BASE, CLB_IN3, CLB_GP_IN_MUX_EXTERNAL);
|
||||
CLB_configGPInputMux(CLB2_BASE, CLB_IN4, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB2_BASE, CLB_IN5, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB2_BASE, CLB_IN6, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB2_BASE, CLB_IN7, CLB_GP_IN_MUX_GP_REG);
|
||||
|
||||
CLB_selectInputFilter(CLB2_BASE, CLB_IN0, CLB_FILTER_FALLING_EDGE);
|
||||
CLB_selectInputFilter(CLB2_BASE, CLB_IN2, CLB_FILTER_FALLING_EDGE);
|
||||
|
||||
// CLB tile 3 configuration
|
||||
CLB_configLocalInputMux(CLB3_BASE, CLB_IN0, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB3_BASE, CLB_IN1, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB3_BASE, CLB_IN2, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB3_BASE, CLB_IN3, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB3_BASE, CLB_IN4, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB3_BASE, CLB_IN5, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB3_BASE, CLB_IN6, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB3_BASE, CLB_IN7, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
|
||||
CLB_configGlobalInputMux(CLB3_BASE, CLB_IN0, CLB_GLOBAL_IN_MUX_EPWM3A);
|
||||
CLB_configGlobalInputMux(CLB3_BASE, CLB_IN1, CLB_GLOBAL_IN_MUX_EPWM3A);
|
||||
CLB_configGlobalInputMux(CLB3_BASE, CLB_IN2, CLB_GLOBAL_IN_MUX_EPWM3B);
|
||||
CLB_configGlobalInputMux(CLB3_BASE, CLB_IN3, CLB_GLOBAL_IN_MUX_EPWM3B);
|
||||
CLB_configGlobalInputMux(CLB3_BASE, CLB_IN4, CLB_GLOBAL_IN_MUX_EPWM3_CTRDIR);
|
||||
CLB_configGlobalInputMux(CLB3_BASE, CLB_IN5, CLB_GLOBAL_IN_MUX_EPWM3_CTRDIR);
|
||||
CLB_configGlobalInputMux(CLB3_BASE, CLB_IN6, CLB_GLOBAL_IN_MUX_EPWM3_CTRDIR);
|
||||
CLB_configGlobalInputMux(CLB3_BASE, CLB_IN7, CLB_GLOBAL_IN_MUX_EPWM3_CTRDIR);
|
||||
|
||||
CLB_configGPInputMux(CLB3_BASE, CLB_IN0, CLB_GP_IN_MUX_EXTERNAL);
|
||||
CLB_configGPInputMux(CLB3_BASE, CLB_IN1, CLB_GP_IN_MUX_EXTERNAL);
|
||||
CLB_configGPInputMux(CLB3_BASE, CLB_IN2, CLB_GP_IN_MUX_EXTERNAL);
|
||||
CLB_configGPInputMux(CLB3_BASE, CLB_IN3, CLB_GP_IN_MUX_EXTERNAL);
|
||||
CLB_configGPInputMux(CLB3_BASE, CLB_IN4, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB3_BASE, CLB_IN5, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB3_BASE, CLB_IN6, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB3_BASE, CLB_IN7, CLB_GP_IN_MUX_GP_REG);
|
||||
|
||||
CLB_selectInputFilter(CLB3_BASE, CLB_IN0, CLB_FILTER_FALLING_EDGE);
|
||||
CLB_selectInputFilter(CLB3_BASE, CLB_IN2, CLB_FILTER_FALLING_EDGE);
|
||||
|
||||
// CLB tile 4 configuration
|
||||
CLB_configLocalInputMux(CLB4_BASE, CLB_IN0, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB4_BASE, CLB_IN1, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB4_BASE, CLB_IN2, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB4_BASE, CLB_IN3, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB4_BASE, CLB_IN4, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB4_BASE, CLB_IN5, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB4_BASE, CLB_IN6, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB4_BASE, CLB_IN7, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
|
||||
CLB_configGlobalInputMux(CLB4_BASE, CLB_IN0, CLB_GLOBAL_IN_MUX_EPWM4A);
|
||||
CLB_configGlobalInputMux(CLB4_BASE, CLB_IN1, CLB_GLOBAL_IN_MUX_EPWM4A);
|
||||
CLB_configGlobalInputMux(CLB4_BASE, CLB_IN2, CLB_GLOBAL_IN_MUX_EPWM4B);
|
||||
CLB_configGlobalInputMux(CLB4_BASE, CLB_IN3, CLB_GLOBAL_IN_MUX_EPWM4B);
|
||||
CLB_configGlobalInputMux(CLB4_BASE, CLB_IN4, CLB_GLOBAL_IN_MUX_EPWM4_CTRDIR);
|
||||
CLB_configGlobalInputMux(CLB4_BASE, CLB_IN5, CLB_GLOBAL_IN_MUX_EPWM4_CTRDIR);
|
||||
CLB_configGlobalInputMux(CLB4_BASE, CLB_IN6, CLB_GLOBAL_IN_MUX_EPWM4_CTRDIR);
|
||||
CLB_configGlobalInputMux(CLB4_BASE, CLB_IN7, CLB_GLOBAL_IN_MUX_EPWM4_CTRDIR);
|
||||
|
||||
CLB_configGPInputMux(CLB4_BASE, CLB_IN0, CLB_GP_IN_MUX_EXTERNAL);
|
||||
CLB_configGPInputMux(CLB4_BASE, CLB_IN1, CLB_GP_IN_MUX_EXTERNAL);
|
||||
CLB_configGPInputMux(CLB4_BASE, CLB_IN2, CLB_GP_IN_MUX_EXTERNAL);
|
||||
CLB_configGPInputMux(CLB4_BASE, CLB_IN3, CLB_GP_IN_MUX_EXTERNAL);
|
||||
CLB_configGPInputMux(CLB4_BASE, CLB_IN4, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB4_BASE, CLB_IN5, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB4_BASE, CLB_IN6, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB4_BASE, CLB_IN7, CLB_GP_IN_MUX_GP_REG);
|
||||
|
||||
CLB_selectInputFilter(CLB4_BASE, CLB_IN0, CLB_FILTER_FALLING_EDGE);
|
||||
CLB_selectInputFilter(CLB4_BASE, CLB_IN2, CLB_FILTER_FALLING_EDGE);
|
||||
|
||||
// start PWMs
|
||||
EPWM_setTimeBaseCounterMode(EPWM1_BASE, EPWM_COUNTER_MODE_UP);
|
||||
EPWM_setTimeBaseCounterMode(EPWM2_BASE, EPWM_COUNTER_MODE_UP);
|
||||
EPWM_setTimeBaseCounterMode(EPWM3_BASE, EPWM_COUNTER_MODE_UP);
|
||||
EPWM_setTimeBaseCounterMode(EPWM4_BASE, EPWM_COUNTER_MODE_UP);
|
||||
|
||||
Interrupt_enable(INT_EPWM1);
|
||||
EINT;
|
||||
|
||||
while(1)
|
||||
{
|
||||
asm(" NOP");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void initEPWM1()
|
||||
{
|
||||
EPWM_setTimeBasePeriod(EPWM1_BASE, EPWM1_TIMER_TBPRD);
|
||||
EPWM_setPhaseShift(EPWM1_BASE, 0U);
|
||||
EPWM_setTimeBaseCounter(EPWM1_BASE, 0U);
|
||||
|
||||
EPWM_setSyncOutPulseMode(EPWM1_BASE, EPWM_SYNC_OUT_PULSE_ON_COUNTER_ZERO);
|
||||
|
||||
EPWM_setCounterCompareValue(EPWM1_BASE, EPWM_COUNTER_COMPARE_A, EPWM1_CMPA);
|
||||
EPWM_setCounterCompareValue(EPWM1_BASE, EPWM_COUNTER_COMPARE_B, EPWM1_CMPB);
|
||||
|
||||
EPWM_disablePhaseShiftLoad(EPWM1_BASE);
|
||||
EPWM_setClockPrescaler(EPWM1_BASE, EPWM_CLOCK_DIVIDER_1, EPWM_HSCLOCK_DIVIDER_1);
|
||||
|
||||
EPWM_setCounterCompareShadowLoadMode(EPWM1_BASE, EPWM_COUNTER_COMPARE_A, EPWM_COMP_LOAD_ON_CNTR_ZERO);
|
||||
EPWM_setCounterCompareShadowLoadMode(EPWM1_BASE, EPWM_COUNTER_COMPARE_B, EPWM_COMP_LOAD_ON_CNTR_ZERO);
|
||||
|
||||
EPWM_setActionQualifierAction(EPWM1_BASE, EPWM_AQ_OUTPUT_A, EPWM_AQ_OUTPUT_HIGH, EPWM_AQ_OUTPUT_ON_TIMEBASE_ZERO);
|
||||
EPWM_setActionQualifierAction(EPWM1_BASE, EPWM_AQ_OUTPUT_A, EPWM_AQ_OUTPUT_LOW, EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPA);
|
||||
|
||||
EPWM_setActionQualifierAction(EPWM1_BASE, EPWM_AQ_OUTPUT_B, EPWM_AQ_OUTPUT_LOW, EPWM_AQ_OUTPUT_ON_TIMEBASE_ZERO);
|
||||
EPWM_setActionQualifierAction(EPWM1_BASE, EPWM_AQ_OUTPUT_B, EPWM_AQ_OUTPUT_HIGH, EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPB);
|
||||
|
||||
EPWM_setInterruptSource(EPWM1_BASE, EPWM_INT_TBCTR_ZERO);
|
||||
EPWM_enableInterrupt(EPWM1_BASE);
|
||||
EPWM_setInterruptEventCount(EPWM1_BASE, 3U);
|
||||
}
|
||||
|
||||
|
||||
void initEPWM2()
|
||||
{
|
||||
EPWM_setTimeBasePeriod(EPWM2_BASE, EPWM2_TIMER_TBPRD);
|
||||
EPWM_setPhaseShift(EPWM2_BASE, 0U);
|
||||
EPWM_setTimeBaseCounter(EPWM2_BASE, 0U);
|
||||
|
||||
EPWM_enablePhaseShiftLoad(EPWM2_BASE);
|
||||
EPWM_setPhaseShift(EPWM2_BASE, 0U);
|
||||
|
||||
EPWM_setCounterCompareValue(EPWM2_BASE, EPWM_COUNTER_COMPARE_A, EPWM2_CMPA);
|
||||
EPWM_setCounterCompareValue(EPWM2_BASE, EPWM_COUNTER_COMPARE_B, EPWM2_CMPB);
|
||||
|
||||
EPWM_setClockPrescaler(EPWM2_BASE, EPWM_CLOCK_DIVIDER_1, EPWM_HSCLOCK_DIVIDER_1);
|
||||
|
||||
EPWM_setCounterCompareShadowLoadMode(EPWM2_BASE, EPWM_COUNTER_COMPARE_A, EPWM_COMP_LOAD_ON_CNTR_ZERO);
|
||||
EPWM_setCounterCompareShadowLoadMode(EPWM2_BASE, EPWM_COUNTER_COMPARE_B, EPWM_COMP_LOAD_ON_CNTR_ZERO);
|
||||
|
||||
EPWM_setActionQualifierAction(EPWM2_BASE, EPWM_AQ_OUTPUT_A, EPWM_AQ_OUTPUT_HIGH, EPWM_AQ_OUTPUT_ON_TIMEBASE_ZERO);
|
||||
EPWM_setActionQualifierAction(EPWM2_BASE, EPWM_AQ_OUTPUT_A, EPWM_AQ_OUTPUT_LOW, EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPA);
|
||||
|
||||
EPWM_setActionQualifierAction(EPWM2_BASE, EPWM_AQ_OUTPUT_B, EPWM_AQ_OUTPUT_LOW, EPWM_AQ_OUTPUT_ON_TIMEBASE_ZERO);
|
||||
EPWM_setActionQualifierAction(EPWM2_BASE, EPWM_AQ_OUTPUT_B, EPWM_AQ_OUTPUT_HIGH, EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPB);
|
||||
}
|
||||
|
||||
|
||||
void initEPWM3()
|
||||
{
|
||||
EPWM_setTimeBasePeriod(EPWM3_BASE, EPWM3_TIMER_TBPRD);
|
||||
EPWM_setPhaseShift(EPWM3_BASE, 0U);
|
||||
EPWM_setTimeBaseCounter(EPWM3_BASE, 0U);
|
||||
|
||||
EPWM_enablePhaseShiftLoad(EPWM3_BASE);
|
||||
EPWM_setPhaseShift(EPWM3_BASE, 0U);
|
||||
|
||||
EPWM_setCounterCompareValue(EPWM3_BASE, EPWM_COUNTER_COMPARE_A, EPWM3_CMPA);
|
||||
EPWM_setCounterCompareValue(EPWM3_BASE, EPWM_COUNTER_COMPARE_B, EPWM3_CMPB);
|
||||
|
||||
EPWM_setClockPrescaler(EPWM3_BASE, EPWM_CLOCK_DIVIDER_1, EPWM_HSCLOCK_DIVIDER_1);
|
||||
|
||||
EPWM_setCounterCompareShadowLoadMode(EPWM3_BASE, EPWM_COUNTER_COMPARE_A, EPWM_COMP_LOAD_ON_CNTR_ZERO);
|
||||
EPWM_setCounterCompareShadowLoadMode(EPWM3_BASE, EPWM_COUNTER_COMPARE_B, EPWM_COMP_LOAD_ON_CNTR_ZERO);
|
||||
|
||||
EPWM_setActionQualifierAction(EPWM3_BASE, EPWM_AQ_OUTPUT_A, EPWM_AQ_OUTPUT_HIGH, EPWM_AQ_OUTPUT_ON_TIMEBASE_ZERO);
|
||||
EPWM_setActionQualifierAction(EPWM3_BASE, EPWM_AQ_OUTPUT_A, EPWM_AQ_OUTPUT_LOW, EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPA);
|
||||
|
||||
EPWM_setActionQualifierAction(EPWM3_BASE, EPWM_AQ_OUTPUT_B, EPWM_AQ_OUTPUT_LOW, EPWM_AQ_OUTPUT_ON_TIMEBASE_ZERO);
|
||||
EPWM_setActionQualifierAction(EPWM3_BASE, EPWM_AQ_OUTPUT_B, EPWM_AQ_OUTPUT_HIGH, EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPB);
|
||||
}
|
||||
|
||||
|
||||
void initEPWM4()
|
||||
{
|
||||
EPWM_setTimeBasePeriod(EPWM4_BASE, EPWM4_TIMER_TBPRD);
|
||||
EPWM_setPhaseShift(EPWM4_BASE, 0U);
|
||||
EPWM_setTimeBaseCounter(EPWM4_BASE, 0U);
|
||||
|
||||
EPWM_enablePhaseShiftLoad(EPWM4_BASE);
|
||||
EPWM_setPhaseShift(EPWM4_BASE, 0U);
|
||||
|
||||
EPWM_setCounterCompareValue(EPWM4_BASE, EPWM_COUNTER_COMPARE_A, EPWM4_CMPA);
|
||||
EPWM_setCounterCompareValue(EPWM4_BASE, EPWM_COUNTER_COMPARE_B, EPWM4_CMPB);
|
||||
|
||||
EPWM_setClockPrescaler(EPWM4_BASE, EPWM_CLOCK_DIVIDER_1, EPWM_HSCLOCK_DIVIDER_1);
|
||||
|
||||
EPWM_setCounterCompareShadowLoadMode(EPWM4_BASE, EPWM_COUNTER_COMPARE_A, EPWM_COMP_LOAD_ON_CNTR_ZERO);
|
||||
EPWM_setCounterCompareShadowLoadMode(EPWM4_BASE, EPWM_COUNTER_COMPARE_B, EPWM_COMP_LOAD_ON_CNTR_ZERO);
|
||||
|
||||
EPWM_setActionQualifierAction(EPWM4_BASE, EPWM_AQ_OUTPUT_A, EPWM_AQ_OUTPUT_HIGH, EPWM_AQ_OUTPUT_ON_TIMEBASE_ZERO);
|
||||
EPWM_setActionQualifierAction(EPWM4_BASE, EPWM_AQ_OUTPUT_A, EPWM_AQ_OUTPUT_LOW, EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPA);
|
||||
|
||||
EPWM_setActionQualifierAction(EPWM4_BASE, EPWM_AQ_OUTPUT_B, EPWM_AQ_OUTPUT_LOW, EPWM_AQ_OUTPUT_ON_TIMEBASE_ZERO);
|
||||
EPWM_setActionQualifierAction(EPWM4_BASE, EPWM_AQ_OUTPUT_B, EPWM_AQ_OUTPUT_HIGH, EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPB);
|
||||
}
|
||||
|
||||
|
||||
__interrupt void epwm1ISR(void)
|
||||
{
|
||||
EPWM_clearEventTriggerInterruptFlag(EPWM1_BASE);
|
||||
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP3);
|
||||
|
||||
if (mode == 0)
|
||||
{
|
||||
CLB_setOutputMask(CLB1_BASE, 0x5, false);
|
||||
CLB_setOutputMask(CLB2_BASE, 0x5, false);
|
||||
CLB_setOutputMask(CLB3_BASE, 0x5, false);
|
||||
CLB_setOutputMask(CLB4_BASE, 0x5, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
CLB_setOutputMask(CLB1_BASE, 0x5, true);
|
||||
CLB_setOutputMask(CLB2_BASE, 0x5, true);
|
||||
CLB_setOutputMask(CLB3_BASE, 0x5, true);
|
||||
CLB_setOutputMask(CLB4_BASE, 0x5, true);
|
||||
}
|
||||
asm(" NOP");
|
||||
}
|
||||
|
||||
/* end of file */
|
||||
@@ -0,0 +1,476 @@
|
||||
|
||||
var TILE = scripting.addModule("/utilities/clb_tool/clb_syscfg/source/TILE");
|
||||
var TILE1 = TILE.addInstance();
|
||||
var TILE2 = TILE.addInstance();
|
||||
var TILE3 = TILE.addInstance();
|
||||
var TILE4 = TILE.addInstance();
|
||||
// sim_duration - Duration of the simulation (in Nano Seconds)
|
||||
TILE.sim_duration = 500000;
|
||||
// Name
|
||||
TILE1.$name = "TILE1";
|
||||
// Name
|
||||
TILE1.BOUNDARY.$name = "BOUNDARY0";
|
||||
// in0
|
||||
TILE1.BOUNDARY.in0 = "squareWave";
|
||||
// in1
|
||||
TILE1.BOUNDARY.in1 = "squareWave";
|
||||
// in2
|
||||
TILE1.BOUNDARY.in2 = "squareWave";
|
||||
// in3
|
||||
TILE1.BOUNDARY.in3 = "squareWave";
|
||||
// in_edge2 - Edge detection on the inputs, generates 1 cycle pulse on chosen edges - for simulation purposes only
|
||||
TILE1.BOUNDARY.in_edge2 = "falling edge";
|
||||
// in_edge0 - Edge detection on the inputs, generates 1 cycle pulse on chosen edges - for simulation purposes only
|
||||
TILE1.BOUNDARY.in_edge0 = "falling edge";
|
||||
// in_period0 - Period of the square wave
|
||||
TILE1.BOUNDARY.in_period0 = 1000;
|
||||
// in_duty0 - Duty or ON time of the square wave
|
||||
TILE1.BOUNDARY.in_duty0 = 500;
|
||||
// in_period1 - Period of the square wave
|
||||
TILE1.BOUNDARY.in_period1 = 1000;
|
||||
// in_duty1 - Duty or ON time of the square wave
|
||||
TILE1.BOUNDARY.in_duty1 = 500;
|
||||
// in_period2 - Period of the square wave
|
||||
TILE1.BOUNDARY.in_period2 = 500;
|
||||
// in_duty2 - Duty or ON time of the square wave
|
||||
TILE1.BOUNDARY.in_duty2 = 250;
|
||||
// in_period3 - Period of the square wave
|
||||
TILE1.BOUNDARY.in_period3 = 500;
|
||||
// in_duty3 - Duty or ON time of the square wave
|
||||
TILE1.BOUNDARY.in_duty3 = 250;
|
||||
// Name
|
||||
TILE1.LUT_0.$name = "LUT_0";
|
||||
// Name
|
||||
TILE1.LUT_1.$name = "LUT_1";
|
||||
// i0 - Input 0.
|
||||
TILE1.LUT_1.i0 = "FSM_0.S0";
|
||||
// eqn - Boolean equation on the variables i3,i2,i1,i0 for the LUT output.
|
||||
TILE1.LUT_1.eqn = "~(i0 | i1)";
|
||||
// i1 - Input 1.
|
||||
TILE1.LUT_1.i1 = "BOUNDARY.in0";
|
||||
// Name
|
||||
TILE1.LUT_2.$name = "LUT_2";
|
||||
// i0 - Input 0.
|
||||
TILE1.LUT_2.i0 = "FSM_1.S0";
|
||||
// eqn - Boolean equation on the variables i3,i2,i1,i0 for the LUT output.
|
||||
TILE1.LUT_2.eqn = "~(i0 | i1)";
|
||||
// i1 - Input 1.
|
||||
TILE1.LUT_2.i1 = "BOUNDARY.in2";
|
||||
// Name
|
||||
TILE1.FSM_0.$name = "FSM_0";
|
||||
// e1 - External Input 1.
|
||||
TILE1.FSM_0.e1 = "COUNTER_0.count_match1";
|
||||
// eqn_out - Boolean equation on the variables e1,e0,s1,s0 for the LUT output.
|
||||
TILE1.FSM_0.eqn_out = "~s0";
|
||||
// e0 - External Input 0.
|
||||
TILE1.FSM_0.e0 = "BOUNDARY.in0";
|
||||
// eqn_s0 - Boolean equation on the variables e1,e0,s1,s0 for the S0 output.
|
||||
TILE1.FSM_0.eqn_s0 = "(~s0 & e0) | (s0 & (~e1)) ";
|
||||
// Name
|
||||
TILE1.FSM_1.$name = "FSM_1";
|
||||
// e1 - External Input 1.
|
||||
TILE1.FSM_1.e1 = "COUNTER_1.count_match1";
|
||||
// eqn_s0 - Boolean equation on the variables e1,e0,s1,s0 for the S0 output.
|
||||
TILE1.FSM_1.eqn_s0 = "(~s0 & e0) | (s0 & (~e1)) ";
|
||||
// eqn_out - Boolean equation on the variables e1,e0,s1,s0 for the LUT output.
|
||||
TILE1.FSM_1.eqn_out = "~s0";
|
||||
// e0 - External Input 0.
|
||||
TILE1.FSM_1.e0 = "BOUNDARY.in2";
|
||||
// Name
|
||||
TILE1.FSM_2.$name = "FSM_2";
|
||||
// Name
|
||||
TILE1.COUNTER_0.$name = "COUNTER_0";
|
||||
// reset - Reset the counter to 0 on next clock cycle (triggers low to high)
|
||||
TILE1.COUNTER_0.reset = "FSM_0.OUT";
|
||||
// mode1 - Controls counting direction. High enables count up. Low enables count down.
|
||||
TILE1.COUNTER_0.mode1 = "1";
|
||||
// match1_val - Sets the value of the Match reference 1 register.
|
||||
TILE1.COUNTER_0.match1_val = "10";
|
||||
// mode0 - Enables Counting when high
|
||||
TILE1.COUNTER_0.mode0 = "FSM_0.S0";
|
||||
// Name
|
||||
TILE1.COUNTER_1.$name = "COUNTER_1";
|
||||
// reset - Reset the counter to 0 on next clock cycle (triggers low to high)
|
||||
TILE1.COUNTER_1.reset = "FSM_1.OUT";
|
||||
// mode0 - Enables Counting when high
|
||||
TILE1.COUNTER_1.mode0 = "FSM_1.S0";
|
||||
// match1_val - Sets the value of the Match reference 1 register.
|
||||
TILE1.COUNTER_1.match1_val = "10";
|
||||
// mode1 - Controls counting direction. High enables count up. Low enables count down.
|
||||
TILE1.COUNTER_1.mode1 = "1";
|
||||
// Name
|
||||
TILE1.COUNTER_2.$name = "COUNTER_2";
|
||||
// Name
|
||||
TILE1.OUTLUT_0.$name = "OUTLUT_0";
|
||||
// i1 - Input 1.
|
||||
TILE1.OUTLUT_0.i1 = "BOUNDARY.in1";
|
||||
// i0 - Input 0.
|
||||
TILE1.OUTLUT_0.i0 = "LUT_2.OUT";
|
||||
// i2 - Input 2.
|
||||
TILE1.OUTLUT_0.i2 = "BOUNDARY.in3";
|
||||
// eqn - Boolean equation on the variables i2,i1,i0 for the OUTLUT output.
|
||||
TILE1.OUTLUT_0.eqn = "i0 & (~(i1 & i2)) & i1";
|
||||
// Name
|
||||
TILE1.OUTLUT_1.$name = "OUTLUT_1";
|
||||
// Name
|
||||
TILE1.OUTLUT_2.$name = "OUTLUT_2";
|
||||
// i1 - Input 1.
|
||||
TILE1.OUTLUT_2.i1 = "BOUNDARY.in3";
|
||||
// i0 - Input 0.
|
||||
TILE1.OUTLUT_2.i0 = "LUT_1.OUT";
|
||||
// i2 - Input 2.
|
||||
TILE1.OUTLUT_2.i2 = "BOUNDARY.in1";
|
||||
// eqn - Boolean equation on the variables i2,i1,i0 for the OUTLUT output.
|
||||
TILE1.OUTLUT_2.eqn = "i0 & (~(i1 & i2)) & i1";
|
||||
// Name
|
||||
TILE1.OUTLUT_3.$name = "OUTLUT_3";
|
||||
// eqn - Boolean equation on the variables i2,i1,i0 for the OUTLUT output.
|
||||
TILE1.OUTLUT_3.eqn = "0";
|
||||
// Name
|
||||
TILE1.OUTLUT_4.$name = "OUTLUT_4";
|
||||
// Name
|
||||
TILE1.OUTLUT_5.$name = "OUTLUT_5";
|
||||
// Name
|
||||
TILE1.OUTLUT_6.$name = "OUTLUT_6";
|
||||
// Name
|
||||
TILE1.OUTLUT_7.$name = "OUTLUT_7";
|
||||
// Name
|
||||
TILE1.HLC.$name = "HLC_0";
|
||||
// Name
|
||||
TILE1.HLC.program0.$name = "HLCP_0";
|
||||
// Name
|
||||
TILE1.HLC.program1.$name = "HLCP_1";
|
||||
// Name
|
||||
TILE1.HLC.program2.$name = "HLCP_2";
|
||||
// instruct0
|
||||
TILE1.HLC.program2.instruct0 = "mov r0,c0";
|
||||
// Name
|
||||
TILE1.HLC.program3.$name = "HLCP_3";
|
||||
var clb_run_dynamic_template_clb_h = scripting.addModule("/utilities/clb_tool/clb_syscfg/source/clb_run_dynamic_template_clb_h.js");
|
||||
var clb_run_dynamic_template_clb_c = scripting.addModule("/utilities/clb_tool/clb_syscfg/source/clb_run_dynamic_template_clb_c.js");
|
||||
var clb_run_dynamic_template_clb_sim = scripting.addModule("/utilities/clb_tool/clb_syscfg/source/clb_run_dynamic_template_clb_sim.js");
|
||||
var clb_run_dynamic_template_clb_dot = scripting.addModule("/utilities/clb_tool/clb_syscfg/source/clb_run_dynamic_template_clb_dot.js");
|
||||
// Name
|
||||
TILE2.$name = "TILE2";
|
||||
// Name
|
||||
TILE2.BOUNDARY.$name = "BOUNDARY1";
|
||||
// Name
|
||||
TILE2.LUT_0.$name = "LUT_3";
|
||||
// Name
|
||||
TILE2.LUT_1.$name = "LUT_4";
|
||||
// eqn - Boolean equation on the variables i3,i2,i1,i0 for the LUT output.
|
||||
TILE2.LUT_1.eqn = "~(i0 | i1)";
|
||||
// i0 - Input 0.
|
||||
TILE2.LUT_1.i0 = "FSM_0.S0";
|
||||
// i1 - Input 1.
|
||||
TILE2.LUT_1.i1 = "BOUNDARY.in0";
|
||||
// Name
|
||||
TILE2.LUT_2.$name = "LUT_5";
|
||||
// eqn - Boolean equation on the variables i3,i2,i1,i0 for the LUT output.
|
||||
TILE2.LUT_2.eqn = "~(i0 | i1)";
|
||||
// i1 - Input 1.
|
||||
TILE2.LUT_2.i1 = "BOUNDARY.in2";
|
||||
// i0 - Input 0.
|
||||
TILE2.LUT_2.i0 = "FSM_1.S0";
|
||||
// Name
|
||||
TILE2.FSM_0.$name = "FSM_3";
|
||||
// eqn_out - Boolean equation on the variables e1,e0,s1,s0 for the LUT output.
|
||||
TILE2.FSM_0.eqn_out = "~s0";
|
||||
// e0 - External Input 0.
|
||||
TILE2.FSM_0.e0 = "BOUNDARY.in0";
|
||||
// e1 - External Input 1.
|
||||
TILE2.FSM_0.e1 = "COUNTER_0.count_match1";
|
||||
// eqn_s0 - Boolean equation on the variables e1,e0,s1,s0 for the S0 output.
|
||||
TILE2.FSM_0.eqn_s0 = "(~s0 & e0) | (s0 & (~e1)) ";
|
||||
// Name
|
||||
TILE2.FSM_1.$name = "FSM_4";
|
||||
// eqn_s0 - Boolean equation on the variables e1,e0,s1,s0 for the S0 output.
|
||||
TILE2.FSM_1.eqn_s0 = "(~s0 & e0) | (s0 & (~e1)) ";
|
||||
// eqn_out - Boolean equation on the variables e1,e0,s1,s0 for the LUT output.
|
||||
TILE2.FSM_1.eqn_out = "~s0";
|
||||
// e0 - External Input 0.
|
||||
TILE2.FSM_1.e0 = "BOUNDARY.in2";
|
||||
// e1 - External Input 1.
|
||||
TILE2.FSM_1.e1 = "COUNTER_1.count_match1";
|
||||
// Name
|
||||
TILE2.FSM_2.$name = "FSM_5";
|
||||
// Name
|
||||
TILE2.COUNTER_0.$name = "COUNTER_3";
|
||||
// reset - Reset the counter to 0 on next clock cycle (triggers low to high)
|
||||
TILE2.COUNTER_0.reset = "FSM_0.OUT";
|
||||
// mode0 - Enables Counting when high
|
||||
TILE2.COUNTER_0.mode0 = "FSM_0.S0";
|
||||
// mode1 - Controls counting direction. High enables count up. Low enables count down.
|
||||
TILE2.COUNTER_0.mode1 = "1";
|
||||
// match1_val - Sets the value of the Match reference 1 register.
|
||||
TILE2.COUNTER_0.match1_val = "10";
|
||||
// Name
|
||||
TILE2.COUNTER_1.$name = "COUNTER_4";
|
||||
// reset - Reset the counter to 0 on next clock cycle (triggers low to high)
|
||||
TILE2.COUNTER_1.reset = "FSM_1.OUT";
|
||||
// mode0 - Enables Counting when high
|
||||
TILE2.COUNTER_1.mode0 = "FSM_1.S0";
|
||||
// mode1 - Controls counting direction. High enables count up. Low enables count down.
|
||||
TILE2.COUNTER_1.mode1 = "1";
|
||||
// match1_val - Sets the value of the Match reference 1 register.
|
||||
TILE2.COUNTER_1.match1_val = "10";
|
||||
// Name
|
||||
TILE2.COUNTER_2.$name = "COUNTER_5";
|
||||
// Name
|
||||
TILE2.OUTLUT_0.$name = "OUTLUT_8";
|
||||
// eqn - Boolean equation on the variables i2,i1,i0 for the OUTLUT output.
|
||||
TILE2.OUTLUT_0.eqn = "i0 & (~(i1 & i2)) & i1";
|
||||
// i0 - Input 0.
|
||||
TILE2.OUTLUT_0.i0 = "LUT_2.OUT";
|
||||
// i1 - Input 1.
|
||||
TILE2.OUTLUT_0.i1 = "BOUNDARY.in1";
|
||||
// i2 - Input 2.
|
||||
TILE2.OUTLUT_0.i2 = "BOUNDARY.in3";
|
||||
// Name
|
||||
TILE2.OUTLUT_1.$name = "OUTLUT_9";
|
||||
// Name
|
||||
TILE2.OUTLUT_2.$name = "OUTLUT_10";
|
||||
// eqn - Boolean equation on the variables i2,i1,i0 for the OUTLUT output.
|
||||
TILE2.OUTLUT_2.eqn = "i0 & (~(i1 & i2)) & i1";
|
||||
// i0 - Input 0.
|
||||
TILE2.OUTLUT_2.i0 = "LUT_1.OUT";
|
||||
// i1 - Input 1.
|
||||
TILE2.OUTLUT_2.i1 = "BOUNDARY.in3";
|
||||
// i2 - Input 2.
|
||||
TILE2.OUTLUT_2.i2 = "BOUNDARY.in1";
|
||||
// Name
|
||||
TILE2.OUTLUT_3.$name = "OUTLUT_11";
|
||||
// Name
|
||||
TILE2.OUTLUT_4.$name = "OUTLUT_12";
|
||||
// Name
|
||||
TILE2.OUTLUT_5.$name = "OUTLUT_13";
|
||||
// Name
|
||||
TILE2.OUTLUT_6.$name = "OUTLUT_14";
|
||||
// Name
|
||||
TILE2.OUTLUT_7.$name = "OUTLUT_15";
|
||||
// Name
|
||||
TILE2.HLC.$name = "HLC_1";
|
||||
// Name
|
||||
TILE2.HLC.program0.$name = "HLCP_4";
|
||||
// Name
|
||||
TILE2.HLC.program1.$name = "HLCP_5";
|
||||
// Name
|
||||
TILE2.HLC.program2.$name = "HLCP_6";
|
||||
// Name
|
||||
TILE2.HLC.program3.$name = "HLCP_7";
|
||||
// Name
|
||||
TILE3.$name = "TILE3";
|
||||
// Name
|
||||
TILE3.BOUNDARY.$name = "BOUNDARY2";
|
||||
// Name
|
||||
TILE3.LUT_0.$name = "LUT_6";
|
||||
// Name
|
||||
TILE3.LUT_1.$name = "LUT_7";
|
||||
// eqn - Boolean equation on the variables i3,i2,i1,i0 for the LUT output.
|
||||
TILE3.LUT_1.eqn = "~(i0 | i1)";
|
||||
// i0 - Input 0.
|
||||
TILE3.LUT_1.i0 = "FSM_0.S0";
|
||||
// i1 - Input 1.
|
||||
TILE3.LUT_1.i1 = "BOUNDARY.in0";
|
||||
// Name
|
||||
TILE3.LUT_2.$name = "LUT_8";
|
||||
// eqn - Boolean equation on the variables i3,i2,i1,i0 for the LUT output.
|
||||
TILE3.LUT_2.eqn = "~(i0 | i1)";
|
||||
// i0 - Input 0.
|
||||
TILE3.LUT_2.i0 = "FSM_1.S0";
|
||||
// i1 - Input 1.
|
||||
TILE3.LUT_2.i1 = "BOUNDARY.in2";
|
||||
// Name
|
||||
TILE3.FSM_0.$name = "FSM_6";
|
||||
// eqn_s0 - Boolean equation on the variables e1,e0,s1,s0 for the S0 output.
|
||||
TILE3.FSM_0.eqn_s0 = "(~s0 & e0) | (s0 & (~e1)) ";
|
||||
// eqn_out - Boolean equation on the variables e1,e0,s1,s0 for the LUT output.
|
||||
TILE3.FSM_0.eqn_out = "~s0";
|
||||
// e0 - External Input 0.
|
||||
TILE3.FSM_0.e0 = "BOUNDARY.in0";
|
||||
// e1 - External Input 1.
|
||||
TILE3.FSM_0.e1 = "COUNTER_0.count_match1";
|
||||
// Name
|
||||
TILE3.FSM_1.$name = "FSM_7";
|
||||
// eqn_out - Boolean equation on the variables e1,e0,s1,s0 for the LUT output.
|
||||
TILE3.FSM_1.eqn_out = "~s0";
|
||||
// eqn_s0 - Boolean equation on the variables e1,e0,s1,s0 for the S0 output.
|
||||
TILE3.FSM_1.eqn_s0 = "(~s0 & e0) | (s0 & (~e1)) ";
|
||||
// e0 - External Input 0.
|
||||
TILE3.FSM_1.e0 = "BOUNDARY.in2";
|
||||
// e1 - External Input 1.
|
||||
TILE3.FSM_1.e1 = "COUNTER_1.count_match1";
|
||||
// Name
|
||||
TILE3.FSM_2.$name = "FSM_8";
|
||||
// Name
|
||||
TILE3.COUNTER_0.$name = "COUNTER_6";
|
||||
// reset - Reset the counter to 0 on next clock cycle (triggers low to high)
|
||||
TILE3.COUNTER_0.reset = "FSM_0.OUT";
|
||||
// mode0 - Enables Counting when high
|
||||
TILE3.COUNTER_0.mode0 = "FSM_0.S0";
|
||||
// mode1 - Controls counting direction. High enables count up. Low enables count down.
|
||||
TILE3.COUNTER_0.mode1 = "1";
|
||||
// match1_val - Sets the value of the Match reference 1 register.
|
||||
TILE3.COUNTER_0.match1_val = "10";
|
||||
// Name
|
||||
TILE3.COUNTER_1.$name = "COUNTER_7";
|
||||
// reset - Reset the counter to 0 on next clock cycle (triggers low to high)
|
||||
TILE3.COUNTER_1.reset = "FSM_1.OUT";
|
||||
// mode1 - Controls counting direction. High enables count up. Low enables count down.
|
||||
TILE3.COUNTER_1.mode1 = "1";
|
||||
// match1_val - Sets the value of the Match reference 1 register.
|
||||
TILE3.COUNTER_1.match1_val = "10";
|
||||
// mode0 - Enables Counting when high
|
||||
TILE3.COUNTER_1.mode0 = "FSM_1.S0";
|
||||
// Name
|
||||
TILE3.COUNTER_2.$name = "COUNTER_8";
|
||||
// Name
|
||||
TILE3.OUTLUT_0.$name = "OUTLUT_16";
|
||||
// eqn - Boolean equation on the variables i2,i1,i0 for the OUTLUT output.
|
||||
TILE3.OUTLUT_0.eqn = "i0 & (~(i1 & i2)) & i1";
|
||||
// i0 - Input 0.
|
||||
TILE3.OUTLUT_0.i0 = "LUT_2.OUT";
|
||||
// i1 - Input 1.
|
||||
TILE3.OUTLUT_0.i1 = "BOUNDARY.in1";
|
||||
// i2 - Input 2.
|
||||
TILE3.OUTLUT_0.i2 = "BOUNDARY.in3";
|
||||
// Name
|
||||
TILE3.OUTLUT_1.$name = "OUTLUT_17";
|
||||
// Name
|
||||
TILE3.OUTLUT_2.$name = "OUTLUT_18";
|
||||
// eqn - Boolean equation on the variables i2,i1,i0 for the OUTLUT output.
|
||||
TILE3.OUTLUT_2.eqn = "i0 & (~(i1 & i2)) & i1";
|
||||
// i0 - Input 0.
|
||||
TILE3.OUTLUT_2.i0 = "LUT_1.OUT";
|
||||
// i1 - Input 1.
|
||||
TILE3.OUTLUT_2.i1 = "BOUNDARY.in3";
|
||||
// i2 - Input 2.
|
||||
TILE3.OUTLUT_2.i2 = "BOUNDARY.in1";
|
||||
// Name
|
||||
TILE3.OUTLUT_3.$name = "OUTLUT_19";
|
||||
// Name
|
||||
TILE3.OUTLUT_4.$name = "OUTLUT_20";
|
||||
// Name
|
||||
TILE3.OUTLUT_5.$name = "OUTLUT_21";
|
||||
// Name
|
||||
TILE3.OUTLUT_6.$name = "OUTLUT_22";
|
||||
// Name
|
||||
TILE3.OUTLUT_7.$name = "OUTLUT_23";
|
||||
// Name
|
||||
TILE3.HLC.$name = "HLC_2";
|
||||
// Name
|
||||
TILE3.HLC.program0.$name = "HLCP_8";
|
||||
// Name
|
||||
TILE3.HLC.program1.$name = "HLCP_9";
|
||||
// Name
|
||||
TILE3.HLC.program2.$name = "HLCP_10";
|
||||
// Name
|
||||
TILE3.HLC.program3.$name = "HLCP_11";
|
||||
// Name
|
||||
TILE4.$name = "TILE4";
|
||||
// Name
|
||||
TILE4.BOUNDARY.$name = "BOUNDARY3";
|
||||
// Name
|
||||
TILE4.LUT_0.$name = "LUT_9";
|
||||
// Name
|
||||
TILE4.LUT_1.$name = "LUT_10";
|
||||
// eqn - Boolean equation on the variables i3,i2,i1,i0 for the LUT output.
|
||||
TILE4.LUT_1.eqn = "~(i0 | i1)";
|
||||
// i0 - Input 0.
|
||||
TILE4.LUT_1.i0 = "FSM_0.S0";
|
||||
// i1 - Input 1.
|
||||
TILE4.LUT_1.i1 = "BOUNDARY.in0";
|
||||
// Name
|
||||
TILE4.LUT_2.$name = "LUT_11";
|
||||
// eqn - Boolean equation on the variables i3,i2,i1,i0 for the LUT output.
|
||||
TILE4.LUT_2.eqn = "~(i0 | i1)";
|
||||
// i0 - Input 0.
|
||||
TILE4.LUT_2.i0 = "FSM_1.S0";
|
||||
// i1 - Input 1.
|
||||
TILE4.LUT_2.i1 = "BOUNDARY.in2";
|
||||
// Name
|
||||
TILE4.FSM_0.$name = "FSM_9";
|
||||
// eqn_out - Boolean equation on the variables e1,e0,s1,s0 for the LUT output.
|
||||
TILE4.FSM_0.eqn_out = "~s0";
|
||||
// eqn_s0 - Boolean equation on the variables e1,e0,s1,s0 for the S0 output.
|
||||
TILE4.FSM_0.eqn_s0 = "(~s0 & e0) | (s0 & (~e1)) ";
|
||||
// e0 - External Input 0.
|
||||
TILE4.FSM_0.e0 = "BOUNDARY.in0";
|
||||
// e1 - External Input 1.
|
||||
TILE4.FSM_0.e1 = "COUNTER_0.count_match1";
|
||||
// Name
|
||||
TILE4.FSM_1.$name = "FSM_10";
|
||||
// eqn_out - Boolean equation on the variables e1,e0,s1,s0 for the LUT output.
|
||||
TILE4.FSM_1.eqn_out = "~s0";
|
||||
// eqn_s0 - Boolean equation on the variables e1,e0,s1,s0 for the S0 output.
|
||||
TILE4.FSM_1.eqn_s0 = "(~s0 & e0) | (s0 & (~e1)) ";
|
||||
// e0 - External Input 0.
|
||||
TILE4.FSM_1.e0 = "BOUNDARY.in2";
|
||||
// e1 - External Input 1.
|
||||
TILE4.FSM_1.e1 = "COUNTER_1.count_match1";
|
||||
// Name
|
||||
TILE4.FSM_2.$name = "FSM_11";
|
||||
// Name
|
||||
TILE4.COUNTER_0.$name = "COUNTER_9";
|
||||
// reset - Reset the counter to 0 on next clock cycle (triggers low to high)
|
||||
TILE4.COUNTER_0.reset = "FSM_0.OUT";
|
||||
// mode0 - Enables Counting when high
|
||||
TILE4.COUNTER_0.mode0 = "FSM_0.S0";
|
||||
// mode1 - Controls counting direction. High enables count up. Low enables count down.
|
||||
TILE4.COUNTER_0.mode1 = "1";
|
||||
// match1_val - Sets the value of the Match reference 1 register.
|
||||
TILE4.COUNTER_0.match1_val = "10";
|
||||
// Name
|
||||
TILE4.COUNTER_1.$name = "COUNTER_10";
|
||||
// reset - Reset the counter to 0 on next clock cycle (triggers low to high)
|
||||
TILE4.COUNTER_1.reset = "FSM_1.OUT";
|
||||
// mode0 - Enables Counting when high
|
||||
TILE4.COUNTER_1.mode0 = "FSM_1.S0";
|
||||
// mode1 - Controls counting direction. High enables count up. Low enables count down.
|
||||
TILE4.COUNTER_1.mode1 = "1";
|
||||
// match1_val - Sets the value of the Match reference 1 register.
|
||||
TILE4.COUNTER_1.match1_val = "10";
|
||||
// Name
|
||||
TILE4.COUNTER_2.$name = "COUNTER_11";
|
||||
// Name
|
||||
TILE4.OUTLUT_0.$name = "OUTLUT_24";
|
||||
// eqn - Boolean equation on the variables i2,i1,i0 for the OUTLUT output.
|
||||
TILE4.OUTLUT_0.eqn = "i0 & (~(i1 & i2)) & i1";
|
||||
// i0 - Input 0.
|
||||
TILE4.OUTLUT_0.i0 = "LUT_2.OUT";
|
||||
// i1 - Input 1.
|
||||
TILE4.OUTLUT_0.i1 = "BOUNDARY.in1";
|
||||
// i2 - Input 2.
|
||||
TILE4.OUTLUT_0.i2 = "BOUNDARY.in3";
|
||||
// Name
|
||||
TILE4.OUTLUT_1.$name = "OUTLUT_25";
|
||||
// Name
|
||||
TILE4.OUTLUT_2.$name = "OUTLUT_26";
|
||||
// eqn - Boolean equation on the variables i2,i1,i0 for the OUTLUT output.
|
||||
TILE4.OUTLUT_2.eqn = "i0 & (~(i1 & i2)) & i1";
|
||||
// i0 - Input 0.
|
||||
TILE4.OUTLUT_2.i0 = "LUT_1.OUT";
|
||||
// i1 - Input 1.
|
||||
TILE4.OUTLUT_2.i1 = "BOUNDARY.in3";
|
||||
// i2 - Input 2.
|
||||
TILE4.OUTLUT_2.i2 = "BOUNDARY.in1";
|
||||
// Name
|
||||
TILE4.OUTLUT_3.$name = "OUTLUT_27";
|
||||
// Name
|
||||
TILE4.OUTLUT_4.$name = "OUTLUT_28";
|
||||
// Name
|
||||
TILE4.OUTLUT_5.$name = "OUTLUT_29";
|
||||
// Name
|
||||
TILE4.OUTLUT_6.$name = "OUTLUT_30";
|
||||
// Name
|
||||
TILE4.OUTLUT_7.$name = "OUTLUT_31";
|
||||
// Name
|
||||
TILE4.HLC.$name = "HLC_3";
|
||||
// Name
|
||||
TILE4.HLC.program0.$name = "HLCP_12";
|
||||
// Name
|
||||
TILE4.HLC.program1.$name = "HLCP_13";
|
||||
// Name
|
||||
TILE4.HLC.program2.$name = "HLCP_14";
|
||||
// Name
|
||||
TILE4.HLC.program3.$name = "HLCP_15";
|
||||
@@ -0,0 +1,581 @@
|
||||
//#############################################################################
|
||||
//
|
||||
// FILE: clb_ex5_event_window.c
|
||||
//
|
||||
// TITLE: CLB Event Window.
|
||||
//
|
||||
//! \addtogroup driver_example_list
|
||||
//! <h1>CLB Event Window</h1>
|
||||
//!
|
||||
//! For the detailed description of this example, please refer to:
|
||||
//! C2000Ware_PATH\utilities\clb_tool\clb_syscfg\doc\CLB Tool Users Guide.pdf
|
||||
//!
|
||||
//
|
||||
//
|
||||
//#############################################################################
|
||||
//
|
||||
//
|
||||
// $Copyright:
|
||||
// Copyright (C) 2013-2024 Texas Instruments Incorporated - http://www.ti.com/
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions
|
||||
// are met:
|
||||
//
|
||||
// Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
//
|
||||
// Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
//
|
||||
// Neither the name of Texas Instruments Incorporated nor the names of
|
||||
// its contributors may be used to endorse or promote products derived
|
||||
// from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
// $
|
||||
//#############################################################################
|
||||
|
||||
|
||||
#include "driverlib.h"
|
||||
#include "device.h"
|
||||
#include "clb_config.h"
|
||||
#include "clb.h"
|
||||
|
||||
#define EPWM1_TIMER_TBPRD 20000U
|
||||
#define EPWM1_CMPA 1933U
|
||||
#define EPWM1_CMPB 1933U
|
||||
|
||||
#define EPWM2_TIMER_TBPRD 25000U
|
||||
#define EPWM2_CMPA 1933U
|
||||
#define EPWM2_CMPB 1933U
|
||||
|
||||
#define EPWM3_TIMER_TBPRD 30000U
|
||||
#define EPWM3_CMPA 1933U
|
||||
#define EPWM3_CMPB 1933U
|
||||
|
||||
#define EPWM4_TIMER_TBPRD 35000U
|
||||
#define EPWM4_CMPA 1933U
|
||||
#define EPWM4_CMPB 1933U
|
||||
|
||||
// default interrupt payloads
|
||||
#define ISR1_PAYLOAD 45U
|
||||
#define ISR2_PAYLOAD 45U
|
||||
#define ISR3_PAYLOAD 45U
|
||||
#define ISR4_PAYLOAD 45U
|
||||
|
||||
void initEPWM1(void);
|
||||
void initEPWM2(void);
|
||||
void initEPWM3(void);
|
||||
void initEPWM4(void);
|
||||
|
||||
__interrupt void epwm1ISR(void);
|
||||
__interrupt void epwm2ISR(void);
|
||||
__interrupt void epwm3ISR(void);
|
||||
__interrupt void epwm4ISR(void);
|
||||
__interrupt void clb1ISR(void);
|
||||
__interrupt void clb2ISR(void);
|
||||
__interrupt void clb3ISR(void);
|
||||
__interrupt void clb4ISR(void);
|
||||
|
||||
// GPREG settings:
|
||||
// bit 2 = enable
|
||||
// bit 1 = ISR end flag
|
||||
// bit 0 not used
|
||||
uint32_t gpreg1 = 4;
|
||||
uint32_t gpreg2 = 4;
|
||||
uint32_t gpreg3 = 4;
|
||||
uint32_t gpreg4 = 4;
|
||||
|
||||
uint32_t payload_1 = ISR1_PAYLOAD;
|
||||
uint32_t payload_2 = ISR2_PAYLOAD;
|
||||
uint32_t payload_3 = ISR3_PAYLOAD;
|
||||
uint32_t payload_4 = ISR4_PAYLOAD;
|
||||
|
||||
volatile uint16_t i = 0;
|
||||
bool first_trip_1 = false;
|
||||
bool first_trip_2 = false;
|
||||
bool first_trip_3 = false;
|
||||
bool first_trip_4 = false;
|
||||
|
||||
|
||||
void main(void)
|
||||
{
|
||||
Device_init();
|
||||
Device_initGPIO();
|
||||
|
||||
// map interrupts
|
||||
Interrupt_initModule();
|
||||
Interrupt_initVectorTable();
|
||||
Interrupt_register(INT_EPWM1, &epwm1ISR);
|
||||
Interrupt_register(INT_EPWM2, &epwm2ISR);
|
||||
Interrupt_register(INT_EPWM3, &epwm3ISR);
|
||||
Interrupt_register(INT_EPWM4, &epwm4ISR);
|
||||
Interrupt_register(INT_CLB1, &clb1ISR);
|
||||
Interrupt_register(INT_CLB2, &clb2ISR);
|
||||
Interrupt_register(INT_CLB3, &clb3ISR);
|
||||
Interrupt_register(INT_CLB4, &clb4ISR);
|
||||
|
||||
// GPIO configuration
|
||||
GPIO_setPadConfig(0, GPIO_PIN_TYPE_STD);
|
||||
GPIO_setPinConfig(GPIO_0_EPWM1A);
|
||||
GPIO_setPadConfig(1, GPIO_PIN_TYPE_STD);
|
||||
GPIO_setPinConfig(GPIO_1_EPWM1B);
|
||||
|
||||
GPIO_setPadConfig(2, GPIO_PIN_TYPE_STD);
|
||||
GPIO_setPinConfig(GPIO_2_EPWM2A);
|
||||
GPIO_setPadConfig(3, GPIO_PIN_TYPE_STD);
|
||||
GPIO_setPinConfig(GPIO_3_EPWM2B);
|
||||
|
||||
GPIO_setPadConfig(4, GPIO_PIN_TYPE_STD);
|
||||
GPIO_setPinConfig(GPIO_4_EPWM3A);
|
||||
GPIO_setPadConfig(5, GPIO_PIN_TYPE_STD);
|
||||
GPIO_setPinConfig(GPIO_5_EPWM3B);
|
||||
|
||||
GPIO_setPadConfig(6, GPIO_PIN_TYPE_STD);
|
||||
GPIO_setPinConfig(GPIO_6_EPWM4A);
|
||||
GPIO_setPadConfig(7, GPIO_PIN_TYPE_STD);
|
||||
GPIO_setPinConfig(GPIO_7_EPWM4B);
|
||||
|
||||
// initialize PWMs
|
||||
SysCtl_disablePeripheral(SYSCTL_PERIPH_CLK_TBCLKSYNC);
|
||||
initEPWM1();
|
||||
initEPWM2();
|
||||
initEPWM3();
|
||||
initEPWM4();
|
||||
|
||||
// initialize CLB tiles
|
||||
//SysCtl_enablePeripheral((SysCtl_PeripheralPCLOCKCR)0x0011);
|
||||
SysCtl_enablePeripheral((SysCtl_PeripheralPCLOCKCR)0x0111);
|
||||
SysCtl_enablePeripheral((SysCtl_PeripheralPCLOCKCR)0x0211);
|
||||
SysCtl_enablePeripheral((SysCtl_PeripheralPCLOCKCR)0x0311);
|
||||
|
||||
CLB_enableCLB(CLB1_BASE);
|
||||
CLB_enableCLB(CLB2_BASE);
|
||||
CLB_enableCLB(CLB3_BASE);
|
||||
CLB_enableCLB(CLB4_BASE);
|
||||
initTILE1(CLB1_BASE);
|
||||
initTILE2(CLB2_BASE);
|
||||
initTILE3(CLB3_BASE);
|
||||
initTILE4(CLB4_BASE);
|
||||
|
||||
// CLB tile 1 configuration
|
||||
CLB_selectInputFilter(CLB1_BASE, CLB_IN0, CLB_FILTER_RISING_EDGE);
|
||||
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN0, CLB_GP_IN_MUX_EXTERNAL);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN1, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN2, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN3, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN4, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN5, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN6, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN7, CLB_GP_IN_MUX_GP_REG);
|
||||
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN0, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN1, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN2, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN3, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN4, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN5, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN6, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN7, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN0, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN1, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN2, CLB_GLOBAL_IN_MUX_EPWM1B);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN3, CLB_GLOBAL_IN_MUX_EPWM1B);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN4, CLB_GLOBAL_IN_MUX_EPWM1_CTRDIR);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN5, CLB_GLOBAL_IN_MUX_EPWM1_CTRDIR);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN6, CLB_GLOBAL_IN_MUX_EPWM1_CTRDIR);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN7, CLB_GLOBAL_IN_MUX_EPWM1_CTRDIR);
|
||||
|
||||
// CLB tile 2 configuration
|
||||
CLB_selectInputFilter(CLB2_BASE, CLB_IN0, CLB_FILTER_RISING_EDGE);
|
||||
|
||||
CLB_configGPInputMux(CLB2_BASE, CLB_IN0, CLB_GP_IN_MUX_EXTERNAL);
|
||||
CLB_configGPInputMux(CLB2_BASE, CLB_IN1, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB2_BASE, CLB_IN2, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB2_BASE, CLB_IN3, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB2_BASE, CLB_IN4, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB2_BASE, CLB_IN5, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB2_BASE, CLB_IN6, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB2_BASE, CLB_IN7, CLB_GP_IN_MUX_GP_REG);
|
||||
|
||||
CLB_configLocalInputMux(CLB2_BASE, CLB_IN0, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB2_BASE, CLB_IN1, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB2_BASE, CLB_IN2, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB2_BASE, CLB_IN3, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB2_BASE, CLB_IN4, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB2_BASE, CLB_IN5, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB2_BASE, CLB_IN6, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB2_BASE, CLB_IN7, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
|
||||
CLB_configGlobalInputMux(CLB2_BASE, CLB_IN0, CLB_GLOBAL_IN_MUX_EPWM2A);
|
||||
CLB_configGlobalInputMux(CLB2_BASE, CLB_IN1, CLB_GLOBAL_IN_MUX_EPWM2A);
|
||||
CLB_configGlobalInputMux(CLB2_BASE, CLB_IN2, CLB_GLOBAL_IN_MUX_EPWM2B);
|
||||
CLB_configGlobalInputMux(CLB2_BASE, CLB_IN3, CLB_GLOBAL_IN_MUX_EPWM2B);
|
||||
CLB_configGlobalInputMux(CLB2_BASE, CLB_IN4, CLB_GLOBAL_IN_MUX_EPWM2_CTRDIR);
|
||||
CLB_configGlobalInputMux(CLB2_BASE, CLB_IN5, CLB_GLOBAL_IN_MUX_EPWM2_CTRDIR);
|
||||
CLB_configGlobalInputMux(CLB2_BASE, CLB_IN6, CLB_GLOBAL_IN_MUX_EPWM2_CTRDIR);
|
||||
CLB_configGlobalInputMux(CLB2_BASE, CLB_IN7, CLB_GLOBAL_IN_MUX_EPWM2_CTRDIR);
|
||||
|
||||
// CLB tile 3 configuration
|
||||
CLB_selectInputFilter(CLB3_BASE, CLB_IN0, CLB_FILTER_RISING_EDGE);
|
||||
|
||||
CLB_configGPInputMux(CLB3_BASE, CLB_IN0, CLB_GP_IN_MUX_EXTERNAL);
|
||||
CLB_configGPInputMux(CLB3_BASE, CLB_IN1, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB3_BASE, CLB_IN2, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB3_BASE, CLB_IN3, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB3_BASE, CLB_IN4, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB3_BASE, CLB_IN5, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB3_BASE, CLB_IN6, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB3_BASE, CLB_IN7, CLB_GP_IN_MUX_GP_REG);
|
||||
|
||||
CLB_configLocalInputMux(CLB3_BASE, CLB_IN0, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB3_BASE, CLB_IN1, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB3_BASE, CLB_IN2, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB3_BASE, CLB_IN3, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB3_BASE, CLB_IN4, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB3_BASE, CLB_IN5, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB3_BASE, CLB_IN6, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB3_BASE, CLB_IN7, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
|
||||
CLB_configGlobalInputMux(CLB3_BASE, CLB_IN0, CLB_GLOBAL_IN_MUX_EPWM3A);
|
||||
CLB_configGlobalInputMux(CLB3_BASE, CLB_IN1, CLB_GLOBAL_IN_MUX_EPWM3A);
|
||||
CLB_configGlobalInputMux(CLB3_BASE, CLB_IN2, CLB_GLOBAL_IN_MUX_EPWM3B);
|
||||
CLB_configGlobalInputMux(CLB3_BASE, CLB_IN3, CLB_GLOBAL_IN_MUX_EPWM3B);
|
||||
CLB_configGlobalInputMux(CLB3_BASE, CLB_IN4, CLB_GLOBAL_IN_MUX_EPWM3_CTRDIR);
|
||||
CLB_configGlobalInputMux(CLB3_BASE, CLB_IN5, CLB_GLOBAL_IN_MUX_EPWM3_CTRDIR);
|
||||
CLB_configGlobalInputMux(CLB3_BASE, CLB_IN6, CLB_GLOBAL_IN_MUX_EPWM3_CTRDIR);
|
||||
CLB_configGlobalInputMux(CLB3_BASE, CLB_IN7, CLB_GLOBAL_IN_MUX_EPWM3_CTRDIR);
|
||||
|
||||
// CLB tile 4 configuration
|
||||
CLB_selectInputFilter(CLB4_BASE, CLB_IN0, CLB_FILTER_RISING_EDGE);
|
||||
|
||||
CLB_configGPInputMux(CLB4_BASE, CLB_IN0, CLB_GP_IN_MUX_EXTERNAL);
|
||||
CLB_configGPInputMux(CLB4_BASE, CLB_IN1, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB4_BASE, CLB_IN2, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB4_BASE, CLB_IN3, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB4_BASE, CLB_IN4, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB4_BASE, CLB_IN5, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB4_BASE, CLB_IN6, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB4_BASE, CLB_IN7, CLB_GP_IN_MUX_GP_REG);
|
||||
|
||||
CLB_configLocalInputMux(CLB4_BASE, CLB_IN0, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB4_BASE, CLB_IN1, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB4_BASE, CLB_IN2, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB4_BASE, CLB_IN3, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB4_BASE, CLB_IN4, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB4_BASE, CLB_IN5, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB4_BASE, CLB_IN6, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB4_BASE, CLB_IN7, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
|
||||
CLB_configGlobalInputMux(CLB4_BASE, CLB_IN0, CLB_GLOBAL_IN_MUX_EPWM4A);
|
||||
CLB_configGlobalInputMux(CLB4_BASE, CLB_IN1, CLB_GLOBAL_IN_MUX_EPWM4A);
|
||||
CLB_configGlobalInputMux(CLB4_BASE, CLB_IN2, CLB_GLOBAL_IN_MUX_EPWM4B);
|
||||
CLB_configGlobalInputMux(CLB4_BASE, CLB_IN3, CLB_GLOBAL_IN_MUX_EPWM4B);
|
||||
CLB_configGlobalInputMux(CLB4_BASE, CLB_IN4, CLB_GLOBAL_IN_MUX_EPWM4_CTRDIR);
|
||||
CLB_configGlobalInputMux(CLB4_BASE, CLB_IN5, CLB_GLOBAL_IN_MUX_EPWM4_CTRDIR);
|
||||
CLB_configGlobalInputMux(CLB4_BASE, CLB_IN6, CLB_GLOBAL_IN_MUX_EPWM4_CTRDIR);
|
||||
CLB_configGlobalInputMux(CLB4_BASE, CLB_IN7, CLB_GLOBAL_IN_MUX_EPWM4_CTRDIR);
|
||||
|
||||
// enable interrupts
|
||||
Interrupt_enable(INT_EPWM1);
|
||||
Interrupt_enable(INT_EPWM2);
|
||||
Interrupt_enable(INT_EPWM3);
|
||||
Interrupt_enable(INT_EPWM4);
|
||||
Interrupt_enable(INT_CLB1);
|
||||
Interrupt_enable(INT_CLB2);
|
||||
Interrupt_enable(INT_CLB3);
|
||||
Interrupt_enable(INT_CLB4);
|
||||
EINT;
|
||||
|
||||
// enable CLB counters
|
||||
HWREG(0x3100) = 0x6;
|
||||
HWREG(0x3500) = 0x6;
|
||||
HWREG(0x3900) = 0x6;
|
||||
HWREG(0x3D00) = 0x6;
|
||||
CLB_setGPREG(CLB1_BASE, gpreg1);
|
||||
CLB_setGPREG(CLB2_BASE, gpreg2);
|
||||
CLB_setGPREG(CLB3_BASE, gpreg3);
|
||||
CLB_setGPREG(CLB4_BASE, gpreg4);
|
||||
|
||||
// start PWMs
|
||||
EPWM_setTimeBaseCounterMode(EPWM1_BASE, EPWM_COUNTER_MODE_UP);
|
||||
EPWM_setTimeBaseCounterMode(EPWM2_BASE, EPWM_COUNTER_MODE_UP);
|
||||
EPWM_setTimeBaseCounterMode(EPWM3_BASE, EPWM_COUNTER_MODE_UP);
|
||||
EPWM_setTimeBaseCounterMode(EPWM4_BASE, EPWM_COUNTER_MODE_UP);
|
||||
SysCtl_enablePeripheral(SYSCTL_PERIPH_CLK_TBCLKSYNC);
|
||||
|
||||
while(1)
|
||||
{
|
||||
asm(" NOP");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//--- PWM initialization ---
|
||||
|
||||
void initEPWM1()
|
||||
{
|
||||
EPWM_setTimeBasePeriod(EPWM1_BASE, EPWM1_TIMER_TBPRD);
|
||||
EPWM_setPhaseShift(EPWM1_BASE, 0U);
|
||||
EPWM_setTimeBaseCounter(EPWM1_BASE, 0U);
|
||||
|
||||
EPWM_setSyncOutPulseMode(EPWM1_BASE, EPWM_SYNC_OUT_PULSE_ON_COUNTER_ZERO);
|
||||
|
||||
EPWM_setCounterCompareValue(EPWM1_BASE, EPWM_COUNTER_COMPARE_A, EPWM1_CMPA);
|
||||
EPWM_setCounterCompareValue(EPWM1_BASE, EPWM_COUNTER_COMPARE_B, EPWM1_CMPB);
|
||||
|
||||
EPWM_disablePhaseShiftLoad(EPWM1_BASE);
|
||||
EPWM_setClockPrescaler(EPWM1_BASE, EPWM_CLOCK_DIVIDER_1, EPWM_HSCLOCK_DIVIDER_1);
|
||||
|
||||
EPWM_setCounterCompareShadowLoadMode(EPWM1_BASE, EPWM_COUNTER_COMPARE_A, EPWM_COMP_LOAD_ON_CNTR_ZERO);
|
||||
EPWM_setCounterCompareShadowLoadMode(EPWM1_BASE, EPWM_COUNTER_COMPARE_B, EPWM_COMP_LOAD_ON_CNTR_ZERO);
|
||||
|
||||
EPWM_setActionQualifierAction(EPWM1_BASE, EPWM_AQ_OUTPUT_A, EPWM_AQ_OUTPUT_HIGH, EPWM_AQ_OUTPUT_ON_TIMEBASE_ZERO);
|
||||
EPWM_setActionQualifierAction(EPWM1_BASE, EPWM_AQ_OUTPUT_A, EPWM_AQ_OUTPUT_LOW, EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPA);
|
||||
|
||||
EPWM_setActionQualifierAction(EPWM1_BASE, EPWM_AQ_OUTPUT_B, EPWM_AQ_OUTPUT_LOW, EPWM_AQ_OUTPUT_ON_TIMEBASE_ZERO);
|
||||
EPWM_setActionQualifierAction(EPWM1_BASE, EPWM_AQ_OUTPUT_B, EPWM_AQ_OUTPUT_HIGH, EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPB);
|
||||
|
||||
EPWM_setInterruptSource(EPWM1_BASE, EPWM_INT_TBCTR_ZERO);
|
||||
EPWM_enableInterrupt(EPWM1_BASE);
|
||||
EPWM_setInterruptEventCount(EPWM1_BASE, 1U);
|
||||
}
|
||||
|
||||
|
||||
void initEPWM2()
|
||||
{
|
||||
EPWM_setTimeBasePeriod(EPWM2_BASE, EPWM2_TIMER_TBPRD);
|
||||
EPWM_setPhaseShift(EPWM2_BASE, 0U);
|
||||
EPWM_setTimeBaseCounter(EPWM2_BASE, 0U);
|
||||
|
||||
EPWM_disablePhaseShiftLoad(EPWM2_BASE);
|
||||
EPWM_setPhaseShift(EPWM2_BASE, 0U);
|
||||
|
||||
EPWM_setCounterCompareValue(EPWM2_BASE, EPWM_COUNTER_COMPARE_A, EPWM2_CMPA);
|
||||
EPWM_setCounterCompareValue(EPWM2_BASE, EPWM_COUNTER_COMPARE_B, EPWM2_CMPB);
|
||||
|
||||
EPWM_setClockPrescaler(EPWM2_BASE, EPWM_CLOCK_DIVIDER_1, EPWM_HSCLOCK_DIVIDER_1);
|
||||
|
||||
EPWM_setCounterCompareShadowLoadMode(EPWM2_BASE, EPWM_COUNTER_COMPARE_A, EPWM_COMP_LOAD_ON_CNTR_ZERO);
|
||||
EPWM_setCounterCompareShadowLoadMode(EPWM2_BASE, EPWM_COUNTER_COMPARE_B, EPWM_COMP_LOAD_ON_CNTR_ZERO);
|
||||
|
||||
EPWM_setActionQualifierAction(EPWM2_BASE, EPWM_AQ_OUTPUT_A, EPWM_AQ_OUTPUT_HIGH, EPWM_AQ_OUTPUT_ON_TIMEBASE_ZERO);
|
||||
EPWM_setActionQualifierAction(EPWM2_BASE, EPWM_AQ_OUTPUT_A, EPWM_AQ_OUTPUT_LOW, EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPA);
|
||||
|
||||
EPWM_setActionQualifierAction(EPWM2_BASE, EPWM_AQ_OUTPUT_B, EPWM_AQ_OUTPUT_LOW, EPWM_AQ_OUTPUT_ON_TIMEBASE_ZERO);
|
||||
EPWM_setActionQualifierAction(EPWM2_BASE, EPWM_AQ_OUTPUT_B, EPWM_AQ_OUTPUT_HIGH, EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPB);
|
||||
|
||||
EPWM_setInterruptSource(EPWM2_BASE, EPWM_INT_TBCTR_ZERO);
|
||||
EPWM_enableInterrupt(EPWM2_BASE);
|
||||
EPWM_setInterruptEventCount(EPWM2_BASE, 1U);
|
||||
}
|
||||
|
||||
|
||||
void initEPWM3()
|
||||
{
|
||||
EPWM_setTimeBasePeriod(EPWM3_BASE, EPWM3_TIMER_TBPRD);
|
||||
EPWM_setPhaseShift(EPWM3_BASE, 0U);
|
||||
EPWM_setTimeBaseCounter(EPWM3_BASE, 0U);
|
||||
|
||||
EPWM_disablePhaseShiftLoad(EPWM3_BASE);
|
||||
EPWM_setPhaseShift(EPWM3_BASE, 0U);
|
||||
|
||||
EPWM_setCounterCompareValue(EPWM3_BASE, EPWM_COUNTER_COMPARE_A, EPWM3_CMPA);
|
||||
EPWM_setCounterCompareValue(EPWM3_BASE, EPWM_COUNTER_COMPARE_B, EPWM3_CMPB);
|
||||
|
||||
EPWM_setClockPrescaler(EPWM3_BASE, EPWM_CLOCK_DIVIDER_1, EPWM_HSCLOCK_DIVIDER_1);
|
||||
|
||||
EPWM_setCounterCompareShadowLoadMode(EPWM3_BASE, EPWM_COUNTER_COMPARE_A, EPWM_COMP_LOAD_ON_CNTR_ZERO);
|
||||
EPWM_setCounterCompareShadowLoadMode(EPWM3_BASE, EPWM_COUNTER_COMPARE_B, EPWM_COMP_LOAD_ON_CNTR_ZERO);
|
||||
|
||||
EPWM_setActionQualifierAction(EPWM3_BASE, EPWM_AQ_OUTPUT_A, EPWM_AQ_OUTPUT_HIGH, EPWM_AQ_OUTPUT_ON_TIMEBASE_ZERO);
|
||||
EPWM_setActionQualifierAction(EPWM3_BASE, EPWM_AQ_OUTPUT_A, EPWM_AQ_OUTPUT_LOW, EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPA);
|
||||
|
||||
EPWM_setActionQualifierAction(EPWM3_BASE, EPWM_AQ_OUTPUT_B, EPWM_AQ_OUTPUT_LOW, EPWM_AQ_OUTPUT_ON_TIMEBASE_ZERO);
|
||||
EPWM_setActionQualifierAction(EPWM3_BASE, EPWM_AQ_OUTPUT_B, EPWM_AQ_OUTPUT_HIGH, EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPB);
|
||||
|
||||
EPWM_setInterruptSource(EPWM3_BASE, EPWM_INT_TBCTR_ZERO);
|
||||
EPWM_enableInterrupt(EPWM3_BASE);
|
||||
EPWM_setInterruptEventCount(EPWM3_BASE, 1U);
|
||||
}
|
||||
|
||||
|
||||
void initEPWM4()
|
||||
{
|
||||
EPWM_setTimeBasePeriod(EPWM4_BASE, EPWM4_TIMER_TBPRD);
|
||||
EPWM_setPhaseShift(EPWM4_BASE, 0U);
|
||||
EPWM_setTimeBaseCounter(EPWM4_BASE, 0U);
|
||||
|
||||
EPWM_disablePhaseShiftLoad(EPWM4_BASE);
|
||||
EPWM_setPhaseShift(EPWM4_BASE, 0U);
|
||||
|
||||
EPWM_setCounterCompareValue(EPWM4_BASE, EPWM_COUNTER_COMPARE_A, EPWM4_CMPA);
|
||||
EPWM_setCounterCompareValue(EPWM4_BASE, EPWM_COUNTER_COMPARE_B, EPWM4_CMPB);
|
||||
|
||||
EPWM_setClockPrescaler(EPWM4_BASE, EPWM_CLOCK_DIVIDER_1, EPWM_HSCLOCK_DIVIDER_1);
|
||||
|
||||
EPWM_setCounterCompareShadowLoadMode(EPWM4_BASE, EPWM_COUNTER_COMPARE_A, EPWM_COMP_LOAD_ON_CNTR_ZERO);
|
||||
EPWM_setCounterCompareShadowLoadMode(EPWM4_BASE, EPWM_COUNTER_COMPARE_B, EPWM_COMP_LOAD_ON_CNTR_ZERO);
|
||||
|
||||
EPWM_setActionQualifierAction(EPWM4_BASE, EPWM_AQ_OUTPUT_A, EPWM_AQ_OUTPUT_HIGH, EPWM_AQ_OUTPUT_ON_TIMEBASE_ZERO);
|
||||
EPWM_setActionQualifierAction(EPWM4_BASE, EPWM_AQ_OUTPUT_A, EPWM_AQ_OUTPUT_LOW, EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPA);
|
||||
|
||||
EPWM_setActionQualifierAction(EPWM4_BASE, EPWM_AQ_OUTPUT_B, EPWM_AQ_OUTPUT_LOW, EPWM_AQ_OUTPUT_ON_TIMEBASE_ZERO);
|
||||
EPWM_setActionQualifierAction(EPWM4_BASE, EPWM_AQ_OUTPUT_B, EPWM_AQ_OUTPUT_HIGH, EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPB);
|
||||
|
||||
EPWM_setInterruptSource(EPWM4_BASE, EPWM_INT_TBCTR_ZERO);
|
||||
EPWM_enableInterrupt(EPWM4_BASE);
|
||||
EPWM_setInterruptEventCount(EPWM4_BASE, 1U);
|
||||
}
|
||||
|
||||
|
||||
//--- interrupt service routines ---
|
||||
|
||||
__interrupt void epwm1ISR(void)
|
||||
{
|
||||
EPWM_clearEventTriggerInterruptFlag(EPWM1_BASE);
|
||||
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP3);
|
||||
|
||||
// ISR payload
|
||||
for (i=0; i<payload_1; i++)
|
||||
{
|
||||
asm(" NOP");
|
||||
}
|
||||
|
||||
// pulse GPREG bit 2 to indicate ISR finished
|
||||
CLB_setGPREG(CLB1_BASE, gpreg1 | 0x00000002);
|
||||
asm(" NOP");
|
||||
CLB_setGPREG(CLB1_BASE, gpreg1);
|
||||
}
|
||||
|
||||
|
||||
__interrupt void epwm2ISR(void)
|
||||
{
|
||||
EPWM_clearEventTriggerInterruptFlag(EPWM2_BASE);
|
||||
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP3);
|
||||
|
||||
// ISR payload
|
||||
for (i=0; i<payload_2; i++)
|
||||
{
|
||||
asm(" NOP");
|
||||
}
|
||||
|
||||
// pulse GPREG bit 2 to indicate ISR finished
|
||||
CLB_setGPREG(CLB2_BASE, gpreg2 | 0x00000002);
|
||||
asm(" NOP");
|
||||
CLB_setGPREG(CLB2_BASE, gpreg2);
|
||||
}
|
||||
|
||||
|
||||
__interrupt void epwm3ISR(void)
|
||||
{
|
||||
EPWM_clearEventTriggerInterruptFlag(EPWM3_BASE);
|
||||
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP3);
|
||||
|
||||
// ISR payload
|
||||
for (i=0; i<payload_3; i++)
|
||||
{
|
||||
asm(" NOP");
|
||||
}
|
||||
|
||||
// pulse GPREG bit 2 to indicate ISR finished
|
||||
CLB_setGPREG(CLB3_BASE, gpreg3 | 0x00000002);
|
||||
asm(" NOP");
|
||||
CLB_setGPREG(CLB3_BASE, gpreg3);
|
||||
}
|
||||
|
||||
|
||||
__interrupt void epwm4ISR(void)
|
||||
{
|
||||
EPWM_clearEventTriggerInterruptFlag(EPWM4_BASE);
|
||||
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP3);
|
||||
|
||||
// ISR payload
|
||||
for (i=0; i<payload_4; i++)
|
||||
{
|
||||
asm(" NOP");
|
||||
}
|
||||
|
||||
// pulse GPREG bit 2 to indicate ISR finished
|
||||
CLB_setGPREG(CLB4_BASE, gpreg4 | 0x00000002);
|
||||
asm(" NOP");
|
||||
CLB_setGPREG(CLB4_BASE, gpreg4);
|
||||
}
|
||||
|
||||
|
||||
__interrupt void clb1ISR(void)
|
||||
{
|
||||
if (!first_trip_1)
|
||||
{
|
||||
first_trip_1 = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
asm(" ESTOP0");
|
||||
}
|
||||
|
||||
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP5);
|
||||
}
|
||||
|
||||
|
||||
__interrupt void clb2ISR(void)
|
||||
{
|
||||
if (!first_trip_2)
|
||||
{
|
||||
first_trip_2 = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
asm(" ESTOP0");
|
||||
}
|
||||
|
||||
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP5);
|
||||
}
|
||||
|
||||
|
||||
__interrupt void clb3ISR(void)
|
||||
{
|
||||
if (!first_trip_3)
|
||||
{
|
||||
first_trip_3 = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
asm(" ESTOP0");
|
||||
}
|
||||
|
||||
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP5);
|
||||
}
|
||||
|
||||
|
||||
__interrupt void clb4ISR(void)
|
||||
{
|
||||
if (!first_trip_4)
|
||||
{
|
||||
first_trip_4 = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
asm(" ESTOP0");
|
||||
}
|
||||
|
||||
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP5);
|
||||
}
|
||||
|
||||
|
||||
/* end of file */
|
||||
@@ -0,0 +1,344 @@
|
||||
|
||||
var TILE = scripting.addModule("/utilities/clb_tool/clb_syscfg/source/TILE");
|
||||
var TILE1 = TILE.addInstance();
|
||||
var TILE2 = TILE.addInstance();
|
||||
var TILE3 = TILE.addInstance();
|
||||
var TILE4 = TILE.addInstance();
|
||||
// sim_duration - Duration of the simulation (in Nano Seconds)
|
||||
TILE.sim_duration = 500000;
|
||||
// Name
|
||||
TILE1.$name = "TILE1";
|
||||
// Name
|
||||
TILE1.BOUNDARY.$name = "BOUNDARY0";
|
||||
// in0
|
||||
TILE1.BOUNDARY.in0 = "squareWave";
|
||||
// in_edge0 - Edge detection on the inputs, generates 1 cycle pulse on chosen edges - for simulation purposes only
|
||||
TILE1.BOUNDARY.in_edge0 = "rising edge";
|
||||
// in_period0 - Period of the square wave
|
||||
TILE1.BOUNDARY.in_period0 = 1000;
|
||||
// in_duty0 - Duty or ON time of the square wave
|
||||
TILE1.BOUNDARY.in_duty0 = 4;
|
||||
// in_repeat_count0 - Number of periods the waveform is repeated
|
||||
TILE1.BOUNDARY.in_repeat_count0 = 1000;
|
||||
// in1
|
||||
TILE1.BOUNDARY.in1 = "squareWave";
|
||||
// in_repeat_count1 - Number of periods the waveform is repeated
|
||||
TILE1.BOUNDARY.in_repeat_count1 = 1000;
|
||||
// in_edge1 - Edge detection on the inputs, generates 1 cycle pulse on chosen edges - for simulation purposes only
|
||||
TILE1.BOUNDARY.in_edge1 = "rising edge";
|
||||
// in2
|
||||
TILE1.BOUNDARY.in2 = "1";
|
||||
// in_period1 - Period of the square wave
|
||||
TILE1.BOUNDARY.in_period1 = 1800;
|
||||
// Name
|
||||
TILE1.LUT_0.$name = "LUT_0";
|
||||
// Name
|
||||
TILE1.LUT_1.$name = "LUT_1";
|
||||
// Name
|
||||
TILE1.LUT_2.$name = "LUT_2";
|
||||
// i0 - Input 0.
|
||||
TILE1.LUT_2.i0 = "FSM_0.S0";
|
||||
// i1 - Input 1.
|
||||
TILE1.LUT_2.i1 = "COUNTER_0.count_match1";
|
||||
// i2 - Input 2.
|
||||
TILE1.LUT_2.i2 = "COUNTER_0.count_match2";
|
||||
// eqn - Boolean equation on the variables i3,i2,i1,i0 for the LUT output.
|
||||
TILE1.LUT_2.eqn = "(~i0 & i1) | (i0 & i2)";
|
||||
// Name
|
||||
TILE1.FSM_0.$name = "FSM_0";
|
||||
// e0 - External Input 0.
|
||||
TILE1.FSM_0.e0 = "BOUNDARY.in0";
|
||||
// e1 - External Input 1.
|
||||
TILE1.FSM_0.e1 = "BOUNDARY.in1";
|
||||
// eqn_s0 - Boolean equation on the variables e1,e0,s1,s0 for the S0 output.
|
||||
TILE1.FSM_0.eqn_s0 = "(~s0 & e0) | (s0 & (~e1))";
|
||||
// eqn_out - Boolean equation on the variables e1,e0,s1,s0 for the LUT output.
|
||||
TILE1.FSM_0.eqn_out = "~s0";
|
||||
// Name
|
||||
TILE1.FSM_1.$name = "FSM_1";
|
||||
// Name
|
||||
TILE1.FSM_2.$name = "FSM_2";
|
||||
// Name
|
||||
TILE1.COUNTER_0.$name = "COUNTER_0";
|
||||
// mode1 - Controls counting direction. High enables count up. Low enables count down.
|
||||
TILE1.COUNTER_0.mode1 = "1";
|
||||
// mode0 - Enables Counting when high
|
||||
TILE1.COUNTER_0.mode0 = "BOUNDARY.in2";
|
||||
// reset - Reset the counter to 0 on next clock cycle (triggers low to high)
|
||||
TILE1.COUNTER_0.reset = "FSM_0.OUT";
|
||||
// match1_val - Sets the value of the Match reference 1 register.
|
||||
TILE1.COUNTER_0.match1_val = "50";
|
||||
// match2_val - Sets the value of the Match reference 2 register.
|
||||
TILE1.COUNTER_0.match2_val = "3200";
|
||||
// Name
|
||||
TILE1.COUNTER_1.$name = "COUNTER_1";
|
||||
// Name
|
||||
TILE1.COUNTER_2.$name = "COUNTER_2";
|
||||
// Name
|
||||
TILE1.OUTLUT_0.$name = "OUTLUT_0";
|
||||
// Name
|
||||
TILE1.OUTLUT_1.$name = "OUTLUT_1";
|
||||
// Name
|
||||
TILE1.OUTLUT_2.$name = "OUTLUT_2";
|
||||
// Name
|
||||
TILE1.OUTLUT_3.$name = "OUTLUT_3";
|
||||
// Name
|
||||
TILE1.OUTLUT_4.$name = "OUTLUT_4";
|
||||
// Name
|
||||
TILE1.OUTLUT_5.$name = "OUTLUT_5";
|
||||
// Name
|
||||
TILE1.OUTLUT_6.$name = "OUTLUT_6";
|
||||
// Name
|
||||
TILE1.OUTLUT_7.$name = "OUTLUT_7";
|
||||
// Name
|
||||
TILE1.HLC.$name = "HLC_0";
|
||||
// Event 0 (e0) - Event 0
|
||||
TILE1.HLC.e0 = "LUT_2.OUT";
|
||||
// Name
|
||||
TILE1.HLC.program0.$name = "HLCP_0";
|
||||
// instruct0
|
||||
TILE1.HLC.program0.instruct0 = "INTR 1";
|
||||
// Name
|
||||
TILE1.HLC.program1.$name = "HLCP_1";
|
||||
// Name
|
||||
TILE1.HLC.program2.$name = "HLCP_2";
|
||||
// Name
|
||||
TILE1.HLC.program3.$name = "HLCP_3";
|
||||
var clb_run_dynamic_template_clb_h = scripting.addModule("/utilities/clb_tool/clb_syscfg/source/clb_run_dynamic_template_clb_h.js");
|
||||
var clb_run_dynamic_template_clb_c = scripting.addModule("/utilities/clb_tool/clb_syscfg/source/clb_run_dynamic_template_clb_c.js");
|
||||
var clb_run_dynamic_template_clb_sim = scripting.addModule("/utilities/clb_tool/clb_syscfg/source/clb_run_dynamic_template_clb_sim.js");
|
||||
var clb_run_dynamic_template_clb_dot = scripting.addModule("/utilities/clb_tool/clb_syscfg/source/clb_run_dynamic_template_clb_dot.js");
|
||||
// Name
|
||||
TILE2.$name = "TILE2";
|
||||
// Name
|
||||
TILE2.BOUNDARY.$name = "BOUNDARY1";
|
||||
// Name
|
||||
TILE2.LUT_0.$name = "LUT_3";
|
||||
// Name
|
||||
TILE2.LUT_1.$name = "LUT_4";
|
||||
// Name
|
||||
TILE2.LUT_2.$name = "LUT_5";
|
||||
// eqn - Boolean equation on the variables i3,i2,i1,i0 for the LUT output.
|
||||
TILE2.LUT_2.eqn = "(~i0 & i1) | (i0 & i2)";
|
||||
// i0 - Input 0.
|
||||
TILE2.LUT_2.i0 = "FSM_0.S0";
|
||||
// i1 - Input 1.
|
||||
TILE2.LUT_2.i1 = "COUNTER_0.count_match1";
|
||||
// i2 - Input 2.
|
||||
TILE2.LUT_2.i2 = "COUNTER_0.count_match2";
|
||||
// Name
|
||||
TILE2.FSM_0.$name = "FSM_3";
|
||||
// eqn_s0 - Boolean equation on the variables e1,e0,s1,s0 for the S0 output.
|
||||
TILE2.FSM_0.eqn_s0 = "(~s0 & e0) | (s0 & (~e1))";
|
||||
// e0 - External Input 0.
|
||||
TILE2.FSM_0.e0 = "BOUNDARY.in0";
|
||||
// e1 - External Input 1.
|
||||
TILE2.FSM_0.e1 = "BOUNDARY.in1";
|
||||
// eqn_out - Boolean equation on the variables e1,e0,s1,s0 for the LUT output.
|
||||
TILE2.FSM_0.eqn_out = "~s0";
|
||||
// Name
|
||||
TILE2.FSM_1.$name = "FSM_4";
|
||||
// Name
|
||||
TILE2.FSM_2.$name = "FSM_5";
|
||||
// Name
|
||||
TILE2.COUNTER_0.$name = "COUNTER_3";
|
||||
// mode1 - Controls counting direction. High enables count up. Low enables count down.
|
||||
TILE2.COUNTER_0.mode1 = "1";
|
||||
// mode0 - Enables Counting when high
|
||||
TILE2.COUNTER_0.mode0 = "BOUNDARY.in2";
|
||||
// reset - Reset the counter to 0 on next clock cycle (triggers low to high)
|
||||
TILE2.COUNTER_0.reset = "FSM_0.OUT";
|
||||
// match1_val - Sets the value of the Match reference 1 register.
|
||||
TILE2.COUNTER_0.match1_val = "50";
|
||||
// match2_val - Sets the value of the Match reference 2 register.
|
||||
TILE2.COUNTER_0.match2_val = "3200";
|
||||
// Name
|
||||
TILE2.COUNTER_1.$name = "COUNTER_4";
|
||||
// Name
|
||||
TILE2.COUNTER_2.$name = "COUNTER_5";
|
||||
// Name
|
||||
TILE2.OUTLUT_0.$name = "OUTLUT_8";
|
||||
// Name
|
||||
TILE2.OUTLUT_1.$name = "OUTLUT_9";
|
||||
// Name
|
||||
TILE2.OUTLUT_2.$name = "OUTLUT_10";
|
||||
// Name
|
||||
TILE2.OUTLUT_3.$name = "OUTLUT_11";
|
||||
// Name
|
||||
TILE2.OUTLUT_4.$name = "OUTLUT_12";
|
||||
// Name
|
||||
TILE2.OUTLUT_5.$name = "OUTLUT_13";
|
||||
// Name
|
||||
TILE2.OUTLUT_6.$name = "OUTLUT_14";
|
||||
// Name
|
||||
TILE2.OUTLUT_7.$name = "OUTLUT_15";
|
||||
// Name
|
||||
TILE2.HLC.$name = "HLC_1";
|
||||
// Event 0 (e0) - Event 0
|
||||
TILE2.HLC.e0 = "LUT_2.OUT";
|
||||
// Name
|
||||
TILE2.HLC.program0.$name = "HLCP_4";
|
||||
// instruct0
|
||||
TILE2.HLC.program0.instruct0 = "INTR 2";
|
||||
// Name
|
||||
TILE2.HLC.program1.$name = "HLCP_5";
|
||||
// Name
|
||||
TILE2.HLC.program2.$name = "HLCP_6";
|
||||
// Name
|
||||
TILE2.HLC.program3.$name = "HLCP_7";
|
||||
// Name
|
||||
TILE3.$name = "TILE3";
|
||||
// Name
|
||||
TILE3.BOUNDARY.$name = "BOUNDARY2";
|
||||
// Name
|
||||
TILE3.LUT_0.$name = "LUT_6";
|
||||
// Name
|
||||
TILE3.LUT_1.$name = "LUT_7";
|
||||
// Name
|
||||
TILE3.LUT_2.$name = "LUT_8";
|
||||
// eqn - Boolean equation on the variables i3,i2,i1,i0 for the LUT output.
|
||||
TILE3.LUT_2.eqn = "(~i0 & i1) | (i0 & i2)";
|
||||
// i0 - Input 0.
|
||||
TILE3.LUT_2.i0 = "FSM_0.S0";
|
||||
// i1 - Input 1.
|
||||
TILE3.LUT_2.i1 = "COUNTER_0.count_match1";
|
||||
// i2 - Input 2.
|
||||
TILE3.LUT_2.i2 = "COUNTER_0.count_match2";
|
||||
// Name
|
||||
TILE3.FSM_0.$name = "FSM_6";
|
||||
// eqn_s0 - Boolean equation on the variables e1,e0,s1,s0 for the S0 output.
|
||||
TILE3.FSM_0.eqn_s0 = "(~s0 & e0) | (s0 & (~e1))";
|
||||
// e0 - External Input 0.
|
||||
TILE3.FSM_0.e0 = "BOUNDARY.in0";
|
||||
// e1 - External Input 1.
|
||||
TILE3.FSM_0.e1 = "BOUNDARY.in1";
|
||||
// eqn_out - Boolean equation on the variables e1,e0,s1,s0 for the LUT output.
|
||||
TILE3.FSM_0.eqn_out = "~s0";
|
||||
// Name
|
||||
TILE3.FSM_1.$name = "FSM_7";
|
||||
// Name
|
||||
TILE3.FSM_2.$name = "FSM_8";
|
||||
// Name
|
||||
TILE3.COUNTER_0.$name = "COUNTER_6";
|
||||
// mode0 - Enables Counting when high
|
||||
TILE3.COUNTER_0.mode0 = "BOUNDARY.in2";
|
||||
// mode1 - Controls counting direction. High enables count up. Low enables count down.
|
||||
TILE3.COUNTER_0.mode1 = "1";
|
||||
// reset - Reset the counter to 0 on next clock cycle (triggers low to high)
|
||||
TILE3.COUNTER_0.reset = "FSM_0.OUT";
|
||||
// match1_val - Sets the value of the Match reference 1 register.
|
||||
TILE3.COUNTER_0.match1_val = "50";
|
||||
// match2_val - Sets the value of the Match reference 2 register.
|
||||
TILE3.COUNTER_0.match2_val = "3200";
|
||||
// Name
|
||||
TILE3.COUNTER_1.$name = "COUNTER_7";
|
||||
// Name
|
||||
TILE3.COUNTER_2.$name = "COUNTER_8";
|
||||
// Name
|
||||
TILE3.OUTLUT_0.$name = "OUTLUT_16";
|
||||
// Name
|
||||
TILE3.OUTLUT_1.$name = "OUTLUT_17";
|
||||
// Name
|
||||
TILE3.OUTLUT_2.$name = "OUTLUT_18";
|
||||
// Name
|
||||
TILE3.OUTLUT_3.$name = "OUTLUT_19";
|
||||
// Name
|
||||
TILE3.OUTLUT_4.$name = "OUTLUT_20";
|
||||
// Name
|
||||
TILE3.OUTLUT_5.$name = "OUTLUT_21";
|
||||
// Name
|
||||
TILE3.OUTLUT_6.$name = "OUTLUT_22";
|
||||
// Name
|
||||
TILE3.OUTLUT_7.$name = "OUTLUT_23";
|
||||
// Name
|
||||
TILE3.HLC.$name = "HLC_2";
|
||||
// Event 0 (e0) - Event 0
|
||||
TILE3.HLC.e0 = "LUT_2.OUT";
|
||||
// Name
|
||||
TILE3.HLC.program0.$name = "HLCP_8";
|
||||
// instruct0
|
||||
TILE3.HLC.program0.instruct0 = "INTR 3";
|
||||
// Name
|
||||
TILE3.HLC.program1.$name = "HLCP_9";
|
||||
// Name
|
||||
TILE3.HLC.program2.$name = "HLCP_10";
|
||||
// Name
|
||||
TILE3.HLC.program3.$name = "HLCP_11";
|
||||
// Name
|
||||
TILE4.$name = "TILE4";
|
||||
// Name
|
||||
TILE4.BOUNDARY.$name = "BOUNDARY3";
|
||||
// Name
|
||||
TILE4.LUT_0.$name = "LUT_9";
|
||||
// Name
|
||||
TILE4.LUT_1.$name = "LUT_10";
|
||||
// Name
|
||||
TILE4.LUT_2.$name = "LUT_11";
|
||||
// eqn - Boolean equation on the variables i3,i2,i1,i0 for the LUT output.
|
||||
TILE4.LUT_2.eqn = "(~i0 & i1) | (i0 & i2)";
|
||||
// i0 - Input 0.
|
||||
TILE4.LUT_2.i0 = "FSM_0.S0";
|
||||
// i1 - Input 1.
|
||||
TILE4.LUT_2.i1 = "COUNTER_0.count_match1";
|
||||
// i2 - Input 2.
|
||||
TILE4.LUT_2.i2 = "COUNTER_0.count_match2";
|
||||
// Name
|
||||
TILE4.FSM_0.$name = "FSM_9";
|
||||
// eqn_s0 - Boolean equation on the variables e1,e0,s1,s0 for the S0 output.
|
||||
TILE4.FSM_0.eqn_s0 = "(~s0 & e0) | (s0 & (~e1))";
|
||||
// e0 - External Input 0.
|
||||
TILE4.FSM_0.e0 = "BOUNDARY.in0";
|
||||
// e1 - External Input 1.
|
||||
TILE4.FSM_0.e1 = "BOUNDARY.in1";
|
||||
// eqn_out - Boolean equation on the variables e1,e0,s1,s0 for the LUT output.
|
||||
TILE4.FSM_0.eqn_out = "~s0";
|
||||
// Name
|
||||
TILE4.FSM_1.$name = "FSM_10";
|
||||
// Name
|
||||
TILE4.FSM_2.$name = "FSM_11";
|
||||
// Name
|
||||
TILE4.COUNTER_0.$name = "COUNTER_9";
|
||||
// mode0 - Enables Counting when high
|
||||
TILE4.COUNTER_0.mode0 = "BOUNDARY.in2";
|
||||
// mode1 - Controls counting direction. High enables count up. Low enables count down.
|
||||
TILE4.COUNTER_0.mode1 = "1";
|
||||
// reset - Reset the counter to 0 on next clock cycle (triggers low to high)
|
||||
TILE4.COUNTER_0.reset = "FSM_0.OUT";
|
||||
// match1_val - Sets the value of the Match reference 1 register.
|
||||
TILE4.COUNTER_0.match1_val = "50";
|
||||
// match2_val - Sets the value of the Match reference 2 register.
|
||||
TILE4.COUNTER_0.match2_val = "3200";
|
||||
// Name
|
||||
TILE4.COUNTER_1.$name = "COUNTER_10";
|
||||
// Name
|
||||
TILE4.COUNTER_2.$name = "COUNTER_11";
|
||||
// Name
|
||||
TILE4.OUTLUT_0.$name = "OUTLUT_24";
|
||||
// Name
|
||||
TILE4.OUTLUT_1.$name = "OUTLUT_25";
|
||||
// Name
|
||||
TILE4.OUTLUT_2.$name = "OUTLUT_26";
|
||||
// Name
|
||||
TILE4.OUTLUT_3.$name = "OUTLUT_27";
|
||||
// Name
|
||||
TILE4.OUTLUT_4.$name = "OUTLUT_28";
|
||||
// Name
|
||||
TILE4.OUTLUT_5.$name = "OUTLUT_29";
|
||||
// Name
|
||||
TILE4.OUTLUT_6.$name = "OUTLUT_30";
|
||||
// Name
|
||||
TILE4.OUTLUT_7.$name = "OUTLUT_31";
|
||||
// Name
|
||||
TILE4.HLC.$name = "HLC_3";
|
||||
// Event 0 (e0) - Event 0
|
||||
TILE4.HLC.e0 = "LUT_2.OUT";
|
||||
// Name
|
||||
TILE4.HLC.program0.$name = "HLCP_12";
|
||||
// instruct0
|
||||
TILE4.HLC.program0.instruct0 = "INTR 4";
|
||||
// Name
|
||||
TILE4.HLC.program1.$name = "HLCP_13";
|
||||
// Name
|
||||
TILE4.HLC.program2.$name = "HLCP_14";
|
||||
// Name
|
||||
TILE4.HLC.program3.$name = "HLCP_15";
|
||||
@@ -0,0 +1,201 @@
|
||||
//#############################################################################
|
||||
//
|
||||
// FILE: clb_ex6_siggen.c
|
||||
//
|
||||
// TITLE: CLB Signal Generator.
|
||||
//
|
||||
//! \addtogroup driver_example_list
|
||||
//! <h1>CLB Signal Generator</h1>
|
||||
//!
|
||||
//! For the detailed description of this example, please refer to:
|
||||
//! C2000Ware_PATH\utilities\clb_tool\clb_syscfg\doc\CLB Tool Users Guide.pdf
|
||||
//!
|
||||
//
|
||||
//
|
||||
//#############################################################################
|
||||
//
|
||||
//
|
||||
// $Copyright:
|
||||
// Copyright (C) 2013-2024 Texas Instruments Incorporated - http://www.ti.com/
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions
|
||||
// are met:
|
||||
//
|
||||
// Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
//
|
||||
// Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
//
|
||||
// Neither the name of Texas Instruments Incorporated nor the names of
|
||||
// its contributors may be used to endorse or promote products derived
|
||||
// from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
// $
|
||||
//#############################################################################
|
||||
|
||||
|
||||
#include "driverlib.h"
|
||||
#include "device.h"
|
||||
#include "clb_config.h"
|
||||
#include "clb.h"
|
||||
|
||||
|
||||
__interrupt void clb2ISR(void);
|
||||
|
||||
// GPREG settings:
|
||||
// bit 2 = enable
|
||||
// bit 1 = ISR end flag
|
||||
// bit 0 not used
|
||||
uint32_t gpreg1 = 1;
|
||||
|
||||
|
||||
bool error_low = false;
|
||||
bool error_hi = false;
|
||||
|
||||
|
||||
void main(void)
|
||||
{
|
||||
Device_init();
|
||||
Device_initGPIO();
|
||||
|
||||
//
|
||||
// map interrupts
|
||||
//
|
||||
Interrupt_initModule();
|
||||
Interrupt_initVectorTable();
|
||||
|
||||
Interrupt_register(INT_CLB2, &clb2ISR);
|
||||
|
||||
//
|
||||
// initialize CLB tiles
|
||||
//
|
||||
//SysCtl_enablePeripheral((SysCtl_PeripheralPCLOCKCR)0x0011);
|
||||
SysCtl_enablePeripheral((SysCtl_PeripheralPCLOCKCR)0x0111);
|
||||
|
||||
CLB_enableCLB(CLB1_BASE);
|
||||
CLB_enableCLB(CLB2_BASE);
|
||||
initTILE1(CLB1_BASE);
|
||||
initTILE2(CLB2_BASE);
|
||||
|
||||
//
|
||||
// CLB tile 1 configuration
|
||||
//
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN0, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN1, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN2, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN3, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN4, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN5, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN6, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN7, CLB_GP_IN_MUX_GP_REG);
|
||||
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN0, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN1, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN2, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN3, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN4, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN5, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN6, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN7, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN0, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN1, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN2, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN3, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN4, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN5, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN6, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN7, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
|
||||
//
|
||||
// CLB tile 2 configuration
|
||||
//
|
||||
CLB_configGPInputMux(CLB2_BASE, CLB_IN0, CLB_GP_IN_MUX_EXTERNAL);
|
||||
CLB_configGPInputMux(CLB2_BASE, CLB_IN1, CLB_GP_IN_MUX_EXTERNAL);
|
||||
CLB_configGPInputMux(CLB2_BASE, CLB_IN2, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB2_BASE, CLB_IN3, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB2_BASE, CLB_IN4, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB2_BASE, CLB_IN5, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB2_BASE, CLB_IN6, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB2_BASE, CLB_IN7, CLB_GP_IN_MUX_GP_REG);
|
||||
|
||||
CLB_configLocalInputMux(CLB2_BASE, CLB_IN0, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB2_BASE, CLB_IN1, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB2_BASE, CLB_IN2, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB2_BASE, CLB_IN3, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB2_BASE, CLB_IN4, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB2_BASE, CLB_IN5, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB2_BASE, CLB_IN6, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB2_BASE, CLB_IN7, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
|
||||
CLB_configGlobalInputMux(CLB2_BASE, CLB_IN0, CLB_GLOBAL_IN_MUX_CLB_AUXSIG0);
|
||||
CLB_configGlobalInputMux(CLB2_BASE, CLB_IN1, CLB_GLOBAL_IN_MUX_CLB_AUXSIG1);
|
||||
CLB_configGlobalInputMux(CLB2_BASE, CLB_IN2, CLB_GLOBAL_IN_MUX_EPWM2B);
|
||||
CLB_configGlobalInputMux(CLB2_BASE, CLB_IN3, CLB_GLOBAL_IN_MUX_EPWM2B);
|
||||
CLB_configGlobalInputMux(CLB2_BASE, CLB_IN4, CLB_GLOBAL_IN_MUX_EPWM2_CTRDIR);
|
||||
CLB_configGlobalInputMux(CLB2_BASE, CLB_IN5, CLB_GLOBAL_IN_MUX_EPWM2_CTRDIR);
|
||||
CLB_configGlobalInputMux(CLB2_BASE, CLB_IN6, CLB_GLOBAL_IN_MUX_EPWM2_CTRDIR);
|
||||
CLB_configGlobalInputMux(CLB2_BASE, CLB_IN7, CLB_GLOBAL_IN_MUX_EPWM2_CTRDIR);
|
||||
|
||||
CLB_enableSynchronization(CLB2_BASE, CLB_IN0);
|
||||
CLB_enableSynchronization(CLB2_BASE, CLB_IN1);
|
||||
|
||||
//
|
||||
// Configure CLB-XBAR AUXSIG0 as CLB1_4
|
||||
//
|
||||
XBAR_setCLBMuxConfig(XBAR_AUXSIG0, XBAR_CLB_MUX01_CLB1_OUT4);
|
||||
XBAR_enableCLBMux(XBAR_AUXSIG0, XBAR_MUX01);
|
||||
|
||||
//
|
||||
// Configure CLB-XBAR AUXSIG1 as CLB1_5
|
||||
//
|
||||
XBAR_setCLBMuxConfig(XBAR_AUXSIG1, XBAR_CLB_MUX03_CLB1_OUT5);
|
||||
XBAR_enableCLBMux(XBAR_AUXSIG1, XBAR_MUX03);
|
||||
|
||||
//
|
||||
// enable interrupts
|
||||
//
|
||||
Interrupt_enable(INT_CLB2);
|
||||
EINT;
|
||||
|
||||
//
|
||||
// enable CLB counters
|
||||
//
|
||||
HWREG(0x3100) = 0x6;
|
||||
HWREG(0x3500) = 0x6;
|
||||
CLB_setGPREG(CLB1_BASE, gpreg1);
|
||||
|
||||
|
||||
while(1)
|
||||
{
|
||||
asm(" NOP");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
__interrupt void clb2ISR(void)
|
||||
{
|
||||
asm(" ESTOP0");
|
||||
|
||||
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP5);
|
||||
}
|
||||
|
||||
//
|
||||
// end of file //
|
||||
//
|
||||
@@ -0,0 +1,193 @@
|
||||
|
||||
var TILE = scripting.addModule("/utilities/clb_tool/clb_syscfg/source/TILE");
|
||||
var TILE1 = TILE.addInstance();
|
||||
var TILE2 = TILE.addInstance();
|
||||
// sim_duration - Duration of the simulation (in Nano Seconds)
|
||||
TILE.sim_duration = 500000;
|
||||
// Name
|
||||
TILE1.$name = "TILE1";
|
||||
// Name
|
||||
TILE1.BOUNDARY.$name = "BOUNDARY0";
|
||||
// in0
|
||||
TILE1.BOUNDARY.in0 = "squareWave";
|
||||
// in_period0 - Period of the square wave
|
||||
TILE1.BOUNDARY.in_period0 = 10000;
|
||||
// in_duty0 - Duty or ON time of the square wave
|
||||
TILE1.BOUNDARY.in_duty0 = 8000;
|
||||
// in_repeat_count0 - Number of periods the waveform is repeated
|
||||
TILE1.BOUNDARY.in_repeat_count0 = 10;
|
||||
// Name
|
||||
TILE1.LUT_0.$name = "LUT_0";
|
||||
// Name
|
||||
TILE1.LUT_1.$name = "LUT_1";
|
||||
// Name
|
||||
TILE1.LUT_2.$name = "LUT_2";
|
||||
// Name
|
||||
TILE1.FSM_0.$name = "FSM_0";
|
||||
// e0 - External Input 0.
|
||||
TILE1.FSM_0.e0 = "COUNTER_0.count_match1";
|
||||
// e1 - External Input 1.
|
||||
TILE1.FSM_0.e1 = "COUNTER_0.count_match2";
|
||||
// eqn_s0 - Boolean equation on the variables e1,e0,s1,s0 for the S0 output.
|
||||
TILE1.FSM_0.eqn_s0 = "(~s0 & e0) | (s0 & ~e1)";
|
||||
// Name
|
||||
TILE1.FSM_1.$name = "FSM_1";
|
||||
// Name
|
||||
TILE1.FSM_2.$name = "FSM_2";
|
||||
// Name
|
||||
TILE1.COUNTER_0.$name = "COUNTER_0";
|
||||
// mode0 - Enables Counting when high
|
||||
TILE1.COUNTER_0.mode0 = "BOUNDARY.in0";
|
||||
// mode1 - Controls counting direction. High enables count up. Low enables count down.
|
||||
TILE1.COUNTER_0.mode1 = "1";
|
||||
// reset - Reset the counter to 0 on next clock cycle (triggers low to high)
|
||||
TILE1.COUNTER_0.reset = "COUNTER_0.count_match2";
|
||||
// match1_val - Sets the value of the Match reference 1 register.
|
||||
TILE1.COUNTER_0.match1_val = "500";
|
||||
// match2_val - Sets the value of the Match reference 2 register.
|
||||
TILE1.COUNTER_0.match2_val = "1000";
|
||||
// Name
|
||||
TILE1.COUNTER_1.$name = "COUNTER_1";
|
||||
// Name
|
||||
TILE1.COUNTER_2.$name = "COUNTER_2";
|
||||
// Name
|
||||
TILE1.OUTLUT_0.$name = "OUTLUT_0";
|
||||
// Name
|
||||
TILE1.OUTLUT_1.$name = "OUTLUT_1";
|
||||
// Name
|
||||
TILE1.OUTLUT_2.$name = "OUTLUT_2";
|
||||
// Name
|
||||
TILE1.OUTLUT_3.$name = "OUTLUT_3";
|
||||
// Name
|
||||
TILE1.OUTLUT_4.$name = "OUTLUT_4";
|
||||
// i0 - Input 0.
|
||||
TILE1.OUTLUT_4.i0 = "FSM_0.S0";
|
||||
// eqn - Boolean equation on the variables i2,i1,i0 for the OUTLUT output.
|
||||
TILE1.OUTLUT_4.eqn = "i0";
|
||||
// Name
|
||||
TILE1.OUTLUT_5.$name = "OUTLUT_5";
|
||||
// i0 - Input 0.
|
||||
TILE1.OUTLUT_5.i0 = "BOUNDARY.in0";
|
||||
// eqn - Boolean equation on the variables i2,i1,i0 for the OUTLUT output.
|
||||
TILE1.OUTLUT_5.eqn = "i0";
|
||||
// Name
|
||||
TILE1.OUTLUT_6.$name = "OUTLUT_6";
|
||||
// Name
|
||||
TILE1.OUTLUT_7.$name = "OUTLUT_7";
|
||||
// Name
|
||||
TILE1.HLC.$name = "HLC_0";
|
||||
// Name
|
||||
TILE1.HLC.program0.$name = "HLCP_0";
|
||||
// Name
|
||||
TILE1.HLC.program1.$name = "HLCP_1";
|
||||
// Name
|
||||
TILE1.HLC.program2.$name = "HLCP_2";
|
||||
// Name
|
||||
TILE1.HLC.program3.$name = "HLCP_3";
|
||||
var clb_run_dynamic_template_clb_h = scripting.addModule("/utilities/clb_tool/clb_syscfg/source/clb_run_dynamic_template_clb_h.js");
|
||||
var clb_run_dynamic_template_clb_c = scripting.addModule("/utilities/clb_tool/clb_syscfg/source/clb_run_dynamic_template_clb_c.js");
|
||||
var clb_run_dynamic_template_clb_sim = scripting.addModule("/utilities/clb_tool/clb_syscfg/source/clb_run_dynamic_template_clb_sim.js");
|
||||
var clb_run_dynamic_template_clb_dot = scripting.addModule("/utilities/clb_tool/clb_syscfg/source/clb_run_dynamic_template_clb_dot.js");
|
||||
// Name
|
||||
TILE2.$name = "TILE2";
|
||||
// Name
|
||||
TILE2.BOUNDARY.$name = "BOUNDARY1";
|
||||
// in0
|
||||
TILE2.BOUNDARY.in0 = "TILE1_BOUNDARY.out4";
|
||||
// in1
|
||||
TILE2.BOUNDARY.in1 = "TILE1_BOUNDARY.out5";
|
||||
// Name
|
||||
TILE2.LUT_0.$name = "LUT_3";
|
||||
// eqn - Boolean equation on the variables i3,i2,i1,i0 for the LUT output.
|
||||
TILE2.LUT_0.eqn = "i0 & i1";
|
||||
// i0 - Input 0.
|
||||
TILE2.LUT_0.i0 = "BOUNDARY.in0";
|
||||
// i1 - Input 1.
|
||||
TILE2.LUT_0.i1 = "BOUNDARY.in1";
|
||||
// Name
|
||||
TILE2.LUT_1.$name = "LUT_4";
|
||||
// i0 - Input 0.
|
||||
TILE2.LUT_1.i0 = "BOUNDARY.in0";
|
||||
// i1 - Input 1.
|
||||
TILE2.LUT_1.i1 = "BOUNDARY.in1";
|
||||
// eqn - Boolean equation on the variables i3,i2,i1,i0 for the LUT output.
|
||||
TILE2.LUT_1.eqn = "~i0 & i1";
|
||||
// Name
|
||||
TILE2.LUT_2.$name = "LUT_5";
|
||||
// i1 - Input 1.
|
||||
TILE2.LUT_2.i1 = "COUNTER_0.count_match1";
|
||||
// i2 - Input 2.
|
||||
TILE2.LUT_2.i2 = "COUNTER_1.count_match1";
|
||||
// i0 - Input 0.
|
||||
TILE2.LUT_2.i0 = "BOUNDARY.in1";
|
||||
// eqn - Boolean equation on the variables i3,i2,i1,i0 for the LUT output.
|
||||
TILE2.LUT_2.eqn = "i0 & (i1 |i2)";
|
||||
// Name
|
||||
TILE2.FSM_0.$name = "FSM_3";
|
||||
// Name
|
||||
TILE2.FSM_1.$name = "FSM_4";
|
||||
// e0 - External Input 0.
|
||||
TILE2.FSM_1.e0 = "LUT_0.OUT";
|
||||
// eqn_s0 - Boolean equation on the variables e1,e0,s1,s0 for the S0 output.
|
||||
TILE2.FSM_1.eqn_s0 = "e0";
|
||||
// eqn_out - Boolean equation on the variables e1,e0,s1,s0 for the LUT output.
|
||||
TILE2.FSM_1.eqn_out = "e0 & ~s0";
|
||||
// Name
|
||||
TILE2.FSM_2.$name = "FSM_5";
|
||||
// Name
|
||||
TILE2.COUNTER_0.$name = "COUNTER_3";
|
||||
// mode0 - Enables Counting when high
|
||||
TILE2.COUNTER_0.mode0 = "LUT_0.OUT";
|
||||
// mode1 - Controls counting direction. High enables count up. Low enables count down.
|
||||
TILE2.COUNTER_0.mode1 = "1";
|
||||
// reset - Reset the counter to 0 on next clock cycle (triggers low to high)
|
||||
TILE2.COUNTER_0.reset = "LUT_1.OUT";
|
||||
// match2_val - Sets the value of the Match reference 2 register.
|
||||
TILE2.COUNTER_0.match2_val = "";
|
||||
// match1_val - Sets the value of the Match reference 1 register.
|
||||
TILE2.COUNTER_0.match1_val = "520";
|
||||
// Name
|
||||
TILE2.COUNTER_1.$name = "COUNTER_4";
|
||||
// mode1 - Controls counting direction. High enables count up. Low enables count down.
|
||||
TILE2.COUNTER_1.mode1 = "1";
|
||||
// reset - Reset the counter to 0 on next clock cycle (triggers low to high)
|
||||
TILE2.COUNTER_1.reset = "FSM_1.OUT";
|
||||
// mode0 - Enables Counting when high
|
||||
TILE2.COUNTER_1.mode0 = "BOUNDARY.in1";
|
||||
// match2_val - Sets the value of the Match reference 2 register.
|
||||
TILE2.COUNTER_1.match2_val = "";
|
||||
// match1_val - Sets the value of the Match reference 1 register.
|
||||
TILE2.COUNTER_1.match1_val = "1020";
|
||||
// Name
|
||||
TILE2.COUNTER_2.$name = "COUNTER_5";
|
||||
// Name
|
||||
TILE2.OUTLUT_0.$name = "OUTLUT_8";
|
||||
// Name
|
||||
TILE2.OUTLUT_1.$name = "OUTLUT_9";
|
||||
// Name
|
||||
TILE2.OUTLUT_2.$name = "OUTLUT_10";
|
||||
// Name
|
||||
TILE2.OUTLUT_3.$name = "OUTLUT_11";
|
||||
// Name
|
||||
TILE2.OUTLUT_4.$name = "OUTLUT_12";
|
||||
// Name
|
||||
TILE2.OUTLUT_5.$name = "OUTLUT_13";
|
||||
// Name
|
||||
TILE2.OUTLUT_6.$name = "OUTLUT_14";
|
||||
// Name
|
||||
TILE2.OUTLUT_7.$name = "OUTLUT_15";
|
||||
// Name
|
||||
TILE2.HLC.$name = "HLC_1";
|
||||
// Event 0 (e0) - Event 0
|
||||
TILE2.HLC.e0 = "LUT_2.OUT";
|
||||
// Name
|
||||
TILE2.HLC.program0.$name = "HLCP_4";
|
||||
// instruct0
|
||||
TILE2.HLC.program0.instruct0 = "INTR 5";
|
||||
// Name
|
||||
TILE2.HLC.program1.$name = "HLCP_5";
|
||||
// Name
|
||||
TILE2.HLC.program2.$name = "HLCP_6";
|
||||
// Name
|
||||
TILE2.HLC.program3.$name = "HLCP_7";
|
||||
|
||||
@@ -0,0 +1,244 @@
|
||||
//#############################################################################
|
||||
//
|
||||
// FILE: clb_ex7_state_machine.c
|
||||
//
|
||||
// TITLE: CLB State Machine.
|
||||
//
|
||||
//! \addtogroup driver_example_list
|
||||
//! <h1>CLB State Machine</h1>
|
||||
//!
|
||||
//! For the detailed description of this example, please refer to:
|
||||
//! C2000Ware_PATH\utilities\clb_tool\clb_syscfg\doc\CLB Tool Users Guide.pdf
|
||||
//!
|
||||
//
|
||||
//
|
||||
//#############################################################################
|
||||
//
|
||||
//
|
||||
// $Copyright:
|
||||
// Copyright (C) 2013-2024 Texas Instruments Incorporated - http://www.ti.com/
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions
|
||||
// are met:
|
||||
//
|
||||
// Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
//
|
||||
// Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
//
|
||||
// Neither the name of Texas Instruments Incorporated nor the names of
|
||||
// its contributors may be used to endorse or promote products derived
|
||||
// from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
// $
|
||||
//#############################################################################
|
||||
|
||||
|
||||
|
||||
#include "driverlib.h"
|
||||
#include "device.h"
|
||||
#include "clb_config.h"
|
||||
#include "clb.h"
|
||||
|
||||
|
||||
#define UPDATE_PWM_COMPLETED_TAG 1
|
||||
#define TRIGGER_PWM_UPDATE_SHIFT 2
|
||||
volatile uint16_t canUpdate = 1;
|
||||
|
||||
volatile uint32_t clbPwmPeriod = 2000;
|
||||
volatile uint32_t clbPwmDuty = 1000;
|
||||
volatile uint16_t clbPwmUpdateNow = 0;
|
||||
|
||||
__interrupt void clb1ISR(void);
|
||||
void updateClbPwm(uint32_t period, uint32_t duty);
|
||||
|
||||
void main(void)
|
||||
{
|
||||
Device_init();
|
||||
Device_initGPIO();
|
||||
|
||||
Interrupt_initModule();
|
||||
Interrupt_initVectorTable();
|
||||
|
||||
Interrupt_register(INT_CLB1, &clb1ISR);
|
||||
Interrupt_enable(INT_CLB1);
|
||||
|
||||
//
|
||||
// Enabling EPWM1 to enable CLB1
|
||||
//
|
||||
SysCtl_enablePeripheral(SYSCTL_PERIPH_CLK_EPWM1);
|
||||
|
||||
CLB_enableCLB(CLB1_BASE);
|
||||
initTILE1(CLB1_BASE);
|
||||
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN0, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN1, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN2, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN3, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN4, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN5, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN6, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN7, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN0, CLB_GLOBAL_IN_MUX_CLB_AUXSIG0);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN1, CLB_GLOBAL_IN_MUX_CLB_AUXSIG1);
|
||||
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN2, CLB_GLOBAL_IN_MUX_EPWM1_CTRDIR);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN3, CLB_GLOBAL_IN_MUX_EPWM1_CTRDIR);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN4, CLB_GLOBAL_IN_MUX_EPWM1_CTRDIR);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN5, CLB_GLOBAL_IN_MUX_EPWM1_CTRDIR);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN6, CLB_GLOBAL_IN_MUX_EPWM1_CTRDIR);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN7, CLB_GLOBAL_IN_MUX_EPWM1_CTRDIR);
|
||||
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN0, CLB_GP_IN_MUX_EXTERNAL);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN1, CLB_GP_IN_MUX_EXTERNAL);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN2, CLB_GP_IN_MUX_GP_REG);
|
||||
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN3, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN4, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN5, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN6, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN7, CLB_GP_IN_MUX_GP_REG);
|
||||
|
||||
|
||||
//
|
||||
// Configure GPIO31 for OUTPUTXBAR8
|
||||
//
|
||||
GPIO_setPinConfig(GPIO_31_OUTPUTXBAR8);
|
||||
GPIO_setDirectionMode(31, GPIO_DIR_MODE_OUT);
|
||||
GPIO_setPadConfig(31, GPIO_PIN_TYPE_STD);
|
||||
|
||||
//
|
||||
// Configure OUTPUT-XBAR OUTPUT8 as CLB1_OUT4
|
||||
//
|
||||
XBAR_setOutputMuxConfig(XBAR_OUTPUT8, XBAR_OUT_MUX01_CLB1_OUT4);
|
||||
XBAR_enableOutputMux(XBAR_OUTPUT8, XBAR_MUX01);
|
||||
|
||||
//
|
||||
// Configure GPIO34 for OUTPUTXBAR1
|
||||
//
|
||||
GPIO_setPinConfig(GPIO_34_OUTPUTXBAR1);
|
||||
GPIO_setDirectionMode(34, GPIO_DIR_MODE_OUT);
|
||||
GPIO_setPadConfig(34, GPIO_PIN_TYPE_STD);
|
||||
|
||||
//
|
||||
// Configure OUTPUT-XBAR OUTPUT1 as CLB1_OUT5
|
||||
//
|
||||
XBAR_setOutputMuxConfig(XBAR_OUTPUT1, XBAR_OUT_MUX03_CLB1_OUT5);
|
||||
XBAR_enableOutputMux(XBAR_OUTPUT1, XBAR_MUX03);
|
||||
|
||||
//
|
||||
// Configure GPIO4 for Button
|
||||
//
|
||||
GPIO_setPinConfig(GPIO_4_GPIO4);
|
||||
GPIO_setDirectionMode(4, GPIO_DIR_MODE_IN);
|
||||
GPIO_setPadConfig(4, GPIO_PIN_TYPE_PULLUP);
|
||||
|
||||
//
|
||||
// Configure Input-XBAR INPUT1 to GPIO4
|
||||
//
|
||||
XBAR_setInputPin(XBAR_INPUT1, 4);
|
||||
|
||||
//
|
||||
// Configure CLB-XBAR AUXSIG0 as INPUT1
|
||||
//
|
||||
XBAR_setCLBMuxConfig(XBAR_AUXSIG0, XBAR_CLB_MUX01_INPUTXBAR1);
|
||||
XBAR_enableCLBMux(XBAR_AUXSIG0, XBAR_MUX01);
|
||||
|
||||
//
|
||||
// Configure GPIO5 for Sensor
|
||||
//
|
||||
GPIO_setPinConfig(GPIO_5_GPIO5);
|
||||
GPIO_setDirectionMode(5, GPIO_DIR_MODE_IN);
|
||||
GPIO_setPadConfig(5, GPIO_PIN_TYPE_PULLUP);
|
||||
|
||||
//
|
||||
// Configure Input-XBAR INPUT2 to GPIO5
|
||||
//
|
||||
XBAR_setInputPin(XBAR_INPUT2, 5);
|
||||
|
||||
//
|
||||
// Configure CLB-XBAR AUXSIG1 as INPUT2
|
||||
//
|
||||
XBAR_setCLBMuxConfig(XBAR_AUXSIG1, XBAR_CLB_MUX03_INPUTXBAR2);
|
||||
XBAR_enableCLBMux(XBAR_AUXSIG1, XBAR_MUX03);
|
||||
|
||||
|
||||
//
|
||||
// Configure GPIO0 for EPWM1A which will be overriden by CLB0_OUT0
|
||||
//
|
||||
GPIO_setPinConfig(GPIO_0_EPWM1A);
|
||||
GPIO_setDirectionMode(0, GPIO_DIR_MODE_OUT);
|
||||
GPIO_setPadConfig(0, GPIO_PIN_TYPE_STD);
|
||||
|
||||
//
|
||||
// Configure GPIO1 for EPWM1B which will be overriden by CLB0_OUT1
|
||||
//
|
||||
GPIO_setPinConfig(GPIO_1_EPWM1B);
|
||||
GPIO_setDirectionMode(1, GPIO_DIR_MODE_OUT);
|
||||
GPIO_setPadConfig(1, GPIO_PIN_TYPE_STD);
|
||||
|
||||
//
|
||||
// Enable Global Interrupt (INTM) and realtime interrupt (DBGM)
|
||||
//
|
||||
EINT;
|
||||
ERTM;
|
||||
|
||||
CLB_setGPREG(CLB1_BASE, 0);
|
||||
CLB_clearInterruptTag(CLB1_BASE);
|
||||
|
||||
CLB_setOutputMask(CLB1_BASE, 1 << 0 | 1 << 2, true);
|
||||
|
||||
|
||||
while(1)
|
||||
{
|
||||
if (clbPwmUpdateNow)
|
||||
{
|
||||
updateClbPwm(clbPwmPeriod, clbPwmDuty);
|
||||
clbPwmUpdateNow = 0;
|
||||
}
|
||||
asm(" NOP");
|
||||
}
|
||||
}
|
||||
|
||||
__interrupt void clb1ISR(void)
|
||||
{
|
||||
uint16_t tag = CLB_getInterruptTag(CLB1_BASE);
|
||||
if (tag == UPDATE_PWM_COMPLETED_TAG)
|
||||
{
|
||||
canUpdate = 1;
|
||||
CLB_setGPREG(CLB1_BASE, 0);
|
||||
}
|
||||
|
||||
CLB_clearInterruptTag(CLB1_BASE);
|
||||
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP5);
|
||||
}
|
||||
|
||||
void updateClbPwm(uint32_t period, uint32_t duty)
|
||||
{
|
||||
if (canUpdate)
|
||||
{
|
||||
canUpdate = 0;
|
||||
CLB_writeInterface(CLB1_BASE, CLB_ADDR_COUNTER_1_LOAD, period);
|
||||
HWREG(CLB1_BASE + CLB_LOGICCTL + CLB_O_BUF_PTR) = 0U;
|
||||
HWREG(CLB1_BASE + CLB_DATAEXCH + CLB_O_PULL(0)) = period;
|
||||
HWREG(CLB1_BASE + CLB_DATAEXCH + CLB_O_PULL(1)) = duty;
|
||||
CLB_setGPREG(CLB1_BASE, 1 << TRIGGER_PWM_UPDATE_SHIFT);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
|
||||
var TILE = scripting.addModule("/utilities/clb_tool/clb_syscfg/source/TILE");
|
||||
var TILE1 = TILE.addInstance();
|
||||
// Name
|
||||
TILE1.$name = "TILE1";
|
||||
// i0 - Input 0.
|
||||
TILE1.LUT_0.i0 = "COUNTER_0.count_match1";
|
||||
// i1 - Input 1.
|
||||
TILE1.LUT_0.i1 = "BOUNDARY.in0";
|
||||
// eqn - Boolean equation on the variables i3,i2,i1,i0 for the LUT output.
|
||||
TILE1.LUT_0.eqn = "i0&i1";
|
||||
// i0 - Input 0.
|
||||
TILE1.LUT_1.i0 = "COUNTER_0.count_match1";
|
||||
// i1 - Input 1.
|
||||
TILE1.LUT_1.i1 = "BOUNDARY.in1";
|
||||
// eqn - Boolean equation on the variables i3,i2,i1,i0 for the LUT output.
|
||||
TILE1.LUT_1.eqn = "i0&i1";
|
||||
// i0 - Input 0.
|
||||
TILE1.LUT_2.i0 = "COUNTER_1.count_zero";
|
||||
// i1 - Input 1.
|
||||
TILE1.LUT_2.i1 = "BOUNDARY.in2";
|
||||
// eqn - Boolean equation on the variables i3,i2,i1,i0 for the LUT output.
|
||||
TILE1.LUT_2.eqn = "i0&i1";
|
||||
// e0 - External Input 0.
|
||||
TILE1.FSM_0.e0 = "COUNTER_1.count_zero";
|
||||
// e1 - External Input 1.
|
||||
TILE1.FSM_0.e1 = "COUNTER_1.count_match1";
|
||||
// eqn_s0 - Boolean equation on the variables e1,e0,s1,s0 for the S0 output.
|
||||
TILE1.FSM_0.eqn_s0 = "(s0 ^ e1)& (!e0)";
|
||||
// e0 - External Input 0.
|
||||
TILE1.FSM_1.e0 = "LUT_0.OUT";
|
||||
// e1 - External Input 1.
|
||||
TILE1.FSM_1.e1 = "LUT_1.OUT";
|
||||
// eqn_s0 - Boolean equation on the variables e1,e0,s1,s0 for the S0 output.
|
||||
TILE1.FSM_1.eqn_s0 = " (!e0&s0) | (e0&e1&!s0) | (!s0&!s1&e0) | (e0&!e1&!s1)";
|
||||
// eqn_s1 - Boolean equation on the variables e1,e0,s1,s0 for the S1 output.
|
||||
TILE1.FSM_1.eqn_s1 = "(s1&!e1) | (s0&s1) | (s0&e1)";
|
||||
// eqn_out - Boolean equation on the variables e1,e0,s1,s0 for the LUT output.
|
||||
TILE1.FSM_1.eqn_out = "(e0&e1) | (!s0&!s1&e0) | (s0&s1&e0)";
|
||||
// e0 - External Input 0.
|
||||
TILE1.FSM_2.e0 = "FSM_1.S0";
|
||||
// e1 - External Input 1.
|
||||
TILE1.FSM_2.e1 = "FSM_1.S1";
|
||||
// eqn_s1 - Boolean equation on the variables e1,e0,s1,s0 for the S1 output.
|
||||
TILE1.FSM_2.eqn_s1 = "(!e0)&e1";
|
||||
// eqn_s0 - Boolean equation on the variables e1,e0,s1,s0 for the S0 output.
|
||||
TILE1.FSM_2.eqn_s0 = "e0&(!e1)";
|
||||
// eqn_out - Boolean equation on the variables e1,e0,s1,s0 for the LUT output.
|
||||
TILE1.FSM_2.eqn_out = "s0 | s1";
|
||||
// mode0 - Enables Counting when high
|
||||
TILE1.COUNTER_0.mode0 = "1";
|
||||
// mode1 - Controls counting direction. High enables count up. Low enables count down.
|
||||
TILE1.COUNTER_0.mode1 = "1";
|
||||
// reset - Reset the counter to 0 on next clock cycle (triggers low to high)
|
||||
TILE1.COUNTER_0.reset = "COUNTER_0.count_match1";
|
||||
// match1_val - Sets the value of the Match reference 1 register.
|
||||
TILE1.COUNTER_0.match1_val = "50000";
|
||||
// event_load_val - Sets the value of the event load value register.
|
||||
TILE1.COUNTER_1.event_load_val = "4000";
|
||||
// What action should be taken on an event trigger?
|
||||
TILE1.COUNTER_1.action = "Load";
|
||||
// match1_val - Sets the value of the Match reference 1 register.
|
||||
TILE1.COUNTER_1.match1_val = "2000";
|
||||
// reset - Reset the counter to 0 on next clock cycle (triggers low to high)
|
||||
TILE1.COUNTER_1.reset = "FSM_1.OUT";
|
||||
// mode0 - Enables Counting when high
|
||||
TILE1.COUNTER_1.mode0 = "FSM_2.OUT";
|
||||
// event - Trigger actions in the counter.
|
||||
TILE1.COUNTER_1.event = "COUNTER_1.count_zero";
|
||||
// i0 - Input 0.
|
||||
TILE1.OUTLUT_0.i0 = "FSM_0.S0";
|
||||
// i1 - Input 1.
|
||||
TILE1.OUTLUT_0.i1 = "FSM_2.S0";
|
||||
// eqn - Boolean equation on the variables i2,i1,i0 for the OUTLUT output.
|
||||
TILE1.OUTLUT_0.eqn = "i0&i1";
|
||||
// i0 - Input 0.
|
||||
TILE1.OUTLUT_2.i0 = "FSM_0.S0";
|
||||
// i1 - Input 1.
|
||||
TILE1.OUTLUT_2.i1 = "FSM_2.S1";
|
||||
// eqn - Boolean equation on the variables i2,i1,i0 for the OUTLUT output.
|
||||
TILE1.OUTLUT_2.eqn = "i0&i1";
|
||||
// i0 - Input 0.
|
||||
TILE1.OUTLUT_4.i0 = "FSM_1.S0";
|
||||
// eqn - Boolean equation on the variables i2,i1,i0 for the OUTLUT output.
|
||||
TILE1.OUTLUT_4.eqn = "!i0";
|
||||
// i0 - Input 0.
|
||||
TILE1.OUTLUT_5.i0 = "FSM_1.S1";
|
||||
// eqn - Boolean equation on the variables i2,i1,i0 for the OUTLUT output.
|
||||
TILE1.OUTLUT_5.eqn = "!i0";
|
||||
// Event 0 (e0) - Event 0
|
||||
TILE1.HLC.e0 = "LUT_2.OUT";
|
||||
// instruct0
|
||||
TILE1.HLC.program0.instruct0 = "PULL C1";
|
||||
// instruct1
|
||||
TILE1.HLC.program0.instruct1 = "PULL R1";
|
||||
// instruct2
|
||||
TILE1.HLC.program0.instruct2 = "MOV_T1 R1,C1";
|
||||
// instruct3
|
||||
TILE1.HLC.program0.instruct3 = "INTR 1";
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
//#############################################################################
|
||||
//
|
||||
// FILE: clb_ex8_external_signal_AND_gate.c
|
||||
//
|
||||
// TITLE: CLB External Signal AND Gate.
|
||||
//
|
||||
//! \addtogroup driver_example_list
|
||||
//! <h1>CLB External Signal AND Gate</h1>
|
||||
//!
|
||||
//! For the detailed description of this example, please refer to:
|
||||
//! C2000Ware_PATH\utilities\clb_tool\clb_syscfg\doc\CLB Tool Users Guide.pdf
|
||||
//!
|
||||
//
|
||||
//
|
||||
//#############################################################################
|
||||
//
|
||||
//
|
||||
// $Copyright:
|
||||
// Copyright (C) 2013-2024 Texas Instruments Incorporated - http://www.ti.com/
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions
|
||||
// are met:
|
||||
//
|
||||
// Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
//
|
||||
// Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
//
|
||||
// Neither the name of Texas Instruments Incorporated nor the names of
|
||||
// its contributors may be used to endorse or promote products derived
|
||||
// from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
// $
|
||||
//#############################################################################
|
||||
|
||||
|
||||
|
||||
#include "driverlib.h"
|
||||
#include "device.h"
|
||||
#include "clb_config.h"
|
||||
#include "clb.h"
|
||||
#include "board.h"
|
||||
|
||||
|
||||
void main(void)
|
||||
{
|
||||
Device_init();
|
||||
Device_initGPIO();
|
||||
|
||||
Interrupt_initModule();
|
||||
Interrupt_initVectorTable();
|
||||
|
||||
//
|
||||
// Enabling EPWM1 to enable CLB1
|
||||
//
|
||||
SysCtl_enablePeripheral(SYSCTL_PERIPH_CLK_EPWM1);
|
||||
|
||||
Board_init();
|
||||
|
||||
initTILE1(myCLBTILE1_BASE);
|
||||
CLB_enableCLB(myCLBTILE1_BASE);
|
||||
|
||||
|
||||
while(1)
|
||||
{
|
||||
|
||||
asm(" NOP");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
|
||||
/**
|
||||
* Import the modules used in this configuration.
|
||||
*/
|
||||
const clb = scripting.addModule("/driverlib/clb.js", {}, false);
|
||||
const clb1 = clb.addInstance();
|
||||
const clbxbar = scripting.addModule("/driverlib/clbxbar.js", {}, false);
|
||||
const clbxbar1 = clbxbar.addInstance();
|
||||
const clbxbar2 = clbxbar.addInstance();
|
||||
const gpio = scripting.addModule("/driverlib/gpio.js", {}, false);
|
||||
const gpio1 = gpio.addInstance();
|
||||
const gpio2 = gpio.addInstance();
|
||||
const inputxbar = scripting.addModule("/driverlib/inputxbar.js", {}, false);
|
||||
const inputxbar1 = inputxbar.addInstance();
|
||||
const outputxbar = scripting.addModule("/driverlib/outputxbar.js", {}, false);
|
||||
const outputxbar1 = outputxbar.addInstance();
|
||||
const TILE = scripting.addModule("/utilities/clb_tool/clb_syscfg/source/TILE");
|
||||
const TILE1 = TILE.addInstance();
|
||||
|
||||
/**
|
||||
* Write custom configuration values to the imported modules.
|
||||
*/
|
||||
clb1.inputsUsed = ["CLB_IN0","CLB_IN1"];
|
||||
clb1.inputTypeCLB_IN0 = "GLOBAL";
|
||||
clb1.globalConfigCLB_IN0 = "CLB_GLOBAL_IN_MUX_CLB_AUXSIG0";
|
||||
clb1.inputTypeCLB_IN1 = "GLOBAL";
|
||||
clb1.globalConfigCLB_IN1 = "CLB_GLOBAL_IN_MUX_CLB_AUXSIG1";
|
||||
clb1.$name = "myCLBTILE1";
|
||||
|
||||
clbxbar1.$name = "myCLBXBAR0";
|
||||
clbxbar1.muxesUsed = ["XBAR_MUX01"];
|
||||
clbxbar1.mux1Config = "XBAR_CLB_MUX01_INPUTXBAR1";
|
||||
|
||||
clbxbar2.$name = "myCLBXBAR1";
|
||||
clbxbar2.auxInput = "XBAR_AUXSIG1";
|
||||
clbxbar2.muxesUsed = ["XBAR_MUX03"];
|
||||
clbxbar2.mux3Config = "XBAR_CLB_MUX03_INPUTXBAR2";
|
||||
|
||||
gpio1.$name = "myGPIO0";
|
||||
gpio1.gpioPin.$assign = "GPIO0";
|
||||
|
||||
gpio2.$name = "myGPIO1";
|
||||
gpio2.gpioPin.$assign = "GPIO1";
|
||||
|
||||
inputxbar1.inputsUsed = ["inputxbar1Gpio","inputxbar2Gpio"];
|
||||
inputxbar1.inputxbar1Gpio = "GPIO0";
|
||||
inputxbar1.inputxbar2Gpio = "GPIO1";
|
||||
inputxbar1.$name = "myINPUTXBAR";
|
||||
|
||||
outputxbar1.$name = "myOUTPUTXBAR1";
|
||||
outputxbar1.muxesUsed = ["XBAR_MUX01"];
|
||||
outputxbar1.mux1Config = "XBAR_OUT_MUX01_CLB1_OUT4";
|
||||
outputxbar1.outputxbar.$name = "MyOUTPUTXBAR1";
|
||||
outputxbar1.outputxbar.$assign = "OUTPUTXBAR1";
|
||||
outputxbar1.outputxbar.outputxbarPin.$assign = "GPIO24";
|
||||
|
||||
TILE.clock_period = 10;
|
||||
TILE.sim_duration = 100000;
|
||||
|
||||
TILE1.$name = "TILE1";
|
||||
TILE1.BOUNDARY.$name = "BOUNDARY0";
|
||||
TILE1.BOUNDARY.in_duty1 = 50;
|
||||
TILE1.BOUNDARY.in_period1 = 100;
|
||||
TILE1.BOUNDARY.in_repeat_count0 = 50;
|
||||
TILE1.BOUNDARY.in_repeat_count3 = 1;
|
||||
TILE1.BOUNDARY.in_repeat_count1 = 1000;
|
||||
TILE1.BOUNDARY.in_duty0 = 20;
|
||||
TILE1.BOUNDARY.in_period0 = 40;
|
||||
TILE1.BOUNDARY.in0 = "squareWave";
|
||||
TILE1.BOUNDARY.in1 = "squareWave";
|
||||
TILE1.LUT_0.$name = "LUT_0";
|
||||
TILE1.LUT_0.i0 = "BOUNDARY.in0";
|
||||
TILE1.LUT_0.i1 = "BOUNDARY.in1";
|
||||
TILE1.LUT_0.eqn = "i0 & i1";
|
||||
TILE1.LUT_1.$name = "LUT_1";
|
||||
TILE1.LUT_2.$name = "LUT_2";
|
||||
TILE1.FSM_0.$name = "FSM_0";
|
||||
TILE1.FSM_1.$name = "FSM_1";
|
||||
TILE1.FSM_2.$name = "FSM_2";
|
||||
TILE1.COUNTER_0.$name = "COUNTER_0";
|
||||
TILE1.COUNTER_1.$name = "COUNTER_1";
|
||||
TILE1.COUNTER_2.$name = "COUNTER_2";
|
||||
TILE1.OUTLUT_0.$name = "OUTLUT_0";
|
||||
TILE1.OUTLUT_1.$name = "OUTLUT_1";
|
||||
TILE1.OUTLUT_2.$name = "OUTLUT_2";
|
||||
TILE1.OUTLUT_3.$name = "OUTLUT_3";
|
||||
TILE1.OUTLUT_4.$name = "OUTLUT_4";
|
||||
TILE1.OUTLUT_4.i0 = "LUT_0.OUT";
|
||||
TILE1.OUTLUT_4.eqn = "i0";
|
||||
TILE1.OUTLUT_5.$name = "OUTLUT_5";
|
||||
TILE1.OUTLUT_6.$name = "OUTLUT_6";
|
||||
TILE1.OUTLUT_7.$name = "OUTLUT_7";
|
||||
TILE1.HLC.$name = "HLC_0";
|
||||
TILE1.HLC.program0.$name = "HLCP_0";
|
||||
TILE1.HLC.program1.$name = "HLCP_1";
|
||||
TILE1.HLC.program2.$name = "HLCP_2";
|
||||
TILE1.HLC.program3.$name = "HLCP_3";
|
||||
@@ -0,0 +1,116 @@
|
||||
//#############################################################################
|
||||
//
|
||||
// FILE: clb_ex9_timer.c
|
||||
//
|
||||
// TITLE: CLB Timer.
|
||||
//
|
||||
//! \addtogroup driver_example_list
|
||||
//! <h1>CLB Timer</h1>
|
||||
//!
|
||||
//! For the detailed description of this example, please refer to:
|
||||
//! C2000Ware_PATH\utilities\clb_tool\clb_syscfg\doc\CLB Tool Users Guide.pdf
|
||||
//!
|
||||
//
|
||||
//
|
||||
//#############################################################################
|
||||
//
|
||||
//
|
||||
// $Copyright:
|
||||
// Copyright (C) 2013-2024 Texas Instruments Incorporated - http://www.ti.com/
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions
|
||||
// are met:
|
||||
//
|
||||
// Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
//
|
||||
// Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
//
|
||||
// Neither the name of Texas Instruments Incorporated nor the names of
|
||||
// its contributors may be used to endorse or promote products derived
|
||||
// from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
// $
|
||||
//#############################################################################
|
||||
|
||||
|
||||
|
||||
#include "driverlib.h"
|
||||
#include "device.h"
|
||||
#include "clb_config.h"
|
||||
#include "clb.h"
|
||||
#include "board.h"
|
||||
|
||||
__interrupt void clb1ISR(void);
|
||||
|
||||
#define RESET_TIMER 1
|
||||
#define ENABLE_TIMER 2
|
||||
#define COUNTUP_MODE 4
|
||||
|
||||
|
||||
void main(void)
|
||||
{
|
||||
Device_init();
|
||||
Device_initGPIO();
|
||||
|
||||
Interrupt_initModule();
|
||||
Interrupt_initVectorTable();
|
||||
|
||||
Interrupt_register(INT_CLB1, &clb1ISR);
|
||||
Interrupt_enable(INT_CLB1);
|
||||
|
||||
//
|
||||
// Enabling EPWM1 to enable CLB1
|
||||
//
|
||||
SysCtl_enablePeripheral(SYSCTL_PERIPH_CLK_EPWM1);
|
||||
|
||||
initTILE1(myTILE1_BASE);
|
||||
Board_init();
|
||||
|
||||
CLB_setGPREG(myTILE1_BASE, ENABLE_TIMER | COUNTUP_MODE);
|
||||
|
||||
//
|
||||
// Enable Global Interrupt (INTM) and realtime interrupt (DBGM)
|
||||
//
|
||||
EINT;
|
||||
ERTM;
|
||||
|
||||
|
||||
CLB_clearInterruptTag(myTILE1_BASE);
|
||||
|
||||
|
||||
while(1)
|
||||
{
|
||||
SysCtl_delay(20000000);
|
||||
// Change Timer Value to 2000
|
||||
CLB_configCounterLoadMatch(myTILE1_BASE, CLB_CTR0, 0, 2000, 0);
|
||||
SysCtl_delay(20000000);
|
||||
// Change Timer Value to 1000
|
||||
CLB_configCounterLoadMatch(myTILE1_BASE, CLB_CTR0, 0, 1000, 0);
|
||||
asm(" NOP");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
__interrupt void clb1ISR(void)
|
||||
{
|
||||
GPIO_togglePin(myGPIO0);
|
||||
CLB_clearInterruptTag(myTILE1_BASE);
|
||||
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP5);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
|
||||
/**
|
||||
* Import the modules used in this configuration.
|
||||
*/
|
||||
const clb = scripting.addModule("/driverlib/clb.js", {}, false);
|
||||
const clb1 = clb.addInstance();
|
||||
const gpio = scripting.addModule("/driverlib/gpio.js", {}, false);
|
||||
const gpio1 = gpio.addInstance();
|
||||
const outputxbar = scripting.addModule("/driverlib/outputxbar.js", {}, false);
|
||||
const outputxbar1 = outputxbar.addInstance();
|
||||
const TILE = scripting.addModule("/utilities/clb_tool/clb_syscfg/source/TILE");
|
||||
const TILE1 = TILE.addInstance();
|
||||
|
||||
/**
|
||||
* Write custom configuration values to the imported modules.
|
||||
*/
|
||||
clb1.$name = "myTILE1";
|
||||
clb1.enableCLB = true;
|
||||
clb1.inputsUsed = ["CLB_IN0","CLB_IN1","CLB_IN2"];
|
||||
|
||||
gpio1.$name = "myGPIO0";
|
||||
gpio1.direction = "GPIO_DIR_MODE_OUT";
|
||||
gpio1.gpioPin.$assign = "GPIO0";
|
||||
|
||||
outputxbar1.$name = "myOUTPUTXBAR1";
|
||||
outputxbar1.muxesUsed = ["XBAR_MUX01"];
|
||||
outputxbar1.mux1Config = "XBAR_OUT_MUX01_CLB1_OUT4";
|
||||
outputxbar1.outputxbar.$name = "MyOUTPUTXBAR1";
|
||||
outputxbar1.outputxbar.$assign = "OUTPUTXBAR1";
|
||||
outputxbar1.outputxbar.outputxbarPin.$assign = "GPIO24";
|
||||
|
||||
TILE.clock_period = 10;
|
||||
TILE.sim_duration = 100000;
|
||||
|
||||
TILE1.$name = "TILE1";
|
||||
TILE1.BOUNDARY.$name = "BOUNDARY0";
|
||||
TILE1.BOUNDARY.in_repeat_count0 = 50;
|
||||
TILE1.BOUNDARY.in_repeat_count3 = 1;
|
||||
TILE1.BOUNDARY.in0 = "squareWave";
|
||||
TILE1.BOUNDARY.in_repeat_count1 = 50;
|
||||
TILE1.BOUNDARY.in_repeat_count2 = 50;
|
||||
TILE1.BOUNDARY.in_period0 = 10000;
|
||||
TILE1.BOUNDARY.in_duty0 = 5001;
|
||||
TILE1.BOUNDARY.in_period1 = 1000;
|
||||
TILE1.BOUNDARY.in_duty1 = 500;
|
||||
TILE1.BOUNDARY.in_period2 = 3000;
|
||||
TILE1.BOUNDARY.in_duty2 = 1500;
|
||||
TILE1.BOUNDARY.in1 = "1";
|
||||
TILE1.BOUNDARY.in2 = "1";
|
||||
TILE1.LUT_0.$name = "LUT_0";
|
||||
TILE1.LUT_1.$name = "LUT_1";
|
||||
TILE1.LUT_2.$name = "LUT_2";
|
||||
TILE1.FSM_0.$name = "FSM_0";
|
||||
TILE1.FSM_1.$name = "FSM_1";
|
||||
TILE1.FSM_2.$name = "FSM_2";
|
||||
TILE1.COUNTER_0.$name = "COUNTER_0";
|
||||
TILE1.COUNTER_0.action = "Load";
|
||||
TILE1.COUNTER_0.reset = "COUNTER_0.count_match1";
|
||||
TILE1.COUNTER_0.event = "BOUNDARY.in0";
|
||||
TILE1.COUNTER_0.mode0 = "BOUNDARY.in1";
|
||||
TILE1.COUNTER_0.mode1 = "BOUNDARY.in2";
|
||||
TILE1.COUNTER_0.match1_val = "1000";
|
||||
TILE1.COUNTER_1.$name = "COUNTER_1";
|
||||
TILE1.COUNTER_2.$name = "COUNTER_2";
|
||||
TILE1.OUTLUT_0.$name = "OUTLUT_0";
|
||||
TILE1.OUTLUT_1.$name = "OUTLUT_1";
|
||||
TILE1.OUTLUT_2.$name = "OUTLUT_2";
|
||||
TILE1.OUTLUT_3.$name = "OUTLUT_3";
|
||||
TILE1.OUTLUT_4.$name = "OUTLUT_4";
|
||||
TILE1.OUTLUT_4.eqn = "i0";
|
||||
TILE1.OUTLUT_4.i0 = "COUNTER_0.count_match1";
|
||||
TILE1.OUTLUT_5.$name = "OUTLUT_5";
|
||||
TILE1.OUTLUT_6.$name = "OUTLUT_6";
|
||||
TILE1.OUTLUT_7.$name = "OUTLUT_7";
|
||||
TILE1.HLC.$name = "HLC_0";
|
||||
TILE1.HLC.e0 = "COUNTER_0.count_match1";
|
||||
TILE1.HLC.program0.$name = "HLCP_0";
|
||||
TILE1.HLC.program0.instruct0 = "INTR 0";
|
||||
TILE1.HLC.program1.$name = "HLCP_1";
|
||||
TILE1.HLC.program2.$name = "HLCP_2";
|
||||
TILE1.HLC.program3.$name = "HLCP_3";
|
||||
@@ -0,0 +1,131 @@
|
||||
//#############################################################################
|
||||
//
|
||||
// FILE: empty.c
|
||||
//
|
||||
// TITLE: CLB Empty Project.
|
||||
//
|
||||
//! \addtogroup driver_example_list
|
||||
//! <h1>CLB Empty Project</h1>
|
||||
//!
|
||||
//! For the detailed description of this example, please refer to:
|
||||
//! C2000Ware_PATH\utilities\clb_tool\clb_syscfg\doc\CLB Tool Users Guide.pdf
|
||||
//!
|
||||
//
|
||||
//
|
||||
//#############################################################################
|
||||
//
|
||||
//
|
||||
// $Copyright:
|
||||
// Copyright (C) 2013-2024 Texas Instruments Incorporated - http://www.ti.com/
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions
|
||||
// are met:
|
||||
//
|
||||
// Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
//
|
||||
// Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
//
|
||||
// Neither the name of Texas Instruments Incorporated nor the names of
|
||||
// its contributors may be used to endorse or promote products derived
|
||||
// from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
// $
|
||||
//#############################################################################
|
||||
|
||||
|
||||
|
||||
#include "driverlib.h"
|
||||
#include "device.h"
|
||||
#include "clb_config.h"
|
||||
#include "clb.h"
|
||||
|
||||
|
||||
|
||||
void main(void)
|
||||
{
|
||||
Device_init();
|
||||
Device_initGPIO();
|
||||
|
||||
Interrupt_initModule();
|
||||
Interrupt_initVectorTable();
|
||||
|
||||
//
|
||||
// Enabling EPWM1 to enable CLB1
|
||||
//
|
||||
SysCtl_enablePeripheral(SYSCTL_PERIPH_CLK_EPWM1);
|
||||
|
||||
CLB_enableCLB(CLB1_BASE);
|
||||
initTILE1(CLB1_BASE);
|
||||
|
||||
//
|
||||
// Select Global input instead of local input for all CLB IN
|
||||
//
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN0, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN1, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN2, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN3, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN4, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN5, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN6, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
CLB_configLocalInputMux(CLB1_BASE, CLB_IN7, CLB_LOCAL_IN_MUX_GLOBAL_IN);
|
||||
|
||||
|
||||
//
|
||||
// Select AUXSIG0 for CLB1, IN0
|
||||
// Select AUXSIG1 for CLB1, IN1
|
||||
//
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN0, CLB_GLOBAL_IN_MUX_CLB_AUXSIG0);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN1, CLB_GLOBAL_IN_MUX_CLB_AUXSIG1);
|
||||
|
||||
//
|
||||
// Unused Inputs below
|
||||
//
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN2, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN3, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN4, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN5, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN6, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
CLB_configGlobalInputMux(CLB1_BASE, CLB_IN7, CLB_GLOBAL_IN_MUX_EPWM1A);
|
||||
|
||||
//
|
||||
// Select External for CLB1, IN0
|
||||
// Select External for CLB1, IN1
|
||||
//
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN0, CLB_GP_IN_MUX_EXTERNAL);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN1, CLB_GP_IN_MUX_EXTERNAL);
|
||||
|
||||
//
|
||||
// Unused inputs to GP register
|
||||
//
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN2, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN3, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN4, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN5, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN6, CLB_GP_IN_MUX_GP_REG);
|
||||
CLB_configGPInputMux(CLB1_BASE, CLB_IN7, CLB_GP_IN_MUX_GP_REG);
|
||||
|
||||
|
||||
|
||||
|
||||
while(1)
|
||||
{
|
||||
|
||||
asm(" NOP");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
|
||||
var TILE = scripting.addModule("/utilities/clb_tool/clb_syscfg/source/TILE");
|
||||
var TILE1 = TILE.addInstance();
|
||||
// Name
|
||||
TILE1.$name = "TILE1";
|
||||
// Name
|
||||
TILE1.BOUNDARY.$name = "BOUNDARY0";
|
||||
// Name
|
||||
TILE1.LUT_0.$name = "LUT_0";
|
||||
// Name
|
||||
TILE1.LUT_1.$name = "LUT_1";
|
||||
// Name
|
||||
TILE1.LUT_2.$name = "LUT_2";
|
||||
// Name
|
||||
TILE1.FSM_0.$name = "FSM_0";
|
||||
// Name
|
||||
TILE1.FSM_1.$name = "FSM_1";
|
||||
// Name
|
||||
TILE1.FSM_2.$name = "FSM_2";
|
||||
// Name
|
||||
TILE1.COUNTER_0.$name = "COUNTER_0";
|
||||
// Name
|
||||
TILE1.COUNTER_1.$name = "COUNTER_1";
|
||||
// Name
|
||||
TILE1.COUNTER_2.$name = "COUNTER_2";
|
||||
// Name
|
||||
TILE1.OUTLUT_0.$name = "OUTLUT_0";
|
||||
// Name
|
||||
TILE1.OUTLUT_1.$name = "OUTLUT_1";
|
||||
// Name
|
||||
TILE1.OUTLUT_2.$name = "OUTLUT_2";
|
||||
// Name
|
||||
TILE1.OUTLUT_3.$name = "OUTLUT_3";
|
||||
// Name
|
||||
TILE1.OUTLUT_4.$name = "OUTLUT_4";
|
||||
// Name
|
||||
TILE1.OUTLUT_5.$name = "OUTLUT_5";
|
||||
// Name
|
||||
TILE1.OUTLUT_6.$name = "OUTLUT_6";
|
||||
// Name
|
||||
TILE1.OUTLUT_7.$name = "OUTLUT_7";
|
||||
// Name
|
||||
TILE1.HLC.$name = "HLC_0";
|
||||
// Name
|
||||
TILE1.HLC.program0.$name = "HLCP_0";
|
||||
// Name
|
||||
TILE1.HLC.program1.$name = "HLCP_1";
|
||||
// Name
|
||||
TILE1.HLC.program2.$name = "HLCP_2";
|
||||
// Name
|
||||
TILE1.HLC.program3.$name = "HLCP_3";
|
||||
var clb_run_dynamic_template_clb_h = scripting.addModule("/utilities/clb_tool/clb_syscfg/source/clb_run_dynamic_template_clb_h.js");
|
||||
var clb_run_dynamic_template_clb_c = scripting.addModule("/utilities/clb_tool/clb_syscfg/source/clb_run_dynamic_template_clb_c.js");
|
||||
var clb_run_dynamic_template_clb_sim = scripting.addModule("/utilities/clb_tool/clb_syscfg/source/clb_run_dynamic_template_clb_sim.js");
|
||||
var clb_run_dynamic_template_clb_dot = scripting.addModule("/utilities/clb_tool/clb_syscfg/source/clb_run_dynamic_template_clb_dot.js");
|
||||
|
||||
Reference in New Issue
Block a user