roi_harness: preserve contraints between harness and sub-project

Signed-off-by: John McMaster <johndmcmaster@gmail.com>
This commit is contained in:
John McMaster 2018-01-19 13:53:32 -08:00
parent c38907cd73
commit b6ae50b718
4 changed files with 66 additions and 16 deletions

View File

@ -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

0
minitests/roi_harness/runme.sh Normal file → Executable file
View File

View File

@ -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

View File

@ -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));