Skip to content

Commit d4da8af

Browse files
authored
Merge pull request #410 from AYYAZmayo/main
EDA-3246: Converting O_BUF_DS to O_BUFT_DS
2 parents 53e51f2 + e85a762 commit d4da8af

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

src/synth_rapidsilicon.cc

+27-1
Original file line numberDiff line numberDiff line change
@@ -5358,6 +5358,12 @@ static void show_sig(const RTLIL::SigSpec &sig)
53585358

53595359
if (!cell->hasParam(RTLIL::escape_id("WEAK_KEEPER")))
53605360
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"));
53615367
}
53625368

53635369
if (cell->type == RTLIL::escape_id("I_BUF_DS")){
@@ -5886,7 +5892,26 @@ static void show_sig(const RTLIL::SigSpec &sig)
58865892
cell->setPort(ID::T, State::S1);
58875893
}
58885894
}
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()) {
58895903

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+
}
58905915
// Remove I_BUF and O_BUF and replace by assigns
58915916
// This is usefull for instance when we start from a bad implementation
58925917
// of I_BUF/O_Buf like in test case :
@@ -9167,7 +9192,6 @@ void collect_clocks (RTLIL::Module* module,
91679192
run("techmap -map" + techMaplutArgs);
91689193
#endif
91699194

9170-
check_blackbox_param();
91719195

91729196
if (legalize_ram_clk_ports) {
91739197
legalize_all_tdp_ram_clock_ports();
@@ -9191,6 +9215,8 @@ void collect_clocks (RTLIL::Module* module,
91919215
// after calling 'rewire_obuft'.
91929216
//
91939217
map_obuf_to_obuft(_design->top_module());
9218+
map_o_buf_ds_to_o_buft_ds(_design->top_module());
9219+
check_blackbox_param();
91949220

91959221
// Eventually performs post synthesis clean up
91969222
//

0 commit comments

Comments
 (0)