@@ -294,6 +294,7 @@ class RrGraphSerializer final : public uxsd::RrGraphBase<RrGraphContextTypes> {
294294 MetadataStorage<int >* rr_node_metadata,
295295 MetadataStorage<std::tuple<int , int , short >>* rr_edge_metadata,
296296 vtr::string_internment* strings,
297+ unsigned long schema_file_id,
297298 bool is_flat)
298299 : chan_width_(chan_width)
299300 , rr_nodes_(rr_nodes)
@@ -319,6 +320,7 @@ class RrGraphSerializer final : public uxsd::RrGraphBase<RrGraphContextTypes> {
319320 , strings_(strings)
320321 , empty_(strings_->intern_string (" " ))
321322 , report_error_(nullptr )
323+ , schema_file_id_(schema_file_id)
322324 , is_flat_(is_flat) {
323325 // Initialize internal data
324326 init_side_map ();
@@ -1727,6 +1729,13 @@ class RrGraphSerializer final : public uxsd::RrGraphBase<RrGraphContextTypes> {
17271729 * <xs:attribute name="tool_comment" type="xs:string" />
17281730 * </xs:complexType>
17291731 */
1732+ inline void set_rr_graph_schema_file_id (unsigned long schema_file_id, void *& /* ctx*/ ) final {
1733+ if (schema_file_id != schema_file_id_) {
1734+ report_error (
1735+ " Schema file ID mismatch: Expected ID 0x%016lx, but got ID 0x%016lx" ,
1736+ schema_file_id_, schema_file_id);
1737+ }
1738+ }
17301739 inline void set_rr_graph_tool_comment (const char * tool_comment, void *& /* ctx*/ ) final {
17311740 std::string correct_string = " Generated from arch file " ;
17321741 correct_string += get_arch_file_name ();
@@ -1748,6 +1757,10 @@ class RrGraphSerializer final : public uxsd::RrGraphBase<RrGraphContextTypes> {
17481757 }
17491758 }
17501759
1760+ inline unsigned long get_rr_graph_schema_file_id (void *& /* ctx*/ ) final {
1761+ return schema_file_id_;
1762+ }
1763+
17511764 inline const char * get_rr_graph_tool_comment (void *& /* ctx*/ ) final {
17521765 temp_string_.assign (" Generated from arch file " );
17531766 temp_string_ += get_arch_file_name ();
@@ -2181,6 +2194,7 @@ class RrGraphSerializer final : public uxsd::RrGraphBase<RrGraphContextTypes> {
21812194 vtr::string_internment* strings_;
21822195 vtr::interned_string empty_;
21832196 const std::function<void (const char *)>* report_error_;
2197+ unsigned long schema_file_id_;
21842198 bool is_flat_;
21852199
21862200 // Temporary data to check grid block types
0 commit comments