mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-10-31 11:42:30 +00:00 
			
		
		
		
	Changed users of cell->connections_ to the new API (sed command)
git grep -l 'connections_' | xargs sed -i -r -e '
	s/(->|\.)connections_\["([^"]*)"\] = (.*);/\1set("\2", \3);/g;
	s/(->|\.)connections_\["([^"]*)"\]/\1get("\2")/g;
	s/(->|\.)connections_.at\("([^"]*)"\)/\1get("\2")/g;
	s/(->|\.)connections_.push_back/\1connect/g;
	s/(->|\.)connections_/\1connections()/g;'
			
			
This commit is contained in:
		
							parent
							
								
									cd6574ecf6
								
							
						
					
					
						commit
						b7dda72302
					
				
					 61 changed files with 1201 additions and 1201 deletions
				
			
		|  | @ -58,9 +58,9 @@ static bool find_states(RTLIL::SigSpec sig, const RTLIL::SigSpec &dff_out, RTLIL | |||
| 			log("  unexpected cell type %s (%s) found in state selection tree.\n", cell->type.c_str(), cell->name.c_str()); | ||||
| 			return false; | ||||
| 		} | ||||
| 		RTLIL::SigSpec sig_a = assign_map(cell->connections_["\\A"]); | ||||
| 		RTLIL::SigSpec sig_b = assign_map(cell->connections_["\\B"]); | ||||
| 		RTLIL::SigSpec sig_s = assign_map(cell->connections_["\\S"]); | ||||
| 		RTLIL::SigSpec sig_a = assign_map(cell->get("\\A")); | ||||
| 		RTLIL::SigSpec sig_b = assign_map(cell->get("\\B")); | ||||
| 		RTLIL::SigSpec sig_s = assign_map(cell->get("\\S")); | ||||
| 		if (reset_state && RTLIL::SigSpec(*reset_state).is_fully_undef()) | ||||
| 			do { | ||||
| 				if (sig_a.is_fully_def()) | ||||
|  | @ -183,12 +183,12 @@ static void extract_fsm(RTLIL::Wire *wire) | |||
| 		if ((cell->type != "$dff" && cell->type != "$adff") || cellport.second != "\\Q") | ||||
| 			continue; | ||||
| 		log("  found %s cell for state register: %s\n", cell->type.c_str(), cell->name.c_str()); | ||||
| 		RTLIL::SigSpec sig_q = assign_map(cell->connections_["\\Q"]); | ||||
| 		RTLIL::SigSpec sig_d = assign_map(cell->connections_["\\D"]); | ||||
| 		clk = cell->connections_["\\CLK"]; | ||||
| 		RTLIL::SigSpec sig_q = assign_map(cell->get("\\Q")); | ||||
| 		RTLIL::SigSpec sig_d = assign_map(cell->get("\\D")); | ||||
| 		clk = cell->get("\\CLK"); | ||||
| 		clk_polarity = cell->parameters["\\CLK_POLARITY"].as_bool(); | ||||
| 		if (cell->type == "$adff") { | ||||
| 			arst = cell->connections_["\\ARST"]; | ||||
| 			arst = cell->get("\\ARST"); | ||||
| 			arst_polarity = cell->parameters["\\ARST_POLARITY"].as_bool(); | ||||
| 			reset_state = cell->parameters["\\ARST_VALUE"]; | ||||
| 		} | ||||
|  | @ -224,9 +224,9 @@ static void extract_fsm(RTLIL::Wire *wire) | |||
| 	sig2trigger.find(dff_out, cellport_list); | ||||
| 	for (auto &cellport : cellport_list) { | ||||
| 		RTLIL::Cell *cell = module->cells.at(cellport.first); | ||||
| 		RTLIL::SigSpec sig_a = assign_map(cell->connections_["\\A"]); | ||||
| 		RTLIL::SigSpec sig_b = assign_map(cell->connections_["\\B"]); | ||||
| 		RTLIL::SigSpec sig_y = assign_map(cell->connections_["\\Y"]); | ||||
| 		RTLIL::SigSpec sig_a = assign_map(cell->get("\\A")); | ||||
| 		RTLIL::SigSpec sig_b = assign_map(cell->get("\\B")); | ||||
| 		RTLIL::SigSpec sig_y = assign_map(cell->get("\\Y")); | ||||
| 		if (cellport.second == "\\A" && !sig_b.is_fully_const()) | ||||
| 			continue; | ||||
| 		if (cellport.second == "\\B" && !sig_a.is_fully_const()) | ||||
|  | @ -271,12 +271,12 @@ static void extract_fsm(RTLIL::Wire *wire) | |||
| 	// create fsm cell
 | ||||
| 
 | ||||
| 	RTLIL::Cell *fsm_cell = module->addCell(stringf("$fsm$%s$%d", wire->name.c_str(), RTLIL::autoidx++), "$fsm"); | ||||
| 	fsm_cell->connections_["\\CLK"] = clk; | ||||
| 	fsm_cell->connections_["\\ARST"] = arst; | ||||
| 	fsm_cell->set("\\CLK", clk); | ||||
| 	fsm_cell->set("\\ARST", arst); | ||||
| 	fsm_cell->parameters["\\CLK_POLARITY"] = RTLIL::Const(clk_polarity ? 1 : 0, 1); | ||||
| 	fsm_cell->parameters["\\ARST_POLARITY"] = RTLIL::Const(arst_polarity ? 1 : 0, 1); | ||||
| 	fsm_cell->connections_["\\CTRL_IN"] = ctrl_in; | ||||
| 	fsm_cell->connections_["\\CTRL_OUT"] = ctrl_out; | ||||
| 	fsm_cell->set("\\CTRL_IN", ctrl_in); | ||||
| 	fsm_cell->set("\\CTRL_OUT", ctrl_out); | ||||
| 	fsm_cell->parameters["\\NAME"] = RTLIL::Const(wire->name); | ||||
| 	fsm_cell->attributes = wire->attributes; | ||||
| 	fsm_data.copy_to_cell(fsm_cell); | ||||
|  | @ -294,13 +294,13 @@ static void extract_fsm(RTLIL::Wire *wire) | |||
| 	sig2driver.find(ctrl_out, cellport_list); | ||||
| 	for (auto &cellport : cellport_list) { | ||||
| 		RTLIL::Cell *cell = module->cells.at(cellport.first); | ||||
| 		RTLIL::SigSpec port_sig = assign_map(cell->connections_[cellport.second]); | ||||
| 		RTLIL::SigSpec port_sig = assign_map(cell->connections()[cellport.second]); | ||||
| 		RTLIL::SigSpec unconn_sig = port_sig.extract(ctrl_out); | ||||
| 		RTLIL::Wire *unconn_wire = new RTLIL::Wire; | ||||
| 		unconn_wire->name = stringf("$fsm_unconnect$%s$%d", log_signal(unconn_sig), RTLIL::autoidx++); | ||||
| 		unconn_wire->width = unconn_sig.size(); | ||||
| 		module->wires[unconn_wire->name] = unconn_wire; | ||||
| 		port_sig.replace(unconn_sig, RTLIL::SigSpec(unconn_wire), &cell->connections_[cellport.second]); | ||||
| 		port_sig.replace(unconn_sig, RTLIL::SigSpec(unconn_wire), &cell->connections()[cellport.second]); | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
|  | @ -344,14 +344,14 @@ struct FsmExtractPass : public Pass { | |||
| 			sig2driver.clear(); | ||||
| 			sig2trigger.clear(); | ||||
| 			for (auto &cell_it : module->cells) | ||||
| 				for (auto &conn_it : cell_it.second->connections_) { | ||||
| 				for (auto &conn_it : cell_it.second->connections()) { | ||||
| 					if (ct.cell_output(cell_it.second->type, conn_it.first) || !ct.cell_known(cell_it.second->type)) { | ||||
| 						RTLIL::SigSpec sig = conn_it.second; | ||||
| 						assign_map.apply(sig); | ||||
| 						sig2driver.insert(sig, sig2driver_entry_t(cell_it.first, conn_it.first)); | ||||
| 					} | ||||
| 					if (ct.cell_input(cell_it.second->type, conn_it.first) && cell_it.second->connections_.count("\\Y") > 0 && | ||||
| 							cell_it.second->connections_["\\Y"].size() == 1 && (conn_it.first == "\\A" || conn_it.first == "\\B")) { | ||||
| 					if (ct.cell_input(cell_it.second->type, conn_it.first) && cell_it.second->connections().count("\\Y") > 0 && | ||||
| 							cell_it.second->get("\\Y").size() == 1 && (conn_it.first == "\\A" || conn_it.first == "\\B")) { | ||||
| 						RTLIL::SigSpec sig = conn_it.second; | ||||
| 						assign_map.apply(sig); | ||||
| 						sig2trigger.insert(sig, sig2driver_entry_t(cell_it.first, conn_it.first)); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue