mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-10-31 03:32:29 +00:00 
			
		
		
		
	s/NEW_ID/NEWER_ID/g
This commit is contained in:
		
							parent
							
								
									6b9082fa64
								
							
						
					
					
						commit
						73d51b25d6
					
				
					 130 changed files with 1275 additions and 1275 deletions
				
			
		|  | @ -75,44 +75,44 @@ struct BoothPassWorker { | |||
| 	// Booth unsigned decoder lsb
 | ||||
| 	SigBit Bur4d_lsb(std::string name, SigBit lsb_i, SigBit one_i, SigBit s_i) | ||||
| 	{ | ||||
| 		SigBit and_op = module->AndGate(NEW_ID_SUFFIX(name), lsb_i, one_i); | ||||
| 		return module->XorGate(NEW_ID_SUFFIX(name), and_op, s_i); | ||||
| 		SigBit and_op = module->AndGate(NEWER_ID_SUFFIX(name), lsb_i, one_i); | ||||
| 		return module->XorGate(NEWER_ID_SUFFIX(name), and_op, s_i); | ||||
| 	} | ||||
| 
 | ||||
| 	// Booth unsigned radix4 decoder
 | ||||
| 	SigBit Bur4d_n(std::string name, SigBit yn_i, SigBit ynm1_i, SigBit one_i, SigBit two_i, SigBit s_i) | ||||
| 	{ | ||||
| 		// ppij = ((yn & one)   | (ynm1 & two)) ^ s;
 | ||||
| 		SigBit an1 = module->AndGate(NEW_ID_SUFFIX(name), yn_i, one_i); | ||||
| 		SigBit an2 = module->AndGate(NEW_ID_SUFFIX(name), ynm1_i, two_i); | ||||
| 		SigBit or1 = module->OrGate(NEW_ID_SUFFIX(name), an1, an2); | ||||
| 		return module->XorGate(NEW_ID_SUFFIX(name), s_i, or1); | ||||
| 		SigBit an1 = module->AndGate(NEWER_ID_SUFFIX(name), yn_i, one_i); | ||||
| 		SigBit an2 = module->AndGate(NEWER_ID_SUFFIX(name), ynm1_i, two_i); | ||||
| 		SigBit or1 = module->OrGate(NEWER_ID_SUFFIX(name), an1, an2); | ||||
| 		return module->XorGate(NEWER_ID_SUFFIX(name), s_i, or1); | ||||
| 	} | ||||
| 
 | ||||
| 	// Booth unsigned radix4 decoder
 | ||||
| 	SigBit Bur4d_msb(std::string name, SigBit msb_i, SigBit two_i, SigBit s_i) | ||||
| 	{ | ||||
| 		// ppij = (msb & two)  ^ s;
 | ||||
| 		SigBit an1 = module->AndGate(NEW_ID_SUFFIX(name), msb_i, two_i); | ||||
| 		return module->XorGate(NEW_ID_SUFFIX(name), s_i, an1); | ||||
| 		SigBit an1 = module->AndGate(NEWER_ID_SUFFIX(name), msb_i, two_i); | ||||
| 		return module->XorGate(NEWER_ID_SUFFIX(name), s_i, an1); | ||||
| 	} | ||||
| 
 | ||||
| 	// half adder, used in CPA
 | ||||
| 	void BuildHa(std::string name, SigBit a_i, SigBit b_i, SigBit &s_o, SigBit &c_o) | ||||
| 	{ | ||||
| 		s_o = module->XorGate(NEW_ID_SUFFIX(name), a_i, b_i); | ||||
| 		c_o = module->AndGate(NEW_ID_SUFFIX(name), a_i, b_i); | ||||
| 		s_o = module->XorGate(NEWER_ID_SUFFIX(name), a_i, b_i); | ||||
| 		c_o = module->AndGate(NEWER_ID_SUFFIX(name), a_i, b_i); | ||||
| 	} | ||||
| 
 | ||||
| 	// Booth unsigned radix 4 encoder
 | ||||
| 	void BuildBur4e(std::string name, SigBit y0_i, SigBit y1_i, SigBit y2_i, | ||||
| 			SigBit &one_o, SigBit &two_o, SigBit &s_o, SigBit &sb_o) | ||||
| 	{ | ||||
| 		one_o = module->XorGate(NEW_ID_SUFFIX(name), y0_i, y1_i); | ||||
| 		one_o = module->XorGate(NEWER_ID_SUFFIX(name), y0_i, y1_i); | ||||
| 		s_o = y2_i; | ||||
| 		sb_o = module->NotGate(NEW_ID_SUFFIX(name), y2_i); | ||||
| 		SigBit y1_xnor_y2 = module->XnorGate(NEW_ID_SUFFIX(name), y1_i, y2_i); | ||||
| 		two_o = module->NorGate(NEW_ID_SUFFIX(name), y1_xnor_y2, one_o); | ||||
| 		sb_o = module->NotGate(NEWER_ID_SUFFIX(name), y2_i); | ||||
| 		SigBit y1_xnor_y2 = module->XnorGate(NEWER_ID_SUFFIX(name), y1_i, y2_i); | ||||
| 		two_o = module->NorGate(NEWER_ID_SUFFIX(name), y1_xnor_y2, one_o); | ||||
| 	} | ||||
| 
 | ||||
| 	void BuildBr4e(std::string name, SigBit y2_m1_i, | ||||
|  | @ -120,9 +120,9 @@ struct BoothPassWorker { | |||
| 		       SigBit y2_p1_i, | ||||
| 		       SigBit &negi_o, SigBit &twoi_n_o, SigBit &onei_n_o, SigBit &cori_o) | ||||
| 	{ | ||||
| 		auto y2_p1_n = module->NotGate(NEW_ID_SUFFIX(name), y2_p1_i); | ||||
| 		auto y2_n = module->NotGate(NEW_ID_SUFFIX(name), y2_i); | ||||
| 		auto y2_m1_n = module->NotGate(NEW_ID_SUFFIX(name), y2_m1_i); | ||||
| 		auto y2_p1_n = module->NotGate(NEWER_ID_SUFFIX(name), y2_p1_i); | ||||
| 		auto y2_n = module->NotGate(NEWER_ID_SUFFIX(name), y2_i); | ||||
| 		auto y2_m1_n = module->NotGate(NEWER_ID_SUFFIX(name), y2_m1_i); | ||||
| 
 | ||||
| 		negi_o = y2_p1_i; | ||||
| 
 | ||||
|  | @ -130,15 +130,15 @@ struct BoothPassWorker { | |||
| 		//    (y2_p1_n & y2_i & y2_m1_i) |
 | ||||
| 		//    (y2_p1 & y2_n & y2_m1_n)
 | ||||
| 		// )
 | ||||
| 		twoi_n_o = module->NorGate(NEW_ID_SUFFIX(name), | ||||
| 			module->AndGate(NEW_ID_SUFFIX(name), y2_p1_n, module->AndGate(NEW_ID_SUFFIX(name), y2_i, y2_m1_i)), | ||||
| 			module->AndGate(NEW_ID_SUFFIX(name), y2_p1_i, module->AndGate(NEW_ID_SUFFIX(name), y2_n, y2_m1_n)) | ||||
| 		twoi_n_o = module->NorGate(NEWER_ID_SUFFIX(name), | ||||
| 			module->AndGate(NEWER_ID_SUFFIX(name), y2_p1_n, module->AndGate(NEWER_ID_SUFFIX(name), y2_i, y2_m1_i)), | ||||
| 			module->AndGate(NEWER_ID_SUFFIX(name), y2_p1_i, module->AndGate(NEWER_ID_SUFFIX(name), y2_n, y2_m1_n)) | ||||
| 		); | ||||
| 
 | ||||
| 		// onei_n = ~(y2_m1_i ^ y2_i);
 | ||||
| 		onei_n_o = module->XnorGate(NEW_ID_SUFFIX(name), y2_m1_i, y2_i); | ||||
| 		onei_n_o = module->XnorGate(NEWER_ID_SUFFIX(name), y2_m1_i, y2_i); | ||||
| 		// cori = (y2_m1_n | y2_n) & y2_p1_i;
 | ||||
| 		cori_o = module->AndGate(NEW_ID_SUFFIX(name), module->OrGate(NEW_ID_SUFFIX(name), y2_m1_n, y2_n), y2_p1_i); | ||||
| 		cori_o = module->AndGate(NEWER_ID_SUFFIX(name), module->OrGate(NEWER_ID_SUFFIX(name), y2_m1_n, y2_n), y2_p1_i); | ||||
| 	} | ||||
| 
 | ||||
| 	//
 | ||||
|  | @ -150,10 +150,10 @@ struct BoothPassWorker { | |||
| 		// nxj_in = xnor(xj,negi)
 | ||||
| 		// nxj_o = xnj_in,
 | ||||
| 		// ppij = ~( (nxj_m1_i | twoi_n_i) & (nxj_int | onei_n_i));
 | ||||
| 		nxj_o = module->XnorGate(NEW_ID_SUFFIX(name), xj_i, negi_i); | ||||
| 		ppij_o = module->NandGate(NEW_ID_SUFFIX(name), | ||||
| 			module->OrGate(NEW_ID_SUFFIX(name), nxj_m1_i, twoi_n_i), | ||||
| 			module->OrGate(NEW_ID_SUFFIX(name), nxj_o, onei_n_i) | ||||
| 		nxj_o = module->XnorGate(NEWER_ID_SUFFIX(name), xj_i, negi_i); | ||||
| 		ppij_o = module->NandGate(NEWER_ID_SUFFIX(name), | ||||
| 			module->OrGate(NEWER_ID_SUFFIX(name), nxj_m1_i, twoi_n_i), | ||||
| 			module->OrGate(NEWER_ID_SUFFIX(name), nxj_o, onei_n_i) | ||||
| 		); | ||||
| 	} | ||||
| 
 | ||||
|  | @ -177,14 +177,14 @@ struct BoothPassWorker { | |||
| 		  //correction propagation
 | ||||
| 		  assign CORO = (~PP1 & ~PP0)? CORI : 1'b0; | ||||
| 		*/ | ||||
| 		nxj_o = module->XnorGate(NEW_ID_SUFFIX(name), x1_i, negi_i); | ||||
| 		pp0_o = module->AndGate(NEW_ID_SUFFIX(name), x0_i, y0_i); | ||||
| 		SigBit pp1_1_int = module->AndGate(NEW_ID_SUFFIX(name), x1_i, y0_i); | ||||
| 		SigBit pp1_2_int = module->AndGate(NEW_ID_SUFFIX(name), x0_i, y1_i); | ||||
| 		pp1_o = module->XorGate(NEW_ID_SUFFIX(name), pp1_1_int, pp1_2_int); | ||||
| 		nxj_o = module->XnorGate(NEWER_ID_SUFFIX(name), x1_i, negi_i); | ||||
| 		pp0_o = module->AndGate(NEWER_ID_SUFFIX(name), x0_i, y0_i); | ||||
| 		SigBit pp1_1_int = module->AndGate(NEWER_ID_SUFFIX(name), x1_i, y0_i); | ||||
| 		SigBit pp1_2_int = module->AndGate(NEWER_ID_SUFFIX(name), x0_i, y1_i); | ||||
| 		pp1_o = module->XorGate(NEWER_ID_SUFFIX(name), pp1_1_int, pp1_2_int); | ||||
| 
 | ||||
| 		SigBit pp1_nor_pp0 = module->NorGate(NEW_ID_SUFFIX(name), pp1_o, pp0_o); | ||||
| 		cor_o = module->AndGate(NEW_ID_SUFFIX(name), pp1_nor_pp0, cori_i); | ||||
| 		SigBit pp1_nor_pp0 = module->NorGate(NEWER_ID_SUFFIX(name), pp1_o, pp0_o); | ||||
| 		cor_o = module->AndGate(NEWER_ID_SUFFIX(name), pp1_nor_pp0, cori_i); | ||||
| 	} | ||||
| 
 | ||||
| 	void BuildBitwiseFa(Module *mod, std::string name, const SigSpec &sig_a, const SigSpec &sig_b, | ||||
|  | @ -289,7 +289,7 @@ struct BoothPassWorker { | |||
| 			int required_op_size = x_sz_revised + y_sz_revised; | ||||
| 
 | ||||
| 			if (required_op_size != z_sz) { | ||||
| 				SigSpec expanded_Y = module->addWire(NEW_ID, required_op_size); | ||||
| 				SigSpec expanded_Y = module->addWire(NEWER_ID, required_op_size); | ||||
| 				SigSpec Y_driver = expanded_Y; | ||||
| 				Y_driver.extend_u0(Y.size(), is_signed); | ||||
| 				module->connect(Y, Y_driver); | ||||
|  | @ -326,9 +326,9 @@ struct BoothPassWorker { | |||
| 			std::vector<SigSpec> new_summands; | ||||
| 			int i; | ||||
| 			for (i = 0; i < (int) summands.size() - 2; i += 3) { | ||||
| 				SigSpec x = module->addWire(NEW_ID, width); | ||||
| 				SigSpec y = module->addWire(NEW_ID, width); | ||||
| 				BuildBitwiseFa(module, NEW_ID.str(), summands[i], summands[i + 1], | ||||
| 				SigSpec x = module->addWire(NEWER_ID, width); | ||||
| 				SigSpec y = module->addWire(NEWER_ID, width); | ||||
| 				BuildBitwiseFa(module, NEWER_ID.str(), summands[i], summands[i + 1], | ||||
| 					       summands[i + 2], x, y); | ||||
| 				new_summands.push_back(y); | ||||
| 				new_summands.push_back({x.extract(0, width - 1), State::S0}); | ||||
|  | @ -424,7 +424,7 @@ struct BoothPassWorker { | |||
| 		if (mapped_cpa) | ||||
| 			BuildCPA(module, wtree_sum.first, {State::S0, wtree_sum.second.extract_end(1)}, Z); | ||||
| 		else | ||||
| 			module->addAdd(NEW_ID, wtree_sum.first, {wtree_sum.second.extract_end(1), State::S0}, Z); | ||||
| 			module->addAdd(NEWER_ID, wtree_sum.first, {wtree_sum.second.extract_end(1), State::S0}, Z); | ||||
| 	} | ||||
| 
 | ||||
| 	/*
 | ||||
|  | @ -460,11 +460,11 @@ struct BoothPassWorker { | |||
| 
 | ||||
| 		// append the sign bits
 | ||||
| 		if (is_signed) { | ||||
| 			SigBit e = module->XorGate(NEW_ID, s_int[0], module->AndGate(NEW_ID, X.msb(), module->OrGate(NEW_ID, two_int[0], one_int[0]))); | ||||
| 			ppij_vec.append({module->NotGate(NEW_ID, e), e, e}); | ||||
| 			SigBit e = module->XorGate(NEWER_ID, s_int[0], module->AndGate(NEWER_ID, X.msb(), module->OrGate(NEWER_ID, two_int[0], one_int[0]))); | ||||
| 			ppij_vec.append({module->NotGate(NEWER_ID, e), e, e}); | ||||
| 		} else { | ||||
| 			// append the sign bits
 | ||||
| 			ppij_vec.append({module->NotGate(NEW_ID, s_int[0]), s_int[0], s_int[0]}); | ||||
| 			ppij_vec.append({module->NotGate(NEWER_ID, s_int[0]), s_int[0], s_int[0]}); | ||||
| 		} | ||||
| 	} | ||||
| 
 | ||||
|  | @ -494,7 +494,7 @@ struct BoothPassWorker { | |||
| 				     					one_int, two_int, s_int)); | ||||
| 		} | ||||
| 
 | ||||
| 		ppij_vec.append(!is_signed ? sb_int[0] : module->XorGate(NEW_ID, sb_int, module->AndGate(NEW_ID, X.msb(), module->OrGate(NEW_ID, two_int, one_int)))); | ||||
| 		ppij_vec.append(!is_signed ? sb_int[0] : module->XorGate(NEWER_ID, sb_int, module->AndGate(NEWER_ID, X.msb(), module->OrGate(NEWER_ID, two_int, one_int)))); | ||||
| 		ppij_vec.append(State::S1); | ||||
| 	} | ||||
| 
 | ||||
|  | @ -721,7 +721,7 @@ struct BoothPassWorker { | |||
| 
 | ||||
| 			// Base Case: Bit 0 is sum 0
 | ||||
| 			if (n == 0) { | ||||
| 				module->addBufGate(NEW_ID_SUFFIX(stringf("base_buf_%d_%d", cpa_id, n)), s_vec[0], result[0]); | ||||
| 				module->addBufGate(NEWER_ID_SUFFIX(stringf("base_buf_%d_%d", cpa_id, n)), s_vec[0], result[0]); | ||||
| 
 | ||||
| #ifdef DEBUG_CPA | ||||
| 				printf("CPA bit [%d] Cell %s IP 0 %s \n", n, buf->name.c_str(), s_vec[0]->name.c_str()); | ||||
|  | @ -747,8 +747,8 @@ struct BoothPassWorker { | |||
| 			// End Case
 | ||||
| 			else if (n == s_vec.size() - 1) { | ||||
| 				// Make the carry results.. Two extra bits after fa.
 | ||||
| 				SigBit carry_out = module->addWire(NEW_ID, 1); | ||||
| 				module->addFa(NEW_ID_SUFFIX(stringf("cpa_%d_fa_%d", cpa_id, n)), | ||||
| 				SigBit carry_out = module->addWire(NEWER_ID, 1); | ||||
| 				module->addFa(NEWER_ID_SUFFIX(stringf("cpa_%d_fa_%d", cpa_id, n)), | ||||
| 					/* A */ s_vec[n], | ||||
| 					/* B */ c_vec[n - 1], | ||||
| 					/* C */ carry, | ||||
|  | @ -775,8 +775,8 @@ struct BoothPassWorker { | |||
| 			} | ||||
| 			// Step case
 | ||||
| 			else { | ||||
| 				SigBit carry_out = module->addWire(NEW_ID_SUFFIX(stringf("cpa_%d_carry_%d", cpa_id, n)), 1); | ||||
| 				module->addFa(NEW_ID_SUFFIX(stringf("cpa_%d_fa_%d", cpa_id, n)), | ||||
| 				SigBit carry_out = module->addWire(NEWER_ID_SUFFIX(stringf("cpa_%d_carry_%d", cpa_id, n)), 1); | ||||
| 				module->addFa(NEWER_ID_SUFFIX(stringf("cpa_%d_fa_%d", cpa_id, n)), | ||||
| 					/* A */ s_vec[n], | ||||
| 					/* B */ c_vec[n - 1], | ||||
| 					/* C */ carry, | ||||
|  | @ -814,10 +814,10 @@ struct BoothPassWorker { | |||
| 
 | ||||
| 			if (first_csa_ips.size() > 0) { | ||||
| 				// build the first csa
 | ||||
| 				auto s_wire = module->addWire(NEW_ID_SUFFIX(stringf("csa_%d_%d_s", column_ix, csa_ix + 1)), 1); | ||||
| 				auto c_wire = module->addWire(NEW_ID_SUFFIX(stringf("csa_%d_%d_c", column_ix, csa_ix + 1)), 1); | ||||
| 				auto s_wire = module->addWire(NEWER_ID_SUFFIX(stringf("csa_%d_%d_s", column_ix, csa_ix + 1)), 1); | ||||
| 				auto c_wire = module->addWire(NEWER_ID_SUFFIX(stringf("csa_%d_%d_c", column_ix, csa_ix + 1)), 1); | ||||
| 
 | ||||
| 				auto csa = module->addFa(NEW_ID_SUFFIX(stringf("csa_%d_%d", column_ix, csa_ix)), | ||||
| 				auto csa = module->addFa(NEWER_ID_SUFFIX(stringf("csa_%d_%d", column_ix, csa_ix)), | ||||
| 					/* A */ first_csa_ips[0], | ||||
| 					/* B */ first_csa_ips.size() > 1 ? first_csa_ips[1] : State::S0, | ||||
| 					/* C */ first_csa_ips.size() > 2 ? first_csa_ips[2] : State::S0, | ||||
|  | @ -846,10 +846,10 @@ struct BoothPassWorker { | |||
| 					} | ||||
| 
 | ||||
| 					if (csa_ips.size() > 0) { | ||||
| 						auto c_wire = module->addWire(NEW_ID_SUFFIX(stringf("csa_%d_%d_c", column_ix, csa_ix + 1)), 1); | ||||
| 						auto s_wire = module->addWire(NEW_ID_SUFFIX(stringf("csa_%d_%d_s", column_ix, csa_ix + 1)), 1); | ||||
| 						auto c_wire = module->addWire(NEWER_ID_SUFFIX(stringf("csa_%d_%d_c", column_ix, csa_ix + 1)), 1); | ||||
| 						auto s_wire = module->addWire(NEWER_ID_SUFFIX(stringf("csa_%d_%d_s", column_ix, csa_ix + 1)), 1); | ||||
| 
 | ||||
| 						auto csa = module->addFa(NEW_ID_SUFFIX(stringf("csa_%d_%d", column_ix, csa_ix)), | ||||
| 						auto csa = module->addFa(NEWER_ID_SUFFIX(stringf("csa_%d_%d", column_ix, csa_ix)), | ||||
| 							/* A */ s_result, | ||||
| 							/* B */ csa_ips[0], | ||||
| 							/* C */ csa_ips.size() > 1 ? csa_ips[1] : State::S0, | ||||
|  | @ -879,10 +879,10 @@ struct BoothPassWorker { | |||
| 		for (int y_ix = 0; y_ix < (!is_signed ? y_sz : y_sz - 1);) { | ||||
| 			std::string enc_name = stringf("bur_enc_%d", encoder_ix); | ||||
| 
 | ||||
| 			two_int.append(module->addWire(NEW_ID_SUFFIX(stringf("two_int_%d", encoder_ix)), 1)); | ||||
| 			one_int.append(module->addWire(NEW_ID_SUFFIX(stringf("one_int_%d", encoder_ix)), 1)); | ||||
| 			s_int.append(module->addWire(NEW_ID_SUFFIX(stringf("s_int_%d", encoder_ix)), 1)); | ||||
| 			sb_int.append(module->addWire(NEW_ID_SUFFIX(stringf("sb_int_%d", encoder_ix)), 1)); | ||||
| 			two_int.append(module->addWire(NEWER_ID_SUFFIX(stringf("two_int_%d", encoder_ix)), 1)); | ||||
| 			one_int.append(module->addWire(NEWER_ID_SUFFIX(stringf("one_int_%d", encoder_ix)), 1)); | ||||
| 			s_int.append(module->addWire(NEWER_ID_SUFFIX(stringf("s_int_%d", encoder_ix)), 1)); | ||||
| 			sb_int.append(module->addWire(NEWER_ID_SUFFIX(stringf("sb_int_%d", encoder_ix)), 1)); | ||||
| 
 | ||||
| 			if (y_ix == 0) { | ||||
| 				BuildBur4e(enc_name, State::S0, Y[y_ix], | ||||
|  | @ -939,10 +939,10 @@ struct BoothPassWorker { | |||
| 
 | ||||
| 					std::string enc_name = stringf("br_enc_pad_%d", encoder_ix); | ||||
| 
 | ||||
| 					two_int.append(module->addWire(NEW_ID_SUFFIX(stringf("two_int_%d", encoder_ix)), 1)); | ||||
| 					one_int.append(module->addWire(NEW_ID_SUFFIX(stringf("one_int_%d", encoder_ix)), 1)); | ||||
| 					s_int.append(module->addWire(NEW_ID_SUFFIX(stringf("s_int_%d", encoder_ix)), 1)); | ||||
| 					sb_int.append(module->addWire(NEW_ID_SUFFIX(stringf("sb_int_%d", encoder_ix)), 1)); | ||||
| 					two_int.append(module->addWire(NEWER_ID_SUFFIX(stringf("two_int_%d", encoder_ix)), 1)); | ||||
| 					one_int.append(module->addWire(NEWER_ID_SUFFIX(stringf("one_int_%d", encoder_ix)), 1)); | ||||
| 					s_int.append(module->addWire(NEWER_ID_SUFFIX(stringf("s_int_%d", encoder_ix)), 1)); | ||||
| 					sb_int.append(module->addWire(NEWER_ID_SUFFIX(stringf("sb_int_%d", encoder_ix)), 1)); | ||||
| 
 | ||||
| 					SigBit one_o_int, two_o_int, s_o_int, sb_o_int; | ||||
| 					BuildBur4e(enc_name, Y[y_ix], State::S0, | ||||
|  | @ -986,10 +986,10 @@ struct BoothPassWorker { | |||
| 
 | ||||
| 		for (unsigned encoder_ix = 1; encoder_ix <= enc_count; encoder_ix++) { | ||||
| 			std::string enc_name = stringf("enc_%d", encoder_ix); | ||||
| 			negi_n_int[encoder_ix - 1] = module->addWire(NEW_ID_SUFFIX(stringf("negi_n_int_%d", encoder_ix)), 1); | ||||
| 			twoi_n_int[encoder_ix - 1] = module->addWire(NEW_ID_SUFFIX(stringf("twoi_n_int_%d", encoder_ix)), 1); | ||||
| 			onei_n_int[encoder_ix - 1] = module->addWire(NEW_ID_SUFFIX(stringf("onei_n_int_%d", encoder_ix)), 1); | ||||
| 			cori_n_int[encoder_ix - 1] = module->addWire(NEW_ID_SUFFIX(stringf("cori_n_int_%d", encoder_ix)), 1); | ||||
| 			negi_n_int[encoder_ix - 1] = module->addWire(NEWER_ID_SUFFIX(stringf("negi_n_int_%d", encoder_ix)), 1); | ||||
| 			twoi_n_int[encoder_ix - 1] = module->addWire(NEWER_ID_SUFFIX(stringf("twoi_n_int_%d", encoder_ix)), 1); | ||||
| 			onei_n_int[encoder_ix - 1] = module->addWire(NEWER_ID_SUFFIX(stringf("onei_n_int_%d", encoder_ix)), 1); | ||||
| 			cori_n_int[encoder_ix - 1] = module->addWire(NEWER_ID_SUFFIX(stringf("cori_n_int_%d", encoder_ix)), 1); | ||||
| 
 | ||||
| 			if (encoder_ix == 1) { | ||||
| 				BuildBr4e(enc_name, State::S0, Y[0], Y[1], | ||||
|  | @ -1024,10 +1024,10 @@ struct BoothPassWorker { | |||
| 		for (int encoder_ix = 1; encoder_ix <= (int)enc_count; encoder_ix++) { | ||||
| 			for (int decoder_ix = 1; decoder_ix <= dec_count; decoder_ix++) { | ||||
| 				PPij[((encoder_ix - 1) * dec_count) + decoder_ix - 1] = | ||||
| 					module->addWire(NEW_ID_SUFFIX(stringf("ppij_%d_%d", encoder_ix, decoder_ix)), 1); | ||||
| 					module->addWire(NEWER_ID_SUFFIX(stringf("ppij_%d_%d", encoder_ix, decoder_ix)), 1); | ||||
| 
 | ||||
| 				nxj[((encoder_ix - 1) * dec_count) + decoder_ix - 1] = | ||||
| 					module->addWire(NEW_ID_SUFFIX(stringf("nxj_%s%d_%d", decoder_ix == 1 ? "pre_dec_" : "", | ||||
| 					module->addWire(NEWER_ID_SUFFIX(stringf("nxj_%s%d_%d", decoder_ix == 1 ? "pre_dec_" : "", | ||||
| 									      encoder_ix, decoder_ix)), 1); | ||||
| 			} | ||||
| 		} | ||||
|  | @ -1042,7 +1042,7 @@ struct BoothPassWorker { | |||
| 			if (encoder_ix == 1) { | ||||
| 				// quadrant 1 optimization
 | ||||
| 			} else { | ||||
| 				module->addNotGate(NEW_ID_SUFFIX(stringf("pre_dec_%d", encoder_ix)), | ||||
| 				module->addNotGate(NEWER_ID_SUFFIX(stringf("pre_dec_%d", encoder_ix)), | ||||
| 					negi_n_int[encoder_ix - 1], | ||||
| 					nxj[(encoder_ix - 1) * dec_count] | ||||
| 				); | ||||
|  | @ -1094,16 +1094,16 @@ struct BoothPassWorker { | |||
| 		std::vector<SigSpec> fa_carry; | ||||
| 
 | ||||
| 		for (fa_row_ix = 0; fa_row_ix < fa_row_count; fa_row_ix++) { | ||||
| 			fa_sum.push_back(module->addWire(NEW_ID_SUFFIX(stringf("fa_sum_%d", fa_row_ix)), fa_count)); | ||||
| 			fa_carry.push_back(module->addWire(NEW_ID_SUFFIX(stringf("fa_carry_%d", fa_row_ix)), fa_count)); | ||||
| 			fa_sum.push_back(module->addWire(NEWER_ID_SUFFIX(stringf("fa_sum_%d", fa_row_ix)), fa_count)); | ||||
| 			fa_carry.push_back(module->addWire(NEWER_ID_SUFFIX(stringf("fa_carry_%d", fa_row_ix)), fa_count)); | ||||
| 		} | ||||
| 
 | ||||
| 		// full adder creation
 | ||||
| 		// base case: 1st row: Inputs from decoders
 | ||||
| 		// 1st row exception: two localized inverters due to sign extension structure
 | ||||
| 		SigBit d08_inv = module->NotGate(NEW_ID_SUFFIX("bfa_0_exc_inv1"), PPij[(0 * dec_count) + dec_count - 1]); | ||||
| 		SigBit d18_inv = module->NotGate(NEW_ID_SUFFIX("bfa_0_exc_inv2"), PPij[(1 * dec_count) + dec_count - 1]); | ||||
| 		BuildBitwiseFa(module, NEW_ID_SUFFIX("fa_row_0").str(), | ||||
| 		SigBit d08_inv = module->NotGate(NEWER_ID_SUFFIX("bfa_0_exc_inv1"), PPij[(0 * dec_count) + dec_count - 1]); | ||||
| 		SigBit d18_inv = module->NotGate(NEWER_ID_SUFFIX("bfa_0_exc_inv2"), PPij[(1 * dec_count) + dec_count - 1]); | ||||
| 		BuildBitwiseFa(module, NEWER_ID_SUFFIX("fa_row_0").str(), | ||||
| 			/* A */ {State::S0, d08_inv, PPij[(0 * dec_count) + x_sz], PPij.extract((0 * dec_count) + 2, x_sz - 1)}, | ||||
| 			/* B */ {State::S1, d18_inv, PPij.extract((1 * dec_count), x_sz)}, | ||||
| 			/* C */ fa_carry[0].extract(1, x_sz + 2), | ||||
|  | @ -1116,10 +1116,10 @@ struct BoothPassWorker { | |||
| 		// special because these are driven by a decoder and prior fa.
 | ||||
| 		for (fa_row_ix = 1; fa_row_ix < fa_row_count; fa_row_ix++) { | ||||
| 			// end two bits: sign extension
 | ||||
| 			SigBit d_inv = module->NotGate(NEW_ID_SUFFIX(stringf("bfa_se_inv_%d_L", fa_row_ix)), | ||||
| 			SigBit d_inv = module->NotGate(NEWER_ID_SUFFIX(stringf("bfa_se_inv_%d_L", fa_row_ix)), | ||||
| 						       PPij[((fa_row_ix + 1) * dec_count) + dec_count - 1]); | ||||
| 
 | ||||
| 			BuildBitwiseFa(module, NEW_ID_SUFFIX(stringf("fa_row_%d", fa_row_ix)).str(), | ||||
| 			BuildBitwiseFa(module, NEWER_ID_SUFFIX(stringf("fa_row_%d", fa_row_ix)).str(), | ||||
| 				/* A */	{State::S0, fa_carry[fa_row_ix - 1][fa_count - 1], fa_sum[fa_row_ix - 1].extract(2, x_sz + 2)}, | ||||
| 				/* B */ {State::S1, d_inv, PPij.extract((fa_row_ix + 1) * dec_count, x_sz), State::S0, State::S0}, | ||||
| 
 | ||||
|  | @ -1132,7 +1132,7 @@ struct BoothPassWorker { | |||
| 		// instantiate the cpa
 | ||||
| 		SigSpec cpa_carry; | ||||
| 		if (z_sz > fa_row_count * 2) | ||||
| 			cpa_carry = module->addWire(NEW_ID_SUFFIX("cpa_carry"), z_sz - fa_row_count * 2); | ||||
| 			cpa_carry = module->addWire(NEWER_ID_SUFFIX("cpa_carry"), z_sz - fa_row_count * 2); | ||||
| 
 | ||||
| 		// The end case where we pass the last two summands
 | ||||
| 		// from prior row directly to product output
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue