- Timestamp:
- Jul 3, 2020, 7:19:17 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecslib/core/tecsgen.rb
r321 r429 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)の条件を満たす場合に限り,本ソフトウェ … … 41 41 class TECSGEN 42 42 43 @@b_post_coded = false # ポストコード生成開始後 true 44 43 45 #=== import パス (-I) を末尾に追加 44 46 # 既に登録済みであれば、追加しない … … 216 218 end 217 219 220 def self.get_argv 221 ARGV 222 end 223 218 224 #------ TECSGEN CDL analyze and generate ------# 219 225 … … 236 242 end # syntax_analisys 237 243 244 #=== TECSGEN#semantics_analisys_1 245 # semantics check. only cells here 246 # other objects (signature, celltype, typedef, etc ) are checked while syntax analisys 238 247 def semantics_analisys_1 239 248 #### 意味解析1 (post コードを除く) #### 240 249 dbgPrint( "## Creating reverse join \n") 241 250 Cell.create_reverse_join 251 252 DescriptorType.check_signature 253 Signature.set_descriptor_list 254 Celltype.check_dynamic_join 242 255 243 256 #0 set_definition_join は2回呼び出される(1回目) … … 248 261 249 262 #### post コードの生成と構文解析 #### 263 @@b_post_coded = true # ポストコード生成開始後 true 250 264 # 引数がなければ、プラグインのポストコードを出力しない 251 265 if ARGV.length > 0 then … … 283 297 dbgPrint( "## Checking all join (for cells generated by Post Code\n") 284 298 @root_namespace.set_definition_join 299 @root_namespace.set_max_entry_port_inner_cell 285 300 286 301 dbgPrint( "## Set require join\n") … … 438 453 open( "#{$gen_base}/tecsgen.timestamp", "w" ){|io|} 439 454 end # finalize 455 456 def dump_tecsgen_rbdmp 457 dbgPrint "dump_tecsgen_rbdmp 0:\n" 458 #### unjoin_plugin 後に行う必要があるため、コード生成後にダンプを行う 459 #### Region link root ごとにオプティマイズしてダンプ #### 460 Namespace.get_root.unjoin_plugin 461 Namespace.get_root.find_plugin 0, [] 462 463 Region.get_link_roots.each { |region| 464 dbgPrint "dump_tecsgen_rbdmp 1: Region.path_str: #{region.get_namespace_path.get_path_str}\n" 465 466 n_cells = region.get_n_cells 467 468 if $region_list.length > 0 then 469 if $region_list[ region.get_namespace_path.get_path_str ] == false then 470 $region_list[ region.get_namespace_path.get_path_str ] = true 471 else 472 next 473 end 474 end 475 476 dbgPrint "dump_tecsgen_rbdmp 2: Region.path_str: #{region.get_namespace_path.get_path_str}\n" 477 # セルが一つもなければ生成しない 478 # セルの生成がない場合 479 if region.get_n_cells == 0 then 480 # if $region_list.length > 0 then 481 # Generator.warning( "W9999 $1: specified to generate but has no cell", region.get_name ) 482 # end 483 if region != @root_namespace then 484 next 485 end 486 end 487 488 dbgPrint "dump_tecsgen_rbdmp 3: Region.path_str: #{region.get_namespace_path.get_path_str}\n" 489 $generating_region = region 490 if Region.get_link_roots.length > 1 then 491 if region.get_name == "::" then 492 $gen = $gen_base 493 else 494 $gen = $gen_base + "/" + region.get_global_name.to_s 495 end 496 else 497 $gen = $gen_base 498 end 499 500 dbgPrint "dump_tecsgen_rbdmp 4: Region.path_str: #{region.get_namespace_path.get_path_str}\n" 501 dbgPrint( "## Unset optimize variables\n") 502 @root_namespace.reset_optimize # 最適化をリセットする 503 504 # if Generator.get_n_error == 0 then 505 # # エラーが発生していたら、ここへは来ない 506 dbgPrint( "## Set cell id\n") 507 @root_namespace.set_cell_id_and_domain # セルの ID とドメイン情報を設定(linkunit 毎に0からつける) 508 509 # エラーが発生していたら、最適化は実施しない 510 if ! $unopt then 511 dbgPrint( "## Optimizing: Link Region=#{@root_namespace.get_name}\n") 512 @root_namespace.optimize 513 end 514 # end 515 dbgPrint "dump_tecsgen_rbdmp final: Region.path_str: #{region.get_namespace_path.get_path_str}\n" 516 File.write( "#{$gen}/tecsgen.rbdmp", Marshal.dump(Namespace.get_root) ) 517 } 518 end 519 520 def self.post_coded? 521 @@b_post_coded 522 end 440 523 end # class TECSGEN
Note:
See TracChangeset
for help on using the changeset viewer.