Index: EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2KernelObjectPlugin.rb
===================================================================
--- EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2KernelObjectPlugin.rb	(revision 321)
+++ EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2KernelObjectPlugin.rb	(revision 429)
@@ -4,5 +4,5 @@
 #      Generator for TOPPERS Embedded Component System
 #  
-#   Copyright (C) 2008-2012 by TOPPERS Project
+#   Copyright (C) 2008-2017 by TOPPERS Project
 #--
 #   上記著作権者は，以下の(1)～(4)の条件を満たす場合に限り，本ソフトウェ
@@ -35,4 +35,5 @@
 #   の責任を負わない．
 #  
+#   $Id$
 #++
 
@@ -185,5 +186,5 @@
                 val = {}
                 @celltype.get_attribute_list.each{ |a|
-                    p a.get_name
+                    # p a.get_name
                     if a.get_type.kind_of?( ArrayType )
                         val[a.get_name] = []
@@ -217,5 +218,6 @@
                 if val[:id].nil? != true
                     puts val[:id]
-                    val[:id] = val[:id].gsub( /(^|[^\$])\$id\$/, "\\1#{@celltype.get_name.to_s}_#{cell.get_name.to_s}" )
+                    #val[:id] = val[:id].gsub( /(^|[^\$])\$id\$/, "\\1#{@celltype.get_name.to_s}_#{cell.get_name.to_s}" )
+                    val[:id] = @celltype.subst_name( val[:id], @celltype.get_name_array( cell ) )
                 end
                 # $cbp$の代わり
@@ -243,6 +245,6 @@
                         file2.puts "}\n"
                     else
-                        print "~~~~~ #{cell.get_region.get_name.to_s} is included in"
-                        p @@region_list
+                        dbgPrint "~~~~~ #{cell.get_region.get_name.to_s} is included in"
+                        # p @@region_list
                     end
                     file3 = AppFile.open( "#{$gen}/tecsgen_#{cell_domain_root.get_name.to_s}.cfg" )
@@ -257,48 +259,50 @@
                 puts "===== end check my domain #{cell.get_name} ====="
                 # SAC_XXXの生成
-                puts "===== begin check regions #{cell.get_name} ====="
-                p val[:accessPattern]
-                p val[:accessPattern].class
-
-                #ep = [ :eTaskActivate, :eTaskControl, :eTaskManage, :eTaskRefer ]
-                #各カーネルオブジェクトの受け口名を取得
-                # ep = get_entry_ports_name_list()
-                i = 0
-                acv = []
-                # アクセス許可ベクタの生成
-                val[:accessPattern].each { |acptnx|
-                    # アクセス許可パターンの生成
-                    if acptnx != "OMIT"
-                        acv << acptnx
-                        p acv[i]
-                    elsif cell_domain_type.get_option.to_s == "trusted"
-                        acv << "TACP_KERNEL"
-                        p acv[i]
-                    elsif cell_domain_type.get_option.to_s != "OutOfDomain"
-                        acv << "TACP(#{cell_domain_root.get_name.to_s})"
+                if !val[:accessPattern].nil?
+                    puts "===== begin check regions #{cell.get_name} ====="
+                    # p val[:accessPattern]
+                    # p val[:accessPattern].class
+
+                    #ep = [ :eTaskActivate, :eTaskControl, :eTaskManage, :eTaskRefer ]
+                    #各カーネルオブジェクトの受け口名を取得
+                    # ep = get_entry_ports_name_list()
+                    i = 0
+                    acv = []
+                    # アクセス許可ベクタの生成
+                    val[:accessPattern].each { |acptnx|
+                        # アクセス許可パターンの生成
+                        if acptnx != "OMIT"
+                            acv << acptnx
+                            # p acv[i]
+                        elsif cell_domain_type.get_option.to_s == "trusted"
+                            acv << "TACP_KERNEL"
+                            # p acv[i]
+                        elsif cell_domain_type.get_option.to_s != "OutOfDomain"
+                            acv << "TACP(#{cell_domain_root.get_name.to_s})"
+                        else
+                            acv << "TACP_SHARED"
+                        end
+
+                        i += 1
+                    }
+
+                    dbgPrint "acv = "
+                    p acv
+
+                    #各種SACの生成
+                    domainOption = cell_domain_type.get_option
+                    # if cell.get_region.get_region_type == :DOMAIN
+                    if domainOption != "OutOfDomain"
+                        # 保護ドメインに属する場合
+                        file3 = AppFile.open( "#{$gen}/tecsgen_#{cell.get_region.get_name.to_s}.cfg" )
+                        print_cfg_sac(file3, val, acv)
+                        file3.close
                     else
-                        acv << "TACP_SHARED"
+                        # 無所属の場合
+                        print_cfg_sac(file2, val, acv)
                     end
 
-                    i += 1
-                }
-
-                print "acv = "
-                p acv
-
-                #各種SACの生成
-                domainOption = cell_domain_type.get_option
-                # if cell.get_region.get_region_type == :DOMAIN
-                if domainOption != "OutOfDomain"
-                    # 保護ドメインに属する場合
-                    file3 = AppFile.open( "#{$gen}/tecsgen_#{cell.get_region.get_name.to_s}.cfg" )
-                    print_cfg_sac(file3, val, acv)
-                    file3.close
-                else
-                    # 無所属の場合
-                    print_cfg_sac(file2, val, acv)
+                    puts "===== end check regions #{cell.get_name} ====="
                 end
-
-                puts "===== end check regions #{cell.get_name} ====="
             end
         }
@@ -319,9 +323,9 @@
 
     def self.check_referenced_cells()
-        puts "===== begin check registered celltype ====="
+        dbgPrint "===== begin check registered celltype =====\n"
         self.get_celltype_list.each { |ct|
-            p ct.get_name.to_s
+            dbgPrint( ct.get_name.to_s + "\n" )
         }
-        puts "===== end check registered celltype ====="
+        dbgPrint "===== end check registered celltype =====\n"
 
 =begin
@@ -331,5 +335,5 @@
                 j = cell.get_join_list.get_item(p.get_name)
                 printf "===== check call port : "
-                p p.get_name.to_s
+                # p p.get_name.to_s
                 next if j.nil? # 未結合の場合
                 if @@celltype_list.include?(j.get_celltype)
@@ -338,7 +342,7 @@
                     j.get_cell.set_referenced_cell(cell, j.get_port_name)
                     printf "===== check joined rhs cell : "
-                    p j.get_cell.get_name.to_s
+                    # p j.get_cell.get_name.to_s
                     printf "===== check joined rhs port_name : "
-                    p j.get_port_name
+                    # p j.get_port_name
                 end
             }
