Skip to content

Fix if/else block issues and other issues - #19

Open
a1248924 wants to merge 5 commits into
mainfrom
a1248924_mirror_input_example
Open

a1248924 wants to merge 5 commits into
mainfrom
a1248924_mirror_input_example

Conversation

@a1248924

@a1248924 a1248924 commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@qodo-code-review

qodo-code-review Bot commented Aug 4, 2026 •

Copy link
Copy Markdown

PR Summary by Qodo

Fix PRU conditional fallthrough and add block jump targets

🐞 Bug fix ✨ Enhancement 📝 Documentation ⚙️ Configuration changes 🕐 40+ Minutes

Grey Divider

AI Description

• Validate connected conditional branches and disconnected chains to prevent unintended fallthrough.
• Add addressable block labels, configurable jumps, and simulation reachability warnings.
• Update AI documentation, examples, and MCU+ SDK build settings.
Diagram

graph TD
  Design["SysConfig graph"] --> Validation["Flow validation"] --> Valid{"Paths terminate?"}
  Valid -->|yes| Allocator["Register allocator"] --> Assembly["PRU assembly"] --> Simulation["PRU simulation"]
  Valid -->|no| Errors["Validation errors"]
  Simulation --> Warnings["Reachability warnings"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Generate conditional joins automatically
  • ➕ Avoids requiring users to add Flow Control to every connected branch.
  • ➖ Changes code-generation semantics and complicates explicit loop jumps.
2. Use a shared path-sensitive graph validator
  • ➕ Applies consistent termination rules to nested branches and disconnected chains.
  • ➖ Requires a larger refactor of existing graph and data-dependency traversal.

Recommendation: Explicit Flow Control makes destinations visible and is a reasonable short-term approach. Check that validation rejects every unterminated reachable path—not just paths where no terminator is reachable—and that dropdown entries correspond to emitted labels.

Files changed (108) +4958 / -2189

Enhancement (2) +180 / -88
pru_syscfg.asm.xdtAdjust generated-label formatting +8/-0

Adjust generated-label formatting

• Adds spacing after emitted _end labels in both assembly-generation branches.

.metadata/sysconfig/.meta/pru_blocks/common/pru_syscfg.asm.xdt

flow_control_block.syscfg.jsOffer and validate block jump targets +172/-88

Offer and validate block jump targets

• Adds a Jump To dropdown containing block entries, generated end, and HALT. Derives the opcode and assembly operand from the selected target while retaining a hidden legacy opcode field.

.metadata/sysconfig/.meta/pru_blocks/program_control/flow_control_block.syscfg.js

Bug fix (7) +448 / -254
pru_blocks_static_module.syscfg.jsValidate disconnected chains and warn about unvisited labels +258/-9

Validate disconnected chains and warn about unvisited labels

• Checks disconnected block chains for Flow Control termination. Uses simulation results to warn about block starts not executed in the configured run, and removes getAIContext.

.metadata/sysconfig/.meta/pru_blocks/common/pru_blocks_static_module.syscfg.js

pru_register_allocator.jsEmit addressable block labels and separate loop exits +31/-1

Emit addressable block labels and separate loop exits

• Emits start and applicable end labels around generated block instructions. Adds a NOP after finite loops to separate their exit address from the next block.

.metadata/sysconfig/.meta/pru_blocks/common/register_allocation/pru_register_allocator.js

pru_core.jsTrack visited labels and stop at generated end +14/-3

Track visited labels and stop at generated end

• Stops simulation on jumps to sysconfig_generated_end and returns labels visited during execution.

.metadata/sysconfig/.meta/pru_blocks/common/simulation/pru_core.js

conditional_block.syscfg.jsCheck connected conditional branches for termination +104/-93

Check connected conditional branches for termination

• Traverses T/F chains, nested conditionals, and data consumers to reject branches that cannot reach Flow Control. Updates the description and removes embedded AI guidance.

.metadata/sysconfig/.meta/pru_blocks/program_control/conditional_block.syscfg.js

loop_block.syscfg.jsValidate loop pre-initialization and NOP cycle cost +36/-148

Validate loop pre-initialization and NOP cycle cost

• Rejects pre-initialization names not present in the loop contents and accounts for the finite-loop NOP. Moves AI guidance to docs_ai.

.metadata/sysconfig/.meta/pru_blocks/program_control/loop_block.syscfg.js

main.asmProvide generated-end exit for empty firmware +3/-0

Provide generated-end exit for empty firmware

• Defines sysconfig_generated_end with a halt instruction for the default jump.

examples/empty/firmware/main.asm

main.asmProvide generated-end exit for SPI loopback +2/-0

Provide generated-end exit for SPI loopback

• Defines sysconfig_generated_end with a halt instruction for the default jump.

examples/spi_loopback/firmware/main.asm

Documentation (52) +4224 / -1749
ai.component.jsDirect AI setup to documentation files +1/-1

Direct AI setup to documentation files

• Replaces the getAIContext prerequisite with instructions to read AGENTS.md and relevant docs_ai files.

.metadata/sysconfig/.meta/ai.component.js

crc_block.syscfg.jsMove CRC scripting guidance to docs_ai +2/-82

Move CRC scripting guidance to docs_ai

• Removes embedded AI configuration guidance and points the description to the CRC documentation.

.metadata/sysconfig/.meta/pru_blocks/application_specific/crc_block.syscfg.js

arithmetic_block.syscfg.jsMove arithmetic guidance to docs_ai +2/-90

Move arithmetic guidance to docs_ai

• Removes embedded AI guidance and directs readers to the arithmetic documentation.

.metadata/sysconfig/.meta/pru_blocks/data_handling/arithmetic_block.syscfg.js

bitwise_block.syscfg.jsMove bitwise guidance to docs_ai +2/-108

Move bitwise guidance to docs_ai

• Removes embedded AI guidance and directs readers to the bitwise documentation.

.metadata/sysconfig/.meta/pru_blocks/data_handling/bitwise_block.syscfg.js

load_constant_block.syscfg.jsMove Load Constant guidance to docs_ai +2/-78

Move Load Constant guidance to docs_ai

• Removes embedded AI guidance and directs readers to the Load Constant documentation.

.metadata/sysconfig/.meta/pru_blocks/data_handling/load_constant_block.syscfg.js

group_block.syscfg.jsMove Group guidance to docs_ai +2/-174

Move Group guidance to docs_ai

• Removes embedded AI guidance and points the description to Group documentation.

.metadata/sysconfig/.meta/pru_blocks/program_control/group_block.syscfg.js

pru_gpi_block.syscfg.jsMove GPI guidance to docs_ai +2/-73

Move GPI guidance to docs_ai

• Removes embedded AI guidance and links GPI documentation.

.metadata/sysconfig/.meta/pru_blocks/pru_io_blocks/pru_gpi_block.syscfg.js

pru_gpo_block.syscfg.jsMove GPO guidance to docs_ai +2/-111

Move GPO guidance to docs_ai

• Removes embedded AI guidance and links GPO documentation.

.metadata/sysconfig/.meta/pru_blocks/pru_io_blocks/pru_gpo_block.syscfg.js

pru_spi_read.syscfg.jsMove SPI Read guidance to docs_ai +6/-93

Move SPI Read guidance to docs_ai

• Removes embedded AI guidance and links SPI Read documentation.

.metadata/sysconfig/.meta/pru_blocks/pru_io_blocks/pru_spi_read.syscfg.js

pru_spi_transfer.syscfg.jsMove SPI Transfer guidance to docs_ai +2/-96

Move SPI Transfer guidance to docs_ai

• Removes embedded AI guidance and links SPI Transfer documentation.

.metadata/sysconfig/.meta/pru_blocks/pru_io_blocks/pru_spi_transfer.syscfg.js

pru_spi_write.syscfg.jsMove SPI Write guidance to docs_ai +2/-91

Move SPI Write guidance to docs_ai

• Removes embedded AI guidance and links SPI Write documentation.

.metadata/sysconfig/.meta/pru_blocks/pru_io_blocks/pru_spi_write.syscfg.js

uart_config.syscfg.jsPoint UART Config readers to docs_ai +2/-1

Point UART Config readers to docs_ai

• Adds a link to the dedicated UART Config documentation.

.metadata/sysconfig/.meta/pru_blocks/pru_io_blocks/uart_config.syscfg.js

uart_rx_op.syscfg.jsMove UART RX guidance to docs_ai +2/-87

Move UART RX guidance to docs_ai

• Removes embedded AI guidance and links UART RX documentation.

.metadata/sysconfig/.meta/pru_blocks/pru_io_blocks/uart_rx_op.syscfg.js

uart_tx_op.syscfg.jsMove UART TX guidance to docs_ai +2/-91

Move UART TX guidance to docs_ai

• Removes embedded AI guidance and links UART TX documentation.

.metadata/sysconfig/.meta/pru_blocks/pru_io_blocks/uart_tx_op.syscfg.js

access_look_up_table.syscfg.jsMove access-table guidance to docs_ai +2/-64

Move access-table guidance to docs_ai

• Removes embedded AI guidance and links access lookup-table documentation.

.metadata/sysconfig/.meta/pru_blocks/utils/access_look_up_table.syscfg.js

data_splitter.syscfg.jsPoint Data Splitter readers to docs_ai +2/-1

Point Data Splitter readers to docs_ai

• Adds a link to the dedicated Data Splitter documentation.

.metadata/sysconfig/.meta/pru_blocks/utils/data_splitter.syscfg.js

delay_block.syscfg.jsMove Delay guidance to docs_ai +2/-60

Move Delay guidance to docs_ai

• Removes embedded AI guidance and links Delay documentation.

.metadata/sysconfig/.meta/pru_blocks/utils/delay_block.syscfg.js

label.syscfg.jsMove Label guidance to docs_ai +2/-36

Move Label guidance to docs_ai

• Removes embedded AI guidance and links Label documentation.

.metadata/sysconfig/.meta/pru_blocks/utils/label.syscfg.js

look_up_table.syscfg.jsMove Lookup Table guidance to docs_ai +3/-100

Move Lookup Table guidance to docs_ai

• Removes embedded AI guidance and links Lookup Table documentation.

.metadata/sysconfig/.meta/pru_blocks/utils/look_up_table.syscfg.js

memory_access_block.syscfg.jsMove Memory Access guidance to docs_ai +2/-84

Move Memory Access guidance to docs_ai

• Removes embedded AI guidance and links Memory Access documentation.

.metadata/sysconfig/.meta/pru_blocks/utils/memory_access_block.syscfg.js

memory_variable_block.syscfg.jsMove Memory Variable guidance to docs_ai +2/-77

Move Memory Variable guidance to docs_ai

• Removes embedded AI guidance and links Memory Variable documentation.

.metadata/sysconfig/.meta/pru_blocks/utils/memory_variable_block.syscfg.js

AGENTS.mdRequire file-based documentation in AI workflow +16/-135

Require file-based documentation in AI workflow

• Replaces getAIContext instructions with docs_ai reading instructions and shortens connection-planning examples.

AGENTS.md

README.mdDocument addressable block entries +3/-0

Document addressable block entries

• Adds block _start labels to the generated-label reference and describes their use as Flow Control targets.

README.md

conditional_block.mdExplain conditional branch termination +15/-4

Explain conditional branch termination

• Corrects the assembly example and documents explicit branch termination and loop-specific jump choices.

docs/program-control/conditional_block.md

flow_control_block.mdDocument jump targets and disconnected chains +39/-8

Document jump targets and disconnected chains

• Describes the expanded dropdown, target validation, loop jump patterns, and disconnected-chain errors.

docs/program-control/flow_control_block.md

loop_block.mdDocument loop breaks and continuation +33/-4

Document loop breaks and continuation

• Adds illustrated Flow Control examples, explains the finite-loop exit NOP, and revises cycle guidance.

docs/program-control/loop_block.md

break_using_flow_control_0.pngIllustrate a block following a loop +0/-0

Illustrate a block following a loop

• Adds the first image for the loop-break walkthrough.

docs/images/break_using_flow_control_0.png

break_using_flow_control_1.pngIllustrate a branch breaking from a loop +0/-0

Illustrate a branch breaking from a loop

• Adds the second image for the loop-break walkthrough.

docs/images/break_using_flow_control_1.png

continue_using_flow_control_loop.pngIllustrate loop continuation +0/-0

Illustrate loop continuation

• Adds the image for the infinite-loop continue walkthrough.

docs/images/continue_using_flow_control_loop.png

crc_block.mdAdd AI-facing CRC reference +175/-0

Add AI-facing CRC reference

• Documents CRC behavior, configuration values, and scripting examples.

docs_ai/application_specific/crc_block.md

arithmetic_block.mdAdd AI-facing arithmetic reference +145/-0

Add AI-facing arithmetic reference

• Documents arithmetic operations, configuration, and scripting examples.

docs_ai/data_handling/arithmetic_block.md

bitwise_block.mdAdd AI-facing bitwise reference +176/-0

Add AI-facing bitwise reference

• Documents bitwise operations, configuration, and scripting examples.

docs_ai/data_handling/bitwise_block.md

load_constant_block.mdAdd AI-facing Load Constant reference +118/-0

Add AI-facing Load Constant reference

• Documents constant configuration and scripting examples.

docs_ai/data_handling/load_constant_block.md

conditional_block.mdAdd AI-facing conditional reference +199/-0

Add AI-facing conditional reference

• Documents comparisons, connections, and the connected-branch termination requirement.

docs_ai/program_control/conditional_block.md

flow_control_block.mdAdd AI-facing Flow Control reference +146/-0

Add AI-facing Flow Control reference

• Documents Jump To values, scripting examples, and branch and loop jump patterns.

docs_ai/program_control/flow_control_block.md

group_block.mdAdd AI-facing Group reference +301/-0

Add AI-facing Group reference

• Moves Group behavior and scripting guidance into a dedicated file.

docs_ai/program_control/group_block.md

loop_block.mdAdd AI-facing Loop reference +270/-0

Add AI-facing Loop reference

• Documents finite and infinite loops, pre-initialization, assembly, and scripting examples.

docs_ai/program_control/loop_block.md

pru_gpi_block.mdAdd AI-facing GPI reference +175/-0

Add AI-facing GPI reference

• Documents GPI configuration and scripting usage.

docs_ai/pru_io_blocks/pru_gpi_block.md

pru_gpo_block.mdAdd AI-facing GPO reference +220/-0

Add AI-facing GPO reference

• Documents GPO configuration and scripting usage.

docs_ai/pru_io_blocks/pru_gpo_block.md

pru_spi_read.mdAdd AI-facing SPI Read reference +276/-0

Add AI-facing SPI Read reference

• Documents SPI Read settings and scripting usage.

docs_ai/pru_io_blocks/pru_spi_read.md

pru_spi_transfer.mdAdd AI-facing SPI Transfer reference +254/-0

Add AI-facing SPI Transfer reference

• Documents SPI Transfer settings and scripting usage.

docs_ai/pru_io_blocks/pru_spi_transfer.md

pru_spi_write.mdAdd AI-facing SPI Write reference +243/-0

Add AI-facing SPI Write reference

• Documents SPI Write settings and scripting usage.

docs_ai/pru_io_blocks/pru_spi_write.md

uart_config.mdAdd AI-facing UART Config reference +132/-0

Add AI-facing UART Config reference

• Documents UART configuration settings and scripting usage.

docs_ai/pru_io_blocks/uart_config.md

uart_rx_op.mdAdd AI-facing UART RX reference +138/-0

Add AI-facing UART RX reference

• Documents UART reception settings and scripting usage.

docs_ai/pru_io_blocks/uart_rx_op.md

uart_tx_op.mdAdd AI-facing UART TX reference +147/-0

Add AI-facing UART TX reference

• Documents UART transmission settings and scripting usage.

docs_ai/pru_io_blocks/uart_tx_op.md

access_look_up_table.mdAdd AI-facing access-table reference +92/-0

Add AI-facing access-table reference

• Documents access lookup-table configuration and scripting usage.

docs_ai/utils/access_look_up_table.md

data_splitter.mdAdd AI-facing Data Splitter reference +101/-0

Add AI-facing Data Splitter reference

• Documents Data Splitter configuration and scripting usage.

docs_ai/utils/data_splitter.md

delay_block.mdAdd AI-facing Delay reference +140/-0

Add AI-facing Delay reference

• Documents delay configuration and scripting usage.

docs_ai/utils/delay_block.md

label.mdAdd AI-facing Label reference +44/-0

Add AI-facing Label reference

• Documents the visual-only Label block and its scripting usage.

docs_ai/utils/label.md

look_up_table.mdAdd AI-facing Lookup Table reference +172/-0

Add AI-facing Lookup Table reference

• Documents lookup-table configuration and scripting usage.

docs_ai/utils/look_up_table.md

memory_access_block.mdAdd AI-facing Memory Access reference +218/-0

Add AI-facing Memory Access reference

• Documents memory operations, configuration, and scripting usage.

docs_ai/utils/memory_access_block.md

memory_variable_block.mdAdd AI-facing Memory Variable reference +190/-0

Add AI-facing Memory Variable reference

• Documents memory-variable configuration and scripting usage.

docs_ai/utils/memory_variable_block.md

Other (47) +106 / -98
example.projectspecUse MCU+ SDK project products +1/-1

Use MCU+ SDK project products

• Removes the PRU No-Code Tool product from the R5F project declaration.

examples/conditional/mcuplus/am261x-lp/r5fss0-0_freertos/ti-arm-clang/example.projectspec

makefileAdjust conditional boot-image generation +2/-2

Adjust conditional boot-image generation

• Defaults OTFA configuration to None and passes it to the MCU+ SDK image generator.

examples/conditional/mcuplus/am261x-lp/r5fss0-0_freertos/ti-arm-clang/makefile

makefile_ccs_bootimage_genUse MCU+ SDK build imports +1/-1

Use MCU+ SDK build imports

• Sources MCU+ SDK imports for CCS boot-image generation.

examples/conditional/mcuplus/am261x-lp/r5fss0-0_freertos/ti-arm-clang/makefile_ccs_bootimage_gen

example.syscfgUse default empty-example jump +1/-1

Use default empty-example jump

• Removes the explicit HALT opcode from Flow Control.

examples/empty/firmware/am243x-evm/icss_g0_pru0_fw/example.syscfg

example.syscfgUse default empty-example jump +1/-1

Use default empty-example jump

• Removes the explicit HALT opcode from Flow Control.

examples/empty/firmware/am243x-evm/icss_g0_pru1_fw/example.syscfg

example.syscfgUse default empty-example jump +1/-1

Use default empty-example jump

• Removes the explicit HALT opcode from Flow Control.

examples/empty/firmware/am243x-evm/icss_g0_rtu_pru0_fw/example.syscfg

example.syscfgUse default empty-example jump +1/-1

Use default empty-example jump

• Removes the explicit HALT opcode from Flow Control.

examples/empty/firmware/am243x-evm/icss_g0_rtu_pru1_fw/example.syscfg

example.syscfgUse default empty-example jump +1/-1

Use default empty-example jump

• Removes the explicit HALT opcode from Flow Control.

examples/empty/firmware/am243x-evm/icss_g0_tx_pru0_fw/example.syscfg

example.syscfgUse default empty-example jump +1/-1

Use default empty-example jump

• Removes the explicit HALT opcode from Flow Control.

examples/empty/firmware/am243x-evm/icss_g0_tx_pru1_fw/example.syscfg

example.syscfgUse default empty-example jump +1/-1

Use default empty-example jump

• Removes the explicit HALT opcode from Flow Control.

examples/empty/firmware/am243x-lp/icss_g0_pru0_fw/example.syscfg

example.syscfgUse default empty-example jump +1/-1

Use default empty-example jump

• Removes the explicit HALT opcode from Flow Control.

examples/empty/firmware/am243x-lp/icss_g0_pru1_fw/example.syscfg

example.syscfgUse default empty-example jump +1/-1

Use default empty-example jump

• Removes the explicit HALT opcode from Flow Control.

examples/empty/firmware/am243x-lp/icss_g0_rtu_pru0_fw/example.syscfg

example.syscfgUse default empty-example jump +1/-1

Use default empty-example jump

• Removes the explicit HALT opcode from Flow Control.

examples/empty/firmware/am243x-lp/icss_g0_rtu_pru1_fw/example.syscfg

example.syscfgUse default empty-example jump +1/-1

Use default empty-example jump

• Removes the explicit HALT opcode from Flow Control.

examples/empty/firmware/am243x-lp/icss_g0_tx_pru0_fw/example.syscfg

example.syscfgUse default empty-example jump +1/-1

Use default empty-example jump

• Removes the explicit HALT opcode from Flow Control.

examples/empty/firmware/am243x-lp/icss_g0_tx_pru1_fw/example.syscfg

example.syscfgUse default empty-example jump +1/-1

Use default empty-example jump

• Removes the explicit HALT opcode from Flow Control.

examples/empty/firmware/am261x-lp/icss_m0_pru0_fw/example.syscfg

example.syscfgUse default empty-example jump +1/-1

Use default empty-example jump

• Removes the explicit HALT opcode from Flow Control.

examples/empty/firmware/am261x-lp/icss_m0_pru1_fw/example.syscfg

example.syscfgUse default empty-example jump +1/-1

Use default empty-example jump

• Removes the explicit HALT opcode from Flow Control.

examples/empty/firmware/am261x-lp/icss_m1_pru0_fw/example.syscfg

example.syscfgUse default empty-example jump +1/-1

Use default empty-example jump

• Removes the explicit HALT opcode from Flow Control.

examples/empty/firmware/am261x-lp/icss_m1_pru1_fw/example.syscfg

example.syscfgUse default empty-example jump +1/-1

Use default empty-example jump

• Removes the explicit HALT opcode from Flow Control.

examples/empty/firmware/am64x-evm/icss_g0_pru0_fw/example.syscfg

example.syscfgUse default empty-example jump +1/-1

Use default empty-example jump

• Removes the explicit HALT opcode from Flow Control.

examples/empty/firmware/am64x-evm/icss_g0_pru1_fw/example.syscfg

example.syscfgUse default empty-example jump +1/-1

Use default empty-example jump

• Removes the explicit HALT opcode from Flow Control.

examples/empty/firmware/am64x-evm/icss_g0_rtu_pru0_fw/example.syscfg

example.syscfgUse default empty-example jump +1/-1

Use default empty-example jump

• Removes the explicit HALT opcode from Flow Control.

examples/empty/firmware/am64x-evm/icss_g0_rtu_pru1_fw/example.syscfg

example.syscfgUse default empty-example jump +1/-1

Use default empty-example jump

• Removes the explicit HALT opcode from Flow Control.

examples/empty/firmware/am64x-evm/icss_g0_tx_pru0_fw/example.syscfg

example.syscfgUse default empty-example jump +1/-1

Use default empty-example jump

• Removes the explicit HALT opcode from Flow Control.

examples/empty/firmware/am64x-evm/icss_g0_tx_pru1_fw/example.syscfg

makefileAdjust empty-example boot-image generation +2/-2

Adjust empty-example boot-image generation

• Defaults OTFA configuration to None and passes it to the MCU+ SDK image generator.

examples/empty/mcuplus/am261x-lp/r5fss0-0_freertos/ti-arm-clang/makefile

makefile_ccs_bootimage_genUse MCU+ SDK build imports +1/-1

Use MCU+ SDK build imports

• Sources MCU+ SDK imports for CCS boot-image generation.

examples/empty/mcuplus/am261x-lp/r5fss0-0_freertos/ti-arm-clang/makefile_ccs_bootimage_gen

example.projectspecUse MCU+ SDK project products +1/-1

Use MCU+ SDK project products

• Removes the PRU No-Code Tool product from the R5F project declaration.

examples/gray_encoder_4_bit/mcuplus/am261x-lp/r5fss0-0_freertos/ti-arm-clang/example.projectspec

makefileAdjust encoder boot-image generation +2/-2

Adjust encoder boot-image generation

• Defaults OTFA configuration to None and passes it to the MCU+ SDK image generator.

examples/gray_encoder_4_bit/mcuplus/am261x-lp/r5fss0-0_freertos/ti-arm-clang/makefile

makefile_ccs_bootimage_genUse MCU+ SDK build imports +1/-1

Use MCU+ SDK build imports

• Sources MCU+ SDK imports for CCS boot-image generation.

examples/gray_encoder_4_bit/mcuplus/am261x-lp/r5fss0-0_freertos/ti-arm-clang/makefile_ccs_bootimage_gen

example.syscfgMove incremental-SPI Flow Control inside loop +21/-20

Move incremental-SPI Flow Control inside loop

• Targets the loop from Flow Control and connects it after SPI Write within the loop container; adjusts layout.

examples/incremental_spi/firmware/am243x-lp/icss_g0_pru0_fw/example.syscfg

example.syscfgMove incremental-SPI Flow Control inside loop +6/-5

Move incremental-SPI Flow Control inside loop

• Targets the loop from Flow Control and connects it after SPI Write within the loop container.

examples/incremental_spi/firmware/am261x-lp/icss_m1_pru0_fw/example.syscfg

example.projectspecUse MCU+ SDK project products +1/-1

Use MCU+ SDK project products

• Removes the PRU No-Code Tool product from the R5F project declaration.

examples/incremental_spi/mcuplus/am261x-lp/r5fss0-0_freertos/ti-arm-clang/example.projectspec

makefileAdjust incremental-SPI boot-image generation +2/-2

Adjust incremental-SPI boot-image generation

• Defaults OTFA configuration to None and passes it to the MCU+ SDK image generator.

examples/incremental_spi/mcuplus/am261x-lp/r5fss0-0_freertos/ti-arm-clang/makefile

makefile_ccs_bootimage_genUse MCU+ SDK build imports +1/-1

Use MCU+ SDK build imports

• Sources MCU+ SDK imports for CCS boot-image generation.

examples/incremental_spi/mcuplus/am261x-lp/r5fss0-0_freertos/ti-arm-clang/makefile_ccs_bootimage_gen

makefileRemove deferred SPI example from aggregate build +0/-1

Remove deferred SPI example from aggregate build

• Drops spi_10mhz from the example build list following removal of that example.

examples/makefile

example.syscfgUse default SPI-loopback jump +1/-1

Use default SPI-loopback jump

• Removes the explicit HALT opcode from Flow Control.

examples/spi_loopback/firmware/am243x-lp/icss_g0_pru0_fw/example.syscfg

example.syscfgUse default SPI-loopback jump +1/-1

Use default SPI-loopback jump

• Removes the explicit HALT opcode from Flow Control.

examples/spi_loopback/firmware/am243x-lp/icss_g0_pru1_fw/example.syscfg

example.syscfgUse default SPI-loopback jump +1/-1

Use default SPI-loopback jump

• Removes the explicit HALT opcode from Flow Control.

examples/spi_loopback/firmware/am261x-lp/icss_m1_pru0_fw/example.syscfg

example.syscfgUse default SPI-loopback jump +1/-1

Use default SPI-loopback jump

• Removes the explicit HALT opcode from Flow Control.

examples/spi_loopback/firmware/am261x-lp/icss_m1_pru1_fw/example.syscfg

example.projectspecUse MCU+ SDK project products +1/-1

Use MCU+ SDK project products

• Removes the PRU No-Code Tool product from the R5F project declaration.

examples/spi_loopback/mcuplus/am261x-lp/r5fss0-0_freertos/ti-arm-clang/example.projectspec

makefileAdjust SPI-loopback boot-image generation +2/-2

Adjust SPI-loopback boot-image generation

• Defaults OTFA configuration to None and passes it to the MCU+ SDK image generator.

examples/spi_loopback/mcuplus/am261x-lp/r5fss0-0_freertos/ti-arm-clang/makefile

makefile_ccs_bootimage_genUse MCU+ SDK build imports +1/-1

Use MCU+ SDK build imports

• Sources MCU+ SDK imports for CCS boot-image generation.

examples/spi_loopback/mcuplus/am261x-lp/r5fss0-0_freertos/ti-arm-clang/makefile_ccs_bootimage_gen

example.syscfgTerminate both Tamagawa conditional branches +30/-23

Terminate both Tamagawa conditional branches

• Adds two Flow Control blocks targeting the infinite-loop start to terminate both branches. Removes the false-branch delay and adjusts the graph layout.

examples/tamagawa_single_channel/firmware/am243x-lp/icss_g0_pru1_fw/example.syscfg

example.projectspecUse MCU+ SDK project products +1/-1

Use MCU+ SDK project products

• Removes the PRU No-Code Tool product from the R5F project declaration.

examples/uart_crc/mcuplus/am261x-lp/r5fss0-0_freertos/ti-arm-clang/example.projectspec

makefileAdjust UART-CRC boot-image generation +2/-2

Adjust UART-CRC boot-image generation

• Defaults OTFA configuration to None and passes it to the MCU+ SDK image generator.

examples/uart_crc/mcuplus/am261x-lp/r5fss0-0_freertos/ti-arm-clang/makefile

makefile_ccs_bootimage_genUse MCU+ SDK build imports +1/-1

Use MCU+ SDK build imports

• Sources MCU+ SDK imports for CCS boot-image generation.

examples/uart_crc/mcuplus/am261x-lp/r5fss0-0_freertos/ti-arm-clang/makefile_ccs_bootimage_gen

@qodo-code-review

qodo-code-review Bot commented Aug 4, 2026 •

Copy link
Copy Markdown

Code Review by Qodo


Action required

1. Simulated loop breaks keep iterating 🐞 ⭐
Description
constant1 maps a finite-loop jump target to endloop_N, but the simulator treats a jump arriving
at that label as the end of a normal iteration and sends execution back to the loop body. When Flow
Control uses this target to break out of a finite loop, simulation continues iterating instead of
following the generated assembly past the loop.
Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
A simulated jump to a finite loop's exit label triggers the simulator's ordinary loop-back handler.
## Fix Focus Areas
- .metadata/sysconfig/.meta/pru_blocks/program_control/flow_control_block.syscfg.js[248-263]
- .metadata/sysconfig/.meta/pru_blocks/common/simulation/pru_core.js[1594-1611]
- .metadata/sysconfig/.meta/pru_blocks/common/register_allocation/pru_register_allocator.js[800-804]
## Recommended Fix
Represent a break target distinctly from normal arrival at the hardware loop boundary, or make the simulator recognize a jump to `endloop_N` as an exit. Compare simulated execution with emitted assembly for an early break.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗


View medium (6)
Remediation recommended
2. An isolated branch gets an invalid jump 🐞 ⭐
Description
getValidJumpTargets() offers every conditional instance as a _start destination, even when the
allocator has never processed that instance. An isolated conditional with no branch chain reaching a
processed block can be selected by Flow Control, but its entry label is absent from the emitted
assembly.
Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The target list accepts isolated conditionals for which no `_start` label is emitted.
## Fix Focus Areas
- .metadata/sysconfig/.meta/pru_blocks/program_control/flow_control_block.syscfg.js[65-72]
- .metadata/sysconfig/.meta/pru_blocks/common/register_allocation/pru_register_allocator.js[861-970]
## Recommended Fix
Include conditional targets only when their entry labels are present in the allocator output, or ensure allocation emits every conditional offered as a target. Test a conditional referenced only by a Flow Control jump.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗

3. Jumping to some listed blocks breaks the build 🐞 ⭐
Description
getValidJumpTargets offers <name>_start for every ordinary /pru_blocks/ instance without using
its collected emittedLabels set, while addToPruRegisterAllocationSummary discards zero-cycle
label rows for blocks with an empty opCode. Memory Variable and Look Up Table have empty opcodes,
so selecting either offered target passes validation but generates a JMP operand with no matching
label in the assembly.
Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The Flow Control dropdown and validation offer `<name>_start` for declaration-only blocks whose labels the allocator does not emit, including Memory Variable and Look Up Table. Selecting one generates a jump to a missing symbol.

## Fix Focus Areas
- .metadata/sysconfig/.meta/pru_blocks/program_control/flow_control_block.syscfg.js[13-85]
- .metadata/sysconfig/.meta/pru_blocks/common/register_allocation/pru_register_allocator.js[149-168]

## Recommended Fix
Make `getValidJumpTargets` build and validate targets according to labels the allocator actually emits. Exclude instances with an empty or whitespace-only `opCode` under the allocator's label-emission rule. Remove the unused `emittedLabels` collection, or use it only as a supplementary check that does not depend on stale state. Add a regression check covering Memory Variable and Look Up Table.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗

4. Re-running an If/Else reuses stale inputs 🐞 ⭐
Description
The universal <name>_start label is pushed right before the block's own instruction, after its
input-port predecessors (and, for If/Else, the hoisted shared predecessors) have already been
emitted. A Flow Control jump to If_Else_0_start therefore runs only the QB compare against
registers that are not refreshed and may already have been freed and reused. For example, a
GPI→If/Else poll whose false branch jumps back to If_Else_0_start never re-reads the input and can
spin forever, even though the docs describe this target as re-running the comparison.
Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`<name>_start` is emitted after the block's input predecessors, so jumping to it skips recomputing the inputs. If/Else re-checks then compare stale or reused registers.

## Fix Focus Areas
- .metadata/sysconfig/.meta/pru_blocks/common/register_allocation/pru_register_allocator.js[488-560]
- .metadata/sysconfig/.meta/pru_blocks/common/register_allocation/pru_register_allocator.js[779-789]

## Recommended Fix
Record the summary index once the prev chain has been processed, before hoisting and input processing. Splice the `_start` label in at that index, so jumping to it re-executes the block's input producers. If that is not wanted, document clearly that `_start` re-executes only the block's own instruction, and stop describing it as re-running the comparison.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗

5. Finite loop 'loop start' jumps to loop end 🐞 ⭐
Description
constant1 maps a finite loop’s <Loop>_start selection to endloop_N, even though the dropdown
calls it “loop start” and the allocator emits a real Loop_N_start label between LDI and LOOP. A
jump from inside the loop therefore acts like a continue, while a Flow Control placed after the loop
to re-run it lands at loop termination instead, contrary to the loop documentation and AI examples.
Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Finite-loop Flow Control presents `_start` as a loop-start or re-entry target but generates a jump to `endloop_N`. That target can serve as a continue from inside the loop, not as re-entry from after it, while the emitted `Loop_N_start` label remains untargetable through this selection.

## Fix Focus Areas
- .metadata/sysconfig/.meta/pru_blocks/program_control/flow_control_block.syscfg.js[50-56]
- .metadata/sysconfig/.meta/pru_blocks/program_control/flow_control_block.syscfg.js[244-267]
- docs/program-control/loop_block.md[144]
- docs_ai/program_control/flow_control_block.md[90-112]
- docs_ai/program_control/conditional_block.md[166-180]

## Recommended Fix
Give the finite-loop continue option a distinct value, such as `<name>_continue`, label it “(continue),” and map only that value to `endloop_N`. Either restrict that option to Flow Control blocks inside the loop’s `$groupContents` or also offer the real `Loop_N_start` label for re-running the loop. Update the loop documentation and AI Flow Control and conditional examples to match the resulting targets; if an example needs to illustrate re-entry without a finite-loop re-entry option, use the infinite-loop `startloop_N` target instead.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗

6. Simulator stops repeating outer loop after break 🐞 ⭐
Description
The JMP handler sets pc to the target label but never pops the loopStack frames of loops it
jumps out of, and the loop-back check looks only at the top frame (`pc ===
currentLoop.targetLabel`). After the documented break pattern (Flow Control jumping to the block
after an inner loop), or a continue that targets an outer loop's endloop_N from inside an inner
loop, the inner frame stays on top. The enclosing finite loop's end is then never matched, so the
simulation and waveform show the outer loop running only once.
Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The simulator keeps loop frames on `loopStack` after a JMP exits the loop body, so enclosing loops are no longer matched at their end label.

## Fix Focus Areas
- .metadata/sysconfig/.meta/pru_blocks/common/simulation/pru_core.js[1110-1125]
- .metadata/sysconfig/.meta/pru_blocks/common/simulation/pru_core.js[1594-1610]

## Recommended Fix
In the JMP (and QBA/QB*) handlers, after computing the new pc, pop every top-of-stack frame whose body range `[returnPC, targetLabel)` does not contain the new pc and whose `targetLabel` is not the new pc. Optionally, also have the end-of-instruction check search the stack for a frame whose `targetLabel === pc`.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗

7. Group entry points get false warnings 🐞
Description
The new unreachable-label check warns on every unvisited _start label, including group entry
points. Groups are emitted for explicit calls from application assembly rather than reached from the
simulator’s default entry point, so a normal simulation warns about valid groups.
Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Normal groups produce misleading unreachable-label warnings.
## Fix Focus Areas
- .metadata/sysconfig/.meta/pru_blocks/common/pru_blocks_static_module.syscfg.js[1247-1271]
## Recommended Fix
Identify group entry labels and exclude them from warnings based solely on the default simulation path.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗


View low (1)
Informational
8. Cycle budget misses the loop trampoline NOP 🐞 ⭐
Description
The NOP trampoline added after every finite loop is pushed with cycleConsumed = 0 and is not added
to cycleBudgetMap/peakCycles. The reported peak-cycle budget is therefore one cycle short for
each finite loop in a path, even though the updated loop long description states 'Total = 2 + (100 ×
11) + 1(NOP)'. The two docs also disagree with each other: docs/program-control/loop_block.md gives
the formula without the NOP.
Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The trampoline NOP after finite loops is not counted in the cycle budget, and the docs disagree on whether it is included.

## Fix Focus Areas
- .metadata/sysconfig/.meta/pru_blocks/common/register_allocation/pru_register_allocator.js[640-650]
- .metadata/sysconfig/.meta/pru_blocks/common/register_allocation/pru_register_allocator.js[800-805]
- docs/program-control/loop_block.md[114-121]

## Recommended Fix
In the finite-loop branch, add 1 to `cycleBudgetMap[instanceName]` (next to the loop body budget) to account for the NOP. Update both docs so they use the same formula.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗


@a1248924
a1248924 force-pushed the a1248924_mirror_input_example branch 2 times, most recently from 461a2a3 to a8bf168 Compare August 4, 2026 11:02
@a1248924
a1248924 force-pushed the a1248924_mirror_input_example branch 3 times, most recently from bb486a3 to a69f359 Compare September 20, 2026 12:26
@a1248924 a1248924 linked an issue Sep 20, 2026 that may be closed by this pull request

@pratheesh pratheesh left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this. The Flow Control jump-target work is a good addition. I generated and tested several designs against this head (a69f359) and found some problems I think should be fixed before merge. They're listed most severe first.

How I checked: SysConfig 1.28.0 CLI against the PR-head .metadata/product.json (AM261x_ZFG, icss_m1_pru0), with the generated asm assembled using clpru 2.3.3. I checked loop behaviour on the TI pru-simulator (cycle-accurate hardware-LOOP model) but have not tested it on silicon.

1. <Loop>_end "break" behaves like continue on finite loops

Loop_0_end: is emitted at the same address as endloop_0. A JMP to the LOOP end address triggers the hardware loop-back. I simulated the exact generated asm with a 5-count loop whose branch jumps to Loop_0_end. It still ran the body 5 times and then halted, where a real break would run it once. Infinite loops are fine, because their _end comes after a QBA and no hardware loop is involved.
Suggested fix: place the break target at an address other than endloop_N (for example one instruction past a trampoline), then confirm on silicon.

2. <Loop>_start re-arms the LOOP, so the documented "continue" pattern never terminates

The label sits between LDI and LOOP. The code comment says a jump there "resumes with the current counter value", but that isn't what happens: re-executing LOOP reloads the count from the register. The conditional_block/flow_control docs tell users to end both branches with JMP Loop_0_start. I simulated that pattern with GPI high and got 714 body entries in 5000 steps with no halt. Also, if the counter register gets reallocated inside the body, the count would be garbage.

3. The dropdown offers targets that are never emitted, and validation accepts them

getValidJumpTargets() lists _start/_end for every /pru_blocks/ instance. But addToPruRegisterAllocationSummary drops 0-cycle entries for blocks with an empty opCode (Memory Variable, LUT). A design with jumpTarget = "Mem_Var_start" passes SysConfig validation, and then clpru fails with E0300 undefined symbol Mem_Var_start. The docs say validation prevents exactly this failure. Unconnected blocks, which pushInstruction never visits, are probably affected the same way.

4. Breaking change: legacy Flow Control designs no longer load

opCode is now a getter-only hidden config. On this head, main's examples/empty/.../example.syscfg (which sets opCode = "HALT") fails with Error: cannot set 'opCode' to 'HALT'. The repo examples were migrated by deleting that line, which also changes HALT into JMP sysconfig_generated_end plus a label in main.asm. User designs have no migration path. Could the old setter be accepted and mapped, or could a migration note be added?

5. SPI Data Setup Time units change silently from cycles to ns

Existing designs will get a much shorter setup time: a value of 10 used to mean 10 cycles and now means 10 ns, which is 2 cycles at 200 MHz. CS Setup/Hold were labelled ns but were previously passed through as raw cycles. This PR fixes that bug, but it also changes behaviour (500 used to mean 2.5 µs and now means 500 ns). This needs a release note or migration.

6. The spi_10mhz example contradicts its README

  • The syscfg has SCLK high=16, low=6, but the README says 14/6.
  • PRU0 (the controller) leaves pruClkFreq at its default of 200 while PRU1 sets 225. That gives SCLK = 9.09 MHz at 200 or 10.23 MHz at 225, never 10 MHz.
  • The caption says "1 bit = 10ns" (should be 100 ns).
  • The README block table now says "SPI Transfer up to 7.69 MHz", which contradicts this 10 MHz SPI Transfer example.

7. If_Else_N_start comes after the input computations

The docs say "jump to an If/Else's _start to re-evaluate it". A jump there compares stale registers that may already have been reallocated, and it does not re-read the inputs.

8. branchTerminates ORs paths (from reading the code; not tested)

It accepts a branch if any next/data-consumer path reaches Flow Control, and it treats data-flow edges as control flow. The docstring says every path must reach it.

9. Small defects

  • uart_tx_op: the input port displayName is "output1" (copy-paste error).
  • spi_write docs still say MODE0 needs a minimum High of 2 for 25 MHz, but validation now allows High=1 (7 cycles, 28.57 MHz).
  • mirror_input readme: the title is "SPI Transfer at 10MHz", it says Loop_0_start where the config uses startloop_0, and it references a pin table that doesn't exist.
  • The mirror R5F syscfg still has leftover SPI pinmux entries (PRU1 GPIO5/6/11, PRU0 GPIO2/7/9).
  • The mirror main.c has dead AM64x/AM243x RTU/TX loads in an AM261x-only example.

10. Scope

The title says "mirror input example", but the PR also includes:

  • the Flow Control/label redesign
  • the SPI timing rework
  • an AM261x CI SDK bump from 10.02.00.15 to 26.00.00.06.STS (mcelf boot images and freertos.* libs, which breaks older SDKs; the README doesn't state the new minimum SDK)
  • new ZNC and ZFG_400 device variants

Splitting these into separate PRs would make review and bisecting much easier. The PR description is also empty.


Note: CI is green, but that only shows the shipped examples compile. None of them uses a finite-loop jump or a declaration-block jump target, which is where items 1 to 3 appear. The qodo bot also flagged #4. Its claim that the repo examples still set opCode is out of date at this head.

@a1248924 a1248924 changed the title A1248924 mirror input example Fix if/else block issues and other issues Oct 8, 2026
@a1248924
a1248924 force-pushed the a1248924_mirror_input_example branch from 5a3debf to 84bc91f Compare October 9, 2026 07:48
- add docs_ai
signed-off by Ayushman <a-ayushman@ti.com>
- add option to jump to start of block from flow control
- correct/update documentation for conditional, flow control, loop block
- enforce graph of blocks termination with flow control
- add warning for unreachable blocks
- add details on how to implement break/continue for loop

signed-off by Ayushman <a-ayushman@ti.com>
- update r5f code to use latest sdk
- remove spi_10mhz example, to be added as seperate PR

signed-off by Ayushman <a-ayushman@ti.com>
@a1248924
a1248924 force-pushed the a1248924_mirror_input_example branch from 84bc91f to 763a2fa Compare October 9, 2026 08:32
- update readme

signed-off by Ayushman <a-ayushman@ti.com>
@a1248924
a1248924 force-pushed the a1248924_mirror_input_example branch from 763a2fa to 30dbcaa Compare October 9, 2026 08:39
@a1248924

a1248924 commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator Author

/agentic_review

@pratheesh pratheesh left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update. Several things are clearly better: the Flow Control target list is now filtered to labels that are actually emitted, so the Memory Variable case is rejected in SysConfig instead of failing in the assembler; the If/Else check that every connected branch ends in a Flow Control is a good addition and works on the shipped conditional example; and the scope is much tighter now that the SPI and mirror/10 MHz example changes are out.

A few things still need attention:

  1. Breaking out of a finite loop. Jumping to the start of the block connected after the loop (as the new docs describe) still behaves like a continue. In the generated assembly that block's _start label sits at the same address as endloop_N, so the hardware loop-back still triggers. I simulated a 5-count loop with an If/Else whose true branch clears an output and jumps to the next block's _start: the clear executed 5 times instead of once, and the next block ran only after the fifth pass. Infinite loops are fine. Could the exit target be placed past the loop end (for example one instruction after, or via a small trampoline), ideally with an example or test that breaks out of a finite loop? Worth confirming on hardware too.
  2. Continue in a finite loop. The docs now correctly say that jumping to <Loop>_start re-arms LOOP, but the option is still offered for finite loops without any warning. In simulation a Flow Control that jumps there never terminates. Consider hiding it for finite loops, or warning when it is selected.
  3. Existing designs. Designs saved with opCode = "HALT" still fail to load (cannot set 'opCode' to 'HALT'). A short migration note, or accepting opCode and mapping it to jumpTarget, would avoid breaking saved projects.
  4. New validation false positives. A finite loop that is the last block (no next) is reported as "Disconnected chunk ... missing Flow Control termination" even when its body ends in Flow Controls. The "Unreachable chunk" warnings are based on a single fixed-input simulation, so correct If/Else designs, including the shipped conditional example, show warnings for the branch the simulated input doesn't take. Static reachability, or softer wording, would avoid noise.
  5. Branch termination check. branchTerminates still accepts a branch if any one next/data-consumer path reaches a Flow Control. Requiring every control-flow path (and not counting data-flow edges) would match the comment and the "run both branches" failure it is meant to prevent.
  6. Minor: README and the error text still mention _end targets in the dropdown although they were removed; If_Else_N_start sits after the input computations, so jumping there re-compares stale registers (worth a sentence in the docs); the description is still empty, and the docs_ai/ and AGENTS.md changes might be easier to review as their own PR.

@a1248924

Copy link
Copy Markdown
Collaborator Author

regarding this comment :
5. Branch termination check. branchTerminates still accepts a branch if any one next/data-consumer path reaches a Flow Control. Requiring every control-flow path (and not counting data-flow edges) would match the comment and the "run both branches" failure it is meant to prevent.

lets say we have this block combination:
image

i think we dont expect the user to connect every flow control using next/prev and for if/else blocks specifically the inputs are two for the block and it has only one prev port so the user cannot connect both the branches next to the if/else's prev

that is why for if/else block we have a seperate check that both T/F branch should end in a flow control and it behaves as expected, the check for a chunk of blocks to end in flow control is seperate than this

@a1248924

Copy link
Copy Markdown
Collaborator Author

for the loop block issue not going out and re-entering the loop, i have added a NOP after the loop block
i will check and review once from my side if there is any case in which this is failing or producing incorrect code

@a1248924
a1248924 force-pushed the a1248924_mirror_input_example branch from b6ed027 to c4c3445 Compare October 14, 2026 11:27
@pratheesh-ti

Copy link
Copy Markdown
Collaborator

/agentic_review

Comment thread examples/spi_loopback/firmware/main.asm Resolved
Comment thread docs_ai/utils/look_up_table.md Resolved
… not overlap with endloop

- update documentation
- terminating loop block may not have flow control termimation
- disable jumping to loop_start if using finite loop
- add opCode="HALT" support so that previous designs do not fail
signed-off by  Ayushman <a-ayushman@ti.com>
@a1248924
a1248924 force-pushed the a1248924_mirror_input_example branch from c4c3445 to 2ce605f Compare October 28, 2026 06:51
@a1248924

Copy link
Copy Markdown
Collaborator Author

/agentic_review

@pratheesh pratheesh left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At 2ce605f the NOP after endloop_N fixes the finite-loop break. I generated a design with a Flow Control inside a 10-count loop that jumps to the next block's _start. The target lands one instruction past endloop_N (generated asm only; not simulated or run on hardware). Continue now maps to endloop_N, and the last-block validation and the softer warning wording look fine. The SysConfig sanity tests pass with 0 errors on AM261x and AM64x, both PRUs.

Still needed:

  1. Saved designs that use opCode = "HALT" still fail to load: cannot set 'opCode' to 'HALT'. I reproduced it with the conditional example plus that one line, using SysConfig 1.28.0 CLI (halt.syscfg:37). The commit message says HALT support was added, but the opCode option is hidden behind a getValue override, so it can't be set. Either accept it and map it to jumpTarget, or document the migration.
  2. Add an example or test that breaks out of a finite loop. Nothing covers it yet.
  3. Minor:
    • flow_control_block.syscfg.js:197 still mentions _end targets.
    • The PR description is empty.
    • The docs_ai/AGENTS.md changes would be easier to review in their own PR.

I'm dropping item 5 (branchTerminates accepting any path). Your explanation makes sense.

On your 11-02 note about removing simulation from NoCode now that pru-simulator integration is coming: which way is that going? Several of the validation warnings rely on the built-in simulation, so it changes how they should work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

both true and false conditions executed for if/else block

3 participants