)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"change_message_id":"a8dd9613593a8063fa1d749da78d6e1c00766e15","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"5c7b9a52_12859380","updated":"2026-06-25 09:58:45.000000000","message":"I only noticed a typo in the error message.\n\nOtherwise LGTM, thank you.","commit_id":"bb099deede6a1b2a932b2d188cb0515bf2625001"},{"author":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"change_message_id":"d45586a69f69f3750fdb2f8fe939579dfd7d3eec","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"10886bad_4501089e","updated":"2026-06-25 15:23:08.000000000","message":"Thanks for the patch!\nOne minor note on the message, though I feel like it needs to be addressed.","commit_id":"bb099deede6a1b2a932b2d188cb0515bf2625001"},{"author":{"_account_id":1002315,"name":"liangzhen","email":"zhen.liang@spacemit.com","username":"liangzhen"},"change_message_id":"ce2725c21f6994ecdc98616b7fbf5a31109e5235","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"b41c976b_010f503c","updated":"2026-07-24 10:39:18.000000000","message":"@Jan, @Evgeniy, I believe that hart index check would be better placed inside examine() instead. Could you please take a look at this?","commit_id":"89dca91bfcafe6903348689316e9bfe1d3f09996"},{"author":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"change_message_id":"4a36c8ef743861afd5f0d2d4a1736aa5723724cd","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"a9c11b4b_5667f444","updated":"2026-07-24 11:24:10.000000000","message":"LGTM. One minor comment","commit_id":"89dca91bfcafe6903348689316e9bfe1d3f09996"}],"src/target/riscv/riscv-013.c":[{"author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"change_message_id":"a8dd9613593a8063fa1d749da78d6e1c00766e15","unresolved":true,"context_lines":[{"line_number":1959,"context_line":"\t\tget_field(dmcontrol, DM_DMCONTROL_HARTSELLO);"},{"line_number":1960,"context_line":""},{"line_number":1961,"context_line":"\tif ((uint32_t)target-\u003ecoreid \u003e hartsel) {"},{"line_number":1962,"context_line":"\t\tLOG_TARGET_ERROR(target, \"No hart with index %u does not exist. There\""},{"line_number":1963,"context_line":"\t\t\t\" are only %u harts found on the DM (with indexes 0 .. %u)\","},{"line_number":1964,"context_line":"\t\t\ttarget-\u003ecoreid, hartsel + 1, hartsel);"},{"line_number":1965,"context_line":"\t\treturn ERROR_FAIL;"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"6e576778_e1412ec5","line":1962,"updated":"2026-06-25 09:58:45.000000000","message":"Nitpick - extra \"No\": `Hart with index %u does not exist.`","commit_id":"bb099deede6a1b2a932b2d188cb0515bf2625001"},{"author":{"_account_id":1002315,"name":"liangzhen","email":"zhen.liang@spacemit.com","username":"liangzhen"},"change_message_id":"e4558774e9831ce4652e0e80ef6d620481a83613","unresolved":false,"context_lines":[{"line_number":1959,"context_line":"\t\tget_field(dmcontrol, DM_DMCONTROL_HARTSELLO);"},{"line_number":1960,"context_line":""},{"line_number":1961,"context_line":"\tif ((uint32_t)target-\u003ecoreid \u003e hartsel) {"},{"line_number":1962,"context_line":"\t\tLOG_TARGET_ERROR(target, \"No hart with index %u does not exist. There\""},{"line_number":1963,"context_line":"\t\t\t\" are only %u harts found on the DM (with indexes 0 .. %u)\","},{"line_number":1964,"context_line":"\t\t\ttarget-\u003ecoreid, hartsel + 1, hartsel);"},{"line_number":1965,"context_line":"\t\treturn ERROR_FAIL;"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"dd595d13_a14bd798","line":1962,"in_reply_to":"2d18f9c0_290a6854","updated":"2026-06-28 13:31:56.000000000","message":"Done","commit_id":"bb099deede6a1b2a932b2d188cb0515bf2625001"},{"author":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"change_message_id":"d45586a69f69f3750fdb2f8fe939579dfd7d3eec","unresolved":true,"context_lines":[{"line_number":1959,"context_line":"\t\tget_field(dmcontrol, DM_DMCONTROL_HARTSELLO);"},{"line_number":1960,"context_line":""},{"line_number":1961,"context_line":"\tif ((uint32_t)target-\u003ecoreid \u003e hartsel) {"},{"line_number":1962,"context_line":"\t\tLOG_TARGET_ERROR(target, \"No hart with index %u does not exist. There\""},{"line_number":1963,"context_line":"\t\t\t\" are only %u harts found on the DM (with indexes 0 .. %u)\","},{"line_number":1964,"context_line":"\t\t\ttarget-\u003ecoreid, hartsel + 1, hartsel);"},{"line_number":1965,"context_line":"\t\treturn ERROR_FAIL;"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"2d18f9c0_290a6854","line":1962,"in_reply_to":"6e576778_e1412ec5","updated":"2026-06-25 15:23:08.000000000","message":"One more note regarding this message -- I would suggest dropping the part about \"There are only %u harts found on the DM\". The issue is, that the reported number of harts is not correct (e.g. for 3 harts and 2-bit `hartsel`).\nI\u0027d suggest something like:\n```\n\"Hart index %u is too large. The maximum index for this Debug Module is %u\".\n```\n\nAlso a minor nitpick: `hartsel` is `uint32_t`, so it would be better to use `PRIu32` for it.","commit_id":"bb099deede6a1b2a932b2d188cb0515bf2625001"},{"author":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"change_message_id":"5bb8bcd94f9abfc67234b416210f596ec7c8ad7a","unresolved":true,"context_lines":[{"line_number":1967,"context_line":""},{"line_number":1968,"context_line":"\t/* Before doing anything else we must first enumerate the harts. */"},{"line_number":1969,"context_line":"\tif (dm-\u003ehart_count \u003c 0) {"},{"line_number":1970,"context_line":"\t\tfor (unsigned int i \u003d 0; i \u003c\u003d hartsel; ++i) {"},{"line_number":1971,"context_line":"\t\t\t/* TODO: This is extremely similar to"},{"line_number":1972,"context_line":"\t\t\t * riscv013_get_hart_state()."},{"line_number":1973,"context_line":"\t\t\t * It would be best to reuse the code."}],"source_content_type":"text/x-csrc","patch_set":2,"id":"66538fbe_5ab3d5e2","line":1970,"updated":"2026-06-29 11:23:10.000000000","message":"[nitpick]\nYou are casting an `unsigned int` to `uint32_t` in an `if` but not here. Seems strange.\n\nTo be honest, I\u0027d actually use `get_field32()` when initializing the `hartsel` and use `uint32_t` throughout -- the issue is `unsigned int` is only required to be 16 bits wide, so it may be unable to fir a 20-bit wide `hartsel`.","commit_id":"141fa96417f314575d5d7f06edac3be60c3b9cc8"},{"author":{"_account_id":1002315,"name":"liangzhen","email":"zhen.liang@spacemit.com","username":"liangzhen"},"change_message_id":"fb5cddaa53ecb0f5a565eaa66beed62ca8f99fd5","unresolved":false,"context_lines":[{"line_number":1967,"context_line":""},{"line_number":1968,"context_line":"\t/* Before doing anything else we must first enumerate the harts. */"},{"line_number":1969,"context_line":"\tif (dm-\u003ehart_count \u003c 0) {"},{"line_number":1970,"context_line":"\t\tfor (unsigned int i \u003d 0; i \u003c\u003d hartsel; ++i) {"},{"line_number":1971,"context_line":"\t\t\t/* TODO: This is extremely similar to"},{"line_number":1972,"context_line":"\t\t\t * riscv013_get_hart_state()."},{"line_number":1973,"context_line":"\t\t\t * It would be best to reuse the code."}],"source_content_type":"text/x-csrc","patch_set":2,"id":"b4ed8fb8_234797d9","line":1970,"in_reply_to":"66538fbe_5ab3d5e2","updated":"2026-06-29 12:34:52.000000000","message":"Thanks, done!","commit_id":"141fa96417f314575d5d7f06edac3be60c3b9cc8"},{"author":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"change_message_id":"4a36c8ef743861afd5f0d2d4a1736aa5723724cd","unresolved":false,"context_lines":[{"line_number":2098,"context_line":"\t\t\ttarget-\u003ecoreid, dm-\u003ehart_count - 1);"},{"line_number":2099,"context_line":"\t\treturn ERROR_FAIL;"},{"line_number":2100,"context_line":"\t}"},{"line_number":2101,"context_line":""},{"line_number":2102,"context_line":"\tresult \u003d dm013_select_target(target);"},{"line_number":2103,"context_line":"\tif (result !\u003d ERROR_OK)"},{"line_number":2104,"context_line":"\t\treturn result;"}],"source_content_type":"text/x-csrc","patch_set":4,"id":"5b06be00_4c259b83","line":2101,"updated":"2026-07-24 11:24:10.000000000","message":"Perhaps we should also check that there are no duplicates? I don\u0027t think this should be implemented in the current patch though. Maybe add a FIXME comment?","commit_id":"89dca91bfcafe6903348689316e9bfe1d3f09996"},{"author":{"_account_id":1002315,"name":"liangzhen","email":"zhen.liang@spacemit.com","username":"liangzhen"},"change_message_id":"cfd6d4c8a11a5e5dbf18349d1f83af430f192f63","unresolved":false,"context_lines":[{"line_number":2098,"context_line":"\t\t\ttarget-\u003ecoreid, dm-\u003ehart_count - 1);"},{"line_number":2099,"context_line":"\t\treturn ERROR_FAIL;"},{"line_number":2100,"context_line":"\t}"},{"line_number":2101,"context_line":""},{"line_number":2102,"context_line":"\tresult \u003d dm013_select_target(target);"},{"line_number":2103,"context_line":"\tif (result !\u003d ERROR_OK)"},{"line_number":2104,"context_line":"\t\treturn result;"}],"source_content_type":"text/x-csrc","patch_set":4,"id":"48dec164_4be3cbc5","line":2101,"in_reply_to":"1e64085e_addaac64","updated":"2026-07-28 10:57:01.000000000","message":"It doesn\u0027t seem easy to handle this issue through configuring parameters. I have completed the RISC-V `examine`, please see: https://review.openocd.org/c/openocd/+/9814","commit_id":"89dca91bfcafe6903348689316e9bfe1d3f09996"},{"author":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"change_message_id":"33998c26cfd34dc529a6942287b89222c15c7a69","unresolved":false,"context_lines":[{"line_number":2098,"context_line":"\t\t\ttarget-\u003ecoreid, dm-\u003ehart_count - 1);"},{"line_number":2099,"context_line":"\t\treturn ERROR_FAIL;"},{"line_number":2100,"context_line":"\t}"},{"line_number":2101,"context_line":""},{"line_number":2102,"context_line":"\tresult \u003d dm013_select_target(target);"},{"line_number":2103,"context_line":"\tif (result !\u003d ERROR_OK)"},{"line_number":2104,"context_line":"\t\treturn result;"}],"source_content_type":"text/x-csrc","patch_set":4,"id":"1e64085e_addaac64","line":2101,"in_reply_to":"4ffd26b4_fc5c7891","updated":"2026-07-28 10:12:01.000000000","message":"Not really.\nTarget-independent code can\u0027t make a choice over what set the `-coreid` should be unique -- it can only make it globally unique, which is not suitable for our case. We need for the ID to be unique per DM.\n\nThough you are right -- it\u0027s better placed on assignment (e.g. in an eventual handler of `-hartid` RISC-V-specific configuration parameter).","commit_id":"89dca91bfcafe6903348689316e9bfe1d3f09996"},{"author":{"_account_id":1002315,"name":"liangzhen","email":"zhen.liang@spacemit.com","username":"liangzhen"},"change_message_id":"c71be93e6fbda9ea45e27bf37a29d57de372f308","unresolved":false,"context_lines":[{"line_number":2098,"context_line":"\t\t\ttarget-\u003ecoreid, dm-\u003ehart_count - 1);"},{"line_number":2099,"context_line":"\t\treturn ERROR_FAIL;"},{"line_number":2100,"context_line":"\t}"},{"line_number":2101,"context_line":""},{"line_number":2102,"context_line":"\tresult \u003d dm013_select_target(target);"},{"line_number":2103,"context_line":"\tif (result !\u003d ERROR_OK)"},{"line_number":2104,"context_line":"\t\treturn result;"}],"source_content_type":"text/x-csrc","patch_set":4,"id":"4ffd26b4_fc5c7891","line":2101,"in_reply_to":"5b06be00_4c259b83","updated":"2026-07-24 13:08:01.000000000","message":"I don\u0027t think this is a matter of RISC-V code, perhaps it should be done int `target.c` after `target create` and `target configure`?","commit_id":"89dca91bfcafe6903348689316e9bfe1d3f09996"}]}
