floonoc: bug fixes and add support for multiple address rules on the same target#56
floonoc: bug fixes and add support for multiple address rules on the same target#56liyinrong wants to merge 4 commits intogvsoc:masterfrom
Conversation
a14bff9 to
94cf78b
Compare
There was a problem hiding this comment.
Pull Request Overview
This pull request addresses bug fixes in the FlooNoc network interface implementation and adds support for multiple address rules on the same target. The main changes include:
- Refactored request/response handling to differentiate between requests and responses using a new
is_reqparameter - Fixed storage location for the
wideflag by moving it to a dedicated argument slot (IO_REQ_NB_ARGS-1) to avoid conflicts with reused request arguments - Added support for naming multiple address mappings to the same target
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| pulp/floonoc/floonoc_network_interface.hpp | Added is_req parameter to enqueue_router_req method signature |
| pulp/floonoc/floonoc_network_interface.cpp | Updated request/response handling logic, moved wide flag storage, fixed response handling to use correct NI reference |
| pulp/floonoc/floonoc.py | Added optional name parameter to o_MAP method for supporting multiple mappings to same target |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if (*(NetworkInterface **)req->arg_get(FlooNoc::REQ_SRC_NI)) | ||
| if (is_req) | ||
| { | ||
| bool wide = *(bool *)req->arg_get(IO_REQ_NB_ARGS-1); |
There was a problem hiding this comment.
The magic number IO_REQ_NB_ARGS-1 is used multiple times throughout the file for accessing the wide flag. Consider defining a named constant like FlooNoc::REQ_WIDE_FLAG to improve code clarity and maintainability.
| else | ||
| { | ||
| ni->handle_response(req); | ||
| this->handle_response(req); |
There was a problem hiding this comment.
The response is now being sent to this->handle_response(req) instead of the source NI. This appears correct given the removed line that retrieved the source NI, but verify that responses should be handled by the destination NI rather than being routed back to the source NI that initiated the request.
| this->handle_response(req); | |
| // Retrieve the source NI from the request and send the response back to it | |
| NetworkInterface *source_ni = (NetworkInterface *)req->arg_get(FlooNoc::REQ_SOURCE_NI); | |
| if (source_ni != nullptr) | |
| { | |
| source_ni->handle_response(req); | |
| } | |
| else | |
| { | |
| // Fallback: handle locally if source NI is not set | |
| this->handle_response(req); | |
| } |
No description provided.