@@ -618,6 +618,37 @@ struct ParsePlaceBoundingBox {
618
618
}
619
619
};
620
620
621
+ struct ParsePlacementFreq {
622
+ ConvertedValue<e_place_freq> from_str (const std::string& str) {
623
+ ConvertedValue<e_place_freq> conv_value;
624
+ if (str == " once" ) {
625
+ conv_value.set_value (e_place_freq::ONCE);
626
+ } else if (str == " always" ) {
627
+ conv_value.set_value (e_place_freq::ALWAYS);
628
+ } else {
629
+ std::stringstream msg;
630
+ msg << " Invalid conversion from '" << str << " ' to e_place_freq (expected one of: " << argparse::join (default_choices (), " , " ) << " )" ;
631
+ conv_value.set_error (msg.str ());
632
+ }
633
+ return conv_value;
634
+ }
635
+
636
+ ConvertedValue<std::string> to_str (e_place_freq val) {
637
+ ConvertedValue<std::string> conv_value;
638
+ if (val == e_place_freq::ONCE) {
639
+ conv_value.set_value (" once" );
640
+ } else {
641
+ VTR_ASSERT (val == e_place_freq::ALWAYS);
642
+ conv_value.set_value (" always" );
643
+ }
644
+ return conv_value;
645
+ }
646
+
647
+ std::vector<std::string> default_choices () {
648
+ return {" once" , " always" };
649
+ }
650
+ };
651
+
621
652
struct ParsePlaceAgentAlgorithm {
622
653
ConvertedValue<e_agent_algorithm> from_str (const std::string& str) {
623
654
ConvertedValue<e_agent_algorithm> conv_value;
@@ -2343,6 +2374,12 @@ argparse::ArgumentParser create_arg_parser(const std::string& prog_name, t_optio
2343
2374
.choices ({" auto_bb" , " cube_bb" , " per_layer_bb" })
2344
2375
.show_in (argparse::ShowIn::HELP_ONLY);
2345
2376
2377
+ place_grp.add_argument <e_place_freq, ParsePlacementFreq>(args.place_placement_freq , " --place_frequency" )
2378
+ .help (" Run placement every time or only once during channel width search." )
2379
+ .default_value (" once" )
2380
+ .choices ({" once, always" })
2381
+ .show_in (argparse::ShowIn::HELP_ONLY);
2382
+
2346
2383
place_grp.add_argument <bool , ParseOnOff>(args.RL_agent_placement , " --RL_agent_placement" )
2347
2384
.help (
2348
2385
" Uses a Reinforcement Learning (RL) agent in choosing the appropriate move type in placement."
0 commit comments