blob: d44eb630c4c5e1886959a7374d3b62fcd7fad825 [file]
#include "get_nets.h"
USING_YOSYS_NAMESPACE
std::string GetNets::TypeName() { return "net"; }
std::string GetNets::SelectionType() { return "w"; }
void GetNets::ExtractSelection(Tcl_Obj* tcl_list, RTLIL::Module* module,
Filters& filters, bool is_quiet) {
for (auto wire : module->selected_wires()) {
if (filters.size() > 0) {
Filter filter = filters.at(0);
std::string attr_value = wire->get_string_attribute(
RTLIL::IdString(RTLIL::escape_id(filter.first)));
if (attr_value.compare(filter.second)) {
continue;
}
}
if (!is_quiet) {
log("%s ", id2cstr(wire->name));
}
Tcl_Obj* value_obj = Tcl_NewStringObj(id2cstr(wire->name), -1);
Tcl_ListObjAppendElement(yosys_get_tcl_interp(), tcl_list, value_obj);
}
}