mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-10-31 11:42:30 +00:00 
			
		
		
		
	cxxrtl: speed up commits on clang.
On Minerva SoC SRAM compiled with clang-11, this change cuts commit time in half (!) and overall time by 20%. When compiled with gcc-10, there is no difference.
This commit is contained in:
		
							parent
							
								
									3d3ea5099d
								
							
						
					
					
						commit
						40ca9d038b
					
				
					 1 changed files with 3 additions and 3 deletions
				
			
		|  | @ -1702,19 +1702,19 @@ struct CxxrtlWorker { | |||
| 					continue; | ||||
| 				} | ||||
| 				if (!module->get_bool_attribute(ID(cxxrtl_blackbox)) || wire->port_id != 0) | ||||
| 					f << indent << "changed |= " << mangle(wire) << ".commit();\n"; | ||||
| 					f << indent << "if (" << mangle(wire) << ".commit()) changed = true;\n"; | ||||
| 			} | ||||
| 			if (!module->get_bool_attribute(ID(cxxrtl_blackbox))) { | ||||
| 				for (auto memory : module->memories) { | ||||
| 					if (!writable_memories[memory.second]) | ||||
| 						continue; | ||||
| 					f << indent << "changed |= " << mangle(memory.second) << ".commit();\n"; | ||||
| 					f << indent << "if (" << mangle(memory.second) << ".commit()) changed = true;\n"; | ||||
| 				} | ||||
| 				for (auto cell : module->cells()) { | ||||
| 					if (is_internal_cell(cell->type)) | ||||
| 						continue; | ||||
| 					const char *access = is_cxxrtl_blackbox_cell(cell) ? "->" : "."; | ||||
| 					f << indent << "changed |= " << mangle(cell) << access << "commit();\n"; | ||||
| 					f << indent << "if (" << mangle(cell) << access << "commit()) changed = true;\n"; | ||||
| 				} | ||||
| 			} | ||||
| 			f << indent << "return changed;\n"; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue