File tree 1 file changed +22
-0
lines changed
himbaechel/uarch/gatemate
1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -164,6 +164,28 @@ struct BitstreamBackend
164
164
boost::replace_all (word, " RES." , stringf (" RES%d." , id));
165
165
else if (boost::starts_with (word, " TES." ))
166
166
boost::replace_all (word, " TES." , stringf (" TES%d." , id));
167
+ if (boost::starts_with (word, " SB_DRIVE." )) {
168
+ Loc l;
169
+ tile_xy (ctx->chip_info , pip.tile , l.x , l.y );
170
+ l.z = 0 ;
171
+ BelId cpe_bel = ctx->getBelByLocation (l);
172
+ // Only if switchbox is inside core (same as sharing location with CPE)
173
+ if (cpe_bel != BelId () && ctx->getBelType (cpe_bel) == id_CPE) {
174
+ // Convert coordinates into in-tile coordinates
175
+ int xt = ((l.x -2 -1 )+16 ) % 8 ;
176
+ int yt = ((l.y -2 -1 )+16 ) % 8 ;
177
+ // Bitstream data for certain SB_DRIVES is located in other tiles
178
+ switch (word[14 ]) {
179
+ case ' 3' : if (xt >= 4 ) { loc.x -= 2 ; word[14 ] = ' 1' ; }; break ;
180
+ case ' 4' : if (yt >= 4 ) { loc.y -= 2 ; word[14 ] = ' 2' ; }; break ;
181
+ case ' 1' : if (xt <= 3 ) { loc.x += 2 ; word[14 ] = ' 3' ; }; break ;
182
+ case ' 2' : if (yt <= 3 ) { loc.y += 2 ; word[14 ] = ' 4' ; }; break ;
183
+ default :
184
+ break ;
185
+ }
186
+ }
187
+ }
188
+
167
189
cc.tiles [loc].add_word (word, int_to_bitvector (extra_data.value , extra_data.bits ));
168
190
}
169
191
}
You can’t perform that action at this time.
0 commit comments