yosys-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
simplify.cc File Reference
#include "kernel/log.h"
#include "libs/sha1/sha1.h"
#include "frontends/verilog/verilog_frontend.h"
#include "ast.h"
#include <sstream>
#include <stdarg.h>
#include <stdlib.h>
#include <math.h>
+ Include dependency graph for simplify.cc:

Go to the source code of this file.

Functions

static void replace_result_wire_name_in_function (AstNode *node, std::string &from, std::string &to)
 
static void mark_memories_assign_lhs_complex (std::map< AstNode *, std::set< std::string >> &mem2reg_places, std::map< AstNode *, uint32_t > &mem2reg_candidates, AstNode *that)
 

Function Documentation

static void mark_memories_assign_lhs_complex ( std::map< AstNode *, std::set< std::string >> &  mem2reg_places,
std::map< AstNode *, uint32_t > &  mem2reg_candidates,
AstNode that 
)
static

Definition at line 2187 of file simplify.cc.

2189 {
2190  for (auto &child : that->children)
2191  mark_memories_assign_lhs_complex(mem2reg_places, mem2reg_candidates, child);
2192 
2193  if (that->type == AST_IDENTIFIER && that->id2ast && that->id2ast->type == AST_MEMORY) {
2194  AstNode *mem = that->id2ast;
2195  if (!(mem2reg_candidates[mem] & AstNode::MEM2REG_FL_CMPLX_LHS))
2196  mem2reg_places[mem].insert(stringf("%s:%d", that->filename.c_str(), that->linenum));
2197  mem2reg_candidates[mem] |= AstNode::MEM2REG_FL_CMPLX_LHS;
2198  }
2199 }
std::string stringf(const char *fmt,...)
Definition: yosys.cc:58
AstNode * id2ast
Definition: ast.h:167
static void mark_memories_assign_lhs_complex(std::map< AstNode *, std::set< std::string >> &mem2reg_places, std::map< AstNode *, uint32_t > &mem2reg_candidates, AstNode *that)
Definition: simplify.cc:2187
AstNodeType type
Definition: ast.h:146
std::string filename
Definition: ast.h:175
std::vector< AstNode * > children
Definition: ast.h:149
int linenum
Definition: ast.h:176

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void replace_result_wire_name_in_function ( AstNode node,
std::string &  from,
std::string &  to 
)
static

Definition at line 2027 of file simplify.cc.

2028 {
2029  for (auto &it : node->children)
2031  if (node->str == from)
2032  node->str = to;
2033 }
static void replace_result_wire_name_in_function(AstNode *node, std::string &from, std::string &to)
Definition: simplify.cc:2027
std::string str
Definition: ast.h:156
std::vector< AstNode * > children
Definition: ast.h:149

+ Here is the caller graph for this function: