mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-10-30 19:22:31 +00:00 
			
		
		
		
	Merge pull request #4959 from YosysHQ/krys/primitive_array_error
simplify: Skip AST_PRIMITIVE in AST_CELLARRAY
This commit is contained in:
		
						commit
						5b8b5292ee
					
				
					 2 changed files with 11 additions and 1 deletions
				
			
		|  | @ -1759,7 +1759,7 @@ bool AstNode::simplify(bool const_fold, int stage, int width_hint, bool sign_hin | |||
| 			break; | ||||
| 		if (type == AST_GENBLOCK) | ||||
| 			break; | ||||
| 		if (type == AST_CELLARRAY && children[i]->type == AST_CELL) | ||||
| 		if (type == AST_CELLARRAY && (children[i]->type == AST_CELL || children[i]->type == AST_PRIMITIVE)) | ||||
| 			continue; | ||||
| 		if (type == AST_BLOCK && !str.empty()) | ||||
| 			break; | ||||
|  | @ -2752,6 +2752,7 @@ bool AstNode::simplify(bool const_fold, int stage, int width_hint, bool sign_hin | |||
| 			if (new_cell->type == AST_PRIMITIVE) { | ||||
| 				input_error("Cell arrays of primitives are currently not supported.\n"); | ||||
| 			} else { | ||||
| 				this->dumpAst(NULL, "    "); | ||||
| 				log_assert(new_cell->children.at(0)->type == AST_CELLTYPE); | ||||
| 				new_cell->children.at(0)->str = stringf("$array:%d:%d:%s", i, num, new_cell->children.at(0)->str.c_str()); | ||||
| 			} | ||||
|  |  | |||
							
								
								
									
										9
									
								
								tests/verilog/bug4785.ys
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								tests/verilog/bug4785.ys
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,9 @@ | |||
| logger -expect error "Cell arrays of primitives are currently not supported" 1 | ||||
| read_verilog <<EOT | ||||
| module test(in1, in2, out1); | ||||
|   input in1, in2; | ||||
|   output out1; | ||||
| 
 | ||||
|   nand  #2 t_nand[0:7](out1, in1, in2); | ||||
| endmodule | ||||
| EOT | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue