@@ -464,7 +464,9 @@ struct SynthRapidSiliconPass : public ScriptPass {
464464
465465 // Special cells
466466 //
467- dict<std::string, pair<int , int >> pp_memories;
467+ dict<std::string, pair<int , int >> pp_memories; // pair is width and depth
468+ dict<std::string, string> pp_memories_prop; // property like "dissolved", "rom"
469+
468470
469471 // Alias between same signals (for I_BUF/CLK_BUF)
470472 //
@@ -4208,10 +4210,15 @@ static void show_sig(const RTLIL::SigSpec &sig)
42084210 }
42094211
42104212 json_file << " {\n " ;
4211- std::string name = it->first ;
4213+ std::string name = ( it->first ). substr ( 1 ) ;
42124214 pair<int , int > wd = it->second ;
42134215
4214- json_file << " \" name\" : \" " << name.substr (1 ) << " \" ,\n " ;
4216+ json_file << " \" name\" : \" " << name << " \" ,\n " ;
4217+
4218+ if (pp_memories_prop.count (name)) {
4219+ json_file << " \" type\" : \" " << pp_memories_prop[name] << " \" ,\n " ;
4220+ }
4221+
42154222 json_file << " \" width\" : \" " << wd.first << " \" ,\n " ;
42164223 json_file << " \" depth\" : \" " << wd.second << " \"\n " ;
42174224 json_file << " }" ;
@@ -4938,6 +4945,25 @@ static void show_sig(const RTLIL::SigSpec &sig)
49384945 }
49394946 }
49404947
4948+ // Scratchpad mechanism is used to extract data posted by the call to
4949+ // "memory_map". Data give extra memory info like "dissolved", "rom".
4950+ //
4951+ void memoryMapAnalysis ()
4952+ {
4953+ dict<std::string, pair<int , int >>::iterator it;
4954+
4955+ for (it = pp_memories.begin (); it != pp_memories.end (); ++it) {
4956+
4957+ std::string mem_name = it->first ;
4958+ string type = _design->scratchpad_get_string (mem_name);
4959+
4960+ if (type.size ()) {
4961+ log (" Memory %s type : %s\n " , mem_name.c_str (), type.c_str ());
4962+ pp_memories_prop[mem_name.substr (1 )] = type;
4963+ }
4964+ }
4965+ }
4966+
49414967 bool illegal_port_connection (std::set<Cell*>* set_cells){
49424968 bool generic_cell = false ;
49434969 bool i_buf = false ;
@@ -8099,6 +8125,7 @@ void collect_clocks (RTLIL::Module* module,
80998125
81008126 if (cell->type .in (ID (I_BUF_DS), ID (O_BUF_DS), ID (O_BUFT_DS), ID (O_SERDES),
81018127 ID (I_SERDES), ID (BOOT_CLOCK), ID (O_DELAY), ID (I_DELAY),
8128+ ID (O_SERDES_CLK), ID (PLL),
81028129 ID (O_BUF), ID (O_BUFT), ID (O_DDR))) {
81038130
81048131#if 0
@@ -8837,6 +8864,10 @@ void collect_clocks (RTLIL::Module* module,
88378864
88388865 run (" memory_map" );
88398866
8867+ // To attach exra info for the netlist info json file
8868+ //
8869+ memoryMapAnalysis ();
8870+
88408871 postProcessBrams ();
88418872
88428873 if (check_label (" map_gates" )) {
0 commit comments