mirror of https://github.com/openXC7/prjxray.git
Add randplace_pblock TCL function
Signed-off-by: Clifford Wolf <clifford@clifford.at> Signed-off-by: Tim 'mithro' Ansell <mithro@mithis.com>
This commit is contained in:
parent
cbad47ffad
commit
919888dc9e
|
|
@ -19,6 +19,9 @@ set_property BITSTREAM.GENERAL.PERFRAMECRC YES [current_design]
|
|||
|
||||
set_property CLOCK_DEDICATED_ROUTE FALSE [get_nets clk_IBUF]
|
||||
|
||||
source ../../../utils/utils.tcl
|
||||
randplace_pblock 100 roi
|
||||
|
||||
place_design
|
||||
route_design
|
||||
|
||||
|
|
|
|||
|
|
@ -24,6 +24,25 @@ proc route_via {net nodes} {
|
|||
puts ""
|
||||
}
|
||||
|
||||
proc randsample_list {num lst} {
|
||||
set rlst {}
|
||||
for {set i 0} {$i<$num} {incr i} {
|
||||
set j [expr {int(rand()*[llength $lst])}]
|
||||
lappend rlst [lindex $lst $j]
|
||||
set lst [lreplace $lst $j $j]
|
||||
}
|
||||
return $rlst
|
||||
}
|
||||
|
||||
proc randplace_pblock {num pblock} {
|
||||
set sites [randsample_list $num [get_sites -filter {SITE_TYPE == SLICEL || SITE_TYPE == SLICEM} -of_objects [get_pblocks $pblock]]]
|
||||
set cells [randsample_list $num [get_cells -hierarchical -filter "PBLOCK == [get_pblocks $pblock] && REF_NAME == LUT6"]]
|
||||
for {set i 0} {$i<$num} {incr i} {
|
||||
set site [lindex $sites $i]
|
||||
set cell [lindex $cells $i]
|
||||
}
|
||||
}
|
||||
|
||||
proc putl {lst} {
|
||||
foreach line $lst {puts $line}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue