-
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
base: master
Are you sure you want to change the base?
Conversation
|
Note that if an XML file does not contain this attribute, it can still be read. An error is raised only when the schema_id attribute is present and does not match the schema used by VPR. |
AlexandreSinger
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Amin! Some minor comments below.
So, just to confirm, if the XML file does not have this attribute, this code will not error out? My concern is that many users of VTR generate the RR-graph XML using external tools. So is our solution to this is just to tell them not to set this attribute? That way they "opt-out" of this error checking.
| #ifdef VTR_ENABLE_CAPNPROTO | ||
| ::capnp::Schema schema = ::capnp::Schema::from<ucap::RrGraph>(); | ||
| schema_file_id = schema.getProto().getScopeId(); | ||
| VTR_LOG("Schema file ID: 0x%016lx\n", schema_file_id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we make this a verbose message? I am not sure if this message will make sense for most users of VPR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have a strong opinion on it, but I think if you are reading or writing the RR Graph, this is relevant information to print even when verbose mode is not enabled.
| #ifdef VTR_ENABLE_CAPNPROTO | ||
| ::capnp::Schema schema = ::capnp::Schema::from<ucap::RrGraph>(); | ||
| schema_file_id = schema.getProto().getScopeId(); | ||
| VTR_LOG("Schema file ID: 0x%016lx\n", schema_file_id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment here. I am wondering if we should make this a verbose log message.
Yes, you are right. If this attribute doesn't exist in XML file, we don't error out. |
This PR adds a schema file ID to the RR graph attributes. The ID is included in both the XML and Cap’n Proto (binary) formats. When reading an RR graph, VTR now loads the schema ID stored in its internal schema and compares it with the ID found in the XML or binary file. If the IDs do not match, an error is raised.
@AlexandreSinger: I believe this also addresses your earlier concern about including an ID for the XML file.
Below is the first line of the RR graph XML, showing the added schema ID:
For the Cap’n Proto file: each time the schema is generated, Cap’n Proto assigns a random 64-bit number in the format
@0x.... This number is stored as the schema ID in both the XML and binary RR graph files.