mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-04 13:29:12 +00:00 
			
		
		
		
	Fix for all zero mask
This commit is contained in:
		
							parent
							
								
									079c1205fe
								
							
						
					
					
						commit
						7c62318239
					
				
					 2 changed files with 16 additions and 1 deletions
				
			
		
							
								
								
									
										6
									
								
								Makefile
									
										
									
									
									
								
							
							
						
						
									
										6
									
								
								Makefile
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -1,5 +1,5 @@
 | 
			
		|||
 | 
			
		||||
CONFIG := clang
 | 
			
		||||
CONFIG := icc
 | 
			
		||||
# CONFIG := gcc
 | 
			
		||||
# CONFIG := gcc-4.6
 | 
			
		||||
# CONFIG := emcc
 | 
			
		||||
| 
						 | 
				
			
			@ -109,6 +109,10 @@ ABCMKARGS += ARCHFLAGS="-DSIZEOF_VOID_P=4 -DSIZEOF_LONG=4 -DSIZEOF_INT=4 -DWIN32
 | 
			
		|||
ABCMKARGS += LIBS="lib/x86/pthreadVC2.lib -s" READLINE=0 CC="$(CXX)" CXX="$(CXX)"
 | 
			
		||||
EXE = .exe
 | 
			
		||||
 | 
			
		||||
else ifeq ($(CONFIG),icc)
 | 
			
		||||
CXX = icpc
 | 
			
		||||
CXXFLAGS += -std=gnu++0x -Os
 | 
			
		||||
 | 
			
		||||
else ifneq ($(CONFIG),none)
 | 
			
		||||
$(error Invalid CONFIG setting '$(CONFIG)'. Valid values: clang, gcc, gcc-4.6, emcc, none)
 | 
			
		||||
endif
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -234,12 +234,23 @@ struct BlifDumper
 | 
			
		|||
				f << stringf(" %s", cstr(output));
 | 
			
		||||
				f << stringf("\n");
 | 
			
		||||
				RTLIL::SigSpec mask = cell->parameters.at("\\LUT");
 | 
			
		||||
				bool one = false;
 | 
			
		||||
				for (int i = 0; i < (1 << width); i++)
 | 
			
		||||
					if (mask[i] == RTLIL::S1) {
 | 
			
		||||
						for (int j = width-1; j >= 0; j--) {
 | 
			
		||||
							f << ((i>>j)&1 ? '1' : '0');
 | 
			
		||||
						}
 | 
			
		||||
						f << " 1\n";
 | 
			
		||||
						one = true;
 | 
			
		||||
					}
 | 
			
		||||
				/* For some reason, sometimes we get LUTs with
 | 
			
		||||
				 * an all zero mask, which won't give any
 | 
			
		||||
				 * .names entries, so write one entry with
 | 
			
		||||
				 * all don't cares */
 | 
			
		||||
				if (!one) {
 | 
			
		||||
					for (int j = width-1; j >= 0; j--)
 | 
			
		||||
						f << '-';
 | 
			
		||||
					f << " 0\n";
 | 
			
		||||
				}
 | 
			
		||||
				continue;
 | 
			
		||||
			}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue