mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-04 13:29:12 +00:00 
			
		
		
		
	Merge pull request #800 from whitequark/write_verilog_tribuf
write_verilog: write $tribuf cell as ternary
This commit is contained in:
		
						commit
						81581f24fc
					
				
					 1 changed files with 12 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -816,6 +816,18 @@ bool dump_cell_expr(std::ostream &f, std::string indent, RTLIL::Cell *cell)
 | 
			
		|||
		return true;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (cell->type == "$tribuf")
 | 
			
		||||
	{
 | 
			
		||||
		f << stringf("%s" "assign ", indent.c_str());
 | 
			
		||||
		dump_sigspec(f, cell->getPort("\\Y"));
 | 
			
		||||
		f << stringf(" = ");
 | 
			
		||||
		dump_sigspec(f, cell->getPort("\\EN"));
 | 
			
		||||
		f << stringf(" ? ");
 | 
			
		||||
		dump_sigspec(f, cell->getPort("\\A"));
 | 
			
		||||
		f << stringf(" : %d'bz;\n", cell->parameters.at("\\WIDTH").as_int());
 | 
			
		||||
		return true;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (cell->type == "$slice")
 | 
			
		||||
	{
 | 
			
		||||
		f << stringf("%s" "assign ", indent.c_str());
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue