mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-10-31 03:32:29 +00:00 
			
		
		
		
	smtbmc: Fix two .yw handling related crashes
These came up when using the experimental incremental interface and are also in code that was recently refactored to support that interface.
This commit is contained in:
		
							parent
							
								
									855ac285f4
								
							
						
					
					
						commit
						094fa8caba
					
				
					 1 changed files with 5 additions and 0 deletions
				
			
		|  | @ -719,6 +719,8 @@ def smt_extract_mask(smt_expr, mask): | ||||||
|     return combined_chunks, ''.join(mask_index_order[start:end] for start, end in chunks)[::-1] |     return combined_chunks, ''.join(mask_index_order[start:end] for start, end in chunks)[::-1] | ||||||
| 
 | 
 | ||||||
| def smt_concat(exprs): | def smt_concat(exprs): | ||||||
|  |     if not isinstance(exprs, (tuple, list)): | ||||||
|  |         exprs = tuple(exprs) | ||||||
|     if not exprs: |     if not exprs: | ||||||
|         return "" |         return "" | ||||||
|     if len(exprs) == 1: |     if len(exprs) == 1: | ||||||
|  | @ -818,6 +820,9 @@ def ywfile_constraints(inywfile, constr_assumes, map_steps=None, skip_x=False): | ||||||
|                 if not bits_re.match(bits): |                 if not bits_re.match(bits): | ||||||
|                     raise ValueError("unsupported bit value in Yosys witness file") |                     raise ValueError("unsupported bit value in Yosys witness file") | ||||||
| 
 | 
 | ||||||
|  |                 if bits.count('?') == len(bits): | ||||||
|  |                     continue | ||||||
|  | 
 | ||||||
|                 smt_expr = ywfile_signal(sig, map_steps.get(t, t)) |                 smt_expr = ywfile_signal(sig, map_steps.get(t, t)) | ||||||
| 
 | 
 | ||||||
|                 smt_expr, bits = smt_extract_mask(smt_expr, bits) |                 smt_expr, bits = smt_extract_mask(smt_expr, bits) | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue