@@ -60,43 +60,11 @@ struct QlDspSimdPass : public Pass {
60
60
61
61
// ..........................................
62
62
63
- // DSP control and config ports to consider and how to map them to ports
64
- // of the target DSP cell
65
- const std::vector<std::pair<IdString, IdString>> m_DspCfgPorts = {
66
- std::make_pair (ID (clock_i), ID (clk)),
67
- std::make_pair (ID (reset_i), ID (reset)),
68
- std::make_pair (ID (feedback_i), ID (feedback)),
69
- std::make_pair (ID (load_acc_i), ID (load_acc)),
70
- std::make_pair (ID (unsigned_a_i), ID (unsigned_a)),
71
- std::make_pair (ID (unsigned_b_i), ID (unsigned_b)),
72
- std::make_pair (ID (subtract_i), ID (subtract)),
73
- std::make_pair (ID (output_select_i), ID (output_select)),
74
- std::make_pair (ID (saturate_enable_i), ID (saturate_enable)),
75
- std::make_pair (ID (shift_right_i), ID (shift_right)),
76
- std::make_pair (ID (round_i), ID (round )),
77
- std::make_pair (ID (register_inputs_i), ID (register_inputs))
78
- };
79
-
80
63
const int m_ModeBitsSize = 80 ;
81
64
82
- // DSP data ports and how to map them to ports of the target DSP cell
83
- const std::vector<std::pair<IdString, IdString>> m_DspDataPorts = {
84
- std::make_pair (ID (a_i), ID (a)),
85
- std::make_pair (ID (b_i), ID (b)),
86
- std::make_pair (ID (acc_fir_i), ID (acc_fir)),
87
- std::make_pair (ID (z_o), ID (z)),
88
- std::make_pair (ID (dly_b_o), ID (dly_b))
89
- };
90
-
91
65
// DSP parameters
92
66
const std::vector<std::string> m_DspParams = {" COEFF_3" , " COEFF_2" , " COEFF_1" , " COEFF_0" };
93
67
94
- // Source DSP cell type (SISD)
95
- const IdString m_SisdDspType = ID(dsp_t1_10x9x32);
96
-
97
- // Target DSP cell types for the SIMD mode
98
- const IdString m_SimdDspType = ID(QL_DSP2);
99
-
100
68
// / Temporary SigBit to SigBit helper map.
101
69
SigMap sigmap;
102
70
@@ -106,6 +74,38 @@ struct QlDspSimdPass : public Pass {
106
74
{
107
75
log_header (a_Design, " Executing QL_DSP_SIMD pass.\n " );
108
76
77
+ // DSP control and config ports to consider and how to map them to ports
78
+ // of the target DSP cell
79
+ static const std::vector<std::pair<IdString, IdString>> m_DspCfgPorts = {
80
+ std::make_pair (ID (clock_i), ID (clk)),
81
+ std::make_pair (ID (reset_i), ID (reset)),
82
+ std::make_pair (ID (feedback_i), ID (feedback)),
83
+ std::make_pair (ID (load_acc_i), ID (load_acc)),
84
+ std::make_pair (ID (unsigned_a_i), ID (unsigned_a)),
85
+ std::make_pair (ID (unsigned_b_i), ID (unsigned_b)),
86
+ std::make_pair (ID (subtract_i), ID (subtract)),
87
+ std::make_pair (ID (output_select_i), ID (output_select)),
88
+ std::make_pair (ID (saturate_enable_i), ID (saturate_enable)),
89
+ std::make_pair (ID (shift_right_i), ID (shift_right)),
90
+ std::make_pair (ID (round_i), ID (round )),
91
+ std::make_pair (ID (register_inputs_i), ID (register_inputs))
92
+ };
93
+
94
+ // DSP data ports and how to map them to ports of the target DSP cell
95
+ static const std::vector<std::pair<IdString, IdString>> m_DspDataPorts = {
96
+ std::make_pair (ID (a_i), ID (a)),
97
+ std::make_pair (ID (b_i), ID (b)),
98
+ std::make_pair (ID (acc_fir_i), ID (acc_fir)),
99
+ std::make_pair (ID (z_o), ID (z)),
100
+ std::make_pair (ID (dly_b_o), ID (dly_b))
101
+ };
102
+
103
+ // Source DSP cell type (SISD)
104
+ static const IdString m_SisdDspType = ID (dsp_t1_10x9x32);
105
+
106
+ // Target DSP cell types for the SIMD mode
107
+ static const IdString m_SimdDspType = ID (QL_DSP2);
108
+
109
109
// Parse args
110
110
extra_args (a_Args, 1 , a_Design);
111
111
@@ -126,7 +126,7 @@ struct QlDspSimdPass : public Pass {
126
126
continue ;
127
127
128
128
// Add to a group
129
- const auto key = getDspConfig (cell);
129
+ const auto key = getDspConfig (cell, m_DspCfgPorts );
130
130
groups[key].push_back (cell);
131
131
}
132
132
@@ -255,11 +255,11 @@ struct QlDspSimdPass : public Pass {
255
255
}
256
256
257
257
// / Given a DSP cell populates and returns a DspConfig struct for it.
258
- DspConfig getDspConfig (RTLIL::Cell *a_Cell)
258
+ DspConfig getDspConfig (RTLIL::Cell *a_Cell, const std::vector<std::pair<IdString, IdString>> &dspCfgPorts )
259
259
{
260
260
DspConfig config;
261
261
262
- for (const auto &it : m_DspCfgPorts ) {
262
+ for (const auto &it : dspCfgPorts ) {
263
263
auto port = it.first ;
264
264
265
265
// Port unconnected
0 commit comments