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

Added unmanaged impl constraint option #153

Merged

Conversation

acw1251
Copy link
Contributor

@acw1251 acw1251 commented Aug 14, 2018

This adds support for adding unmanaged implementation constraint files in Vivado with the flag --unmanaged-implconstraints.

An unmanaged constraint file is an XDC file that is imported as a plain TCL file, and vivado will not try to add or remove constraints from the file. This allows for more of the TCL language to be included in the file such as foreach and if. As a side effect of this, some critical warnings in managed constraint files get promotes to errors in unmanaged constraint files, resulting in some builds failing if all constraint files are blindly set to unmanaged.

Unmanaged constraint files are read using the -unmanaged flag of the read_xdc command.

@acw1251
Copy link
Contributor Author

acw1251 commented Aug 14, 2018

related pull request in fpgamake: cambridgehackers/fpgamake#20

@acw1251
Copy link
Contributor Author

acw1251 commented Aug 14, 2018

And for reference, I have an FPGA build for a RISC-V processor that used to fail timing due to false paths, but I got rid of all of the false paths using the following unmanaged constraint file, and now the processor meets timing and works.

puts "Executing the unmanaged constraint file!"

foreach fifo_cell [get_cells -hier -filter {FILE_NAME =~ */FIFO_DUALCLOCK_MACRO.v} *fifo*] {
    set fifo_rst_pin [get_pins -filter {NAME =~ *RST} -of_objects $fifo_cell]
    set driving_clk [all_fanin -flat -startpoints_only $fifo_rst_pin]

    # reset pin of FIFO_DUALCLOCK_MACRO should be asynchronous

    # puts "set_false_path -reset_path -to $fifo_rst_pin"
    # set_false_path -reset_path -to $fifo_rst_pin

    puts "set_false_path -reset_path -from $driving_clk -to $fifo_rst_pin"
    set_false_path -reset_path -from $driving_clk -to $fifo_rst_pin
}

foreach reset_meta_reg [get_cells -hier -filter {FILE_NAME =~ */PositiveReset.v || FILE_NAME =~ */SyncReset.v} reset_meta_reg] {
    set reset_meta_pins [get_pins -filter {NAME =~ */D || NAME =~ */S} -of_objects $reset_meta_reg]
    set driving_clk [all_fanin -flat -startpoints_only $reset_meta_pins]

    foreach s $driving_clk {
        foreach d $reset_meta_pins {
            puts "set_false_path -reset_path -from $s -to $d"
            set_false_path -reset_path -from $s -to $d
        }
    }
}

Copy link
Member

@jameyhicks jameyhicks left a comment

Choose a reason for hiding this comment

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

Looks good. Thank you for remembering to update the documentation!

@jameyhicks jameyhicks merged commit 63edd44 into cambridgehackers:master Aug 14, 2018
@acw1251 acw1251 deleted the unmanaged-impl-constraint branch August 14, 2018 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants