105 std::string top_module =
"top";
106 std::string arch_name =
"spartan6";
107 std::string edif_file;
108 std::string run_from, run_to;
111 for (argidx = 1; argidx <
args.size(); argidx++)
113 if (
args[argidx] ==
"-top" && argidx+1 <
args.size()) {
114 top_module =
args[++argidx];
117 if (
args[argidx] ==
"-arch" && argidx+1 <
args.size()) {
118 arch_name =
args[++argidx];
121 if (
args[argidx] ==
"-edif" && argidx+1 <
args.size()) {
122 edif_file =
args[++argidx];
125 if (
args[argidx] ==
"-run" && argidx+1 <
args.size()) {
126 size_t pos =
args[argidx+1].find(
':');
127 if (pos == std::string::npos)
129 run_from =
args[++argidx].substr(0, pos);
130 run_to =
args[argidx].substr(pos+1);
138 log_cmd_error(
"This comannd only operates on fully selected designs!\n");
140 if (arch_name ==
"spartan6") {
143 if (arch_name ==
"artix7") {
146 if (arch_name ==
"kintex7") {
149 if (arch_name ==
"zynq7000") {
152 log_cmd_error(
"Architecture '%s' is not supported!\n", arch_name.c_str());
154 bool active = run_from.empty();
159 if (
check_label(active, run_from, run_to,
"begin"))
164 if (
check_label(active, run_from, run_to,
"coarse"))
180 if (
check_label(active, run_from, run_to,
"map_luts"))
186 if (
check_label(active, run_from, run_to,
"map_cells"))
188 Pass::call(design,
"techmap -share_map xilinx/cells.v");
192 if (
check_label(active, run_from, run_to,
"clkbuf"))
194 Pass::call(design,
stringf(
"select -set xilinx_clocks %s/t:FDRE %%x:+FDRE[C] %s/t:FDRE %%d", top_module.c_str(), top_module.c_str()));
195 Pass::call(design,
"iopadmap -inpad BUFGP O:I @xilinx_clocks");
198 if (
check_label(active, run_from, run_to,
"iobuf"))
200 Pass::call(design,
stringf(
"select -set xilinx_nonclocks %s/w:* %s/t:BUFGP %%x:+BUFGP[I] %%d", top_module.c_str(), top_module.c_str()));
201 Pass::call(design,
"iopadmap -outpad OBUF I:O -inpad IBUF O:I @xilinx_nonclocks");
206 if (!edif_file.empty())
std::string stringf(const char *fmt,...)
USING_YOSYS_NAMESPACE PRIVATE_NAMESPACE_BEGIN bool check_label(bool &active, std::string run_from, std::string run_to, std::string label)
void log_header(const char *format,...)
bool full_selection() const
void log_cmd_error(const char *format,...)
void extra_args(std::vector< std::string > args, size_t argidx, RTLIL::Design *design, bool select=true)
static void call(RTLIL::Design *design, std::string command)