@@ -309,6 +309,18 @@ static LogicVec lut_outputs(const t_pb* atom_pb, size_t num_inputs, const t_pb_r
309
309
return lut.table ();
310
310
}
311
311
312
+ static std::vector<std::string> split_fasm_entry (std::string entry,
313
+ std::string delims,
314
+ std::string ignore) {
315
+ for (size_t ii=0 ; ii<entry.length (); ii++) {
316
+ while (ignore.find (entry[ii]) != std::string::npos) {
317
+ entry.erase (ii, 1 );
318
+ }
319
+ }
320
+
321
+ return vtr::split (entry, delims);
322
+ }
323
+
312
324
static const t_metadata_dict *get_fasm_type (const t_pb_graph_node* pb_graph_node, std::string target_type) {
313
325
if (pb_graph_node == nullptr ) {
314
326
return nullptr ;
@@ -361,7 +373,7 @@ const LutOutputDefinition* FasmWriterVisitor::find_lut(const t_pb_graph_node* pb
361
373
if (meta != nullptr ) {
362
374
VTR_ASSERT (meta->has (" fasm_lut" ));
363
375
std::string fasm_lut = meta->one (" fasm_lut" )->as_string ();
364
- auto lut_parts = vtr::split ( vtr::replace_all ( fasm_lut, " " , " " ), " \n " );
376
+ auto lut_parts = split_fasm_entry ( fasm_lut, " \n " , " \t " );
365
377
if (__builtin_popcount (lut_parts.size ()) != 1 ) {
366
378
vpr_throw (VPR_ERROR_OTHER,
367
379
__FILE__, __LINE__,
@@ -449,7 +461,7 @@ void FasmWriterVisitor::check_for_param(const t_pb *atom) {
449
461
Parameters params;
450
462
std::string fasm_params = meta->one (" fasm_params" )->as_string ();
451
463
for (const auto param : vtr::split (fasm_params, " \n " )) {
452
- auto param_parts = vtr::split ( vtr::replace_all ( param, " " , " " ), " = " );
464
+ auto param_parts = split_fasm_entry ( param, " = " , " \t " );
453
465
if (param_parts.size () == 0 ) {
454
466
continue ;
455
467
}
@@ -559,7 +571,7 @@ void FasmWriterVisitor::output_fasm_mux(std::string fasm_mux,
559
571
auto pin_index = mux_input_pin->pin_number ;
560
572
auto mux_inputs = vtr::split (fasm_mux, " \n " );
561
573
for (const auto &mux_input : mux_inputs) {
562
- auto mux_parts = vtr::split ( vtr::replace_all ( mux_input, " " , " " ), " = " );
574
+ auto mux_parts = split_fasm_entry ( mux_input, " = " , " \t " );
563
575
564
576
if (mux_parts.size () == 0 ) {
565
577
// Swallow whitespace.
0 commit comments