From b6ae50b718e3aa77ec00e6e94b9d0c6c54af764f Mon Sep 17 00:00:00 2001 From: John McMaster Date: Fri, 19 Jan 2018 13:53:32 -0800 Subject: [PATCH] roi_harness: preserve contraints between harness and sub-project Signed-off-by: John McMaster --- minitests/roi_harness/README.txt | 4 +-- minitests/roi_harness/runme.sh | 0 minitests/roi_harness/runme.tcl | 47 +++++++++++++++++++++++--------- minitests/roi_harness/top.v | 31 ++++++++++++++++++++- 4 files changed, 66 insertions(+), 16 deletions(-) mode change 100644 => 100755 minitests/roi_harness/runme.sh diff --git a/minitests/roi_harness/README.txt b/minitests/roi_harness/README.txt index e2f90c13..12485912 100644 --- a/minitests/roi_harness/README.txt +++ b/minitests/roi_harness/README.txt @@ -12,8 +12,8 @@ Its expected the end user will rip out everything inside the ROI To target Arty A7 you should source the artix DB environment script then source arty.sh To build the baseline harness: -make +./runme.sh To build a sample design using the harness: -XRAY_ROIV=roi_inv.v make +XRAY_ROIV=roi_inv.v XRAY_FIXED_XDC=out_xc7a35tcpg236-1_BASYS3-SWBUT_roi_basev/fixed.xdc ./runme.sh diff --git a/minitests/roi_harness/runme.sh b/minitests/roi_harness/runme.sh old mode 100644 new mode 100755 diff --git a/minitests/roi_harness/runme.tcl b/minitests/roi_harness/runme.tcl index 58e4d876..43f43748 100644 --- a/minitests/roi_harness/runme.tcl +++ b/minitests/roi_harness/runme.tcl @@ -60,11 +60,20 @@ source ../../utils/utils.tcl create_project -force -part $::env(XRAY_PART) design design read_verilog top.v read_verilog $roiv +set fixed_xdc "" +if { [info exists ::env(XRAY_FIXED_XDC) ] } { + set fixed_xdc "$::env(XRAY_FIXED_XDC)" +} + # added flatten_hierarchy # dout_shr was getting folded into the pblock # synth_design -top top -flatten_hierarchy none -no_lc -keep_equivalent_registers -resource_sharing off synth_design -top top -flatten_hierarchy none -verilog_define DIN_N=$DIN_N -verilog_define DOUT_N=$DOUT_N +if {$fixed_xdc ne ""} { + read_xdc $fixed_xdc +} + # Map of top level net names to IOB pin names array set net2pin [list] @@ -180,19 +189,22 @@ foreach {net pin} [array get net2pin] { set_property -dict "PACKAGE_PIN $pin IOSTANDARD LVCMOS33" [get_ports $net] } -create_pblock roi -set_property EXCLUDE_PLACEMENT 1 [get_pblocks roi] -add_cells_to_pblock [get_pblocks roi] [get_cells roi] -resize_pblock [get_pblocks roi] -add "$::env(XRAY_ROI)" +if {$fixed_xdc eq ""} { + create_pblock roi + set_property EXCLUDE_PLACEMENT 1 [get_pblocks roi] + set_property CONTAIN_ROUTING true [get_pblocks roi] + set_property DONT_TOUCH true [get_cells roi] + add_cells_to_pblock [get_pblocks roi] [get_cells roi] + resize_pblock [get_pblocks roi] -add "$::env(XRAY_ROI)" -set_property CFGBVS VCCO [current_design] -set_property CONFIG_VOLTAGE 3.3 [current_design] -set_property BITSTREAM.GENERAL.PERFRAMECRC YES [current_design] + set_property CFGBVS VCCO [current_design] + set_property CONFIG_VOLTAGE 3.3 [current_design] + set_property BITSTREAM.GENERAL.PERFRAMECRC YES [current_design] -set_property CLOCK_DEDICATED_ROUTE FALSE [get_nets clk_IBUF] - -#write_checkpoint -force synth.dcp + set_property CLOCK_DEDICATED_ROUTE FALSE [get_nets clk_IBUF] + #write_checkpoint -force $outdir/synth.dcp +} proc loc_roi_clk_left {ff_x ff_y} { @@ -257,7 +269,7 @@ proc net_bank_left {net} { } # Manual placement -if {1} { +if {$fixed_xdc eq ""} { set x $X_BASE # Place ROI clock right after inputs @@ -286,7 +298,7 @@ if {1} { } place_design -#write_checkpoint -force placed.dcp +#write_checkpoint -force $outdir/placed.dcp # Version with more error checking for missing end node # Will do best effort in this case @@ -341,7 +353,7 @@ proc route_via2 {net nodes} { set fp [open "design.txt" w] puts $fp "name node pin" # Manual routing -if {1} { +if {$fixed_xdc eq ""} { set x $X_BASE # No routing strictly needed for clk @@ -406,6 +418,15 @@ close $fp puts "routing design" route_design +# Don't set for user designs +# Makes things easier to debug +if {$fixed_xdc eq ""} { + set_property IS_ROUTE_FIXED 1 [get_nets -hierarchical] + #set_property IS_LOC_FIXED 1 [get_cells -hierarchical] + #set_property IS_BEL_FIXED 1 [get_cells -hierarchical] + write_xdc -force $outdir/fixed.xdc +} + write_checkpoint -force $outdir/design.dcp set_property BITSTREAM.GENERAL.DEBUGBITSTREAM YES [current_design] write_bitstream -force $outdir/design.bit diff --git a/minitests/roi_harness/top.v b/minitests/roi_harness/top.v index 997231a9..91587565 100644 --- a/minitests/roi_harness/top.v +++ b/minitests/roi_harness/top.v @@ -3,10 +3,39 @@ `include "defines.v" module top(input wire clk, - input [DIN_N-1:0] din, output [DOUT_N-1:0] dout); + inout wire [DIN_N-1:0] din, inout wire [DOUT_N-1:0] dout); parameter DIN_N = `DIN_N; parameter DOUT_N = `DOUT_N; + /* + //Added explicit I/O as clocking was doing something weird + (* KEEP, DONT_TOUCH *) + wire clk_net; + (* KEEP, DONT_TOUCH *) + wire [DIN_N-1:0] din_net; + (* KEEP, DONT_TOUCH *) + wire [DOUT_N-1:0] dout_net; + genvar i; + generate + //CLK + (* KEEP, DONT_TOUCH *) + BUFG bufg(.I(clk), .O(clk_net)); + + //DIN + for (i = 0; i < DIN_N; i = i+1) begin:ins + IOBUF bufio(.O(din_net[i]), .IO(din[i]), .I(1'bx), .T(1'b0)); + end + + //DOUT + for (i = 0; i < DOUT_N; i = i+1) begin:outs + IOBUF bufio(.O(), .IO(dout[i]), .I(dout_net[i]), .T(1'b1)); + end + endgenerate + + roi #(.DIN_N(DIN_N), .DOUT_N(DOUT_N)) roi ( + .clk(clk_net), + .din(din_net), .dout(dout_net)); + */ roi #(.DIN_N(DIN_N), .DOUT_N(DOUT_N)) roi ( .clk(clk), .din(din), .dout(dout));