mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-10-27 01:39:23 +00:00 
			
		
		
		
	write_verilog: dump zero width sigspecs correctly.
Before this commit, zero width sigspecs were dumped as "" (empty string). Unfortunately, 1364-2005 5.2.3.3 indicates that an empty string is equivalent to "\0", and is 8 bits wide, so that's wrong. After this commit, a replication operation with a count of zero is used instead, which is explicitly permitted per 1364-2005 5.1.14, and is defined to have size zero. (Its operand has to have a non-zero size for it to be legal, though.) PR #1203 has addressed this issue before, but in an incomplete way.
This commit is contained in:
		
							parent
							
								
									8e91857fab
								
							
						
					
					
						commit
						86f2804dc3
					
				
					 1 changed files with 2 additions and 1 deletions
				
			
		|  | @ -358,7 +358,8 @@ void dump_sigchunk(std::ostream &f, const RTLIL::SigChunk &chunk, bool no_decima | |||
| void dump_sigspec(std::ostream &f, const RTLIL::SigSpec &sig) | ||||
| { | ||||
| 	if (GetSize(sig) == 0) { | ||||
| 		f << "\"\""; | ||||
| 		// See IEEE 1364-2005 Clause 5.1.14.
 | ||||
| 		f << "{0{1'b0}}"; | ||||
| 		return; | ||||
| 	} | ||||
| 	if (sig.is_chunk()) { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue