Advertisement
ramswa02

PrimeTime - Find Registers of ARM Borr GPU Async Bridge

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