71 log_header(
"Executing IOPADMAP pass (mapping inputs/outputs to IO-PAD cells).\n");
73 std::string inpad_celltype, inpad_portname, inpad_portname2;
74 std::string outpad_celltype, outpad_portname, outpad_portname2;
75 std::string inoutpad_celltype, inoutpad_portname, inoutpad_portname2;
76 std::string widthparam, nameparam;
77 bool flag_bits =
false;
80 for (argidx = 1; argidx <
args.size(); argidx++)
82 std::string arg =
args[argidx];
83 if (arg ==
"-inpad" && argidx+2 <
args.size()) {
84 inpad_celltype =
args[++argidx];
85 inpad_portname =
args[++argidx];
89 if (arg ==
"-outpad" && argidx+2 <
args.size()) {
90 outpad_celltype =
args[++argidx];
91 outpad_portname =
args[++argidx];
95 if (arg ==
"-inoutpad" && argidx+2 <
args.size()) {
96 inoutpad_celltype =
args[++argidx];
97 inoutpad_portname =
args[++argidx];
101 if (arg ==
"-widthparam" && argidx+1 <
args.size()) {
102 widthparam =
args[++argidx];
105 if (arg ==
"-nameparam" && argidx+1 <
args.size()) {
106 nameparam =
args[++argidx];
109 if (arg ==
"-bits") {
121 if (!design->
selected(module) || module->get_bool_attribute(
"\\blackbox"))
124 for (
auto &it2 : module->
wires_)
131 std::string celltype, portname, portname2;
134 if (inpad_celltype.empty()) {
138 celltype = inpad_celltype;
139 portname = inpad_portname;
140 portname2 = inpad_portname2;
143 if (outpad_celltype.empty()) {
147 celltype = outpad_celltype;
148 portname = outpad_portname;
149 portname2 = outpad_portname2;
152 if (inoutpad_celltype.empty()) {
156 celltype = inoutpad_celltype;
157 portname = inoutpad_portname;
158 portname2 = inoutpad_portname2;
162 if (!flag_bits && wire->
width != 1 && widthparam.empty()) {
170 if (!portname2.empty()) {
177 for (
int i = 0; i < wire->
width; i++)
181 if (!portname2.empty())
183 if (!widthparam.empty())
185 if (!nameparam.empty())
194 if (!portname2.empty())
196 if (!widthparam.empty())
198 if (!nameparam.empty())
bool selected(T1 *module) const
std::string stringf(const char *fmt,...)
RTLIL::Cell * addCell(RTLIL::IdString name, RTLIL::IdString type)
void log_header(const char *format,...)
std::map< RTLIL::IdString, RTLIL::Wire * > wires_
void setPort(RTLIL::IdString portname, RTLIL::SigSpec signal)
void swap_names(RTLIL::Wire *w1, RTLIL::Wire *w2)
std::map< RTLIL::IdString, RTLIL::Const > parameters
static std::string escape_id(std::string str)
USING_YOSYS_NAMESPACE PRIVATE_NAMESPACE_BEGIN void split_portname_pair(std::string &port1, std::string &port2)
RTLIL::Wire * addWire(RTLIL::IdString name, int width=1)
static const char * id2cstr(const RTLIL::IdString &str)
std::map< RTLIL::IdString, RTLIL::Module * > modules_
void log(const char *format,...)
void extra_args(std::vector< std::string > args, size_t argidx, RTLIL::Design *design, bool select=true)