Advertisement
ramswa02

PrimeTime - Find Registers of ARM Mimir GPU Async Bridge

Oct 13th, 2015
258
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
TCL 3.31 KB | None | 0 0
  1. proc rbx_find_gpu_async_registers { } {
  2.  
  3.  
  4.   set slave_channels        "\
  5.                 u_asn_r_slave
  6.                 u_jcb_rq_slave
  7.                 u_asn_b_slave
  8.                 u_jcb_rsp_slave
  9.                 u_asn_ar_slave
  10.                 u_asn_w_slave
  11.                 "
  12.  
  13.   puts              "\n\n###################################"
  14.   puts              "### DIRECTION = Master to Slave ###"
  15.   puts              "###################################"
  16.  
  17.   foreach chnl $slave_channels {
  18.  
  19.     # RESET ALL DATA
  20.     set all_sync_regs       ""
  21.     set current_sync_regs   ""
  22.     set current_dest_regs   ""
  23.  
  24.     # FIND POINTER REGISTERS
  25.     set all_sync_regs       [get_object_name [get_cells -hier *synchronizer_sync0*]]
  26.     set current_sync_regs   [rm_lregexp $chnl $all_sync_regs]
  27.     set current_dest_regs   [get_object_name  [all_fanout -from [get_pins -quiet *$chnl/m_data] -endpoints_only]]
  28.     set Y           [llength $current_sync_regs]
  29.     set W           [llength $current_dest_regs]
  30.     puts            "\n\n### Channel = $chnl ###"
  31.     # puts          "Y = $Y" ; # Do not used this value. Get this value from datasheet
  32.     # puts          "W = $W" ; # Do not used this value. Get this value from datasheet
  33.     # puts          "N = [expr round(pow(2,$Y))]" ; # Do not used this value. Get this value from datasheet
  34.     puts            "\$destination_ptr_regs_inpin_list ="
  35.     foreach sr $current_sync_regs {
  36.       puts          "             $sr/D"
  37.     }
  38.  
  39.  
  40.     # FIND POINTER REGISTERS
  41.     puts            "\$destination_pld_regs_inpin_list ="
  42.     foreach i $current_dest_regs {
  43.       if {[get_attribute [get_cells -of_objects [get_pins $i]] is_sequential]} {
  44.         puts            "             $i"
  45.       }
  46.     }
  47.  
  48.   }
  49.  
  50.  
  51.  
  52.   set master_channels       "
  53.                 u_asn_r_master
  54.                 u_jcb_rq_master
  55.                 u_asn_b_master
  56.                 u_jcb_rsp_master
  57.                 u_asn_ar_master
  58.                 u_asn_w_master
  59.                 "
  60.  
  61.   puts              "\n\n###################################"
  62.   puts              "### DIRECTION = Slave to Master ###"
  63.   puts              "###################################"
  64.  
  65.   foreach chnl $master_channels {
  66.  
  67.     # RESET ALL DATA
  68.     set all_sync_regs       ""
  69.     set current_sync_regs   ""
  70.     set current_dest_regs   ""
  71.  
  72.     # FIND POINTER REGISTERS
  73.     set all_sync_regs       [get_object_name [get_cells -hier *synchronizer_sync0*]]
  74.     set current_sync_regs   [rm_lregexp $chnl $all_sync_regs]
  75.     set current_dest_regs   [get_object_name  [all_fanout -from [get_pins -quiet *$chnl/s_credit] -endpoints_only]]
  76.     set Y           [llength $current_sync_regs]
  77.     set W           [llength $current_dest_regs]
  78.     puts            "\n\n### Channel = $chnl ###"
  79.     # puts          "Y = $Y" ; # Do not used this value. Get this value from datasheet
  80.     # puts          "W = $W" ; # Do not used this value. Get this value from datasheet
  81.     # puts          "N = [expr round(pow(2,$Y))]" ; # Do not used this value. Get this value from datasheet
  82.     puts            "\$destination_ptr_regs_inpin_list ="
  83.     foreach sr $current_sync_regs {
  84.       puts          "             $sr/D"
  85.     }
  86.  
  87.  
  88.     # FIND POINTER REGISTERS
  89.     puts            "\$destination_pld_regs_inpin_list ="
  90.     foreach i $current_dest_regs {
  91.       if {[get_attribute [get_cells -of_objects [get_pins $i]] is_sequential]} {
  92.         puts            "             $i"
  93.       }
  94.     }
  95.  
  96.   }
  97.  
  98. }
  99.  
  100. proc rm_lregexp { string_to_match lookup_list } {
  101.  
  102.   set matched_list  ""
  103.  
  104.   foreach element $lookup_list {
  105.     if {[regexp ".*${string_to_match}.*" $element]} {
  106.       lappend matched_list $element
  107.     }
  108.   }
  109.  
  110.   return $matched_list
  111. }
  112.  
  113. # EOF
  114.  
  115.  
  116. rbx_find_gpu_async_registers
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement