Changeset 374 for asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin
- Timestamp:
- Apr 5, 2019, 9:26:53 PM (5 years ago)
- Location:
- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin
- Files:
-
- 16 added
- 34 edited
Legend:
- Unmodified
- Added
- Removed
-
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/ATK1AlarmPlugin.rb
r337 r374 35 35 # の責任を負わない. 36 36 # 37 # $Id 37 # $Id$ 38 38 #++ 39 39 -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/ATK1DelayTaskPlugin.rb
r337 r374 35 35 # の責任を負わない. 36 36 # 37 # $Id 37 # $Id$ 38 38 #++ 39 39 -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/ATK1ISRPlugin.rb
r337 r374 35 35 # の責任を負わない. 36 36 # 37 # $Id 37 # $Id$ 38 38 #++ 39 39 -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/ATK1KernelPlugin.rb
r337 r374 35 35 # の責任を負わない. 36 36 # 37 # $Id 37 # $Id$ 38 38 #++ 39 39 -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/ATK1ResourcePlugin.rb
r337 r374 35 35 # の責任を負わない. 36 36 # 37 # $Id 37 # $Id$ 38 38 #++ 39 39 -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/ATK1TaskPlugin.rb
r337 r374 35 35 # の責任を負わない. 36 36 # 37 # $Id 37 # $Id$ 38 38 #++ 39 39 -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/DomainPlugin.rb
r337 r374 46 46 #option::String : domain 指定子の第二引数 47 47 def initialize( region, domain_type_name, option ) 48 super() 48 49 end 49 50 … … 77 78 return false 78 79 end 80 81 #== ドメイン種別を返す 82 #return::Symbol :kernel, :user, :OutOfDomain 83 def get_kind 84 :kernel 85 end 86 87 #== factory 生成 88 # DomainPlugin の factory は特定のファイルへの出力が想定されていない 89 def gen_factory 90 end 79 91 end -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2Cache.rb
r337 r374 1 1 # -*- coding: utf-8 -*- 2 2 3 # $Id$ 3 4 -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2CyclicHandlerPlugin.rb
r359 r374 4 4 # Generator for TOPPERS Embedded Component System 5 5 # 6 # Copyright (C) 2008-201 2by TOPPERS Project6 # Copyright (C) 2008-2017 by TOPPERS Project 7 7 #-- 8 8 # 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2DataqueuePlugin.rb
r337 r374 4 4 # Generator for TOPPERS Embedded Component System 5 5 # 6 # Copyright (C) 2008-201 2by TOPPERS Project6 # Copyright (C) 2008-2017 by TOPPERS Project 7 7 #-- 8 8 # 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ … … 35 35 # の責任を負わない. 36 36 # 37 # $Id$ 37 38 #++ 38 39 -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2EventflagPlugin.rb
r337 r374 4 4 # Generator for TOPPERS Embedded Component System 5 5 # 6 # Copyright (C) 2008-201 2by TOPPERS Project6 # Copyright (C) 2008-2017 by TOPPERS Project 7 7 #-- 8 8 # 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ … … 35 35 # の責任を負わない. 36 36 # 37 # $Id$ 37 38 #++ 38 39 -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2FixedSizeMemoryPoolPlugin.rb
r337 r374 4 4 # Generator for TOPPERS Embedded Component System 5 5 # 6 # Copyright (C) 2008-201 2by TOPPERS Project6 # Copyright (C) 2008-2017 by TOPPERS Project 7 7 #-- 8 8 # 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ … … 35 35 # の責任を負わない. 36 36 # 37 # $Id$ 37 38 #++ 38 39 -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2HandlerPlugin.rb
r359 r374 4 4 # Generator for TOPPERS Embedded Component System 5 5 # 6 # Copyright (C) 2008-201 4by TOPPERS Project6 # Copyright (C) 2008-2018 by TOPPERS Project 7 7 #-- 8 8 # 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ … … 77 77 elsif @plugin_arg_str == "ISR" 78 78 file.print <<EOT 79 #{tab}ATT_ISR({ #{val[:attribute]}, &#{cell_CB_name}, #{val[:interruptNumber]}, tISR_start, #{val[:priority]} });79 #{tab}ATT_ISR({ #{val[:attribute]}, #{cell_CBP}, #{val[:interruptNumber]}, tISR_start, #{val[:priority]} }); 80 80 EOT 81 81 elsif @plugin_arg_str == "INIT_ROUTINE" 82 82 file.print <<EOT 83 #{tab}ATT_INI({ #{val[:attribute]}, &#{cell_CB_name}, tInitializeRoutine_start });83 #{tab}ATT_INI({ #{val[:attribute]}, #{cell_CBP}, tInitializeRoutine_start }); 84 84 EOT 85 85 elsif @plugin_arg_str == "TERM_ROUTINE" 86 86 file.print <<EOT 87 #{tab}ATT_TER({ #{val[:attribute]}, &#{cell_CB_name}, tTerminateRoutine_start });87 #{tab}ATT_TER({ #{val[:attribute]}, #{cell_CBP}, tTerminateRoutine_start }); 88 88 EOT 89 89 else -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2KernelObjectPlugin.rb
r359 r374 4 4 # Generator for TOPPERS Embedded Component System 5 5 # 6 # Copyright (C) 2008-201 2by TOPPERS Project6 # Copyright (C) 2008-2017 by TOPPERS Project 7 7 #-- 8 8 # 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ … … 186 186 val = {} 187 187 @celltype.get_attribute_list.each{ |a| 188 p a.get_name188 # p a.get_name 189 189 if a.get_type.kind_of?( ArrayType ) 190 190 val[a.get_name] = [] … … 218 218 if val[:id].nil? != true 219 219 puts val[:id] 220 val[:id] = val[:id].gsub( /(^|[^\$])\$id\$/, "\\1#{@celltype.get_name.to_s}_#{cell.get_name.to_s}" ) 220 #val[:id] = val[:id].gsub( /(^|[^\$])\$id\$/, "\\1#{@celltype.get_name.to_s}_#{cell.get_name.to_s}" ) 221 val[:id] = @celltype.subst_name( val[:id], @celltype.get_name_array( cell ) ) 221 222 end 222 223 # $cbp$の代わり … … 244 245 file2.puts "}\n" 245 246 else 246 print "~~~~~ #{cell.get_region.get_name.to_s} is included in"247 p @@region_list247 dbgPrint "~~~~~ #{cell.get_region.get_name.to_s} is included in" 248 # p @@region_list 248 249 end 249 250 file3 = AppFile.open( "#{$gen}/tecsgen_#{cell_domain_root.get_name.to_s}.cfg" ) … … 260 261 if !val[:accessPattern].nil? 261 262 puts "===== begin check regions #{cell.get_name} =====" 262 p val[:accessPattern]263 p val[:accessPattern].class263 # p val[:accessPattern] 264 # p val[:accessPattern].class 264 265 265 266 #ep = [ :eTaskActivate, :eTaskControl, :eTaskManage, :eTaskRefer ] … … 273 274 if acptnx != "OMIT" 274 275 acv << acptnx 275 p acv[i]276 # p acv[i] 276 277 elsif cell_domain_type.get_option.to_s == "trusted" 277 278 acv << "TACP_KERNEL" 278 p acv[i]279 # p acv[i] 279 280 elsif cell_domain_type.get_option.to_s != "OutOfDomain" 280 281 acv << "TACP(#{cell_domain_root.get_name.to_s})" … … 286 287 } 287 288 288 print "acv = "289 dbgPrint "acv = " 289 290 p acv 290 291 … … 322 323 323 324 def self.check_referenced_cells() 324 puts "===== begin check registered celltype ====="325 dbgPrint "===== begin check registered celltype =====\n" 325 326 self.get_celltype_list.each { |ct| 326 p ct.get_name.to_s327 dbgPrint( ct.get_name.to_s + "\n" ) 327 328 } 328 puts "===== end check registered celltype ====="329 dbgPrint "===== end check registered celltype =====\n" 329 330 330 331 =begin … … 334 335 j = cell.get_join_list.get_item(p.get_name) 335 336 printf "===== check call port : " 336 p p.get_name.to_s337 # p p.get_name.to_s 337 338 next if j.nil? # 未結合の場合 338 339 if @@celltype_list.include?(j.get_celltype) … … 341 342 j.get_cell.set_referenced_cell(cell, j.get_port_name) 342 343 printf "===== check joined rhs cell : " 343 p j.get_cell.get_name.to_s344 # p j.get_cell.get_name.to_s 344 345 printf "===== check joined rhs port_name : " 345 p j.get_port_name346 # p j.get_port_name 346 347 end 347 348 } -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2ObjectPlugin.rb
r337 r374 4 4 # Generator for TOPPERS Embedded Component System 5 5 # 6 # Copyright (C) 2008-201 4by TOPPERS Project6 # Copyright (C) 2008-2017 by TOPPERS Project 7 7 #-- 8 8 # 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ … … 35 35 # の責任を負わない. 36 36 # 37 # $Id$ 37 38 #++ 38 39 -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2Plugin.rb
r359 r374 4 4 # Generator for TOPPERS Embedded Component System 5 5 # 6 # Copyright (C) 201 4by TOPPERS Project6 # Copyright (C) 2018 by TOPPERS Project 7 7 #-- 8 8 # 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ … … 44 44 45 45 def initialize( region, name, option ) 46 super 46 47 print "HRP2Plugin: initialize: region=#{region.get_name}, domainName=#{name}, option=#{option}\n" 48 @region = region 49 @name = name 50 51 case option 52 when "trusted", "nontrusted", "OutOfDomain" 53 # OK 54 @option = option 55 else 56 cdl_error( "HRPPlugin: '$1' is unacceptable domain kind, specify 'trusted' or 'nontrusted'", option ) 57 @option = "trusted" # とりあえず trusted を設定しておく 58 end 47 59 end 48 60 … … 108 120 end 109 121 122 #== ドメイン種別を返す 123 #return::Symbol :kernel, :user, :OutOfDomain 124 def get_kind 125 case @option 126 when "trusted" 127 return :kernel 128 when "nontrusted" 129 return :user 130 when "OutOfDomain" 131 return :OutOfDomain 132 end 133 end 134 110 135 def joinable?(current_region, next_region, through_type ) 111 136 print "HRP2Plugin: joinable? from #{current_region.get_name} to #{next_region.get_name} (#{through_type})\n" -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2PostHook.rb
r337 r374 4 4 # Generator for TOPPERS Embedded Component System 5 5 # 6 # Copyright (C) 201 2by TOPPERS Project6 # Copyright (C) 2017 by TOPPERS Project 7 7 #-- 8 8 # 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ … … 35 35 # の責任を負わない. 36 36 # 37 # $Id$ 37 38 #++ 38 39 -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2PriorityDataqueuePlugin.rb
r337 r374 35 35 # の責任を負わない. 36 36 # 37 # $Id$ 37 38 #++ 38 39 -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2RPCPlugin.rb
r337 r374 35 35 # の責任を負わない. 36 36 # 37 # $Id$ 37 38 #++ 38 39 … … 70 71 #=== RPCPlugin の initialize 71 72 # 説明は ThroughPlugin (plugin.rb) を参照 72 def initialize( cell_name, plugin_arg, next_cell, next_cell_port_name, signature, celltype, caller_cell )73 def initialize( cell_name, plugin_arg, next_cell, next_cell_port_name, next_cell_port_subscript, signature, celltype, caller_cell ) 73 74 super 74 75 @b_noClientSemaphore = false … … 234 235 if cell.get_allocator_list.length > 0 then 235 236 236 dbgPrint "make allocator "237 dbgPrint "make allocator\n" 237 238 file.print "#{indent_str}[allocator(" 238 239 … … 269 270 nest = @end_region.gen_region_str_pre file 270 271 indent_str = " " * nest 272 nest_str = " " * nest 273 if @next_cell_port_subscript then 274 subscript = '[' + @next_cell_port_subscript.to_s + ']' 275 else 276 subscript = "" 277 end 271 278 272 279 file.print <<EOT 273 280 #{indent_str}cell #{@rpc_channel_celltype_name}Server #{@cell_name}Body { 274 #{indent_str} #{@call_port_name} = #{@next_cell.get_namespace_path.get_path_str}.#{@next_cell_port_name} ;281 #{indent_str} #{@call_port_name} = #{@next_cell.get_namespace_path.get_path_str}.#{@next_cell_port_name}#{subscript}; 275 282 //#{indent_str} #{@call_port_name} = #{@next_cell.get_name}.#{@next_cell_port_name}; 276 283 #{indent_str} //cTDR = #{@channelCellName}.eTDR; -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2SVCPlugin.rb
r337 r374 35 35 # の責任を負わない. 36 36 # 37 # $Id$ 37 38 #++ 38 39 … … 83 84 @@generated_celltype_header = {} 84 85 85 def initialize( cell_name, plugin_arg, next_cell, next_cell_port_name, signature, celltype, caller_cell )86 def initialize( cell_name, plugin_arg, next_cell, next_cell_port_name, next_cell_port_subscript, signature, celltype, caller_cell ) 86 87 super 87 88 @ct_name_body = "#{@ct_name}SVCBody_#{@next_cell.get_name}_#{@next_cell_port_name}".to_sym … … 217 218 nest = @end_region.gen_region_str_pre file 218 219 nest_str = " " * nest 220 if @next_cell_port_subscript then 221 subscript = '[' + @next_cell_port_subscript.to_s + ']' 222 else 223 subscript = "" 224 end 219 225 220 226 # サーバー側チャンネルの生成 … … 224 230 #{nest_str} // Server Side Channel 225 231 #{nest_str} cell #{@ct_name_body} #{@cell_name_body}{ 226 #{nest_str} #{@call_port_name} = #{@next_cell.get_namespace_path.get_path_str}.#{@next_cell_port_name} ;232 #{nest_str} #{@call_port_name} = #{@next_cell.get_namespace_path.get_path_str}.#{@next_cell_port_name}#{subscript}; 227 233 #{nest_str} }; 228 234 EOT … … 241 247 nest = @start_region.gen_region_str_pre file 242 248 nest_str = " " * nest 249 if @next_cell_port_subscript then 250 subscript = '[' + @next_cell_port_subscript.to_s + ']' 251 else 252 subscript = "" 253 end 243 254 244 255 # クライアント側チャンネルの生成 … … 247 258 #{nest_str} // Client Side Channel 248 259 #{nest_str} cell #{@ct_name} #{@cell_name}{ 249 #{nest_str} #{@call_port_name} = #{@next_cell.get_namespace_path.get_path_str}.#{@next_cell_port_name} ;260 #{nest_str} #{@call_port_name} = #{@next_cell.get_namespace_path.get_path_str}.#{@next_cell_port_name}#{subscript}; 250 261 #{nest_str} }; 251 262 -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2SemaphorePlugin.rb
r337 r374 35 35 # の責任を負わない. 36 36 # 37 # $Id$ 37 38 #++ 38 39 -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2TaskPlugin.rb
r359 r374 53 53 # tab : 54 54 def print_cfg_cre(file, cell, val, tab) 55 val[:id] = val[:id].gsub( /(^|[^\$])\$id\$/, "\\1#{@celltype.get_name.to_s}_#{cell.get_name.to_s}" ) 55 #val[:id] = val[:id].gsub( /(^|[^\$])\$id\$/, "\\1#{@celltype.get_name.to_s}_#{cell.get_global_name.to_s}" ) 56 #val[:id] = @celltype.subst_name( val[:id], @celltype.get_name_array( cell ) ) 56 57 # $cbp$の代わり 57 58 index = cell.get_id - @celltype.get_id_base … … 59 60 cell_CB_name = "#{index}" 60 61 # CRE_XXX/DEF_XXXの生成 61 print "assign task plugin\n"62 dbgPrint "assign task plugin\n" 62 63 domainOption = cell.get_region.get_domain_root.get_domain_type.get_option 63 64 # if cell.get_region.get_region_type == :DOMAIN 65 # cell.show_tree 1 64 66 if domainOption != "OutOfDomain" 65 67 # 保護ドメインに属する場合 … … 69 71 raise "system task cannot have user stack." 70 72 end 73 p "CRE_TSK 0 user=#{val[:userStackSize]} system=#{val[:systemStackSize]}" 71 74 file.print <<EOT 72 75 #{tab}CRE_TSK(#{val[:id]}, { #{val[:taskAttribute]}, #{cell_CB_name}, tTask_start_task, #{val[:priority]}, #{val[:systemStackSize]}, NULL }); … … 77 80 raise "user task must have user stack." 78 81 end 82 p "CRE_TSK 1" 79 83 if val[:systemStackSize] == "OMIT" 80 84 file.print <<EOT … … 82 86 EOT 83 87 else 88 p "CRE_TSK 2" 84 89 file.print <<EOT 85 90 #{tab}CRE_TSK(#{val[:id]}, { #{val[:taskAttribute]}, #{cell_CB_name}, tTask_start_task, #{val[:priority]}, #{val[:userStackSize]}, NULL, #{val[:systemStackSize]}, NULL }); … … 138 143 regions = ct.get_domain_roots 139 144 regions_hrp2 = regions[ :HRP2 ] 140 print "HRP2 domain in #{ct.get_name}: "145 dbgPrint "HRP2 domain in #{ct.get_name}: " 141 146 regions_hrp2.each { |reg| 142 print reg.get_name147 dbgPrint reg.get_name 143 148 } 144 149 puts "" -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/MrubyBridgePlugin.rb
r359 r374 3 3 # mruby => TECS bridge 4 4 # 5 # Copyright (C) 2008-201 5by TOPPERS Project5 # Copyright (C) 2008-2017 by TOPPERS Project 6 6 # 7 7 # 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/MultiPlugin.rb
r359 r374 4 4 # Generator for TOPPERS Embedded Component System 5 5 # 6 # Copyright (C) 2008-201 4by TOPPERS Project6 # Copyright (C) 2008-2017 by TOPPERS Project 7 7 #-- 8 8 # 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/NotifierPlugin.rb
r359 r374 1 1 # -*- coding: utf-8 -*- 2 # 3 # TECS Generator 4 # Generator for TOPPERS Embedded Component System 2 5 # 3 6 # Copyright (C) 2015 by Ushio Laboratory … … 5 8 # Copyright (C) 2015-2016 by Embedded and Real-Time Systems Laboratory 6 9 # Graduate School of Information Science, Nagoya Univ., JAPAN 10 # Copyright (C) 2015-2018 by TOPPERS Project 7 11 # 12 #-- 13 # 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ 14 # ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改 15 # 変・再配布(以下,利用と呼ぶ)することを無償で許諾する. 16 # (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作 17 # 権表示,この利用条件および下記の無保証規定が,そのままの形でソー 18 # スコード中に含まれていること. 19 # (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使 20 # 用できる形で再配布する場合には,再配布に伴うドキュメント(利用 21 # 者マニュアルなど)に,上記の著作権表示,この利用条件および下記 22 # の無保証規定を掲載すること. 23 # (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使 24 # 用できない形で再配布する場合には,次のいずれかの条件を満たすこ 25 # と. 26 # (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著 27 # 作権表示,この利用条件および下記の無保証規定を掲載すること. 28 # (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに 29 # 報告すること. 30 # (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損 31 # 害からも,上記著作権者およびTOPPERSプロジェクトを免責すること. 32 # また,本ソフトウェアのユーザまたはエンドユーザからのいかなる理 33 # 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを 34 # 免責すること. 35 # 36 # 本ソフトウェアは,無保証で提供されているものである.上記著作権者お 37 # よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的 38 # に対する適合性も含めて,いかなる保証も行わない.また,本ソフトウェ 39 # アの利用により直接的または間接的に生じたいかなる損害に関しても,そ 40 # の責任を負わない. 41 # 42 # $Id$ 43 #++ 8 44 9 45 NotifierPluginArgProc = { … … 128 164 # @param [Cell, Symbol] cell セル.セルについて一般化する場合は `:generic` 129 165 # @param [Integer, Symbol, nil] subscript 添字.添字について一般化する場合は `:generic` 166 # @param [Celltype] 呼び先のセルタイプ、cell==:generic の場合のみ有効 130 167 # @private 131 def generate_inner(context, fn_name, cell, subscript )168 def generate_inner(context, fn_name, cell, subscript, callee_ct=nil) 132 169 source_file = context.source_file 133 170 header_file = context.header_file … … 141 178 unless ct.is_singleton? 142 179 if cell == :generic 143 params << "(CELLIDX)extinf" 180 params << "(#{callee_ct.get_global_name}_IDX)extinf" 181 # params << "(CELLIDX)extinf" 144 182 else 145 183 # セルのCELLIDXを得る … … 233 271 234 272 generate_inner context, fn_name, 235 :generic, subscript 273 :generic, subscript, ct 236 274 237 275 props.each { |prop| … … 445 483 # join:: Join : 結合 (declarationがPortであるもの) 446 484 def validate_join(handler, cell, join) 447 485 return !generate_attr_map(handler, cell).nil? 448 486 end 449 487 … … 872 910 parse_plugin_arg 873 911 unless @factory 874 cdl_error(" ASP1003 celltype $1: option factory is not specified",912 cdl_error("NTF1003 celltype $1: option factory is not specified", 875 913 celltype.get_name) 876 914 end 877 915 unless @output_file 878 cdl_error(" ASP1003 celltype $1: option output_file is not specified",916 cdl_error("NTF1003 celltype $1: option output_file is not specified", 879 917 celltype.get_name) 880 918 end … … 883 921 def set_factory(template_string) 884 922 unless @factory.nil? 885 cdl_error(" ASP1003 celltype $1: option factory was specified more than once",923 cdl_error("NTF1003 celltype $1: option factory was specified more than once", 886 924 celltype.get_name) 887 925 end … … 891 929 def set_factory_output_file(output_file) 892 930 unless @output_file.nil? 893 cdl_error(" ASP1003 celltype $1: option output_file was specified more than once",931 cdl_error("NTF1003 celltype $1: option output_file was specified more than once", 894 932 celltype.get_name) 895 933 end … … 898 936 899 937 def gen_factory file 900 puts "===== begin #{@celltype.get_name.to_s} plugin ====="938 # puts "===== begin #{@celltype.get_name.to_s} plugin =====" 901 939 902 940 kernelCfg = AppFile.open( "#{$gen}/#{@output_file}" ) … … 922 960 subst_attr = @celltype.find(name) 923 961 unless subst_attr 924 cdl_error( " ASP1007 celltype $1: additional_param: attribute $2 does not exist.",962 cdl_error( "NTF1007 celltype $1: additional_param: attribute $2 does not exist.", 925 963 @celltype.get_name, name) 926 964 end … … 935 973 936 974 kernelCfg.close 937 puts "===== end #{@celltype.get_name.to_s} plugin ====="975 # puts "===== end #{@celltype.get_name.to_s} plugin =====" 938 976 end 939 977 940 978 def gen_factory_for_cell(kernelCfg, cell) 979 # print "########## gen_factory_for_cell cell=#{cell.get_name}\n" 941 980 handler_flags = [] 942 981 handler_args = [] … … 959 998 when 'false' then ignoreErrors = false 960 999 else 961 cdl_warning ( "ASP1005 cell $1: unrecognized value '$2' specified for ignoreErrors",1000 cdl_warning2( cell.get_locale, "NTF1005 cell $1: unrecognized value '$2' specified for ignoreErrors", 962 1001 cell.get_name, ignoreErrors ) 963 1002 ignoreErrors = false 964 1003 end 965 1004 1005 # ドメイン指定用文字列 1006 pre_text = "" 1007 post_text = "\n" 1008 indent = "" 1009 966 1010 [EVENT_HANDLER, ERROR_HANDLER].each { |handler| 967 1011 # 呼び口の結合を取得 968 1012 call_join = cell.get_join_list.get_item(handler.call_port_name.to_sym) 1013 domain_root = cell.get_region.get_domain_root 1014 if cell.get_region.get_domain_root.get_domain_type then 1015 # print "cell=#{cell.get_name} domain_root=#{domain_root.get_name} domain_type=#{domain_root.get_domain_type.get_name} domain_option=#{domain_root.get_domain_type.get_option}\n" 1016 else 1017 # print "cell=#{cell.get_name} domain_root=#{cell.get_region.get_domain_root.get_name}\n" 1018 end 1019 if call_join 1020 # print "validate_join: hanlder=#{handler.class.name} cell=#{cell.get_name} join=#{call_join.get_name} rhs_cell=#{call_join.get_cell}\n" 1021 else 1022 # print "validate_join: hanlder=#{handler.class.name} cell=#{cell.get_name}\n" 1023 end 969 1024 970 1025 # ハンドラタイプを判別する … … 974 1029 975 1030 if matches.length == 0 976 cdl_error ( "ASP1001 cell $1: no matching handler type found for $2", cell.get_name, handler.call_port_name )1031 cdl_error2( cell.get_locale, "NTF1001 cell $1: no matching handler type found for $2", cell.get_name, handler.call_port_name ) 977 1032 next 978 1033 end 979 1034 980 1035 # 最初に見つかった有効なハンドラタイプを使用 981 1036 ht = matches[0] 1037 1038 # ドメインプラグインが指定されている場合、所属ドメインのチェック 1039 domain_root = cell.get_region.get_domain_root 1040 if domain_root.get_domain_type then 1041 if domain_root.get_domain_type.get_name == :HRP then 1042 option = domain_root.get_domain_type.get_option 1043 matches.each{ |match| 1044 # p "match:#{match}" 1045 case match 1046 when ActivateTaskHandlerType, WakeUpTaskHandlerType, 1047 SetVariableHandlerType, SetVariableToErrorCodeHandlerType, 1048 IncrementVariableHandlerType, SignalSemaphoreHandlerType, 1049 SetEventflagHandlerType, SendToDataqueueHandlerType, 1050 SendErrorCodeToDataqueueHandlerType 1051 if option == "OutOfDomain" then 1052 cdl_error2( cell.get_locale, "NTF9999: NotifierPlugin: $1 cannot be placed out of domain", cell.get_name ) 1053 elsif call_join.get_cell.get_region.get_domain_root == nil || 1054 call_join.get_cell.get_region.get_domain_root != domain_root then 1055 cdl_error2( cell.get_locale, "NTF9999: NotifierPlugin: $1 and $2 must be placed in same domain", cell.get_name, call_join.get_cell.get_name ) 1056 end 1057 dbgPrint "#{self.class.name}: match pattern 1.\n" 1058 when UserHandlerType 1059 if option != "kernel" then 1060 cdl_error2( cell.get_locale, "NTF9999: NotifierPlugin: $1 can be placed in kernel domain only, because notify target is handler", cell.get_name ) 1061 elsif call_join.get_cell.get_region.get_domain_root == nil || 1062 call_join.get_cell.get_region.get_domain_root != domain_root then 1063 cdl_error2( cell.get_locale, "NTF9999: NotifierPlugin: $1 and $2 must be placed in same domain", cell.get_name, call_join.get_cell.get_name ) 1064 end 1065 dbgPrint "#{self.class.name}: match pattern 2.\n" 1066 when NullHandlerType.new # エラー通知を指定していない 1067 dbgPrint "#{self.class.name}: match pattern 3.\n" 1068 end 1069 } 1070 1071 # if cell.get_region.get_param == :KERNEL_DOMAIN 1072 if option == "kernel" 1073 pre_text = "KERNEL_DOMAIN{\n" 1074 post_text = "}\n" 1075 indent = "\t" 1076 elsif option != "OutOfDomain" then 1077 pre_text = "DOMAIN(#{domain_root.get_name.to_s}){\n" 1078 post_text = "}\n" 1079 indent = "\t" 1080 end 1081 else 1082 cdl_error( "NTF9999: NotifierPlugin: unknown domain type $1", domain_root.get_domain_type.get_name ) 1083 end 1084 1085 end 982 1086 983 1087 # 通知ハンドラで「エラーが発生するはずがない」のに「エラーハンドラが指定されている」 … … 986 1090 # なため、検出は行わない。) 987 1091 if handler == ERROR_HANDLER && !ht.is_a?(NullHandlerType) && !event_handler_might_fail 988 cdl_error ( "ASP1004 cell $1: handler type $2 which never raises an error was inferred for the normal notification handler, but an error notification handler was specified.",1092 cdl_error2( cell.get_locale, "NTF1004 cell $1: handler type $2 which never raises an error was inferred for the normal notification handler, but an error notification handler was specified.", 989 1093 cell.get_name, handler_flag) 990 1094 end 991 1095 if handler == ERROR_HANDLER && ht.is_a?(NullHandlerType) && event_handler_might_fail && !ignoreErrors 992 cdl_warning ( "ASP1006 cell $1: handler type $2 which might raise an error was inferred for the normal notificaton handler, but an error notification handler was not specified.",1096 cdl_warning2( cell.get_locale, "NTF1006 cell $1: handler type $2 which might raise an error was inferred for the normal notificaton handler, but an error notification handler was not specified.", 993 1097 cell.get_name, handler_flag) 994 1098 end … … 1057 1161 # $id$等の置換 1058 1162 cell.get_celltype.subst_name(subst, name_array) 1059 } 1060 1061 # 出力 1062 kernelCfg.puts text 1063 1064 end 1065 private :gen_factory_for_cell 1163 } 1164 1165 # 出力 (CRE_xxx) 1166 kernelCfg.print pre_text 1167 kernelCfg.print indent, text, "\n" 1168 gen_sac kernelCfg, cell, indent 1169 kernelCfg.print post_text 1170 end 1171 1172 def gen_sac file, cell, indent 1173 domain_root = cell.get_region.get_domain_root 1174 if domain_root.get_domain_type then 1175 id = (cell.get_attr_initializer :id).to_s 1176 name_array = cell.get_celltype.get_name_array(cell) 1177 case cell.get_celltype.get_name 1178 when :tCyclicNotifier 1179 obj_type = "CYC" 1180 when :tAlarmNotifier 1181 obj_type = "ALM" 1182 else 1183 raise "NotifierPlugin: unknown celltype #{cell.get_celltype.get_name}" 1184 end 1185 id = cell.get_celltype.subst_name(id, name_array) 1186 # p obj_type 1187 # p HRPPlugin.get_sac_str cell 1188 file.print indent, "SAC_#{obj_type}( #{id}, #{HRPPlugin.get_sac_str cell} );\n" 1189 end 1190 end 1191 private :gen_factory_for_cell 1066 1192 1067 1193 end -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/OpaqueRPCPlugin.rb
r337 r374 56 56 #=== RPCPlugin の initialize 57 57 # 説明は ThroughPlugin (plugin.rb) を参照 58 def initialize( cell_name, plugin_arg, next_cell, next_cell_port_name, signature, celltype, caller_cell )58 def initialize( cell_name, plugin_arg, next_cell, next_cell_port_name, next_cell_port_subscript, signature, celltype, caller_cell ) 59 59 super 60 60 @b_noClientSemaphore = false … … 254 254 nest = @end_region.gen_region_str_pre file 255 255 nest_str = " " * nest 256 if @next_cell_port_subscript then 257 subscript = '[' + @next_cell_port_subscript.to_s + ']' 258 else 259 subscript = "" 260 end 256 261 257 262 if @serverErrorHandler then … … 282 287 #{nest_str} cell #{@rpc_server_channel_celltype_name} #{@serverChannelCell}_Unmarshaler { 283 288 #{nest_str} cChannel = #{@serverChannelCell}.eC1; 284 #{nest_str} #{@call_port_name} = #{@next_cell.get_namespace_path.get_path_str}.#{@next_cell_port_name} ;289 #{nest_str} #{@call_port_name} = #{@next_cell.get_namespace_path.get_path_str}.#{@next_cell_port_name}#{subscript}; 285 290 #{serverErrorHandler_str}#{nest_str} }; 286 291 EOT -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/RPCPlugin.rb
r337 r374 65 65 #=== RPCPlugin の initialize 66 66 # 説明は ThroughPlugin (plugin.rb) を参照 67 def initialize( cell_name, plugin_arg, next_cell, next_cell_port_name, signature, celltype, caller_cell )67 def initialize( cell_name, plugin_arg, next_cell, next_cell_port_name, next_cell_port_subscript, signature, celltype, caller_cell ) 68 68 super 69 69 @b_noClientSemaphore = false … … 197 197 nest = @region.gen_region_str_pre file 198 198 indent_str = " " * nest 199 if @next_cell_port_subscript then 200 subscript = '[' + @next_cell_port_subscript.to_s + ']' 201 else 202 subscript = "" 203 end 199 204 200 205 file.print <<EOT … … 233 238 file.print <<EOT 234 239 #{indent_str}cell #{@rpc_channel_celltype_name} #{@cell_name} { 235 #{indent_str} #{@call_port_name} = #{@next_cell.get_name}.#{@next_cell_port_name} ;240 #{indent_str} #{@call_port_name} = #{@next_cell.get_name}.#{@next_cell_port_name}#{subscript}; 236 241 #{indent_str} cTDR = #{@channelCellName}.eTDR; 237 242 #{indent_str} cEventflag = #{@channelCellName}.eEventflag; -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/SharedOpaqueRPCPlugin.rb
r337 r374 68 68 #=== RPCPlugin の initialize 69 69 # 説明は ThroughPlugin (plugin.rb) を参照 70 def initialize( cell_name, plugin_arg, next_cell, next_cell_port_name, signature, celltype, caller_cell )70 def initialize( cell_name, plugin_arg, next_cell, next_cell_port_name, next_cell_port_subscript, signature, celltype, caller_cell ) 71 71 super 72 72 initialize_opaque_marshaler … … 221 221 nest = @start_region.gen_region_str_pre file 222 222 indent_str = " " * nest 223 nest_str = " " * nest 224 if @next_cell_port_subscript then 225 subscript = '[' + @next_cell_port_subscript.to_s + ']' 226 else 227 subscript = "" 228 end 223 229 224 230 # セルを探す … … 303 309 #{indent_str}cell #{@unmarshaler_celltype_name} #{@cell_name}_Server { 304 310 #{indent_str} cTDR = #{@shared_channel_cell}_Server.eTDR; 305 #{indent_str} cServerCall = #{@next_cell.get_namespace_path.get_path_str}.#{@next_cell_port_name} ;311 #{indent_str} cServerCall = #{@next_cell.get_namespace_path.get_path_str}.#{@next_cell_port_name}#{subscript}; 306 312 #{ppallocator_join}#{indent_str}}; 307 313 EOT -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/SharedRPCPlugin.rb
r337 r374 62 62 #=== RPCPlugin の initialize 63 63 # 説明は ThroughPlugin (plugin.rb) を参照 64 def initialize( cell_name, plugin_arg, next_cell, next_cell_port_name, signature, celltype, caller_cell )64 def initialize( cell_name, plugin_arg, next_cell, next_cell_port_name, next_cell_port_subscript, signature, celltype, caller_cell ) 65 65 66 66 # mikan プラグインオプション指定の不一致のチェック task_priority, … … 236 236 nest = @region.gen_region_str_pre file 237 237 indent_str = " " * nest 238 if @next_cell_port_subscript then 239 subscript = '[' + @next_cell_port_subscript.to_s + ']' 240 else 241 subscript = "" 242 end 238 243 239 244 # セルを探す … … 291 296 file.print <<EOT 292 297 #{indent_str}cell #{@rpc_channel_celltype_name} #{@cell_name} { 293 #{indent_str} #{@call_port_name} = #{@next_cell.get_name}.#{@next_cell_port_name} ;298 #{indent_str} #{@call_port_name} = #{@next_cell.get_name}.#{@next_cell_port_name}#{subscript}; 294 299 #{indent_str} cTDR = #{@shared_channel_cell}.eTDR; 295 300 #{indent_str} cEventflag = #{@shared_channel_cell}.eEventflag; -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/ThroughPlugin.rb
r337 r374 47 47 #@next_cell:: Cell 呼び口を結合するセル 48 48 #@next_cell_port_name:: Symbol 呼び口を結合する受口の名前 49 #@next_cell_port_subscript::Nil|Integer 呼び口を結合する受口の配列添数.受け口配列でない場合 nil 49 50 #@signature:: Signature シグニチャ 50 51 #@celltype:: Celltype 呼び先のセルのセルタイプ. through が連接する場合、最終的な呼び先のセルのセルタイプ … … 74 75 #next_cell:: Cell 呼び口を接続するセル 75 76 #next_cell_port_name:: Symbol 呼び口を接続する受口の名前 77 #next_cell_port_subscript:: Nil|Integer 呼び口を接続する受口配列添数 76 78 #signature:: Signature シグニチャ 77 79 #celltype:: Celltype セルタイプ (呼び先のセルのセルタイプ) 78 80 #caller_cell:: Cell 呼び元のセル.@caller_cell の項を参照 79 def initialize( cell_name, plugin_arg, next_cell, next_cell_port_name, signature, celltype, caller_cell )81 def initialize( cell_name, plugin_arg, next_cell, next_cell_port_name, next_cell_port_subscript, signature, celltype, caller_cell ) 80 82 super() 81 83 @cell_name = cell_name # 生成すべきセル名(受け口側のセル名) … … 83 85 @next_cell = next_cell # 呼び先のセル 84 86 @next_cell_port_name = next_cell_port_name 87 @next_cell_port_subscript = next_cell_port_subscript 85 88 @signature = signature 86 89 @entry_port_name = :"eThroughEntry" … … 136 139 def get_through_entry_port_name 137 140 @entry_port_name 141 end 142 143 #=== 生成されたセルの受け口配列添数を得る 144 def get_through_entry_port_subscript 145 @entry_port_subscript 138 146 end 139 147 -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/TracePlugin.rb
r337 r374 44 44 #=== TracePlugin の initialize 45 45 # 説明は ThroughPlugin (plugin.rb) を参照 46 def initialize( cell_name, plugin_arg, next_cell, next_cell_port_name, signature, celltype, caller_cell )46 def initialize( cell_name, plugin_arg, next_cell, next_cell_port_name, next_cell_port_subscript, signature, celltype, caller_cell ) 47 47 48 48 @maxArrayDisplay = 16 … … 141 141 nest = @region.gen_region_str_pre file 142 142 indent_str = " " * nest 143 if @next_cell_port_subscript then 144 subscript = '[' + @next_cell_port_subscript.to_s + ']' 145 else 146 subscript = "" 147 end 143 148 144 149 if @probeName then … … 155 160 file.print <<EOT 156 161 #{indent_str}cell #{@ct_name} #{@cell_name} { 157 #{indent_str} #{@call_port_name} = #{@next_cell.get_namespace_path.get_path_str}.#{@next_cell_port_name} ;162 #{indent_str} #{@call_port_name} = #{@next_cell.get_namespace_path.get_path_str}.#{@next_cell_port_name}#{subscript}; 158 163 #{probeName_str}#{caller_cell_str}#{indent_str}}; 159 164 EOT … … 210 215 } 211 216 file.print( " );\n" ) 217 if @next_cell_port_subscript then 218 subscript = '[' + @next_cell_port_subscript.to_s + ']' 219 else 220 subscript = "" 221 end 212 222 213 223 file.print <<EOT 214 224 \tgetMicroTime( &utime ); 215 \tsyslog( LOG_INFO, \"Leave: %sTime=%d: #{@next_cell.get_name}.#{@next_cell_port_name} .#{func_name}\", ATTR_probeName_str, utime );225 \tsyslog( LOG_INFO, \"Leave: %sTime=%d: #{@next_cell.get_name}.#{@next_cell_port_name}#{subscript}.#{func_name}\", ATTR_probeName_str, utime ); 216 226 EOT 217 227 -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/lib/GenHRP2Marshaler.rb
r337 r374 35 35 # の責任を負わない. 36 36 # 37 # $Id$ 37 38 #++ 38 39 -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/lib/GenOpaqueMarshaler.rb
r337 r374 4 4 # Generator for TOPPERS Embedded Component System 5 5 # 6 # Copyright (C) 2008-201 4by TOPPERS Project6 # Copyright (C) 2008-2018 by TOPPERS Project 7 7 #-- 8 8 # 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ … … 464 464 /* Channel Lock */ 465 465 SET_RPC_STATE( state_, RPCSTATE_CLIENT_GET_SEM ); 466 if( is_cLockChannel_joined() ) 467 cLockChannel_wait(); 466 if( is_cLockChannel_joined() ){ 467 if( (ercd_=cLockChannel_wait()) != E_OK ) 468 goto error_reset; 469 } 468 470 EOT 469 471 … … 554 556 /* Channel Unlock */ 555 557 SET_RPC_STATE( state_, RPCSTATE_CLIENT_RELEASE_SEM ); 556 if( is_cLockChannel_joined() ) 557 cLockChannel_signal(); 558 if( is_cLockChannel_joined() ){ 559 if( (ercd_=cLockChannel_signal()) != E_OK ) 560 goto error_reset; 561 } 562 EOT 563 564 file.print <<EOT 565 /* state_ is not used in normal case */ 566 /* below is to avoid 'set but not used' warnning */ 567 (void)state_; 558 568 EOT 559 569 … … 630 640 file.print <<EOT 631 641 }else{ 632 return ;642 return E_ID; 633 643 } 634 644 EOT -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/lib/GenTransparentMarshaler.rb
r337 r374 388 388 }; 389 389 #{ppallocator_dealloc_str} 390 return ;390 return E_OK; 391 391 392 392 error_reset: … … 394 394 (void)cTDR_reset(); 395 395 #{ppallocator_dealloc_str} 396 return E_OK; 396 397 EOT 397 398
Note:
See TracChangeset
for help on using the changeset viewer.