2 * yosys -- Yosys Open SYnthesis Suite
4 * Copyright (C) 2012 Clifford Wolf <clifford@clifford.at>
6 * Permission to use, copy, modify, and/or distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies.
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20 #include "kernel/register.h"
21 #include "kernel/log.h"
26 PRIVATE_NAMESPACE_BEGIN
28 struct ProcPass
: public Pass
{
29 ProcPass() : Pass("proc", "translate processes to netlists") { }
30 void help() YS_OVERRIDE
32 // |---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|
34 log(" proc [options] [selection]\n");
36 log("This pass calls all the other proc_* passes in the most common order.\n");
39 log(" proc_rmdead\n");
44 log(" proc_dlatch\n");
48 log("This replaces the processes in the design with multiplexers,\n");
49 log("flip-flops and latches.\n");
51 log("The following options are supported:\n");
53 log(" -global_arst [!]<netname>\n");
54 log(" This option is passed through to proc_arst.\n");
57 log(" This option is passed through to proc_mux. proc_rmdead is not\n");
58 log(" executed in -ifx mode.\n");
61 void execute(std::vector
<std::string
> args
, RTLIL::Design
*design
) YS_OVERRIDE
63 std::string global_arst
;
66 log_header(design
, "Executing PROC pass (convert processes to netlists).\n");
70 for (argidx
= 1; argidx
< args
.size(); argidx
++)
72 if (args
[argidx
] == "-global_arst" && argidx
+1 < args
.size()) {
73 global_arst
= args
[++argidx
];
76 if (args
[argidx
] == "-ifx") {
82 extra_args(args
, argidx
, design
);
84 Pass::call(design
, "proc_clean");
86 Pass::call(design
, "proc_rmdead");
87 Pass::call(design
, "proc_prune");
88 Pass::call(design
, "proc_init");
89 if (global_arst
.empty())
90 Pass::call(design
, "proc_arst");
92 Pass::call(design
, "proc_arst -global_arst " + global_arst
);
93 Pass::call(design
, ifxmode
? "proc_mux -ifx" : "proc_mux");
94 Pass::call(design
, "proc_dlatch");
95 Pass::call(design
, "proc_dff");
96 Pass::call(design
, "proc_clean");
102 PRIVATE_NAMESPACE_END