Skip to content

Commit 3185e60

Browse files
committed
Changed the precision of the noc constraints (noc link bandwidth, link latency, etc..) from integer to double
1 parent 4420969 commit 3185e60

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

libs/libarchfpga/src/physical_types.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1746,9 +1746,9 @@ struct t_router {
17461746
/* Network-on-chip(NoC) data type used to store the network
17471747
properties and used when builidng a dedicated on-chip network*/
17481748
struct t_noc_inf {
1749-
int link_bandwidth; // in Gbps
1750-
int link_latency; // in nanoseconds
1751-
int router_latency; // in nanoseconds
1749+
double link_bandwidth; // in Gbps
1750+
double link_latency; // in nanoseconds
1751+
double router_latency; // in nanoseconds
17521752

17531753
std::vector<t_router> router_list;
17541754

libs/libarchfpga/src/read_xml_arch_file.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4669,19 +4669,19 @@ static void ProcessNoc(pugi::xml_node noc_tag, t_arch* arch, const pugiutil::loc
46694669
pugiutil::expect_only_attributes(noc_tag, expected_noc_attributes, loc_data);
46704670

46714671
// now go through and parse the required attributes for noc tag
4672-
noc_ref->link_bandwidth = pugiutil::get_attribute(noc_tag, "link_bandwidth", loc_data, pugiutil::REQUIRED).as_int(attribute_conversion_failure);
4672+
noc_ref->link_bandwidth = pugiutil::get_attribute(noc_tag, "link_bandwidth", loc_data, pugiutil::REQUIRED).as_double(attribute_conversion_failure);
46734673

4674-
noc_ref->link_latency = pugiutil::get_attribute(noc_tag, "link_latency", loc_data, pugiutil::REQUIRED).as_int(attribute_conversion_failure);
4674+
noc_ref->link_latency = pugiutil::get_attribute(noc_tag, "link_latency", loc_data, pugiutil::REQUIRED).as_double(attribute_conversion_failure);
46754675

4676-
noc_ref->router_latency = pugiutil::get_attribute(noc_tag, "router_latency", loc_data, pugiutil::REQUIRED).as_int(attribute_conversion_failure);
4676+
noc_ref->router_latency = pugiutil::get_attribute(noc_tag, "router_latency", loc_data, pugiutil::REQUIRED).as_double(attribute_conversion_failure);
46774677

46784678
noc_ref->noc_router_tile_name = pugiutil::get_attribute(noc_tag, "noc_router_tile_name", loc_data, pugiutil::REQUIRED).as_string();
46794679

46804680
// the noc parameters can only be non-zero positive values
46814681
if ((noc_ref->link_bandwidth < 0) || (noc_ref->link_latency < 0) || (noc_ref->router_latency < 0))
46824682
{
46834683
archfpga_throw(loc_data.filename_c_str(), loc_data.line(noc_tag),
4684-
"The link bandwidth, link latency and router latency for the NoC must be a positive non-zero integer.");
4684+
"The link bandwidth, link latency and router latency for the NoC must be a positive non-zero value.");
46854685
}
46864686

46874687
// check that the router tile name was supplied properly

vpr/src/base/setup_noc.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -310,11 +310,11 @@ static void echo_noc(char* file_name)
310310
fprintf(fp, "NoC Constraints:\n");
311311
fprintf(fp, "--------------------------------------------------------------\n");
312312
fprintf(fp, "\n");
313-
fprintf(fp, "Maximum NoC Link Bandwidth: %d\n", noc_ctx.noc_link_bandwidth);
313+
fprintf(fp, "Maximum NoC Link Bandwidth: %f\n", noc_ctx.noc_link_bandwidth);
314314
fprintf(fp, "\n");
315-
fprintf(fp, "NoC Link Latency: %d\n", noc_ctx.noc_link_latency);
315+
fprintf(fp, "NoC Link Latency: %f\n", noc_ctx.noc_link_latency);
316316
fprintf(fp, "\n");
317-
fprintf(fp, "NoC Router Latency: %d\n", noc_ctx.noc_router_latency);
317+
fprintf(fp, "NoC Router Latency: %f\n", noc_ctx.noc_router_latency);
318318
fprintf(fp, "\n");
319319

320320
// print all the routers and their properties

vpr/src/base/vpr_context.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -431,17 +431,17 @@ struct NocContext : public Context {
431431
/**
432432
* @brief Represents the maximum allowed bandwidth for the links in the NoC (in Gbps)
433433
*/
434-
int noc_link_bandwidth;
434+
double noc_link_bandwidth;
435435

436436
/**
437437
* @brief Represents the delay expected when going through a link
438438
*/
439-
int noc_link_latency;
439+
double noc_link_latency;
440440

441441
/**
442442
* @brief Represents the expected delay when going through a router
443443
*/
444-
int noc_router_latency;
444+
double noc_router_latency;
445445
};
446446

447447
/**

0 commit comments

Comments
 (0)