summaryrefslogtreecommitdiff
path: root/passes/opt/opt.cc
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2014-08-30 19:37:12 +0200
committerClifford Wolf <clifford@clifford.at>2014-08-30 19:37:12 +0200
commit2a1b08aeb34b7d5f2df1a43c9ef1f99abacb9cae (patch)
tree858accdb45dd772e8a9ffb8556e6faf6bca7b6f8 /passes/opt/opt.cc
parent4724d94fbce587b39cd7343dc8de3b859311f55c (diff)
Added design->scratchpad
Diffstat (limited to 'passes/opt/opt.cc')
-rw-r--r--passes/opt/opt.cc11
1 files changed, 4 insertions, 7 deletions
diff --git a/passes/opt/opt.cc b/passes/opt/opt.cc
index b6d36f0e..b20521d1 100644
--- a/passes/opt/opt.cc
+++ b/passes/opt/opt.cc
@@ -17,14 +17,11 @@
*
*/
-#include "opt_status.h"
#include "kernel/register.h"
#include "kernel/log.h"
#include <stdlib.h>
#include <stdio.h>
-bool OPT_DID_SOMETHING;
-
struct OptPass : public Pass {
OptPass() : Pass("opt", "perform simple optimizations") { }
virtual void help()
@@ -113,9 +110,9 @@ struct OptPass : public Pass {
while (1) {
Pass::call(design, "opt_const" + opt_const_args);
Pass::call(design, "opt_share");
- OPT_DID_SOMETHING = false;
+ design->scratchpad_unset("opt.did_something");
Pass::call(design, "opt_rmdff");
- if (OPT_DID_SOMETHING == false)
+ if (design->scratchpad_get_bool("opt.did_something") == false)
break;
Pass::call(design, "opt_clean" + opt_clean_args);
log_header("Rerunning OPT passes. (Removed registers in this run.)\n");
@@ -127,14 +124,14 @@ struct OptPass : public Pass {
Pass::call(design, "opt_const" + opt_const_args);
Pass::call(design, "opt_share -nomux");
while (1) {
- OPT_DID_SOMETHING = false;
+ design->scratchpad_unset("opt.did_something");
Pass::call(design, "opt_muxtree");
Pass::call(design, "opt_reduce" + opt_reduce_args);
Pass::call(design, "opt_share");
Pass::call(design, "opt_rmdff");
Pass::call(design, "opt_clean" + opt_clean_args);
Pass::call(design, "opt_const" + opt_const_args);
- if (OPT_DID_SOMETHING == false)
+ if (design->scratchpad_get_bool("opt.did_something") == false)
break;
log_header("Rerunning OPT passes. (Maybe there is more to do..)\n");
}