@@ -211,19 +211,52 @@ struct FasmBackend
211
211
212
212
void write_pip (PipId pip, NetInfo *net)
213
213
{
214
+ const bool debug_this = false ;
215
+
214
216
pips_by_tile[pip.tile ].push_back (pip);
215
217
216
218
auto dst_intent = ctx->wireIntent (ctx->getPipDstWire (pip));
217
219
if (dst_intent == ID_PSEUDO_GND || dst_intent == ID_PSEUDO_VCC)
218
220
return ;
219
221
220
222
auto &pd = ctx->locInfo (pip).pip_data [pip.index ];
221
- if (pd.flags != PIP_TILE_ROUTING)
223
+ if (debug_this) {
224
+ IdString src_debug = IdString (ctx->locInfo (pip).wire_data [pd.src_index ].name );
225
+ IdString dst_debug = IdString (ctx->locInfo (pip).wire_data [pd.dst_index ].name );
226
+ std::cerr << " ==> looking at pip " << ctx->getPipName (pip).str (ctx) << " on tile " << get_tile_name (pip.tile ) << " from " << src_debug.c_str (ctx) << " to " << dst_debug.c_str (ctx) << std::endl;
227
+ }
228
+
229
+ if (pd.flags != PIP_TILE_ROUTING && pd.flags != PIP_SITE_INTERNAL)
222
230
return ;
223
231
224
232
IdString src = IdString (ctx->locInfo (pip).wire_data [pd.src_index ].name );
225
233
IdString dst = IdString (ctx->locInfo (pip).wire_data [pd.dst_index ].name );
226
234
235
+ // handle certain site internal pips:
236
+ // this is necessary, because in tristate outputs, the
237
+ // ZINV_T1 bit needs to be set, because in the OLOGIC tiles the
238
+ // tristate control signals are inverted if this bit is not set
239
+ // this only applies to router1, because router2 does not generate
240
+ // site internal pips here.
241
+ if (pd.flags == PIP_SITE_INTERNAL) {
242
+ if (src.str (ctx) == " T1" && dst.str (ctx) == " T1INV_OUT" ) {
243
+ auto srcwire_uphill_iter = ctx->getPipsUphill (ctx->getPipSrcWire (pip));
244
+ auto uphill = srcwire_uphill_iter.begin ();
245
+ if (uphill != srcwire_uphill_iter.end ()) {
246
+ // source wire should be like: LIOI3_X0Y73/IOI_OLOGIC1_T1
247
+ auto loc = ctx->getWireName (ctx->getPipSrcWire (*uphill)).str (ctx);
248
+ boost::replace_all (loc, " /" , " ." );
249
+ boost::erase_all (loc, " _T1" );
250
+ boost::replace_all (loc, " IOI_OLOGIC" , " OLOGIC_Y" );
251
+ // the replacements transformed it into : LIOI3_X0Y73.OLOGIC_Y1
252
+ if (debug_this) std::cerr << " writing bit " << loc << " ." << " ZINV_T1" << std::endl;
253
+ out << loc << " ." << " ZINV_T1" << std::endl;
254
+ }
255
+ }
256
+ return ;
257
+ }
258
+
259
+ // handle tile routing pips
227
260
PseudoPipKey ppk{IdString (ctx->locInfo (pip).type ), dst, src};
228
261
229
262
if (pp_config.count (ppk)) {
@@ -240,6 +273,7 @@ struct FasmBackend
240
273
c.replace (y0pos, 2 , " Y1" );
241
274
}
242
275
}
276
+ if (debug_this) std::cerr << " writing pp " << c << " for tile " << tile_name << std::endl;
243
277
out << tile_name << " ." << c << std::endl;
244
278
}
245
279
if (!pp.empty ())
0 commit comments