mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-10-31 03:32:29 +00:00 
			
		
		
		
	Display values of outputs
This commit is contained in:
		
							parent
							
								
									226dc659f0
								
							
						
					
					
						commit
						40018e191b
					
				
					 1 changed files with 10 additions and 12 deletions
				
			
		|  | @ -885,6 +885,7 @@ struct SimWorker : SimShared | ||||||
| 		SigMap sigmap(topmod); | 		SigMap sigmap(topmod); | ||||||
| 		log ("Get inputs\n"); | 		log ("Get inputs\n"); | ||||||
| 		std::map<Wire*,fstHandle> inputs; | 		std::map<Wire*,fstHandle> inputs; | ||||||
|  | 		std::map<Wire*,fstHandle> outputs; | ||||||
| 
 | 
 | ||||||
| 		for (auto wire : topmod->wires()) { | 		for (auto wire : topmod->wires()) { | ||||||
| 			if (wire->port_input) { | 			if (wire->port_input) { | ||||||
|  | @ -892,6 +893,11 @@ struct SimWorker : SimShared | ||||||
| 				log("Input %s\n",log_id(wire)); | 				log("Input %s\n",log_id(wire)); | ||||||
| 				inputs[wire] = id; | 				inputs[wire] = id; | ||||||
| 			} | 			} | ||||||
|  | 			if (wire->port_output) { | ||||||
|  | 				fstHandle id = fst->getHandle(scope + "." + RTLIL::unescape_id(wire->name)); | ||||||
|  | 				log("Output %s %d\n",log_id(wire), id); | ||||||
|  | 				outputs[wire] = id; | ||||||
|  | 			} | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		fst->reconstruct(fst_clock); | 		fst->reconstruct(fst_clock); | ||||||
|  | @ -903,19 +909,11 @@ struct SimWorker : SimShared | ||||||
| 				top->set_state(item.first, Const::from_string(v)); | 				top->set_state(item.first, Const::from_string(v)); | ||||||
| 			} | 			} | ||||||
| 			update(); | 			update(); | ||||||
| 
 | 			for(auto &item : outputs) { | ||||||
| 			/*Wire *wire = topmod->wire("\\cnt");
 | 				Const fst_val = Const::from_string(fst->valueAt(item.second, time)); | ||||||
| 			Const value = top->get_state(wire); | 				Const sim_val = top->get_state(item.first); | ||||||
| 			std::stringstream ss; | 				log("%s %s\n", log_signal(fst_val), log_signal(sim_val)); | ||||||
| 			for (int i = GetSize(value)-1; i >= 0; i--) { |  | ||||||
| 				switch (value[i]) { |  | ||||||
| 					case State::S0: ss << "0"; break; |  | ||||||
| 					case State::S1: ss << "1"; break; |  | ||||||
| 					case State::Sx: ss << "x"; break; |  | ||||||
| 					default: ss << "z"; |  | ||||||
| 				} |  | ||||||
| 			} | 			} | ||||||
| 			log("%s\n",ss.str().c_str());*/ |  | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
| }; | }; | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue