Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[chip-tool] Add structs_with_cluster_name zap helper instead of relying on a partial and multiple zcl_structs calls #13726

Merged

Conversation

vivien-apple
Copy link
Contributor

Problem

To generate the code for the necessary structs in chip-tool, one needs to uses 2 zcl_structs block, which makes it mandatory to create a partial if you want code to be reused. This is annoying and confusing is you need to create an other class that needs to generate code for structs too, while it can be solved by a simple helper.

Change overview

  • Add structs_with_cluster_name in chip-tool
  • Update generated code

@github-actions
Copy link

github-actions bot commented Jan 19, 2022

PR #13726: Size comparison from ffd25d8 to 63f56c4

Full report (19 builds for efr32, k32w, linux, mbed, p6, qpg, telink)
platform target config section ffd25d8 63f56c4 change % change
efr32 lighting-app BRD4161A (read only) 834836 834836 0 0.0
(read/write) 127636 127636 0 0.0
.bss 125744 125744 0 0.0
.data 1892 1892 0 0.0
.text 834828 834828 0 0.0
BRD4161A+rpc (read only) 822224 822224 0 0.0
(read/write) 144296 144296 0 0.0
.bss 142304 142304 0 0.0
.data 1992 1992 0 0.0
.text 822216 822216 0 0.0
window-app BRD4161A (read only) 805408 805408 0 0.0
(read/write) 126328 126328 0 0.0
.bss 124480 124480 0 0.0
.data 1844 1844 0 0.0
.text 805400 805400 0 0.0
k32w light k32w061+release (read/write) 659060 659060 0 0.0
.bss 77136 77136 0 0.0
.data 1860 1860 0 0.0
.text 574264 574264 0 0.0
lock k32w061+release (read/write) 661792 661792 0 0.0
.bss 77432 77432 0 0.0
.data 1880 1880 0 0.0
.text 576680 576680 0 0.0
linux chip-tool-ipv6only arm64 (read only) 8122444 8122444 0 0.0
(read/write) 374145 374145 0 0.0
.bss 55217 55217 0 0.0
.data 1112 1112 0 0.0
.data.rel.ro 248632 248632 0 0.0
.dynamic 560 560 0 0.0
.got 65488 65488 0 0.0
.init 24 24 0 0.0
.init_array 168 168 0 0.0
.rodata 422212 422212 0 0.0
.text 6902804 6902804 0 0.0
thermostat-no-ble arm64 (read only) 2043580 2043580 0 0.0
(read/write) 145905 145905 0 0.0
.bss 65089 65089 0 0.0
.data 896 896 0 0.0
.data.rel.ro 72952 72952 0 0.0
.dynamic 560 560 0 0.0
.got 4032 4032 0 0.0
.init 24 24 0 0.0
.init_array 304 304 0 0.0
.rodata 129916 129916 0 0.0
.text 1699296 1699296 0 0.0
mbed all-clusters-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2350160 2350160 0 0.0
.bss 189220 189220 0 0.0
.data 5328 5328 0 0.0
.text 1312736 1312736 0 0.0
lighting-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2334424 2334424 0 0.0
.bss 180760 180760 0 0.0
.data 5576 5576 0 0.0
.text 1297024 1297024 0 0.0
lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2304768 2304768 0 0.0
.bss 179768 179768 0 0.0
.data 5552 5552 0 0.0
.text 1267368 1267368 0 0.0
pigweed-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 1139712 1139712 0 0.0
.bss 11756 11756 0 0.0
.data 4368 4368 0 0.0
.text 103096 103096 0 0.0
shell CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2054256 2054256 0 0.0
.bss 156876 156876 0 0.0
.data 4864 4864 0 0.0
.text 1016856 1016856 0 0.0
p6 all-clusters-app default (read/write) 2405536 2405536 0 0.0
.bss 117556 117556 0 0.0
.data 2608 2608 0 0.0
.text 1363800 1363800 0 0.0
light-app default (read/write) 2329976 2329976 0 0.0
.bss 106128 106128 0 0.0
.data 2400 2400 0 0.0
.text 1288240 1288240 0 0.0
lock-app default (read/write) 2299000 2299000 0 0.0
.bss 104976 104976 0 0.0
.data 2352 2352 0 0.0
.text 1257264 1257264 0 0.0
qpg lighting-app qpg6105+debug (read only) 565064 565064 0 0.0
(read/write) 146940 146940 0 0.0
.bss 89960 89960 0 0.0
.data 1056 1056 0 0.0
.text 559744 559744 0 0.0
lock-app qpg6105+debug (read only) 515476 515476 0 0.0
(read/write) 146936 146936 0 0.0
.bss 88584 88584 0 0.0
.data 980 980 0 0.0
.text 510156 510156 0 0.0
persistent-storage-app qpg6105+debug (read only) 106848 106848 0 0.0
(read/write) 146940 146940 0 0.0
.bss 38512 38512 0 0.0
.data 288 288 0 0.0
.text 101528 101528 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 840698 840698 0 0.0
bss 87316 87316 0 0.0
noinit 37160 37160 0 0.0
text 587724 587724 0 0.0

@github-actions
Copy link

github-actions bot commented Jan 20, 2022

PR #13726: Size comparison from 914ba3e to 97a7d58

Full report (21 builds for efr32, esp32, k32w, linux, mbed, p6, qpg, telink)
platform target config section 914ba3e4 97a7d58 change % change
efr32 lighting-app BRD4161A (read only) 832684 832684 0 0.0
(read/write) 127112 127112 0 0.0
.bss 125216 125216 0 0.0
.data 1896 1896 0 0.0
.text 832676 832676 0 0.0
BRD4161A+rpc (read only) 820080 820080 0 0.0
(read/write) 143776 143776 0 0.0
.bss 141776 141776 0 0.0
.data 1996 1996 0 0.0
.text 820072 820072 0 0.0
window-app BRD4161A (read only) 803268 803268 0 0.0
(read/write) 125800 125800 0 0.0
.bss 123952 123952 0 0.0
.data 1848 1848 0 0.0
.text 803260 803260 0 0.0
esp32 all-clusters-app c3devkit (read only) 910524 910524 0 0.0
(read/write) 1315850 1315850 0 0.0
.dram0.bss 70024 70024 0 0.0
.dram0.data 14236 14236 0 0.0
.flash.rodata 178096 178096 0 0.0
.flash.text 910524 910524 0 0.0
.iram0.text 62056 62056 0 0.0
m5stack (read only) 959535 959535 0 0.0
(read/write) 448008 448008 0 0.0
.dram0.bss 74480 74480 0 0.0
.dram0.data 34032 34032 0 0.0
.flash.rodata 207368 207368 0 0.0
.flash.text 954151 954151 0 0.0
.iram0.text 123399 123399 0 0.0
k32w light k32w061+release (read/write) 656696 656696 0 0.0
.bss 76608 76608 0 0.0
.data 1864 1864 0 0.0
.text 572424 572424 0 0.0
lock k32w061+release (read/write) 659400 659400 0 0.0
.bss 76904 76904 0 0.0
.data 1884 1884 0 0.0
.text 574812 574812 0 0.0
linux chip-tool-ipv6only arm64 (read only) 8155868 8155868 0 0.0
(read/write) 376481 376481 0 0.0
.bss 56049 56049 0 0.0
.data 1128 1128 0 0.0
.data.rel.ro 249928 249928 0 0.0
.dynamic 560 560 0 0.0
.got 65632 65632 0 0.0
.init 24 24 0 0.0
.init_array 200 200 0 0.0
.rodata 423044 423044 0 0.0
.text 6928708 6928708 0 0.0
thermostat-no-ble arm64 (read only) 2033476 2033476 0 0.0
(read/write) 144417 144417 0 0.0
.bss 63841 63841 0 0.0
.data 904 904 0 0.0
.data.rel.ro 72704 72704 0 0.0
.dynamic 560 560 0 0.0
.got 4032 4032 0 0.0
.init 24 24 0 0.0
.init_array 304 304 0 0.0
.rodata 129508 129508 0 0.0
.text 1689952 1689952 0 0.0
mbed all-clusters-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2347504 2347504 0 0.0
.bss 188732 188732 0 0.0
.data 5296 5296 0 0.0
.text 1310080 1310080 0 0.0
lighting-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2331768 2331768 0 0.0
.bss 180232 180232 0 0.0
.data 5576 5576 0 0.0
.text 1294368 1294368 0 0.0
lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2302120 2302120 0 0.0
.bss 179240 179240 0 0.0
.data 5552 5552 0 0.0
.text 1264720 1264720 0 0.0
pigweed-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 1139712 1139712 0 0.0
.bss 11756 11756 0 0.0
.data 4368 4368 0 0.0
.text 103096 103096 0 0.0
shell CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2054256 2054256 0 0.0
.bss 156876 156876 0 0.0
.data 4864 4864 0 0.0
.text 1016856 1016856 0 0.0
p6 all-clusters-app default (read/write) 2403648 2403648 0 0.0
.bss 117068 117068 0 0.0
.data 2568 2568 0 0.0
.text 1361912 1361912 0 0.0
light-app default (read/write) 2327768 2327768 0 0.0
.bss 105600 105600 0 0.0
.data 2408 2408 0 0.0
.text 1286032 1286032 0 0.0
lock-app default (read/write) 2296792 2296792 0 0.0
.bss 104448 104448 0 0.0
.data 2352 2352 0 0.0
.text 1255056 1255056 0 0.0
qpg lighting-app qpg6105+debug (read only) 563480 563480 0 0.0
(read/write) 146936 146936 0 0.0
.bss 89696 89696 0 0.0
.data 1060 1060 0 0.0
.text 558160 558160 0 0.0
lock-app qpg6105+debug (read only) 513836 513836 0 0.0
(read/write) 146940 146940 0 0.0
.bss 88320 88320 0 0.0
.data 984 984 0 0.0
.text 508516 508516 0 0.0
persistent-storage-app qpg6105+debug (read only) 106848 106848 0 0.0
(read/write) 146940 146940 0 0.0
.bss 38512 38512 0 0.0
.data 288 288 0 0.0
.text 101528 101528 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 838018 838018 0 0.0
bss 86772 86772 0 0.0
noinit 37160 37160 0 0.0
text 585862 585862 0 0.0

Copy link
Contributor

@woody-apple woody-apple left a comment

Choose a reason for hiding this comment

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

Fast tracking, given tool changes.

@github-actions
Copy link

github-actions bot commented Jan 26, 2022

PR #13726: Size comparison from e45f0a1 to 1f9b668

Full report (32 builds for cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
platform target config section e45f0a1 1f9b668 change % change
cyw30739 light cyw930739m2evb_01 (read/write) 579910 579910 0 0.0
.app_xip_area 484832 484832 0 0.0
.bss 77824 77824 0 0.0
.data 596 596 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
efr32 lighting-app BRD4161A (read only) 842596 842596 0 0.0
(read/write) 127364 127364 0 0.0
.bss 125464 125464 0 0.0
.data 1900 1900 0 0.0
.text 842588 842588 0 0.0
BRD4161A+rpc (read only) 829952 829952 0 0.0
(read/write) 144024 144024 0 0.0
.bss 142024 142024 0 0.0
.data 2000 2000 0 0.0
.text 829944 829944 0 0.0
window-app BRD4161A (read only) 815228 815228 0 0.0
(read/write) 126020 126020 0 0.0
.bss 124164 124164 0 0.0
.data 1856 1856 0 0.0
.text 815220 815220 0 0.0
esp32 all-clusters-app c3devkit (read only) 920846 920846 0 0.0
(read/write) 1384650 1384650 0 0.0
.dram0.bss 70840 70840 0 0.0
.dram0.data 14244 14244 0 0.0
.flash.rodata 180632 180632 0 0.0
.flash.text 920846 920846 0 0.0
.iram0.text 62056 62056 0 0.0
m5stack (read only) 969851 969851 0 0.0
(read/write) 451664 451664 0 0.0
.dram0.bss 75584 75584 0 0.0
.dram0.data 34032 34032 0 0.0
.flash.rodata 209920 209920 0 0.0
.flash.text 964467 964467 0 0.0
.iram0.text 123399 123399 0 0.0
k32w light k32w061+release (read/write) 664700 664700 0 0.0
.bss 77596 77596 0 0.0
.data 1868 1868 0 0.0
.text 579436 579436 0 0.0
lock k32w061+release (read/write) 665696 665696 0 0.0
.bss 77860 77860 0 0.0
.data 1892 1892 0 0.0
.text 580144 580144 0 0.0
linux chip-tool-ipv6only arm64 (read only) 8729252 8729252 0 0.0
(read/write) 392273 392273 0 0.0
.bss 56241 56241 0 0.0
.data 1128 1128 0 0.0
.data.rel.ro 261872 261872 0 0.0
.dynamic 560 560 0 0.0
.got 69280 69280 0 0.0
.init 24 24 0 0.0
.init_array 200 200 0 0.0
.rodata 534252 534252 0 0.0
.text 7353252 7353252 0 0.0
thermostat-no-ble arm64 (read only) 2058404 2058404 0 0.0
(read/write) 147457 147457 0 0.0
.bss 65857 65857 0 0.0
.data 904 904 0 0.0
.data.rel.ro 73624 73624 0 0.0
.dynamic 560 560 0 0.0
.got 4112 4112 0 0.0
.init 24 24 0 0.0
.init_array 320 320 0 0.0
.rodata 131396 131396 0 0.0
.text 1711248 1711248 0 0.0
mbed all-clusters-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2354872 2354872 0 0.0
.bss 189548 189548 0 0.0
.data 5296 5296 0 0.0
.text 1317472 1317472 0 0.0
lighting-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2340864 2340864 0 0.0
.bss 181072 181072 0 0.0
.data 5584 5584 0 0.0
.text 1303464 1303464 0 0.0
lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2307608 2307608 0 0.0
.bss 180968 180968 0 0.0
.data 5568 5568 0 0.0
.text 1270208 1270208 0 0.0
pigweed-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 1139712 1139712 0 0.0
.bss 11756 11756 0 0.0
.data 4368 4368 0 0.0
.text 103096 103096 0 0.0
shell CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2293772 2293772 0 0.0
.bss 177700 177700 0 0.0
.data 5384 5384 0 0.0
.text 1256344 1256344 0 0.0
nrfconnect lighting-app nrf52840dk_nrf52840 (read/write) 983171 983171 0 0.0
bss 120828 120828 0 0.0
rodata 116408 116408 0 0.0
text 668144 668144 0 0.0
nrf52840dk_nrf52840+rpc (read/write) 967031 967031 0 0.0
bss 117872 117872 0 0.0
rodata 107940 107940 0 0.0
text 662816 662816 0 0.0
nrf52840dongle_nrf52840 (read/write) 999355 999355 0 0.0
bss 122000 122000 0 0.0
rodata 115292 115292 0 0.0
text 673604 673604 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 892390 892390 0 0.0
bss 117616 117616 0 0.0
rodata 109704 109704 0 0.0
text 584324 584324 0 0.0
lock-app nrf52840dk_nrf52840 (read/write) 915863 915863 0 0.0
bss 119208 119208 0 0.0
rodata 105076 105076 0 0.0
text 614168 614168 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 825886 825886 0 0.0
bss 116024 116024 0 0.0
rodata 98304 98304 0 0.0
text 531120 531120 0 0.0
pigweed-app nrf52840dk_nrf52840 (read/write) 541835 541835 0 0.0
bss 52588 52588 0 0.0
rodata 50104 50104 0 0.0
text 376940 376940 0 0.0
pump-app nrf52840dk_nrf52840 (read/write) 918523 918523 0 0.0
bss 118952 118952 0 0.0
rodata 105464 105464 0 0.0
text 616632 616632 0 0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 913707 913707 0 0.0
bss 118980 118980 0 0.0
rodata 104568 104568 0 0.0
text 612664 612664 0 0.0
shell nrf52840dk_nrf52840 (read/write) 798219 798219 0 0.0
bss 109776 109776 0 0.0
rodata 78288 78288 0 0.0
text 533648 533648 0 0.0
p6 all-clusters-app default (read/write) 2414704 2414704 0 0.0
.bss 117892 117892 0 0.0
.data 2584 2584 0 0.0
.text 1372968 1372968 0 0.0
light-app default (read/write) 2338168 2338168 0 0.0
.bss 105652 105652 0 0.0
.data 2408 2408 0 0.0
.text 1296432 1296432 0 0.0
lock-app default (read/write) 2303720 2303720 0 0.0
.bss 105396 105396 0 0.0
.data 2360 2360 0 0.0
.text 1261984 1261984 0 0.0
qpg lighting-app qpg6105+debug (read only) 571540 571540 0 0.0
(read/write) 146936 146936 0 0.0
.bss 89808 89808 0 0.0
.data 1060 1060 0 0.0
.text 566220 566220 0 0.0
lock-app qpg6105+debug (read only) 517724 517724 0 0.0
(read/write) 146940 146940 0 0.0
.bss 89280 89280 0 0.0
.data 992 992 0 0.0
.text 512404 512404 0 0.0
persistent-storage-app qpg6105+debug (read only) 107140 107140 0 0.0
(read/write) 146940 146940 0 0.0
.bss 38504 38504 0 0.0
.data 288 288 0 0.0
.text 101820 101820 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 847718 847718 0 0.0
bss 87608 87608 0 0.0
noinit 37160 37160 0 0.0
text 592560 592560 0 0.0

@vivien-apple vivien-apple merged commit 799d195 into project-chip:master Jan 26, 2022
selissia pushed a commit to selissia/connectedhomeip that referenced this pull request Jan 28, 2022
…ng on a partial and multiple zcl_structs calls (project-chip#13726)

* [chip-tool] Add structs_with_cluster_name zap helper instead of relying on a partial and multiple zcl_structs calls

* Update generated code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants