Class: ATK1ISRPlugin

Inherits:
CelltypePlugin show all
Defined in:
lib/tecsgen/plugin/ATK1ISRPlugin.rb

Overview

celltype プラグインの共通の親クラス

Constant Summary

Constants inherited from Plugin

Plugin::PluginArgProc

Instance Method Summary collapse

Methods inherited from CelltypePlugin

gen_post_code

Methods inherited from Plugin

#cdl_error, #check_plugin_arg, #gen_cdl_file, #gen_ep_func?, #gen_postamble, #gen_preamble, #parse_plugin_arg, #print_msg, #set_locale, #set_silent

Methods inherited from Node

#cdl_error, #cdl_error2, #cdl_error3, #cdl_info, #cdl_info2, #cdl_warning, #cdl_warning2, #get_locale, #locale_str, #set_locale

Constructor Details

#initialize(celltype, option) ⇒ ATK1ISRPlugin

signature

Celltype シグニチャ(インスタンス)



45
46
47
# File 'lib/tecsgen/plugin/ATK1ISRPlugin.rb', line 45

def initialize(celltype, option)
  super
end

Instance Method Details

#gen_factory(file) ⇒ Object

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 )

end


76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
# File 'lib/tecsgen/plugin/ATK1ISRPlugin.rb', line 76

def gen_factory(file)
  file2 = CFile.open("#{$gen}/ISR_tecsgen.oil", "w")

  # ISR
  @celltype.get_cell_list.each {|cell|

  if cell.is_generate?

    file2.print "\tISR #{cell.get_name} {\n"

    # CATEGORY
    join = cell.get_join_list.get_item(:category)
    if join
      file2.print "\t\tCATEGORY = #{join.get_rhs};\n"
    end

    # PRIORITY
    join = cell.get_join_list.get_item(:priority)
    if join
      file2.print "\t\tPRIORITY = #{join.get_rhs};\n"
    end

    # ENTRY (entryはtecsgenの予約語のためNumberを付加)
    join = cell.get_join_list.get_item(:entryNumber)
    if join
      file2.print "\t\tENTRY = #{join.get_rhs};\n"
    end

    # RESOURCE
    join2 = cell.get_join_list.get_item(:resource)
    delim = ""
    if join2
      join2.get_rhs.each {|res|
        str = res.to_s.gsub(/^"(.*)"$/, '\1')
        file2.print "\t\tRESOURCE = #{str};\n"
        delim = ";"
      }
    end

    # MESSAGE
    join2 = cell.get_join_list.get_item(:message)
    delim = ""
    if join2
      join2.get_rhs.each {|msg|
        str = msg.to_s.gsub(/^"(.*)"$/, '\1')
        file2.print "\t\tMESSAGE = #{str};\n"
        delim = ";"
      }
    end

    file2.print "\t};\n"
    file2.print "\n"

  end
}

file2.close

# 追記するために AppFile を使う(文字コード変換されない)
file = AppFile.open("#{$gen}/tISR_tecsgen.#{$c_suffix}")
file.print "\n/* Generated by ATK1ISRPlugin */\n"
@celltype.get_cell_list.each {|cell|
  if cell.is_generate?
    name_array = @celltype.get_name_array(cell)
    join2 = cell.get_join_list.get_item(:category)
    if join2
      str = join2.get_rhs.to_s
      if str == "1"
        file.print <<EOT
#if defined( OMIT_ISR1_ENTRY )
EOT
        file.print "/* ISR1入り口未生成時は本関数を割込み関数指定する  */\n"
        file.print <<EOT
#pragma INTERRUPT  #{cell.get_name}
#endif  /* OMIT_ISR1_ENTRY  */
void  RxHwSerialInt( void );
void
RxHwSerialInt( void )
EOT
      else
        file.print <<EOT
ISR(#{cell.get_name})
EOT
      end
    end

    file.print <<EOT
{
  CELLCB *p_cellcb = #{name_array[8]};
  cBody_main();
}

EOT
  end
}

file.close
end

#new_cell(cell) ⇒ Object

def gen_cdl_file file

end


58
59
# File 'lib/tecsgen/plugin/ATK1ISRPlugin.rb', line 58

def new_cell(cell)
end