3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-06-06 14:13:23 +00:00

Added design->scratchpad

This commit is contained in:
Clifford Wolf 2014-08-30 19:37:12 +02:00
parent 4724d94fbc
commit 2a1b08aeb3
10 changed files with 91 additions and 64 deletions

View file

@ -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");
}