Skip to content

Commit 0b7e606

Browse files
authored
Merge pull request #1569 from georgkrylov/infra_changes_for_mixing
Changes to enable custom ODIN configuration to vtr_flow experiments
2 parents de52413 + 703907b commit 0b7e606

File tree

13 files changed

+916
-26
lines changed

13 files changed

+916
-26
lines changed

ODIN_II/SRC/odin_ii.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ void get_options(int argc, char** argv) {
572572
global_args.verilog_files.value().size() > 0 //have a verilog input list
573573
})) {
574574
parser.print_usage();
575-
error_message(PARSE_ARGS, unknown_location, "%s", "Must include only one of either:\n\ta config file(-c)\n\ta blif file(-b)\n\ta verilog file(-V)\n");
575+
warning_message(PARSE_ARGS, unknown_location, "%s", "Must include only one of either:\n\ta config file(-c)\n\ta blif file(-b)\n\ta verilog file(-V)\nUnless is used for infrastructure directly\n");
576576
}
577577

578578
//adjust thread count

ODIN_II/SRC/read_xml_config_file.cpp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ void read_debug_switches(pugi::xml_node a_node, config_t* config, const pugiutil
4444
void read_optimizations(pugi::xml_node a_node, config_t* config, const pugiutil::loc_data& loc_data);
4545
void set_default_optimization_settings(config_t* config);
4646

47+
extern HardSoftLogicMixer* mixer;
48+
4749
/*-------------------------------------------------------------------------
4850
* (function: read_config_file)
4951
* This reads an XML config file that specifies what we will do in the tool.
@@ -217,6 +219,27 @@ void read_optimizations(pugi::xml_node a_node, config_t* config, const pugiutil:
217219
config->split_hard_multiplier = 1;
218220
}
219221

222+
child = get_single_child(a_node, "mix_soft_hard_blocks", loc_data, OPTIONAL);
223+
if (child != NULL) {
224+
prop = get_attribute(child, "mults_ratio", loc_data, OPTIONAL).as_string(NULL);
225+
if (prop != NULL) {
226+
float ratio = atof(prop);
227+
if (ratio >= 0.0 && ratio <= 1.0) {
228+
delete mixer->_opts[MULTIPLY];
229+
mixer->_opts[MULTIPLY] = new MultsOpt(ratio);
230+
}
231+
}
232+
233+
prop = get_attribute(child, "exact_mults", loc_data, OPTIONAL).as_string(NULL);
234+
if (prop != NULL) {
235+
int exact = atoi(prop);
236+
if (exact >= 0) {
237+
delete mixer->_opts[MULTIPLY];
238+
mixer->_opts[MULTIPLY] = new MultsOpt(exact);
239+
}
240+
}
241+
}
242+
220243
child = get_single_child(a_node, "memory", loc_data, OPTIONAL);
221244
if (child != NULL) {
222245
prop = get_attribute(child, "split_memory_width", loc_data, OPTIONAL).as_string(NULL);
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<config>
2+
<verilog_files>
3+
<!-- Leave empty to be able to test with config-->
4+
</verilog_files>
5+
<output>
6+
<!-- Leave empty to be able to test with config-->
7+
</output>
8+
<optimizations>
9+
<!-- This is where the optimization flags go -->
10+
<mix_soft_hard_blocks mults_ratio="0.5"></mix_soft_hard_blocks>
11+
</optimizations>
12+
<debug_outputs>
13+
<!-- Leave empty to be able to test with config-->
14+
</debug_outputs>
15+
</config>

0 commit comments

Comments
 (0)