Skip to content

codegen: add S161 for multidimensional input buffer to use array.size#2166

Open
rahur-NI wants to merge 8 commits intoni:masterfrom
rahur-NI:fix-multidim-size-codegen
Open

codegen: add S161 for multidimensional input buffer to use array.size#2166
rahur-NI wants to merge 8 commits intoni:masterfrom
rahur-NI:fix-multidim-size-codegen

Conversation

@rahur-NI
Copy link
Contributor

@rahur-NI rahur-NI commented Feb 25, 2026

  • This contribution adheres to CONTRIBUTING.md.
  • I've updated CHANGELOG.md if applicable.
  • I've added tests applicable for this pull request

What does this Pull Request accomplish?

This PR Includes the S161 size-parameter codegen path for input buffers so multidimensional arrays use total element count .

Before this fix, S160 used len(array_name), which undercounted multidimensional inputs by returning only the first dimension; now it uses array_name.size when array_dimensions > 1.

Updated the documentation for S160 code as well as it supports 1-dimentional and preserves existing len(array_name) behavior for 1D/default inputs.

List issues fixed by this Pull Request below, if any.

What testing has been done?

  • Add a unit test for S161 with array_dimensions > 1 to verify .size is generated.
  • Keep the existing S160 1D test to verify len(...) behavior still works.
  • A successful tox execution

@rahur-NI rahur-NI changed the title codegen: handle S160 multidimensional input size using array.size codegen: add S161 for multidimensional input buffer to use array.size Feb 27, 2026
@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.13%. Comparing base (538fc94) to head (8dae061).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2166      +/-   ##
==========================================
- Coverage   91.15%   90.13%   -1.03%     
==========================================
  Files          67       71       +4     
  Lines       16477    18685    +2208     
==========================================
+ Hits        15020    16841    +1821     
- Misses       1457     1844     +387     
Flag Coverage Δ
codegenunittests 84.90% <100.00%> (+0.02%) ⬆️
nidcpowersystemtests 94.65% <ø> (+0.04%) ⬆️
nidcpowerunittests 89.53% <ø> (ø)
nidigitalsystemtests 92.26% <ø> (ø)
nidigitalunittests 68.44% <ø> (ø)
nidmmsystemtests 92.72% <ø> (ø)
nifakeunittests 85.68% <ø> (ø)
nifgensystemtests 94.61% <ø> (ø)
nimodinstsystemtests 73.85% <ø> (ø)
nimodinstunittests 94.20% <ø> (ø)
nirfsgsystemtests 82.40% <ø> (?)
niscopesystemtests 92.94% <ø> (ø)
niscopeunittests 43.20% <ø> (ø)
nisesystemtests 91.50% <ø> (ø)
niswitchsystemtests 82.03% <ø> (ø)
nitclksystemtests 94.87% <ø> (ø)
nitclkunittests 98.26% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
build/helper/codegen_helper.py 83.87% <100.00%> (+0.15%) ⬆️

... and 5 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 538fc94...8dae061. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

4 participants