Skip to content

XDC placement constraints support for interchange #2021

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

Open
wants to merge 38 commits into
base: master
Choose a base branch
from

Conversation

kboronski-ant
Copy link

@kboronski-ant kboronski-ant commented May 5, 2022

Description

DEPENDS ON #1999 (I will rebase this branch to exclude commits from #1999 once it gets merged).

Parse XDC placement constraints using TCL interpreter.

  • libtclcpp - C++ wrapper liblrary for TCL C API.
  • xdc_constraints.h/cpp - create VprConstraints and modify netlist from a TCL script using XDC commands.

Supported commands:

  • get_ports
    • by single name
    • by multiple names (multiarg call)
  • set_property
    • PACKAGE_PIN (for single port)
    • IOSTANDARD (for any number of ports)

To read XDC files:

 --xdc_files <filename> ...

See antmicro#15 for another discussion about those changes.

About libtclcpp:

This is mostly header-based library for exposing C++ interfaces in TCL.
Currently it allows "exporting methods from TclClient-derived classes as callable Tcl commands. A class needs to be added to an active TclContext (which represents the currently active interpreter) through TclCtx::add_client to register its methods. It also introduces a mechanism for wrapping C++ types in a generic way and imposing some compile-time type-safety when managing objects those types. Additionally it offers a C++ wrapper for typed and untyped Tcl lists (of course Tcl is a dynamically typed language, so typing restrictions apply only in C++ and are enforced through language constructs and extra runtime checks).

Caveats

Severe incompatibility with libsdcparse.
Using timing constraints commands would require porting the interface for SDC commands from libsdcparse to libtclcpp. To handle more complex commands with optional arguments a Tcl argument parser would be useful. That's why at this moment only placement constraints are handled in this PR and SDC commands are not supported.

Another thing is that it works only for the interchange format at the moment. phys_grid_mapping field that was added to t_arch needs to be populated when loading an architecture definition and so far I've implemented it only for interchange. This field contains mappings from physical pins to grid locations so it shouldn't be hard to get that information when loading a VPR (XML) architecture definition.

Related Issue

#932

Motivation and Context

The current constrain system doesn't allow constraining IOs without knowing exactly what blocks are the going to be. It is also specific to VPR, while XDC seems to be a much more universal format.

How Has This Been Tested?

Manually constraining testarch IOs for LUT design from fpga-interchange-tests and checking results in GUI.

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

mtdudek and others added 30 commits May 2, 2022 09:29
Signed-off-by: Maciej Dudek <[email protected]>
Code refactor

Signed-off-by: Maciej Dudek <[email protected]>
Small improvements to RR graph generation

Signed-off-by: Maciej Dudek <[email protected]>
Signed-off-by: Maciej Dudek <[email protected]>
…on step

Combine node forest to single tree

Signed-off-by: Maciej Dudek <[email protected]>
Update to new mainline

Signed-off-by: Maciej Dudek <[email protected]>
Signed-off-by: Maciej Dudek <[email protected]>
…208f3

54f6208f3 Merge pull request SymbiFlow#69 from antmicro/mdudel/fix_annotations
d8a0567a5 Fix annotations in DeviceResources

git-subtree-dir: libs/EXTERNAL/libinterchange
git-subtree-split: 54f6208f32e20b746863da6ea54e3051fc9a830e
Signed-off-by: Maciej Dudek <[email protected]>
Also fixes RR Graph generation with alternative site types

Signed-off-by: Maciej Dudek <[email protected]>
Signed-off-by: Alessandro Comodi <[email protected]>
…ations and bind them to selected ports

Signed-off-by: Krzysztof Boronski <[email protected]>
…from XDC command implementation

Signed-off-by: Krzysztof Boronski <[email protected]>
Signed-off-by: Krzysztof Boronski <[email protected]>
Signed-off-by: Krzysztof Boronski <[email protected]>
Signed-off-by: Krzysztof Boronski <[email protected]>
…perty: handle lists of ports.

Signed-off-by: Krzysztof Boronski <[email protected]>
Signed-off-by: Krzysztof Boronski <[email protected]>
Signed-off-by: Krzysztof Boronski <[email protected]>
Signed-off-by: Krzysztof Boronski <[email protected]>
Signed-off-by: Krzysztof Boronski <[email protected]>
Signed-off-by: Krzysztof Boronski <[email protected]>
@github-actions github-actions bot added build Build system external_libs infra Project Infrastructure lang-make CMake/Make code lang-shell Shell scripts (bash etc.) libarchfpga Library for handling FPGA Architecture descriptions libvtrutil scripts Utility & Infrastructure scripts VPR VPR FPGA Placement & Routing Tool labels May 5, 2022
@kboronski-ant kboronski-ant changed the title XDC placement constraints support XDC placement constraints support for interchange May 5, 2022
@kboronski-ant kboronski-ant marked this pull request as draft May 5, 2022 11:53
@kboronski-ant kboronski-ant marked this pull request as ready for review May 5, 2022 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Build system external_libs infra Project Infrastructure lang-make CMake/Make code lang-shell Shell scripts (bash etc.) libarchfpga Library for handling FPGA Architecture descriptions libvtrutil scripts Utility & Infrastructure scripts VPR VPR FPGA Placement & Routing Tool
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants