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

xc7 MMCM support #1729

Merged
merged 37 commits into from
Aug 19, 2021
Merged

xc7 MMCM support #1729

merged 37 commits into from
Aug 19, 2021

Conversation

mkurc-ant
Copy link
Collaborator

@mkurc-ant mkurc-ant commented Oct 27, 2020

This pull requests adds support for MMCM block for Xilinx 7-series devices.

The supported features are:

  • Basic (integer) multiplier and divider control,
  • Fractional multiplier (CLKFBOUT) and divider (CLKOUT0) support,
  • Duty cycle control,
  • Phase shift control,
  • Bandwidth and compensation settings,
  • Local control input inverters (CLKINSEL, PSEN, PSINCDEC, PWRDWN, RST)
  • Startup wait enable/disable

Dynamic phase shift and dynamic reconfiguration are supported as well.

All the remaining MMCM functionality is not supported at the moment mostly due to missing bitstream documentation. This is tracked in f4pga/prjxray#1473

This PR also adds tests/examples for MMCM which are available under xc/xc7/tests/mmcm and can be run on hardware (some of them).

@mkurc-ant
Copy link
Collaborator Author

While disassembling Vivado bitstreams of MMCM designs I'm consistently getting these two unknown bits:

{ unknown_bit = "0040151c_30_19", unknown_segment = "0x00401500", unknown_segbit = "28_979" }
{ unknown_bit = "0040151c_31_28", unknown_segment = "0x00401500", unknown_segbit = "28_1020" }

@litghost
Copy link
Contributor

litghost commented Oct 27, 2020

While disassembling Vivado bitstreams of MMCM designs I'm consistently getting these two unknown bits:

{ unknown_bit = "0040151c_30_19", unknown_segment = "0x00401500", unknown_segbit = "28_979" }
{ unknown_bit = "0040151c_31_28", unknown_segment = "0x00401500", unknown_segbit = "28_1020" }

This doesn't surprise me too much. I disabled the compension features because they were initially causing me trouble, see here: https://github.com/SymbiFlow/prjxray/blob/91d91357b5077b12e578ac741322bea71c285b6a/fuzzers/031-cmt-mmcm/generate.py#L128-L131

Now that the basic MMCM features and pips are in, maybe it is time to go back and get the compension features working?

GitHub
Documenting the Xilinx 7-series bit-stream format. - SymbiFlow/prjxray

@mkurc-ant mkurc-ant mentioned this pull request Oct 27, 2020
@mkurc-ant
Copy link
Collaborator Author

@litghost I've checked and currently the MMCM does not work in hardware when using SymbiFlow bitstream. It looks like the two unknown bits I mentioned before are required for it to work. I've tested Vivado and SymbiFlow bitstreams for the same design where the only difference between them was the latter missing these two bits. The Vivado bitstream works while the SymbiFlow doesn't.

@mkurc-ant
Copy link
Collaborator Author

This one solves the two missing bits: f4pga/prjxray#1491

@mkurc-ant mkurc-ant force-pushed the mmcm_support branch 2 times, most recently from f70a992 to f812cdb Compare November 17, 2020 15:26
@mkurc-ant mkurc-ant changed the title [WIP] xc7 MMCM support xc7 MMCM support Nov 17, 2020
TILE MMCME2_ADV
SITE_AS_TILE
SITE_TYPES MMCME2_ADV/MMCME2_ADV
EQUIVALENT_SITES SLICEL
Copy link
Contributor

Choose a reason for hiding this comment

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

This equivalent site is wrong?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed.

@litghost
Copy link
Contributor

@mkurc-ant Can you please rebase this PR?

@probot-autolabeler probot-autolabeler bot added arch-artix7 lang-python Issue uses (or requires) Python language. lang-verilog Issue uses (or requires) Verilog language. lang-xml Issues uses (or requires) XML language. third-party type-docs Issue is related to documentation. type-utils Issues is related to the scripts inside the repo. type-vpr labels Dec 1, 2020
@mkurc-ant
Copy link
Collaborator Author

@litghost Done. I'm now working on adding MMCM support to fasm2bels.

@litghost
Copy link
Contributor

litghost commented Dec 8, 2020

Latest error:

CMake Error at xc/xc7/tests/mmcm/CMakeLists.txt:46 (add_dependencies):
  The dependency target "mmcm_random_case3_vivado_diff_fasm" of target
  "all_xc7_mmcm_vivado_diff_fasm" does not exist.

Signed-off-by: Maciej Kurc <mkurc@antmicro.com>
Signed-off-by: Maciej Kurc <mkurc@antmicro.com>
Signed-off-by: Maciej Kurc <mkurc@antmicro.com>
Signed-off-by: Maciej Kurc <mkurc@antmicro.com>
Signed-off-by: Maciej Kurc <mkurc@antmicro.com>
Signed-off-by: Maciej Kurc <mkurc@antmicro.com>
Signed-off-by: Maciej Kurc <mkurc@antmicro.com>
Signed-off-by: Maciej Kurc <mkurc@antmicro.com>
Signed-off-by: Maciej Kurc <mkurc@antmicro.com>
Signed-off-by: Maciej Kurc <mkurc@antmicro.com>
Signed-off-by: Maciej Kurc <mkurc@antmicro.com>
…DRC issues (?)

Signed-off-by: Maciej Kurc <mkurc@antmicro.com>
Signed-off-by: Maciej Kurc <mkurc@antmicro.com>
Signed-off-by: Maciej Kurc <mkurc@antmicro.com>
…onal divider is used.

Signed-off-by: Maciej Kurc <mkurc@antmicro.com>
Signed-off-by: Maciej Kurc <mkurc@antmicro.com>
Signed-off-by: Maciej Kurc <mkurc@antmicro.com>
Signed-off-by: Maciej Kurc <mkurc@antmicro.com>
Signed-off-by: Maciej Kurc <mkurc@antmicro.com>
Signed-off-by: Maciej Kurc <mkurc@antmicro.com>
Signed-off-by: Maciej Kurc <mkurc@antmicro.com>
…ay-db

Signed-off-by: Maciej Kurc <mkurc@antmicro.com>
…2bels

Signed-off-by: Maciej Kurc <mkurc@antmicro.com>
Signed-off-by: Maciej Kurc <mkurc@antmicro.com>
Signed-off-by: Alessandro Comodi <acomodi@antmicro.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arch-artix7 lang-python Issue uses (or requires) Python language. lang-verilog Issue uses (or requires) Verilog language. lang-xml Issues uses (or requires) XML language. third-party type-docs Issue is related to documentation. type-utils Issues is related to the scripts inside the repo. type-vpr
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants