@@ -28,8 +28,9 @@ namespace FOEDAG {
2828
2929struct PIN_TABLE_INFO {
3030 PIN_TABLE_INFO () {}
31- PIN_TABLE_INFO (uint32_t i) : fabric_clk_index(i) {}
31+ PIN_TABLE_INFO (uint32_t i, bool s ) : fabric_clk_index(i), is_soc(s ) {}
3232 uint32_t fabric_clk_index = 0 ;
33+ bool is_soc = false ;
3334 uint32_t x = 0 ;
3435 uint32_t y = 0 ;
3536 std::string type = " " ;
@@ -61,7 +62,14 @@ void ModelConfig_BITSREAM_SETTINGS_XML::gen(
6162 CFG_ASSERT (words[0 ] == " set_core_clk" );
6263 CFG_ASSERT (location_map.find (words[1 ]) == location_map.end ());
6364 uint32_t index = (uint32_t )(CFG_convert_string_to_u64 (words[2 ]));
64- location_map[words[1 ]] = PIN_TABLE_INFO (index);
65+ location_map[words[1 ]] = PIN_TABLE_INFO (index, false );
66+ } else if (line.size () > 0 && line.find (" set_soc_clk" ) == 0 ) {
67+ std::vector<std::string> words = CFG_split_string (line, " " , 0 , false );
68+ CFG_ASSERT (words.size () == 3 );
69+ CFG_ASSERT (words[0 ] == " set_soc_clk" );
70+ CFG_ASSERT (location_map.find (words[1 ]) == location_map.end ());
71+ uint32_t index = (uint32_t )(CFG_convert_string_to_u64 (words[2 ]));
72+ location_map[words[1 ]] = PIN_TABLE_INFO (index, true );
6573 }
6674 }
6775 design.close ();
@@ -71,12 +79,16 @@ void ModelConfig_BITSREAM_SETTINGS_XML::gen(
7179 while (std::getline (pin, line)) {
7280 CFG_get_rid_trailing_whitespace (line);
7381 std::vector<std::string> words = CFG_split_string (line, " ," );
74- if (words.size () >= 11 && words[2 ].size () > 0 ) {
75- auto iter = location_map.find (words[2 ]);
76- if (iter != location_map.end ()) {
77- iter->second .x = (uint32_t )(CFG_convert_string_to_u64 (words[9 ]));
78- iter->second .y = (uint32_t )(CFG_convert_string_to_u64 (words[10 ]));
79- }
82+ std::map<std::string, PIN_TABLE_INFO>::iterator iter;
83+ if (words.size () >= 14 &&
84+ ((words[2 ].size () > 0 &&
85+ (iter = location_map.find (words[2 ])) != location_map.end () &&
86+ !iter->second .is_soc ) ||
87+ (words[13 ].size () > 0 &&
88+ (iter = location_map.find (words[13 ])) != location_map.end () &&
89+ iter->second .is_soc ))) {
90+ iter->second .x = (uint32_t )(CFG_convert_string_to_u64 (words[9 ]));
91+ iter->second .y = (uint32_t )(CFG_convert_string_to_u64 (words[10 ]));
8092 }
8193 }
8294 pin.close ();
@@ -117,9 +129,10 @@ void ModelConfig_BITSREAM_SETTINGS_XML::gen(
117129 }
118130 if (iter.second .type .size ()) {
119131 oxml << CFG_print (
120- " <!-- Location: %s, Value: %d, X: %d, Y: %d -->\n " ,
121- iter.first .c_str (), iter.second .fabric_clk_index ,
122- iter.second .x , iter.second .y )
132+ " <!-- Location: %s, SOC: %d, Value: %d, X: %d, Y: %d "
133+ " -->\n " ,
134+ iter.first .c_str (), iter.second .is_soc ,
135+ iter.second .fabric_clk_index , iter.second .x , iter.second .y )
123136 .c_str ();
124137 for (int i = 0 ; i < 4 ; i++) {
125138 oxml << CFG_print (
@@ -132,10 +145,11 @@ void ModelConfig_BITSREAM_SETTINGS_XML::gen(
132145 }
133146 } else {
134147 oxml << CFG_print (
135- " <!-- Unknown location: %s, Value: %d, X: %d, Y: %d "
148+ " <!-- Unknown location: %s, SOC: %d, Value: %d, X: %d, "
149+ " Y: %d "
136150 " -->\n " ,
137- iter.first .c_str (), iter.second .fabric_clk_index ,
138- iter.second .x , iter.second .y )
151+ iter.first .c_str (), iter.second .is_soc ,
152+ iter.second .fabric_clk_index , iter. second . x , iter.second .y )
139153 .c_str ();
140154 }
141155 }
0 commit comments