Skip to content
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

Add AutoHoG JSON importer #756

Merged
merged 1 commit into from
Jul 18, 2024
Merged

Conversation

j2kun
Copy link
Collaborator

@j2kun j2kun commented Jun 28, 2024

Fixes #686

@j2kun j2kun marked this pull request as draft June 28, 2024 23:28
@j2kun j2kun force-pushed the autohog-importer branch 3 times, most recently from eca7a44 to fee9014 Compare June 29, 2024 23:52
@j2kun j2kun marked this pull request as ready for review July 14, 2024 19:19
@j2kun j2kun requested a review from asraa July 14, 2024 19:19
Copy link
Collaborator

@asraa asraa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Definitely a lot of work, so I really appreciate it!

lib/Dialect/CGGI/IR/CGGIOps.td Outdated Show resolved Hide resolved
lib/Source/AutoHog/AutoHogImporter.cpp Outdated Show resolved Hide resolved
lib/Source/AutoHog/AutoHogImporter.cpp Outdated Show resolved Hide resolved
lib/Source/AutoHog/AutoHogImporter.cpp Show resolved Hide resolved
lib/Source/AutoHog/AutoHogImporter.cpp Outdated Show resolved Hide resolved
lib/Source/AutoHog/AutoHogImporter.cpp Show resolved Hide resolved
lib/Source/AutoHog/AutoHogImporter.cpp Show resolved Hide resolved
@j2kun
Copy link
Collaborator Author

j2kun commented Jul 16, 2024

Still TODO: convert ports from object to array

@j2kun
Copy link
Collaborator Author

j2kun commented Jul 17, 2024

This one should be ready for a final review now.

Copy link
Collaborator

@asraa asraa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Really small question about the spec - after this is merged we can file a follow-up issue to add a README.md doc about the spec.

const rapidjson::Value &portData = itr->value;
assert(portData.IsObject() &&
"Expected 'connections[...]' to be an object");
const char *connectedPortName = portData["port"].GetString();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really understand why this value is always needed - in toposort.json the AND cell's port $0$ connection contains both cell and port -

        "$0$": {
          "cell": "input_cell",
          "port": "$2$"
        },

Shouldn't it either be connected to a port or a cell? Why does this field have both? It's also confusing because that port name is the same name as a local port name...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel the names are also confusing, but the way I understand it is that port refers to one of:

  • Global circuit input/output (when cell is not present)
  • Local cell input/output (when cell is present)

The problem is that $2$ is used many times in the example JSON, in each cell that has at least three inputs. So the way to disambiguate is either to give everything unique names, or add the name of the cell as a sort of namespace for the ports local to that cell.

@asraa asraa added the pull_ready Indicates whether a PR is ready to pull. The copybara worker will import for internal testing label Jul 17, 2024
@copybara-service copybara-service bot merged commit 195121f into google:main Jul 18, 2024
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pull_ready Indicates whether a PR is ready to pull. The copybara worker will import for internal testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add an importer for AutoHoG json netlists
2 participants