mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-10-31 03:32:29 +00:00 
			
		
		
		
	Merge pull request #2273 from whitequark/write-verilog-always-star-initial
verilog_backend: in non-SV mode, add a trigger for `always @*`
This commit is contained in:
		
						commit
						f3d7e9a1df
					
				
					 1 changed files with 5 additions and 0 deletions
				
			
		|  | @ -1718,6 +1718,8 @@ void dump_process(std::ostream &f, std::string indent, RTLIL::Process *proc, boo | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	f << stringf("%s" "always%s begin\n", indent.c_str(), systemverilog ? "_comb" : " @*"); | 	f << stringf("%s" "always%s begin\n", indent.c_str(), systemverilog ? "_comb" : " @*"); | ||||||
|  | 	if (!systemverilog) | ||||||
|  | 		f << indent + "  " << "if (" << id("\\initial") << ") begin end\n"; | ||||||
| 	dump_case_body(f, indent, &proc->root_case, true); | 	dump_case_body(f, indent, &proc->root_case, true); | ||||||
| 
 | 
 | ||||||
| 	std::string backup_indent = indent; | 	std::string backup_indent = indent; | ||||||
|  | @ -1850,6 +1852,9 @@ void dump_module(std::ostream &f, std::string indent, RTLIL::Module *module) | ||||||
| 	} | 	} | ||||||
| 	f << stringf(");\n"); | 	f << stringf(");\n"); | ||||||
| 
 | 
 | ||||||
|  | 	if (!systemverilog && !module->processes.empty()) | ||||||
|  | 		f << indent + "  " << "reg " << id("\\initial") << " = 0;\n"; | ||||||
|  | 
 | ||||||
| 	for (auto w : module->wires()) | 	for (auto w : module->wires()) | ||||||
| 		dump_wire(f, indent + "  ", w); | 		dump_wire(f, indent + "  ", w); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue