-
Notifications
You must be signed in to change notification settings - Fork 430
Add Schema ID to RR Graph Formats #3366
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 6 commits
bae00b0
5a8e572
aa358f8
7bbc715
a413b42
4e96b4b
b54f0ef
8bf3903
618fcee
95e5f35
974af1f
4faf21f
623deab
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -294,6 +294,7 @@ class RrGraphSerializer final : public uxsd::RrGraphBase<RrGraphContextTypes> { | |
| MetadataStorage<int>* rr_node_metadata, | ||
| MetadataStorage<std::tuple<int, int, short>>* rr_edge_metadata, | ||
| vtr::string_internment* strings, | ||
| unsigned long schema_file_id, | ||
| bool is_flat) | ||
| : chan_width_(chan_width) | ||
| , rr_nodes_(rr_nodes) | ||
|
|
@@ -319,6 +320,7 @@ class RrGraphSerializer final : public uxsd::RrGraphBase<RrGraphContextTypes> { | |
| , strings_(strings) | ||
| , empty_(strings_->intern_string("")) | ||
| , report_error_(nullptr) | ||
| , schema_file_id_(schema_file_id) | ||
| , is_flat_(is_flat) { | ||
| // Initialize internal data | ||
| init_side_map(); | ||
|
|
@@ -1727,6 +1729,17 @@ class RrGraphSerializer final : public uxsd::RrGraphBase<RrGraphContextTypes> { | |
| * <xs:attribute name="tool_comment" type="xs:string" /> | ||
| * </xs:complexType> | ||
| */ | ||
| inline void set_rr_graph_schema_file_id(unsigned long schema_file_id, void*& /*ctx*/) final { | ||
| // Only check if the schema file ID is not 0. If it is 0, it means capnproto is not enabled. | ||
| // Thus, we cannot check the schema file ID mismatch. | ||
|
||
| if (schema_file_id_ != 0) { | ||
| if (schema_file_id != schema_file_id_) { | ||
| report_error( | ||
| "Schema file ID mismatch: Expected ID 0x%016lx, but got ID 0x%016lx", | ||
| schema_file_id_, schema_file_id); | ||
| } | ||
| } | ||
| } | ||
| inline void set_rr_graph_tool_comment(const char* tool_comment, void*& /*ctx*/) final { | ||
| std::string correct_string = "Generated from arch file "; | ||
| correct_string += get_arch_file_name(); | ||
|
|
@@ -1748,6 +1761,10 @@ class RrGraphSerializer final : public uxsd::RrGraphBase<RrGraphContextTypes> { | |
| } | ||
| } | ||
|
|
||
| inline unsigned long get_rr_graph_schema_file_id(void*& /*ctx*/) final { | ||
| return schema_file_id_; | ||
| } | ||
|
|
||
| inline const char* get_rr_graph_tool_comment(void*& /*ctx*/) final { | ||
| temp_string_.assign("Generated from arch file "); | ||
| temp_string_ += get_arch_file_name(); | ||
|
|
@@ -2181,6 +2198,7 @@ class RrGraphSerializer final : public uxsd::RrGraphBase<RrGraphContextTypes> { | |
| vtr::string_internment* strings_; | ||
| vtr::interned_string empty_; | ||
| const std::function<void(const char*)>* report_error_; | ||
| unsigned long schema_file_id_; | ||
| bool is_flat_; | ||
|
|
||
| // Temporary data to check grid block types | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.