)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":1002315,"name":"liangzhen","email":"zhen.liang@spacemit.com","username":"liangzhen"},"change_message_id":"2692e0dcce8dafcce8b8b25ab0460c9727da4413","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"d48cd499_8e5c6be0","updated":"2025-11-20 04:32:03.000000000","message":"Imported from\nhttps://github.com/riscv-collab/riscv-openocd/pull/1243","commit_id":"59a4e60b86d912821b390c424a6b4ee349b9629b"},{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"2c506fe363ebfb78496fe7209411ee6ee5b42a7c","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"8f96b913_9a8f7839","updated":"2026-01-06 09:50:33.000000000","message":"Please remove all periods at the end of sentences from log messages.","commit_id":"877b3a3707dc5e813f69779d0df1b21047a690fa"},{"author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"change_message_id":"8d8d346d42c2716104cd42b868cd5fda2fd3751f","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"95d366c0_98f2b506","updated":"2026-06-10 14:34:43.000000000","message":"Liang Zhen, thanks for your work on this patch.\n\nI believe it still needs some work before it is ready. Please see my comments below.","commit_id":"eba49ecaf88b30bdd8dfcb1e02a5b3ea36a7adf0"},{"author":{"_account_id":1002315,"name":"liangzhen","email":"zhen.liang@spacemit.com","username":"liangzhen"},"change_message_id":"699528ea481a7b09cb70751e23280c017316f31f","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"06b90500_4bfc9af3","in_reply_to":"0d6be21c_2ac836a3","updated":"2026-06-11 11:59:16.000000000","message":"Please ignore this, I forgot that multiple harts under the same DM can create multiple SMP groups.","commit_id":"eba49ecaf88b30bdd8dfcb1e02a5b3ea36a7adf0"},{"author":{"_account_id":1002315,"name":"liangzhen","email":"zhen.liang@spacemit.com","username":"liangzhen"},"change_message_id":"a92b710d1ab7fe1a52a95436f65e054dce80c500","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"f4944274_4cfd955a","in_reply_to":"95d366c0_98f2b506","updated":"2026-06-11 09:34:13.000000000","message":"Jan Matyas, Thank you for reviewing this patch again.\nI have made the corresponding changes. If you have time, please take a look again","commit_id":"eba49ecaf88b30bdd8dfcb1e02a5b3ea36a7adf0"},{"author":{"_account_id":1002315,"name":"liangzhen","email":"zhen.liang@spacemit.com","username":"liangzhen"},"change_message_id":"255de2eb31ae7adaab23f58b433289761607eefb","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"0d6be21c_2ac836a3","in_reply_to":"f4944274_4cfd955a","updated":"2026-06-11 10:47:52.000000000","message":"Also, do you think it\u0027s necessary to set the hat group of dmexttrigger 0 to the target -\u003esmp value by default, like Hart did.\n```\n@@ -2012,6 +2012,17 @@ static int examine_dm(struct target *target)\n                return ERROR_FAIL;\n        }\n\n+        if (target-\u003esmp) {\n+                if (set_dmexttrigger_group(target, \u0026dm-\u003ehaltgroup_supported, 0, HALT_GROUP, target-\u003esmp) !\u003d ERROR_OK)\n+                        return ERROR_FAIL;\n+\n+                if (info-\u003ehaltgroup_supported)\n+                        LOG_TARGET_INFO(target, \"DM external trigger 0 made part of halt group %d.\", target-\u003esmp);\n+                else\n+                        LOG_TARGET_INFO(target, \"DM external trigger 0 could not be made part of halt group %d.\",\n+                                        target-\u003esmp);\n+        }\n+\n        dm-\u003ewas_examined \u003d true;\n        return ERROR_OK;\n }\n\n```","commit_id":"eba49ecaf88b30bdd8dfcb1e02a5b3ea36a7adf0"},{"author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"change_message_id":"bd73c960cae321fbe01ed087b71b3ed3e1d1b76b","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":5,"id":"01cf7de4_eef59553","updated":"2026-06-11 13:42:07.000000000","message":"Overall, this looks good. Thank you for addressing my previous comments.\n\nI have few last suggestions and don\u0027t expect to have any more comments afterwards.","commit_id":"013ff9eb5588ae6fea820742bd0172c16476d747"},{"author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"change_message_id":"3fced48e8bc910fb40b80923e29e84943a11668a","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":6,"id":"af0c1a21_6cedab92","updated":"2026-06-15 12:56:26.000000000","message":"LGTM - thank you.","commit_id":"a49b32229bb6f09782e1af1a89e2326117148e01"}],"doc/openocd.texi":[{"author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"change_message_id":"8d8d346d42c2716104cd42b868cd5fda2fd3751f","unresolved":true,"context_lines":[{"line_number":11954,"context_line":"With no parameters, prints current trigger features configuration."},{"line_number":11955,"context_line":"@end deffn"},{"line_number":11956,"context_line":""},{"line_number":11957,"context_line":"@deffn {Command} {riscv set_group} \u003c@option{halt_group}|@option{resume_group}\u003e group [\u0027trigger\u0027 triggernum]"},{"line_number":11958,"context_line":"OpenOCD assigns a hart or a given external trigger into a RISC-V halt/resume group."},{"line_number":11959,"context_line":"This command associates current target or supplied external trigger(s) with this halt/resume group."},{"line_number":11960,"context_line":""}],"source_content_type":"text/x-texinfo","patch_set":3,"id":"ea572963_95d556bb","line":11957,"updated":"2026-06-10 14:34:43.000000000","message":"I would strongly prefer to split the command into two.\n\nIn the current state, if the optional `trigger trigger_num` arguments are appended, users may very well think that the command will do some extra work on top of what it would do normally, which is not true.\n\nFor that reason, I propose these two commands instead:\n\n```\nriscv set_target_group \u003chalt_group|resume_group\u003e group_number\n\nriscv set_ext_trigger_group trigger_num \u003chalt_group|resume_group\u003e group_number\n```\n\nThis way it will be clearer what each command is doing and also the syntax will be simpler (no optional arguments).\n\n----\n\nFor future (no change needed now): \n\nThe external trigger number command should be applied to an instance of a debug module, not to a target (hart).","commit_id":"eba49ecaf88b30bdd8dfcb1e02a5b3ea36a7adf0"},{"author":{"_account_id":1002315,"name":"liangzhen","email":"zhen.liang@spacemit.com","username":"liangzhen"},"change_message_id":"a92b710d1ab7fe1a52a95436f65e054dce80c500","unresolved":false,"context_lines":[{"line_number":11954,"context_line":"With no parameters, prints current trigger features configuration."},{"line_number":11955,"context_line":"@end deffn"},{"line_number":11956,"context_line":""},{"line_number":11957,"context_line":"@deffn {Command} {riscv set_group} \u003c@option{halt_group}|@option{resume_group}\u003e group [\u0027trigger\u0027 triggernum]"},{"line_number":11958,"context_line":"OpenOCD assigns a hart or a given external trigger into a RISC-V halt/resume group."},{"line_number":11959,"context_line":"This command associates current target or supplied external trigger(s) with this halt/resume group."},{"line_number":11960,"context_line":""}],"source_content_type":"text/x-texinfo","patch_set":3,"id":"b4f8d25b_d9c625d3","line":11957,"in_reply_to":"ea572963_95d556bb","updated":"2026-06-11 09:34:13.000000000","message":"Done","commit_id":"eba49ecaf88b30bdd8dfcb1e02a5b3ea36a7adf0"},{"author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"change_message_id":"8d8d346d42c2716104cd42b868cd5fda2fd3751f","unresolved":true,"context_lines":[{"line_number":11960,"context_line":""},{"line_number":11961,"context_line":"@option{trigger} and @var{triggernum} Specify the index of the external trigger."},{"line_number":11962,"context_line":"When an external input trigger fires, the harts in the halt/resume group will get halted/resume."},{"line_number":11963,"context_line":"Similarly, all external output triggers will be notified when a hart in the halt/resume group halts/resumes."},{"line_number":11964,"context_line":""},{"line_number":11965,"context_line":"The only supported value of @var{grouptype} is @option{halt_group}. RISC-V resume groups"},{"line_number":11966,"context_line":"are not allowed because the concept of a target resuming due to a different reason than"}],"source_content_type":"text/x-texinfo","patch_set":3,"id":"0331a2d7_6cca0d0e","line":11963,"updated":"2026-06-10 14:34:43.000000000","message":"Users may wonder how to remove hart/trigger from a group because there is no command like `clear_group`. So consider mentioning that group 0 means \"not member of any group\".","commit_id":"eba49ecaf88b30bdd8dfcb1e02a5b3ea36a7adf0"},{"author":{"_account_id":1002315,"name":"liangzhen","email":"zhen.liang@spacemit.com","username":"liangzhen"},"change_message_id":"a92b710d1ab7fe1a52a95436f65e054dce80c500","unresolved":false,"context_lines":[{"line_number":11960,"context_line":""},{"line_number":11961,"context_line":"@option{trigger} and @var{triggernum} Specify the index of the external trigger."},{"line_number":11962,"context_line":"When an external input trigger fires, the harts in the halt/resume group will get halted/resume."},{"line_number":11963,"context_line":"Similarly, all external output triggers will be notified when a hart in the halt/resume group halts/resumes."},{"line_number":11964,"context_line":""},{"line_number":11965,"context_line":"The only supported value of @var{grouptype} is @option{halt_group}. RISC-V resume groups"},{"line_number":11966,"context_line":"are not allowed because the concept of a target resuming due to a different reason than"}],"source_content_type":"text/x-texinfo","patch_set":3,"id":"47195704_e2d38362","line":11963,"in_reply_to":"0331a2d7_6cca0d0e","updated":"2026-06-11 09:34:13.000000000","message":"Done","commit_id":"eba49ecaf88b30bdd8dfcb1e02a5b3ea36a7adf0"},{"author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"change_message_id":"8d8d346d42c2716104cd42b868cd5fda2fd3751f","unresolved":true,"context_lines":[{"line_number":11966,"context_line":"are not allowed because the concept of a target resuming due to a different reason than"},{"line_number":11967,"context_line":"user\u0027s resume request is not supported by OpenOCD and GDB. Allowing @var{grouptype} to"},{"line_number":11968,"context_line":"be set to @option{resume_group} might be useful for hardware testing, but OpenOCD will"},{"line_number":11969,"context_line":"report a warning."},{"line_number":11970,"context_line":"@end deffn"},{"line_number":11971,"context_line":""},{"line_number":11972,"context_line":""}],"source_content_type":"text/x-texinfo","patch_set":3,"id":"965a16ee_99eabf27","line":11969,"updated":"2026-06-10 14:34:43.000000000","message":"I am afraid this paragraph contains contradictory statements:\n\n- \"The only supported value of grouptype is halt_group\"\n- \"Allowing @var{grouptype} to be set to @option{resume_group} might be useful for hardware testing, but OpenOCD will report a warning.\"\n\nAs a reader I am very confused: is \"resume_group\" allowed or not?\n\nI think you wanted to say: both \"halt_group\" and \"resume_group\" are allowed, but the latter may cause problems and should only be used in special cases like testing. \n\nIs that correct understanding?\n\nPlease, rewrite the paragraph as needed to make it very clear.","commit_id":"eba49ecaf88b30bdd8dfcb1e02a5b3ea36a7adf0"},{"author":{"_account_id":1002315,"name":"liangzhen","email":"zhen.liang@spacemit.com","username":"liangzhen"},"change_message_id":"a92b710d1ab7fe1a52a95436f65e054dce80c500","unresolved":false,"context_lines":[{"line_number":11966,"context_line":"are not allowed because the concept of a target resuming due to a different reason than"},{"line_number":11967,"context_line":"user\u0027s resume request is not supported by OpenOCD and GDB. Allowing @var{grouptype} to"},{"line_number":11968,"context_line":"be set to @option{resume_group} might be useful for hardware testing, but OpenOCD will"},{"line_number":11969,"context_line":"report a warning."},{"line_number":11970,"context_line":"@end deffn"},{"line_number":11971,"context_line":""},{"line_number":11972,"context_line":""}],"source_content_type":"text/x-texinfo","patch_set":3,"id":"01e62761_48c88abb","line":11969,"in_reply_to":"965a16ee_99eabf27","updated":"2026-06-11 09:34:13.000000000","message":"Done","commit_id":"eba49ecaf88b30bdd8dfcb1e02a5b3ea36a7adf0"},{"author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"change_message_id":"8d8d346d42c2716104cd42b868cd5fda2fd3751f","unresolved":true,"context_lines":[{"line_number":11967,"context_line":"user\u0027s resume request is not supported by OpenOCD and GDB. Allowing @var{grouptype} to"},{"line_number":11968,"context_line":"be set to @option{resume_group} might be useful for hardware testing, but OpenOCD will"},{"line_number":11969,"context_line":"report a warning."},{"line_number":11970,"context_line":"@end deffn"},{"line_number":11971,"context_line":""},{"line_number":11972,"context_line":""},{"line_number":11973,"context_line":"@subsection RISC-V Authentication Commands"}],"source_content_type":"text/x-texinfo","patch_set":3,"id":"b6840ffb_0109a713","line":11970,"updated":"2026-06-10 14:34:43.000000000","message":"For future - separate patch:\n\nWhen we have setters for the hart/ext. trigger groups, it would only be logical to implement getters, too:\n\n```\nriscv get_target_group \u003chalt_group|resume_group\u003e\nriscv get_ext_trigger_group trigger_num \u003chalt_group|resume_group\u003e\n```\n\nRemember that the RISC-V debug spec explicitly permits that the harts can be in  different halt/resume groups than 0 after reset. So would be is useful to have a means to discover the current groups assignments, not only change them.","commit_id":"eba49ecaf88b30bdd8dfcb1e02a5b3ea36a7adf0"},{"author":{"_account_id":1002315,"name":"liangzhen","email":"zhen.liang@spacemit.com","username":"liangzhen"},"change_message_id":"a92b710d1ab7fe1a52a95436f65e054dce80c500","unresolved":false,"context_lines":[{"line_number":11967,"context_line":"user\u0027s resume request is not supported by OpenOCD and GDB. Allowing @var{grouptype} to"},{"line_number":11968,"context_line":"be set to @option{resume_group} might be useful for hardware testing, but OpenOCD will"},{"line_number":11969,"context_line":"report a warning."},{"line_number":11970,"context_line":"@end deffn"},{"line_number":11971,"context_line":""},{"line_number":11972,"context_line":""},{"line_number":11973,"context_line":"@subsection RISC-V Authentication Commands"}],"source_content_type":"text/x-texinfo","patch_set":3,"id":"2e8151e6_23cc8772","line":11970,"in_reply_to":"b6840ffb_0109a713","updated":"2026-06-11 09:34:13.000000000","message":"After this patch is merged, I can add them","commit_id":"eba49ecaf88b30bdd8dfcb1e02a5b3ea36a7adf0"},{"author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"change_message_id":"bd73c960cae321fbe01ed087b71b3ed3e1d1b76b","unresolved":true,"context_lines":[{"line_number":11990,"context_line":"Assign the current hart into a RISC-V halt/resume group."},{"line_number":11991,"context_line":"@var{group_num} is a number in range 0..31."},{"line_number":11992,"context_line":"Setting @var{group_num} to 0 effectively removes the hart from any group,"},{"line_number":11993,"context_line":"as group 0 is the default and means \"not a member of any group\"."},{"line_number":11994,"context_line":""},{"line_number":11995,"context_line":"The only well-supported grouptype is @option{halt_group}."},{"line_number":11996,"context_line":"While @option{resume_group} is accepted, it should only be used for hardware testing"}],"source_content_type":"text/x-texinfo","patch_set":5,"id":"9ff4021f_3e7d2773","line":11993,"updated":"2026-06-11 13:42:07.000000000","message":"I think we should not write that \"group 0 is the default\". The RISC-V debug spec says in [1]: \"Some designs may choose to hardcode hart groups to a group other than group 0\".\n\nI think you can just update the sentence to: `... as group 0 means \"not a member of any group\"`.\n\n[1] https://docs.riscv.org/reference/debug/debug_module.html#hrgroups","commit_id":"013ff9eb5588ae6fea820742bd0172c16476d747"},{"author":{"_account_id":1002315,"name":"liangzhen","email":"zhen.liang@spacemit.com","username":"liangzhen"},"change_message_id":"60c83d5f56e0508e81b6ce84423b1392dfbb8bf5","unresolved":false,"context_lines":[{"line_number":11990,"context_line":"Assign the current hart into a RISC-V halt/resume group."},{"line_number":11991,"context_line":"@var{group_num} is a number in range 0..31."},{"line_number":11992,"context_line":"Setting @var{group_num} to 0 effectively removes the hart from any group,"},{"line_number":11993,"context_line":"as group 0 is the default and means \"not a member of any group\"."},{"line_number":11994,"context_line":""},{"line_number":11995,"context_line":"The only well-supported grouptype is @option{halt_group}."},{"line_number":11996,"context_line":"While @option{resume_group} is accepted, it should only be used for hardware testing"}],"source_content_type":"text/x-texinfo","patch_set":5,"id":"97e7277e_e293c8c5","line":11993,"in_reply_to":"9ff4021f_3e7d2773","updated":"2026-06-11 15:09:55.000000000","message":"Done","commit_id":"013ff9eb5588ae6fea820742bd0172c16476d747"},{"author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"change_message_id":"bd73c960cae321fbe01ed087b71b3ed3e1d1b76b","unresolved":false,"context_lines":[{"line_number":11992,"context_line":"Setting @var{group_num} to 0 effectively removes the hart from any group,"},{"line_number":11993,"context_line":"as group 0 is the default and means \"not a member of any group\"."},{"line_number":11994,"context_line":""},{"line_number":11995,"context_line":"The only well-supported grouptype is @option{halt_group}."},{"line_number":11996,"context_line":"While @option{resume_group} is accepted, it should only be used for hardware testing"},{"line_number":11997,"context_line":"or special cases. Neither OpenOCD nor GDB support the concept of a hart resuming"},{"line_number":11998,"context_line":"on its own due to an external event, so using resume groups may lead to unexpected behavior."}],"source_content_type":"text/x-texinfo","patch_set":5,"id":"b82f7d4c_6432eaa4","line":11995,"updated":"2026-06-11 13:42:07.000000000","message":"Now the paragraph about \"resume_group\" looks very clear to me. Thanks for rephrasing it.","commit_id":"013ff9eb5588ae6fea820742bd0172c16476d747"},{"author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"change_message_id":"bd73c960cae321fbe01ed087b71b3ed3e1d1b76b","unresolved":true,"context_lines":[{"line_number":11992,"context_line":"Setting @var{group_num} to 0 effectively removes the hart from any group,"},{"line_number":11993,"context_line":"as group 0 is the default and means \"not a member of any group\"."},{"line_number":11994,"context_line":""},{"line_number":11995,"context_line":"The only well-supported grouptype is @option{halt_group}."},{"line_number":11996,"context_line":"While @option{resume_group} is accepted, it should only be used for hardware testing"},{"line_number":11997,"context_line":"or special cases. Neither OpenOCD nor GDB support the concept of a hart resuming"},{"line_number":11998,"context_line":"on its own due to an external event, so using resume groups may lead to unexpected behavior."}],"source_content_type":"text/x-texinfo","patch_set":5,"id":"f6606748_bea242b4","line":11995,"updated":"2026-06-11 13:42:07.000000000","message":"`grouptype` --\u003e `group type`","commit_id":"013ff9eb5588ae6fea820742bd0172c16476d747"},{"author":{"_account_id":1002315,"name":"liangzhen","email":"zhen.liang@spacemit.com","username":"liangzhen"},"change_message_id":"60c83d5f56e0508e81b6ce84423b1392dfbb8bf5","unresolved":false,"context_lines":[{"line_number":11992,"context_line":"Setting @var{group_num} to 0 effectively removes the hart from any group,"},{"line_number":11993,"context_line":"as group 0 is the default and means \"not a member of any group\"."},{"line_number":11994,"context_line":""},{"line_number":11995,"context_line":"The only well-supported grouptype is @option{halt_group}."},{"line_number":11996,"context_line":"While @option{resume_group} is accepted, it should only be used for hardware testing"},{"line_number":11997,"context_line":"or special cases. Neither OpenOCD nor GDB support the concept of a hart resuming"},{"line_number":11998,"context_line":"on its own due to an external event, so using resume groups may lead to unexpected behavior."}],"source_content_type":"text/x-texinfo","patch_set":5,"id":"1e82be8d_0b979bde","line":11995,"in_reply_to":"f6606748_bea242b4","updated":"2026-06-11 15:09:55.000000000","message":"Done","commit_id":"013ff9eb5588ae6fea820742bd0172c16476d747"},{"author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"change_message_id":"bd73c960cae321fbe01ed087b71b3ed3e1d1b76b","unresolved":true,"context_lines":[{"line_number":12003,"context_line":"Assign a given DM external trigger into a RISC-V halt/resume group."},{"line_number":12004,"context_line":"@var{trigger_num} is the index of the external trigger (0..15)."},{"line_number":12005,"context_line":"Other parameters are the same as @command{riscv set_hart_group}."},{"line_number":12006,"context_line":""},{"line_number":12007,"context_line":"When an external input trigger fires, the harts in the halt group will get halted."},{"line_number":12008,"context_line":"Similarly, all external output triggers will be notified when a hart in the halt group halts."},{"line_number":12009,"context_line":"@end deffn"}],"source_content_type":"text/x-texinfo","patch_set":5,"id":"0fb0f976_7ce3d97b","line":12006,"updated":"2026-06-11 13:42:07.000000000","message":"I would recommend to stress also here that only the `halt_group` option is expected to work well:\n\n`The only well-supported group type is @option{halt_group}. Please see @command{riscv set_hart_group} for further explanation.`","commit_id":"013ff9eb5588ae6fea820742bd0172c16476d747"},{"author":{"_account_id":1002315,"name":"liangzhen","email":"zhen.liang@spacemit.com","username":"liangzhen"},"change_message_id":"60c83d5f56e0508e81b6ce84423b1392dfbb8bf5","unresolved":false,"context_lines":[{"line_number":12003,"context_line":"Assign a given DM external trigger into a RISC-V halt/resume group."},{"line_number":12004,"context_line":"@var{trigger_num} is the index of the external trigger (0..15)."},{"line_number":12005,"context_line":"Other parameters are the same as @command{riscv set_hart_group}."},{"line_number":12006,"context_line":""},{"line_number":12007,"context_line":"When an external input trigger fires, the harts in the halt group will get halted."},{"line_number":12008,"context_line":"Similarly, all external output triggers will be notified when a hart in the halt group halts."},{"line_number":12009,"context_line":"@end deffn"}],"source_content_type":"text/x-texinfo","patch_set":5,"id":"808534af_06a0378c","line":12006,"in_reply_to":"0fb0f976_7ce3d97b","updated":"2026-06-11 15:09:55.000000000","message":"Done","commit_id":"013ff9eb5588ae6fea820742bd0172c16476d747"},{"author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"change_message_id":"bd73c960cae321fbe01ed087b71b3ed3e1d1b76b","unresolved":true,"context_lines":[{"line_number":12004,"context_line":"@var{trigger_num} is the index of the external trigger (0..15)."},{"line_number":12005,"context_line":"Other parameters are the same as @command{riscv set_hart_group}."},{"line_number":12006,"context_line":""},{"line_number":12007,"context_line":"When an external input trigger fires, the harts in the halt group will get halted."},{"line_number":12008,"context_line":"Similarly, all external output triggers will be notified when a hart in the halt group halts."},{"line_number":12009,"context_line":"@end deffn"},{"line_number":12010,"context_line":""}],"source_content_type":"text/x-texinfo","patch_set":5,"id":"cc36627e_e4f336ef","line":12007,"updated":"2026-06-11 13:42:07.000000000","message":"1) This paragraph talks about halt groups but resume groups are not mentioned.\n\n2) I think it is not necessary to cherry-pick some trigger-related requirements (but not others) from the debug spec and put them here.\n\nInstead, I recommend to just give the high-level overview of what the DM external triggers are. The readers can find the details in the RISC-V debug spec. How about something like this?\n\n\u003e @i{Debug module external triggers} are abstract concepts that allow to connect the halt/resume groups with other components of the system. The external triggers typically serve to implement near-simultaneous halt and resume of all cores in the system when not all cores are RISC-V. Details can be found in the @i{RISC-V Debug Specification}.","commit_id":"013ff9eb5588ae6fea820742bd0172c16476d747"},{"author":{"_account_id":1002315,"name":"liangzhen","email":"zhen.liang@spacemit.com","username":"liangzhen"},"change_message_id":"60c83d5f56e0508e81b6ce84423b1392dfbb8bf5","unresolved":false,"context_lines":[{"line_number":12004,"context_line":"@var{trigger_num} is the index of the external trigger (0..15)."},{"line_number":12005,"context_line":"Other parameters are the same as @command{riscv set_hart_group}."},{"line_number":12006,"context_line":""},{"line_number":12007,"context_line":"When an external input trigger fires, the harts in the halt group will get halted."},{"line_number":12008,"context_line":"Similarly, all external output triggers will be notified when a hart in the halt group halts."},{"line_number":12009,"context_line":"@end deffn"},{"line_number":12010,"context_line":""}],"source_content_type":"text/x-texinfo","patch_set":5,"id":"dd7733a8_67da09a3","line":12007,"in_reply_to":"cc36627e_e4f336ef","updated":"2026-06-11 15:09:55.000000000","message":"Thanks, done","commit_id":"013ff9eb5588ae6fea820742bd0172c16476d747"}],"src/target/riscv/riscv-013.c":[{"author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"change_message_id":"8d8d346d42c2716104cd42b868cd5fda2fd3751f","unresolved":true,"context_lines":[{"line_number":1789,"context_line":"\tinfo-\u003eversion_specific \u003d NULL;"},{"line_number":1790,"context_line":"}"},{"line_number":1791,"context_line":""},{"line_number":1792,"context_line":"static int set_group(struct target *target, bool *supported, unsigned int group,"},{"line_number":1793,"context_line":"\t\tenum grouptype grouptype, bool is_trigger, unsigned int trigger_num)"},{"line_number":1794,"context_line":"{"},{"line_number":1795,"context_line":"\tassert(group \u003c\u003d 31);"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"5c3c3c48_b8e7f5f2","line":1792,"updated":"2026-06-10 14:34:43.000000000","message":"1) For code clarity, please don\u0027t make this function more complicated. Instead, prefer to split it into two functions with simpler interface:\n\n```\nstatic int set_hart_group(struct target *target, bool *supported, enum grouptype grouptype, unsigned int group);\n\nstatic int set_ext_trigger_group(struct target *target, bool *supported, unsigned int trigger_num, enum grouptype grouptype, unsigned int group);\n\n```\n\n2) Nitpick: It is more logical to put the type of the group first, and then the number of the group after it (first select the type of the group, then the number of the group within that type).","commit_id":"eba49ecaf88b30bdd8dfcb1e02a5b3ea36a7adf0"},{"author":{"_account_id":1002315,"name":"liangzhen","email":"zhen.liang@spacemit.com","username":"liangzhen"},"change_message_id":"a92b710d1ab7fe1a52a95436f65e054dce80c500","unresolved":false,"context_lines":[{"line_number":1789,"context_line":"\tinfo-\u003eversion_specific \u003d NULL;"},{"line_number":1790,"context_line":"}"},{"line_number":1791,"context_line":""},{"line_number":1792,"context_line":"static int set_group(struct target *target, bool *supported, unsigned int group,"},{"line_number":1793,"context_line":"\t\tenum grouptype grouptype, bool is_trigger, unsigned int trigger_num)"},{"line_number":1794,"context_line":"{"},{"line_number":1795,"context_line":"\tassert(group \u003c\u003d 31);"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"c8a3d726_21f2eda1","line":1792,"in_reply_to":"5c3c3c48_b8e7f5f2","updated":"2026-06-11 09:34:13.000000000","message":"Done","commit_id":"eba49ecaf88b30bdd8dfcb1e02a5b3ea36a7adf0"},{"author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"change_message_id":"8d8d346d42c2716104cd42b868cd5fda2fd3751f","unresolved":true,"context_lines":[{"line_number":1801,"context_line":"\tdm013_info_t *dm \u003d get_dm(target);"},{"line_number":1802,"context_line":"\tif (!dm)"},{"line_number":1803,"context_line":"\t\treturn ERROR_FAIL;"},{"line_number":1804,"context_line":"\tif (is_trigger \u0026\u0026 ((dm-\u003eexternal_triggers[trigger_num].haltgroup_was_set \u0026\u0026"},{"line_number":1805,"context_line":"\t\t\tdm-\u003eexternal_triggers[trigger_num].haltgroup_num \u003d\u003d group) ||"},{"line_number":1806,"context_line":"\t\t\t(dm-\u003eexternal_triggers[trigger_num].resumegroup_was_set \u0026\u0026"},{"line_number":1807,"context_line":"\t\t\tdm-\u003eexternal_triggers[trigger_num].resumegroup_num \u003d\u003d group))) {"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"d1c1cbcb_71ae2436","line":1804,"updated":"2026-06-10 14:34:43.000000000","message":"It looks like the purpose of this condition is to not try to change the trigger membership if we know that the trigger is part of the group already.\n\nIf so, then there issues to solve:\n\n1) Why do we need this check in the first place? If we again add the trigger to the group it is already in, that is not an issue at all. It is simply a no-op.\n\n2) I don\u0027t see that the content of dm-\u003eexternal_triggers would get cleared when the DM undergoes reset, so it would retain bogus values. \n\nBecause of that, I would prefer to remove the dm-\u003eexternal_triggers item as well as this \"if\" block completely.","commit_id":"eba49ecaf88b30bdd8dfcb1e02a5b3ea36a7adf0"},{"author":{"_account_id":1002315,"name":"liangzhen","email":"zhen.liang@spacemit.com","username":"liangzhen"},"change_message_id":"a92b710d1ab7fe1a52a95436f65e054dce80c500","unresolved":false,"context_lines":[{"line_number":1801,"context_line":"\tdm013_info_t *dm \u003d get_dm(target);"},{"line_number":1802,"context_line":"\tif (!dm)"},{"line_number":1803,"context_line":"\t\treturn ERROR_FAIL;"},{"line_number":1804,"context_line":"\tif (is_trigger \u0026\u0026 ((dm-\u003eexternal_triggers[trigger_num].haltgroup_was_set \u0026\u0026"},{"line_number":1805,"context_line":"\t\t\tdm-\u003eexternal_triggers[trigger_num].haltgroup_num \u003d\u003d group) ||"},{"line_number":1806,"context_line":"\t\t\t(dm-\u003eexternal_triggers[trigger_num].resumegroup_was_set \u0026\u0026"},{"line_number":1807,"context_line":"\t\t\tdm-\u003eexternal_triggers[trigger_num].resumegroup_num \u003d\u003d group))) {"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"11ee6a95_d99b69f1","line":1804,"in_reply_to":"d1c1cbcb_71ae2436","updated":"2026-06-11 09:34:13.000000000","message":"remove, done","commit_id":"eba49ecaf88b30bdd8dfcb1e02a5b3ea36a7adf0"}],"src/target/riscv/riscv.c":[{"author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"change_message_id":"8d8d346d42c2716104cd42b868cd5fda2fd3751f","unresolved":true,"context_lines":[{"line_number":5591,"context_line":"\t\t/* Ext. triggers for resume groups are not supported: neither OpenOCD nor GDB"},{"line_number":5592,"context_line":"\t\t * have a concept of hart resuming on its own due to an external reason, without"},{"line_number":5593,"context_line":"\t\t * an explicit resume request. */"},{"line_number":5594,"context_line":"\t\tLOG_WARNING(\"triggers for resume groups are not supported, please use with caution\");"},{"line_number":5595,"context_line":"\t\tgrouptype \u003d RESUME_GROUP;"},{"line_number":5596,"context_line":"\t} else {"},{"line_number":5597,"context_line":"\t\tLOG_ERROR(\"%s is not a valid argument\", CMD_ARGV[1]);"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"715feee3_d211bfbb","line":5594,"updated":"2026-06-10 14:34:43.000000000","message":"Did you want to say something like \"may lead to unexpected behavior\" instead of \"not supported\"?\n\n\"Not supported\" would mean that the whole command failed because of an unsupported option.","commit_id":"eba49ecaf88b30bdd8dfcb1e02a5b3ea36a7adf0"},{"author":{"_account_id":1002315,"name":"liangzhen","email":"zhen.liang@spacemit.com","username":"liangzhen"},"change_message_id":"a92b710d1ab7fe1a52a95436f65e054dce80c500","unresolved":false,"context_lines":[{"line_number":5591,"context_line":"\t\t/* Ext. triggers for resume groups are not supported: neither OpenOCD nor GDB"},{"line_number":5592,"context_line":"\t\t * have a concept of hart resuming on its own due to an external reason, without"},{"line_number":5593,"context_line":"\t\t * an explicit resume request. */"},{"line_number":5594,"context_line":"\t\tLOG_WARNING(\"triggers for resume groups are not supported, please use with caution\");"},{"line_number":5595,"context_line":"\t\tgrouptype \u003d RESUME_GROUP;"},{"line_number":5596,"context_line":"\t} else {"},{"line_number":5597,"context_line":"\t\tLOG_ERROR(\"%s is not a valid argument\", CMD_ARGV[1]);"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"988d3d7b_c0bbd10e","line":5594,"in_reply_to":"715feee3_d211bfbb","updated":"2026-06-11 09:34:13.000000000","message":"Done","commit_id":"eba49ecaf88b30bdd8dfcb1e02a5b3ea36a7adf0"},{"author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"change_message_id":"8d8d346d42c2716104cd42b868cd5fda2fd3751f","unresolved":true,"context_lines":[{"line_number":5637,"context_line":""},{"line_number":5638,"context_line":"\tif (supported)"},{"line_number":5639,"context_line":"\t\tLOG_TARGET_INFO(target, \"%s %d made part of %s group %d\","},{"line_number":5640,"context_line":"\t\t\t(is_trigger ? \"External trigger\" : \"Core\"),"},{"line_number":5641,"context_line":"\t\t\t(is_trigger ? trigger_num : (unsigned int)target-\u003ecoreid),"},{"line_number":5642,"context_line":"\t\t\t(grouptype \u003d\u003d HALT_GROUP) ? \"halt\" : \"resume\", group);"},{"line_number":5643,"context_line":"\telse"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"ee60cf8c_3e728af0","line":5640,"updated":"2026-06-10 14:34:43.000000000","message":"Minor terminology note:\n\nShould it be \"Hart\" instead of \"Core\"?","commit_id":"eba49ecaf88b30bdd8dfcb1e02a5b3ea36a7adf0"},{"author":{"_account_id":1002315,"name":"liangzhen","email":"zhen.liang@spacemit.com","username":"liangzhen"},"change_message_id":"a92b710d1ab7fe1a52a95436f65e054dce80c500","unresolved":false,"context_lines":[{"line_number":5637,"context_line":""},{"line_number":5638,"context_line":"\tif (supported)"},{"line_number":5639,"context_line":"\t\tLOG_TARGET_INFO(target, \"%s %d made part of %s group %d\","},{"line_number":5640,"context_line":"\t\t\t(is_trigger ? \"External trigger\" : \"Core\"),"},{"line_number":5641,"context_line":"\t\t\t(is_trigger ? trigger_num : (unsigned int)target-\u003ecoreid),"},{"line_number":5642,"context_line":"\t\t\t(grouptype \u003d\u003d HALT_GROUP) ? \"halt\" : \"resume\", group);"},{"line_number":5643,"context_line":"\telse"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"3c9a8dba_1e4b84bb","line":5640,"in_reply_to":"ee60cf8c_3e728af0","updated":"2026-06-11 09:34:13.000000000","message":"Done","commit_id":"eba49ecaf88b30bdd8dfcb1e02a5b3ea36a7adf0"},{"author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"change_message_id":"8d8d346d42c2716104cd42b868cd5fda2fd3751f","unresolved":true,"context_lines":[{"line_number":5641,"context_line":"\t\t\t(is_trigger ? trigger_num : (unsigned int)target-\u003ecoreid),"},{"line_number":5642,"context_line":"\t\t\t(grouptype \u003d\u003d HALT_GROUP) ? \"halt\" : \"resume\", group);"},{"line_number":5643,"context_line":"\telse"},{"line_number":5644,"context_line":"\t\tLOG_TARGET_WARNING(target, \"%s %d could not be made part of %s group %d\","},{"line_number":5645,"context_line":"\t\t\t(is_trigger ? \"External trigger\" : \"Core\"),"},{"line_number":5646,"context_line":"\t\t\t(is_trigger ? trigger_num : (unsigned int)target-\u003ecoreid),"},{"line_number":5647,"context_line":"\t\t\t(grouptype \u003d\u003d HALT_GROUP) ? \"halt\" : \"resume\", group);"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"e6460e30_d4b62754","line":5644,"updated":"2026-06-10 14:34:43.000000000","message":"If this happens, shouldn\u0027t we instead:\n\n- print an error (LOG_TARGET_ERROR)\n- return a failure code (return ERROR_FAIL)\n\n?","commit_id":"eba49ecaf88b30bdd8dfcb1e02a5b3ea36a7adf0"},{"author":{"_account_id":1002315,"name":"liangzhen","email":"zhen.liang@spacemit.com","username":"liangzhen"},"change_message_id":"a92b710d1ab7fe1a52a95436f65e054dce80c500","unresolved":false,"context_lines":[{"line_number":5641,"context_line":"\t\t\t(is_trigger ? trigger_num : (unsigned int)target-\u003ecoreid),"},{"line_number":5642,"context_line":"\t\t\t(grouptype \u003d\u003d HALT_GROUP) ? \"halt\" : \"resume\", group);"},{"line_number":5643,"context_line":"\telse"},{"line_number":5644,"context_line":"\t\tLOG_TARGET_WARNING(target, \"%s %d could not be made part of %s group %d\","},{"line_number":5645,"context_line":"\t\t\t(is_trigger ? \"External trigger\" : \"Core\"),"},{"line_number":5646,"context_line":"\t\t\t(is_trigger ? trigger_num : (unsigned int)target-\u003ecoreid),"},{"line_number":5647,"context_line":"\t\t\t(grouptype \u003d\u003d HALT_GROUP) ? \"halt\" : \"resume\", group);"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"7a0c23b6_2d3b617a","line":5644,"in_reply_to":"e6460e30_d4b62754","updated":"2026-06-11 09:34:13.000000000","message":"Done","commit_id":"eba49ecaf88b30bdd8dfcb1e02a5b3ea36a7adf0"},{"author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"change_message_id":"bd73c960cae321fbe01ed087b71b3ed3e1d1b76b","unresolved":true,"context_lines":[{"line_number":5632,"context_line":"\tunsigned int group;"},{"line_number":5633,"context_line":"\tCOMMAND_PARSE_NUMBER(uint, CMD_ARGV[1], group);"},{"line_number":5634,"context_line":"\tif (group \u003e 31) {"},{"line_number":5635,"context_line":"\t\tLOG_ERROR(\"%d is not a valid group number - expecting a number in range 0..31\","},{"line_number":5636,"context_line":"\t\t\tgroup);"},{"line_number":5637,"context_line":"\t\treturn ERROR_COMMAND_ARGUMENT_INVALID;"},{"line_number":5638,"context_line":"\t}"}],"source_content_type":"text/x-csrc","patch_set":5,"id":"e46d32eb_dd100a60","line":5635,"updated":"2026-06-11 13:42:07.000000000","message":"`group` is unsigned int, so please use `%u`.\n\nThere are more occurrences - please check and fix them all.","commit_id":"013ff9eb5588ae6fea820742bd0172c16476d747"},{"author":{"_account_id":1002315,"name":"liangzhen","email":"zhen.liang@spacemit.com","username":"liangzhen"},"change_message_id":"60c83d5f56e0508e81b6ce84423b1392dfbb8bf5","unresolved":false,"context_lines":[{"line_number":5632,"context_line":"\tunsigned int group;"},{"line_number":5633,"context_line":"\tCOMMAND_PARSE_NUMBER(uint, CMD_ARGV[1], group);"},{"line_number":5634,"context_line":"\tif (group \u003e 31) {"},{"line_number":5635,"context_line":"\t\tLOG_ERROR(\"%d is not a valid group number - expecting a number in range 0..31\","},{"line_number":5636,"context_line":"\t\t\tgroup);"},{"line_number":5637,"context_line":"\t\treturn ERROR_COMMAND_ARGUMENT_INVALID;"},{"line_number":5638,"context_line":"\t}"}],"source_content_type":"text/x-csrc","patch_set":5,"id":"0fd7983b_9cc920a0","line":5635,"in_reply_to":"e46d32eb_dd100a60","updated":"2026-06-11 15:09:55.000000000","message":"Done","commit_id":"013ff9eb5588ae6fea820742bd0172c16476d747"},{"author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"change_message_id":"bd73c960cae321fbe01ed087b71b3ed3e1d1b76b","unresolved":true,"context_lines":[{"line_number":5981,"context_line":"\t\t.handler \u003d riscv_set_hart_group,"},{"line_number":5982,"context_line":"\t\t.mode \u003d COMMAND_ANY,"},{"line_number":5983,"context_line":"\t\t.usage \u003d \"\u003c\u0027halt_group\u0027|\u0027resume_group\u0027\u003e group_num\","},{"line_number":5984,"context_line":"\t\t.help \u003d \"Set a hart to the halt/resume group\""},{"line_number":5985,"context_line":"\t},"},{"line_number":5986,"context_line":"\t{"},{"line_number":5987,"context_line":"\t\t.name \u003d \"set_dmexttrigger_group\","}],"source_content_type":"text/x-csrc","patch_set":5,"id":"ba20e5e0_7cab6e9a","line":5984,"updated":"2026-06-11 13:42:07.000000000","message":"Nitpick - more clear wording:\n\n`Assign the hart to the specified halt/resume group`","commit_id":"013ff9eb5588ae6fea820742bd0172c16476d747"},{"author":{"_account_id":1002315,"name":"liangzhen","email":"zhen.liang@spacemit.com","username":"liangzhen"},"change_message_id":"60c83d5f56e0508e81b6ce84423b1392dfbb8bf5","unresolved":false,"context_lines":[{"line_number":5981,"context_line":"\t\t.handler \u003d riscv_set_hart_group,"},{"line_number":5982,"context_line":"\t\t.mode \u003d COMMAND_ANY,"},{"line_number":5983,"context_line":"\t\t.usage \u003d \"\u003c\u0027halt_group\u0027|\u0027resume_group\u0027\u003e group_num\","},{"line_number":5984,"context_line":"\t\t.help \u003d \"Set a hart to the halt/resume group\""},{"line_number":5985,"context_line":"\t},"},{"line_number":5986,"context_line":"\t{"},{"line_number":5987,"context_line":"\t\t.name \u003d \"set_dmexttrigger_group\","}],"source_content_type":"text/x-csrc","patch_set":5,"id":"cb7dbaf0_ad739f33","line":5984,"in_reply_to":"ba20e5e0_7cab6e9a","updated":"2026-06-11 15:09:55.000000000","message":"Done","commit_id":"013ff9eb5588ae6fea820742bd0172c16476d747"},{"author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"change_message_id":"bd73c960cae321fbe01ed087b71b3ed3e1d1b76b","unresolved":true,"context_lines":[{"line_number":5988,"context_line":"\t\t.handler \u003d riscv_set_dmexttrigger_group,"},{"line_number":5989,"context_line":"\t\t.mode \u003d COMMAND_ANY,"},{"line_number":5990,"context_line":"\t\t.usage \u003d \"trigger_num \u003c\u0027halt_group\u0027|\u0027resume_group\u0027\u003e group_num\","},{"line_number":5991,"context_line":"\t\t.help \u003d \"Set a given DM external trigger to the halt/resume group\""},{"line_number":5992,"context_line":"\t},"},{"line_number":5993,"context_line":"\t{"},{"line_number":5994,"context_line":"\t\t.chain \u003d smp_command_handlers"}],"source_content_type":"text/x-csrc","patch_set":5,"id":"78dfcf6e_d2ea7f64","line":5991,"updated":"2026-06-11 13:42:07.000000000","message":"Nitpick - more clear wording:\n\n`Assign the given DM external trigger to the specified halt/resume group`","commit_id":"013ff9eb5588ae6fea820742bd0172c16476d747"},{"author":{"_account_id":1002315,"name":"liangzhen","email":"zhen.liang@spacemit.com","username":"liangzhen"},"change_message_id":"60c83d5f56e0508e81b6ce84423b1392dfbb8bf5","unresolved":false,"context_lines":[{"line_number":5988,"context_line":"\t\t.handler \u003d riscv_set_dmexttrigger_group,"},{"line_number":5989,"context_line":"\t\t.mode \u003d COMMAND_ANY,"},{"line_number":5990,"context_line":"\t\t.usage \u003d \"trigger_num \u003c\u0027halt_group\u0027|\u0027resume_group\u0027\u003e group_num\","},{"line_number":5991,"context_line":"\t\t.help \u003d \"Set a given DM external trigger to the halt/resume group\""},{"line_number":5992,"context_line":"\t},"},{"line_number":5993,"context_line":"\t{"},{"line_number":5994,"context_line":"\t\t.chain \u003d smp_command_handlers"}],"source_content_type":"text/x-csrc","patch_set":5,"id":"2567c254_877a4119","line":5991,"in_reply_to":"78dfcf6e_d2ea7f64","updated":"2026-06-11 15:09:55.000000000","message":"Done","commit_id":"013ff9eb5588ae6fea820742bd0172c16476d747"}]}
