Skip to content

FPGA Interchange: add constant synthetic tiles #1958

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

Conversation

acomodi
Copy link
Collaborator

@acomodi acomodi commented Jan 27, 2022

Description

This adds the synthetic tiles for the constant network, improving support for the interchange devices.

The idea is to place a synthetic tile with two subtiles, each for one constant. The synthetic tile will be placed on the edge of the grid, so not to conflict with real tiles.

With the followup RR graph interchange reader, the constant tiles will be connected to the real RR graph based on the information present in the device

Motivation and Context

Constants need to be handled correctly, and fully supported

Types of changes

  • Bug fix (change which fixes an issue)
  • New feature (change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation
  • I have updated the documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed

@github-actions github-actions bot added libarchfpga Library for handling FPGA Architecture descriptions VPR VPR FPGA Placement & Routing Tool labels Jan 27, 2022
@mithro
Copy link
Contributor

mithro commented Jan 27, 2022

There probably needs to be a way to describe a constant generator in the older architecture XML format too?

@acomodi acomodi force-pushed the acom/fpga-interchange-improve-arch-reading-consts-upstream branch from 44b094d to 1405735 Compare February 7, 2022 15:24
@@ -2103,6 +2252,16 @@ struct ArchReader {
grid_def.loc_defs.emplace_back(std::move(single));
}

// The constant source tile will be placed at (0, 0)
Copy link
Collaborator

Choose a reason for hiding this comment

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

How are we sure that there is no real tile at (0, 0) ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

There is an empty outer layer surrounding the grid, as all the tiles have been placed with a (1, 1) offset: https://github.com/verilog-to-routing/vtr-verilog-to-routing/blob/master/libs/libarchfpga/src/read_fpga_interchange_arch.cpp#L2095-L2096


if (consts.getVccNetName().isName())
arch_->vcc_net = str(consts.getVccNetName().getName());
arch_->gnd_net = consts.getGndNetName().isName() ? str(consts.getGndNetName().getName()) : "$__gnd_net";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are these hard-coded const net names special in any way? Maybe we could define them as constants somewhere else in the code?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

So, in general the const names should be present in the interchange device. This is just a way to allow having them blank. At the moment there is no interchange device validator and there is no rule to determine whether the const GND and VCC net need to be defined.

We could opt for erroring out if those are not present

@tangxifan
Copy link
Contributor

@acomodi Can you give me 2 weeks to review the PR? Sorry for a delay due to my bandwidth problem.

Copy link
Contributor

@tangxifan tangxifan left a comment

Choose a reason for hiding this comment

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

Basically, the changes look good. Just need some comments so that it is easier for other developers.

type.fc_specs.push_back(fc_spec);
}
pb_type->name = vtr::strdup(const_block_.c_str());
pb_type->num_pb = 1;
Copy link
Contributor

Choose a reason for hiding this comment

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

I see some attributes of the constant block is hard coded. Is it possible to provide more comments? For example, what are the two ports (VCC & GND)? And what are the naming convention for both pb_type and ports? I believe these information is useful when building a legalizer, e.g., check_arch(). As we support multiple file format, we definitely need a legalizer which tells us if the arch database is good enough for downstream functions.

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 have added a comment on top of the function

@acomodi acomodi force-pushed the acom/fpga-interchange-improve-arch-reading-consts-upstream branch from 1405735 to cdaac96 Compare February 23, 2022 08:54
@acomodi acomodi requested a review from tangxifan February 24, 2022 08:59
@acomodi acomodi force-pushed the acom/fpga-interchange-improve-arch-reading-consts-upstream branch from cdaac96 to 724b87e Compare March 11, 2022 10:50
@acomodi
Copy link
Collaborator Author

acomodi commented Mar 15, 2022

I have added more comments on top of the new functions as well as some other. I may open a new PR to increase the comments coverage on the interchange-related functions as well.

For now I'll proceed with merging this PR and soon after I'll open the one about the RR graph generation.

@acomodi acomodi merged commit 08ec56b into verilog-to-routing:master Mar 15, 2022
@acomodi acomodi deleted the acom/fpga-interchange-improve-arch-reading-consts-upstream branch March 15, 2022 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libarchfpga Library for handling FPGA Architecture descriptions VPR VPR FPGA Placement & Routing Tool
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants