4
4
* https://github.com/duck2/uxsdcxx
5
5
* Modify only if your build process doesn't involve regenerating this file.
6
6
*
7
- * Cmdline: /home/talaeikh/ uxsdcxx/uxsdcxx.py /home/talaeikh /vtr-verilog-to-routing/libs/librrgraph/src/io/rr_graph.xsd
8
- * Input file: /home/talaeikh /vtr-verilog-to-routing/libs/librrgraph/src/io/rr_graph.xsd
9
- * md5sum of input file: 9c14a0ddd3c6bc1e690ca6abf467bae6
7
+ * Cmdline: uxsdcxx/uxsdcxx.py /home/mohagh18 /vtr-verilog-to-routing/libs/librrgraph/src/io/rr_graph.xsd
8
+ * Input file: /home/mohagh18 /vtr-verilog-to-routing/libs/librrgraph/src/io/rr_graph.xsd
9
+ * md5sum of input file: 65eddcc840064bbb91d7f4cf0b8bf821
10
10
*/
11
11
12
12
#include < functional>
@@ -247,8 +247,8 @@ constexpr const char *atok_lookup_t_segment_timing[] = {"C_per_meter", "R_per_me
247
247
248
248
enum class gtok_t_segment {TIMING};
249
249
constexpr const char *gtok_lookup_t_segment[] = {" timing" };
250
- enum class atok_t_segment {ID, NAME, RES_TYPE};
251
- constexpr const char *atok_lookup_t_segment[] = {" id" , " name" , " res_type" };
250
+ enum class atok_t_segment {ID, LENGTH, NAME, RES_TYPE};
251
+ constexpr const char *atok_lookup_t_segment[] = {" id" , " length " , " name" , " res_type" };
252
252
253
253
enum class gtok_t_segments {SEGMENT};
254
254
constexpr const char *gtok_lookup_t_segments[] = {" segment" };
@@ -792,6 +792,24 @@ inline atok_t_segment lex_attr_t_segment(const char *in, const std::function<voi
792
792
default : break ;
793
793
}
794
794
break ;
795
+ case 6 :
796
+ switch (*((triehash_uu32*)&in[0 ])){
797
+ case onechar (' l' , 0 , 32 ) | onechar (' e' , 8 , 32 ) | onechar (' n' , 16 , 32 ) | onechar (' g' , 24 , 32 ):
798
+ switch (in[4 ]){
799
+ case onechar (' t' , 0 , 8 ):
800
+ switch (in[5 ]){
801
+ case onechar (' h' , 0 , 8 ):
802
+ return atok_t_segment::LENGTH;
803
+ break ;
804
+ default : break ;
805
+ }
806
+ break ;
807
+ default : break ;
808
+ }
809
+ break ;
810
+ default : break ;
811
+ }
812
+ break ;
795
813
case 8 :
796
814
switch (*((triehash_uu64*)&in[0 ])){
797
815
case onechar (' r' , 0 , 64 ) | onechar (' e' , 8 , 64 ) | onechar (' s' , 16 , 64 ) | onechar (' _' , 24 , 64 ) | onechar (' t' , 32 , 64 ) | onechar (' y' , 40 , 64 ) | onechar (' p' , 48 , 64 ) | onechar (' e' , 56 , 64 ):
@@ -2325,7 +2343,7 @@ inline void load_switch_required_attributes(const pugi::xml_node &root, int * id
2325
2343
}
2326
2344
2327
2345
inline void load_segment_required_attributes (const pugi::xml_node &root, int * id, const std::function<void (const char *)> * report_error){
2328
- std::bitset<3 > astate = 0 ;
2346
+ std::bitset<4 > astate = 0 ;
2329
2347
for (pugi::xml_attribute attr = root.first_attribute (); attr; attr = attr.next_attribute ()){
2330
2348
atok_t_segment in = lex_attr_t_segment (attr.name (), report_error);
2331
2349
if (astate[(int )in] == 0 ) astate[(int )in] = 1 ;
@@ -2334,6 +2352,9 @@ inline void load_segment_required_attributes(const pugi::xml_node &root, int * i
2334
2352
case atok_t_segment::ID:
2335
2353
*id = load_int (attr.value (), report_error);
2336
2354
break ;
2355
+ case atok_t_segment::LENGTH:
2356
+ /* Attribute length set after element init */
2357
+ break ;
2337
2358
case atok_t_segment::NAME:
2338
2359
/* Attribute name set after element init */
2339
2360
break ;
@@ -2343,7 +2364,7 @@ inline void load_segment_required_attributes(const pugi::xml_node &root, int * i
2343
2364
default : break ; /* Not possible. */
2344
2365
}
2345
2366
}
2346
- std::bitset<3 > test_astate = astate | std::bitset<3 >( 0b100 );
2367
+ std::bitset<4 > test_astate = astate | std::bitset<4 >( 0b1010 );
2347
2368
if (!test_astate.all ()) attr_error (test_astate, atok_lookup_t_segment, report_error);
2348
2369
}
2349
2370
@@ -2936,6 +2957,9 @@ inline void load_segment(const pugi::xml_node &root, T &out, Context &context, c
2936
2957
case atok_t_segment::ID:
2937
2958
/* Attribute id is already set */
2938
2959
break ;
2960
+ case atok_t_segment::LENGTH:
2961
+ out.set_segment_length (load_int (attr.value (), report_error), context);
2962
+ break ;
2939
2963
case atok_t_segment::NAME:
2940
2964
out.set_segment_name (attr.value (), context);
2941
2965
break ;
@@ -4006,6 +4030,8 @@ inline void write_segments(T &in, std::ostream &os, Context &context){
4006
4030
auto child_context = in.get_segments_segment (i, context);
4007
4031
os << " <segment" ;
4008
4032
os << " id=\" " << in.get_segment_id (child_context) << " \" " ;
4033
+ if ((bool )in.get_segment_length (child_context))
4034
+ os << " length=\" " << in.get_segment_length (child_context) << " \" " ;
4009
4035
os << " name=\" " << in.get_segment_name (child_context) << " \" " ;
4010
4036
if ((bool )in.get_segment_res_type (child_context))
4011
4037
os << " res_type=\" " << lookup_segment_res_type[(int )in.get_segment_res_type (child_context)] << " \" " ;
0 commit comments