mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-10-29 18:52:30 +00:00 
			
		
		
		
	
							parent
							
								
									c39ebe6ae0
								
							
						
					
					
						commit
						b4a4cb081d
					
				
					 2 changed files with 37 additions and 1 deletions
				
			
		|  | @ -801,11 +801,31 @@ struct TechmapWorker | ||||||
| 									} | 									} | ||||||
| 								} | 								} | ||||||
| 
 | 
 | ||||||
|  | 								// Handle outputs first, as these cannot be remapped.
 | ||||||
| 								for (auto &conn : cell->connections()) | 								for (auto &conn : cell->connections()) | ||||||
|  | 								{ | ||||||
|  | 									Wire *twire = tpl->wire(conn.first); | ||||||
|  | 									if (!twire->port_output) | ||||||
|  | 										continue; | ||||||
|  | 
 | ||||||
|  | 									for (int i = 0; i < GetSize(conn.second); i++) { | ||||||
|  | 										RTLIL::SigBit bit = sigmap(conn.second[i]); | ||||||
|  | 										RTLIL::SigBit tplbit(twire, i); | ||||||
|  | 										cellbits_to_tplbits[bit] = tplbit; | ||||||
|  | 									} | ||||||
|  | 								} | ||||||
|  | 
 | ||||||
|  | 								// Now handle inputs, remapping as necessary.
 | ||||||
|  | 								for (auto &conn : cell->connections()) | ||||||
|  | 								{ | ||||||
|  | 									Wire *twire = tpl->wire(conn.first); | ||||||
|  | 									if (twire->port_output) | ||||||
|  | 										continue; | ||||||
|  | 
 | ||||||
| 									for (int i = 0; i < GetSize(conn.second); i++) | 									for (int i = 0; i < GetSize(conn.second); i++) | ||||||
| 									{ | 									{ | ||||||
| 										RTLIL::SigBit bit = sigmap(conn.second[i]); | 										RTLIL::SigBit bit = sigmap(conn.second[i]); | ||||||
| 										RTLIL::SigBit tplbit(tpl->wire(conn.first), i); | 										RTLIL::SigBit tplbit(twire, i); | ||||||
| 
 | 
 | ||||||
| 										if (bit.wire == nullptr) | 										if (bit.wire == nullptr) | ||||||
| 										{ | 										{ | ||||||
|  | @ -820,6 +840,7 @@ struct TechmapWorker | ||||||
| 										else | 										else | ||||||
| 											cellbits_to_tplbits[bit] = tplbit; | 											cellbits_to_tplbits[bit] = tplbit; | ||||||
| 									} | 									} | ||||||
|  | 								} | ||||||
| 
 | 
 | ||||||
| 								RTLIL::SigSig port_conn; | 								RTLIL::SigSig port_conn; | ||||||
| 								for (auto &it : port_connmap) { | 								for (auto &it : port_connmap) { | ||||||
|  |  | ||||||
							
								
								
									
										15
									
								
								tests/techmap/bug2321.ys
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								tests/techmap/bug2321.ys
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,15 @@ | ||||||
|  | read_verilog <<EOT | ||||||
|  | module m (input i, output o); | ||||||
|  | wire [1023:0] _TECHMAP_DO_00_ = "CONSTMAP; "; | ||||||
|  | endmodule | ||||||
|  | EOT | ||||||
|  | 
 | ||||||
|  | design -stash map | ||||||
|  | 
 | ||||||
|  | read_verilog <<EOT | ||||||
|  | module top(output o); | ||||||
|  | m m (.o(o), .i(o)); | ||||||
|  | endmodule | ||||||
|  | EOT | ||||||
|  | 
 | ||||||
|  | techmap -map %map | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue