Method: NotifierPlugin::AdapterGenerator::EntryPort#generate_inner
- Defined in:
- lib/tecsgen/plugin/NotifierPlugin.rb
#generate_inner(context, fn_name, cell, subscript, callee_ct = nil) ⇒ Object
結合先の情報に応じたアダプタ関数をソース・ヘッダーに出力する.一般化指定は,cellまたはsubscriptの一方のみ行うことができる.
166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 |
# File 'lib/tecsgen/plugin/NotifierPlugin.rb', line 166 def generate_inner(context, fn_name, cell, subscript, callee_ct=nil) source_file = context.source_file header_file = context.header_file source_file.print "void #{fn_name}(intptr_t extinf) {\n" params = [] ct = @port.get_celltype # シングルトンセルタイプ以外では,CELLIDXの指定が必要. unless ct.is_singleton? if cell == :generic params << "(#{callee_ct.get_global_name}_IDX)extinf" # params << "(CELLIDX)extinf" else # セルのCELLIDXを得る if ct.has_INIB? || ct.has_CB? params << ct.get_name_array(cell)[7] else params << "0" end end end # 受け口配列の添字. if @port.get_array_size if subscript == :generic params << "(int_t)extinf" else params << subscript.to_s end end params_str = params.join(", ") source_file.print "\t#{@entry_fn_name}(#{params_str});\n" source_file.print "}\n\n" header_file.print "extern void #{fn_name}(intptr_t extinf);\n\n" end |