-
Notifications
You must be signed in to change notification settings - Fork 387
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
[AP] Added AP Flow to VPR #2746
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/** | ||
* @file | ||
* @author Alex Singer | ||
* @date September 2024 | ||
* @brief Implementation of the Analytical Placement flow. | ||
*/ | ||
|
||
#include "analytical_placement_flow.h" | ||
#include "atom_netlist.h" | ||
#include "globals.h" | ||
#include "prepack.h" | ||
#include "vpr_context.h" | ||
#include "vpr_error.h" | ||
#include "vpr_types.h" | ||
#include "vtr_time.h" | ||
|
||
void run_analytical_placement_flow(t_vpr_setup& vpr_setup) { | ||
(void)vpr_setup; | ||
// Start an overall timer for the Analytical Placement flow. | ||
vtr::ScopedStartFinishTimer timer("Analytical Placement Flow"); | ||
|
||
// The global state used/modified by this flow. | ||
const AtomNetlist& atom_nlist = g_vpr_ctx.atom().nlist; | ||
const DeviceContext& device_ctx = g_vpr_ctx.device(); | ||
|
||
// Run the prepacker | ||
Prepacker prepacker; | ||
prepacker.init(atom_nlist, device_ctx.logical_block_types); | ||
|
||
// AP is currently under-construction. Fail gracefully just in case this | ||
// is somehow being called. | ||
VPR_FATAL_ERROR(VPR_ERROR_AP, | ||
"Analytical Placement flow not implemented yet"); | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/** | ||
* @file | ||
* @author Alex Singer | ||
* @date September 2024 | ||
* @brief Methods for running the Analytical Placement flow. | ||
*/ | ||
|
||
#pragma once | ||
|
||
// Forward declarations | ||
struct t_vpr_setup; | ||
|
||
/** | ||
* @brief Run the Analaytical Placement flow. | ||
* | ||
* @param vpr_setup The setup options provided by the user. | ||
*/ | ||
void run_analytical_placement_flow(t_vpr_setup& vpr_setup); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -97,6 +97,7 @@ void SetupVPR(const t_options* Options, | |
t_netlist_opts* NetlistOpts, | ||
t_packer_opts* PackerOpts, | ||
t_placer_opts* PlacerOpts, | ||
t_ap_opts* APOpts, | ||
t_annealing_sched* AnnealSched, | ||
t_router_opts* RouterOpts, | ||
t_analysis_opts* AnalysisOpts, | ||
|
@@ -244,11 +245,13 @@ void SetupVPR(const t_options* Options, | |
if (!Options->do_packing | ||
&& !Options->do_legalize | ||
&& !Options->do_placement | ||
&& !Options->do_analytical_placement | ||
&& !Options->do_routing | ||
&& !Options->do_analysis) { | ||
//run all stages if none specified | ||
PackerOpts->doPacking = STAGE_DO; | ||
PlacerOpts->doPlacement = STAGE_DO; | ||
APOpts->doAP = STAGE_SKIP; // AP not default. | ||
RouterOpts->doRouting = STAGE_DO; | ||
AnalysisOpts->doAnalysis = STAGE_AUTO; //Deferred until implementation status known | ||
} else { | ||
|
@@ -276,6 +279,12 @@ void SetupVPR(const t_options* Options, | |
PlacerOpts->doPlacement = STAGE_DO; | ||
} | ||
|
||
if (Options->do_analytical_placement) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe comment why: analytical placement performs both packing & placement with an integrated algorithm. |
||
PackerOpts->doPacking = STAGE_SKIP; | ||
PlacerOpts->doPlacement = STAGE_SKIP; | ||
APOpts->doAP = STAGE_DO; | ||
} | ||
|
||
if (Options->do_packing) { | ||
PackerOpts->doPacking = STAGE_DO; | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1324,6 +1324,11 @@ argparse::ArgumentParser create_arg_parser(const std::string& prog_name, t_optio | |
.action(argparse::Action::STORE_TRUE) | ||
.default_value("off"); | ||
|
||
stage_grp.add_argument<bool, ParseOnOff>(args.do_analytical_placement, "--analytical_place") | ||
.help("Run analytical placement") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd expand on this .help. Should say analytical placement uses an integrated packing & placement algorithm. (Reason to explain this: otherwise it would make more sense for us to just have another set of placement options, but not a different stage). |
||
.action(argparse::Action::STORE_TRUE) | ||
.default_value("off"); | ||
|
||
stage_grp.add_argument<bool, ParseOnOff>(args.do_routing, "--route") | ||
.help("Run routing") | ||
.action(argparse::Action::STORE_TRUE) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1143,6 +1143,26 @@ struct t_placer_opts { | |
bool enable_analytic_placer; | ||
}; | ||
|
||
|
||
/****************************************************************** | ||
* Analytical Placer data types | ||
*******************************************************************/ | ||
|
||
/** | ||
* @brief Various options for the Analytical Placer. | ||
* | ||
* @param doAnalyticalPlacement | ||
* True if analytical placement is supposed to be done in the CAD | ||
* flow. False if otherwise. | ||
*/ | ||
struct t_ap_opts { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I know we've got lots of types in this file already, but I wonder if the t_ap_ops should go in the analytical_place directory (maybe ap_types.h) instead? Don't worry about it if that would be a big refactor or be more trouble than it is worth due to being inconsistent with other opts. |
||
e_stage_action doAP; | ||
}; | ||
|
||
/****************************************************************** | ||
* Router data types | ||
*******************************************************************/ | ||
|
||
/* All the parameters controlling the router's operation are in this * | ||
* structure. * | ||
* first_iter_pres_fac: Present sharing penalty factor used for the * | ||
|
@@ -1712,6 +1732,7 @@ struct t_vpr_setup { | |
t_netlist_opts NetlistOpts; ///<Options for packer | ||
t_packer_opts PackerOpts; ///<Options for packer | ||
t_placer_opts PlacerOpts; ///<Options for placer | ||
t_ap_opts APOpts; ///<Options for analytical placer | ||
t_annealing_sched AnnealSched; ///<Placement option annealing schedule | ||
t_router_opts RouterOpts; ///<router options | ||
t_analysis_opts AnalysisOpts; ///<Analysis options | ||
|
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.
Device size isn't fixed in the constraints file; it's specified either in the arch file or can be specified on the command line.