3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-06-12 17:06:15 +00:00

ilang, ast: Store parameter order and default value information.

Fixes #1819, #1820.
This commit is contained in:
Marcelina Kościelnicka 2020-04-16 15:51:03 +02:00
parent 79efaa65ad
commit 06a344efcb
6 changed files with 27 additions and 9 deletions

View file

@ -290,8 +290,16 @@ void ILANG_BACKEND::dump_module(std::ostream &f, std::string indent, RTLIL::Modu
if (!module->avail_parameters.empty()) {
if (only_selected)
f << stringf("\n");
for (auto &p : module->avail_parameters)
f << stringf("%s" " parameter %s\n", indent.c_str(), p.c_str());
for (const auto &p : module->avail_parameters) {
const auto &it = module->parameter_default_values.find(p);
if (it == module->parameter_default_values.end()) {
f << stringf("%s" " parameter %s\n", indent.c_str(), p.c_str());
} else {
f << stringf("%s" " parameter %s ", indent.c_str(), p.c_str());
dump_const(f, it->second);
f << stringf("\n");
}
}
}
}