mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-04 13:29:12 +00:00 
			
		
		
		
	Various indenting fixes in AST front-end (mostly space vs tab issues)
Signed-off-by: Clifford Wolf <clifford@clifford.at>
This commit is contained in:
		
							parent
							
								
									68304c6d17
								
							
						
					
					
						commit
						64e0582c29
					
				
					 3 changed files with 69 additions and 99 deletions
				
			
		| 
						 | 
					@ -172,8 +172,7 @@ bool AstNode::get_bool_attribute(RTLIL::IdString id)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	AstNode *attr = attributes.at(id);
 | 
						AstNode *attr = attributes.at(id);
 | 
				
			||||||
	if (attr->type != AST_CONSTANT)
 | 
						if (attr->type != AST_CONSTANT)
 | 
				
			||||||
		log_file_error(attr->filename, attr->linenum, "Attribute `%s' with non-constant value!\n",
 | 
							log_file_error(attr->filename, attr->linenum, "Attribute `%s' with non-constant value!\n", id.c_str());
 | 
				
			||||||
			       id.c_str());
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return attr->integer != 0;
 | 
						return attr->integer != 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -969,8 +968,7 @@ static AstModule* process_module(AstNode *ast, bool defer, AstNode *original_ast
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		for (auto &attr : ast->attributes) {
 | 
							for (auto &attr : ast->attributes) {
 | 
				
			||||||
			if (attr.second->type != AST_CONSTANT)
 | 
								if (attr.second->type != AST_CONSTANT)
 | 
				
			||||||
				log_file_error(ast->filename, ast->linenum, "Attribute `%s' with non-constant value!\n",
 | 
									log_file_error(ast->filename, ast->linenum, "Attribute `%s' with non-constant value!\n", attr.first.c_str());
 | 
				
			||||||
					       attr.first.c_str());
 | 
					 | 
				
			||||||
			current_module->attributes[attr.first] = attr.second->asAttrConst();
 | 
								current_module->attributes[attr.first] = attr.second->asAttrConst();
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		for (size_t i = 0; i < ast->children.size(); i++) {
 | 
							for (size_t i = 0; i < ast->children.size(); i++) {
 | 
				
			||||||
| 
						 | 
					@ -1061,8 +1059,7 @@ void AST::process(RTLIL::Design *design, AstNode *ast, bool dump_ast1, bool dump
 | 
				
			||||||
			if (design->has((*it)->str)) {
 | 
								if (design->has((*it)->str)) {
 | 
				
			||||||
				RTLIL::Module *existing_mod = design->module((*it)->str);
 | 
									RTLIL::Module *existing_mod = design->module((*it)->str);
 | 
				
			||||||
				if (!nooverwrite && !overwrite && !existing_mod->get_bool_attribute("\\blackbox")) {
 | 
									if (!nooverwrite && !overwrite && !existing_mod->get_bool_attribute("\\blackbox")) {
 | 
				
			||||||
					log_file_error((*it)->filename, (*it)->linenum, "Re-definition of module `%s'!\n",
 | 
										log_file_error((*it)->filename, (*it)->linenum, "Re-definition of module `%s'!\n", (*it)->str.c_str());
 | 
				
			||||||
						       (*it)->str.c_str());
 | 
					 | 
				
			||||||
				} else if (nooverwrite) {
 | 
									} else if (nooverwrite) {
 | 
				
			||||||
					log("Ignoring re-definition of module `%s' at %s:%d.\n",
 | 
										log("Ignoring re-definition of module `%s' at %s:%d.\n",
 | 
				
			||||||
							(*it)->str.c_str(), (*it)->filename.c_str(), (*it)->linenum);
 | 
												(*it)->str.c_str(), (*it)->filename.c_str(), (*it)->linenum);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -55,8 +55,7 @@ static RTLIL::SigSpec uniop2rtlil(AstNode *that, std::string type, int result_wi
 | 
				
			||||||
	if (gen_attributes)
 | 
						if (gen_attributes)
 | 
				
			||||||
		for (auto &attr : that->attributes) {
 | 
							for (auto &attr : that->attributes) {
 | 
				
			||||||
			if (attr.second->type != AST_CONSTANT)
 | 
								if (attr.second->type != AST_CONSTANT)
 | 
				
			||||||
				log_file_error(that->filename, that->linenum, "Attribute `%s' with non-constant value!\n",
 | 
									log_file_error(that->filename, that->linenum, "Attribute `%s' with non-constant value!\n", attr.first.c_str());
 | 
				
			||||||
					       attr.first.c_str());
 | 
					 | 
				
			||||||
			cell->attributes[attr.first] = attr.second->asAttrConst();
 | 
								cell->attributes[attr.first] = attr.second->asAttrConst();
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -89,8 +88,7 @@ static void widthExtend(AstNode *that, RTLIL::SigSpec &sig, int width, bool is_s
 | 
				
			||||||
	if (that != NULL)
 | 
						if (that != NULL)
 | 
				
			||||||
		for (auto &attr : that->attributes) {
 | 
							for (auto &attr : that->attributes) {
 | 
				
			||||||
			if (attr.second->type != AST_CONSTANT)
 | 
								if (attr.second->type != AST_CONSTANT)
 | 
				
			||||||
				log_file_error(that->filename, that->linenum, "Attribute `%s' with non-constant value!\n",
 | 
									log_file_error(that->filename, that->linenum, "Attribute `%s' with non-constant value!\n", attr.first.c_str());
 | 
				
			||||||
					       attr.first.c_str());
 | 
					 | 
				
			||||||
			cell->attributes[attr.first] = attr.second->asAttrConst();
 | 
								cell->attributes[attr.first] = attr.second->asAttrConst();
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -117,8 +115,7 @@ static RTLIL::SigSpec binop2rtlil(AstNode *that, std::string type, int result_wi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	for (auto &attr : that->attributes) {
 | 
						for (auto &attr : that->attributes) {
 | 
				
			||||||
		if (attr.second->type != AST_CONSTANT)
 | 
							if (attr.second->type != AST_CONSTANT)
 | 
				
			||||||
			log_file_error(that->filename, that->linenum, "Attribute `%s' with non-constant value!\n",
 | 
								log_file_error(that->filename, that->linenum, "Attribute `%s' with non-constant value!\n", attr.first.c_str());
 | 
				
			||||||
				       attr.first.c_str());
 | 
					 | 
				
			||||||
		cell->attributes[attr.first] = attr.second->asAttrConst();
 | 
							cell->attributes[attr.first] = attr.second->asAttrConst();
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -152,8 +149,7 @@ static RTLIL::SigSpec mux2rtlil(AstNode *that, const RTLIL::SigSpec &cond, const
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	for (auto &attr : that->attributes) {
 | 
						for (auto &attr : that->attributes) {
 | 
				
			||||||
		if (attr.second->type != AST_CONSTANT)
 | 
							if (attr.second->type != AST_CONSTANT)
 | 
				
			||||||
			log_file_error(that->filename, that->linenum, "Attribute `%s' with non-constant value!\n",
 | 
								log_file_error(that->filename, that->linenum, "Attribute `%s' with non-constant value!\n", attr.first.c_str());
 | 
				
			||||||
				       attr.first.c_str());
 | 
					 | 
				
			||||||
		cell->attributes[attr.first] = attr.second->asAttrConst();
 | 
							cell->attributes[attr.first] = attr.second->asAttrConst();
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -480,8 +476,7 @@ struct AST_INTERNAL::ProcessGenerator
 | 
				
			||||||
 | 
					
 | 
				
			||||||
				for (auto &attr : ast->attributes) {
 | 
									for (auto &attr : ast->attributes) {
 | 
				
			||||||
					if (attr.second->type != AST_CONSTANT)
 | 
										if (attr.second->type != AST_CONSTANT)
 | 
				
			||||||
						log_file_error(ast->filename, ast->linenum, "Attribute `%s' with non-constant value!\n",
 | 
											log_file_error(ast->filename, ast->linenum, "Attribute `%s' with non-constant value!\n", attr.first.c_str());
 | 
				
			||||||
							       attr.first.c_str());
 | 
					 | 
				
			||||||
					sw->attributes[attr.first] = attr.second->asAttrConst();
 | 
										sw->attributes[attr.first] = attr.second->asAttrConst();
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -648,8 +643,7 @@ void AstNode::detectSignWidthWorker(int &width_hint, bool &sign_hint, bool *foun
 | 
				
			||||||
				while (left_at_zero_ast->simplify(true, true, false, 1, -1, false, false)) { }
 | 
									while (left_at_zero_ast->simplify(true, true, false, 1, -1, false, false)) { }
 | 
				
			||||||
				while (right_at_zero_ast->simplify(true, true, false, 1, -1, false, false)) { }
 | 
									while (right_at_zero_ast->simplify(true, true, false, 1, -1, false, false)) { }
 | 
				
			||||||
				if (left_at_zero_ast->type != AST_CONSTANT || right_at_zero_ast->type != AST_CONSTANT)
 | 
									if (left_at_zero_ast->type != AST_CONSTANT || right_at_zero_ast->type != AST_CONSTANT)
 | 
				
			||||||
					log_file_error(filename, linenum, "Unsupported expression on dynamic range select on signal `%s'!\n",
 | 
										log_file_error(filename, linenum, "Unsupported expression on dynamic range select on signal `%s'!\n", str.c_str());
 | 
				
			||||||
						       str.c_str());
 | 
					 | 
				
			||||||
				this_width = left_at_zero_ast->integer - right_at_zero_ast->integer + 1;
 | 
									this_width = left_at_zero_ast->integer - right_at_zero_ast->integer + 1;
 | 
				
			||||||
				delete left_at_zero_ast;
 | 
									delete left_at_zero_ast;
 | 
				
			||||||
				delete right_at_zero_ast;
 | 
									delete right_at_zero_ast;
 | 
				
			||||||
| 
						 | 
					@ -799,8 +793,7 @@ void AstNode::detectSignWidthWorker(int &width_hint, bool &sign_hint, bool *foun
 | 
				
			||||||
	default:
 | 
						default:
 | 
				
			||||||
		for (auto f : log_files)
 | 
							for (auto f : log_files)
 | 
				
			||||||
			current_ast->dumpAst(f, "verilog-ast> ");
 | 
								current_ast->dumpAst(f, "verilog-ast> ");
 | 
				
			||||||
		log_file_error(filename, linenum, "Don't know how to detect sign and width for %s node!\n",
 | 
							log_file_error(filename, linenum, "Don't know how to detect sign and width for %s node!\n", type2str(type).c_str());
 | 
				
			||||||
			       type2str(type).c_str());
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (*found_real)
 | 
						if (*found_real)
 | 
				
			||||||
| 
						 | 
					@ -892,11 +885,9 @@ RTLIL::SigSpec AstNode::genRTLIL(int width_hint, bool sign_hint)
 | 
				
			||||||
	// create an RTLIL::Wire for an AST_WIRE node
 | 
						// create an RTLIL::Wire for an AST_WIRE node
 | 
				
			||||||
	case AST_WIRE: {
 | 
						case AST_WIRE: {
 | 
				
			||||||
			if (current_module->wires_.count(str) != 0)
 | 
								if (current_module->wires_.count(str) != 0)
 | 
				
			||||||
				log_file_error(filename, linenum, "Re-definition of signal `%s'!\n",
 | 
									log_file_error(filename, linenum, "Re-definition of signal `%s'!\n", str.c_str());
 | 
				
			||||||
					       str.c_str());
 | 
					 | 
				
			||||||
			if (!range_valid)
 | 
								if (!range_valid)
 | 
				
			||||||
				log_file_error(filename, linenum, "Signal `%s' with non-constant width!\n",
 | 
									log_file_error(filename, linenum, "Signal `%s' with non-constant width!\n", str.c_str());
 | 
				
			||||||
					       str.c_str());
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
			log_assert(range_left >= range_right || (range_left == -1 && range_right == 0));
 | 
								log_assert(range_left >= range_right || (range_left == -1 && range_right == 0));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -910,8 +901,7 @@ RTLIL::SigSpec AstNode::genRTLIL(int width_hint, bool sign_hint)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			for (auto &attr : attributes) {
 | 
								for (auto &attr : attributes) {
 | 
				
			||||||
				if (attr.second->type != AST_CONSTANT)
 | 
									if (attr.second->type != AST_CONSTANT)
 | 
				
			||||||
					log_file_error(filename, linenum, "Attribute `%s' with non-constant value!\n",
 | 
										log_file_error(filename, linenum, "Attribute `%s' with non-constant value!\n", attr.first.c_str());
 | 
				
			||||||
						       attr.first.c_str());
 | 
					 | 
				
			||||||
				wire->attributes[attr.first] = attr.second->asAttrConst();
 | 
									wire->attributes[attr.first] = attr.second->asAttrConst();
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
| 
						 | 
					@ -920,16 +910,14 @@ RTLIL::SigSpec AstNode::genRTLIL(int width_hint, bool sign_hint)
 | 
				
			||||||
	// create an RTLIL::Memory for an AST_MEMORY node
 | 
						// create an RTLIL::Memory for an AST_MEMORY node
 | 
				
			||||||
	case AST_MEMORY: {
 | 
						case AST_MEMORY: {
 | 
				
			||||||
			if (current_module->memories.count(str) != 0)
 | 
								if (current_module->memories.count(str) != 0)
 | 
				
			||||||
				log_file_error(filename, linenum, "Re-definition of memory `%s'!\n",
 | 
									log_file_error(filename, linenum, "Re-definition of memory `%s'!\n", str.c_str());
 | 
				
			||||||
					       str.c_str());
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
			log_assert(children.size() >= 2);
 | 
								log_assert(children.size() >= 2);
 | 
				
			||||||
			log_assert(children[0]->type == AST_RANGE);
 | 
								log_assert(children[0]->type == AST_RANGE);
 | 
				
			||||||
			log_assert(children[1]->type == AST_RANGE);
 | 
								log_assert(children[1]->type == AST_RANGE);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			if (!children[0]->range_valid || !children[1]->range_valid)
 | 
								if (!children[0]->range_valid || !children[1]->range_valid)
 | 
				
			||||||
				log_file_error(filename, linenum, "Memory `%s' with non-constant width or size!\n",
 | 
									log_file_error(filename, linenum, "Memory `%s' with non-constant width or size!\n", str.c_str());
 | 
				
			||||||
					       str.c_str());
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
			RTLIL::Memory *memory = new RTLIL::Memory;
 | 
								RTLIL::Memory *memory = new RTLIL::Memory;
 | 
				
			||||||
			memory->attributes["\\src"] = stringf("%s:%d", filename.c_str(), linenum);
 | 
								memory->attributes["\\src"] = stringf("%s:%d", filename.c_str(), linenum);
 | 
				
			||||||
| 
						 | 
					@ -946,8 +934,7 @@ RTLIL::SigSpec AstNode::genRTLIL(int width_hint, bool sign_hint)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			for (auto &attr : attributes) {
 | 
								for (auto &attr : attributes) {
 | 
				
			||||||
				if (attr.second->type != AST_CONSTANT)
 | 
									if (attr.second->type != AST_CONSTANT)
 | 
				
			||||||
					log_file_error(filename, linenum, "Attribute `%s' with non-constant value!\n",
 | 
										log_file_error(filename, linenum, "Attribute `%s' with non-constant value!\n", attr.first.c_str());
 | 
				
			||||||
						       attr.first.c_str());
 | 
					 | 
				
			||||||
				memory->attributes[attr.first] = attr.second->asAttrConst();
 | 
									memory->attributes[attr.first] = attr.second->asAttrConst();
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
| 
						 | 
					@ -966,8 +953,7 @@ RTLIL::SigSpec AstNode::genRTLIL(int width_hint, bool sign_hint)
 | 
				
			||||||
	case AST_REALVALUE:
 | 
						case AST_REALVALUE:
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
			RTLIL::SigSpec sig = realAsConst(width_hint);
 | 
								RTLIL::SigSpec sig = realAsConst(width_hint);
 | 
				
			||||||
			log_file_warning(filename, linenum, "converting real value %e to binary %s.\n",
 | 
								log_file_warning(filename, linenum, "converting real value %e to binary %s.\n", realvalue, log_signal(sig));
 | 
				
			||||||
					 realvalue, log_signal(sig));
 | 
					 | 
				
			||||||
			return sig;
 | 
								return sig;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -994,8 +980,7 @@ RTLIL::SigSpec AstNode::genRTLIL(int width_hint, bool sign_hint)
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			else if (id2ast->type == AST_PARAMETER || id2ast->type == AST_LOCALPARAM) {
 | 
								else if (id2ast->type == AST_PARAMETER || id2ast->type == AST_LOCALPARAM) {
 | 
				
			||||||
				if (id2ast->children[0]->type != AST_CONSTANT)
 | 
									if (id2ast->children[0]->type != AST_CONSTANT)
 | 
				
			||||||
					log_file_error(filename, linenum, "Parameter %s does not evaluate to constant value!\n",
 | 
										log_file_error(filename, linenum, "Parameter %s does not evaluate to constant value!\n", str.c_str());
 | 
				
			||||||
						       str.c_str());
 | 
					 | 
				
			||||||
				chunk = RTLIL::Const(id2ast->children[0]->bits);
 | 
									chunk = RTLIL::Const(id2ast->children[0]->bits);
 | 
				
			||||||
				goto use_const_chunk;
 | 
									goto use_const_chunk;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
| 
						 | 
					@ -1010,13 +995,11 @@ RTLIL::SigSpec AstNode::genRTLIL(int width_hint, bool sign_hint)
 | 
				
			||||||
				is_interface = true;
 | 
									is_interface = true;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			else {
 | 
								else {
 | 
				
			||||||
				log_file_error(filename, linenum, "Identifier `%s' doesn't map to any signal!\n",
 | 
									log_file_error(filename, linenum, "Identifier `%s' doesn't map to any signal!\n", str.c_str());
 | 
				
			||||||
						str.c_str());
 | 
					 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			if (id2ast->type == AST_MEMORY)
 | 
								if (id2ast->type == AST_MEMORY)
 | 
				
			||||||
				log_file_error(filename, linenum, "Identifier `%s' does map to an unexpanded memory!\n",
 | 
									log_file_error(filename, linenum, "Identifier `%s' does map to an unexpanded memory!\n", str.c_str());
 | 
				
			||||||
					       str.c_str());
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
			// If identifier is an interface, create a RTLIL::SigSpec with a dummy wire with a attribute called 'is_interface'
 | 
								// If identifier is an interface, create a RTLIL::SigSpec with a dummy wire with a attribute called 'is_interface'
 | 
				
			||||||
			// This makes it possible for the hierarchy pass to see what are interface connections and then replace them
 | 
								// This makes it possible for the hierarchy pass to see what are interface connections and then replace them
 | 
				
			||||||
| 
						 | 
					@ -1051,8 +1034,7 @@ RTLIL::SigSpec AstNode::genRTLIL(int width_hint, bool sign_hint)
 | 
				
			||||||
					while (left_at_zero_ast->simplify(true, true, false, 1, -1, false, false)) { }
 | 
										while (left_at_zero_ast->simplify(true, true, false, 1, -1, false, false)) { }
 | 
				
			||||||
					while (right_at_zero_ast->simplify(true, true, false, 1, -1, false, false)) { }
 | 
										while (right_at_zero_ast->simplify(true, true, false, 1, -1, false, false)) { }
 | 
				
			||||||
					if (left_at_zero_ast->type != AST_CONSTANT || right_at_zero_ast->type != AST_CONSTANT)
 | 
										if (left_at_zero_ast->type != AST_CONSTANT || right_at_zero_ast->type != AST_CONSTANT)
 | 
				
			||||||
						log_file_error(filename, linenum, "Unsupported expression on dynamic range select on signal `%s'!\n",
 | 
											log_file_error(filename, linenum, "Unsupported expression on dynamic range select on signal `%s'!\n", str.c_str());
 | 
				
			||||||
							       str.c_str());
 | 
					 | 
				
			||||||
					int width = left_at_zero_ast->integer - right_at_zero_ast->integer + 1;
 | 
										int width = left_at_zero_ast->integer - right_at_zero_ast->integer + 1;
 | 
				
			||||||
					AstNode *fake_ast = new AstNode(AST_NONE, clone(), children[0]->children.size() >= 2 ?
 | 
										AstNode *fake_ast = new AstNode(AST_NONE, clone(), children[0]->children.size() >= 2 ?
 | 
				
			||||||
							children[0]->children[1]->clone() : children[0]->children[0]->clone());
 | 
												children[0]->children[1]->clone() : children[0]->children[0]->clone());
 | 
				
			||||||
| 
						 | 
					@ -1436,8 +1418,7 @@ RTLIL::SigSpec AstNode::genRTLIL(int width_hint, bool sign_hint)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			for (auto &attr : attributes) {
 | 
								for (auto &attr : attributes) {
 | 
				
			||||||
				if (attr.second->type != AST_CONSTANT)
 | 
									if (attr.second->type != AST_CONSTANT)
 | 
				
			||||||
					log_file_error(filename, linenum, "Attribute `%s' with non-constant value!\n",
 | 
										log_file_error(filename, linenum, "Attribute `%s' with non-constant value!\n", attr.first.c_str());
 | 
				
			||||||
						       attr.first.c_str());
 | 
					 | 
				
			||||||
				cell->attributes[attr.first] = attr.second->asAttrConst();
 | 
									cell->attributes[attr.first] = attr.second->asAttrConst();
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1522,8 +1503,7 @@ RTLIL::SigSpec AstNode::genRTLIL(int width_hint, bool sign_hint)
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			for (auto &attr : attributes) {
 | 
								for (auto &attr : attributes) {
 | 
				
			||||||
				if (attr.second->type != AST_CONSTANT)
 | 
									if (attr.second->type != AST_CONSTANT)
 | 
				
			||||||
					log_file_error(filename, linenum, "Attribute `%s' with non-constant value!\n",
 | 
										log_file_error(filename, linenum, "Attribute `%s' with non-constant value!\n", attr.first.c_str());
 | 
				
			||||||
						       attr.first.c_str());
 | 
					 | 
				
			||||||
				cell->attributes[attr.first] = attr.second->asAttrConst();
 | 
									cell->attributes[attr.first] = attr.second->asAttrConst();
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
| 
						 | 
					@ -1561,8 +1541,7 @@ RTLIL::SigSpec AstNode::genRTLIL(int width_hint, bool sign_hint)
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
				if (width <= 0)
 | 
									if (width <= 0)
 | 
				
			||||||
					log_file_error(filename, linenum, "Failed to detect width of %s!\n",
 | 
										log_file_error(filename, linenum, "Failed to detect width of %s!\n", RTLIL::unescape_id(str).c_str());
 | 
				
			||||||
						       RTLIL::unescape_id(str).c_str());
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
				Cell *cell = current_module->addCell(myid, str.substr(1));
 | 
									Cell *cell = current_module->addCell(myid, str.substr(1));
 | 
				
			||||||
				cell->attributes["\\src"] = stringf("%s:%d", filename.c_str(), linenum);
 | 
									cell->attributes["\\src"] = stringf("%s:%d", filename.c_str(), linenum);
 | 
				
			||||||
| 
						 | 
					@ -1589,8 +1568,7 @@ RTLIL::SigSpec AstNode::genRTLIL(int width_hint, bool sign_hint)
 | 
				
			||||||
		for (auto f : log_files)
 | 
							for (auto f : log_files)
 | 
				
			||||||
			current_ast->dumpAst(f, "verilog-ast> ");
 | 
								current_ast->dumpAst(f, "verilog-ast> ");
 | 
				
			||||||
		type_name = type2str(type);
 | 
							type_name = type2str(type);
 | 
				
			||||||
		log_file_error(filename, linenum, "Don't know how to generate RTLIL code for %s node!\n",
 | 
							log_file_error(filename, linenum, "Don't know how to generate RTLIL code for %s node!\n", type_name.c_str());
 | 
				
			||||||
			       type_name.c_str());
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return RTLIL::SigSpec();
 | 
						return RTLIL::SigSpec();
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1312,8 +1312,7 @@ bool AstNode::simplify(bool const_fold, bool at_zero, bool in_lvalue, int stage,
 | 
				
			||||||
	if (type == AST_PRIMITIVE)
 | 
						if (type == AST_PRIMITIVE)
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		if (children.size() < 2)
 | 
							if (children.size() < 2)
 | 
				
			||||||
			log_file_error(filename, linenum, "Insufficient number of arguments for primitive `%s'!\n",
 | 
								log_file_error(filename, linenum, "Insufficient number of arguments for primitive `%s'!\n", str.c_str());
 | 
				
			||||||
				       str.c_str());
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
		std::vector<AstNode*> children_list;
 | 
							std::vector<AstNode*> children_list;
 | 
				
			||||||
		for (auto child : children) {
 | 
							for (auto child : children) {
 | 
				
			||||||
| 
						 | 
					@ -1328,8 +1327,7 @@ bool AstNode::simplify(bool const_fold, bool at_zero, bool in_lvalue, int stage,
 | 
				
			||||||
		if (str == "bufif0" || str == "bufif1" || str == "notif0" || str == "notif1")
 | 
							if (str == "bufif0" || str == "bufif1" || str == "notif0" || str == "notif1")
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
			if (children_list.size() != 3)
 | 
								if (children_list.size() != 3)
 | 
				
			||||||
				log_file_error(filename, linenum, "Invalid number of arguments for primitive `%s'!\n",
 | 
									log_file_error(filename, linenum, "Invalid number of arguments for primitive `%s'!\n", str.c_str());
 | 
				
			||||||
					       str.c_str());
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
			std::vector<RTLIL::State> z_const(1, RTLIL::State::Sz);
 | 
								std::vector<RTLIL::State> z_const(1, RTLIL::State::Sz);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1416,8 +1414,7 @@ bool AstNode::simplify(bool const_fold, bool at_zero, bool in_lvalue, int stage,
 | 
				
			||||||
			while (left_at_zero_ast->simplify(true, true, false, stage, -1, false, false)) { }
 | 
								while (left_at_zero_ast->simplify(true, true, false, stage, -1, false, false)) { }
 | 
				
			||||||
			while (right_at_zero_ast->simplify(true, true, false, stage, -1, false, false)) { }
 | 
								while (right_at_zero_ast->simplify(true, true, false, stage, -1, false, false)) { }
 | 
				
			||||||
			if (left_at_zero_ast->type != AST_CONSTANT || right_at_zero_ast->type != AST_CONSTANT)
 | 
								if (left_at_zero_ast->type != AST_CONSTANT || right_at_zero_ast->type != AST_CONSTANT)
 | 
				
			||||||
				log_file_error(filename, linenum, "Unsupported expression on dynamic range select on signal `%s'!\n",
 | 
									log_file_error(filename, linenum, "Unsupported expression on dynamic range select on signal `%s'!\n", str.c_str());
 | 
				
			||||||
					       str.c_str());
 | 
					 | 
				
			||||||
			result_width = abs(int(left_at_zero_ast->integer - right_at_zero_ast->integer)) + 1;
 | 
								result_width = abs(int(left_at_zero_ast->integer - right_at_zero_ast->integer)) + 1;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		did_something = true;
 | 
							did_something = true;
 | 
				
			||||||
| 
						 | 
					@ -1875,15 +1872,13 @@ skip_dynamic_range_lvalue_expansion:;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
				else if (str == "\\$rose")
 | 
									else if (str == "\\$rose")
 | 
				
			||||||
					newNode = new AstNode(AST_LOGIC_AND,
 | 
										newNode = new AstNode(AST_LOGIC_AND,
 | 
				
			||||||
						new AstNode(AST_LOGIC_NOT,
 | 
												new AstNode(AST_LOGIC_NOT, new AstNode(AST_BIT_AND, past, mkconst_int(1,false))),
 | 
				
			||||||
							new AstNode(AST_BIT_AND, past, mkconst_int(1,false))),
 | 
					 | 
				
			||||||
							new AstNode(AST_BIT_AND, present, mkconst_int(1,false)));
 | 
												new AstNode(AST_BIT_AND, present, mkconst_int(1,false)));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
				else if (str == "\\$fell")
 | 
									else if (str == "\\$fell")
 | 
				
			||||||
					newNode = new AstNode(AST_LOGIC_AND,
 | 
										newNode = new AstNode(AST_LOGIC_AND,
 | 
				
			||||||
							new AstNode(AST_BIT_AND, past, mkconst_int(1,false)),
 | 
												new AstNode(AST_BIT_AND, past, mkconst_int(1,false)),
 | 
				
			||||||
						new AstNode(AST_LOGIC_NOT,
 | 
												new AstNode(AST_LOGIC_NOT, new AstNode(AST_BIT_AND, present, mkconst_int(1,false))));
 | 
				
			||||||
							new AstNode(AST_BIT_AND, present, mkconst_int(1,false))));
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
				else
 | 
									else
 | 
				
			||||||
					log_abort();
 | 
										log_abort();
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue