mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-10-30 19:22:31 +00:00 
			
		
		
		
	Support cell name in btor witness file
This commit is contained in:
		
							parent
							
								
									d340f302f6
								
							
						
					
					
						commit
						b72c779204
					
				
					 1 changed files with 14 additions and 5 deletions
				
			
		|  | @ -1290,12 +1290,21 @@ struct SimWorker : SimShared | ||||||
| 					RTLIL::IdString escaped_s = RTLIL::escape_id(signal_name(parts[len-1])); | 					RTLIL::IdString escaped_s = RTLIL::escape_id(signal_name(parts[len-1])); | ||||||
| 					if (len==3) { | 					if (len==3) { | ||||||
| 						Wire *w = topmod->wire(escaped_s); | 						Wire *w = topmod->wire(escaped_s); | ||||||
| 						if (!w) | 						if (!w) { | ||||||
| 							log_warning("Wire %s not present in module %s\n",log_id(escaped_s),log_id(topmod)); | 							Cell *c = topmod->cell(escaped_s); | ||||||
| 						if (w && (int)parts[1].size() != w->width) | 							if (!c) | ||||||
| 							log_error("Size of wire %s is different than provided data.\n", log_signal(w)); | 								log_warning("Wire/cell %s not present in module %s\n",log_id(escaped_s),log_id(topmod)); | ||||||
| 						if (w) | 							else if (c->type.in(ID($anyconst), ID($anyseq))) { | ||||||
|  | 								SigSpec sig_y= c->getPort(ID::Y); | ||||||
|  | 								if ((int)parts[1].size() != GetSize(sig_y)) | ||||||
|  | 									log_error("Size of wire %s is different than provided data.\n", log_signal(sig_y)); | ||||||
|  | 								top->set_state(sig_y, Const::from_string(parts[1])); | ||||||
|  | 							} | ||||||
|  | 						} else { | ||||||
|  | 							if ((int)parts[1].size() != w->width) | ||||||
|  | 								log_error("Size of wire %s is different than provided data.\n", log_signal(w)); | ||||||
| 							top->set_state(w, Const::from_string(parts[1])); | 							top->set_state(w, Const::from_string(parts[1])); | ||||||
|  | 						} | ||||||
| 					} else { | 					} else { | ||||||
| 						Cell *c = topmod->cell(escaped_s); | 						Cell *c = topmod->cell(escaped_s); | ||||||
| 						if (!c) | 						if (!c) | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue