Skip to content

Commit 96441da

Browse files
committed
added another attribute of the noc, which is the name used to describe router tiles. Then updated setup_noc to use the new value.
1 parent 94525d6 commit 96441da

File tree

4 files changed

+18
-4
lines changed

4 files changed

+18
-4
lines changed

libs/libarchfpga/src/physical_types.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1751,6 +1751,8 @@ struct t_noc_inf {
17511751
int router_latency; // in nanoseconds
17521752

17531753
std::vector<t_router> router_list;
1754+
1755+
std::string noc_router_tile_name;
17541756
};
17551757

17561758
/* Detailed routing architecture */

libs/libarchfpga/src/read_xml_arch_file.cpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4646,7 +4646,7 @@ static void ProcessClocks(pugi::xml_node Parent, t_clock_arch* clocks, const pug
46464646
static void ProcessNoc(pugi::xml_node noc_tag, t_arch* arch, const pugiutil::loc_data& loc_data)
46474647
{
46484648
// a vector representing all the possible attributes within the noc tag
4649-
std::vector<std::string> expected_noc_attributes = {"link_bandwidth", "link_latency", "router_latency"};
4649+
std::vector<std::string> expected_noc_attributes = {"link_bandwidth", "link_latency", "router_latency", "noc_router_tile_name"};
46504650

46514651
std::vector<std::string> expected_noc_children_tags = {"mesh","topology"};
46524652

@@ -4656,6 +4656,9 @@ static void ProcessNoc(pugi::xml_node noc_tag, t_arch* arch, const pugiutil::loc
46564656
// identifier that lets us know when we could not properly convert an attribute value to a integer
46574657
int attribute_conversion_failure = -1;
46584658

4659+
// identifier that lets us know when we could not properly convert a string conversion value
4660+
std::string attribute_conversion_failure_string = "";
4661+
46594662
// if we are here, then the user has a NoC in their architecture, so need to add it
46604663
arch->noc = new t_noc_inf;
46614664
t_noc_inf* noc_ref = arch->noc;
@@ -4672,13 +4675,22 @@ static void ProcessNoc(pugi::xml_node noc_tag, t_arch* arch, const pugiutil::loc
46724675

46734676
noc_ref->router_latency = pugiutil::get_attribute(noc_tag, "router_latency", loc_data, pugiutil::REQUIRED).as_int(attribute_conversion_failure);
46744677

4678+
noc_ref->noc_router_tile_name = pugiutil::get_attribute(noc_tag, "noc_router_tile_name", loc_data, pugiutil::REQUIRED).as_string();
4679+
46754680
// the noc parameters can only be non-zero positive values
46764681
if ((noc_ref->link_bandwidth < 0) || (noc_ref->link_latency < 0) || (noc_ref->router_latency < 0))
46774682
{
46784683
archfpga_throw(loc_data.filename_c_str(), loc_data.line(noc_tag),
46794684
"The link bandwidth, link latency and router latency for the NoC must be a positive non-zero integer.");
46804685
}
46814686

4687+
// check that the router tile name was supplied properly
4688+
if (!(noc_ref->noc_router_tile_name.compare(attribute_conversion_failure_string)))
4689+
{
4690+
archfpga_throw(loc_data.filename_c_str(), loc_data.line(noc_tag),
4691+
"The noc router tile name must be a string.");
4692+
}
4693+
46824694
/* We processed the NoC node, so now process the topology*/
46834695

46844696
// make sure that only the topology tag is found under NoC

vpr/src/base/setup_noc.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include "vtr_math.h"
1010

1111

12-
void setup_noc(const t_arch& arch, std::string noc_router_tile_name)
12+
void setup_noc(const t_arch& arch)
1313
{
1414

1515
// variable to store all the noc router tiles within the FPGA device
@@ -21,7 +21,7 @@ void setup_noc(const t_arch& arch, std::string noc_router_tile_name)
2121

2222
// go through the FPGA grid and find the noc router tiles
2323
// then store the position
24-
identify_and_store_noc_router_tile_positions(device_ctx.grid,list_of_noc_router_tiles, noc_router_tile_name);
24+
identify_and_store_noc_router_tile_positions(device_ctx.grid,list_of_noc_router_tiles, arch.noc->noc_router_tile_name);
2525

2626
// check whether the noc topology information provided uses more than the number of available routers in the FPGA
2727
if (list_of_noc_router_tiles.size() < arch.noc->router_list.size())

vpr/src/base/setup_noc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ struct t_noc_router_tile_position {
2929
};
3030

3131

32-
void setup_noc(const t_arch& arch, std::string noc_router_tile_name);
32+
void setup_noc(const t_arch& arch);
3333

3434
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);
3535

0 commit comments

Comments
 (0)