11#include " kernel/sigtools.h"
22#include " kernel/yosys.h"
3- #include " kernel/sigtools.h"
43
54USING_YOSYS_NAMESPACE
65PRIVATE_NAMESPACE_BEGIN
@@ -23,10 +22,7 @@ struct QlDspIORegs : public Pass {
2322
2423 // ..........................................
2524
26- QlDspIORegs () : Pass(
27- " ql_dsp_io_regs" ,
28- " Changes types of QL_DSP2/QL_DSP3 depending on their configuration." )
29- {}
25+ QlDspIORegs () : Pass(" ql_dsp_io_regs" , " Changes types of QL_DSP2/QL_DSP3 depending on their configuration." ) {}
3026
3127 void help () override
3228 {
@@ -54,20 +50,21 @@ struct QlDspIORegs : public Pass {
5450
5551 // Returns a pair of mask and value describing constant bit connections of
5652 // a SigSpec
57- std::pair<uint32_t , uint32_t > get_constant_mask_value (const RTLIL::SigSpec* sigspec) {
53+ std::pair<uint32_t , uint32_t > get_constant_mask_value (const RTLIL::SigSpec *sigspec)
54+ {
5855 uint32_t mask = 0L ;
5956 uint32_t value = 0L ;
6057
6158 auto sigbits = sigspec->bits ();
62- for (ssize_t i= (sigbits.size () - 1 ); i >= 0 ; --i) {
59+ for (ssize_t i = (sigbits.size () - 1 ); i >= 0 ; --i) {
6360 auto other = m_SigMap (sigbits[i]);
6461
65- mask <<= 1 ;
62+ mask <<= 1 ;
6663 value <<= 1 ;
6764
6865 // A known constant
6966 if (!other.is_wire () && other.data != RTLIL::Sx) {
70- mask |= 0x1 ;
67+ mask |= 0x1 ;
7168 value |= (other.data == RTLIL::S1);
7269 }
7370 }
@@ -128,8 +125,8 @@ struct QlDspIORegs : public Pass {
128125 // Check if feedback is or can be set to 0 which implies MACC
129126 auto feedback_con = get_constant_mask_value (feedback);
130127 bool have_macc = (feedback_con.second == 0x0 );
131- // log("mask=0x%08X value=0x%08X\n", consts.first, consts.second);
132- // log_error("=== END HERE ===\n");
128+ // log("mask=0x%08X value=0x%08X\n", consts.first, consts.second);
129+ // log_error("=== END HERE ===\n");
133130
134131 // Build new type name
135132 std::string new_type = cell_type;
@@ -148,8 +145,7 @@ struct QlDspIORegs : public Pass {
148145 default :
149146 break ;
150147 }
151- }
152- else {
148+ } else {
153149 switch (out_sel_i) {
154150 case 1 :
155151 case 2 :
@@ -164,12 +160,12 @@ struct QlDspIORegs : public Pass {
164160 }
165161
166162 if (reg_in_i) {
167- del_clk = false ;
163+ del_clk = false ;
168164 new_type += " _REGIN" ;
169165 }
170166
171167 if (out_sel_i > 3 ) {
172- del_clk = false ;
168+ del_clk = false ;
173169 new_type += " _REGOUT" ;
174170 }
175171
0 commit comments