From b6ae50b718e3aa77ec00e6e94b9d0c6c54af764f Mon Sep 17 00:00:00 2001 From: John McMaster Date: Fri, 19 Jan 2018 13:53:32 -0800 Subject: [PATCH 1/3] 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)); From 5b0a1f7cb519dd57f0ed88f3033500460839ee07 Mon Sep 17 00:00:00 2001 From: John McMaster Date: Fri, 19 Jan 2018 14:02:51 -0800 Subject: [PATCH 2/3] roi_harness: example clk hack Signed-off-by: John McMaster --- minitests/roi_harness/README.txt | 6 +++--- minitests/roi_harness/runme.sh | 7 +++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/minitests/roi_harness/README.txt b/minitests/roi_harness/README.txt index 12485912..2f24f2da 100644 --- a/minitests/roi_harness/README.txt +++ b/minitests/roi_harness/README.txt @@ -14,6 +14,6 @@ To target Arty A7 you should source the artix DB environment script then source To build the baseline harness: ./runme.sh -To build a sample design using the harness: -XRAY_ROIV=roi_inv.v XRAY_FIXED_XDC=out_xc7a35tcpg236-1_BASYS3-SWBUT_roi_basev/fixed.xdc ./runme.sh - +To build a sample Vivado design using the harness: +XRAY_ROIV=roi_inv.v XRAY_FIXED_XDC=out_xc7a35tcpg236-1_BASYS3-SWBUT_roi_basev/fixed_noclk.xdc ./runme.sh +Note: this was intended for verification only and not as an end user flow (they should use SymbiFlow) diff --git a/minitests/roi_harness/runme.sh b/minitests/roi_harness/runme.sh index a15ab84e..4fa2c200 100755 --- a/minitests/roi_harness/runme.sh +++ b/minitests/roi_harness/runme.sh @@ -10,4 +10,11 @@ ${XRAY_BITREAD} -F $XRAY_ROI_FRAMES -o design.bits -z -y design.bit ${XRAY_SEGPRINT} -zd design.bits >design.segp ${XRAY_DIR}/tools/segprint2fasm.py design.segp design.fasm ${XRAY_DIR}/tools/fasm2frame.py design.fasm design.frm +# Hack to get around weird clock error related to clk net not found +# Remove following lines: +#set_property CLOCK_DEDICATED_ROUTE FALSE [get_nets clk_IBUF] +#set_property FIXED_ROUTE { { CLK_BUFG_BUFGCTRL0_O CLK_BUFG_CK_GCLK0 ... CLK_L1 CLBLM_M_CLK } } [get_nets clk_net] +if [ -f fixed.xdc ] ; then + cat fixed.xdc |fgrep -v 'CLOCK_DEDICATED_ROUTE FALSE' |fgrep -v 'set_property FIXED_ROUTE { { CLK_BUFG_BUFGCTRL0_O' >fixed_noclk.xdc +fi popd From 2015f4cb62981409039932ede2b0a6b7905f035d Mon Sep 17 00:00:00 2001 From: John McMaster Date: Fri, 19 Jan 2018 14:09:24 -0800 Subject: [PATCH 3/3] roi_harness: remove top.v test Signed-off-by: John McMaster --- minitests/roi_harness/top.v | 31 +------------------------------ 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/minitests/roi_harness/top.v b/minitests/roi_harness/top.v index 91587565..2e8852ad 100644 --- a/minitests/roi_harness/top.v +++ b/minitests/roi_harness/top.v @@ -3,39 +3,10 @@ `include "defines.v" module top(input wire clk, - inout wire [DIN_N-1:0] din, inout wire [DOUT_N-1:0] dout); + inout wire [DIN_N-1:0] din, output 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));