Skip to content

Set the maximum pres_fac #2523

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

Merged
merged 22 commits into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
1744d6c
vpr: router: cap pres_fac to 1000
amin1377 Mar 27, 2024
b456298
Merge branch 'master' of https://github.com/verilog-to-routing/vtr-ve…
amin1377 Apr 1, 2024
c9da9d4
vpr: add max_pres_fac to command line argument
amin1377 Apr 1, 2024
8f86b04
vpr: show max_pres_fac in log
amin1377 Apr 1, 2024
3efa8a2
vpr: set the max pres fac of router to the value pass through the com…
amin1377 Apr 1, 2024
9855a8e
document: add max_pres_fac to online document
amin1377 Apr 1, 2024
a472c96
make format
amin1377 Apr 1, 2024
d38956b
Merge branch 'master' of https://github.com/verilog-to-routing/vtr-ve…
amin1377 Apr 2, 2024
5276017
vpr: fix a type. set max pres fac
amin1377 Apr 2, 2024
26380cc
Merge branch 'master' of https://github.com/verilog-to-routing/vtr-ve…
amin1377 May 16, 2024
e6af24c
[CLI] add doc for max_pres_fac
amin1377 May 16, 2024
33ea049
[vpr][route] set pres fac before calling update_draw_pres_fac
amin1377 May 16, 2024
c8a3e22
Merge branch 'master' of https://github.com/verilog-to-routing/vtr-ve…
amin1377 May 22, 2024
9978c70
Merge branch 'pres_fac_max' of https://github.com/verilog-to-routing/…
amin1377 May 22, 2024
81604de
[vpr][router] solve the bug with update_draw_pres_fac
amin1377 May 22, 2024
ba8c455
[vpr][placement] fix comment
amin1377 May 23, 2024
a66176c
[test] update nightly_test_2 golden results
amin1377 May 23, 2024
43b2c4a
Merge branch 'master' of https://github.com/verilog-to-routing/vtr-ve…
amin1377 May 28, 2024
27839bd
[test] update nightly_test_1 golden result
amin1377 May 29, 2024
7bea33f
[vpr][router] fix fuction signiture
amin1377 May 29, 2024
313eb02
fix a typo
amin1377 May 29, 2024
24d69c0
Merge branch 'master' into pres_fac_max
amin1377 May 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions doc/src/vpr/command_line_usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1163,6 +1163,12 @@ VPR uses a negotiated congestion algorithm (based on Pathfinder) to perform rout

**Default:** ``1.3``

.. option:: --max_pres_fac <float>

Sets the maximum present overuse penalty factor.

**Default:** ``1000.0``

.. option:: --acc_fac <float>

Specifies the accumulated overuse factor (historical congestion cost factor).
Expand Down
51 changes: 25 additions & 26 deletions libs/libarchfpga/src/read_fpga_interchange_arch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,28 @@

#ifdef VTR_ENABLE_CAPNPROTO

#include <algorithm>
#include <kj/std/iostream.h>
#include <limits>
#include <map>
#include <regex>
#include <set>
#include <stdlib.h>
#include <string>
#include <string.h>
#include <zlib.h>
#include <sstream>

#include "vtr_assert.h"
#include "vtr_digest.h"
#include "vtr_log.h"
#include "vtr_memory.h"
#include "vtr_util.h"

#include "arch_check.h"
#include "arch_error.h"
#include "arch_util.h"
#include "arch_types.h"

# include <algorithm>
# include <kj/std/iostream.h>
# include <limits>
# include <map>
# include <regex>
# include <set>
# include <stdlib.h>
# include <string>
# include <string.h>
# include <zlib.h>
# include <sstream>

# include "vtr_assert.h"
# include "vtr_digest.h"
# include "vtr_log.h"
# include "vtr_memory.h"
# include "vtr_util.h"

# include "arch_check.h"
# include "arch_error.h"
# include "arch_util.h"
# include "arch_types.h"

/*
* FPGA Interchange Device frontend
Expand Down Expand Up @@ -2503,7 +2502,7 @@ struct ArchReader {
}
};

#endif // VTR_ENABLE_CAPNPROTO
#endif // VTR_ENABLE_CAPNPROTO

void FPGAInterchangeReadArch(const char* FPGAInterchangeDeviceFile,
const bool /*timing_enabled*/,
Expand Down Expand Up @@ -2551,12 +2550,12 @@ void FPGAInterchangeReadArch(const char* FPGAInterchangeDeviceFile,

ArchReader reader(arch, device_reader, FPGAInterchangeDeviceFile, PhysicalTileTypes, LogicalBlockTypes);
reader.read_arch();
#else // VTR_ENABLE_CAPNPROTO
#else // VTR_ENABLE_CAPNPROTO
// If CAPNPROTO is disabled, throw an error.
(void)FPGAInterchangeDeviceFile;
(void)arch;
(void)PhysicalTileTypes;
(void)LogicalBlockTypes;
throw vtr::VtrError("Unable to read FPGA interchange if CAPNPROTO is not enabled", __FILE__, __LINE__);
#endif // VTR_ENABLE_CAPNPROTO
#endif // VTR_ENABLE_CAPNPROTO
}
16 changes: 8 additions & 8 deletions libs/libarchfpga/src/read_fpga_interchange_arch.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@

#ifdef VTR_ENABLE_CAPNPROTO

#include "DeviceResources.capnp.h"
#include "LogicalNetlist.capnp.h"
#include "capnp/serialize.h"
#include "capnp/serialize-packed.h"
#include <fcntl.h>
#include <unistd.h>

#endif // VTR_ENABLE_CAPNPROTO
# include "DeviceResources.capnp.h"
# include "LogicalNetlist.capnp.h"
# include "capnp/serialize.h"
# include "capnp/serialize-packed.h"
# include <fcntl.h>
# include <unistd.h>

#endif // VTR_ENABLE_CAPNPROTO

#ifdef __cplusplus
extern "C" {
Expand Down
1 change: 1 addition & 0 deletions vpr/src/base/SetupVPR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@ static void SetupRouterOpts(const t_options& Options, t_router_opts* RouterOpts)
RouterOpts->min_incremental_reroute_fanout = Options.min_incremental_reroute_fanout;
RouterOpts->incr_reroute_delay_ripup = Options.incr_reroute_delay_ripup;
RouterOpts->pres_fac_mult = Options.pres_fac_mult;
RouterOpts->max_pres_fac = Options.max_pres_fac;
RouterOpts->route_type = Options.RouteType;

RouterOpts->full_stats = Options.full_stats;
Expand Down
2 changes: 2 additions & 0 deletions vpr/src/base/ShowSetup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ static void ShowRouterOpts(const t_router_opts& RouterOpts) {
VTR_LOG("RouterOpts.first_iter_pres_fac: %f\n", RouterOpts.first_iter_pres_fac);
VTR_LOG("RouterOpts.initial_pres_fac: %f\n", RouterOpts.initial_pres_fac);
VTR_LOG("RouterOpts.pres_fac_mult: %f\n", RouterOpts.pres_fac_mult);
VTR_LOG("RouterOpts.max_pres_fac: %f\n", RouterOpts.max_pres_fac);
VTR_LOG("RouterOpts.max_router_iterations: %d\n", RouterOpts.max_router_iterations);
VTR_LOG("RouterOpts.min_incremental_reroute_fanout: %d\n", RouterOpts.min_incremental_reroute_fanout);
VTR_LOG("RouterOpts.do_check_rr_graph: %s\n", RouterOpts.do_check_rr_graph ? "true" : "false");
Expand Down Expand Up @@ -473,6 +474,7 @@ static void ShowRouterOpts(const t_router_opts& RouterOpts) {
VTR_LOG("RouterOpts.first_iter_pres_fac: %f\n", RouterOpts.first_iter_pres_fac);
VTR_LOG("RouterOpts.initial_pres_fac: %f\n", RouterOpts.initial_pres_fac);
VTR_LOG("RouterOpts.pres_fac_mult: %f\n", RouterOpts.pres_fac_mult);
VTR_LOG("RouterOpts.max_pres_fac: %f\n", RouterOpts.max_pres_fac);
VTR_LOG("RouterOpts.max_router_iterations: %d\n", RouterOpts.max_router_iterations);
VTR_LOG("RouterOpts.min_incremental_reroute_fanout: %d\n", RouterOpts.min_incremental_reroute_fanout);
VTR_LOG("RouterOpts.do_check_rr_graph: %s\n", RouterOpts.do_check_rr_graph ? "true" : "false");
Expand Down
60 changes: 30 additions & 30 deletions vpr/src/base/read_interchange_netlist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,33 @@

#ifdef VTR_ENABLE_CAPNPROTO

#include <cmath>
#include <limits>
#include <kj/std/iostream.h>
#include <regex>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <zlib.h>
#include <iostream>
#include <sstream>

#include "LogicalNetlist.capnp.h"
#include "capnp/serialize.h"
#include "capnp/serialize-packed.h"

#include "vtr_assert.h"
#include "vtr_hash.h"
#include "vtr_util.h"
#include "vtr_log.h"
#include "vtr_logic.h"
#include "vtr_time.h"
#include "vtr_digest.h"

#include "vpr_types.h"
#include "vpr_error.h"
#include "globals.h"
#include "arch_types.h"
# include <cmath>
# include <limits>
# include <kj/std/iostream.h>
# include <regex>
# include <string>
# include <unordered_map>
# include <unordered_set>
# include <zlib.h>
# include <iostream>
# include <sstream>

# include "LogicalNetlist.capnp.h"
# include "capnp/serialize.h"
# include "capnp/serialize-packed.h"

# include "vtr_assert.h"
# include "vtr_hash.h"
# include "vtr_util.h"
# include "vtr_log.h"
# include "vtr_logic.h"
# include "vtr_time.h"
# include "vtr_digest.h"

# include "vpr_types.h"
# include "vpr_error.h"
# include "globals.h"
# include "arch_types.h"

struct NetlistReader {
public:
Expand Down Expand Up @@ -524,7 +524,7 @@ struct NetlistReader {
}
};

#endif // VTR_ENABLE_CAPNPROTO
#endif // VTR_ENABLE_CAPNPROTO

AtomNetlist read_interchange_netlist(const char* ic_netlist_file,
t_arch& arch) {
Expand Down Expand Up @@ -572,12 +572,12 @@ AtomNetlist read_interchange_netlist(const char* ic_netlist_file,

return netlist;

#else // VTR_ENABLE_CAPNPROTO
#else // VTR_ENABLE_CAPNPROTO

// If CAPNPROTO is not enabled, throw an error
(void)ic_netlist_file;
(void)arch;
throw vtr::VtrError("Unable to read interchange netlist with CAPNPROTO disabled", __FILE__, __LINE__);

#endif // VTR_ENABLE_CAPNPROTO
#endif // VTR_ENABLE_CAPNPROTO
}
5 changes: 5 additions & 0 deletions vpr/src/base/read_options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2339,6 +2339,11 @@ argparse::ArgumentParser create_arg_parser(const std::string& prog_name, t_optio
.default_value("1.3")
.show_in(argparse::ShowIn::HELP_ONLY);

route_grp.add_argument(args.max_pres_fac, "-max_pres_fac")
.help("Sets the maximum present overuse penalty factor")
.default_value("1000.0")
.show_in(argparse::ShowIn::HELP_ONLY);

route_grp.add_argument(args.acc_fac, "--acc_fac")
.help("Specifies the accumulated overuse factor (historical congestion cost factor)")
.default_value("1.0")
Expand Down
1 change: 1 addition & 0 deletions vpr/src/base/read_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ struct t_options {
argparse::ArgValue<float> first_iter_pres_fac;
argparse::ArgValue<float> initial_pres_fac;
argparse::ArgValue<float> pres_fac_mult;
argparse::ArgValue<float> max_pres_fac;
argparse::ArgValue<float> acc_fac;
argparse::ArgValue<int> bb_factor;
argparse::ArgValue<e_base_cost_type> base_cost_type;
Expand Down
1 change: 1 addition & 0 deletions vpr/src/base/vpr_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -1407,6 +1407,7 @@ struct t_router_opts {
float first_iter_pres_fac;
float initial_pres_fac;
float pres_fac_mult;
float max_pres_fac;
float acc_fac;
float bend_cost;
int max_router_iterations;
Expand Down
2 changes: 1 addition & 1 deletion vpr/src/noc/noc_link.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ NocLink::NocLink(NocLinkId link_id, NocRouterId source, NocRouterId sink, double
, source_router(source)
, sink_router(sink)
, bandwidth_usage(0.0)
, bandwidth(bw) { }
, bandwidth(bw) {}

// getters
NocRouterId NocLink::get_source_router(void) const {
Expand Down
3 changes: 1 addition & 2 deletions vpr/src/noc/noc_link.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class NocLink {
NocRouterId sink_router; /*!< The router which uses this link as an incoming edge*/

double bandwidth_usage; /*!< Represents the bandwidth of the data being transmitted on the link. Units in bits-per-second(bps)*/
double bandwidth; /*!< Represents the maximum bits per second that can be transmitted over the link without causing congestion*/
double bandwidth; /*!< Represents the maximum bits per second that can be transmitted over the link without causing congestion*/

public:
NocLink(NocLinkId link_id, NocRouterId source_router, NocRouterId sink_router, double bw);
Expand Down Expand Up @@ -135,7 +135,6 @@ class NocLink {
*/
void set_bandwidth(double new_bandwidth);


/**
* @brief Returns the unique link ID. The ID can be used to index
* vtr::vector<NoCLinkId, ...> instances.
Expand Down
2 changes: 1 addition & 1 deletion vpr/src/noc/noc_storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const NocLink& NocStorage::get_single_noc_link(NocLinkId id) const {
return link_storage[id];
}

NocLinkId NocStorage::get_single_noc_link_id(NocRouterId src_router, NocRouterId dst_router) const {
NocLinkId NocStorage::get_single_noc_link_id(NocRouterId src_router, NocRouterId dst_router) const {
NocLinkId link_id = NocLinkId::INVALID();

for (const auto& link : link_storage) {
Expand Down
2 changes: 1 addition & 1 deletion vpr/src/noc/noc_storage.h
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ class NocStorage {
* to the destination router. NocLinkId::INVALID() is such a link is not
* found.
*/
NocLinkId get_single_noc_link_id(NocRouterId src_router, NocRouterId dst_router) const;
NocLinkId get_single_noc_link_id(NocRouterId src_router, NocRouterId dst_router) const;

/**
* @brief Given a unique link identifier, get the corresponding link
Expand Down
1 change: 0 additions & 1 deletion vpr/src/place/initial_noc_placement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ static void noc_routers_anneal(const t_noc_opts& noc_opts) {
const double starting_prob = 0.5;
const double prob_step = starting_prob / N_MOVES;


// The checkpoint stored the placement with the lowest cost.
NoCPlacementCheckpoint checkpoint;

Expand Down
Loading