@@ -464,7 +464,9 @@ struct SynthRapidSiliconPass : public ScriptPass {
464
464
465
465
// Special cells
466
466
//
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
+
468
470
469
471
// Alias between same signals (for I_BUF/CLK_BUF)
470
472
//
@@ -4208,10 +4210,15 @@ static void show_sig(const RTLIL::SigSpec &sig)
4208
4210
}
4209
4211
4210
4212
json_file << " {\n " ;
4211
- std::string name = it->first ;
4213
+ std::string name = ( it->first ). substr ( 1 ) ;
4212
4214
pair<int , int > wd = it->second ;
4213
4215
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
+
4215
4222
json_file << " \" width\" : \" " << wd.first << " \" ,\n " ;
4216
4223
json_file << " \" depth\" : \" " << wd.second << " \"\n " ;
4217
4224
json_file << " }" ;
@@ -4938,6 +4945,25 @@ static void show_sig(const RTLIL::SigSpec &sig)
4938
4945
}
4939
4946
}
4940
4947
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
+
4941
4967
bool illegal_port_connection (std::set<Cell*>* set_cells){
4942
4968
bool generic_cell = false ;
4943
4969
bool i_buf = false ;
@@ -8827,6 +8853,10 @@ void collect_clocks (RTLIL::Module* module,
8827
8853
8828
8854
run (" memory_map" );
8829
8855
8856
+ // To attach exra info for the netlist info json file
8857
+ //
8858
+ memoryMapAnalysis ();
8859
+
8830
8860
postProcessBrams ();
8831
8861
8832
8862
if (check_label (" map_gates" )) {
0 commit comments