tecscde 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +12 -0
- data/.rubocop.yml +125 -0
- data/.rubocop_todo.yml +188 -0
- data/CHANGELOG.md +3 -0
- data/Gemfile +6 -0
- data/LICENSE +46 -0
- data/LICENSE.ja +32 -0
- data/README.ja.md +200 -0
- data/README.md +35 -0
- data/Rakefile +27 -0
- data/bin/tecscde +64 -0
- data/glade/tecscde-cell-property.glade +205 -0
- data/glade/tecscde-celltype-property.glade +172 -0
- data/glade/tecscde-celltype.glade +414 -0
- data/glade/tecscde-export.glade +161 -0
- data/glade/test-cell-plugin.rb +51 -0
- data/glade/test-cell-property.rb +35 -0
- data/glade/test-export.rb +35 -0
- data/glade/test-palette.rb +26 -0
- data/lib/tcflow.rb +148 -0
- data/lib/tecscde.rb +65 -0
- data/lib/tecscde/NewCell.png +0 -0
- data/lib/tecscde/SelectArrow.png +0 -0
- data/lib/tecscde/attr_tree_view.rb +253 -0
- data/lib/tecscde/cell_plugin_dialog.glade +294 -0
- data/lib/tecscde/cell_plugin_dialog.rb +89 -0
- data/lib/tecscde/celltype_tree_view.rb +105 -0
- data/lib/tecscde/change_set_control.rb +35 -0
- data/lib/tecscde/change_set_control/change_set.rb +32 -0
- data/lib/tecscde/change_set_control/change_set_manager.rb +62 -0
- data/lib/tecscde/command.rb +35 -0
- data/lib/tecscde/control.rb +491 -0
- data/lib/tecscde/highlighted_objects.rb +180 -0
- data/lib/tecscde/logger.rb +74 -0
- data/lib/tecscde/main_view_and_model.rb +80 -0
- data/lib/tecscde/palette.glade +553 -0
- data/lib/tecscde/palette.rb +174 -0
- data/lib/tecscde/preferences.glade +117 -0
- data/lib/tecscde/preferences.rb +44 -0
- data/lib/tecscde/tecs_model.rb +1137 -0
- data/lib/tecscde/tecs_model/hbar.rb +68 -0
- data/lib/tecscde/tecs_model/tm_c_port.rb +122 -0
- data/lib/tecscde/tecs_model/tm_c_port_array.rb +98 -0
- data/lib/tecscde/tecs_model/tm_cell.rb +496 -0
- data/lib/tecscde/tecs_model/tm_e_port.rb +126 -0
- data/lib/tecscde/tecs_model/tm_e_port_array.rb +78 -0
- data/lib/tecscde/tecs_model/tm_join.rb +293 -0
- data/lib/tecscde/tecs_model/tm_join_bar.rb +146 -0
- data/lib/tecscde/tecs_model/tm_port.rb +238 -0
- data/lib/tecscde/tecs_model/tm_port_array.rb +246 -0
- data/lib/tecscde/tecs_model/tm_region.rb +107 -0
- data/lib/tecscde/tecs_model/tm_uneditable.rb +68 -0
- data/lib/tecscde/tecs_model/vbar.rb +68 -0
- data/lib/tecscde/templates/_cell_info.cde.erb +15 -0
- data/lib/tecscde/templates/_join_info.cde.erb +28 -0
- data/lib/tecscde/templates/main.cde.erb +49 -0
- data/lib/tecscde/tm_object.rb +91 -0
- data/lib/tecscde/version.rb +4 -0
- data/lib/tecscde/view.rb +58 -0
- data/lib/tecscde/view/cairo_matrix.rb +90 -0
- data/lib/tecscde/view/canvas.rb +59 -0
- data/lib/tecscde/view/constants.rb +114 -0
- data/lib/tecscde/view/main_view.rb +1245 -0
- data/lib/tecsflow.rb +475 -0
- data/lib/tecsflow/C_parser.tab.rb +2471 -0
- data/lib/tecsflow/C_parser.y.rb +1087 -0
- data/lib/tecsflow/classes.rb +421 -0
- data/lib/tecsgen.rb +581 -0
- data/lib/tecsgen/core/C_parser.tab.rb +2477 -0
- data/lib/tecsgen/core/C_parser.y +1032 -0
- data/lib/tecsgen/core/bnf-deb.tab.rb +5193 -0
- data/lib/tecsgen/core/bnf.tab.rb +5193 -0
- data/lib/tecsgen/core/bnf.y +2211 -0
- data/lib/tecsgen/core/componentobj.rb +7901 -0
- data/lib/tecsgen/core/ctypes.rb +226 -0
- data/lib/tecsgen/core/expression.rb +1031 -0
- data/lib/tecsgen/core/gen_xml.rb +374 -0
- data/lib/tecsgen/core/generate.rb +5206 -0
- data/lib/tecsgen/core/location.rb +116 -0
- data/lib/tecsgen/core/messages.rb +101 -0
- data/lib/tecsgen/core/optimize.rb +456 -0
- data/lib/tecsgen/core/plugin.rb +332 -0
- data/lib/tecsgen/core/pluginModule.rb +165 -0
- data/lib/tecsgen/core/syntaxobj.rb +1234 -0
- data/lib/tecsgen/core/tecs_lang.rb +306 -0
- data/lib/tecsgen/core/tecsgen.rb +453 -0
- data/lib/tecsgen/core/tecsinfo.rb +860 -0
- data/lib/tecsgen/core/tool_info.rb +258 -0
- data/lib/tecsgen/core/types.rb +1632 -0
- data/lib/tecsgen/core/unjoin_plugin.rb +218 -0
- data/lib/tecsgen/core/value.rb +650 -0
- data/lib/tecsgen/messages/messages_console_en_US.rb +1171 -0
- data/lib/tecsgen/messages/messages_console_ja_JP.rb +1171 -0
- data/lib/tecsgen/messages/messages_file_en_US.rb +334 -0
- data/lib/tecsgen/messages/messages_file_ja_JP.rb +163 -0
- data/lib/tecsgen/plugin/ATK1AlarmPlugin.rb +196 -0
- data/lib/tecsgen/plugin/ATK1DelayTaskPlugin.rb +106 -0
- data/lib/tecsgen/plugin/ATK1EventPlugin.rb +147 -0
- data/lib/tecsgen/plugin/ATK1ISRPlugin.rb +174 -0
- data/lib/tecsgen/plugin/ATK1KernelPlugin.rb +287 -0
- data/lib/tecsgen/plugin/ATK1ResourcePlugin.rb +124 -0
- data/lib/tecsgen/plugin/ATK1TaskPlugin.rb +220 -0
- data/lib/tecsgen/plugin/C2TECSBridgePlugin.rb +210 -0
- data/lib/tecsgen/plugin/CellPlugin.rb +61 -0
- data/lib/tecsgen/plugin/CelltypePlugin.rb +72 -0
- data/lib/tecsgen/plugin/CompositePlugin.rb +66 -0
- data/lib/tecsgen/plugin/DomainPlugin.rb +89 -0
- data/lib/tecsgen/plugin/HRP2AlarmHandlerPlugin.rb +76 -0
- data/lib/tecsgen/plugin/HRP2Cache.rb +1 -0
- data/lib/tecsgen/plugin/HRP2CyclicHandlerPlugin.rb +75 -0
- data/lib/tecsgen/plugin/HRP2DataqueuePlugin.rb +68 -0
- data/lib/tecsgen/plugin/HRP2EventflagPlugin.rb +68 -0
- data/lib/tecsgen/plugin/HRP2FixedSizeMemoryPoolPlugin.rb +68 -0
- data/lib/tecsgen/plugin/HRP2HandlerPlugin.rb +117 -0
- data/lib/tecsgen/plugin/HRP2KernelObjectPlugin.rb +372 -0
- data/lib/tecsgen/plugin/HRP2ObjectPlugin.rb +94 -0
- data/lib/tecsgen/plugin/HRP2Plugin.rb +140 -0
- data/lib/tecsgen/plugin/HRP2PostHook.rb +111 -0
- data/lib/tecsgen/plugin/HRP2PriorityDataqueuePlugin.rb +66 -0
- data/lib/tecsgen/plugin/HRP2RPCPlugin.rb +319 -0
- data/lib/tecsgen/plugin/HRP2SVCPlugin.rb +473 -0
- data/lib/tecsgen/plugin/HRP2SemaphorePlugin.rb +67 -0
- data/lib/tecsgen/plugin/HRP2TaskPlugin.rb +200 -0
- data/lib/tecsgen/plugin/HRPHandlerPlugin.rb +125 -0
- data/lib/tecsgen/plugin/HRPKernelObjectManager.rb +72 -0
- data/lib/tecsgen/plugin/HRPKernelObjectPlugin.rb +333 -0
- data/lib/tecsgen/plugin/HRPObjectPlugin.rb +93 -0
- data/lib/tecsgen/plugin/HRPPlugin.rb +356 -0
- data/lib/tecsgen/plugin/HRPRPCPlugin.rb +407 -0
- data/lib/tecsgen/plugin/HRPSVCPlugin.rb +859 -0
- data/lib/tecsgen/plugin/HRPTaskPlugin.rb +107 -0
- data/lib/tecsgen/plugin/Mruby2CBridgePlugin.rb +86 -0
- data/lib/tecsgen/plugin/MrubyBridgeCellPlugin.rb +264 -0
- data/lib/tecsgen/plugin/MrubyBridgeCelltypePlugin.rb +293 -0
- data/lib/tecsgen/plugin/MrubyBridgeCompositePlugin.rb +49 -0
- data/lib/tecsgen/plugin/MrubyBridgePlugin.rb +67 -0
- data/lib/tecsgen/plugin/MrubyBridgeSignaturePlugin.rb +1307 -0
- data/lib/tecsgen/plugin/MrubyInfoBridgePlugin.rb +14 -0
- data/lib/tecsgen/plugin/MrubyInfoBridgeSignaturePlugin.rb +994 -0
- data/lib/tecsgen/plugin/MultiPlugin.rb +57 -0
- data/lib/tecsgen/plugin/NotifierPlugin.rb +1217 -0
- data/lib/tecsgen/plugin/OpaqueMarshalerPlugin.rb +81 -0
- data/lib/tecsgen/plugin/OpaqueRPCPlugin.rb +323 -0
- data/lib/tecsgen/plugin/RPCPlugin.rb +266 -0
- data/lib/tecsgen/plugin/RepeatCellPlugin.rb +166 -0
- data/lib/tecsgen/plugin/RepeatJoinPlugin.rb +130 -0
- data/lib/tecsgen/plugin/SharedOpaqueRPCPlugin.rb +357 -0
- data/lib/tecsgen/plugin/SharedRPCPlugin.rb +329 -0
- data/lib/tecsgen/plugin/SignaturePlugin.rb +77 -0
- data/lib/tecsgen/plugin/TECS2CBridgePlugin.rb +178 -0
- data/lib/tecsgen/plugin/TECSInfoPlugin.rb +280 -0
- data/lib/tecsgen/plugin/ThroughPlugin.rb +333 -0
- data/lib/tecsgen/plugin/TracePlugin.rb +484 -0
- data/lib/tecsgen/plugin/lib/GenHRP2Marshaler.rb +761 -0
- data/lib/tecsgen/plugin/lib/GenOpaqueMarshaler.rb +1107 -0
- data/lib/tecsgen/plugin/lib/GenParamCopy.rb +365 -0
- data/lib/tecsgen/plugin/lib/GenTransparentMarshaler.rb +683 -0
- data/lib/tecsgen/plugin/lib/MrubyBridgeCelltypePluginModule.rb +283 -0
- data/lib/tecsgen/plugin/lib/MrubyBridgeSignaturePluginModule.rb +277 -0
- data/lib/tecsgen/version.rb +6 -0
- data/samples/FigureSamples/active/active.cde +104 -0
- data/samples/FigureSamples/active/active.cdl +20 -0
- data/samples/FigureSamples/active/active.pdf +0 -0
- data/samples/FigureSamples/active/active.png +0 -0
- data/samples/FigureSamples/active/gen/tmp_C_src.c +36 -0
- data/samples/FigureSamples/active/gen/tmp_cygwin_tecs.h +1908 -0
- data/samples/FigureSamples/active/gen/tmp_plugin_post_code.cdl +0 -0
- data/samples/FigureSamples/allocator/allocator-internal.png +0 -0
- data/samples/FigureSamples/allocator/allocator.cde +171 -0
- data/samples/FigureSamples/allocator/allocator.cdl +58 -0
- data/samples/FigureSamples/allocator/allocator.png +0 -0
- data/samples/FigureSamples/basic/Makefile +87 -0
- data/samples/FigureSamples/basic/SimpleSample-trace.cdl +50 -0
- data/samples/FigureSamples/basic/SimpleSample.cde +91 -0
- data/samples/FigureSamples/basic/SimpleSample.cdl +47 -0
- data/samples/FigureSamples/basic/basic.cde +93 -0
- data/samples/FigureSamples/basic/basic.cdl +46 -0
- data/samples/FigureSamples/basic/basic.png +0 -0
- data/samples/FigureSamples/callback/callback.cde +130 -0
- data/samples/FigureSamples/callback/callback.cdl +29 -0
- data/samples/FigureSamples/callback/callback.png +0 -0
- data/samples/FigureSamples/carray/carray.cde +144 -0
- data/samples/FigureSamples/carray/carray.cdl +38 -0
- data/samples/FigureSamples/carray/carray.png +0 -0
- data/samples/FigureSamples/cearray/cearray.cde +314 -0
- data/samples/FigureSamples/cearray/cearray.cdl +60 -0
- data/samples/FigureSamples/cearray/cearray.png +0 -0
- data/samples/FigureSamples/composite/composite-internal.png +0 -0
- data/samples/FigureSamples/composite/composite.cde +216 -0
- data/samples/FigureSamples/composite/composite.cdl +95 -0
- data/samples/FigureSamples/composite/composite.png +0 -0
- data/samples/FigureSamples/earray/earray.cde +142 -0
- data/samples/FigureSamples/earray/earray.cdl +38 -0
- data/samples/FigureSamples/earray/earray.png +0 -0
- data/samples/FigureSamples/join/Makefile +87 -0
- data/samples/FigureSamples/join/join.cde +132 -0
- data/samples/FigureSamples/join/join.cdl +40 -0
- data/samples/FigureSamples/join/join.png +0 -0
- data/samples/FigureSamples/relay/Makefile +99 -0
- data/samples/FigureSamples/relay/relay-internal.png +0 -0
- data/samples/FigureSamples/relay/relay.cde +284 -0
- data/samples/FigureSamples/relay/relay.cdl +52 -0
- data/samples/FigureSamples/relay/relay.png +0 -0
- data/samples/FigureSamples/rpc/Makefile +123 -0
- data/samples/FigureSamples/rpc/rpc-expand.png +0 -0
- data/samples/FigureSamples/rpc/rpc.cde +245 -0
- data/samples/FigureSamples/rpc/rpc.png +0 -0
- data/samples/FigureSamples/rpc/rpc_sample.cdl +53 -0
- data/samples/SimpleSample/Makefile +25 -0
- data/samples/SimpleSample/SimpleSample/Makefile +86 -0
- data/samples/SimpleSample/SimpleSample/Makefile-trace +91 -0
- data/samples/SimpleSample/SimpleSample/README.txt +106 -0
- data/samples/SimpleSample/SimpleSample/SimpleSample-trace.cdl +50 -0
- data/samples/SimpleSample/SimpleSample/SimpleSample.cdl +45 -0
- data/samples/SimpleSample/SimpleSample/src/tSample.c +77 -0
- data/samples/SimpleSample/SimpleSample/src/tSimple.c +48 -0
- data/samples/SimpleSample/SimpleSample/src/tecs-types.h +27 -0
- data/samples/SimpleSample/SimpleSampleOpaqueRPC/Makefile +51 -0
- data/samples/SimpleSample/SimpleSampleOpaqueRPC/Makefile-trace +91 -0
- data/samples/SimpleSample/SimpleSampleOpaqueRPC/README.txt +106 -0
- data/samples/SimpleSample/SimpleSampleOpaqueRPC/SimpleSample-trace.cdl +80 -0
- data/samples/SimpleSample/SimpleSampleOpaqueRPC/SimpleSample.cdl +77 -0
- data/samples/SimpleSample/SimpleSampleOpaqueRPC/rSample/Makefile +112 -0
- data/samples/SimpleSample/SimpleSampleOpaqueRPC/rSimple/Makefile +109 -0
- data/samples/SimpleSample/SimpleSampleOpaqueRPC/src/tSample.c +80 -0
- data/samples/SimpleSample/SimpleSampleOpaqueRPC/src/tSimple.c +47 -0
- data/samples/SimpleSample/SimpleSampleOpaqueRPC/src/tTaskMain.c +66 -0
- data/samples/SimpleSample/SimpleSampleOpaqueRPC/src/tecs-types.h +27 -0
- data/samples/SimpleSample/SimpleSampleTransparentRPC/Makefile +125 -0
- data/samples/SimpleSample/SimpleSampleTransparentRPC/Makefile-trace +130 -0
- data/samples/SimpleSample/SimpleSampleTransparentRPC/SimpleSample-trace.cdl +54 -0
- data/samples/SimpleSample/SimpleSampleTransparentRPC/SimpleSample.cdl +53 -0
- data/samples/SimpleSample/SimpleSampleTransparentRPC/src/tSample.c +80 -0
- data/samples/SimpleSample/SimpleSampleTransparentRPC/src/tSimple.c +54 -0
- data/tecscde.gemspec +41 -0
- metadata +353 -0
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
#
|
|
2
|
+
# TECS Generator Cell-type plugin
|
|
3
|
+
# for TOPPERS Embedded Component System
|
|
4
|
+
#
|
|
5
|
+
# Copyright (C) 2008-2014 by TOPPERS Project TECS-WG
|
|
6
|
+
#--
|
|
7
|
+
# 上記著作権者は,以下の(1)〜(4)の条件を満たす場合に限り,本ソフトウェ
|
|
8
|
+
# ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改
|
|
9
|
+
# 変・再配布(以下,利用と呼ぶ)することを無償で許諾する.
|
|
10
|
+
# (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作
|
|
11
|
+
# 権表示,この利用条件および下記の無保証規定が,そのままの形でソー
|
|
12
|
+
# スコード中に含まれていること.
|
|
13
|
+
# (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使
|
|
14
|
+
# 用できる形で再配布する場合には,再配布に伴うドキュメント(利用
|
|
15
|
+
# 者マニュアルなど)に,上記の著作権表示,この利用条件および下記
|
|
16
|
+
# の無保証規定を掲載すること.
|
|
17
|
+
# (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使
|
|
18
|
+
# 用できない形で再配布する場合には,次のいずれかの条件を満たすこ
|
|
19
|
+
# と.
|
|
20
|
+
# (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著
|
|
21
|
+
# 作権表示,この利用条件および下記の無保証規定を掲載すること.
|
|
22
|
+
# (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに
|
|
23
|
+
# 報告すること.
|
|
24
|
+
# (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損
|
|
25
|
+
# 害からも,上記著作権者およびTOPPERSプロジェクトを免責すること.
|
|
26
|
+
# また,本ソフトウェアのユーザまたはエンドユーザからのいかなる理
|
|
27
|
+
# 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを
|
|
28
|
+
# 免責すること.
|
|
29
|
+
#
|
|
30
|
+
# 本ソフトウェアは,無保証で提供されているものである.上記著作権者お
|
|
31
|
+
# よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的
|
|
32
|
+
# に対する適合性も含めて,いかなる保証も行わない.また,本ソフトウェ
|
|
33
|
+
# アの利用により直接的または間接的に生じたいかなる損害に関しても,そ
|
|
34
|
+
# の責任を負わない.
|
|
35
|
+
#
|
|
36
|
+
# $Id: ATK1ISRPlugin.rb 2955 2018-05-07 10:23:26Z okuma-top $
|
|
37
|
+
#++
|
|
38
|
+
|
|
39
|
+
#== celltype プラグインの共通の親クラス
|
|
40
|
+
class ATK1ISRPlugin < CelltypePlugin
|
|
41
|
+
# @celltype:: Celltype
|
|
42
|
+
# @option:: String :オプション文字列
|
|
43
|
+
|
|
44
|
+
# signature:: Celltype シグニチャ(インスタンス)
|
|
45
|
+
def initialize(celltype, option)
|
|
46
|
+
super
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
#=== CDL ファイルの生成
|
|
50
|
+
# typedef, signature, celltype, cell のコードを生成
|
|
51
|
+
# 重複して生成してはならない
|
|
52
|
+
# すでに生成されている場合は出力しないこと。
|
|
53
|
+
# もしくは同名の import により、重複を避けること。
|
|
54
|
+
# file:: FILE 生成するファイル
|
|
55
|
+
# def gen_cdl_file file
|
|
56
|
+
# end
|
|
57
|
+
|
|
58
|
+
def new_cell(cell)
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
#=== 受け口関数の本体(C言語)を生成する
|
|
62
|
+
# このメソッドが未定義の場合、ジェネレータは受け口関数のテンプレートを生成する
|
|
63
|
+
# このメソッドが定義済みの場合、(テンプレートではなく、変更する必要のない)セルタイプコードを生成する
|
|
64
|
+
# file:: FILE 出力先ファイル
|
|
65
|
+
# b_singleton:: bool true if singleton
|
|
66
|
+
# ct_name:: Symbol
|
|
67
|
+
# global_ct_name:: string
|
|
68
|
+
# sig_name:: string
|
|
69
|
+
# ep_name:: string
|
|
70
|
+
# func_name:: string
|
|
71
|
+
# func_global_name:: string
|
|
72
|
+
# func_type:: class derived from Type
|
|
73
|
+
# def gen_ep_func_body( file, b_singleton, ct_name, global_ct_name, sig_name, ep_name, func_name, func_global_name, func_type, params )
|
|
74
|
+
# end
|
|
75
|
+
|
|
76
|
+
def gen_factory(file)
|
|
77
|
+
file2 = CFile.open("#{$gen}/ISR_tecsgen.oil", "w")
|
|
78
|
+
|
|
79
|
+
# ISR
|
|
80
|
+
@celltype.get_cell_list.each {|cell|
|
|
81
|
+
|
|
82
|
+
if cell.is_generate?
|
|
83
|
+
|
|
84
|
+
file2.print "\tISR #{cell.get_name} {\n"
|
|
85
|
+
|
|
86
|
+
# CATEGORY
|
|
87
|
+
join = cell.get_join_list.get_item(:category)
|
|
88
|
+
if join
|
|
89
|
+
file2.print "\t\tCATEGORY = #{join.get_rhs};\n"
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
# PRIORITY
|
|
93
|
+
join = cell.get_join_list.get_item(:priority)
|
|
94
|
+
if join
|
|
95
|
+
file2.print "\t\tPRIORITY = #{join.get_rhs};\n"
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# ENTRY (entryはtecsgenの予約語のためNumberを付加)
|
|
99
|
+
join = cell.get_join_list.get_item(:entryNumber)
|
|
100
|
+
if join
|
|
101
|
+
file2.print "\t\tENTRY = #{join.get_rhs};\n"
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
# RESOURCE
|
|
105
|
+
join2 = cell.get_join_list.get_item(:resource)
|
|
106
|
+
delim = ""
|
|
107
|
+
if join2
|
|
108
|
+
join2.get_rhs.each {|res|
|
|
109
|
+
str = res.to_s.gsub(/^"(.*)"$/, '\1')
|
|
110
|
+
file2.print "\t\tRESOURCE = #{str};\n"
|
|
111
|
+
delim = ";"
|
|
112
|
+
}
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
# MESSAGE
|
|
116
|
+
join2 = cell.get_join_list.get_item(:message)
|
|
117
|
+
delim = ""
|
|
118
|
+
if join2
|
|
119
|
+
join2.get_rhs.each {|msg|
|
|
120
|
+
str = msg.to_s.gsub(/^"(.*)"$/, '\1')
|
|
121
|
+
file2.print "\t\tMESSAGE = #{str};\n"
|
|
122
|
+
delim = ";"
|
|
123
|
+
}
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
file2.print "\t};\n"
|
|
127
|
+
file2.print "\n"
|
|
128
|
+
|
|
129
|
+
end
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
file2.close
|
|
133
|
+
|
|
134
|
+
# 追記するために AppFile を使う(文字コード変換されない)
|
|
135
|
+
file = AppFile.open("#{$gen}/tISR_tecsgen.#{$c_suffix}")
|
|
136
|
+
file.print "\n/* Generated by ATK1ISRPlugin */\n"
|
|
137
|
+
@celltype.get_cell_list.each {|cell|
|
|
138
|
+
if cell.is_generate?
|
|
139
|
+
name_array = @celltype.get_name_array(cell)
|
|
140
|
+
join2 = cell.get_join_list.get_item(:category)
|
|
141
|
+
if join2
|
|
142
|
+
str = join2.get_rhs.to_s
|
|
143
|
+
if str == "1"
|
|
144
|
+
file.print <<EOT
|
|
145
|
+
#if defined( OMIT_ISR1_ENTRY )
|
|
146
|
+
EOT
|
|
147
|
+
file.print "/* ISR1入り口未生成時は本関数を割込み関数指定する */\n"
|
|
148
|
+
file.print <<EOT
|
|
149
|
+
#pragma INTERRUPT #{cell.get_name}
|
|
150
|
+
#endif /* OMIT_ISR1_ENTRY */
|
|
151
|
+
void RxHwSerialInt( void );
|
|
152
|
+
void
|
|
153
|
+
RxHwSerialInt( void )
|
|
154
|
+
EOT
|
|
155
|
+
else
|
|
156
|
+
file.print <<EOT
|
|
157
|
+
ISR(#{cell.get_name})
|
|
158
|
+
EOT
|
|
159
|
+
end
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
file.print <<EOT
|
|
163
|
+
{
|
|
164
|
+
CELLCB *p_cellcb = #{name_array[8]};
|
|
165
|
+
cBody_main();
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
EOT
|
|
169
|
+
end
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
file.close
|
|
173
|
+
end
|
|
174
|
+
end
|
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
#
|
|
2
|
+
# TECS Generator Cell-type plugin
|
|
3
|
+
# for TOPPERS Embedded Component System
|
|
4
|
+
#
|
|
5
|
+
# Copyright (C) 2008-2014 by TOPPERS Project TECS-WG
|
|
6
|
+
#--
|
|
7
|
+
# 上記著作権者は,以下の(1)〜(4)の条件を満たす場合に限り,本ソフトウェ
|
|
8
|
+
# ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改
|
|
9
|
+
# 変・再配布(以下,利用と呼ぶ)することを無償で許諾する.
|
|
10
|
+
# (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作
|
|
11
|
+
# 権表示,この利用条件および下記の無保証規定が,そのままの形でソー
|
|
12
|
+
# スコード中に含まれていること.
|
|
13
|
+
# (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使
|
|
14
|
+
# 用できる形で再配布する場合には,再配布に伴うドキュメント(利用
|
|
15
|
+
# 者マニュアルなど)に,上記の著作権表示,この利用条件および下記
|
|
16
|
+
# の無保証規定を掲載すること.
|
|
17
|
+
# (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使
|
|
18
|
+
# 用できない形で再配布する場合には,次のいずれかの条件を満たすこ
|
|
19
|
+
# と.
|
|
20
|
+
# (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著
|
|
21
|
+
# 作権表示,この利用条件および下記の無保証規定を掲載すること.
|
|
22
|
+
# (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに
|
|
23
|
+
# 報告すること.
|
|
24
|
+
# (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損
|
|
25
|
+
# 害からも,上記著作権者およびTOPPERSプロジェクトを免責すること.
|
|
26
|
+
# また,本ソフトウェアのユーザまたはエンドユーザからのいかなる理
|
|
27
|
+
# 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを
|
|
28
|
+
# 免責すること.
|
|
29
|
+
#
|
|
30
|
+
# 本ソフトウェアは,無保証で提供されているものである.上記著作権者お
|
|
31
|
+
# よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的
|
|
32
|
+
# に対する適合性も含めて,いかなる保証も行わない.また,本ソフトウェ
|
|
33
|
+
# アの利用により直接的または間接的に生じたいかなる損害に関しても,そ
|
|
34
|
+
# の責任を負わない.
|
|
35
|
+
#
|
|
36
|
+
# $Id: ATK1KernelPlugin.rb 2955 2018-05-07 10:23:26Z okuma-top $
|
|
37
|
+
#++
|
|
38
|
+
|
|
39
|
+
#== celltype プラグインの共通の親クラス
|
|
40
|
+
class ATK1KernelPlugin < CelltypePlugin
|
|
41
|
+
# @celltype:: Celltype
|
|
42
|
+
# @option:: String :オプション文字列
|
|
43
|
+
@@cell_list = []
|
|
44
|
+
|
|
45
|
+
# signature:: Celltype シグニチャ(インスタンス)
|
|
46
|
+
def initialize(celltype, option)
|
|
47
|
+
super
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
#=== CDL ファイルの生成
|
|
51
|
+
# typedef, signature, celltype, cell のコードを生成
|
|
52
|
+
# 重複して生成してはならない
|
|
53
|
+
# すでに生成されている場合は出力しないこと。
|
|
54
|
+
# もしくは同名の import により、重複を避けること。
|
|
55
|
+
# file:: FILE 生成するファイル
|
|
56
|
+
# def gen_cdl_file file
|
|
57
|
+
# end
|
|
58
|
+
|
|
59
|
+
def new_cell(cell)
|
|
60
|
+
# join_list = cell.get_join_list
|
|
61
|
+
# a = join_list.get_item( :resource )
|
|
62
|
+
# if a == nil
|
|
63
|
+
# Generator.error( "resource: must be initialized")
|
|
64
|
+
# elsif ! a.get_rhs.instance_of? Array
|
|
65
|
+
# Generator.error( "resource: initializer must be in format of '{val1, val2 ...}'")
|
|
66
|
+
# end
|
|
67
|
+
@@cell_list << cell
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
#=== 受け口関数の本体(C言語)を生成する
|
|
71
|
+
# このメソッドが未定義の場合、ジェネレータは受け口関数のテンプレートを生成する
|
|
72
|
+
# このメソッドが定義済みの場合、(テンプレートではなく、変更する必要のない)セルタイプコードを生成する
|
|
73
|
+
# file:: FILE 出力先ファイル
|
|
74
|
+
# b_singleton:: bool true if singleton
|
|
75
|
+
# ct_name:: Symbol
|
|
76
|
+
# global_ct_name:: string
|
|
77
|
+
# sig_name:: string
|
|
78
|
+
# ep_name:: string
|
|
79
|
+
# func_name:: string
|
|
80
|
+
# func_global_name:: string
|
|
81
|
+
# func_type:: class derived from Type
|
|
82
|
+
# def gen_ep_func_body( file, b_singleton, ct_name, global_ct_name, sig_name, ep_name, func_name, func_global_name, func_type, params )
|
|
83
|
+
# end
|
|
84
|
+
|
|
85
|
+
def gen_factory(file)
|
|
86
|
+
file2 = CFile.open("#{$gen}/Kernel_tecsgen.oil", "w")
|
|
87
|
+
|
|
88
|
+
# Kernel
|
|
89
|
+
@celltype.get_cell_list.each {|cell|
|
|
90
|
+
|
|
91
|
+
if cell.is_generate?
|
|
92
|
+
|
|
93
|
+
file2.print "\tOS #{cell.get_name} {\n"
|
|
94
|
+
|
|
95
|
+
# STATUS
|
|
96
|
+
join = cell.get_join_list.get_item(:status)
|
|
97
|
+
if join
|
|
98
|
+
str = join.get_rhs.to_s.gsub(/^"(.*)"$/, '\1')
|
|
99
|
+
file2.print "\t\tSTATUS = #{str};\n"
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
# STARTUPHOOK
|
|
103
|
+
join = cell.get_join_list.get_item(:useStartupHook)
|
|
104
|
+
if join
|
|
105
|
+
str = join.get_rhs.to_s
|
|
106
|
+
file2.print "\t\tSTARTUPHOOK = #{str};\n"
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# ERRORHOOK
|
|
110
|
+
join = cell.get_join_list.get_item(:useErrorHook)
|
|
111
|
+
if join
|
|
112
|
+
str = join.get_rhs.to_s
|
|
113
|
+
file2.print "\t\tERRORHOOK = #{str};\n"
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
# SHUTDOWNHOOK
|
|
117
|
+
join = cell.get_join_list.get_item(:useShutdownHook)
|
|
118
|
+
if join
|
|
119
|
+
str = join.get_rhs.to_s
|
|
120
|
+
file2.print "\t\tSHUTDOWNHOOK = #{str};\n"
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
# PRETASKHOOK
|
|
124
|
+
join = cell.get_join_list.get_item(:usePreTaskHook)
|
|
125
|
+
if join
|
|
126
|
+
str = join.get_rhs.to_s
|
|
127
|
+
file2.print "\t\tPRETASKHOOK = #{str};\n"
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
# POSTASKHOOK
|
|
131
|
+
join = cell.get_join_list.get_item(:usePostTaskHook)
|
|
132
|
+
if join
|
|
133
|
+
str = join.get_rhs.to_s
|
|
134
|
+
file2.print "\t\tPOSTTASKHOOK = #{str};\n"
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
# USEGETSERVICEID
|
|
138
|
+
join = cell.get_join_list.get_item(:useGetServiceId)
|
|
139
|
+
if join
|
|
140
|
+
str = join.get_rhs.to_s
|
|
141
|
+
file2.print "\t\tUSEGETSERVICEID = #{str};\n"
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
# USEPARAMETERACCESS
|
|
145
|
+
join = cell.get_join_list.get_item(:useParameterAccess)
|
|
146
|
+
if join
|
|
147
|
+
str = join.get_rhs.to_s
|
|
148
|
+
file2.print "\t\tUSEPARAMETERACCESS = #{str};\n"
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
# USERESSCHEDULER
|
|
152
|
+
join = cell.get_join_list.get_item(:useResourceScheduler)
|
|
153
|
+
if join
|
|
154
|
+
str = join.get_rhs.to_s
|
|
155
|
+
file2.print "\t\tUSERESSCHEDULER = #{str};\n"
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
file2.print "\t};\n\n"
|
|
159
|
+
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
file2.close
|
|
165
|
+
|
|
166
|
+
# 追記するために AppFile を使う(文字コード変換されない)
|
|
167
|
+
file2 = AppFile.open("#{$gen}/tKernel_tecsgen.#{$c_suffix}")
|
|
168
|
+
file2.print "\n/* Generated by ATK1KernelPlugin */\n\n"
|
|
169
|
+
@celltype.get_cell_list.each {|cell|
|
|
170
|
+
if cell.is_generate?
|
|
171
|
+
name_array = @celltype.get_name_array(cell)
|
|
172
|
+
|
|
173
|
+
join = cell.get_join_list.get_item(:useStartupHook)
|
|
174
|
+
if join
|
|
175
|
+
str = join.get_rhs.to_s
|
|
176
|
+
if str == "TRUE"
|
|
177
|
+
file2.print <<EOT
|
|
178
|
+
#ifdef USE_STARTUPHOOK
|
|
179
|
+
void StartupHook(void)
|
|
180
|
+
{
|
|
181
|
+
/* CELLCB *p_cellcb = #{name_array[8]}; */
|
|
182
|
+
INT32 i;
|
|
183
|
+
for(i = 0; i < N_CP_cStartupHookBody; i++){
|
|
184
|
+
cStartupHookBody_main(i);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
#endif /* USE_STARTUPHOOK */
|
|
188
|
+
EOT
|
|
189
|
+
end
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
join = cell.get_join_list.get_item(:useErrorHook)
|
|
193
|
+
if join
|
|
194
|
+
str = join.get_rhs.to_s
|
|
195
|
+
if str == "TRUE"
|
|
196
|
+
file2.print <<EOT
|
|
197
|
+
#ifdef USE_ERRORHOOK
|
|
198
|
+
void ErrorHook(StatusType ercd)
|
|
199
|
+
{
|
|
200
|
+
/* CELLCB *p_cellcb = #{name_array[8]}; */
|
|
201
|
+
cErrorHookBody_main( ercd );
|
|
202
|
+
}
|
|
203
|
+
#endif /* USE_ERRORHOOK */
|
|
204
|
+
|
|
205
|
+
EOT
|
|
206
|
+
end
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
join = cell.get_join_list.get_item(:useShutdownHook)
|
|
210
|
+
if join
|
|
211
|
+
str = join.get_rhs.to_s
|
|
212
|
+
if str == "TRUE"
|
|
213
|
+
file2.print <<EOT
|
|
214
|
+
#ifdef USE_SHUTDOWNHOOK
|
|
215
|
+
void ShutdownHook(StatusType ercd)
|
|
216
|
+
{
|
|
217
|
+
/* CELLCB *p_cellcb = #{name_array[8]}; */
|
|
218
|
+
INT32 i;
|
|
219
|
+
for(i = 0; i < N_CP_cShutdownHookBody; i++){
|
|
220
|
+
cShutdownHookBody_main( i, ercd );
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
#endif /* USE_SHUTDOWNHOOK */
|
|
224
|
+
|
|
225
|
+
EOT
|
|
226
|
+
end
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
join = cell.get_join_list.get_item(:usePreTaskHook)
|
|
230
|
+
if join
|
|
231
|
+
str = join.get_rhs.to_s
|
|
232
|
+
if str == "TRUE"
|
|
233
|
+
file2.print <<EOT
|
|
234
|
+
#ifdef USE_PRETASKHOOK
|
|
235
|
+
void PreTaskHook(void)
|
|
236
|
+
{
|
|
237
|
+
/* CELLCB *p_cellcb = #{name_array[8]}; */
|
|
238
|
+
cPreTaskHookBody_main();
|
|
239
|
+
}
|
|
240
|
+
#endif /* USE_PRETASKHOOK */
|
|
241
|
+
|
|
242
|
+
EOT
|
|
243
|
+
end
|
|
244
|
+
end
|
|
245
|
+
|
|
246
|
+
join = cell.get_join_list.get_item(:usePostTaskHook)
|
|
247
|
+
if join
|
|
248
|
+
str = join.get_rhs.to_s
|
|
249
|
+
if str == "TRUE"
|
|
250
|
+
file2.print <<EOT
|
|
251
|
+
#ifdef USE_POSTTASKHOOK
|
|
252
|
+
void PostTaskHook(void)
|
|
253
|
+
{
|
|
254
|
+
/* CELLCB *p_cellcb = #{name_array[8]}; */
|
|
255
|
+
cPostTaskHookBody_main();
|
|
256
|
+
}
|
|
257
|
+
#endif /* USE_POSTTASKHOOK */
|
|
258
|
+
|
|
259
|
+
EOT
|
|
260
|
+
end
|
|
261
|
+
end
|
|
262
|
+
|
|
263
|
+
end
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
file2.close
|
|
267
|
+
end
|
|
268
|
+
|
|
269
|
+
def self.gen_post_code(file)
|
|
270
|
+
@@cell_list.each {|cell|
|
|
271
|
+
join = cell.get_join_list.get_item(:useResourceScheduler)
|
|
272
|
+
if join
|
|
273
|
+
flag = join.get_rhs.to_s
|
|
274
|
+
if flag == "TRUE"
|
|
275
|
+
file.print <<EOT
|
|
276
|
+
cell tResource RES_SCHEDULER {
|
|
277
|
+
property = "STANDARD";
|
|
278
|
+
};
|
|
279
|
+
EOT
|
|
280
|
+
else
|
|
281
|
+
file.print <<EOT
|
|
282
|
+
EOT
|
|
283
|
+
end
|
|
284
|
+
end
|
|
285
|
+
}
|
|
286
|
+
end
|
|
287
|
+
end
|