@@ -200,7 +200,7 @@ bool is_extending_cell(RTLIL::IdString type)
200200bool is_inlinable_cell (RTLIL ::IdString type)
201201{
202202 return is_unary_cell (type) || is_binary_cell (type) || type.in (
203- ID ($mux), ID ($concat), ID ($slice), ID ($pmux), ID ($bmux), ID ($demux), ID ($bwmux));
203+ ID ($mux), ID ($concat), ID ($slice), ID ($pmux), ID ($bmux), ID ($demux), ID ($bwmux), ID ($buf) );
204204}
205205
206206bool is_ff_cell (RTLIL ::IdString type)
@@ -1133,8 +1133,11 @@ struct CxxrtlWorker {
11331133
11341134 void dump_cell_expr (const RTLIL ::Cell *cell, bool for_debug = false )
11351135 {
1136+ // Buffers
1137+ if (cell->type == ID ($buf)) {
1138+ dump_sigspec_rhs (cell->getPort (ID ::A), for_debug);
11361139 // Unary cells
1137- if (is_unary_cell (cell->type )) {
1140+ } else if (is_unary_cell (cell->type )) {
11381141 f << cell->type .substr (1 );
11391142 if (is_extending_cell (cell->type ))
11401143 f << ' _' << (cell->getParam (ID ::A_SIGNED ).as_bool () ? ' s' : ' u' );
@@ -1517,6 +1520,20 @@ struct CxxrtlWorker {
15171520 dump_sigspec_rhs (cell->getPort (ID ::CLR ));
15181521 f << (cell->getParam (ID ::CLR_POLARITY ).as_bool () ? " " : " .bit_not()" ) << " );\n " ;
15191522 }
1523+ // ICG cells GCLK = CLK & (EN | SE)
1524+ } else if (cell->type == ID ($icg)) {
1525+ f << indent;
1526+ dump_sigspec_lhs (cell->getPort (ID ::GCLK ), for_debug);
1527+ f << " = " ;
1528+ dump_sigspec_rhs (cell->getPort (ID ::CLK ), for_debug);
1529+ f << " .bit_and(" ;
1530+ dump_sigspec_rhs (cell->getPort (ID ::EN ), for_debug);
1531+ if (cell->hasPort (ID ::SE )) {
1532+ f << " .bit_or(" ;
1533+ dump_sigspec_rhs (cell->getPort (ID ::SE ), for_debug);
1534+ f << " )" ;
1535+ }
1536+ f << " );\n " ;
15201537 // Internal cells
15211538 } else if (is_internal_cell (cell->type )) {
15221539 log_cmd_error (" Unsupported internal cell `%s'.\n " , cell->type );
0 commit comments