44 * https://github.com/duck2/uxsdcxx
55 * Modify only if your build process doesn't involve regenerating this file.
66 *
7- * Cmdline: uxsdcxx/uxsdcxx.py /home/soheil/vtr/vtr-verilog-to-routing /libs/librrgraph/src/io/rr_graph.xsd
8- * Input file: /home/soheil/vtr/vtr-verilog-to-routing /libs/librrgraph/src/io/rr_graph.xsd
9- * md5sum of input file: 040903603053940a1b24392c38663b59
7+ * Cmdline: uxsdcxx/uxsdcxx.py /home/soheil/vpr_repos /libs/librrgraph/src/io/rr_graph.xsd
8+ * Input file: /home/soheil/vpr_repos /libs/librrgraph/src/io/rr_graph.xsd
9+ * md5sum of input file: 5d51b89242fe6e463629ac43a72e4606
1010 */
1111
1212#include < functional>
@@ -201,10 +201,15 @@ inline void write_rr_graph_xml(T &in, Context &context, std::ostream &os){
201201}
202202
203203
204+ #if defined(_MSC_VER)
205+ typedef const uint32_t __declspec (align(1 )) triehash_uu32;
206+ typedef const uint64_t __declspec (align(1 )) triehash_uu64;
207+ #else
204208typedef const uint32_t __attribute__ ((aligned(1 ))) triehash_uu32;
205209typedef const uint64_t __attribute__ ((aligned(1 ))) triehash_uu64;
206210static_assert (alignof (triehash_uu32) == 1 , " Unaligned 32-bit access not found." );
207211static_assert (alignof (triehash_uu64) == 1 , " Unaligned 64-bit access not found." );
212+ #endif
208213#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
209214#define onechar (c, s, l ) (((uint64_t )(c)) << (s))
210215#else
@@ -275,8 +280,8 @@ constexpr const char *atok_lookup_t_grid_loc[] = {"block_type_id", "height_offse
275280enum class gtok_t_grid_locs {GRID_LOC};
276281constexpr const char *gtok_lookup_t_grid_locs[] = {" grid_loc" };
277282
278- enum class atok_t_node_loc {LAYER_HIGH, LAYER_LOW, PTC, SIDE, XHIGH, XLOW, YHIGH, YLOW};
279- constexpr const char *atok_lookup_t_node_loc[] = {" layer_high " , " layer_low " , " ptc " , " side " , " xhigh" , " xlow" , " yhigh" , " ylow" };
283+ enum class atok_t_node_loc {LAYER, PTC, SIDE, TWIST , XHIGH, XLOW, YHIGH, YLOW};
284+ constexpr const char *atok_lookup_t_node_loc[] = {" layer " , " ptc " , " side " , " twist " , " xhigh" , " xlow" , " yhigh" , " ylow" };
280285
281286
282287enum class atok_t_node_timing {C, R};
@@ -1156,49 +1161,34 @@ inline atok_t_node_loc lex_attr_t_node_loc(const char *in, const std::function<v
11561161 break ;
11571162 case 5 :
11581163 switch (*((triehash_uu32*)&in[0 ])){
1159- case onechar (' x ' , 0 , 32 ) | onechar (' h ' , 8 , 32 ) | onechar (' i ' , 16 , 32 ) | onechar (' g ' , 24 , 32 ):
1164+ case onechar (' l ' , 0 , 32 ) | onechar (' a ' , 8 , 32 ) | onechar (' y ' , 16 , 32 ) | onechar (' e ' , 24 , 32 ):
11601165 switch (in[4 ]){
1161- case onechar (' h ' , 0 , 8 ):
1162- return atok_t_node_loc::XHIGH ;
1166+ case onechar (' r ' , 0 , 8 ):
1167+ return atok_t_node_loc::LAYER ;
11631168 break ;
11641169 default : break ;
11651170 }
11661171 break ;
1167- case onechar (' y ' , 0 , 32 ) | onechar (' h ' , 8 , 32 ) | onechar (' i' , 16 , 32 ) | onechar (' g ' , 24 , 32 ):
1172+ case onechar (' t ' , 0 , 32 ) | onechar (' w ' , 8 , 32 ) | onechar (' i' , 16 , 32 ) | onechar (' s ' , 24 , 32 ):
11681173 switch (in[4 ]){
1169- case onechar (' h ' , 0 , 8 ):
1170- return atok_t_node_loc::YHIGH ;
1174+ case onechar (' t ' , 0 , 8 ):
1175+ return atok_t_node_loc::TWIST ;
11711176 break ;
11721177 default : break ;
11731178 }
11741179 break ;
1175- default : break ;
1176- }
1177- break ;
1178- case 9 :
1179- switch (*((triehash_uu64*)&in[0 ])){
1180- case onechar (' l' , 0 , 64 ) | onechar (' a' , 8 , 64 ) | onechar (' y' , 16 , 64 ) | onechar (' e' , 24 , 64 ) | onechar (' r' , 32 , 64 ) | onechar (' _' , 40 , 64 ) | onechar (' l' , 48 , 64 ) | onechar (' o' , 56 , 64 ):
1181- switch (in[8 ]){
1182- case onechar (' w' , 0 , 8 ):
1183- return atok_t_node_loc::LAYER_LOW;
1180+ case onechar (' x' , 0 , 32 ) | onechar (' h' , 8 , 32 ) | onechar (' i' , 16 , 32 ) | onechar (' g' , 24 , 32 ):
1181+ switch (in[4 ]){
1182+ case onechar (' h' , 0 , 8 ):
1183+ return atok_t_node_loc::XHIGH;
11841184 break ;
11851185 default : break ;
11861186 }
11871187 break ;
1188- default : break ;
1189- }
1190- break ;
1191- case 10 :
1192- switch (*((triehash_uu64*)&in[0 ])){
1193- case onechar (' l' , 0 , 64 ) | onechar (' a' , 8 , 64 ) | onechar (' y' , 16 , 64 ) | onechar (' e' , 24 , 64 ) | onechar (' r' , 32 , 64 ) | onechar (' _' , 40 , 64 ) | onechar (' h' , 48 , 64 ) | onechar (' i' , 56 , 64 ):
1194- switch (in[8 ]){
1195- case onechar (' g' , 0 , 8 ):
1196- switch (in[9 ]){
1197- case onechar (' h' , 0 , 8 ):
1198- return atok_t_node_loc::LAYER_HIGH;
1199- break ;
1200- default : break ;
1201- }
1188+ case onechar (' y' , 0 , 32 ) | onechar (' h' , 8 , 32 ) | onechar (' i' , 16 , 32 ) | onechar (' g' , 24 , 32 ):
1189+ switch (in[4 ]){
1190+ case onechar (' h' , 0 , 8 ):
1191+ return atok_t_node_loc::YHIGH;
12021192 break ;
12031193 default : break ;
12041194 }
@@ -1634,7 +1624,7 @@ template<std::size_t N>
16341624constexpr const char *lookup_switch_type[] = {" UXSD_INVALID" , " mux" , " tristate" , " pass_gate" , " short" , " buffer" };
16351625constexpr const char *lookup_segment_res_type[] = {" UXSD_INVALID" , " GENERAL" , " GCLK" };
16361626constexpr const char *lookup_pin_type[] = {" UXSD_INVALID" , " OPEN" , " OUTPUT" , " INPUT" };
1637- constexpr const char *lookup_node_type[] = {" UXSD_INVALID" , " CHANX" , " CHANY" , " CHANZ " , " SOURCE" , " SINK" , " OPIN" , " IPIN" , " MUX " };
1627+ constexpr const char *lookup_node_type[] = {" UXSD_INVALID" , " CHANX" , " CHANY" , " SOURCE" , " SINK" , " OPIN" , " IPIN" };
16381628constexpr const char *lookup_node_direction[] = {" UXSD_INVALID" , " INC_DIR" , " DEC_DIR" , " BI_DIR" , " NONE" };
16391629constexpr const char *lookup_node_clk_res_type[] = {" UXSD_INVALID" , " VIRTUAL_SINK" };
16401630constexpr const char *lookup_loc_side[] = {" UXSD_INVALID" , " LEFT" , " RIGHT" , " TOP" , " BOTTOM" , " RIGHT_LEFT" , " RIGHT_BOTTOM" , " RIGHT_BOTTOM_LEFT" , " TOP_RIGHT" , " TOP_BOTTOM" , " TOP_LEFT" , " TOP_RIGHT_BOTTOM" , " TOP_RIGHT_LEFT" , " TOP_BOTTOM_LEFT" , " TOP_RIGHT_BOTTOM_LEFT" , " BOTTOM_LEFT" };
@@ -1813,24 +1803,6 @@ inline enum_pin_type lex_enum_pin_type(const char *in, bool throw_on_invalid, co
18131803inline enum_node_type lex_enum_node_type (const char *in, bool throw_on_invalid, const std::function<void (const char *)> * report_error){
18141804 unsigned int len = strlen (in);
18151805 switch (len){
1816- case 3 :
1817- switch (in[0 ]){
1818- case onechar (' M' , 0 , 8 ):
1819- switch (in[1 ]){
1820- case onechar (' U' , 0 , 8 ):
1821- switch (in[2 ]){
1822- case onechar (' X' , 0 , 8 ):
1823- return enum_node_type::MUX;
1824- break ;
1825- default : break ;
1826- }
1827- break ;
1828- default : break ;
1829- }
1830- break ;
1831- default : break ;
1832- }
1833- break ;
18341806 case 4 :
18351807 switch (*((triehash_uu32*)&in[0 ])){
18361808 case onechar (' I' , 0 , 32 ) | onechar (' P' , 8 , 32 ) | onechar (' I' , 16 , 32 ) | onechar (' N' , 24 , 32 ):
@@ -1855,9 +1827,6 @@ inline enum_node_type lex_enum_node_type(const char *in, bool throw_on_invalid,
18551827 case onechar (' Y' , 0 , 8 ):
18561828 return enum_node_type::CHANY;
18571829 break ;
1858- case onechar (' Z' , 0 , 8 ):
1859- return enum_node_type::CHANZ;
1860- break ;
18611830 default : break ;
18621831 }
18631832 break ;
@@ -2511,18 +2480,18 @@ inline void load_node_loc_required_attributes(const pugi::xml_node &root, int *
25112480 if (astate[(int )in] == 0 ) astate[(int )in] = 1 ;
25122481 else noreturn_report (report_error, (" Duplicate attribute " + std::string (attr.name ()) + " in <node_loc>." ).c_str ());
25132482 switch (in){
2514- case atok_t_node_loc::LAYER_HIGH:
2515- /* Attribute layer_high set after element init */
2516- break ;
2517- case atok_t_node_loc::LAYER_LOW:
2518- /* Attribute layer_low set after element init */
2483+ case atok_t_node_loc::LAYER:
2484+ /* Attribute layer set after element init */
25192485 break ;
25202486 case atok_t_node_loc::PTC:
25212487 /* Attribute ptc set after element init */
25222488 break ;
25232489 case atok_t_node_loc::SIDE:
25242490 /* Attribute side set after element init */
25252491 break ;
2492+ case atok_t_node_loc::TWIST:
2493+ /* Attribute twist set after element init */
2494+ break ;
25262495 case atok_t_node_loc::XHIGH:
25272496 *xhigh = load_int (attr.value (), report_error);
25282497 break ;
@@ -2538,7 +2507,7 @@ inline void load_node_loc_required_attributes(const pugi::xml_node &root, int *
25382507 default : break ; /* Not possible. */
25392508 }
25402509 }
2541- std::bitset<8 > test_astate = astate | std::bitset<8 >(0b00001011 );
2510+ std::bitset<8 > test_astate = astate | std::bitset<8 >(0b00001101 );
25422511 if (!test_astate.all ()) attr_error (test_astate, atok_lookup_t_node_loc, report_error);
25432512}
25442513
@@ -3453,11 +3422,8 @@ inline void load_node_loc(const pugi::xml_node &root, T &out, Context &context,
34533422 for (pugi::xml_attribute attr = root.first_attribute (); attr; attr = attr.next_attribute ()){
34543423 atok_t_node_loc in = lex_attr_t_node_loc (attr.name (), report_error);
34553424 switch (in){
3456- case atok_t_node_loc::LAYER_HIGH:
3457- out.set_node_loc_layer_high (load_int (attr.value (), report_error), context);
3458- break ;
3459- case atok_t_node_loc::LAYER_LOW:
3460- out.set_node_loc_layer_low (load_int (attr.value (), report_error), context);
3425+ case atok_t_node_loc::LAYER:
3426+ out.set_node_loc_layer (load_int (attr.value (), report_error), context);
34613427 break ;
34623428 case atok_t_node_loc::PTC:
34633429 out.set_node_loc_ptc (attr.value (), context);
@@ -4199,8 +4165,7 @@ inline void write_node(T &in, std::ostream &os, Context &context){
41994165 {
42004166 auto child_context = in.get_node_loc (context);
42014167 os << " <loc" ;
4202- os << " layer_high=\" " << in.get_node_loc_layer_high (child_context) << " \" " ;
4203- os << " layer_low=\" " << in.get_node_loc_layer_low (child_context) << " \" " ;
4168+ os << " layer=\" " << in.get_node_loc_layer (child_context) << " \" " ;
42044169 os << " ptc=\" " << in.get_node_loc_ptc (child_context) << " \" " ;
42054170 if ((bool )in.get_node_loc_side (child_context))
42064171 os << " side=\" " << lookup_loc_side[(int )in.get_node_loc_side (child_context)] << " \" " ;
0 commit comments