-
Notifications
You must be signed in to change notification settings - Fork 0
/
yosys.patch
55 lines (53 loc) · 1.74 KB
/
yosys.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
diff --git a/kernel/driver.cc b/kernel/driver.cc
index b55f0283..05987113 100644
--- a/kernel/driver.cc
+++ b/kernel/driver.cc
@@ -198,6 +198,7 @@ int main(int argc, char **argv)
std::string backend_command = "auto";
std::vector<std::string> vlog_defines;
std::vector<std::string> passes_commands;
+ std::vector<std::string> passes_commands_before;
std::vector<std::string> plugin_filenames;
std::string output_filename = "";
std::string scriptfile = "";
@@ -274,7 +275,10 @@ int main(int argc, char **argv)
#endif
printf("\n");
printf(" -p command\n");
- printf(" execute the commands\n");
+ printf(" execute the commands after input file processing\n");
+ printf("\n");
+ printf(" -Z command\n");
+ printf(" execute the commands before input file processing\n");
printf("\n");
printf(" -m module_file\n");
printf(" load the specified module (aka plugin)\n");
@@ -342,7 +346,7 @@ int main(int argc, char **argv)
}
int opt;
- while ((opt = getopt(argc, argv, "MXAQTVSgm:f:Hh:b:o:p:l:L:qv:tds:c:W:w:e:r:D:P:E:x:")) != -1)
+ while ((opt = getopt(argc, argv, "MXAQTVSgm:f:Hh:b:o:p:Z:l:L:qv:tds:c:W:w:e:r:D:P:E:x:")) != -1)
{
switch (opt)
{
@@ -388,7 +392,11 @@ int main(int argc, char **argv)
case 'p':
passes_commands.push_back(optarg);
run_shell = false;
break;
+ case 'Z':
+ passes_commands_before.push_back(optarg);
+ run_shell = false;
+ break;
case 'o':
output_filename = optarg;
run_shell = false;
@@ -519,6 +526,9 @@ int main(int argc, char **argv)
run_pass(vdef_cmd);
}
+ for (auto&& cmd : passes_commands_before)
+ run_pass(cmd);
+
while (optind < argc)
if (run_frontend(argv[optind++], frontend_command))
run_shell = false;