Advertisement
Guest User

Untitled

a guest
Oct 26th, 2015
576
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
TCL 1.71 KB | None | 0 0
  1. # (c) Xilinx
  2.  
  3. # 1. Check that the Vivado objects are valid. Generate a TCL_ERROR otherwise (revised)
  4.  
  5. proc get_pin_dir { pinName } {
  6.     if {$pinName == {}} {
  7.         error "Error - no pin name provided"
  8.     }
  9.     set pin [get_pins $pinName]
  10.     if {$pin == {}} {
  11.         error "Error - pin $pinName does not exist"
  12.     }
  13.     set direction [get_property DIRECTION $pin]
  14.     return $direction
  15. }
  16.  
  17. # 2. Creating custom design rules checks (DRCs)
  18.  
  19. # This is simplistic check -- report BRAM cells with WRITE_WIDTH_B wider than 36
  20. proc dataWidthCheck {} {
  21.     # list to hold violations
  22.     set vios {}
  23.     # iterate through the objects to be checked
  24.     foreach bram [get_cells -hier -filter {PRIMITIVE_SUBGROUP == bram}] {
  25.         set bwidth [get_property WRITE_WIDTH_B $bram]
  26.         if {$bwidth > 36} {
  27.             #define the message to report when violations are found
  28.             set msg "On cell %ELG, WRITE_WIDTH_B is $bwidth"
  29.             set vio [ create_drc_violation -name {RAMW-1} -msg $msg $bram ]
  30.             lappend vios $vio
  31.             }; #end IF
  32.         }; # end FOR
  33.     if {[llength $vios] > 0} {
  34.         return -code error $vios
  35.     } else {
  36.         return {}
  37.     }; #end IF
  38. }; #end PROC
  39.  
  40.  
  41. # DRC explanation script
  42. proc explain_drc {drcs} {
  43.     package require struct::matrix
  44.     set loop_drcs [get_drc_checks $drcs]
  45.     if {$loop_drcs == {}} {
  46.         puts "Error : $drcs does not match any existing DRC rule"
  47.         return
  48.     }
  49.  
  50.     struct::matrix drcsm
  51.     drcsm add colums 3
  52.     drcsm add row {DRC_ID SEVERITY DESCRIPTION}
  53.     foreach drc $loop_drcs {
  54.         set description "\{[get_property NAME {get_drc_checks $drc]]\}"
  55.         set severity "\{[get_property SEVERITY [get_drc_checks $drc]]\}"
  56.         set key "\{[get_property KEY [get_drc_checks $drc]]\}"
  57.         drcsm add row "$key $severity $description"
  58.     }
  59.     puts "[drcsm format 2chan]";
  60.     drcsm destroy
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement