|
6 | 6 | #include "vtr_log.h" |
7 | 7 | #include "arch_error.h" |
8 | 8 |
|
| 9 | +/** |
| 10 | + * @brief Process the <topology> tag under <noc> tag. |
| 11 | + * |
| 12 | + * Using <topology> tag, the user can specify a custom |
| 13 | + * topology. |
| 14 | + * |
| 15 | + * @param topology_tag An XML node pointing to a <topology> tag. |
| 16 | + * @param loc_data Points to the location in the xml file where the parser is reading. |
| 17 | + * @param noc_ref To be filled with NoC router locations and their connectivity. |
| 18 | + */ |
9 | 19 | static void process_topology(pugi::xml_node topology_tag, |
10 | 20 | const pugiutil::loc_data& loc_data, |
11 | 21 | t_noc_inf* noc_ref); |
12 | 22 |
|
13 | | -static void process_mesh_topology(pugi::xml_node mesh_topology_tag, |
14 | | - const pugiutil::loc_data& loc_data, t_noc_inf* noc_ref); |
15 | | - |
| 23 | +/** |
| 24 | + * @brief Process a <router> tag under a <topology> tag. |
| 25 | + * |
| 26 | + * A <topology> tag contains multiple <router> tags. Each <router> tag has |
| 27 | + * attributes that specify its location and connectivity to other NoC routers. |
| 28 | + * |
| 29 | + * @param router_tag An XML node pointing to a <router> tag. |
| 30 | + * @param loc_data Points to the location in the xml file where the parser is reading. |
| 31 | + * @param noc_ref To be filled with the given router's location and connectivity information. |
| 32 | + * @param routers_in_arch_info Stores router information that includes the number of connections |
| 33 | + * a router has within a given topology and also the number of times a router was declared |
| 34 | + * in the arch file using the <router> tag. [router_id, [n_declarations, n_connections]] |
| 35 | + */ |
16 | 36 | static void process_router(pugi::xml_node router_tag, |
17 | 37 | const pugiutil::loc_data& loc_data, |
18 | 38 | t_noc_inf* noc_ref, |
19 | | - std::map<int, std::pair<int, int>>& routers_info_in_arch); |
| 39 | + std::map<int, std::pair<int, int>>& routers_in_arch_info); |
| 40 | + |
| 41 | +/** |
| 42 | + * @brief Processes the <mesh> tag under <noc> tag. |
| 43 | + * |
| 44 | + * Using the <mesh> tag, the user can describe a NoC with |
| 45 | + * mesh topology. |
| 46 | + * |
| 47 | + * @param mesh_topology_tag An XML tag pointing to a <mesh> tag. |
| 48 | + * @param loc_data Points to the location in the xml file where the parser is reading. |
| 49 | + * @param noc_ref To be filled with NoC router locations and their connectivity. |
| 50 | + */ |
| 51 | +static void process_mesh_topology(pugi::xml_node mesh_topology_tag, |
| 52 | + const pugiutil::loc_data& loc_data, t_noc_inf* noc_ref); |
20 | 53 |
|
| 54 | + |
| 55 | +/** |
| 56 | + * Create routers and set their properties so that a mesh grid of routers is created. |
| 57 | + * Then connect the routers together so that a mesh topology is created. |
| 58 | + * |
| 59 | + * @param mesh_topology_tag An XML tag pointing to a <mesh> tag. |
| 60 | + * @param loc_data Points to the location in the xml file where the parser is reading. |
| 61 | + * @param noc_ref To be filled with NoC router locations and their connectivity. |
| 62 | + * @param mesh_region_start_x The location the bottom left NoC router on the X-axis. |
| 63 | + * @param mesh_region_end_x The location the top right NoC router on the X-axis. |
| 64 | + * @param mesh_region_start_y The location the bottom left NoC router on the Y-axis. |
| 65 | + * @param mesh_region_end_y The location the top right NoC router on the Y-axis. |
| 66 | + * @param mesh_size The number of NoC routers in each row or column. |
| 67 | + */ |
21 | 68 | static void generate_noc_mesh(pugi::xml_node mesh_topology_tag, |
22 | 69 | const pugiutil::loc_data& loc_data, |
23 | 70 | t_noc_inf* noc_ref, |
@@ -81,12 +128,21 @@ static void update_router_info_in_arch(int router_id, |
81 | 128 | bool router_updated_as_a_connection, |
82 | 129 | std::map<int, std::pair<int, int>>& routers_in_arch_info); |
83 | 130 |
|
84 | | - |
| 131 | +/** |
| 132 | + * @brief Process <overrides> tag under <noc> tag. |
| 133 | + * |
| 134 | + * The user can override the default latency and bandwidth values |
| 135 | + * for specific NoC routers and links using <router> and <link> |
| 136 | + * tags under <overrides> tag. |
| 137 | + * |
| 138 | + * @param noc_overrides_tag An XML node pointing to a <overrides> tag. |
| 139 | + * @param loc_data Points to the location in the xml file where the parser is reading. |
| 140 | + * @param noc_ref To be filled with parsed overridden latencies and bandwidths. |
| 141 | + */ |
85 | 142 | static void process_noc_overrides(pugi::xml_node noc_overrides_tag, |
86 | 143 | const pugiutil::loc_data& loc_data, |
87 | 144 | t_noc_inf& noc_ref); |
88 | 145 |
|
89 | | - |
90 | 146 | void process_noc_tag(pugi::xml_node noc_tag, |
91 | 147 | t_arch* arch, |
92 | 148 | const pugiutil::loc_data& loc_data) { |
@@ -195,10 +251,6 @@ static void process_mesh_topology(pugi::xml_node mesh_topology_tag, |
195 | 251 | generate_noc_mesh(mesh_topology_tag, loc_data, noc_ref, mesh_region_start_x, mesh_region_end_x, mesh_region_start_y, mesh_region_end_y, mesh_size); |
196 | 252 | } |
197 | 253 |
|
198 | | -/* |
199 | | - * Create routers and set their properties so that a mesh grid of routers is created. |
200 | | - * Then connect the routers together so that a mesh topology is created. |
201 | | - */ |
202 | 254 | static void generate_noc_mesh(pugi::xml_node mesh_topology_tag, |
203 | 255 | const pugiutil::loc_data& loc_data, |
204 | 256 | t_noc_inf* noc_ref, |
|
0 commit comments