From 78b9e0992f282fd5978a458d5d30fa07e51c3e3e Mon Sep 17 00:00:00 2001 From: thierryBesson Date: Tue, 24 Sep 2024 11:57:52 +0500 Subject: [PATCH 1/2] Fix EDA-3248 --- src/synth_rapidsilicon.cc | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/src/synth_rapidsilicon.cc b/src/synth_rapidsilicon.cc index 0de75f0b..3cf99970 100644 --- a/src/synth_rapidsilicon.cc +++ b/src/synth_rapidsilicon.cc @@ -464,7 +464,9 @@ struct SynthRapidSiliconPass : public ScriptPass { // Special cells // - dict> pp_memories; + dict> pp_memories; // pair is width and depth + dict pp_memories_prop; // property like "dissolved", "rom" + // Alias between same signals (for I_BUF/CLK_BUF) // @@ -4208,10 +4210,15 @@ static void show_sig(const RTLIL::SigSpec &sig) } json_file << " {\n"; - std::string name = it->first; + std::string name = (it->first).substr(1); pair wd = it->second; - json_file << " \"name\" : \"" << name.substr(1) << "\",\n"; + json_file << " \"name\" : \"" << name << "\",\n"; + + if (pp_memories_prop.count(name)) { + json_file << " \"type\" : \"" << pp_memories_prop[name] << "\",\n"; + } + json_file << " \"width\" : \"" << wd.first << "\",\n"; json_file << " \"depth\" : \"" << wd.second << "\"\n"; json_file << " }"; @@ -4938,6 +4945,25 @@ static void show_sig(const RTLIL::SigSpec &sig) } } + // Scratchpad mechanism is used to extract data posted by the call to + // "memory_map". Data give extra memory info like "dissolved", "rom". + // + void memoryMapAnalysis() + { + dict>::iterator it; + + for (it = pp_memories.begin(); it != pp_memories.end(); ++it) { + + std::string mem_name = it->first; + string type = _design->scratchpad_get_string(mem_name); + + if (type.size()) { + log("Memory %s type : %s\n", mem_name.c_str(), type.c_str()); + pp_memories_prop[mem_name.substr(1)] = type; + } + } + } + bool illegal_port_connection(std::set* set_cells){ bool generic_cell = false; bool i_buf = false; @@ -8827,6 +8853,10 @@ void collect_clocks (RTLIL::Module* module, run("memory_map"); + // To attach exra info for the netlist info json file + // + memoryMapAnalysis(); + postProcessBrams(); if (check_label("map_gates")) { From 9d195ac1dfc44320fdead694d617ea1759a0172e Mon Sep 17 00:00:00 2001 From: thierryBesson Date: Tue, 24 Sep 2024 17:27:10 +0500 Subject: [PATCH 2/2] fix EDA-3262 --- src/synth_rapidsilicon.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/synth_rapidsilicon.cc b/src/synth_rapidsilicon.cc index 3cf99970..bd4af41b 100644 --- a/src/synth_rapidsilicon.cc +++ b/src/synth_rapidsilicon.cc @@ -8125,6 +8125,7 @@ void collect_clocks (RTLIL::Module* module, if (cell->type.in(ID(I_BUF_DS), ID(O_BUF_DS), ID(O_BUFT_DS), ID(O_SERDES), ID(I_SERDES), ID(BOOT_CLOCK), ID(O_DELAY), ID(I_DELAY), + ID(O_SERDES_CLK), ID(PLL), ID(O_BUF), ID(O_BUFT), ID(O_DDR))) { #if 0