[388] | 1 | # coding: utf-8
|
---|
| 2 | #
|
---|
| 3 | # TECS Generator
|
---|
| 4 | # Generator for TOPPERS Embedded Component System
|
---|
| 5 | #
|
---|
| 6 | # Copyright (C) 2014-2018 by TOPPERS Project
|
---|
| 7 | #--
|
---|
| 8 | # ä¸è¨èä½æ¨©è
|
---|
| 9 | ã¯ï¼ä»¥ä¸ã®(1)ï½(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
|
---|
| 10 | # ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ã使ç¨ã»è¤è£½ã»æ¹
|
---|
| 11 | # å¤ã»åé
|
---|
| 12 | å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
|
---|
| 13 | # (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
|
---|
| 14 | # 権表示ï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
|
---|
| 15 | # ã¹ã³ã¼ãä¸ã«å«ã¾ãã¦ãããã¨ï¼
|
---|
| 16 | # (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
|
---|
| 17 | # ç¨ã§ããå½¢ã§åé
|
---|
| 18 | å¸ããå ´åã«ã¯ï¼åé
|
---|
| 19 | å¸ã«ä¼´ãããã¥ã¡ã³ãï¼å©ç¨
|
---|
| 20 | # è
|
---|
| 21 | ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
|
---|
| 22 | # ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
|
---|
| 23 | # (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
|
---|
| 24 | # ç¨ã§ããªãå½¢ã§åé
|
---|
| 25 | å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
|
---|
| 26 | # ã¨ï¼
|
---|
| 27 | # (a) åé
|
---|
| 28 | å¸ã«ä¼´ãããã¥ã¡ã³ãï¼å©ç¨è
|
---|
| 29 | ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
|
---|
| 30 | # ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
|
---|
| 31 | # (b) åé
|
---|
| 32 | å¸ã®å½¢æ
|
---|
| 33 | ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSããã¸ã§ã¯ãã«
|
---|
| 34 | # å ±åãããã¨ï¼
|
---|
| 35 | # (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
|
---|
| 36 | # 害ãããï¼ä¸è¨èä½æ¨©è
|
---|
| 37 | ããã³TOPPERSããã¸ã§ã¯ããå
|
---|
| 38 | 責ãããã¨ï¼
|
---|
| 39 | # ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
|
---|
| 40 | # ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
|
---|
| 41 | ããã³TOPPERSããã¸ã§ã¯ãã
|
---|
| 42 | # å
|
---|
| 43 | 責ãããã¨ï¼
|
---|
| 44 | #
|
---|
| 45 | # æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
|
---|
| 46 | ã
|
---|
| 47 | # ãã³TOPPERSããã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
|
---|
| 48 | # ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
|
---|
| 49 | # ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ害ã«é¢ãã¦ãï¼ã
|
---|
| 50 | # ã®è²¬ä»»ãè² ããªãï¼
|
---|
| 51 | #
|
---|
| 52 | # $Id$
|
---|
| 53 | #++
|
---|
| 54 |
|
---|
| 55 |
|
---|
| 56 | require_tecsgen_lib "HRPKernelObjectManager.rb"
|
---|
| 57 | #
|
---|
| 58 | # åã¡ã½ããã®å½¹å²ãã¯ãDomainPlugin.rb ãåç
|
---|
| 59 | §ã®ãã¨
|
---|
| 60 | # HRPã«ã¼ãã«ç¨ãã¡ã¤ã³ãã©ã°ã¤ã³
|
---|
| 61 | class HRPPlugin < DomainPlugin
|
---|
| 62 |
|
---|
| 63 | def initialize( region, name, option )
|
---|
| 64 | super
|
---|
| 65 | dbgPrint "HRPPlugin: initialize: region=#{region.get_name}, domainName=#{name}, option=#{option}\n"
|
---|
| 66 | @region = region
|
---|
| 67 | @name = name
|
---|
| 68 | case option
|
---|
| 69 | when "kernel", "user", "OutOfDomain"
|
---|
| 70 | # OK
|
---|
| 71 | @option = option
|
---|
| 72 | else
|
---|
| 73 | cdl_error( "HRPPlugin: '$1' is unacceptable domain kind, specify 'kernel' or 'user'", option )
|
---|
| 74 | @option = "kernel" # ã¨ãããã kernel ãè¨å®ãã¦ãã
|
---|
| 75 | end
|
---|
| 76 | end
|
---|
| 77 |
|
---|
| 78 | def add_through_plugin( join, current_region, next_region, through_type )
|
---|
| 79 | # join.get_owner:Cell 左辺ã®ã»ã«
|
---|
| 80 | # join.get_definition:Port å¼ã³å£
|
---|
| 81 | # join.get_subscript:Integer or nil å¼ã³å£é
|
---|
| 82 | åã®æ·»æ° (Join::@subscript ã®èª¬æåç
|
---|
| 83 | §)
|
---|
| 84 | # join.get_cell:Cell å³è¾ºã®ã»ã«
|
---|
| 85 | # join.get_port_name:Symbol åãå£
|
---|
| 86 | # get_rhs_subscript:Integer or nil åãå£é
|
---|
| 87 | åã®æ·»æ° (Join::@rhs_subscript ã®èª¬æåç
|
---|
| 88 | §)
|
---|
| 89 | # return []
|
---|
| 90 | dbgPrint "MyDomainPlugin: add_through_plugin: #{current_region.get_name}=>#{next_region.get_name}, #{join.get_owner.get_name}.#{join.get_definition.get_name}=>#{join.get_cell.get_name}.#{join.get_port_name}, #{through_type}\n"
|
---|
| 91 |
|
---|
| 92 | #puts "=====Join Check Start====="
|
---|
| 93 | #puts "caller: #{join.get_owner.get_name.to_s}, callee: #{join.get_cell.get_name.to_s}"
|
---|
| 94 | #puts "=====Join Check param====="
|
---|
| 95 | current_domain = current_region.get_domain_root.get_domain_type
|
---|
| 96 | next_domain = next_region.get_domain_root.get_domain_type
|
---|
| 97 | #puts current_domain.get_option.to_s
|
---|
| 98 | # if !next_domain.nil?
|
---|
| 99 | # puts next_domain.get_option.to_s
|
---|
| 100 | # else
|
---|
| 101 | # puts "next domain is nil!"
|
---|
| 102 | # end
|
---|
| 103 |
|
---|
| 104 | HRPPlugin.add_inter_domain_join_set join
|
---|
| 105 | # p join.get_cell.get_name
|
---|
| 106 | # p join.get_cell.get_real_celltype(join.get_rhs_port1).get_name
|
---|
| 107 | # if HRPKernelObjectManager.include_celltype?(join.get_cell.get_celltype.get_global_name) #oyama: get_name => get_global_name
|
---|
| 108 | if HRPKernelObjectManager.include_celltype?(join.
|
---|
| 109 | get_cell.
|
---|
| 110 | get_real_celltype(join.get_rhs_port1).
|
---|
| 111 | get_global_name) #oyama: get_name => get_global_name
|
---|
| 112 | # çµåå
|
---|
| 113 | ãã«ã¼ãã«ãªãã¸ã§ã¯ãã»ã«
|
---|
| 114 | # @plugin_body = HRP2SVCPlugin.new(cell_name, plugin_arg, next_cell, next_cell_port_name, signature, celltype, caller_cell)
|
---|
| 115 | # ä½ãããªãthrough
|
---|
| 116 | # puts "***** #{join.get_cell.get_celltype.get_name} is kernel object"
|
---|
| 117 | return []
|
---|
| 118 | # return [ :HRP2SVCPlugin, "channelCelltype=tMessagebufferChannel,noClientSemaphore=true" ]
|
---|
| 119 | # elsif @end_region.is_root?
|
---|
| 120 | # elsif next_region.get_option == OutOfDomain
|
---|
| 121 | # elsif next_domain.nil?
|
---|
| 122 | elsif next_domain.get_option.to_s == "OutOfDomain"
|
---|
| 123 | # # çµåå
|
---|
| 124 | ãç¡æå±
|
---|
| 125 | # # ä½ãããªãthrough
|
---|
| 126 | # # @plugin_body = HRP2SVCPlugin.new(cell_name, plugin_arg, next_cell, next_cell_port_name, signature, celltype, caller_cell)
|
---|
| 127 | # puts "***** nil"
|
---|
| 128 | return []
|
---|
| 129 | #elsif @start_region.get_param != :KERNEL_DOMAIN && @end_region.get_param == :KERNEL_DOMAIN
|
---|
| 130 | elsif current_domain.get_option.to_s != "kernel" && next_domain.get_option.to_s == "kernel"
|
---|
| 131 | # ã¦ã¼ã¶ãã¡ã¤ã³ããã«ã¼ãã«ãã¡ã¤ã³ã¸ã®çµå
|
---|
| 132 | # @plugin_body = HRP2SVCPlugin.new(cell_name, plugin_arg, next_cell, next_cell_port_name, signature, celltype, caller_cell)
|
---|
| 133 | # puts "***** svc"
|
---|
| 134 | return [ :HRPSVCPlugin, "" ]
|
---|
| 135 | elsif current_domain != next_domain
|
---|
| 136 | # å¥ã®ã¦ã¼ã¶ãã¡ã¤ã³ã¸ã®çµå
|
---|
| 137 | # @plugin_body = HRP2RPCPlugin.new(cell_name, plugin_arg, next_cell, next_cell_port_name, signature, celltype, caller_cell)
|
---|
| 138 | # puts "***** rpc"
|
---|
| 139 | # return [ :HRPRPCPlugin, "channelCelltype=tMessagebufferChannel,noClientSemaphore=true" ]
|
---|
| 140 | # puts "HRPPlugin:RPC:PPAllocatorSize=256"
|
---|
| 141 | return [ :HRPRPCPlugin, "noClientSemaphore=false,PPAllocatorSize=256" ]
|
---|
| 142 | else
|
---|
| 143 | # ãã®ä»
|
---|
| 144 | # ä½ãããªãthrough
|
---|
| 145 | # @plugin_body = HRP2SVCPlugin.new(cell_name, plugin_arg, next_cell, next_cell_port_name, signature, celltype, caller_cell)
|
---|
| 146 | dbgPrint "warning: at HRP Join Check"
|
---|
| 147 | return nil
|
---|
| 148 | end
|
---|
| 149 |
|
---|
| 150 | # puts "=====Join Check End====="
|
---|
| 151 | end
|
---|
| 152 |
|
---|
| 153 | def joinable?(current_region, next_region, through_type )
|
---|
| 154 | dbgPrint "MyDomainPlugin: joinable? from #{current_region.get_name} to #{next_region.get_name} (#{through_type})\n"
|
---|
| 155 | return true
|
---|
| 156 | end
|
---|
| 157 |
|
---|
| 158 | #== ãã¡ã¤ã³ç¨®å¥ãè¿ã
|
---|
| 159 | #return::Symbol :kernel, :user, :OutOfDomain
|
---|
| 160 | def get_kind
|
---|
| 161 | return @option.to_sym
|
---|
| 162 | end
|
---|
| 163 |
|
---|
| 164 | def self.gen_post_code file
|
---|
| 165 | end
|
---|
| 166 |
|
---|
| 167 | # ATT_MODãçææ¸ã¿ãã©ãã # 2017.8.27
|
---|
| 168 | @@generate_memory_module = false
|
---|
| 169 |
|
---|
| 170 | @@include_extsvc_fncd = false # 17.07.26 æ«å®
|
---|
| 171 | #
|
---|
| 172 | # ATT_MODã®çæ
|
---|
| 173 | # gen_factoryå®è¡æã«ã¯ï¼ãã¹ã¦ã®ã»ã«ã¿ã¤ããã©ã°ã¤ã³ãçææ¸ã¿ã®ã¯ããªã®ã§ï¼
|
---|
| 174 | # ã«ã¼ãã«APIã³ã¼ãã®ã¡ã¢ãªä¿è·ãçç¥ã§ããï¼
|
---|
| 175 | #
|
---|
| 176 | def gen_factory
|
---|
| 177 | super
|
---|
| 178 |
|
---|
| 179 | if @@include_extsvc_fncd == false
|
---|
| 180 | file = AppFile.open( "#{$gen}/tecsgen.cfg" )
|
---|
| 181 | file.print "/* HRPPlugin 001 */\n"
|
---|
| 182 | file.print "#include \"extsvc_fncode.h\"\n" ## 2017.7.26
|
---|
| 183 | file.close
|
---|
| 184 | @@include_extsvc_fncd = true
|
---|
| 185 | end
|
---|
| 186 |
|
---|
| 187 | if @@generate_memory_module == false
|
---|
| 188 |
|
---|
| 189 | # INCLUDE ãåºå
|
---|
| 190 | # ãã¹ã¦ã®ãã¡ã¤ã³ã«å¯¾ãã cfg ãå
|
---|
| 191 | ã«çæãã¦ãã
|
---|
| 192 | # ããããã¡ã¤ã³ã«å±ããã«ã¼ãã«ãªãã¸ã§ã¯ãããã¢ã¸ã¥ã¼ã«ããªãå ´åã§ããcfg ãåºåããã
|
---|
| 193 | regions = DomainType.get_domain_regions[ :HRP ]
|
---|
| 194 | file = AppFile.open( "#{$gen}/tecsgen.cfg" )
|
---|
| 195 | file.print "/* HRPPlugin 002 */\n"
|
---|
| 196 | regions.each{ |region|
|
---|
| 197 | if ! region.is_root? then
|
---|
| 198 | nsp = "#{region.get_global_name}"
|
---|
| 199 | file2 = AppFile.open( "#{$gen}/tecsgen_#{nsp}.cfg" )
|
---|
| 200 | file2.close
|
---|
| 201 | case region.get_domain_type.get_kind
|
---|
| 202 | when :kernel
|
---|
| 203 | pre = "KERNEL_DOMAIN{\n "
|
---|
| 204 | post = "}\n"
|
---|
| 205 | when :user
|
---|
| 206 | pre = "DOMAIN(#{region.get_name}){\n "
|
---|
| 207 | post = "}\n"
|
---|
| 208 | when :OutOfDomain
|
---|
| 209 | pre = ""
|
---|
| 210 | post = "\n"
|
---|
| 211 | end
|
---|
| 212 | file.puts "#{pre}INCLUDE(\"#{$gen}/tecsgen_#{nsp}.cfg\");\n#{post}"
|
---|
| 213 | end
|
---|
| 214 | }
|
---|
| 215 | file.print "/* HRPPlugin 002 end */\n\n"
|
---|
| 216 | file.close
|
---|
| 217 |
|
---|
| 218 | check_celltype_list = []
|
---|
| 219 |
|
---|
| 220 | #
|
---|
| 221 | # ATT_MODã®çæ
|
---|
| 222 | #
|
---|
| 223 | Cell.get_cell_list2.each { |cell|
|
---|
| 224 | # ãã¹ã¦ã®ã»ã«ãèµ°æ»ãã¦ã»ã«ã¿ã¤ãããã§ãã¯
|
---|
| 225 | ct = cell.get_celltype
|
---|
| 226 | if ct.class == Celltype && check_celltype_list.include?( ct ) == false
|
---|
| 227 | # ãã§ãã¯æ¸ã¿ã»ã«ã¿ã¤ãã«ç»é²
|
---|
| 228 | check_celltype_list << ct
|
---|
| 229 |
|
---|
| 230 | # æªãã§ãã¯ã®ã»ã«ã¿ã¤ãã ã£ãå ´å
|
---|
| 231 | # puts "check for ATT_MOD : #{ct.classget_global_name}"
|
---|
| 232 | # puts "check for ATT_MOD : #{ct.get_global_name}"
|
---|
| 233 |
|
---|
| 234 | # ã«ã¼ãã«APIã®ã³ã¼ãï¼ãã¼ã¿ã¯ã¡ã¢ãªä¿è·ããªã # HRP3 oyama delete by Takada's request
|
---|
| 235 | # next if HRPKernelObjectManager.include_celltype?( ct.get_name )
|
---|
| 236 |
|
---|
| 237 | # å¿
|
---|
| 238 | è¦ã®ãªãã»ã«ã¿ã¤ãã®ã³ã¼ãï¼ãã¼ã¿ã¯ã¡ã¢ãªä¿è·ããªã
|
---|
| 239 | next if ! ct.need_generate?
|
---|
| 240 |
|
---|
| 241 | # HRPã®ãã¡ã¤ã³ãªã¼ã¸ã§ã³ãåå¾
|
---|
| 242 | regions = ct.get_domain_roots
|
---|
| 243 | regions_hrp = regions[ :HRP ]
|
---|
| 244 | dbgPrint "HRP domain in #{ct.get_name}: "
|
---|
| 245 | regions_hrp.each { |reg|
|
---|
| 246 | dbgPrint reg.get_name
|
---|
| 247 | }
|
---|
| 248 | # puts ""
|
---|
| 249 |
|
---|
| 250 | # ã»ã«ç®¡çãããã¯ã¨ã¹ã±ã«ãã³ã®ã¡ã¢ãªä¿è·
|
---|
| 251 | # gen_celltype_names_domain ç¸å½ã®å¦ç
|
---|
| 252 | if regions_hrp.include?( Region.get_root ) == false && regions_hrp.length > 1
|
---|
| 253 | # ãã¡ã¤ã³ãè¤æ°ã§ï¼OutOfDomainã«ã»ã«ãåå¨ããªãã»ã«ã¿ã¤ãã®å ´å
|
---|
| 254 | # å
|
---|
| 255 | ±æã®ã»ã«ç®¡çãããã¯ã¨ã¹ã±ã«ãã³ã³ã¼ããç»é²ãã
|
---|
| 256 | file = AppFile.open( "#{$gen}/tecsgen.cfg" )
|
---|
| 257 | file.printf "%-60s/* HRPPlugin 003 */\n", "ATT_MOD(\"#{ct.get_global_name}_tecsgen.o\");"
|
---|
| 258 | file.close
|
---|
| 259 | end
|
---|
| 260 |
|
---|
| 261 | regions_hrp.each { |reg|
|
---|
| 262 | if reg.is_root?
|
---|
| 263 | nsp = ""
|
---|
| 264 | else
|
---|
| 265 | nsp = "_#{reg.get_global_name}"
|
---|
| 266 | end
|
---|
| 267 | file = AppFile.open( "#{$gen}/tecsgen#{nsp}.cfg" )
|
---|
| 268 | file.printf "%-50s/* HRPPlugin 004 */\n", "ATT_MOD(\"#{ct.get_global_name}#{nsp}_tecsgen.o\");"
|
---|
| 269 | file.close
|
---|
| 270 | }
|
---|
| 271 |
|
---|
| 272 | # ã»ã«ã¿ã¤ãã³ã¼ãããªãå ´åã¯ã¹ããã
|
---|
| 273 | next if ct.is_all_entry_inline? && ! ct.is_active?
|
---|
| 274 |
|
---|
| 275 | # ã»ã«ã¿ã¤ãã³ã¼ãã®ã¡ã¢ãªä¿è·
|
---|
| 276 | # gen_celltype_names_domain2 ç¸å½ã®å¦ç
|
---|
| 277 | if regions_hrp.include?( Region.get_root ) == true || regions_hrp.length > 1
|
---|
| 278 | # OutOfDomainã«ã»ã«ãåå¨ããã»ã«ã¿ã¤ãã®å ´å
|
---|
| 279 | # ã¾ãã¯ï¼è¤æ°ã®ãã¡ã¤ã³ã«ã»ã«ãåå¨ããã»ã«ã¿ã¤ãã®å ´å
|
---|
| 280 | # ã»ã«ã¿ã¤ãã³ã¼ããå
|
---|
| 281 | ±æããããã«ç»é²ãã
|
---|
| 282 | file = AppFile.open( "#{$gen}/tecsgen.cfg" )
|
---|
| 283 | else
|
---|
| 284 | # OutOfDomainã§ãªãåä¸ã®ãã¡ã¤ã³ã«ã»ã«ãåå¨ããã»ã«ã¿ã¤ãã®å ´å
|
---|
| 285 | # ã»ã«ã¿ã¤ãã³ã¼ããå°æããããã«ç»é²ãã
|
---|
| 286 | file = AppFile.open( "#{$gen}/tecsgen_#{regions_hrp[0].get_global_name}.cfg" )
|
---|
| 287 | end
|
---|
| 288 |
|
---|
| 289 | file.printf "%-50s/* HRPPlugin 005 */\n", "ATT_MOD(\"#{ct.get_global_name}.o\");"
|
---|
| 290 | file.close
|
---|
| 291 | else
|
---|
| 292 | # ä½ãããªã
|
---|
| 293 | end
|
---|
| 294 | }
|
---|
| 295 |
|
---|
| 296 | @@generate_memory_module = true
|
---|
| 297 | else
|
---|
| 298 | # ä½ãããªã
|
---|
| 299 | end
|
---|
| 300 | end
|
---|
| 301 |
|
---|
| 302 | #----- Inter Domain Join Set -----#
|
---|
| 303 | @@inter_domain_join_set = {} #{entry_cell =>{domain_root=>count} } Hash of inter domain join
|
---|
| 304 | def self.add_inter_domain_join_set join
|
---|
| 305 | rhs_cell = join.get_cell
|
---|
| 306 | dbgPrint "--------- add_inter_domain:#{join.get_owner.get_namespace_path} => #{join.get_cell.get_namespace_path}-----\n"
|
---|
| 307 | domain_root = join.get_owner.get_region.get_domain_root # lhs cell's domain root
|
---|
| 308 | if @@inter_domain_join_set[ rhs_cell ] == nil then
|
---|
| 309 | @@inter_domain_join_set[ rhs_cell ] = []
|
---|
| 310 | end
|
---|
| 311 | # 左辺ã®ãã¡ã¤ã³ã«ã¼ããè¨é²
|
---|
| 312 | @@inter_domain_join_set[ rhs_cell ] << join
|
---|
| 313 | end
|
---|
| 314 | def self.get_inter_domain_join_set rhs_cell
|
---|
| 315 | if @@inter_domain_join_set[ rhs_cell ] then
|
---|
| 316 | @@inter_domain_join_set[ rhs_cell ].uniq!
|
---|
| 317 | else
|
---|
| 318 | @@inter_domain_join_set[ rhs_cell ] = []
|
---|
| 319 | end
|
---|
| 320 | return @@inter_domain_join_set[ rhs_cell ]
|
---|
| 321 | end
|
---|
| 322 | def self.get_inter_domain_join_roots rhs_cell
|
---|
| 323 | dbgPrint "--------- get_inter_domain #{rhs_cell.get_namespace_path} -----\n"
|
---|
| 324 | domain_roots = []
|
---|
| 325 | set = get_inter_domain_join_set rhs_cell
|
---|
| 326 | set.each{ |join|
|
---|
| 327 | dbgPrint "--------- get_inter_domain:#{join.get_owner.get_namespace_path} => #{join.get_cell.get_namespace_path}-----\n"
|
---|
| 328 | # if join.get_owner.get_region.get_domain_root.get_domain_type.get_option == "user" then
|
---|
| 329 | domain_roots << join.get_owner.get_region.get_domain_root
|
---|
| 330 | # end
|
---|
| 331 | }
|
---|
| 332 | return domain_roots.uniq
|
---|
| 333 | end
|
---|
| 334 |
|
---|
| 335 | def self.get_sac_str cell
|
---|
| 336 | domain_roots = self.get_inter_domain_join_roots cell
|
---|
| 337 | delim = ""
|
---|
| 338 | acv = ""
|
---|
| 339 | cell_domain_root = cell.get_region.get_domain_root
|
---|
| 340 | if cell_domain_root.get_domain_type.get_kind != :OutOfDomain then
|
---|
| 341 | domain_roots << cell.get_region.get_domain_root # çµåå
|
---|
| 342 | ã®ãã¡ã¤ã³ãå«ãã
|
---|
| 343 | end
|
---|
| 344 | domain_roots.each{ |dr|
|
---|
| 345 | case dr.get_domain_type.get_kind
|
---|
| 346 | when :kernel
|
---|
| 347 | acv += "#{delim}TACP_KERNEL"
|
---|
| 348 | delim = "|"
|
---|
| 349 | when :user
|
---|
| 350 | acv += "#{delim}TACP(#{dr.get_name})"
|
---|
| 351 | delim = "|"
|
---|
| 352 | if cell_domain_root.get_domain_type.get_kind != :OutOfDomain &&
|
---|
| 353 | dr.get_namespace_path != cell_domain_root.get_namespace_path then
|
---|
| 354 | cdl_error( "HRP9999 '$1': kernel object joined from other user domain. kernel object joined from multi-user-domain must be placed out of domain", cell.get_name )
|
---|
| 355 | end
|
---|
| 356 | when :OutOfDomain
|
---|
| 357 | if cell_domain_root.get_domain_type.get_kind == :OutOfDomain then
|
---|
| 358 | acv += "#{delim}TACP_SHARED"
|
---|
| 359 | delim = "|"
|
---|
| 360 | end
|
---|
| 361 | else
|
---|
| 362 | raise "unkown domain kind"
|
---|
| 363 | end
|
---|
| 364 | }
|
---|
| 365 | if acv == "" then
|
---|
| 366 | # å¼ã³å
|
---|
| 367 | ã»ã«ãç¡æå±ãã¤ãå¼ã³å
|
---|
| 368 | ãç¡æå±ã®ã¿ãã¾ãã¯çµåç¡ãã®å ´å
|
---|
| 369 | acv = "TACP_SHARED"
|
---|
| 370 | end
|
---|
| 371 | sac_str = "{"
|
---|
| 372 | delim = ""
|
---|
| 373 | [:accessPattern1, :accessPattern2, :accessPattern3, :accessPattern4].each{ |acp|
|
---|
| 374 | init = (cell.get_attr_initializer acp).to_s
|
---|
| 375 | if init != "OMIT"
|
---|
| 376 | sac_str += delim + init
|
---|
| 377 | else
|
---|
| 378 | sac_str += delim + acv
|
---|
| 379 | end
|
---|
| 380 | delim = ", "
|
---|
| 381 | }
|
---|
| 382 | return sac_str + '}'
|
---|
| 383 | end
|
---|
| 384 | end
|
---|