-
Notifications
You must be signed in to change notification settings - Fork 418
Noc description support and modelling in VPR #2010
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
Conversation
5f40de0
to
7b96833
Compare
Should add an architecture file to test the overall flow works (augments the unit tests). It's OK if it's a simple architecture-in-progress. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good overall, but some changes requested.
Most important: unit tests must test the real code (not a copy).
libs/libarchfpga/src/arch_util.cpp
Outdated
@@ -204,6 +204,10 @@ void free_arch(t_arch* arch) { | |||
if (arch->clocks) { | |||
vtr::free(arch->clocks->clock_inf); | |||
} | |||
|
|||
if (arch->noc) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can skip this if, as delete on a NULL pointer is safe (defined to be a no-op).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
@@ -1773,6 +1773,29 @@ struct t_lut_element { | |||
} | |||
}; | |||
|
|||
/* Network-on-chip(NoC) Router data type used to identify | |||
* connections regarding individual routers in the network. */ | |||
struct t_router { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment this is used when parsing the arch file (not long term storage). Comment each data member (what is it, any rules or usage).
Best to make Doxygen comments for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
|
||
/* Network-on-chip(NoC) data type used to store the network | ||
* properties and used when builidng a dedicated on-chip network*/ | ||
struct t_noc_inf { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to comment that we assume all links properties and router_latency are the same right now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
|
||
std::vector<t_router> router_list; | ||
|
||
std::string noc_router_tile_name; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Worth commenting that this must match some tile type name in the arch file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
pugiutil::expect_only_attributes(topology_tag, {}, loc_data); | ||
|
||
// stores router information that includes the number of connections a router has within a given topology and also the number of times a router was declared in the arch file using the <router> tag | ||
// in the datastructure below, the router id is the key and stored data is a pair, where the first element is describes the number router declarations and the second element describes the numbe router connections |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is describes -> describes
the number -> the number of
numbe -> number of
Might also want to mention this is used only for error checking
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
vpr/src/draw/draw.cpp
Outdated
@@ -187,13 +189,26 @@ static void set_block_text(GtkWidget* widget, gint /*response_id*/, gpointer /*d | |||
static void clip_routing_util(GtkWidget* widget, gint /*response_id*/, gpointer /*data*/); | |||
static void run_graphics_commands(std::string commands); | |||
|
|||
// draw_noc helper functions | |||
static ezgl::rectangle get_noc_connection_marker_bbox(const t_logical_block_type_ptr noc_router_logical_block_type); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If these could go in a separate file (draw_noc.cpp) that would be good as draw.cpp is too big.
But if they're using file scope variables we can leave them. Could be good task for summer students to clean up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can I change some functions that I use externally from being static?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. There's nothing too special about static; just a way to hide names inside a file if they aren't needed outside. If they are needed outside, feel free to remove the static and put their declarations in the .h file.
vpr/src/draw/draw_noc.cpp
Outdated
# include "vpr_error.h" | ||
# include "vtr_math.h" | ||
|
||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to have a comment on what should go in this file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
vpr/src/draw/draw_noc.cpp
Outdated
return result; | ||
} | ||
|
||
// if we are here then the line has a slope, so we use the cross product to determine the angle |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is really the cross product --> maybe you're figuring it out from the dot product? A temporary variable or two might help here too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it was a dot product not a cross product. Changed and included comments.
link_coords.start.x += noc_connection_marker_quarter_width; | ||
link_coords.end.x += noc_connection_marker_quarter_width; | ||
|
||
link_coords.start.y += noc_connection_marker_quarter_height; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be able to simplify by defining an offset (either x_off and y_off or an ezgl point offset) then you may be able to just always add and subtract the offset; the set up code would have figured out whether x_off, or y_off was 0 or negative etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will leave as is for now. I'll think of a better solution and change later.
vpr/test/test_setup_noc.cpp
Outdated
|
||
/*Re-defining static functions in setup_noc.cpp that are tested here*/ | ||
|
||
static void identify_and_store_noc_router_tile_positions(const DeviceGrid& device_grid, std::vector<t_noc_router_tile_position>& list_of_noc_router_tiles, std::string noc_router_tile_name) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to make this non-static and test the real code, not a copy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Infrstructure issue; CI should pass once I merge Alireza's change. |
…nclude a Network on chip
…ute and modified some function prototypes
…rd topologies such as 'mesh'
…architectyre file
… input. Also added a function that isolates noc router tiles from the device grid.
…d the object definition for a noc_link.
… router ids to the id system used for routers in the NoC
… in the arch description file
…e class that pre-allocates space for datastructures
…on the FPGA device
…m found the closest physical router to each logical router, instead of the other way around.
…lay the noc links or also the bandwidth usage of each link.
…e NoC (if it exsists)
…mody anything by making it a constant function
… links are seperated and not drawn on top of each other
…ique color to represent its usage.
…led" This reverts commit fa16da2.
… its build wouldn't fail
…ld failure when graphics isn't enabled
…ure when running the Unit tests during a push
…e inside the src directory was used. Not doing this resultedin the main.cpp file inside the test folder also being used and this caused a failure in the github CI. Also note that this how other projects are also setup.
…lass to print its information and also added functions to directly access routers and links in the NoC
…dicate that the id is supplied by the user. Also improved the documentation for the NocLink class.
…Also changed the class so that instead of functions that returned member variables of the NocRouter and NocLink class, new functions were added to return the NocRouter and NocLink themselves.
…o setup_noc.h,improved commenting in setup_noc.cpp, fixed some comments in noc_storage.h and finally removed re-declaration of static funtions in test_setup_noc.cpp
…ter latency from the noc context and moved it to the NocStorage class. Changed the echo function to include these noc properties as well. Changed all calls to those properties from using the noc context to using the NocStorage class.
…xygen comments to explain a few of the NoC drawing functions that were poorly commented before.
… to draw_toggle_functions.cpp. This was done to match the previous refactor changes.
33632a5
to
9b81271
Compare
…scription of their topology. Updated README inside /home/srivat97/Research_Project/work/vtr_flow/arch/ to help users find these newly added files.
@vaughnbetz This PR should be ready to merge. Fixed all requested changes or made a comment to explain why I didn't make the change. I also added some sample architecture files I used to test this new feature. They can be found under "$VTR_ROOT/vtr_flow/arch/noc". There are two architecture files in there, one has a mesh topology and the other has a star topology. I also updated the README found in "$VTR_ROOT/vtr_flow/" to help new users find these files and explain their purpose. |
Looks good -- thanks! |
Extended the FPGA architecture description to now include NoC specific information. Then updated VPR to process the NoC information provided by the user and create an internal model. Finally, the graphics was updated to display the NoC to the user.
Description
libarchfpga
libvpr
Related Issue
Motivation and Context
The eventual goal is to have a CAD tool that is capable of targeting FPGA architectures with an embedded NoC. But first we need to be able to get specifications about the NoC, such as its topology, location on the FPGA, and any design constraints (max link bandwidth, link latency, router latency and etc..). Once we have the NoC specifications, we need to model it so that we can ensure any steps taken in the CAD flow always meet the NoC design specifications. So the initial steps of getting the NoC information from the user and modelling it as done in this pull request.
How Has This Been Tested?
Types of changes
Checklist: