@@ -5358,6 +5358,12 @@ static void show_sig(const RTLIL::SigSpec &sig)
5358
5358
5359
5359
if (!cell->hasParam(RTLIL::escape_id("WEAK_KEEPER")))
5360
5360
cell->setParam(RTLIL::escape_id("WEAK_KEEPER"), stringf("NONE"));
5361
+
5362
+ if (!cell->hasParam(RTLIL::escape_id("IOSTANDARD")))
5363
+ cell->setParam(RTLIL::escape_id("IOSTANDARD"), stringf("DEFAULT"));
5364
+
5365
+ if (!cell->hasParam(RTLIL::escape_id("DIFFERENTIAL_TERMINATION")))
5366
+ cell->setParam(RTLIL::escape_id("DIFFERENTIAL_TERMINATION"), stringf("TRUE"));
5361
5367
}
5362
5368
5363
5369
if (cell->type == RTLIL::escape_id("I_BUF_DS")){
@@ -5886,7 +5892,26 @@ static void show_sig(const RTLIL::SigSpec &sig)
5886
5892
cell->setPort(ID::T, State::S1);
5887
5893
}
5888
5894
}
5895
+ // Replace all O_BUF_DS cells by O_BUFT_DS equivalent.
5896
+ //
5897
+ // To correctly configure the GB in O_BUF_DS mode, we need to use
5898
+ // the O_BUFT_DS and set the enable signal "T" to 1.
5899
+ //
5900
+ void map_o_buf_ds_to_o_buft_ds(RTLIL::Module *top_module)
5901
+ {
5902
+ for (auto cell : top_module->cells()) {
5889
5903
5904
+ if (cell->type != RTLIL::escape_id("O_BUF_DS")) {
5905
+ continue;
5906
+ }
5907
+
5908
+ cell->type = RTLIL::escape_id("O_BUFT_DS");
5909
+
5910
+ // Add extra port 'T' set to 1'b1
5911
+ //
5912
+ cell->setPort(ID::T, State::S1);
5913
+ }
5914
+ }
5890
5915
// Remove I_BUF and O_BUF and replace by assigns
5891
5916
// This is usefull for instance when we start from a bad implementation
5892
5917
// of I_BUF/O_Buf like in test case :
@@ -9167,7 +9192,6 @@ void collect_clocks (RTLIL::Module* module,
9167
9192
run("techmap -map" + techMaplutArgs);
9168
9193
#endif
9169
9194
9170
- check_blackbox_param();
9171
9195
9172
9196
if (legalize_ram_clk_ports) {
9173
9197
legalize_all_tdp_ram_clock_ports();
@@ -9191,6 +9215,8 @@ void collect_clocks (RTLIL::Module* module,
9191
9215
// after calling 'rewire_obuft'.
9192
9216
//
9193
9217
map_obuf_to_obuft(_design->top_module());
9218
+ map_o_buf_ds_to_o_buft_ds(_design->top_module());
9219
+ check_blackbox_param();
9194
9220
9195
9221
// Eventually performs post synthesis clean up
9196
9222
//
0 commit comments