Changeset 429
- Timestamp:
- Jul 3, 2020, 7:19:17 PM (4 years ago)
- Location:
- EcnlProtoTool/trunk
- Files:
-
- 251 added
- 8 deleted
- 353 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
EcnlProtoTool/trunk/asp3_dcre/.cproject
r426 r429 49 49 <option id="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.createflash.1804182567" name="Create flash image" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.createflash" value="true" valueType="boolean"/> 50 50 <targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="ilg.gnuarmeclipse.managedbuild.cross.targetPlatform.74647507" isAbstract="false" osList="all" superClass="ilg.gnuarmeclipse.managedbuild.cross.targetPlatform"/> 51 <builder buildPath="${workspace_loc:/asp3_dcre}/Debug" id="com.renesas.cdt.managedbuild.gcc.rz.builder.460934776" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="GCC for Renesas Builder" superClass="com.renesas.cdt.managedbuild.gcc.rz.builder"/>51 <builder buildPath="${workspace_loc:/asp3_dcre}/Debug" id="com.renesas.cdt.managedbuild.gcc.rz.builder.460934776" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="GCC for Renesas Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.renesas.cdt.managedbuild.gcc.rz.builder"/> 52 52 <tool id="com.renesas.cdt.managedbuild.gcc.rz.tool.assembler.1682623852" name="Cross ARM GNU Assembler" superClass="com.renesas.cdt.managedbuild.gcc.rz.tool.assembler"> 53 53 <option id="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.usepreprocessor.1607103230" name="Use preprocessor" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.usepreprocessor" value="true" valueType="boolean"/> … … 94 94 <option id="toolchain.id" value="gcc-arm-embedded"/> 95 95 <option id="toolchain.version" value="6.3.1.20170620"/> 96 <option id="toolchain.enable" value="true"/> 96 97 </storageModule> 97 98 </cconfiguration> … … 112 113 </configuration> 113 114 </storageModule> 115 <storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/> 114 116 </cproject> -
EcnlProtoTool/trunk/asp3_dcre/Debug/Makefile
r424 r429 6 6 # Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory 7 7 # Toyohashi Univ. of Technology, JAPAN 8 # Copyright (C) 2006-201 6by Embedded and Real-Time Systems Laboratory8 # Copyright (C) 2006-2019 by Embedded and Real-Time Systems Laboratory 9 9 # Graduate School of Information Science, Nagoya Univ., JAPAN 10 10 # … … 81 81 82 82 # 83 # システムサービスコールライブラリ(libsyssvc.a)のディレクトリ名 84 # (システムサービスコールライブラリもmake対象にする時は,空に定義する) 85 # 86 SYSSVC_LIB = 87 88 # 83 89 # カーネルを関数単位でコンパイルするかどうかの定義 84 90 # … … 89 95 # 90 96 OMIT_TECS = 97 98 # 99 # TECS関係ファイルのディレクトリの定義 100 # 101 TECSDIR = 91 102 92 103 # … … 119 130 120 131 # 121 # 依存関係ファイルを置くディレクトリの定義 122 # 123 DEPDIR = deps 132 # 中間オブジェクトファイルと依存関係ファイルを置くディレクトリの定義 133 # 134 OBJDIR = obj 135 DEPDIR = obj 124 136 125 137 # … … 150 162 endif 151 163 164 TINETDIR = tinet 165 152 166 # 153 167 # mbedサービスの定義 … … 159 173 # 共通コンパイルオプションの定義 160 174 # 161 COPTS := -g -std=gnu99 $(COPTS)175 COPTS := -g -std=gnu99 -ffunction-sections -fdata-sections $(COPTS) 162 176 ifndef OMIT_WARNING_ALL 163 177 COPTS := -Wall $(COPTS) … … 171 185 CDEFS := $(CDEFS) 172 186 INCLUDES := -I. -I$(SRCDIR)/include $(INCLUDES) -I$(SRCDIR) 173 LDFLAGS := $(LDFLAGS) - Wl,-Map=$(OBJNAME).map,--cref187 LDFLAGS := $(LDFLAGS) -L. 174 188 LIBS := $(LIBS) $(CXXLIBS) 175 189 CFLAGS = $(COPTS) $(CDEFS) $(INCLUDES) … … 191 205 APPL_COBJS := sample1n.o sample1.o 192 206 endif 193 APPL_COBJS := $(APPL_COBJS) log_output.o vasyslog.o t_perror.o strerror.o 207 APPL_COBJS := $(APPL_COBJS) log_output.o vasyslog.o t_perror.o strerror.o mbed_stub.o 194 208 APPL_CFLAGS := $(APPL_CFLAGS) 195 209 ifdef APPLDIRS … … 197 211 endif 198 212 199 TINETDIR = tinet200 213 ifdef TINETDIR 201 214 # … … 221 234 SUPPORT_UDP = true 222 235 236 # IGMPを有効に設定 237 #SUPPORT_IGMP = true 238 223 239 # 224 240 # ネットワークサービスの Makefile のインクルード … … 230 246 # システムサービスに関する定義 231 247 # 248 ifdef TCINSTALL 249 GCC_PATH = $(TCINSTALL) 250 else 251 GCC_PATH = $(shell which $(CC))/../../ 252 endif 253 MALLOC_LIB = "${GCC_PATH}arm-none-eabi/lib/thumb/v7-ar/fpv3/hard/libc.a" 254 MALLOC_OBJS = lib_a-reent.o lib_a-impure.o lib_a-malloc.o lib_a-mallocr.o lib_a-calloc.o lib_a-callocr.o lib_a-realloc.o lib_a-reallocr.o lib_a-sbrkr.o lib_a-freer.o 255 232 256 SYSSVC_DIRS := $(TECSGENDIR) $(SRCDIR)/tecs_kernel \ 233 257 $(SYSSVC_DIRS) $(SRCDIR)/syssvc 234 258 SYSSVC_ASMOBJS := $(SYSSVC_ASMOBJS) 235 SYSSVC_COBJS := $( INIT_TECS_COBJ) $(TECS_COBJS) $(SYSSVC_COBJS) \236 $(CXXRTS)259 SYSSVC_COBJS := $(SYSSVC_COBJS) $(TECS_COBJS) \ 260 $(INIT_TECS_COBJ) $(CXXRTS) 237 261 SYSSVC_CFLAGS := $(SYSSVC_CFLAGS) 238 262 INCLUDES := $(INCLUDES) -I$(TECSGENDIR) -I$(SRCDIR)/tecs_kernel -I../../musl-1.1.18/include 239 263 240 264 # 265 # トレースログ記録のサンプルコードに関する定義 266 # 267 ifdef ENABLE_TRACE 268 COPTS := $(COPTS) -DTOPPERS_ENABLE_TRACE 269 SYSSVC_DIRS := $(SYSSVC_DIRS) $(SRCDIR)/arch/tracelog 270 endif 271 272 # 241 273 # ターゲットファイル 242 274 # 243 275 .PHONY: all 244 276 ifndef OMIT_TECS 245 all: tecs 277 all: tecs | $(DEPDIR) 246 278 # @$(MAKE) check 247 279 @$(MAKE) check $(OBJNAME).bin … … 258 290 # コンフィギュレータに関する定義 259 291 # 292 CFG_KERNEL := --kernel asp 260 293 ifndef TINETDIR 261 294 CFG_TRB := -T $(TARGETDIR)/target_kernel.trb … … 266 299 CFG_TABS := --api-table $(TINET_ROOT)/tcpip_api.def:tcpip \ 267 300 --api-table $(SRCDIR)/kernel/kernel_api.def:kernel \ 268 --symval-table $( SRCDIR)/tinet/tcpip_sym.def \301 --symval-table $(TINET_ROOT)/tcpip_sym.def \ 269 302 --symval-table $(SRCDIR)/kernel/kernel_sym.def $(CFG_TABS) 270 303 endif … … 272 305 CFG_COBJS := kernel_cfg.o $(CFG_COBJS) 273 306 CFG_OBJS := $(CFG_ASMOBJS) $(CFG_COBJS) 307 CFG_CFLAGS := -DTOPPERS_CB_TYPE_ONLY $(CFG_CFLAGS) 308 274 309 CFG2_OUT_SRCS := kernel_cfg.h kernel_cfg.c $(CFG2_OUT_SRCS) 275 CFG_CFLAGS := -DTOPPERS_CB_TYPE_ONLY $(CFG_CFLAGS)276 310 277 311 # … … 304 338 $(foreach file,$(KERNEL_FCSRCS),$(file:.c=.o)) 305 339 endif 306 ifdef OMIT_OFFSET_H 307 OFFSET_H = 308 else 340 ifdef TARGET_OFFSET_TRB 309 341 OFFSET_H = offset.h 310 342 endif … … 322 354 endif 323 355 ifndef TARGET_TCPIP_TRB 324 TARGET_TCPIP_TRB := $(SRCDIR)/ tinet/tinet.trb356 TARGET_TCPIP_TRB := $(SRCDIR)/$(TINETDIR)/tinet.trb 325 357 endif 326 358 … … 332 364 vpath %.cfg $(APPL_DIRS) 333 365 vpath %.cdl $(APPL_DIRS) 366 vpath %.bin $(APPL_DIRS) 367 368 # 369 # 中間オブジェクトファイルを置くディレクトリの処理 370 # 371 APPL_ASMOBJS := $(addprefix $(OBJDIR)/, $(APPL_ASMOBJS)) 372 APPL_CXXOBJS := $(addprefix $(OBJDIR)/, $(APPL_CXXOBJS)) 373 APPL_COBJS := $(addprefix $(OBJDIR)/, $(APPL_COBJS)) 374 SYSSVC_ASMOBJS := $(addprefix $(OBJDIR)/, $(SYSSVC_ASMOBJS)) 375 SYSSVC_COBJS := $(addprefix $(OBJDIR)/, $(SYSSVC_COBJS)) 376 KERNEL_ASMOBJS := $(addprefix $(OBJDIR)/, $(KERNEL_ASMOBJS)) 377 KERNEL_COBJS := $(addprefix $(OBJDIR)/, $(KERNEL_COBJS)) 378 KERNEL_LCOBJS := $(addprefix $(OBJDIR)/, $(KERNEL_LCOBJS)) 379 CFG_ASMOBJS := $(addprefix $(OBJDIR)/, $(CFG_ASMOBJS)) 380 CFG_COBJS := $(addprefix $(OBJDIR)/, $(CFG_COBJS)) 381 CFG_DMY := $(addprefix $(OBJDIR)/, $(CFG_DMY)) 382 MALLOC_OBJS := $(addprefix $(OBJDIR)/, $(MALLOC_OBJS)) 334 383 335 384 # 336 385 # コンパイルのための変数の定義 337 386 # 338 KERNEL_LIB_OBJS = $(KERNEL_ASMOBJS) $(KERNEL_COBJS) $(KERNEL_LCOBJS)387 APPL_OBJS = $(APPL_ASMOBJS) $(APPL_COBJS) $(APPL_CXXOBJS) 339 388 SYSSVC_OBJS = $(SYSSVC_ASMOBJS) $(SYSSVC_COBJS) $(HIDDEN_OBJS) 340 APPL_OBJS = $(APPL_ASMOBJS) $(APPL_COBJS) $(APPL_CXXOBJS) 389 KERNEL_LIB_OBJS = $(KERNEL_ASMOBJS) $(KERNEL_COBJS) $(KERNEL_LCOBJS) $(MALLOC_OBJS) 390 CFG_OBJS = $(CFG_ASMOBJS) $(CFG_COBJS) 341 391 ALL_OBJS = $(START_OBJS) $(APPL_OBJS) $(SYSSVC_OBJS) $(CFG_OBJS) \ 342 392 $(END_OBJS) $(HIDDEN_OBJS) … … 350 400 OBJ_LDFLAGS := $(OBJ_LDFLAGS) -L. 351 401 endif 402 ifdef SYSSVC_LIB 403 LIBS_DEP := $(LIBS_DEP) $(SYSSVC_LIB)/libsyssvc.a 404 OBJ_LDFLAGS := $(OBJ_LDFLAGS) -L$(SYSSVC_LIB) 405 REALCLEAN_FILES := $(REALCLEAN_FILES) libsyssvc.a 406 else 407 LIBS_DEP := $(LIBS_DEP) libsyssvc.a 408 OBJ_LDFLAGS := $(OBJ_LDFLAGS) -L. 409 endif 352 410 353 411 ifdef TEXT_START_ADDRESS … … 372 430 tecs $(TECSGEN_SRCS) $(TECS_HEADERS): $(TECSGEN_TIMESTAMP) ; 373 431 $(TECSGEN_TIMESTAMP): $(APPL_CDL) $(TECS_IMPORTS) 374 $(TECSGEN) $< -R $(INCLUDES) --cpp "$( TECS_CPP)" -g $(TECSGENDIR)432 $(TECSGEN) $< -R $(INCLUDES) --cpp "$(subst ", \", $(TECS_CPP))" -g $(TECSGENDIR) 375 433 376 434 # … … 379 437 cfg1_out.c cfg1_out.db: cfg1_out.timestamp ; 380 438 cfg1_out.timestamp: $(APPL_CFG) $(TECSGEN_TIMESTAMP) 381 echo $(CFG_TABS) 382 $(CFG) --pass 1 --kernel asp $(INCLUDES) $(CFG_TABS) \ 439 $(CFG) --pass 1 $(CFG_KERNEL) $(INCLUDES) $(CFG_TABS) \ 383 440 -M $(DEPDIR)/cfg1_out_c.d $(TARGET_KERNEL_CFG) $< 384 441 385 $(CFG1_OUT): $(START_OBJS) cfg1_out.o $(CFG_DMY) $(END_OBJS) $(HIDDEN_OBJS)442 $(CFG1_OUT): $(START_OBJS) $(OBJDIR)/cfg1_out.o $(CFG_DMY) $(END_OBJS) $(HIDDEN_OBJS) 386 443 $(LINK) $(CFLAGS) $(LDFLAGS) $(CFG1_OUT_LDFLAGS) -o $(CFG1_OUT) \ 387 $(START_OBJS) cfg1_out.o $(CFG_DMY) $(END_OBJS)444 $(START_OBJS) $(OBJDIR)/cfg1_out.o $(CFG_DMY) $(LIBS) $(END_OBJS) $(HIDDEN_OBJS) 388 445 389 446 cfg1_out.syms: $(CFG1_OUT) … … 395 452 $(CFG2_OUT_SRCS) cfg2_out.db: kernel_cfg.timestamp ; 396 453 kernel_cfg.timestamp: cfg1_out.db cfg1_out.syms cfg1_out.srec 397 $(CFG) --pass 2 --kernel asp$(INCLUDES) $(CFG_TRB)454 $(CFG) --pass 2 $(CFG_KERNEL) $(INCLUDES) $(CFG_TRB) 398 455 399 456 # … … 402 459 $(OFFSET_H): offset.timestamp ; 403 460 offset.timestamp: cfg1_out.db cfg1_out.syms cfg1_out.srec 404 $(CFG) --pass 2 -O --kernel asp$(INCLUDES) -T $(TARGET_OFFSET_TRB) \461 $(CFG) --pass 2 -O $(CFG_KERNEL) $(INCLUDES) -T $(TARGET_OFFSET_TRB) \ 405 462 --rom-symbol cfg1_out.syms --rom-image cfg1_out.srec 406 463 … … 414 471 415 472 # 473 # システムサービスコールライブラリファイルの生成 474 # 475 libsyssvc.a: $(filter-out $(OBJDIR)/tBannerMain.o, $(SYSSVC_OBJS)) 476 rm -f libsyssvc.a 477 $(AR) -rcs libsyssvc.a $(filter-out $(OBJDIR)/tBannerMain.o, $(SYSSVC_OBJS)) 478 $(RANLIB) libsyssvc.a 479 480 # 481 # 並列makeのための依存関係の定義 482 # 483 $(APPL_OBJS) $(filter-out $(CFG_DMY), $(SYSSVC_OBJS)): | kernel_cfg.timestamp 484 $(APPL_ASMOBJS) $(filter-out $(CFG_DMY), $(SYSSVC_ASMOBJS)) $(KERNEL_ASMOBJS) $(CFG_ASMOBJS): \ 485 | offset.timestamp 486 487 # 416 488 # 特別な依存関係の定義 417 489 # 418 tBannerMain.o: $(filter-out tBannerMain.o,$(ALL_OBJS)) $(LIBS_DEP) 490 $(OBJDIR)/tBannerMain.o: $(filter-out $(OBJDIR)/tBannerMain.o,$(ALL_OBJS)) \ 491 $(LIBS_DEP) 419 492 420 493 # … … 423 496 $(OBJFILE): $(ALL_OBJS) $(LIBS_DEP) 424 497 $(LINK) $(CFLAGS) $(LDFLAGS) $(OBJ_LDFLAGS) -o $(OBJFILE) \ 498 -Wl,-Map=$(OBJNAME).map,--cref -Wl,--gc-sections -Wl,-e_kernel__start,--gc-keep-exported=_kernel_istk \ 425 499 $(START_OBJS) $(APPL_OBJS) $(SYSSVC_OBJS) $(CFG_OBJS) \ 426 $(ALL_LIBS) $(END_OBJS) 500 -Wl,--start-group $(ALL_LIBS) -Wl,--end-group $(END_OBJS) 501 502 # 503 # 依存関係フォルダの作成 504 # 505 $(DEPDIR): 506 mkdir $@ 427 507 428 508 # … … 452 532 check: check.timestamp ; 453 533 check.timestamp: cfg2_out.db $(OBJNAME).syms $(OBJNAME).srec 454 $(CFG) --pass 3 --kernel asp-O $(INCLUDES) -T $(TARGET_CHECK_TRB) \534 $(CFG) --pass 3 $(CFG_KERNEL) -O $(INCLUDES) -T $(TARGET_CHECK_TRB) \ 455 535 --rom-symbol $(OBJNAME).syms --rom-image $(OBJNAME).srec 456 536 @echo "configuration check passed" … … 461 541 .PHONY: clean 462 542 clean: 463 rm -f \#* *~ *.o $(DEPDIR)/*.d $(CLEAN_FILES) check.timestamp543 rm -f \#* *~ $(OBJDIR)/*.o $(DEPDIR)/*.d $(CLEAN_FILES) check.timestamp 464 544 rm -f $(OBJFILE) $(OBJNAME).syms $(OBJNAME).srec $(OBJNAME).bin 465 545 rm -f kernel_cfg.timestamp $(CFG2_OUT_SRCS) cfg2_out.db … … 471 551 rm -f libkernel.a 472 552 endif 553 ifndef SYSSVC_LIB 554 rm -f libsyssvc.a 555 endif 556 rm -f $(MALLOC_OBJS) 473 557 474 558 .PHONY: cleankernel 475 559 cleankernel: 476 560 rm -f $(OFFSET_H) $(KERNEL_LIB_OBJS) 477 rm -f $(KERNEL_LIB_OBJS:%.o=$(DEPDIR)/%.d) 561 rm -f $(KERNEL_LIB_OBJS:$(OBJDIR)/%.o=$(DEPDIR)/%.d) 562 563 .PHONY: cleansyssvc 564 cleansyssvc: 565 rm -f $(SYSSVC_OBJS) 566 rm -f $(SYSSVC_OBJS:$(OBJDIR)/%.o=$(DEPDIR)/%.d) 478 567 479 568 .PHONY: realclean … … 487 576 # のみを付けてコンパイルする. 488 577 # 489 ALL_CFG_COBJS = $(CFG_COBJS) cfg1_out.o578 ALL_CFG_COBJS = $(CFG_COBJS) $(OBJDIR)/cfg1_out.o 490 579 ALL_CFG_ASMOBJS = $(CFG_ASMOBJS) 491 580 492 $(ALL_CFG_COBJS): %.o: %.c493 $(CC) -c - MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(CFG_CFLAGS) $<494 495 $(ALL_CFG_COBJS: .o=.s): %.s: %.c496 $(CC) -S $(CFLAGS) $(CFG_CFLAGS) $<497 498 $(ALL_CFG_ASMOBJS): %.o: %.S499 $(CC) -c - MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(CFG_CFLAGS) $<581 $(ALL_CFG_COBJS): $(OBJDIR)/%.o: %.c 582 $(CC) -c -o $@ -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(CFG_CFLAGS) $< 583 584 $(ALL_CFG_COBJS:$(OBJDIR)/%.o=%.s): %.s: %.c 585 $(CC) -S -o $@ $(CFLAGS) $(CFG_CFLAGS) $< 586 587 $(ALL_CFG_ASMOBJS): $(OBJDIR)/%.o: %.S 588 $(CC) -c -o $@ -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(CFG_CFLAGS) $< 500 589 501 590 # … … 549 638 # コンパイルルールの定義 550 639 # 551 $(KERNEL_COBJS): %.o: %.c552 $(CC) -c - MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(KERNEL_CFLAGS) $<553 554 $(KERNEL_COBJS: .o=.s): %.s: %.c555 $(CC) -S $(CFLAGS) $(KERNEL_CFLAGS) $<556 557 $(KERNEL_LCOBJS): %.o:558 $(CC) - DTOPPERS_$(*F) -o $@ -c-MD -MP -MF $(DEPDIR)/$*.d \640 $(KERNEL_COBJS): $(OBJDIR)/%.o: %.c 641 $(CC) -c -o $@ -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(KERNEL_CFLAGS) $< 642 643 $(KERNEL_COBJS:$(OBJDIR)/%.o=%.s): %.s: %.c 644 $(CC) -S -o $@ $(CFLAGS) $(KERNEL_CFLAGS) $< 645 646 $(KERNEL_LCOBJS): $(OBJDIR)/%.o: 647 $(CC) -c -o $@ -DTOPPERS_$(*F) -MD -MP -MF $(DEPDIR)/$*.d \ 559 648 $(CFLAGS) $(KERNEL_CFLAGS) $< 560 649 561 $(KERNEL_LCOBJS:.o=.s): %.s: 562 $(CC) -DTOPPERS_$(*F) -o $@ -S $(CFLAGS) $(KERNEL_CFLAGS) $< 563 564 $(KERNEL_ASMOBJS): %.o: %.S 565 $(CC) -c -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(KERNEL_CFLAGS) $< 566 567 $(SYSSVC_COBJS): %.o: %.c 568 $(CC) -c -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(SYSSVC_CFLAGS) $< 569 570 $(SYSSVC_COBJS:.o=.s): %.s: %.c 571 $(CC) -S $(CFLAGS) $(SYSSVC_CFLAGS) $< 572 573 $(SYSSVC_ASMOBJS): %.o: %.S 574 $(CC) -c -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(SYSSVC_CFLAGS) $< 575 576 $(APPL_COBJS): %.o: %.c 577 $(CC) -c -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(APPL_CFLAGS) $< 578 579 $(APPL_COBJS:.o=.s): %.s: %.c 580 $(CC) -S $(CFLAGS) $(APPL_CFLAGS) $< 581 582 $(APPL_CXXOBJS): %.o: %.cpp 583 $(CXX) -c -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(APPL_CFLAGS) $< 584 585 $(APPL_CXXOBJS:.o=.s): %.s: %.cpp 586 $(CXX) -S $(CFLAGS) $(APPL_CFLAGS) $< 587 588 $(APPL_ASMOBJS): %.o: %.S 589 $(CC) -c -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(APPL_CFLAGS) $< 650 $(KERNEL_LCOBJS:$(OBJDIR)/%.o=%.s): %.s: 651 $(CC) -S -o $@ -DTOPPERS_$(*F) $(CFLAGS) $(KERNEL_CFLAGS) $< 652 653 $(KERNEL_ASMOBJS): $(OBJDIR)/%.o: %.S 654 $(CC) -c -o $@ -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(KERNEL_CFLAGS) $< 655 656 $(SYSSVC_COBJS): $(OBJDIR)/%.o: %.c 657 $(CC) -c -o $@ -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(SYSSVC_CFLAGS) $< 658 659 $(SYSSVC_COBJS:$(OBJDIR)/%.o=%.s): %.s: %.c 660 $(CC) -S -o $@ $(CFLAGS) $(SYSSVC_CFLAGS) $< 661 662 $(SYSSVC_ASMOBJS): $(OBJDIR)/%.o: %.S 663 $(CC) -c -o $@ -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(SYSSVC_CFLAGS) $< 664 665 $(APPL_COBJS): $(OBJDIR)/%.o: %.c 666 $(CC) -c -o $@ -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(APPL_CFLAGS) $< 667 668 $(APPL_COBJS:$(OBJDIR)/%.o=%.s): %.s: %.c 669 $(CC) -S -o $@ $(CFLAGS) $(APPL_CFLAGS) $< 670 671 $(APPL_CXXOBJS): $(OBJDIR)/%.o: %.cpp 672 $(CXX) -c -o $@ -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(APPL_CFLAGS) $< 673 674 $(APPL_CXXOBJS:$(OBJDIR)/%.o=%.s): %.s: %.cpp 675 $(CXX) -S -o $@ $(CFLAGS) $(APPL_CFLAGS) $< 676 677 $(APPL_ASMOBJS): $(OBJDIR)/%.o: %.S 678 $(CC) -c -o $@ -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(APPL_CFLAGS) $< 679 680 $(MALLOC_OBJS): $(OBJDIR)/%.o: 681 $(AR) x $(MALLOC_LIB) $(notdir $@) 682 mv $(notdir $@) $@ 590 683 591 684 # 592 685 # デフォルトコンパイルルールを上書き 593 686 # 594 %.o: %.c687 $(OBJDIR)/%.o: %.c 595 688 @echo "*** Default compile rules should not be used." 596 $(CC) -c - MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $<689 $(CC) -c -o $@ -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $< 597 690 598 691 %.s: %.c 599 692 @echo "*** Default compile rules should not be used." 600 $(CC) -S $(CFLAGS) $<601 602 %.o: %.cpp693 $(CC) -S -o $@ $(CFLAGS) $< 694 695 $(OBJDIR)/%.o: %.cpp 603 696 @echo "*** Default compile rules should not be used." 604 $(CXX) -c - MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $<697 $(CXX) -c -o $@ -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $< 605 698 606 699 %.s: %.cpp 607 700 @echo "*** Default compile rules should not be used." 608 $(CXX) -S $(CFLAGS) $<609 610 %.o: %.S701 $(CXX) -S -o $@ $(CFLAGS) $< 702 703 $(OBJDIR)/%.o: %.S 611 704 @echo "*** Default compile rules should not be used." 612 $(CC) -c - MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $<705 $(CC) -c -o $@ -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $< -
EcnlProtoTool/trunk/asp3_dcre/MANIFEST
r270 r429 1 1 PACKAGE asp3 2 VERSION 3. 1.02 VERSION 3.5.0 3 3 4 4 configure.rb … … 88 88 tecs_kernel/tAlarmNotifier.c 89 89 tecs_kernel/tAlarmNotifier_inline.h 90 tecs_kernel/tCpuExceptionHandler.c91 90 tecs_kernel/tCyclicNotifier.c 92 91 tecs_kernel/tCyclicNotifier_inline.h … … 96 95 tecs_kernel/tISR.c 97 96 tecs_kernel/tInitializeRoutine.c 98 tecs_kernel/tInterruptHandler.c99 97 tecs_kernel/tInterruptRequest_inline.h 100 98 tecs_kernel/tKernel_inline.h … … 119 117 syssvc/tLogTask.cdl 120 118 syssvc/tLogTaskMain.c 119 syssvc/tPutLogSIOPort.c 120 syssvc/tPutLogSIOPort.cdl 121 121 syssvc/tSerialAdapter.c 122 122 syssvc/tSerialAdapter.cdl … … 129 129 syssvc/tTestService.c 130 130 syssvc/tTestService.cdl 131 syssvc/tTestServiceAdapter.c 132 syssvc/tTestServiceAdapter.cdl 131 133 syssvc/test_svc.h 132 134 … … 141 143 arch/tracelog/tTraceLog.c 142 144 arch/tracelog/tTraceLog.cdl 145 146 arch/simtimer/sim_timer.c 147 arch/simtimer/sim_timer.cfg 148 arch/simtimer/sim_timer.h 149 arch/simtimer/sim_timer_cntl.h 150 arch/simtimer/tSimTimerCntl.c 151 arch/simtimer/tSimTimerCntl.cdl 152 arch/simtimer/tSimTimerCntlAdapter.c 153 arch/simtimer/tSimTimerCntlAdapter.cdl 143 154 144 155 utils/applyrename.rb -
EcnlProtoTool/trunk/asp3_dcre/README.txt
r321 r429 1 1 2 TOPPERS/ASP3 Kernel(Release 3. 1)2 TOPPERS/ASP3 Kernel(Release 3.5) 3 3 Toyohashi Open Platform for Embedded Real-Time Systems/ 4 4 Advanced Standard Profile Kernel … … 40 40 グリスト(users@toppers.jp)宛にお願いします. 41 41 42 これらのメーリングリストに投稿されたメールは,ウェブサイトのメーリング 43 リストアーカイブから読むことができますので,公開すべきでない情報(個人 44 情報など)をメール中に含めないように注意をお願いします. 45 42 46 TOPPERSユーザーズメーリングリストへの登録方法については,以下のページに 43 47 説明があります. -
EcnlProtoTool/trunk/asp3_dcre/arch/arm_gcc/MANIFEST
r270 r429 1 1 PACKAGE asp3_arch_arm_gcc 2 VERSION 3. 1.02 VERSION 3.2.0 3 3 4 4 MANIFEST -
EcnlProtoTool/trunk/asp3_dcre/arch/arm_gcc/common/Makefile.core
r321 r429 2 2 # Makefileのコア依存部(ARM用) 3 3 # 4 # $Id $4 # $Id: Makefile.core 755 2016-06-12 10:08:22Z ertl-hiro $ 5 5 # 6 6 … … 50 50 # START_OBJSをstart.oに設定し,LDFLAGSに-nostdlibを追加する. 51 51 # 52 START_OBJS = start.o 52 START_OBJS := start.o 53 START_OBJS := $(addprefix $(OBJDIR)/, $(START_OBJS)) 53 54 54 $(START_OBJS): %.o: %.S55 $(CC) -c $(CFLAGS) $(KERNEL_CFLAGS) $<55 $(START_OBJS): $(OBJDIR)/%.o: %.S 56 $(CC) -c -o $@ -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(KERNEL_CFLAGS) $< 56 57 57 LDFLAGS := -no stdlib$(LDFLAGS)58 LDFLAGS := -nodefaultlibs $(LDFLAGS) -
EcnlProtoTool/trunk/asp3_dcre/arch/arm_gcc/common/arm.c
r321 r429 137 137 * ARMv7におけるデータキャッシュの無効化 138 138 * 139 * レベル0のキャッシュのみを無効化する. 139 * バリアを2か所に入れているのは,ARMアーキテクチャリファレンスマニュ 140 * アルのサンプルコードを踏襲した. 140 141 */ 141 142 #if __TARGET_ARCH_ARM == 7 … … 144 145 armv7_invalidate_dcache(void) 145 146 { 146 uint32_t reg; 147 uint32_t clidr, ccsidr; 148 uint32_t level, no_levels; 147 149 uint32_t way, no_ways, shift_way; 148 150 uint32_t set, no_sets, shift_set; 149 150 CP15_WRITE_CSSELR(0U); 151 CP15_READ_CCSIDR(reg); 152 no_sets = ((reg >> 13) & 0x7fffU) + 1; 153 shift_set = (reg & 0x07U) + 4; 154 no_ways = ((reg >> 3) & 0x3ffU) + 1; 155 shift_way = count_leading_zero(no_ways); 156 157 for (way = 0; way < no_ways; way++){ 158 for (set = 0; set < no_sets; set++) { 159 reg = (way << shift_way) | (set << shift_set); 160 CP15_WRITE_DCISW(reg); 151 uint32_t waylevel, setwaylevel; 152 153 CP15_READ_CLIDR(clidr); 154 no_levels = (clidr >> 24) & 0x07U; 155 for (level = 0; level < no_levels; level++) { 156 if (((clidr >> (level * 3)) & 0x07U) >= 0x02U) { 157 CP15_WRITE_CSSELR(level << 1); 158 inst_sync_barrier(); 159 CP15_READ_CCSIDR(ccsidr); 160 no_sets = ((ccsidr >> 13) & 0x7fffU) + 1; 161 shift_set = (ccsidr & 0x07U) + 4; 162 no_ways = ((ccsidr >> 3) & 0x3ffU) + 1; 163 shift_way = count_leading_zero(no_ways - 1); 164 165 for (way = 0; way < no_ways; way++) { 166 waylevel = (way << shift_way) | (level << 1); 167 for (set = 0; set < no_sets; set++) { 168 setwaylevel = waylevel | (set << shift_set); 169 CP15_WRITE_DCISW(setwaylevel); 170 } 171 } 161 172 } 162 173 } 174 data_sync_barrier(); 163 175 } 164 176 … … 168 180 * ARMv7におけるデータキャッシュのクリーンと無効化 169 181 * 170 * レベル0のキャッシュのみをクリーンと無効化する. 182 * バリアを2か所に入れているのは,ARMアーキテクチャリファレンスマニュ 183 * アルのサンプルコードを踏襲した. 171 184 */ 172 185 #if __TARGET_ARCH_ARM == 7 … … 175 188 armv7_clean_and_invalidate_dcache(void) 176 189 { 177 uint32_t reg; 190 uint32_t clidr, ccsidr; 191 uint32_t level, no_levels; 178 192 uint32_t way, no_ways, shift_way; 179 193 uint32_t set, no_sets, shift_set; 180 181 CP15_WRITE_CSSELR(0U); 182 CP15_READ_CCSIDR(reg); 183 no_sets = ((reg >> 13) & 0x7fffU) + 1; 184 shift_set = (reg & 0x07U) + 4; 185 no_ways = ((reg >> 3) & 0x3ffU) + 1; 186 shift_way = count_leading_zero(no_ways); 187 188 for (way = 0; way < no_ways; way++){ 189 for (set = 0; set < no_sets; set++) { 190 reg = (way << shift_way) | (set << shift_set); 191 CP15_WRITE_DCCISW(reg); 194 uint32_t waylevel, setwaylevel; 195 196 CP15_READ_CLIDR(clidr); 197 no_levels = (clidr >> 24) & 0x07U; 198 for (level = 0; level < no_levels; level++) { 199 if (((clidr >> (level * 3)) & 0x07U) >= 0x02U) { 200 CP15_WRITE_CSSELR(level << 1); 201 inst_sync_barrier(); 202 CP15_READ_CCSIDR(ccsidr); 203 no_sets = ((ccsidr >> 13) & 0x7fffU) + 1; 204 shift_set = (ccsidr & 0x07U) + 4; 205 no_ways = ((ccsidr >> 3) & 0x3ffU) + 1; 206 shift_way = count_leading_zero(no_ways - 1); 207 208 for (way = 0; way < no_ways; way++) { 209 waylevel = (way << shift_way) | (level << 1); 210 for (set = 0; set < no_sets; set++) { 211 setwaylevel = waylevel | (set << shift_set); 212 CP15_WRITE_DCCISW(setwaylevel); 213 } 214 } 192 215 } 193 216 } 217 data_sync_barrier(); 194 218 } 195 219 -
EcnlProtoTool/trunk/asp3_dcre/arch/arm_gcc/common/arm.h
r321 r429 5 5 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory 6 6 * Toyohashi Univ. of Technology, JAPAN 7 * Copyright (C) 2006-201 6by Embedded and Real-Time Systems Laboratory7 * Copyright (C) 2006-2019 by Embedded and Real-Time Systems Laboratory 8 8 * Graduate School of Information Science, Nagoya Univ., JAPAN 9 9 * … … 53 53 */ 54 54 #ifndef TOPPERS_MACRO_ONLY 55 #ifndef TECSGEN 56 #include "arm_insn.h" /* tecsgenが解釈できないためスキップ */ 57 #endif /* TECSGEN */ 55 #include "arm_insn.h" 58 56 #endif /* TOPPERS_MACRO_ONLY */ 59 57 … … 117 115 #define CP15_SCTLR_DCACHE UINT_C(0x00000004) 118 116 #define CP15_SCTLR_MMU UINT_C(0x00000001) 117 118 /* 119 * CP15のコプロセッサアクセス制御レジスタ(CPACR)の設定値 120 */ 121 #define CP15_CPACR_ASEDIS UINT_C(0x80000000) 122 #define CP15_CPACR_D32DIS UINT_C(0x40000000) 123 #define CP15_CPACR_CP11_FULLACCESS UINT_C(0x00c00000) 124 #define CP15_CPACR_CP10_FULLACCESS UINT_C(0x00300000) 119 125 120 126 /* … … 193 199 #define ARM_MMU_DSCR1_TEX010 0x02000U /* TEXビットが010 */ 194 200 #define ARM_MMU_DSCR1_TEX100 0x04000U /* TEXビットが100 */ 195 #define ARM_MMU_DSCR1_AP01 0x00400U /* APビットが01 */196 #define ARM_MMU_DSCR1_AP10 0x00800U /* APビットが10 */197 #define ARM_MMU_DSCR1_AP11 0x00c00U /* APビットが11 */198 201 #define ARM_MMU_DSCR1_CB00 0x00000U /* Cビットが0,Bビットが0 */ 199 202 #define ARM_MMU_DSCR1_CB01 0x00004U /* Cビットが0,Bビットが1 */ … … 201 204 #define ARM_MMU_DSCR1_CB11 0x0000cU /* Cビットが1,Bビットが1 */ 202 205 203 #if __TARGET_ARCH_ARM >= 6 206 #if __TARGET_ARCH_ARM < 6 207 208 #define ARMV5_MMU_DSCR1_AP01 0x00400U /* APビットが01 */ 209 #define ARMV5_MMU_DSCR1_AP10 0x00800U /* APビットが10 */ 210 #define ARMV5_MMU_DSCR1_AP11 0x00c00U /* APビットが11 */ 211 212 #else /* __TARGET_ARCH_ARM < 6 */ 213 204 214 #define ARMV6_MMU_DSCR1_NONGLOBAL 0x20000U /* グローバルでない */ 205 #define ARMV6_MMU_DSCR1_APX0 0x00000U /* APXビットが0 */ 206 #define ARMV6_MMU_DSCR1_APX1 0x08000U /* APXビットが1 */ 215 #define ARMV6_MMU_DSCR1_AP001 0x00400 /* APビットが001 */ 216 #define ARMV6_MMU_DSCR1_AP010 0x00800 /* APビットが010 */ 217 #define ARMV6_MMU_DSCR1_AP011 0x00c00 /* APビットが011 */ 218 #define ARMV6_MMU_DSCR1_AP101 0x08400 /* APビットが101 */ 219 #define ARMV6_MMU_DSCR1_AP110 0x08800 /* APビットが110 */ 220 #define ARMV6_MMU_DSCR1_AP111 0x08c00 /* APビットが111 */ 207 221 #define ARMV6_MMU_DSCR1_ECC 0x00200U /* ECCが有効(MPCore)*/ 208 222 #define ARMV6_MMU_DSCR1_NOEXEC 0x00010U /* 実行不可 */ 209 #endif /* __TARGET_ARCH_ARM >= 6 */ 223 224 #endif /* __TARGET_ARCH_ARM < 6 */ 210 225 211 226 /* … … 237 252 #define ARMV6_MMU_DSCR2_NONGLOBAL 0x0800U /* グローバルでない */ 238 253 #define ARMV6_MMU_DSCR2_SHARED 0x0400U /* プロセッサ間で共有 */ 239 #define ARMV6_MMU_DSCR2_APX0 0x0000U /* APXビットが0 */ 240 #define ARMV6_MMU_DSCR2_APX1 0x0200U /* APXビットが1 */ 241 #define ARMV6_MMU_DSCR2_AP01 0x0010U /* APビットが01 */ 242 #define ARMV6_MMU_DSCR2_AP10 0x0020U /* APビットが10 */ 243 #define ARMV6_MMU_DSCR2_AP11 0x0030U /* APビットが11 */ 254 #define ARMV6_MMU_DSCR2_AP001 0x0010 /* APビットが001 */ 255 #define ARMV6_MMU_DSCR2_AP010 0x0020 /* APビットが010 */ 256 #define ARMV6_MMU_DSCR2_AP011 0x0030 /* APビットが011 */ 257 #define ARMV6_MMU_DSCR2_AP101 0x0210 /* APビットが101 */ 258 #define ARMV6_MMU_DSCR2_AP110 0x0220 /* APビットが110 */ 259 #define ARMV6_MMU_DSCR2_AP111 0x0230 /* APビットが111 */ 244 260 245 261 /* ラージページのディスクリプタ用 */ … … 318 334 319 335 /* 320 * プロセッサ番号の取得336 * 自プロセッサのインデックス(0オリジン)の取得 321 337 * 322 * マルチプロセッサアフィニティレジスタを読んで,その下位8ビットを返す. 323 * ARMv6では,マルチプロセッサをサポートしている場合にのみ使用できる. 338 * マルチプロセッサアフィニティレジスタを読んで,その下位8ビットを返 339 * す.ARMv6では,マルチプロセッサをサポートしている場合にのみ使用で 340 * きる. 324 341 */ 325 342 #if __TARGET_ARCH_ARM >= 6 326 343 327 Inline uint 32_t328 arm_prc_index(void)344 Inline uint_t 345 get_my_prcidx(void) 329 346 { 330 347 uint32_t reg; 331 348 332 349 CP15_READ_MPIDR(reg); 333 return( reg & 0xffU);350 return((uint_t)(reg & 0xffU)); 334 351 } 335 352 … … 444 461 445 462 #endif /* TOPPERS_MACRO_ONLY */ 463 464 /* 465 * 浮動小数点例外制御レジスタ(FPEXC)の設定値 466 */ 467 #define FPEXC_ENABLE UINT_C(0x40000000) 468 446 469 #endif /* TOPPERS_ARM_H */ -
EcnlProtoTool/trunk/asp3_dcre/arch/arm_gcc/common/arm_insn.h
r321 r429 5 5 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory 6 6 * Toyohashi Univ. of Technology, JAPAN 7 * Copyright (C) 2006-201 6by Embedded and Real-Time Systems Laboratory7 * Copyright (C) 2006-2018 by Embedded and Real-Time Systems Laboratory 8 8 * Graduate School of Information Science, Nagoya Univ., JAPAN 9 9 * … … 105 105 * Thumbモードではmrs/msr命令が使用できないため,関数として実現して, 106 106 * ARMモードに移行して実行する. 107 * 108 * current_cpsrとset_cpsrは,__thumb__が定義されない場合にはヘッダファ 109 * イル中で定義されるインライン関数になるため,core_rename.defに登録 110 * せず,先頭の_kernel_を手書きしている. 107 111 */ 108 112 … … 110 114 * ステータスレジスタ(CPSR)の現在値の読出し 111 115 */ 112 extern uint32_t current_cpsr(void); 116 extern uint32_t _kernel_current_cpsr(void); 117 #define current_cpsr() _kernel_current_cpsr() 113 118 114 119 /* 115 120 * ステータスレジスタ(CPSR)の現在値の変更 116 121 */ 117 extern void set_cpsr(uint32_t cpsr); 122 extern void _kernel_set_cpsr(uint32_t cpsr); 123 #define set_cpsr(cpsr) _kernel_set_cpsr(cpsr) 118 124 119 125 #endif /* __thumb__ */ … … 220 226 #define CP15_READ_ACTLR(reg) Asm("mrc p15, 0, %0, c1, c0, 1":"=r"(reg)) 221 227 #define CP15_WRITE_ACTLR(reg) Asm("mcr p15, 0, %0, c1, c0, 1"::"r"(reg)) 228 229 /* コプロセッサアクセス制御レジスタ */ 230 #define CP15_READ_CPACR(reg) Asm("mrc p15, 0, %0, c1, c0, 2":"=r"(reg)) 231 #define CP15_WRITE_CPACR(reg) Asm("mcr p15, 0, %0, c1, c0, 2"::"r"(reg)) 222 232 223 233 /* … … 293 303 294 304 /* ドメインアクセス制御レジスタ */ 295 #define CP15_WRITE_DACR(reg) Asm("mcr p15, 0, %0, c3, c0, 0":: 305 #define CP15_WRITE_DACR(reg) Asm("mcr p15, 0, %0, c3, c0, 0"::"r"(reg)) 296 306 297 307 /* コンテキストIDレジスタ(ARMv6以降)*/ 298 308 #if __TARGET_ARCH_ARM >= 6 299 #define CP15_WRITE_CONTEXTIDR(reg) Asm("mcr p15, 0, %0, c13, c0, 1" 309 #define CP15_WRITE_CONTEXTIDR(reg) Asm("mcr p15, 0, %0, c13, c0, 1"::"r"(reg)) 300 310 #endif /* __TARGET_ARCH_ARM >= 6 */ 301 311 … … 415 425 416 426 #endif /* __TARGET_ARCH_ARM == 7 */ 427 428 /* 429 * 浮動小数点例外制御レジスタ(FPEXC)の現在値の読出し 430 */ 431 Inline uint32_t 432 current_fpexc(void) 433 { 434 uint32_t fpexc; 435 436 Asm("vmrs %0, fpexc" : "=r"(fpexc)); 437 return(fpexc); 438 } 439 440 /* 441 * 浮動小数点例外制御レジスタ(FPEXC)の現在値の変更 442 */ 443 Inline void 444 set_fpexc(uint32_t fpexc) 445 { 446 Asm("vmsr fpexc, %0" : : "r"(fpexc)); 447 } 448 417 449 #endif /* TOPPERS_ARM_INSN_H */ -
EcnlProtoTool/trunk/asp3_dcre/arch/arm_gcc/common/core_cfg1_out.h
r321 r429 5 5 */ 6 6 7 /*8 * cfg1_out.cのリンクに必要な定義9 */10 11 7 #include <kernel.h> 12 8 13 void sta_ker(void) {}9 void sta_ker(void) { } 14 10 STK_T *const _kernel_istkpt; 15 16 /*17 * offset.hを生成するための定義18 */19 const uint8_t MAGIC_1 = 0x12;20 const uint16_t MAGIC_2 = 0x1234;21 const uint32_t MAGIC_4 = 0x12345678; -
EcnlProtoTool/trunk/asp3_dcre/arch/arm_gcc/common/core_check.trb
r321 r429 3 3 # パス3の生成スクリプトのコア依存部(ARM用) 4 4 # 5 # $Id $5 # $Id: core_check.trb 730 2016-04-03 02:04:52Z ertl-hiro $ 6 6 # 7 7 … … 20 20 inhTable = SYMBOL("_kernel_inh_table") 21 21 offset = SYMBOL("__etext") - SYMBOL("__data_start__") 22 $cfgData[:DEF_INH].each do | key, params|22 $cfgData[:DEF_INH].each do |_, params| 23 23 inthdr = PEEK(inhTable + offset + params[:inhno] * $sizeof_FP, $sizeof_FP) 24 24 … … 39 39 # 40 40 excTable = SYMBOL("_kernel_exc_table") 41 $cfgData[:DEF_EXC].each do | key, params|41 $cfgData[:DEF_EXC].each do |_, params| 42 42 exchdr = PEEK(excTable + params[:excno] * $sizeof_FP, $sizeof_FP) 43 43 -
EcnlProtoTool/trunk/asp3_dcre/arch/arm_gcc/common/core_kernel.h
r321 r429 6 6 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory 7 7 * Toyohashi Univ. of Technology, JAPAN 8 * Copyright (C) 2004-201 6by Embedded and Real-Time Systems Laboratory8 * Copyright (C) 2004-2019 by Embedded and Real-Time Systems Laboratory 9 9 * Graduate School of Information Science, Nagoya Univ., JAPAN 10 10 * … … 53 53 54 54 /* 55 * ターゲット定義のタスク属性 56 */ 57 #define TA_FPU UINT_C(0x08) /* FPUレジスタをコンテキストに含める */ 58 59 /* 55 60 * スタックの型 56 61 * … … 62 67 * CPU例外ハンドラ番号の数 63 68 */ 64 #define TNUM_EXCNO 669 #define TNUM_EXCNO 7 65 70 66 71 /* 67 72 * CPU例外ハンドラ番号の定義 68 73 */ 69 #define EXCNO_UNDEF 0 70 #define EXCNO_SVC 1 71 #define EXCNO_PABORT 2 72 #define EXCNO_DABORT 3 73 #define EXCNO_IRQ 4 74 #define EXCNO_FIQ 5 74 #define EXCNO_UNDEF UINT_C(0) /* 未定義命令 */ 75 #define EXCNO_SVC UINT_C(1) /* スーパバイザコール */ 76 #define EXCNO_PABORT UINT_C(2) /* プリフェッチアボート */ 77 #define EXCNO_DABORT UINT_C(3) /* データアボート */ 78 #define EXCNO_IRQ UINT_C(4) /* IRQ割込み */ 79 #define EXCNO_FIQ UINT_C(5) /* FIQ割込み */ 80 #define EXCNO_FATAL UINT_C(6) /* フェイタルデータアボート */ 75 81 76 82 #ifndef TOPPERS_MACRO_ONLY -
EcnlProtoTool/trunk/asp3_dcre/arch/arm_gcc/common/core_kernel.trb
r321 r429 6 6 # 7 7 # Copyright (C) 2015 by FUJI SOFT INCORPORATED, JAPAN 8 # Copyright (C) 2015 ,2016by Embedded and Real-Time Systems Laboratory8 # Copyright (C) 2015-2019 by Embedded and Real-Time Systems Laboratory 9 9 # Graduate School of Information Science, Nagoya Univ., JAPAN 10 10 # … … 38 38 # の責任を負わない. 39 39 # 40 # $Id $40 # $Id: core_kernel.trb 662 2016-02-27 02:33:51Z ertl-hiro $ 41 41 # 42 42 … … 48 48 # 有効なCPU例外ハンドラ番号 49 49 # 50 $EXCNO_VALID = [ 0, 1, 2, 3, 4, 5 ]50 $EXCNO_VALID = [ 0, 1, 2, 3, 4, 5, 6 ] 51 51 52 52 # 53 53 # DEF_EXCで使用できるCPU例外ハンドラ番号 54 54 # 55 $EXCNO_DEFEXC_VALID = [ 0, 1, 2, 3, 5 ]55 $EXCNO_DEFEXC_VALID = [ 0, 1, 2, 3, 5, 6 ] 56 56 57 57 # … … 65 65 $kernelCfgC.comment_header("Interrupt Handler Table") 66 66 67 $kernelCfgC.add(" FP _kernel_inh_table[TNUM_INHNO] = {")67 $kernelCfgC.add("/*const*/FP _kernel_inh_table[TNUM_INHNO] = {") 68 68 $INHNO_VALID.each_with_index do |inhnoVal, index| 69 69 $kernelCfgC.add(",") if index > 0 -
EcnlProtoTool/trunk/asp3_dcre/arch/arm_gcc/common/core_kernel_impl.c
r321 r429 6 6 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory 7 7 * Toyohashi Univ. of Technology, JAPAN 8 * Copyright (C) 2006-201 6by Embedded and Real-Time Systems Laboratory8 * Copyright (C) 2006-2019 by Embedded and Real-Time Systems Laboratory 9 9 * Graduate School of Information Science, Nagoya Univ., JAPAN 10 10 * … … 73 73 */ 74 74 Inline void 75 config_section_entry( ARM_MMU_CONFIG *p_ammuc)75 config_section_entry(const ARM_MMU_CONFIG *p_ammuc) 76 76 { 77 77 uint32_t vaddr = p_ammuc->vaddr; … … 80 80 uint_t i; 81 81 82 assert(vaddr % ARM_SECTION_SIZE == 0); 83 assert(paddr % ARM_SECTION_SIZE == 0); 84 assert(size % ARM_SECTION_SIZE == 0); 82 85 while (size > 0) { 83 86 #ifdef USE_ARM_SSECTION … … 170 173 171 174 /* 175 * FPUの初期化 176 */ 177 #ifdef USE_ARM_FPU 178 179 void 180 arm_fpu_initialize(void) 181 { 182 uint32_t reg; 183 184 /* 185 * CP10とCP11をアクセス可能に設定する. 186 */ 187 CP15_READ_CPACR(reg); 188 reg |= (CP15_CPACR_CP10_FULLACCESS | CP15_CPACR_CP11_FULLACCESS); 189 CP15_WRITE_CPACR(reg); 190 191 /* 192 * FPUをディスエーブルする. 193 */ 194 set_fpexc(current_fpexc() & ~FPEXC_ENABLE); 195 } 196 197 #endif /* USE_ARM_FPU */ 198 199 /* 172 200 * コア依存の初期化 173 201 */ … … 187 215 arm_mmu_initialize(); 188 216 #endif /* USE_ARM_MMU */ 217 218 /* 219 * FPUの初期化 220 */ 221 #ifdef USE_ARM_FPU 222 arm_fpu_initialize(); 223 #endif /* USE_ARM_FPU */ 189 224 190 225 /* … … 306 341 syslog_0(LOG_EMERG, "FIQ exception occurs."); 307 342 break; 343 case EXCNO_FATAL: 344 syslog_0(LOG_EMERG, "Fatal Data Abort exception occurs."); 345 break; 308 346 } 309 347 xlog_sys(p_excinf); 310 348 311 if (excno == EXCNO_PABORT || excno == EXCNO_DABORT) { 349 if (excno == EXCNO_PABORT || excno == EXCNO_DABORT 350 || excno == EXCNO_FATAL) { 312 351 uint32_t fsr, far; 313 352 -
EcnlProtoTool/trunk/asp3_dcre/arch/arm_gcc/common/core_kernel_impl.h
r321 r429 6 6 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory 7 7 * Toyohashi Univ. of Technology, JAPAN 8 * Copyright (C) 2006-201 6by Embedded and Real-Time Systems Laboratory8 * Copyright (C) 2006-2019 by Embedded and Real-Time Systems Laboratory 9 9 * Graduate School of Information Science, Nagoya Univ., JAPAN 10 10 * … … 55 55 56 56 /* 57 * ターゲット依存のタスク属性(エラーチェック用) 58 */ 59 /*#ifdef USE_ARM_FPU*/ 60 #define TARGET_TSKATR (TA_FPU) 61 /*#endif /* USE_ARM_FPU */ 62 63 /* 57 64 * エラーチェック方法の指定 58 65 */ … … 68 75 #define CHECK_MPF_ALIGN 4 /* 固定長メモリプール領域のアライン単位 */ 69 76 #define CHECK_MPF_NONNULL /* 固定長メモリプール領域の非NULLチェック */ 77 #define CHECK_MPK_ALIGN 4 /* カーネルメモリプール領域のアライン単位 */ 78 #define CHECK_MPK_NONNULL /* カーネルメモリプール領域の非NULL */ 79 /* チェック */ 70 80 #define CHECK_MB_ALIGN 4 /* 管理領域のアライン単位 */ 71 81 … … 269 279 * 非タスクコンテキストからのディスパッチ要求 270 280 */ 271 #define request_dispatch ()281 #define request_dispatch_retint() 272 282 273 283 /* … … 324 334 * 割込みハンドラテーブル(kernel_cfg.c) 325 335 */ 326 extern FP inh_table[TNUM_INHNO];336 extern /*const*/FP inh_table[TNUM_INHNO]; 327 337 328 338 /* … … 447 457 * MMUの設定情報(メモリエリアの情報)(target_kernel_impl.c) 448 458 */ 449 extern ARM_MMU_CONFIG arm_memory_area[];459 extern const ARM_MMU_CONFIG arm_memory_area[]; 450 460 451 461 /* … … 458 468 459 469 #ifndef TOPPERS_MACRO_ONLY 470 471 /* 472 * FPUの初期化 473 */ 474 #ifdef USE_ARM_FPU 475 extern void arm_fpu_initialize(void); 476 #endif /* USE_ARM_FPU */ 460 477 461 478 /* -
EcnlProtoTool/trunk/asp3_dcre/arch/arm_gcc/common/core_offset.trb
r321 r429 3 3 # オフセットファイル生成用Rubyテンプレート(ARM用) 4 4 # 5 # $Id $5 # $Id: core_offset.trb 572 2016-02-01 14:40:09Z ertl-hiro $ 6 6 # 7 7 … … 14 14 # フィールドのオフセットの定義の生成 15 15 # 16 GenerateDefine("TCB_p_tinib", $offsetof_TCB_p_tinib) 17 GenerateDefine("TCB_sp", $offsetof_TCB_sp) 18 GenerateDefine("TCB_pc", $offsetof_TCB_pc) 19 GenerateDefine("TINIB_exinf", $offsetof_TINIB_exinf) 20 GenerateDefine("TINIB_task", $offsetof_TINIB_task) 21 GenerateDefine("TINIB_stksz", $offsetof_TINIB_stksz) 22 GenerateDefine("TINIB_stk", $offsetof_TINIB_stk) 23 GenerateDefine("T_EXCINF_cpsr", $offsetof_T_EXCINF_cpsr) 16 $offsetH.append(<<EOS) 17 #define TCB_p_tinib #{$offsetof_TCB_p_tinib} 18 #define TCB_sp #{$offsetof_TCB_sp} 19 #define TCB_pc #{$offsetof_TCB_pc} 20 #define TINIB_tskatr #{$offsetof_TINIB_tskatr} 21 #define TINIB_exinf #{$offsetof_TINIB_exinf} 22 #define TINIB_task #{$offsetof_TINIB_task} 23 #define TINIB_stksz #{$offsetof_TINIB_stksz} 24 #define TINIB_stk #{$offsetof_TINIB_stk} 25 #define T_EXCINF_cpsr #{$offsetof_T_EXCINF_cpsr} 26 EOS -
EcnlProtoTool/trunk/asp3_dcre/arch/arm_gcc/common/core_rename.def
r331 r429 16 16 dabort_handler 17 17 fiq_handler 18 current_cpsr19 set_cpsr20 18 21 19 # core_kernel_impl.c 22 20 excpt_nest_count 23 21 arm_mmu_initialize 22 arm_fpu_initialize 24 23 core_initialize 25 24 core_terminate … … 28 27 default_int_handler 29 28 default_exc_handler 29 30 # mpcore_kernel_impl.c 31 mpcore_initialize 32 mpcore_terminate 33 34 # mpcore_timer.c 35 target_hrt_initialize 36 target_hrt_terminate 37 target_hrt_handler 38 target_ovrtimer_initialize 39 target_ovrtimer_terminate 40 target_ovrtimer_handler 30 41 31 42 # gic_kernel_impl.c … … 47 58 pl310_invalidate_all 48 59 pl310_clean_and_invalidate_all 49 50 # target_kernel_impl.c51 arm_tnum_memory_area52 arm_memory_area -
EcnlProtoTool/trunk/asp3_dcre/arch/arm_gcc/common/core_rename.h
r321 r429 25 25 #define dabort_handler _kernel_dabort_handler 26 26 #define fiq_handler _kernel_fiq_handler 27 #define current_cpsr _kernel_current_cpsr28 #define set_cpsr _kernel_set_cpsr29 27 30 28 /* … … 33 31 #define excpt_nest_count _kernel_excpt_nest_count 34 32 #define arm_mmu_initialize _kernel_arm_mmu_initialize 33 #define arm_fpu_initialize _kernel_arm_fpu_initialize 35 34 #define core_initialize _kernel_core_initialize 36 35 #define core_terminate _kernel_core_terminate … … 39 38 #define default_int_handler _kernel_default_int_handler 40 39 #define default_exc_handler _kernel_default_exc_handler 40 41 /* 42 * mpcore_kernel_impl.c 43 */ 44 #define mpcore_initialize _kernel_mpcore_initialize 45 #define mpcore_terminate _kernel_mpcore_terminate 46 47 /* 48 * mpcore_timer.c 49 */ 50 #define target_hrt_initialize _kernel_target_hrt_initialize 51 #define target_hrt_terminate _kernel_target_hrt_terminate 52 #define target_hrt_handler _kernel_target_hrt_handler 53 #define target_ovrtimer_initialize _kernel_target_ovrtimer_initialize 54 #define target_ovrtimer_terminate _kernel_target_ovrtimer_terminate 55 #define target_ovrtimer_handler _kernel_target_ovrtimer_handler 41 56 42 57 /* … … 65 80 #define pl310_clean_and_invalidate_all _kernel_pl310_clean_and_invalidate_all 66 81 67 /*68 * target_kernel_impl.c69 */70 #define arm_tnum_memory_area _kernel_arm_tnum_memory_area71 #define arm_memory_area _kernel_arm_memory_area72 73 82 74 83 #endif /* TOPPERS_CORE_RENAME_H */ -
EcnlProtoTool/trunk/asp3_dcre/arch/arm_gcc/common/core_sil.h
r321 r429 5 5 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory 6 6 * Toyohashi Univ. of Technology, JAPAN 7 * Copyright (C) 2004-201 6by Embedded and Real-Time Systems Laboratory7 * Copyright (C) 2004-2018 by Embedded and Real-Time Systems Laboratory 8 8 * Graduate School of Information Science, Nagoya Univ., JAPAN 9 9 * … … 86 86 * ステータスレジスタ(CPSR)の現在値の読出し 87 87 */ 88 extern uint32_t current_cpsr(void);89 #define TOPPERS_current_cpsr() current_cpsr()88 extern uint32_t _kernel_current_cpsr(void); 89 #define TOPPERS_current_cpsr() _kernel_current_cpsr() 90 90 91 91 /* 92 92 * ステータスレジスタ(CPSR)の現在値の変更 93 93 */ 94 extern void set_cpsr(uint32_t cpsr);95 #define TOPPERS_set_cpsr(cpsr) current_cpsr(cpsr)94 extern void _kernel_set_cpsr(uint32_t cpsr); 95 #define TOPPERS_set_cpsr(cpsr) _kernel_set_cpsr(cpsr) 96 96 97 97 #endif /* __thumb__ */ … … 138 138 #define SIL_UNL_INT() (TOPPERS_set_fiq_irq(TOPPERS_fiq_irq_mask)) 139 139 140 /* 141 * メモリ同期バリア 142 */ 143 #ifdef DATA_SYNC_BARRIER 144 #define TOPPERS_SIL_WRITE_SYNC() DATA_SYNC_BARRIER() 145 #elif __TARGET_ARCH_ARM <= 6 146 #define TOPPERS_SIL_WRITE_SYNC() \ 147 Asm("mcr p15, 0, %0, c7, c10, 4"::"r"(0):"memory") 148 #else /* __TARGET_ARCH_ARM <= 6 */ 149 #define TOPPERS_SIL_WRITE_SYNC() Asm("dsb":::"memory") 150 #endif 151 140 152 #endif /* TOPPERS_MACRO_ONLY */ 141 153 #endif /* TOPPERS_CORE_SIL_H */ -
EcnlProtoTool/trunk/asp3_dcre/arch/arm_gcc/common/core_support.S
r331 r429 6 6 * Copyright (C) 2000-2004 by Embedded and Real-Time Systems Laboratory 7 7 * Toyohashi Univ. of Technology, JAPAN 8 * Copyright (C) 2006-201 7by Embedded and Real-Time Systems Laboratory8 * Copyright (C) 2006-2019 by Embedded and Real-Time Systems Laboratory 9 9 * Graduate School of Information Science, Nagoya Univ., JAPAN 10 10 * … … 55 55 56 56 /* 57 * 使用する命令セットの定義 58 */ 59 #ifdef USE_ARM_FPU 60 .fpu vfpv3 61 #endif /* USE_ARM_FPU */ 62 63 /* 57 64 * 例外ベクタ 58 65 */ … … 101 108 * マスク全解除状態・ディスパッチ許可状態で呼び出される. 102 109 */ 103 push {r12,lr} /* 戻り番地を保存,r12はダミー */ 110 push {r12,lr} /* 戻り番地(lr)を保存 */ 111 /* r12はアラインメントのため */ 104 112 #ifdef TOPPERS_SUPPORT_OVRHDR 105 113 bl ovrtimer_stop 106 114 #endif /* TOPPERS_SUPPORT_OVRHDR */ 107 stmfd sp!, {r4-r11}/* 非スクラッチレジスタの保存 */115 push {r4-r11} /* 非スクラッチレジスタの保存 */ 108 116 ldr r0, =p_runtsk /* p_runtsk → r0 */ 109 117 ldr r0, [r0] 118 #ifdef USE_ARM_FPU 119 ldr r2, [r0,#TCB_p_tinib] /* p_runtsk->p_tinib → r2 */ 120 ldr r1, [r2,#TINIB_tskatr] /* p_runtsk->p_tinib->tskatr → r1 */ 121 tst r1, #TA_FPU 122 beq 1f 123 vpush {d8-d15} /* 非スクラッチFPUレジスタの保存 */ 124 1: 125 #endif /* USE_ARM_FPU */ 110 126 str sp, [r0,#TCB_sp] /* スタックポインタを保存 */ 111 127 adr r1, dispatch_r … … 114 130 115 131 ALABEL(dispatch_r) 116 ldmfd sp!, {r4-r11} /* 非スクラッチレジスタの復帰 */ 132 /* 133 * 【この時点のレジスタ状態】 134 * r4:p_runtsk(タスク切換え後) 135 */ 136 #ifdef USE_ARM_FPU 137 ldr r2, [r4,#TCB_p_tinib] /* p_runtsk->p_tinib → r2 */ 138 ldr r1, [r2,#TINIB_tskatr] /* p_runtsk->p_tinib->tskatr → r1 */ 139 tst r1, #TA_FPU 140 vmrs r0, fpexc 141 biceq r0, r0, #FPEXC_ENABLE 142 orrne r0, r0, #FPEXC_ENABLE 143 vmsr fpexc, r0 /* FPEXCを設定 */ 144 beq 1f 145 vpop {d8-d15} /* 非スクラッチFPUレジスタの復帰 */ 146 1: 147 #endif /* USE_ARM_FPU */ 148 pop {r4-r11} /* 非スクラッチレジスタの復帰 */ 117 149 #ifdef TOPPERS_SUPPORT_OVRHDR 118 150 bl ovrtimer_start … … 137 169 138 170 /* 171 * 各種のデバイス(特に割込みコントローラ)の設定が完了するのを待つ. 172 */ 173 asm_data_sync_barrier r0 174 175 /* 139 176 * タスクコンテキストに切り換える. 140 177 */ … … 184 221 bl log_dsp_enter 185 222 #endif /* LOG_DSP_ENTER */ 186 223 187 224 ALABEL(dispatcher_0) 188 225 /* … … 232 269 ALABEL(call_exit_kernel) 233 270 msr cpsr_c, #(CPSR_SVC_MODE AOR CPSR_INTLOCK) 234 ldr r0, =istkpt /* 非タスクコンテキスト のスタックへ*/271 ldr r0, =istkpt /* 非タスクコンテキスト用のスタックに */ 235 272 ldr sp, [r0] 273 ldr r0, =excpt_nest_count /* 例外ネストカウントを1に */ 274 mov r1, #1 275 str r1, [r0] 236 276 b exit_kernel 237 277 … … 243 283 AGLOBAL(start_r) 244 284 /* 245 * ディスパッチャ本体から呼び出されるため,p_runtskはr4に入っている. 285 * 【この時点のレジスタ状態】 286 * r4:p_runtsk(タスク切換え後) 246 287 */ 247 288 ALABEL(start_r) … … 253 294 ldr lr, =ext_tsk /* タスク本体からの戻り番地を設定 */ 254 295 ldr r2, [r4,#TCB_p_tinib] /* p_runtsk->p_tinib → r2 */ 296 #ifdef USE_ARM_FPU 297 ldr r1, [r2,#TINIB_tskatr] /* p_runtsk->p_tinib->tskatr → r1 */ 298 tst r1, #TA_FPU 299 vmrs r0, fpexc 300 biceq r0, r0, #FPEXC_ENABLE 301 orrne r0, r0, #FPEXC_ENABLE 302 vmsr fpexc, r0 /* FPEXCを設定 */ 303 #endif /* USE_ARM_FPU */ 255 304 ldr r0, [r2,#TINIB_exinf] /* exinfをパラメータに */ 256 305 ldr r1, [r2,#TINIB_task] /* タスク起動番地にジャンプ */ … … 270 319 #if __TARGET_ARCH_ARM < 6 271 320 /* 272 * スーパバイザモードに切り換え,スクラッチレジスタ を保存する.321 * スーパバイザモードに切り換え,スクラッチレジスタ+αを保存する. 273 322 */ 274 323 msr cpsr_c, #(CPSR_SVC_MODE AOR CPSR_IRQ_BIT) 275 stmfd sp!, {r0-r5,r12,lr,pc} /* pcはスペース確保のため */ 276 277 /* 278 * IRQモードに戻して,戻り番地とspsr(戻り先のcpsr)を取得する. 324 push {r0-r5,r12,lr,pc} /* pcはスペース確保のため */ 325 326 /* 327 * IRQモードに戻して,戻り番地(lr-4)と戻り先のcpsr(spsr)を取 328 * 得する. 279 329 */ 280 330 msr cpsr_c, #(CPSR_IRQ_MODE AOR CPSR_IRQ_BIT) … … 283 333 284 334 /* 285 * スーパバイザモードに切り換え,戻り番地と spsrを保存する.335 * スーパバイザモードに切り換え,戻り番地と戻り先のcpsrを保存する. 286 336 */ 287 337 msr cpsr_c, #(CPSR_SVC_MODE AOR CPSR_IRQ_BIT) 288 str r2, [sp,#0x20] /* 戻り番地をスタックに保存 289 push {r1} /* spsrをスタックに保存 */338 str r2, [sp,#0x20] /* 戻り番地をスタックに保存(pcの場所)*/ 339 push {r1} /* 戻り先のcpsrをスタックに保存 */ 290 340 #else /* __TARGET_ARCH_ARM < 6 */ 291 341 /* 292 * 戻り 先(lr)とspsr(cpsr_svc)をスーパバイザモードのスタックに293 * 保存する.342 * 戻り番地(lr)と戻り先のcpsr(spsr)をスーパバイザモードのスタッ 343 * クに保存する. 294 344 */ 295 345 sub lr, lr, #4 /* 戻り番地の算出 */ … … 297 347 298 348 /* 299 * スーパバイザモードに切り換え,スクラッチレジスタ を保存する.349 * スーパバイザモードに切り換え,スクラッチレジスタ+αを保存する. 300 350 */ 301 351 cps #CPSR_SVC_MODE 302 stmfd sp!,{r0-r5,r12,lr}352 push {r0-r5,r12,lr} 303 353 #endif /* __TARGET_ARCH_ARM < 6 */ 304 354 … … 308 358 and r1, sp, #4 309 359 sub sp, sp, r1 310 push {r0,r1} /* r0はスペース確保のため*/311 360 push {r0,r1} /* スタックポインタの調整値を保存 */ 361 /* r0はスペース確保のため */ 312 362 /* 313 363 * 例外ネストカウントをインクリメントする.割込みが非タスクコンテキ … … 328 378 #endif /* TOPPERS_SUPPORT_OVRHDR */ 329 379 380 #ifdef USE_ARM_FPU 381 /* 382 * FPUをディスエーブルする. 383 */ 384 vmrs r0, fpexc 385 str r0, [sp] /* FPEXCを保存(r0の場所)*/ 386 bic r0, r0, #FPEXC_ENABLE 387 vmsr fpexc, r0 /* FPEXCを設定 */ 388 #endif /* USE_ARM_FPU */ 389 330 390 /* 331 391 * 非タスクコンテキスト用のスタックに切り換える. … … 339 399 /* 340 400 * 割込みコントローラを操作し,割込み番号を取得する. 401 * 402 * irc_begin_intは,スタックトップ(r0の場所)に,irc_end_intで用 403 * いる情報を保存する. 341 404 */ 342 405 bl irc_begin_int … … 345 408 #else /* TNUM_INHNO <= 256 || __TARGET_ARCH_ARM <= 6 */ 346 409 movw r3, #TNUM_INHNO 347 cmp r4, r3 410 cmp r4, r3 348 411 #endif /* TNUM_INHNO <= 256 || __TARGET_ARCH_ARM <= 6 */ 349 412 bhs irq_handler_2 /* スプリアス割込みなら */ … … 420 483 mov sp, r3 421 484 485 #ifdef USE_ARM_FPU 486 /* 487 * FPUを元に戻す. 488 */ 489 ldr r0, [sp] /* FPEXCを復帰 */ 490 vmsr fpexc, r0 491 #endif /* USE_ARM_FPU */ 492 422 493 /* 423 494 * p_runtskがNULLか判定する. … … 433 504 pop {r0,r1} /* スタックポインタの調整を元に戻す */ 434 505 add sp, sp, r1 435 add sp, sp, #40 /* スクラッチレジスタ を捨てる */506 add sp, sp, #40 /* スクラッチレジスタ等を捨てる */ 436 507 b dispatcher_0 437 508 … … 440 511 */ 441 512 ALABEL(irq_handler_3) 513 /* 514 * 【この時点のレジスタ状態】 515 * r0:p_runtsk 516 */ 442 517 ldr r1, =p_schedtsk /* p_schedtsk → r1 */ 443 518 ldr r1, [r1] … … 448 523 * コンテキストを保存する. 449 524 */ 450 stmfd sp!, {r6-r11} /* 非スクラッチレジスタの保存 */ 525 push {r6-r11} /* 残りのレジスタの保存 */ 526 #ifdef USE_ARM_FPU 527 ldr r2, [r0,#TCB_p_tinib] /* p_runtsk->p_tinib → r2 */ 528 ldr r1, [r2,#TINIB_tskatr] /* p_runtsk->p_tinib->tskatr → r1 */ 529 tst r1, #TA_FPU 530 beq 1f /* TA_FPU属性でない場合は分岐 */ 531 #ifdef USE_ARM_FPU_D32 532 vpush {d16-d31} 533 #endif /* USE_ARM_FPU_D32 */ 534 vpush {d0-d15} /* 全FPUレジスタの保存 */ 535 vmrs r1, fpscr 536 push {r1,r2} /* FPSCRの保存 */ 537 1: /* r2はアラインメントのため */ 538 #endif /* USE_ARM_FPU */ 451 539 str sp, [r0,#TCB_sp] /* スタックポインタを保存 */ 452 540 adr r1, ret_int_r /* 実行再開番地を保存 */ … … 457 545 /* 458 546 * コンテキストを復帰する. 459 */ 460 ldmfd sp!, {r6-r11} /* 非スクラッチレジスタの復帰 */ 547 * 548 * 【この時点のレジスタ状態】 549 * r4:p_runtsk(タスク切換え後) 550 */ 551 #ifdef USE_ARM_FPU 552 ldr r2, [r4,#TCB_p_tinib] /* p_runtsk->p_tinib → r2 */ 553 ldr r1, [r2,#TINIB_tskatr] /* p_runtsk->p_tinib->tskatr → r1 */ 554 tst r1, #TA_FPU 555 vmrs r0, fpexc 556 biceq r0, r0, #FPEXC_ENABLE 557 orrne r0, r0, #FPEXC_ENABLE 558 vmsr fpexc, r0 /* FPEXCを設定 */ 559 beq 1f /* TA_FPU属性でない場合は分岐 */ 560 pop {r1,r2} /* FPSCRの復帰 */ 561 vmsr fpscr, r1 562 vpop {d0-d15} /* 全FPUレジスタの復帰 */ 563 #ifdef USE_ARM_FPU_D32 564 vpop {d16-d31} 565 #endif /* USE_ARM_FPU_D32 */ 566 1: 567 #endif /* USE_ARM_FPU */ 568 pop {r6-r11} /* 残りのレジスタの復帰 */ 461 569 462 570 ALABEL(irq_handler_4) … … 469 577 470 578 /* 471 * 割込み /CPU例外処理からのリターン579 * 割込み処理からのリターン 472 580 * 473 * 割込み /CPU例外処理からのリターンにより,CPUロック解除状態に遷474 * 移するようにする必要があるが,ARMはCPSRのビットによってCPUロッ475 * ク状態を表しているため,CPSRを元に戻してリターンすればよい.581 * 割込み処理からのリターンにより,CPUロック解除状態に遷移するよ 582 * うにする必要があるが,ARMはCPSRのビットによってCPUロック状態を 583 * 表しているため,CPSRを元に戻してリターンすればよい. 476 584 */ 477 585 ALABEL(irq_handler_5) … … 480 588 481 589 #if __TARGET_ARCH_ARM < 6 482 ldmfd sp!, {r0}/* 戻り先のcpsrをspsrに設定 */590 pop {r0} /* 戻り先のcpsrをspsrに設定 */ 483 591 msr spsr_cxsf, r0 484 592 ldmfd sp!, {r0-r5,r12,lr,pc}^ /* コンテキストの復帰 */ 485 593 /* ^付きなので,spsr → cpsr */ 486 594 #else /* __TARGET_ARCH_ARM < 6 */ 487 ldmfd sp!, {r0-r5,r12,lr}595 pop {r0-r5,r12,lr} /* スクラッチレジスタ+αの復帰 */ 488 596 rfefd sp! 489 597 #endif /* __TARGET_ARCH_ARM < 6 */ … … 509 617 /* 510 618 * IビットとFビットをセットし,スーパバイザモードに切り換え,スク 511 * ラッチレジスタ を保存する.619 * ラッチレジスタ+αを保存する. 512 620 */ 513 621 msr cpsr_c, #(CPSR_SVC_MODE AOR CPSR_FIQ_IRQ_BIT) 514 stmfd sp!, {r0-r5,r12,lr,pc} /* pcはスペース確保のため */ 515 516 /* 517 * 未定義モードに戻して,戻り番地とspsrを取得する. 622 push {r0-r5,r12,lr,pc} /* pcはスペース確保のため */ 623 624 /* 625 * 未定義モードに戻して,戻り番地(lr)と戻り先のcpsr(spsr)を取 626 * 得する. 518 627 */ 519 628 msr cpsr_c, #(CPSR_UND_MODE AOR CPSR_FIQ_IRQ_BIT) … … 522 631 523 632 /* 524 * スーパバイザモードに切り換え,戻り番地と spsrを保存する.633 * スーパバイザモードに切り換え,戻り番地と戻り先のcpsrを保存する. 525 634 */ 526 635 msr cpsr_c, #(CPSR_SVC_MODE AOR CPSR_FIQ_IRQ_BIT) 527 str r2, [sp,#0x20] /* 戻り番地をスタックに保存 528 push {r1} /* spsrをスタックに保存 */636 str r2, [sp,#0x20] /* 戻り番地をスタックに保存(pcの場所)*/ 637 push {r1} /* 戻り先のcpsrをスタックに保存 */ 529 638 #else /* __TARGET_ARCH_ARM < 6 */ 530 639 /* 531 * 戻り 先(lr)とspsr(cpsr_svc)をスーパバイザモードのスタックに532 * 保存する.640 * 戻り番地(lr)と戻り先のcpsr(spsr)をスーパバイザモードのスタッ 641 * クに保存する. 533 642 */ 534 643 srsfd #CPSR_SVC_MODE! 535 644 536 645 /* 537 * スーパバイザモードに切り換え,スクラッチレジスタ を保存する.646 * スーパバイザモードに切り換え,スクラッチレジスタ+αを保存する. 538 647 */ 539 648 cps #CPSR_SVC_MODE 540 stmfd sp!,{r0-r5,r12,lr}649 push {r0-r5,r12,lr} 541 650 #endif /* __TARGET_ARCH_ARM < 6 */ 542 651 mov r4, #EXCNO_UNDEF … … 558 667 #if __TARGET_ARCH_ARM < 6 559 668 /* 560 * IビットとFビットをセットし,スクラッチレジスタを保存する. 669 * IビットとFビットをセットし,戻り番地(lr),スクラッチレジスタ 670 * +α,戻り先のcpsr(spsr)を保存する(lrは二重に保存される). 561 671 */ 562 672 msr cpsr_c, #(CPSR_SVC_MODE AOR CPSR_FIQ_IRQ_BIT) 563 stmfd sp!, {r0-r5,r12,lr,pc} /* pcはスペース確保のため */ 564 565 /* 566 * 戻り番地とspsrを取得する. 567 */ 568 mov r2, lr 673 push {lr} 674 push {r0-r5,r12,lr} 569 675 mrs r1, spsr 570 571 /* 572 * 戻り番地とspsrを保存する. 573 */ 574 str r2, [sp,#0x20] /* 戻り番地をスタックに保存 */ 575 push {r1} /* spsrをスタックに保存 */ 676 push {r1} 576 677 #else /* __TARGET_ARCH_ARM < 6 */ 577 678 /* 578 * 戻り 先(lr)とspsr(cpsr_svc)をスーパバイザモードのスタックに579 * 保存する.679 * 戻り番地(lr)と戻り先のcpsr(spsr)をスーパバイザモードのスタッ 680 * クに保存する. 580 681 */ 581 682 srsfd #CPSR_SVC_MODE! 582 683 583 684 /* 584 * スーパバイザモードで,スクラッチレジスタを保存する. 585 */ 586 cps #CPSR_SVC_MODE /* 不要と思われる */ 587 stmfd sp!, {r0-r5,r12,lr} 685 * スーパバイザモードで,スクラッチレジスタ+αを保存する. 686 */ 687 push {r0-r5,r12,lr} 588 688 #endif /* __TARGET_ARCH_ARM < 6 */ 589 689 mov r4, #EXCNO_SVC … … 605 705 /* 606 706 * IビットとFビットをセットし,スーパバイザモードに切り換え,スク 607 * ラッチレジスタ を保存する.707 * ラッチレジスタ+αを保存する. 608 708 */ 609 709 msr cpsr_c, #(CPSR_SVC_MODE AOR CPSR_FIQ_IRQ_BIT) 610 stmfd sp!, {r0-r5,r12,lr,pc} /* pcはスペース確保のため */ 611 612 /* 613 * アボートモードに戻して,戻り番地とspsrを取得する. 710 push {r0-r5,r12,lr,pc} /* pcはスペース確保のため */ 711 712 /* 713 * アボートモードに戻して,戻り番地(lr)と戻り先のcpsr(spsr)を 714 * 取得する. 614 715 */ 615 716 msr cpsr_c, #(CPSR_ABT_MODE AOR CPSR_FIQ_IRQ_BIT) … … 618 719 619 720 /* 620 * スーパバイザモードに切り換え,戻り番地と spsrを保存する.721 * スーパバイザモードに切り換え,戻り番地と戻り先のcpsrを保存する. 621 722 */ 622 723 msr cpsr_c, #(CPSR_SVC_MODE AOR CPSR_FIQ_IRQ_BIT) 623 str r2, [sp,#0x20] /* 戻り番地をスタックに保存 624 push {r1} /* spsrをスタックに保存 */724 str r2, [sp,#0x20] /* 戻り番地をスタックに保存(pcの場所)*/ 725 push {r1} /* 戻り先のcpsrをスタックに保存 */ 625 726 #else /* __TARGET_ARCH_ARM < 6 */ 626 727 /* 627 * 戻り 先(lr)とspsr(cpsr_svc)をスーパバイザモードのスタックに628 * 保存する.728 * 戻り番地(lr)と戻り先のcpsr(spsr)をスーパバイザモードのスタッ 729 * クに保存する. 629 730 */ 630 731 srsfd #CPSR_SVC_MODE! 631 732 632 733 /* 633 * スーパバイザモードに切り換え,スクラッチレジスタ を保存する.734 * スーパバイザモードに切り換え,スクラッチレジスタ+αを保存する. 634 735 */ 635 736 cps #CPSR_SVC_MODE 636 stmfd sp!,{r0-r5,r12,lr}737 push {r0-r5,r12,lr} 637 738 #endif /* __TARGET_ARCH_ARM < 6 */ 638 739 mov r4, #EXCNO_PABORT … … 653 754 * データアボートが,CPU例外の入口(start_exc_entryとend_exc_entry 654 755 * の間)で発生した場合には,fatal_dabort_handlerに分岐する.アボー 655 * トモードのspを汎用レジスタの代わりに使用する .656 */ 657 ldr sp, =start_exc_entry+8658 cmp lr, sp756 * トモードのspを汎用レジスタの代わりに使用する(r13と記述している). 757 */ 758 adr r13, start_exc_entry+8 759 cmp lr, r13 659 760 bcc dabort_handler_1 660 ldr sp, =end_exc_entry+8661 cmp lr, sp761 adr r13, end_exc_entry+8 762 cmp lr, r13 662 763 bcc fatal_dabort_handler 663 764 … … 666 767 /* 667 768 * IビットとFビットをセットし,スーパバイザモードに切り換え,スク 668 * ラッチレジスタ を保存する.769 * ラッチレジスタ+αを保存する. 669 770 */ 670 771 msr cpsr_c, #(CPSR_SVC_MODE AOR CPSR_FIQ_IRQ_BIT) 671 stmfd sp!, {r0-r5,r12,lr,pc} /* pcはスペース確保のため */ 672 673 /* 674 * アボートモードに戻して,戻り番地とspsrを取得する. 772 push {r0-r5,r12,lr,pc} /* pcはスペース確保のため */ 773 774 /* 775 * アボートモードに戻して,戻り番地(lr)と戻り先のcpsr(spsr)を 776 * 取得する. 675 777 */ 676 778 msr cpsr_c, #(CPSR_ABT_MODE AOR CPSR_FIQ_IRQ_BIT) … … 679 781 680 782 /* 681 * スーパバイザモードに切り換え,戻り番地と spsrを保存する.783 * スーパバイザモードに切り換え,戻り番地と戻り先のcpsrを保存する. 682 784 */ 683 785 msr cpsr_c, #(CPSR_SVC_MODE AOR CPSR_FIQ_IRQ_BIT) 684 str r2, [sp,#0x20] /* 戻り番地をスタックに保存 685 push {r1} /* spsrをスタックに保存 */786 str r2, [sp,#0x20] /* 戻り番地をスタックに保存(pcの場所)*/ 787 push {r1} /* 戻り先のcpsrをスタックに保存 */ 686 788 #else /* __TARGET_ARCH_ARM < 6 */ 687 789 /* 688 * 戻り 先(lr)とspsr(cpsr_svc)をスーパバイザモードのスタックに689 * 保存する.790 * 戻り番地(lr)と戻り先のcpsr(spsr)をスーパバイザモードのスタッ 791 * クに保存する. 690 792 */ 691 793 srsfd #CPSR_SVC_MODE! 692 794 693 795 /* 694 * スーパバイザモードに切り換え,スクラッチレジスタ を保存する.796 * スーパバイザモードに切り換え,スクラッチレジスタ+αを保存する. 695 797 */ 696 798 cps #CPSR_SVC_MODE 697 stmfd sp!,{r0-r5,r12,lr}799 push {r0-r5,r12,lr} 698 800 #endif /* __TARGET_ARCH_ARM < 6 */ 699 801 mov r4, #EXCNO_DABORT 700 802 b exc_handler_1 701 #endif /* OMIT_DABORT_HANDLER */702 803 703 804 /* … … 708 809 /* 709 810 * IビットとFビットをセットし,スーパバイザモードに切り換え,スタッ 710 * クポインタを初期化し,スクラッチレジスタ を保存する.811 * クポインタを初期化し,スクラッチレジスタ+αを保存する. 711 812 */ 712 813 msr cpsr_c, #(CPSR_SVC_MODE AOR CPSR_FIQ_IRQ_BIT) 713 814 ldr sp, =istkpt 714 815 ldr sp, [sp] 715 stmfd sp!, {r0-r5,r12,lr,pc} /* pcはスペース確保のため */ 716 717 /* 718 * アボートモードに戻して,戻り番地とspsrを取得する. 816 push {r0-r5,r12,lr,pc} /* pcはスペース確保のため */ 817 818 /* 819 * アボートモードに戻して,戻り番地(lr)と戻り先のcpsr(spsr)を 820 * 取得する. 719 821 */ 720 822 msr cpsr_c, #(CPSR_ABT_MODE AOR CPSR_FIQ_IRQ_BIT) … … 723 825 724 826 /* 725 * スーパバイザモードに切り換え,戻り番地と spsrを保存する.827 * スーパバイザモードに切り換え,戻り番地と戻り先のcpsrを保存する. 726 828 */ 727 829 msr cpsr_c, #(CPSR_SVC_MODE AOR CPSR_FIQ_IRQ_BIT) 728 str r2, [sp,#0x20] /* 戻り番地をスタックに保存 729 push {r1} /* spsrをスタックに保存 */830 str r2, [sp,#0x20] /* 戻り番地をスタックに保存(pcの場所)*/ 831 push {r1} /* 戻り先のcpsrをスタックに保存 */ 730 832 #else /* __TARGET_ARCH_ARM < 6 */ 731 833 /* … … 738 840 739 841 /* 740 * アボートモードに戻して,戻り 先(lr)とspsr(cpsr_svc)をスーパ741 * バイザモードのスタックに保存する.842 * アボートモードに戻して,戻り番地(lr)と戻り先のcpsr(spsr)を 843 * スーパバイザモードのスタックに保存する. 742 844 */ 743 845 cps #CPSR_ABT_MODE … … 745 847 746 848 /* 747 * スーパバイザモードに切り換え,スクラッチレジスタ を保存する.849 * スーパバイザモードに切り換え,スクラッチレジスタ+αを保存する. 748 850 */ 749 851 cps #CPSR_SVC_MODE 750 stmfd sp!,{r0-r5,r12,lr}852 push {r0-r5,r12,lr} 751 853 #endif /* __TARGET_ARCH_ARM < 6 */ 752 854 753 855 /* 754 * 例外ネストカウント の最上位ビットを1にする.856 * 例外ネストカウントをインクリメントする. 755 857 */ 756 858 ldr r2, =excpt_nest_count 757 859 ldr r3, [r2] 758 orr r3, r3, #0x80000000860 add r3, r3, #1 759 861 str r3, [r2] 760 862 761 mov r4, #EXCNO_ DABORT863 mov r4, #EXCNO_FATAL 762 864 b exc_handler_1 865 #endif /* OMIT_DABORT_HANDLER */ 763 866 764 867 /* … … 776 879 /* 777 880 * IビットとFビットをセットし,スーパバイザモードに切り換え,スク 778 * ラッチレジスタ を保存する.881 * ラッチレジスタ+αを保存する. 779 882 */ 780 883 msr cpsr_c, #(CPSR_SVC_MODE AOR CPSR_FIQ_IRQ_BIT) 781 stmfd sp!, {r0-r5,r12,lr,pc} /* pcはスペース確保のため */ 782 783 /* 784 * FIQモードに戻して,戻り番地とspsrを取得する. 884 push {r0-r5,r12,lr,pc} /* pcはスペース確保のため */ 885 886 /* 887 * FIQモードに戻して,戻り番地(lr)と戻り先のcpsr(spsr)を取得 888 * する. 785 889 */ 786 890 msr cpsr_c, #(CPSR_FIQ_MODE AOR CPSR_FIQ_IRQ_BIT) … … 789 893 790 894 /* 791 * スーパバイザモードに切り換え,戻り番地と spsrを保存する.895 * スーパバイザモードに切り換え,戻り番地と戻り先のcpsrを保存する. 792 896 */ 793 897 msr cpsr_c, #(CPSR_SVC_MODE AOR CPSR_FIQ_IRQ_BIT) 794 str r2, [sp,#0x20] /* 戻り番地をスタックに保存 795 push {r1} /* spsrをスタックに保存 */898 str r2, [sp,#0x20] /* 戻り番地をスタックに保存(pcの場所)*/ 899 push {r1} /* 戻り先のcpsrをスタックに保存 */ 796 900 #else /* __TARGET_ARCH_ARM < 6 */ 797 901 /* 798 * 戻り 先(lr)とspsr(cpsr_svc)をスーパバイザモードのスタックに799 * 保存する.902 * 戻り番地(lr)と戻り先のcpsr(spsr)をスーパバイザモードのスタッ 903 * クに保存する. 800 904 */ 801 905 srsfd #CPSR_SVC_MODE! 802 906 803 907 /* 804 * スーパバイザモードに切り換え,スクラッチレジスタ を保存する.908 * スーパバイザモードに切り換え,スクラッチレジスタ+αを保存する. 805 909 */ 806 910 cps #CPSR_SVC_MODE 807 stmfd sp!,{r0-r5,r12,lr}911 push {r0-r5,r12,lr} 808 912 #endif /* __TARGET_ARCH_ARM < 6 */ 809 913 mov r4, #EXCNO_FIQ 810 914 b exc_handler_1 811 915 #endif /* OMIT_FIQ_HANDLER */ 812 916 813 917 ALABEL(end_exc_entry) 814 918 815 919 /* 816 920 * CPU例外ハンドラ出入口処理の共通部分 817 *818 * 【この時点のレジスタ状態】819 * r4:CPU例外ハンドラ番号820 921 */ 821 922 ALABEL(exc_handler_1) 822 923 /* 924 * 【この時点のレジスタ状態】 925 * r4:CPU例外ハンドラ番号 926 * 823 927 * CPU例外が発生した状況の判断に用いるために,CPU例外発生前の割 824 928 * 込み優先度マスクと例外ネストカウントをスタックに保存する. … … 836 940 and r1, sp, #4 837 941 sub sp, sp, r1 838 push {r0,r1} /* r0はスペース確保のため*/839 942 push {r0,r1} /* スタックポインタの調整値を保存 */ 943 /* r0はスペース確保のため */ 840 944 /* 841 945 * カーネル管理外のCPU例外か判定する … … 873 977 #endif /* TOPPERS_SUPPORT_OVRHDR */ 874 978 979 #ifdef USE_ARM_FPU 980 /* 981 * FPUをディスエーブルする. 982 */ 983 vmrs r0, fpexc 984 str r0, [sp] /* FPEXCを保存(r0の場所)*/ 985 bic r0, r0, #FPEXC_ENABLE 986 vmsr fpexc, r0 /* FPEXCを設定 */ 987 #endif /* USE_ARM_FPU */ 988 875 989 /* 876 990 * 非タスクコンテキスト用のスタックに切り換える. … … 890 1004 /* 891 1005 * (必要なら)割込みコントローラを操作する. 1006 * 1007 * irc_begin_excは,スタックトップ(r0の場所)に,irc_end_excで用 1008 * いる情報を保存する. 892 1009 */ 893 1010 bl irc_begin_exc … … 970 1087 mov sp, r3 971 1088 1089 #ifdef USE_ARM_FPU 1090 /* 1091 * FPUを元に戻す. 1092 */ 1093 ldr r0, [sp] /* FPEXCを復帰 */ 1094 vmsr fpexc, r0 1095 #endif /* USE_ARM_FPU */ 1096 972 1097 /* 973 1098 * p_runtskがNULLか判定する. … … 990 1115 */ 991 1116 ALABEL(exc_handler_3) 1117 /* 1118 * 【この時点のレジスタ状態】 1119 * r0:p_runtsk 1120 */ 992 1121 ldr r1, =p_schedtsk /* p_schedtsk → r1 */ 993 1122 ldr r1, [r1] … … 998 1127 * コンテキストを保存する. 999 1128 */ 1000 stmfd sp!, {r6-r11} /* 非スクラッチレジスタの保存 */ 1129 push {r6-r11} /* 残りのレジスタの保存 */ 1130 #ifdef USE_ARM_FPU 1131 ldr r2, [r0,#TCB_p_tinib] /* p_runtsk->p_tinib → r2 */ 1132 ldr r1, [r2,#TINIB_tskatr] /* p_runtsk->p_tinib->tskatr → r1 */ 1133 tst r1, #TA_FPU 1134 beq 1f /* TA_FPU属性でない場合は分岐 */ 1135 #ifdef USE_ARM_FPU_D32 1136 vpush {d16-d31} 1137 #endif /* USE_ARM_FPU_D32 */ 1138 vpush {d0-d15} /* 全FPUレジスタの保存 */ 1139 vmrs r1, fpscr 1140 push {r1,r2} /* FPSCRの保存 */ 1141 1: /* r2はアラインメントのため */ 1142 #endif /* USE_ARM_FPU */ 1001 1143 str sp, [r0,#TCB_sp] /* スタックポインタを保存 */ 1002 1144 adr r1, ret_exc_r /* 実行再開番地を保存 */ … … 1007 1149 /* 1008 1150 * コンテキストを復帰する. 1009 */ 1010 ldmfd sp!, {r6-r11} /* 非スクラッチレジスタの復帰 */ 1151 * 1152 * 【この時点のレジスタ状態】 1153 * r4:p_runtsk(タスク切換え後) 1154 */ 1155 #ifdef USE_ARM_FPU 1156 ldr r2, [r4,#TCB_p_tinib] /* p_runtsk->p_tinib → r2 */ 1157 ldr r1, [r2,#TINIB_tskatr] /* p_runtsk->p_tinib->tskatr → r1 */ 1158 tst r1, #TA_FPU 1159 vmrs r0, fpexc 1160 biceq r0, r0, #FPEXC_ENABLE 1161 orrne r0, r0, #FPEXC_ENABLE 1162 vmsr fpexc, r0 /* FPEXCを設定 */ 1163 beq 1f /* TA_FPU属性でない場合は分岐 */ 1164 pop {r1,r2} /* FPSCRの復帰 */ 1165 vmsr fpscr, r1 1166 vpop {d0-d15} /* 全FPUレジスタの復帰 */ 1167 #ifdef USE_ARM_FPU_D32 1168 vpop {d16-d31} 1169 #endif /* USE_ARM_FPU_D32 */ 1170 1: 1171 #endif /* USE_ARM_FPU */ 1172 pop {r6-r11} /* 残りのレジスタの復帰 */ 1011 1173 1012 1174 ALABEL(exc_handler_4) … … 1031 1193 1032 1194 #if __TARGET_ARCH_ARM < 6 1033 ldmfd sp!, {r0}/* 戻り先のcpsrをspsrに設定 */1195 pop {r0} /* 戻り先のcpsrをspsrに設定 */ 1034 1196 msr spsr_cxsf, r0 1035 1197 ldmfd sp!, {r0-r5,r12,lr,pc}^ /* コンテキストの復帰 */ 1036 1198 /* ^付きなので,spsr → cpsr */ 1037 1199 #else /* __TARGET_ARCH_ARM < 6 */ 1038 ldmfd sp!, {r0-r5,r12,lr}1200 pop {r0-r5,r12,lr} /* スクラッチレジスタ+αの復帰 */ 1039 1201 rfefd sp! 1040 1202 #endif /* __TARGET_ARCH_ARM < 6 */ … … 1061 1223 bne nk_exc_handler_2 /* ならnk_exc_handler_2に分岐 */ 1062 1224 1225 #ifdef USE_ARM_FPU 1226 /* 1227 * FPUをディスエーブルする. 1228 */ 1229 vmrs r0, fpexc 1230 str r0, [sp] /* FPEXCを保存(r0の場所)*/ 1231 bic r0, r0, #FPEXC_ENABLE 1232 vmsr fpexc, r0 /* FPEXCを設定 */ 1233 #endif /* USE_ARM_FPU */ 1234 1063 1235 /* 1064 1236 * 非タスクコンテキスト用のスタックに切り換える. … … 1068 1240 ldr sp, [r2] 1069 1241 push {r0,r3} /* 切換え前のスタックポインタを保存 */ 1070 /* r0は スペース確保のため */1242 /* r0はアラインメントのため */ 1071 1243 ALABEL(nk_exc_handler_2) 1072 1244 /* … … 1101 1273 pop {r0,r3} 1102 1274 mov sp, r3 1275 1276 #ifdef USE_ARM_FPU 1277 /* 1278 * FPUを元に戻す. 1279 */ 1280 ldr r0, [sp] /* FPEXCを復帰 */ 1281 vmsr fpexc, r0 1282 #endif /* USE_ARM_FPU */ 1103 1283 b exc_handler_5 1104 1284 1105 1285 /* 1106 1286 * ステータスレジスタの操作関数 … … 1113 1293 ATEXT 1114 1294 AALIGN(2) 1115 AWEAK( current_cpsr)1116 ALABEL( current_cpsr)1295 AWEAK(_kernel_current_cpsr) 1296 ALABEL(_kernel_current_cpsr) 1117 1297 mrs r0, cpsr_cxsf 1118 1298 bx lr 1119 1299 1120 1300 AALIGN(2) 1121 AWEAK( set_cpsr)1122 ALABEL( set_cpsr)1301 AWEAK(_kernel_set_cpsr) 1302 ALABEL(_kernel_set_cpsr) 1123 1303 msr cpsr_cxsf, r0 1124 1304 bx lr -
EcnlProtoTool/trunk/asp3_dcre/arch/arm_gcc/common/core_sym.def
r331 r429 1 1 TARGET_ARCH_ARM,__TARGET_ARCH_ARM 2 USE_INTCFG_TABLE,true,bool,defined(USE_INTCFG_TABLE) 2 USE_ARM_FPU,true,bool,defined(USE_ARM_FPU),false 3 USE_ARM_FPU_D32,true,bool,defined(USE_ARM_FPU_D32),false 4 USE_INTCFG_TABLE,true,bool,defined(USE_INTCFG_TABLE),false 5 TA_FPU 3 6 sizeof_TCB,sizeof(TCB) 4 7 offsetof_TCB_p_tinib,"offsetof(TCB,p_tinib)" -
EcnlProtoTool/trunk/asp3_dcre/arch/arm_gcc/common/core_test.h
r321 r429 4 4 * Advanced Standard Profile Kernel 5 5 * 6 * Copyright (C) 2006-201 6by Embedded and Real-Time Systems Laboratory6 * Copyright (C) 2006-2019 by Embedded and Real-Time Systems Laboratory 7 7 * Graduate School of Information Science, Nagoya Univ., JAPAN 8 8 * … … 36 36 * の責任を負わない. 37 37 * 38 * $Id $38 * $Id: core_test.h 1244 2019-07-16 21:41:05Z ertl-hiro $ 39 39 */ 40 40 … … 54 54 55 55 /* 56 * CPU例外の発生56 * 不正アドレスの定義(メモリのない番地に設定する) 57 57 */ 58 59 58 #ifndef ILLEGAL_IADDR 60 59 #define ILLEGAL_IADDR 0xd0000000U /* 不正命令アドレス */ … … 66 65 67 66 /* 67 * サンプルプログラムで用いるCPU例外の発生 68 */ 69 #if defined(USE_CPUEXC_SVC) 70 71 #define CPUEXC1 EXCNO_SVC /* スーパバイザコール */ 72 #define RAISE_CPU_EXCEPTION RAISE_CPU_EXCEPTION_SVC 73 #define PREPARE_RETURN_CPUEXC PREPARE_RETURN_CPUEXC_SVC 74 75 #elif defined(USE_CPUEXC_PABORT) 76 77 #define CPUEXC1 EXCNO_PABORT /* プリフェッチアボート */ 78 #define RAISE_CPU_EXCEPTION RAISE_CPU_EXCEPTION_PABORT 79 #define PREPARE_RETURN_CPUEXC PREPARE_RETURN_CPUEXC_PABORT 80 81 #elif defined(USE_CPUEXC_DABORT) 82 83 #define CPUEXC1 EXCNO_DABORT /* データアボート */ 84 #define RAISE_CPU_EXCEPTION RAISE_CPU_EXCEPTION_DABORT 85 #define PREPARE_RETURN_CPUEXC PREPARE_RETURN_CPUEXC_DABORT 86 87 #elif defined(USE_CPUEXC_FATAL) 88 89 #define CPUEXC1 EXCNO_FATAL /* フェイタルデータアボート */ 90 #define RAISE_CPU_EXCEPTION RAISE_CPU_EXCEPTION_FATAL 91 /* フェイタルデータアボート例外ハンドラからリターンしてはならない */ 92 93 #else 94 95 #define CPUEXC1 EXCNO_UNDEF /* 未定義命令 */ 96 #define RAISE_CPU_EXCEPTION RAISE_CPU_EXCEPTION_UNDEF 97 #define PREPARE_RETURN_CPUEXC PREPARE_RETURN_CPUEXC_UNDEF 98 99 #endif 100 101 /* 68 102 * スーパバイザコールによるCPU例外の発生 69 103 * 70 * CPU例外ハンドラから,そのままリターンすることができる.svc命令によ 71 * りlrレジスタが上書きされるため,lrレジスタは破壊されるものと指定し 72 * ている. 104 * svc #0によりCPU例外を発生させる.svc命令によりlrレジスタが上書きさ 105 * れるため,lrレジスタは破壊されるものと指定している.CPU例外ハンド 106 * ラからそのままリターンすることで,svc命令の次の命令から実行が継続 107 * する. 73 108 */ 74 #if defined(USE_SVC_CPUEXC) 75 76 #define CPUEXC1 EXCNO_SVC /* スーパバイザコール */ 77 #define RAISE_CPU_EXCEPTION Asm("svc #0":::"lr") 78 #define PREPARE_RETURN_CPUEXC 109 #define RAISE_CPU_EXCEPTION_SVC Asm("svc #0":::"lr") 110 #define PREPARE_RETURN_CPUEXC_SVC 79 111 80 112 /* 81 113 * プリフェッチアボートによるCPU例外の発生 82 114 * 83 * プリフェッチアボートを起こした命令をスキップしてCPU例外ハンドラから 84 * リターンするために,戻り番地はそのままで良い(ARMモードで使うことを 85 * 想定). 115 * 不正な番地を関数の先頭番地として呼び出すことで,プリフェッチアボー 116 * トによるCPU例外を発生させる.不正な番地に分岐した命令をスキップし 117 * てCPU例外ハンドラからリターンするために,戻り番地には,lrレジスタ 118 * の値(不正な番地への分岐命令からのリターン番地が入っている)を設定 119 * する. 86 120 */ 87 #elif defined(USE_PABORT_CPUEXC) 88 89 #define CPUEXC1 EXCNO_PABORT /* プリフェッチアボート */ 90 #define RAISE_CPU_EXCEPTION ((void (*)(void)) ILLEGAL_IADDR)() 91 #define PREPARE_RETURN_CPUEXC 121 #define RAISE_CPU_EXCEPTION_PABORT (((void (*)(void)) ILLEGAL_IADDR)()) 122 #define PREPARE_RETURN_CPUEXC_PABORT (((T_EXCINF *) p_excinf)->pc \ 123 = ((T_EXCINF *) p_excinf)->lr) 92 124 93 125 /* 94 126 * データアボートによるCPU例外の発生 95 127 * 96 * データアボートを起こした命令をスキップしてCPU例外ハンドラからリター 97 * ンするために,戻り番地から4を減算する(ARMモードで使うことを想定). 128 * 不正な番地をリードすることで,データアボートによるCPU例外を発生さ 129 * せる.データアボートを起こした命令をスキップしてCPU例外ハンドラか 130 * らリターンするために,戻り番地から4を減算する(ARMモードで使うこと 131 * を想定している). 98 132 */ 99 #elif defined(USE_DABORT_CPUEXC) 100 101 #include "arm.h" 102 #define CPUEXC1 EXCNO_DABORT /* データアボート */ 103 #define RAISE_CPU_EXCEPTION (void)(*((volatile uint32_t *) ILLEGAL_DADDR)) 104 #define PREPARE_RETURN_CPUEXC ((T_EXCINF *) p_excinf)->pc -= 4U 133 #define RAISE_CPU_EXCEPTION_DABORT (void)(*((volatile uint32_t *) \ 134 ILLEGAL_DADDR)) 135 #define PREPARE_RETURN_CPUEXC_DABORT (((T_EXCINF *) p_excinf)->pc -= 4U) 105 136 106 137 /* 107 * フェイタルデータアボート 処理138 * フェイタルデータアボートによるCPU例外の発生 108 139 * 109 * スタックポインタを不正にして,フェイタルデータアボート処理を行わせ 110 * る.CPU例外ハンドラからはリターンできない. 140 * スタックポインタを不正にして,未定義命令を実行することで,フェイタ 141 * ルデータアボートによるCPU例外を発生させる.CPU例外ハンドラからリター 142 * ンしてはならない. 111 143 */ 112 #elif defined(USE_FATAL_DABORT_CPUEXC) 113 114 #define CPUEXC1 EXCNO_DABORT /* データアボート */ 115 #define RAISE_CPU_EXCEPTION Asm("mov sp, %0"::"I"(ILLEGAL_DADDR)) 144 #define RAISE_CPU_EXCEPTION_FATAL Asm("mov sp, %0\n" \ 145 "\t.word 0xf0500090" \ 146 ::"I"(ILLEGAL_DADDR)) 116 147 117 148 /* 118 149 * 未定義命令によるCPU例外の発生 119 150 * 120 * RAISE_CPU_EXCEPTIONは,ARMモードで使うことを想定している.CPU例外ハ 121 * ンドラから,そのままリターンすることができる.使用している未定義命 122 * 令は,"Multiply and multiply accumulate"命令群のエンコーディング内 123 * における未定義命令である. 151 * 未定義命令によりCPU例外を発生させる.使用している未定義命令は, 152 * "Multiply and multiply accumulate"命令群のエンコーディング内におけ 153 * る未定義命令である.CPU例外ハンドラからそのままリターンすることで, 154 * 未定義命令の次の命令から実行が継続する(ARMモードで使うことを想定 155 * している). 124 156 */ 125 #else 157 #define RAISE_CPU_EXCEPTION_UNDEF Asm(".word 0xf0500090") 158 #define PREPARE_RETURN_CPUEXC_UNDEF 126 159 127 #define CPUEXC1 EXCNO_UNDEF /* 未定義命令 */128 #define RAISE_CPU_EXCEPTION Asm(".word 0xf0500090")129 #define PREPARE_RETURN_CPUEXC130 131 #endif132 160 #endif /* TOPPERS_CORE_TEST_H */ -
EcnlProtoTool/trunk/asp3_dcre/arch/arm_gcc/common/core_unrename.h
r321 r429 26 26 #undef dabort_handler 27 27 #undef fiq_handler 28 #undef current_cpsr29 #undef set_cpsr30 28 31 29 /* … … 34 32 #undef excpt_nest_count 35 33 #undef arm_mmu_initialize 34 #undef arm_fpu_initialize 36 35 #undef core_initialize 37 36 #undef core_terminate … … 40 39 #undef default_int_handler 41 40 #undef default_exc_handler 41 42 /* 43 * mpcore_kernel_impl.c 44 */ 45 #undef mpcore_initialize 46 #undef mpcore_terminate 47 48 /* 49 * mpcore_timer.c 50 */ 51 #undef target_hrt_initialize 52 #undef target_hrt_terminate 53 #undef target_hrt_handler 54 #undef target_ovrtimer_initialize 55 #undef target_ovrtimer_terminate 56 #undef target_ovrtimer_handler 42 57 43 58 /* … … 66 81 #undef pl310_clean_and_invalidate_all 67 82 68 /*69 * target_kernel_impl.c70 */71 #undef arm_tnum_memory_area72 #undef arm_memory_area73 74 83 75 84 #endif /* TOPPERS_CORE_RENAME_H */ -
EcnlProtoTool/trunk/asp3_dcre/arch/arm_gcc/common/gic_kernel_impl.c
r321 r429 227 227 */ 228 228 gicd_set_priority(intno, INT_IPM(intpri)); 229 gicd_set_target(intno, 1U << arm_prc_index());229 gicd_set_target(intno, 1U << get_my_prcidx()); 230 230 231 231 /* -
EcnlProtoTool/trunk/asp3_dcre/arch/arm_gcc/common/gic_kernel_impl.h
r321 r429 3 3 * Toyohashi Open Platform for Embedded Real-Time Systems 4 4 * 5 * Copyright (C) 2006-201 7by Embedded and Real-Time Systems Laboratory5 * Copyright (C) 2006-2019 by Embedded and Real-Time Systems Laboratory 6 6 * Graduate School of Information Science, Nagoya Univ., JAPAN 7 7 * … … 67 67 * 割込み番号の定義 68 68 */ 69 #define GIC_INTNO_SGI0 0U70 #define GIC_INTNO_PPI0 16U71 #define GIC_INTNO_SPI0 32U69 #define GIC_INTNO_SGI0 UINT_C(0) 70 #define GIC_INTNO_PPI0 UINT_C(16) 71 #define GIC_INTNO_SPI0 UINT_C(32) 72 72 73 73 /* … … 126 126 #define GICC_EOIR GIC_REG(GICC_BASE, 0x10) 127 127 #define GICC_RPR GIC_REG(GICC_BASE, 0x14) 128 #define GICC_HP IR GIC_REG(GICC_BASE, 0x18)128 #define GICC_HPPIR GIC_REG(GICC_BASE, 0x18) 129 129 130 130 /* … … 198 198 gicc_set_priority(uint_t pri) 199 199 { 200 sil_ wrw_mem(GICC_PMR, pri);200 sil_swrw_mem(GICC_PMR, pri); 201 201 } 202 202 … … 230 230 gicd_disable_int(INTNO intno) 231 231 { 232 sil_ wrw_mem(GICD_ICENABLER(intno / 32), (1U << (intno % 32)));232 sil_swrw_mem(GICD_ICENABLER(intno / 32), (1U << (intno % 32))); 233 233 } 234 234 … … 239 239 gicd_enable_int(INTNO intno) 240 240 { 241 sil_ wrw_mem(GICD_ISENABLER(intno / 32), (1U << (intno % 32)));241 sil_swrw_mem(GICD_ISENABLER(intno / 32), (1U << (intno % 32))); 242 242 } 243 243 … … 248 248 gicd_clear_pending(INTNO intno) 249 249 { 250 sil_ wrw_mem(GICD_ICPENDR(intno / 32), (1U << (intno % 32)));250 sil_swrw_mem(GICD_ICPENDR(intno / 32), (1U << (intno % 32))); 251 251 } 252 252 … … 257 257 gicd_set_pending(INTNO intno) 258 258 { 259 sil_ wrw_mem(GICD_ISPENDR(intno / 32), (1U << (intno % 32)));259 sil_swrw_mem(GICD_ISPENDR(intno / 32), (1U << (intno % 32))); 260 260 } 261 261 … … 271 271 272 272 /* 273 * ソフトウェア生成割込み(SGI)の生成 274 */ 275 Inline void 276 gicd_raise_sgi(INTNO intno) 277 { 278 sil_swrw_mem(GICD_SGIR, (0x02000000 | intno)); 279 } 280 281 /* 273 282 * 割込みのコンフィグレーション 274 283 */ … … 279 288 uint32_t reg; 280 289 281 reg = sil_rew_mem(GICD_ICFGR(intno / 16)); 282 reg &= ~(0x03U << shift); 283 reg |= (config << shift); 284 sil_wrw_mem(GICD_ICFGR(intno / 16), reg); 290 if (intno >= GIC_INTNO_PPI0) { 291 reg = sil_rew_mem(GICD_ICFGR(intno / 16)); 292 reg &= ~(0x03U << shift); 293 reg |= (config << shift); 294 sil_wrw_mem(GICD_ICFGR(intno / 16), reg); 295 } 285 296 } 286 297 … … 318 329 * 割込みターゲットプロセッサの設定 319 330 * 320 * prcsは,ターゲットとするプロセッサを表すビットのビット毎論理和で指321 * 定する.331 * affinityは,ターゲットとするプロセッサを表すビットのビット毎論理和 332 * で指定する. 322 333 * プロセッサ0 : 0x01 323 334 * プロセッサ1 : 0x02 … … 326 337 */ 327 338 Inline void 328 gicd_set_target(INTNO intno, uint_t prcs)339 gicd_set_target(INTNO intno, uint_t affinity) 329 340 { 330 341 uint_t shift = (intno % 4) * 8; … … 333 344 reg = sil_rew_mem(GICD_ITARGETSR(intno / 4)); 334 345 reg &= ~(0xffU << shift); 335 reg |= ( prcs<< shift);346 reg |= (affinity << shift); 336 347 sil_wrw_mem(GICD_ITARGETSR(intno / 4), reg); 337 348 } … … 373 384 */ 374 385 #ifndef TOPPERS_MACRO_ONLY 386 387 /* 388 * 割込み属性の設定のチェック 389 */ 390 Inline bool_t 391 check_intno_cfg(INTNO intno) 392 { 393 return(intcfg_table[intno] != 0U); 394 } 375 395 376 396 /* … … 393 413 394 414 /* 415 * 割込み要求禁止フラグが操作できる割込み番号の範囲の判定 416 */ 417 #ifdef GIC_SUPPORT_DISABLE_SGI 418 #define VALID_INTNO_DISINT(intno) VALID_INTNO(intno) 419 #else /* GIC_SUPPORT_DISABLE_SGI */ 420 #define VALID_INTNO_DISINT(intno) \ 421 (GIC_INTNO_PPI0 <= (intno) && (intno) <= TMAX_INTNO) 422 #endif /* GIC_SUPPORT_DISABLE_SGI */ 423 424 /* 395 425 * 割込み要求禁止フラグのセット 396 * 397 * intnoで指定された割込み要求ラインに対する割込み要求禁止フラグのセッ 398 * トし,割込みを禁止する.割込み属性が設定されていない割込み要求ライ 399 * ンが指定された場合には,falseを返す. 400 */ 401 Inline bool_t 426 */ 427 Inline void 402 428 disable_int(INTNO intno) 403 429 { 404 if (intcfg_table[intno] == 0U) {405 return(false);406 }407 430 gicd_disable_int(intno); 408 return(true);409 431 } 410 432 411 433 /* 412 434 * 割込み要求禁止フラグのクリア 413 * 414 * intnoで指定された割込み要求ラインに対する割込み要求禁止フラグのクリ 415 * アし,割込みを許可する.割込み属性が設定されていない割込み要求ライ 416 * ンが指定された場合には,falseを返す. 435 */ 436 Inline void 437 enable_int(INTNO intno) 438 { 439 gicd_enable_int(intno); 440 } 441 442 /* 443 * 割込み要求がクリアできる割込み番号の範囲の判定 444 */ 445 #define VALID_INTNO_CLRINT(intno) \ 446 (GIC_INTNO_PPI0 <= (intno) && (intno) <= TMAX_INTNO) 447 448 /* 449 * 割込み要求がクリアできる状態か? 417 450 */ 418 451 Inline bool_t 419 enable_int(INTNO intno) 420 { 421 if (intcfg_table[intno] == 0U) { 422 return(false); 452 check_intno_clear(INTNO intno) 453 { 454 return(true); 455 } 456 457 /* 458 * 割込み要求のクリア 459 */ 460 Inline void 461 clear_int(INTNO intno) 462 { 463 gicd_clear_pending(intno); 464 } 465 466 /* 467 * 割込みが要求できる状態か? 468 */ 469 Inline bool_t 470 check_intno_raise(INTNO intno) 471 { 472 return(true); 473 } 474 475 /* 476 * 割込みの要求 477 */ 478 Inline void 479 raise_int(INTNO intno) 480 { 481 if (intno < GIC_INTNO_PPI0) { 482 gicd_raise_sgi(intno); 423 483 } 424 gicd_enable_int(intno); 425 return(true); 426 } 427 428 /* 429 * 割込み要求のクリア 430 */ 431 Inline void 432 clear_int(INTNO intno) 433 { 434 gicd_clear_pending(intno); 484 else { 485 gicd_set_pending(intno); 486 } 435 487 } 436 488 … … 444 496 } 445 497 446 /*447 * 割込み要求のセット448 */449 Inline void450 raise_int(INTNO intno)451 {452 gicd_set_pending(intno);453 }454 455 498 #endif /* TOPPERS_MACRO_ONLY */ 456 499 #endif /* TOPPERS_GIC_KERNEL_IMPL_H */ -
EcnlProtoTool/trunk/asp3_dcre/arch/arm_gcc/common/gic_support.S
r321 r429 5 5 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory 6 6 * Toyohashi Univ. of Technology, JAPAN 7 * Copyright (C) 2006-201 7by Embedded and Real-Time Systems Laboratory7 * Copyright (C) 2006-2018 by Embedded and Real-Time Systems Laboratory 8 8 * Graduate School of Information Science, Nagoya Univ., JAPAN 9 9 * … … 70 70 * 割込み要因を取得する. 71 71 */ 72 #ifdef GIC_PL390_ERRATA /* GIC 390 Errata 801120への対策 */ 73 ldr r1, =GICC_HPPIR 74 ldr r0, [r1] 75 #endif /* GIC_PL390_ERRATA */ 72 76 ldr r1, =GICC_IAR 73 77 ldr r3, [r1] 74 75 /*76 * 割込み番号を求める.77 */78 78 lsl r4, r3, #22 /* 下位10ビットを取り出す */ 79 79 lsr r4, r4, #22 80 80 81 /* 82 * 割込み要求をクリアする. 83 */ 84 and r0, r4, #31 85 mov r2, #1 86 lsl r0, r2, r0 87 ldr r2, =GICD_ICPENDR(0) 88 lsr r1, r4, #5 89 str r0, [r2,r1,lsl #2] 81 #ifdef GIC_PL390_ERRATA /* GIC 390 Errata 733075への対策 */ 82 movw r0, #1023 83 cmp r4, r0 84 beq irc_begin_int_errata_1 85 movw r0, #1022 86 cmp r4, r0 87 beq irc_begin_int_errata_1 88 cmp r3, #0 89 bne irc_begin_int_errata_2 90 ldr r1, =GICD_ISACTIVER(0) /* 割込み要求があるかチェック */ 91 ldr r0, [r1] 92 tst r0, #0x01 93 movweq r4, #1024 /* 無効な割込みとみなす */ 94 ALABEL(irc_begin_int_errata_1) 95 ldr r1, =GICD_IPRIORITYR(0) /* 割込み優先度レジスタ0に書き込み */ 96 ldr r0, [r1] 97 str r0, [r1] 98 asm_data_sync_barrier r0 99 ALABEL(irc_begin_int_errata_2) 100 #endif /* GIC_PL390_ERRATA */ 90 101 91 102 /* … … 107 118 108 119 /* 109 * 割込み番号を返値としてリターンする.120 * r4に割込み番号を入れた状態でリターンする. 110 121 */ 111 122 bx lr -
EcnlProtoTool/trunk/asp3_dcre/arch/arm_gcc/common/pl310.c
r428 r429 43 43 44 44 #include "kernel_impl.h" 45 #include " core_pl310.h"45 #include "pl310.h" 46 46 47 47 Inline uint32_t -
EcnlProtoTool/trunk/asp3_dcre/arch/arm_gcc/common/tUartPL011.c
r321 r429 1 1 /* 2 * TOPPERS/ASP Kernel 3 * Toyohashi Open Platform for Embedded Real-Time Systems/ 4 * Advanced Standard Profile Kernel 5 * 6 * Copyright (C) 2006-2016 by Embedded and Real-Time Systems Laboratory 2 * TOPPERS Software 3 * Toyohashi Open Platform for Embedded Real-Time Systems 4 * 5 * Copyright (C) 2006-2018 by Embedded and Real-Time Systems Laboratory 7 6 * Graduate School of Information Science, Nagoya Univ., JAPAN 8 7 * … … 95 94 CELLCB *p_cellcb = GET_CELLCB(idx); 96 95 97 /* 98 * UARTをディスエーブル 99 */ 100 sil_wrw_mem(UART_CR(ATTR_baseAddress), 0U); 101 102 /* 103 * エラーフラグをクリア 104 */ 105 sil_wrw_mem(UART_ECR(ATTR_baseAddress), 0U); 106 107 /* 108 * FIFOを空にする 109 */ 110 while (uart_pl011_getready(p_cellcb)) { 111 (void) uart_pl011_getchar(p_cellcb); 112 } 113 114 /* 115 * ボーレートと通信規格を設定 116 */ 117 sil_wrw_mem(UART_IBRD(ATTR_baseAddress), ATTR_ibrd); 118 sil_wrw_mem(UART_FBRD(ATTR_baseAddress), ATTR_fbrd); 119 sil_wrw_mem(UART_LCR_H(ATTR_baseAddress), ATTR_lcr_h); 120 121 /* 122 * UARTをイネーブル 123 */ 124 sil_wrw_mem(UART_CR(ATTR_baseAddress), 96 if (!VAR_opened) { 97 /* 98 * 既にオープンしている場合は、二重にオープンしない. 99 */ 100 101 /* 102 * UARTをディスエーブル 103 */ 104 sil_wrw_mem(UART_CR(ATTR_baseAddress), 0U); 105 106 /* 107 * エラーフラグをクリア 108 */ 109 sil_wrw_mem(UART_ECR(ATTR_baseAddress), 0U); 110 111 /* 112 * FIFOを空にする 113 */ 114 while (uart_pl011_getready(p_cellcb)) { 115 (void) uart_pl011_getchar(p_cellcb); 116 } 117 118 /* 119 * ボーレートと通信規格を設定 120 */ 121 sil_wrw_mem(UART_IBRD(ATTR_baseAddress), ATTR_ibrd); 122 sil_wrw_mem(UART_FBRD(ATTR_baseAddress), ATTR_fbrd); 123 sil_wrw_mem(UART_LCR_H(ATTR_baseAddress), ATTR_lcr_h); 124 125 /* 126 * UARTをイネーブル 127 */ 128 sil_wrw_mem(UART_CR(ATTR_baseAddress), 125 129 UART_CR_UARTEN|UART_CR_TXE|UART_CR_RXE); 130 131 VAR_opened = true; 132 } 126 133 } 127 134 … … 134 141 CELLCB *p_cellcb = GET_CELLCB(idx); 135 142 136 /* 137 * UARTをディスエーブル 138 */ 139 sil_wrw_mem(UART_CR(ATTR_baseAddress), 0U); 143 if (VAR_opened) { 144 /* 145 * UARTをディスエーブル 146 */ 147 sil_wrw_mem(UART_CR(ATTR_baseAddress), 0U); 148 149 VAR_opened = false; 150 } 140 151 } 141 152 … … 232 243 } 233 244 } 245 246 /* 247 * SIOドライバの終了処理 248 */ 249 void 250 eTerminate_main(CELLIDX idx) 251 { 252 eSIOPort_close(idx); 253 } -
EcnlProtoTool/trunk/asp3_dcre/arch/arm_gcc/common/tUartPL011.cdl
r321 r429 1 1 /* 2 * TOPPERS/ASP Kernel 3 * Toyohashi Open Platform for Embedded Real-Time Systems/ 4 * Advanced Standard Profile Kernel 2 * TOPPERS Software 3 * Toyohashi Open Platform for Embedded Real-Time Systems 5 4 * 6 5 * Copyright (C) 2015 by Ushio Laboratory 7 6 * Graduate School of Engineering Science, Osaka Univ., JAPAN 8 * Copyright (C) 2015 ,2016by Embedded and Real-Time Systems Laboratory7 * Copyright (C) 2015-2018 by Embedded and Real-Time Systems Laboratory 9 8 * Graduate School of Information Science, Nagoya Univ., JAPAN 10 9 * … … 58 57 59 58 entry siHandlerBody eiISR; 59 entry sRoutineBody eTerminate; 60 60 61 61 attr { … … 65 65 uint8_t lcr_h; /* ライン制御レジスタの設定値 */ 66 66 }; 67 var { 68 bool_t opened = false; /* オープン済み */ 69 }; 67 70 }; -
EcnlProtoTool/trunk/asp3_dcre/arch/arm_gcc/common/uart_pl011.h
r321 r429 1 1 /* 2 * TOPPERS/ASP Kernel 3 * Toyohashi Open Platform for Embedded Real-Time Systems/ 4 * Advanced Standard Profile Kernel 2 * TOPPERS Software 3 * Toyohashi Open Platform for Embedded Real-Time Systems 5 4 * 6 5 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory -
EcnlProtoTool/trunk/asp3_dcre/arch/arm_gcc/rza1/Makefile.chip
r321 r429 2 2 # Makefile のチップ依存部(RZ/A1用) 3 3 # 4 # $Id $4 # $Id: Makefile.chip 720 2016-04-01 22:16:17Z ertl-hiro $ 5 5 # 6 6 … … 22 22 # 23 23 KERNEL_DIRS := $(KERNEL_DIRS) $(CHIPDIR) 24 KERNEL_COBJS := $(KERNEL_COBJS) chip_kernel_impl.o mpcore_kernel_impl.o \ 25 gic_kernel_impl.o pl310.o chip_timer.o 24 26 KERNEL_ASMOBJS := $(KERNEL_ASMOBJS) gic_support.o 25 KERNEL_COBJS := $(KERNEL_COBJS) chip_kernel_impl.o gic_kernel_impl.o \ 26 chip_timer.o 27 28 # 29 # システムサービスに関する定義 30 # 31 SYSSVC_DIRS := $(SYSSVC_DIRS) $(CHIPDIR) 27 32 28 33 # -
EcnlProtoTool/trunk/asp3_dcre/arch/arm_gcc/rza1/chip_kernel.h
r321 r429 3 3 * Toyohashi Open Platform for Embedded Real-Time Systems/ 4 4 * Advanced Standard Profile Kernel 5 * 6 * Copyright (C) 2006-201 6by Embedded and Real-Time Systems Laboratory5 * 6 * Copyright (C) 2006-2018 by Embedded and Real-Time Systems Laboratory 7 7 * Graduate School of Information Science, Nagoya Univ., JAPAN 8 * 8 * 9 9 * 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ 10 10 * ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改 … … 29 29 * 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを 30 30 * 免責すること. 31 * 31 * 32 32 * 本ソフトウェアは,無保証で提供されているものである.上記著作権者お 33 33 * よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的 … … 35 35 * アの利用により直接的または間接的に生じたいかなる損害に関しても,そ 36 36 * の責任を負わない. 37 * 37 * 38 38 * $Id$ 39 39 */ … … 42 42 * kernel.hのターゲット依存部(RZ/A1用) 43 43 * 44 * このヘッダファイルは, kernel.hからインクルードされる.他のファイル45 * から直接インクルードすることはない.このファイルをインクルードする46 * 前に,t_stddef.hがインクルードされるので,それに依存してもよい.44 * このヘッダファイルは,target_kernel.h(または,そこからインクルー 45 * ドされるファイル)のみからインクルードされる.他のファイルから直接 46 * インクルードしてはならない. 47 47 */ 48 48 … … 66 66 * サポートできる機能の定義 67 67 * 68 * ena_int/dis_intとオーバランハンドラをサポートすることができる. 68 * ena_int/dis_int/clr_int/ras_int/prb_intとオーバランハンドラを 69 * サポートすることができる. 69 70 */ 70 71 #define TOPPERS_TARGET_SUPPORT_ENA_INT /* ena_int */ 71 72 #define TOPPERS_TARGET_SUPPORT_DIS_INT /* dis_int */ 73 #define TOPPERS_TARGET_SUPPORT_CLR_INT /* clr_int */ 74 #define TOPPERS_TARGET_SUPPORT_RAS_INT /* ras_int */ 75 #define TOPPERS_TARGET_SUPPORT_PRB_INT /* prb_int */ 72 76 #define TOPPERS_TARGET_SUPPORT_OVRHDR 73 74 /*75 * 高分解能タイマのタイマ周期76 *77 * 2^32 / 33.33…を丸めた値とする.78 */79 #define TCYC_HRTCNT 128849019U80 81 /*82 * 高分解能タイマのカウント値の進み幅83 */84 #define TSTEP_HRTCNT 1U85 86 /*87 * オーバランハンドラの残りプロセッサ時間に指定できる最大値88 *89 * この値をOSタイマへの設定値に変換してタイマに設定した後,タイマの現90 * 在値を読み出してμ秒単位に変換できる値としている.タイマの現在値を91 * μ秒単位に変換する時に34を加えるため,以下の条件を満たす最大の値と92 * する.93 * (TMAX_OVRTIM * 33 + TMAX_OVRTIM / 3 + 1) + 34 < 2^3294 */95 #define TMAX_OVRTIM 128849017U96 77 97 78 /* -
EcnlProtoTool/trunk/asp3_dcre/arch/arm_gcc/rza1/chip_kernel.trb
r321 r429 27 27 # 割込み要求ライン属性に関するターゲット依存のエラーチェック 28 28 # 29 $cfgData[:CFG_INT].each do | key, params|30 if $INTNO_IRQ0 <= key && key<= $INTNO_IRQ729 $cfgData[:CFG_INT].each do |_, params| 30 if $INTNO_IRQ0 <= params[:intno] && params[:intno] <= $INTNO_IRQ7 31 31 # IRQ割込みの場合 32 32 #(TA_EDGEがセットされている場合) -
EcnlProtoTool/trunk/asp3_dcre/arch/arm_gcc/rza1/chip_kernel_impl.c
r321 r429 3 3 * Toyohashi Open Platform for Embedded Real-Time Systems/ 4 4 * Advanced Standard Profile Kernel 5 * 5 * 6 6 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory 7 7 * Toyohashi Univ. of Technology, JAPAN 8 * Copyright (C) 2006-201 6by Embedded and Real-Time Systems Laboratory8 * Copyright (C) 2006-2018 by Embedded and Real-Time Systems Laboratory 9 9 * Graduate School of Information Science, Nagoya Univ., JAPAN 10 * 10 * 11 11 * 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ 12 12 * ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改 … … 31 31 * 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを 32 32 * 免責すること. 33 * 33 * 34 34 * 本ソフトウェアは,無保証で提供されているものである.上記著作権者お 35 35 * よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的 … … 37 37 * アの利用により直接的または間接的に生じたいかなる損害に関しても,そ 38 38 * の責任を負わない. 39 * 39 * 40 40 * $Id$ 41 41 */ … … 46 46 47 47 #include "kernel_impl.h" 48 #include <sil.h> 48 49 #include "interrupt.h" 50 #include "pl310.h" 49 51 50 52 /* … … 55 57 { 56 58 /* 57 * キャッシュをディスエーブル59 * MPCore依存の初期化 58 60 */ 59 arm_disable_cache();61 mpcore_initialize(); 60 62 61 63 /* 62 * コア依存の初期化64 * L2キャッシュコントローラ(PL310)の初期化 63 65 */ 64 core_initialize(); 65 66 /* 67 * キャッシュをイネーブル 68 */ 69 arm_enable_cache(); 70 71 /* 72 * GICのディストリビュータの初期化 73 */ 74 gicd_initialize(); 75 76 /* 77 * GICのCPUインタフェースの初期化 78 */ 79 gicc_initialize(); 80 81 /* 82 * 分岐予測の無効化とイネーブル 83 */ 84 arm_invalidate_bp(); 85 arm_enable_bp(); 66 pl310_initialize(0x0U, ~0x0U); 86 67 } 87 68 88 69 /* 89 * チップ依存 部の終了処理70 * チップ依存の終了処理 90 71 */ 91 72 void 92 73 chip_terminate(void) 93 74 { 94 extern void software_term_hook(void);95 void (*volatile fp)(void) = software_term_hook;96 97 75 /* 98 * software_term_hookへのポインタを,一旦volatile指定のあるfpに代 99 * 入してから使うのは,0との比較が最適化で削除されないようにするた 100 * めである. 76 * MPCore依存の終了処理 101 77 */ 102 if (fp != 0) { 103 (*fp)(); 104 } 105 106 /* 107 * GICのCPUインタフェースの終了処理 108 */ 109 gicc_terminate(); 110 111 /* 112 * GICのディストリビュータの終了処理 113 */ 114 gicd_terminate(); 115 116 /* 117 * コア依存の終了処理 118 */ 119 core_terminate(); 78 mpcore_terminate(); 120 79 } 121 80 … … 177 136 */ 178 137 gicd_set_priority(intno, INT_IPM(intpri)); 179 gicd_set_target(intno, 1U << arm_prc_index());138 gicd_set_target(intno, 1U << get_my_prcidx()); 180 139 181 140 /* -
EcnlProtoTool/trunk/asp3_dcre/arch/arm_gcc/rza1/chip_kernel_impl.h
r321 r429 3 3 * Toyohashi Open Platform for Embedded Real-Time Systems/ 4 4 * Advanced Standard Profile Kernel 5 * 5 * 6 6 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory 7 7 * Toyohashi Univ. of Technology, JAPAN 8 * Copyright (C) 2006-201 6by Embedded and Real-Time Systems Laboratory8 * Copyright (C) 2006-2018 by Embedded and Real-Time Systems Laboratory 9 9 * Graduate School of Information Science, Nagoya Univ., JAPAN 10 * 10 * 11 11 * 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ 12 12 * ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改 … … 31 31 * 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを 32 32 * 免責すること. 33 * 33 * 34 34 * 本ソフトウェアは,無保証で提供されているものである.上記著作権者お 35 35 * よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的 … … 37 37 * アの利用により直接的または間接的に生じたいかなる損害に関しても,そ 38 38 * の責任を負わない. 39 * 39 * 40 40 * $Id$ 41 41 */ … … 58 58 59 59 /* 60 * MMUの使用に関する設定60 * デフォルトの非タスクコンテキスト用のスタック領域の定義 61 61 */ 62 #define USE_ARM_MMU 63 #define USE_ARM_SSECTION 62 #ifndef DEFAULT_ISTKSZ 63 #define DEFAULT_ISTKSZ 0x2000U /* 8KB */ 64 #endif /* DEFAULT_ISTKSZ */ 64 65 65 66 /* … … 70 71 71 72 /* 72 * GIC依存部の割込み管理機能の初期化は使用しない. 73 * GIC 390 Errataへの対策を実施 74 */ 75 #define GIC_PL390_ERRATA 76 77 /* 78 * GIC依存部の割込み管理機能の初期化は使用しない 73 79 */ 74 80 #define OMIT_GIC_INITIALIZE_INTERRUPT 75 81 76 82 /* 77 * GICに関する定義,コアで共通な定義 78 * 79 * core_kernel_impl.hは,gic_kernel_impl.hからインクルードされる. 83 * MPCoreで共通な定義 80 84 */ 81 #include " gic_kernel_impl.h"85 #include "mpcore_kernel_impl.h" 82 86 83 87 #ifndef TOPPERS_MACRO_ONLY -
EcnlProtoTool/trunk/asp3_dcre/arch/arm_gcc/rza1/chip_rename.def
r331 r429 6 6 target_hrt_initialize 7 7 target_hrt_terminate 8 target_hrt_set_event9 target_hrt_raise_event10 8 target_hrt_handler 11 9 target_ovrtimer_initialize 12 10 target_ovrtimer_terminate 13 target_ovrtimer_stop14 target_ovrtimer_get_current15 11 target_ovrtimer_handler 16 12 -
EcnlProtoTool/trunk/asp3_dcre/arch/arm_gcc/rza1/chip_rename.h
r321 r429 15 15 #define target_hrt_initialize _kernel_target_hrt_initialize 16 16 #define target_hrt_terminate _kernel_target_hrt_terminate 17 #define target_hrt_set_event _kernel_target_hrt_set_event18 #define target_hrt_raise_event _kernel_target_hrt_raise_event19 17 #define target_hrt_handler _kernel_target_hrt_handler 20 18 #define target_ovrtimer_initialize _kernel_target_ovrtimer_initialize 21 19 #define target_ovrtimer_terminate _kernel_target_ovrtimer_terminate 22 #define target_ovrtimer_stop _kernel_target_ovrtimer_stop23 #define target_ovrtimer_get_current _kernel_target_ovrtimer_get_current24 20 #define target_ovrtimer_handler _kernel_target_ovrtimer_handler 25 21 -
EcnlProtoTool/trunk/asp3_dcre/arch/arm_gcc/rza1/chip_stddef.h
r321 r429 1 /*2 * TOPPERS Software3 * Toyohashi Open Platform for Embedded Real-Time Systems4 *5 * Copyright (C) 2007 by Embedded and Real-Time Systems Laboratory6 * Graduate School of Information Science, Nagoya Univ., JAPAN7 * Copyright (C) 2011-2016 by Embedded and Real-Time Systems Laboratory8 * Graduate School of Information Science, Nagoya Univ., JAPAN9 *10 * 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ11 * ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改12 * 変・再配布(以下,利用と呼ぶ)することを無償で許諾する.13 * (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作14 * 権表示,この利用条件および下記の無保証規定が,そのままの形でソー15 * スコード中に含まれていること.16 * (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使17 * 用できる形で再配布する場合には,再配布に伴うドキュメント(利用18 * 者マニュアルなど)に,上記の著作権表示,この利用条件および下記19 * の無保証規定を掲載すること.20 * (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使21 * 用できない形で再配布する場合には,次のいずれかの条件を満たすこ22 * と.23 * (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著24 * 作権表示,この利用条件および下記の無保証規定を掲載すること.25 * (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに26 * 報告すること.27 * (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損28 * 害からも,上記著作権者およびTOPPERSプロジェクトを免責すること.29 * また,本ソフトウェアのユーザまたはエンドユーザからのいかなる理30 * 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを31 * 免責すること.32 *33 * 本ソフトウェアは,無保証で提供されているものである.上記著作権者お34 * よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的35 * に対する適合性も含めて,いかなる保証も行わない.また,本ソフトウェ36 * アの利用により直接的または間接的に生じたいかなる損害に関しても,そ37 * の責任を負わない.38 *39 * $Id$40 */41 42 1 /* 43 2 * t_stddef.hのチップ依存部(RZ/A1用) … … 46 5 * されるファイル)のみからインクルードされる.他のファイルから直接イ 47 6 * ンクルードしてはならない. 7 * 8 * $Id$ 48 9 */ 49 10 … … 64 25 65 26 /* 27 * 開発環境で共通な定義 28 */ 29 #ifndef TOPPERS_MACRO_ONLY 30 #include <stdint.h> 31 #endif /* TOPPERS_MACRO_ONLY */ 32 33 #define TOPPERS_STDFLOAT_TYPE1 34 #include "tool_stddef.h" 35 36 /* 66 37 * コアで共通な定義 67 38 */ -
EcnlProtoTool/trunk/asp3_dcre/arch/arm_gcc/rza1/chip_sym.def
r331 r429 1 TARGET_RZA1H,true,bool,defined(TARGET_RZA1H) 2 TARGET_RZA1L,true,bool,defined(TARGET_RZA1L) 1 TARGET_RZA1H,true,bool,defined(TARGET_RZA1H),false 2 TARGET_RZA1L,true,bool,defined(TARGET_RZA1L),false 3 3 TA_NEGEDGE 4 4 TA_POSEDGE -
EcnlProtoTool/trunk/asp3_dcre/arch/arm_gcc/rza1/chip_timer.c
r321 r429 4 4 * Advanced Standard Profile Kernel 5 5 * 6 * Copyright (C) 2006-201 7by Embedded and Real-Time Systems Laboratory6 * Copyright (C) 2006-2018 by Embedded and Real-Time Systems Laboratory 7 7 * Graduate School of Information Science, Nagoya Univ., JAPAN 8 8 * … … 100 100 101 101 /* 102 * 高分解能タイマへの割込みタイミングの設定103 */104 void105 target_hrt_set_event(HRTCNT hrtcnt)106 {107 uint32_t cnt = hrtcnt * 33 + hrtcnt / 3 + 1;108 uint32_t current;109 110 /*111 * 現在のカウント値を読み,hrtcnt後に割込みが発生するように設定する.112 */113 current = sil_rew_mem(OSTM_CNT(OSTM0_BASE));114 sil_wrw_mem(OSTM_CMP(OSTM0_BASE), current + cnt);115 116 /*117 * 上で現在のカウント値を読んで以降に,cnt以上カウントアップしてい118 * た場合には,割込みを発生させる.119 */120 if (sil_rew_mem(OSTM_CNT(OSTM0_BASE)) - current >= cnt) {121 raise_int(INTNO_OSTM0);122 }123 }124 125 /*126 * 高分解能タイマ割込みの要求127 */128 void129 target_hrt_raise_event(void)130 {131 raise_int(INTNO_OSTM0);132 }133 134 /*135 102 * タイマ割込みハンドラ 136 103 */ … … 143 110 signal_time(); 144 111 } 112 145 113 /* 146 114 * オーバランタイマドライバ … … 183 151 184 152 /* 185 * オーバランタイマの停止186 */187 PRCTIM188 target_ovrtimer_stop(void)189 {190 uint32_t cnt;191 192 /*193 * OSタイマを停止する.194 */195 sil_wrb_mem(OSTM_TT(OSTM1_BASE), OSTM_TT_STOP);196 197 if (probe_int(INTNO_OSTM1)) {198 /*199 * 割込み要求が発生している場合200 */201 clear_int(INTNO_OSTM1);202 return(0U);203 }204 else {205 cnt = sil_rew_mem(OSTM_CNT(OSTM1_BASE));206 return((PRCTIM)((cnt + 34) / 5 * 3 / 20));207 }208 }209 210 /*211 * オーバランタイマの現在値の読出し212 */213 PRCTIM214 target_ovrtimer_get_current(void)215 {216 uint32_t cnt;217 218 if (probe_int(INTNO_OSTM1)) {219 /*220 * 割込み要求が発生している場合221 */222 return(0U);223 }224 else {225 cnt = sil_rew_mem(OSTM_CNT(OSTM1_BASE));226 return((PRCTIM)((cnt + 34) / 5 * 3 / 20));227 }228 }229 230 /*231 153 * オーバランタイマ割込みハンドラ 232 154 * -
EcnlProtoTool/trunk/asp3_dcre/arch/arm_gcc/rza1/chip_timer.cfg
r321 r429 1 1 /* 2 * タイマドライバのコンフィギュレーションファイル 2 * タイマドライバのコンフィギュレーションファイル(RZ/A1 OSタイマ用) 3 3 * 4 4 * $Id$ … … 10 10 ATT_INI({ TA_NULL, 0, _kernel_target_hrt_initialize }); 11 11 ATT_TER({ TA_NULL, 0, _kernel_target_hrt_terminate }); 12 12 13 CFG_INT(INTNO_TIMER, { TA_ENAINT|INTATR_TIMER, INTPRI_TIMER }); 13 14 DEF_INH(INHNO_TIMER, { TA_NULL, _kernel_target_hrt_handler }); … … 17 18 */ 18 19 #ifdef TOPPERS_SUPPORT_OVRHDR 20 19 21 ATT_INI({ TA_NULL, 0, _kernel_target_ovrtimer_initialize }); 20 22 ATT_TER({ TA_NULL, 0, _kernel_target_ovrtimer_terminate }); 23 21 24 CFG_INT(INTNO_OVRTIMER, { TA_ENAINT|INTATR_OVRTIMER, INTPRI_OVRTIMER }); 22 25 DEF_INH(INHNO_OVRTIMER, { TA_NULL, _kernel_target_ovrtimer_handler }); 26 23 27 #endif /* TOPPERS_SUPPORT_OVRHDR */ -
EcnlProtoTool/trunk/asp3_dcre/arch/arm_gcc/rza1/chip_timer.h
r321 r429 6 6 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory 7 7 * Toyohashi Univ. of Technology, JAPAN 8 * Copyright (C) 2005-201 6by Embedded and Real-Time Systems Laboratory8 * Copyright (C) 2005-2018 by Embedded and Real-Time Systems Laboratory 9 9 * Graduate School of Information Science, Nagoya Univ., JAPAN 10 10 * … … 51 51 #define TOPPERS_CHIP_TIMER_H 52 52 53 #include "kernel/kernel_impl.h" 53 54 #include <sil.h> 54 55 #include "rza1.h" … … 140 141 * 生させるように設定する. 141 142 */ 142 extern void target_hrt_set_event(HRTCNT hrtcnt); 143 Inline void 144 target_hrt_set_event(HRTCNT hrtcnt) 145 { 146 uint32_t cnt = hrtcnt * 33 + hrtcnt / 3 + 1; 147 uint32_t current; 148 149 /* 150 * 現在のカウント値を読み,hrtcnt後に割込みが発生するように設定する. 151 */ 152 current = sil_rew_mem(OSTM_CNT(OSTM0_BASE)); 153 sil_wrw_mem(OSTM_CMP(OSTM0_BASE), current + cnt); 154 155 /* 156 * 上で現在のカウント値を読んで以降に,cnt以上カウントアップしてい 157 * た場合には,割込みを発生させる. 158 */ 159 if (sil_rew_mem(OSTM_CNT(OSTM0_BASE)) - current >= cnt) { 160 raise_int(INTNO_OSTM0); 161 } 162 } 143 163 144 164 /* 145 165 * 高分解能タイマ割込みの要求 146 166 */ 147 extern void target_hrt_raise_event(void); 167 Inline void 168 target_hrt_raise_event(void) 169 { 170 raise_int(INTNO_OSTM0); 171 } 148 172 149 173 /* … … 184 208 * オーバランタイマの停止 185 209 */ 186 extern PRCTIM target_ovrtimer_stop(void); 210 Inline PRCTIM 211 target_ovrtimer_stop(void) 212 { 213 uint32_t cnt; 214 215 /* 216 * OSタイマを停止する. 217 */ 218 sil_wrb_mem(OSTM_TT(OSTM1_BASE), OSTM_TT_STOP); 219 220 if (probe_int(INTNO_OSTM1)) { 221 /* 222 * 割込み要求が発生している場合 223 */ 224 clear_int(INTNO_OSTM1); 225 return(0U); 226 } 227 else { 228 cnt = sil_rew_mem(OSTM_CNT(OSTM1_BASE)); 229 return((PRCTIM)((cnt + 34) / 5 * 3 / 20)); 230 } 231 } 187 232 188 233 /* 189 234 * オーバランタイマの現在値の読出し 190 235 */ 191 extern PRCTIM target_ovrtimer_get_current(void); 236 Inline PRCTIM 237 target_ovrtimer_get_current(void) 238 { 239 uint32_t cnt; 240 241 if (probe_int(INTNO_OSTM1)) { 242 /* 243 * 割込み要求が発生している場合 244 */ 245 return(0U); 246 } 247 else { 248 cnt = sil_rew_mem(OSTM_CNT(OSTM1_BASE)); 249 return((PRCTIM)((cnt + 34) / 5 * 3 / 20)); 250 } 251 } 192 252 193 253 /* -
EcnlProtoTool/trunk/asp3_dcre/arch/arm_gcc/rza1/chip_unrename.h
r321 r429 16 16 #undef target_hrt_initialize 17 17 #undef target_hrt_terminate 18 #undef target_hrt_set_event19 #undef target_hrt_raise_event20 18 #undef target_hrt_handler 21 19 #undef target_ovrtimer_initialize 22 20 #undef target_ovrtimer_terminate 23 #undef target_ovrtimer_stop24 #undef target_ovrtimer_get_current25 21 #undef target_ovrtimer_handler 26 22 -
EcnlProtoTool/trunk/asp3_dcre/arch/arm_gcc/rza1/rza1.h
r321 r429 2 2 * TOPPERS Software 3 3 * Toyohashi Open Platform for Embedded Real-Time Systems 4 * 5 * Copyright (C) 2006-201 6by Embedded and Real-Time Systems Laboratory4 * 5 * Copyright (C) 2006-2018 by Embedded and Real-Time Systems Laboratory 6 6 * Graduate School of Information Science, Nagoya Univ., JAPAN 7 * 7 * 8 8 * 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ 9 9 * ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改 … … 28 28 * 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを 29 29 * 免責すること. 30 * 30 * 31 31 * 本ソフトウェアは,無保証で提供されているものである.上記著作権者お 32 32 * よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的 … … 34 34 * アの利用により直接的または間接的に生じたいかなる損害に関しても,そ 35 35 * の責任を負わない. 36 * 36 * 37 37 * $Id$ 38 38 */ … … 45 45 #define TOPPERS_RZA1_H 46 46 47 #include <kernel.h> 47 48 #include <sil.h> 49 #include "arm.h" 48 50 49 51 /* … … 84 86 85 87 /* 88 * CP15の補助制御レジスタ(ACTLR)の設定値 89 */ 90 #define CP15_ACTLR_SMP UINT_C(0x00000040) 91 92 /* 86 93 * GIC依存部を使用するための定義 87 94 */ … … 92 99 #define GIC_TNUM_INTNO UINT_C(538) 93 100 #endif /* TOPPERS_RZA1H */ 94 #endif /* GIC_TNUM_INT */101 #endif /* GIC_TNUM_INTNO */ 95 102 96 103 /* … … 256 263 reg = sil_reh_mem(RZA1_IRQRR); 257 264 reg &= ~(0x01U << (intno - INTNO_IRQ0)); 258 sil_ wrh_mem(RZA1_IRQRR, reg);265 sil_swrh_mem(RZA1_IRQRR, reg); 259 266 } 260 267 -
EcnlProtoTool/trunk/asp3_dcre/arch/arm_gcc/rza1/scif.h
r321 r429 1 1 /* 2 * TOPPERS/ASP Kernel 3 * Toyohashi Open Platform for Embedded Real-Time Systems/ 4 * Advanced Standard Profile Kernel 5 * 2 * TOPPERS Software 3 * Toyohashi Open Platform for Embedded Real-Time Systems 4 * 6 5 * Copyright (C) 2001-2011 by Industrial Technology Institute, 7 6 * Miyagi Prefectural Government, JAPAN 8 7 * Copyright (C) 2007-2016 by Embedded and Real-Time Systems Laboratory 9 8 * Graduate School of Information Science, Nagoya Univ., JAPAN 10 * 9 * 11 10 * 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ 12 11 * ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改 … … 31 30 * 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを 32 31 * 免責すること. 33 * 32 * 34 33 * 本ソフトウェアは,無保証で提供されているものである.上記著作権者お 35 34 * よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的 … … 37 36 * アの利用により直接的または間接的に生じたいかなる損害に関しても,そ 38 37 * の責任を負わない. 39 * 38 * 40 39 * $Id$ 41 40 */ … … 66 65 * シリアルモードレジスタ(SCIF_SCSMR)の設定値 67 66 */ 67 #define SCIF_SCSMR_ASYNC 0x0000U /* 調歩同期式モード */ 68 68 #define SCIF_SCSMR_SYNC 0x0080U /* クロック同期式モード */ 69 #define SCIF_SCSMR_8BIT 0x0000U /* 8ビットデータ */ 69 70 #define SCIF_SCSMR_7BIT 0x0040U /* 7ビットデータ */ 70 #define SCIF_SCSMR_PARITY 0x0020U /* パリティビットの付加 */ 71 #define SCIF_SCSMR_NOPARITY 0x0000U /* パリティビットなし */ 72 #define SCIF_SCSMR_PARITY 0x0020U /* パリティビット付加 */ 73 #define SCIF_SCSMR_EVEN 0x0000U /* 偶数パリティ */ 71 74 #define SCIF_SCSMR_ODD 0x0010U /* 奇数パリティ */ 75 #define SCIF_SCSMR_1STOP 0x0000U /* 1ストッピビット */ 72 76 #define SCIF_SCSMR_2STOP 0x0008U /* 2ストッピビット */ 73 77 #define SCIF_SCSMR_CKS1 0x0000U /* P1φクロック1 */ -
EcnlProtoTool/trunk/asp3_dcre/arch/arm_gcc/rza1/tSCIF.c
r321 r429 1 1 /* 2 * TOPPERS/ASP Kernel 3 * Toyohashi Open Platform for Embedded Real-Time Systems/ 4 * Advanced Standard Profile Kernel 2 * TOPPERS Software 3 * Toyohashi Open Platform for Embedded Real-Time Systems 5 4 * 6 * Copyright (C) 2006-201 6by Embedded and Real-Time Systems Laboratory5 * Copyright (C) 2006-2019 by Embedded and Real-Time Systems Laboratory 7 6 * Graduate School of Information Science, Nagoya Univ., JAPAN 8 7 * … … 133 132 uint_t brr; 134 133 135 if (VAR_initialized) { 136 /* 137 * 既に初期化している場合は、二重に初期化しない. 138 */ 139 return; 140 } 141 142 brr = SCIF_CLK / (32 * ATTR_baudRate) - 1; 143 assert(brr <= 255); 144 145 sil_wrh_mem(SCIF_SCSCR(ATTR_baseAddress), 0U); 146 sil_wrh_mem(SCIF_SCFCR(ATTR_baseAddress), 134 if (!VAR_opened) { 135 /* 136 * 既にオープンしている場合は、二重にオープンしない. 137 */ 138 brr = SCIF_CLK / (32 * ATTR_baudRate) - 1; 139 assert(brr <= 255); 140 141 sil_wrh_mem(SCIF_SCSCR(ATTR_baseAddress), 0U); 142 sil_wrh_mem(SCIF_SCFCR(ATTR_baseAddress), 147 143 SCIF_SCFCR_TFRST|SCIF_SCFCR_RFRST); 148 (void) sil_reh_mem(SCIF_SCFSR(ATTR_baseAddress)); 149 (void) sil_reh_mem(SCIF_SCLSR(ATTR_baseAddress)); 150 sil_wrh_mem(SCIF_SCFSR(ATTR_baseAddress), 0U); 151 sil_wrh_mem(SCIF_SCLSR(ATTR_baseAddress), 0U); 152 sil_wrh_mem(SCIF_SCSCR(ATTR_baseAddress), SCIF_SCSCR_INTCLK); 153 sil_wrh_mem(SCIF_SCSMR(ATTR_baseAddress), SCIF_SCSMR_CKS1); 154 sil_wrh_mem(SCIF_SCEMR(ATTR_baseAddress), 0U); 155 sil_wrb_mem(SCIF_SCBRR(ATTR_baseAddress), (uint8_t) brr); 156 sil_wrh_mem(SCIF_SCFCR(ATTR_baseAddress), 144 (void) sil_reh_mem(SCIF_SCFSR(ATTR_baseAddress)); 145 (void) sil_reh_mem(SCIF_SCLSR(ATTR_baseAddress)); 146 sil_wrh_mem(SCIF_SCFSR(ATTR_baseAddress), 0U); 147 sil_wrh_mem(SCIF_SCLSR(ATTR_baseAddress), 0U); 148 sil_wrh_mem(SCIF_SCSCR(ATTR_baseAddress), SCIF_SCSCR_INTCLK); 149 sil_wrh_mem(SCIF_SCSMR(ATTR_baseAddress), 150 SCIF_SCSMR_ASYNC|ATTR_mode|SCIF_SCSMR_CKS1); 151 sil_wrh_mem(SCIF_SCEMR(ATTR_baseAddress), 0U); 152 sil_wrb_mem(SCIF_SCBRR(ATTR_baseAddress), (uint8_t) brr); 153 sil_wrh_mem(SCIF_SCFCR(ATTR_baseAddress), 157 154 SCIF_SCFCR_RSTRG_15|SCIF_SCFCR_RTRG_1|SCIF_SCFCR_TTRG_8); 158 sil_wrh_mem(SCIF_SCSCR(ATTR_baseAddress),155 sil_wrh_mem(SCIF_SCSCR(ATTR_baseAddress), 159 156 SCIF_SCSCR_TE|SCIF_SCSCR_RE|SCIF_SCSCR_INTCLK); 160 157 161 while ((sil_reh_mem(SCIF_SCFSR(ATTR_baseAddress)) & SCIF_SCFSR_RDF) != 0U) { 162 (void) sil_reb_mem(SCIF_SCFRDR(ATTR_baseAddress)); 163 sil_wrh_mem(SCIF_SCFSR(ATTR_baseAddress), (uint16_t) ~(SCIF_SCFSR_RDF)); 164 } 165 sil_wrh_mem(SCIF_SCFSR(ATTR_baseAddress), 0U); 166 167 VAR_initialized = true; 158 while ((sil_reh_mem(SCIF_SCFSR(ATTR_baseAddress)) & SCIF_SCFSR_RDF) 159 != 0U) { 160 (void) sil_reb_mem(SCIF_SCFRDR(ATTR_baseAddress)); 161 sil_wrh_mem(SCIF_SCFSR(ATTR_baseAddress), 162 (uint16_t) ~(SCIF_SCFSR_RDF)); 163 } 164 sil_wrh_mem(SCIF_SCFSR(ATTR_baseAddress), 0U); 165 166 VAR_opened = true; 167 } 168 168 } 169 169 … … 176 176 CELLCB *p_cellcb = GET_CELLCB(idx); 177 177 178 sil_wrh_mem(SCIF_SCSCR(ATTR_baseAddress), 0U); 178 if (VAR_opened) { 179 sil_wrh_mem(SCIF_SCSCR(ATTR_baseAddress), 0U); 180 181 VAR_opened = false; 182 } 179 183 } 180 184 … … 284 288 } 285 289 } 290 291 /* 292 * SIOドライバの終了処理 293 */ 294 void 295 eTerminate_main(CELLIDX idx) 296 { 297 CELLCB *p_cellcb = GET_CELLCB(idx); 298 299 if (VAR_opened) { 300 /* 301 * 送信FIFOが空になるまで待つ 302 */ 303 while ((sil_reh_mem(SCIF_SCFSR(ATTR_baseAddress)) 304 & SCIF_SCFSR_TEND) == 0U) ; 305 /* 306 * ポートのクローズ 307 */ 308 eSIOPort_close(idx); 309 } 310 } -
EcnlProtoTool/trunk/asp3_dcre/arch/arm_gcc/rza1/tSCIF.cdl
r321 r429 5 5 * Copyright (C) 2015 by Ushio Laboratory 6 6 * Graduate School of Engineering Science, Osaka Univ., JAPAN 7 * Copyright (C) 2015 ,2016by Embedded and Real-Time Systems Laboratory7 * Copyright (C) 2015-2018 by Embedded and Real-Time Systems Laboratory 8 8 * Graduate School of Information Science, Nagoya Univ., JAPAN 9 9 * … … 61 61 entry siHandlerBody eiRxISR; 62 62 entry siHandlerBody eiTxISR; 63 entry sRoutineBody eTerminate; 63 64 64 65 attr { 65 66 uintptr_t baseAddress; /* SCIFレジスタのベースアドレス */ 66 uint32_t baudRate; /* ボーレートの設定値 */ 67 uint16_t mode; /* モードレジスタの設定値 */ 68 uint32_t baudRate; /* ボーレート */ 67 69 }; 68 70 var { 69 bool_t initialized = false; /* 初期化済み */71 bool_t opened = false; /* オープン済み */ 70 72 }; 71 73 }; -
EcnlProtoTool/trunk/asp3_dcre/arch/gcc/tool_stddef.h
r321 r429 5 5 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory 6 6 * Toyohashi Univ. of Technology, JAPAN 7 * Copyright (C) 2004-201 1by Embedded and Real-Time Systems Laboratory7 * Copyright (C) 2004-2018 by Embedded and Real-Time Systems Laboratory 8 8 * Graduate School of Information Science, Nagoya Univ., JAPAN 9 9 * … … 90 90 * 91 91 * TOPPERS_STDINT_TYPE1: char/short/int/long longのビット長がそれぞれ 92 * 8/16/32/64ビットで, ポインタのビット長がlong93 * のビット長と一致する場合92 * 8/16/32/64ビットで,size_tとポインタのビット 93 * 長がlongのビット長と一致する場合 94 94 */ 95 95 #ifdef TOPPERS_STDINT_TYPE1 … … 177 177 #define INT_LEAST8_MIN INT8_MIN 178 178 #define UINT_LEAST8_MAX INT8_MAX 179 180 #define SIZE_MAX ULONG_MAX 179 181 180 182 #endif /* TOPPERS_STDINT_TYPE1 */ -
EcnlProtoTool/trunk/asp3_dcre/arch/tracelog/tTraceLog.c
r331 r429 5 5 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory 6 6 * Toyohashi Univ. of Technology, JAPAN 7 * Copyright (C) 2005-201 6by Embedded and Real-Time Systems Laboratory7 * Copyright (C) 2005-2019 by Embedded and Real-Time Systems Laboratory 8 8 * Graduate School of Information Science, Nagoya Univ., JAPAN 9 9 * … … 48 48 #include "kernel/task.h" 49 49 #include "kernel/time_event.h" 50 #ifdef TOPPERS_SUPPORT_PROTECT 51 #include "kernel/domain.h" 52 #endif /* TOPPERS_SUPPORT_PROTECT */ 50 53 #include <sil.h> 51 54 #include <log_output.h> … … 56 59 * 57 60 * デフォルトでは,ログ時刻として,高分解能タイマのカウント値を用いて 58 * いる.ターゲット依存で変更する場合には, SYSLOG_GET_LOGTIMに,ログ時61 * いる.ターゲット依存で変更する場合には,TRACE_GET_LOGTIMに,ログ時 59 62 * 刻を取り出すマクロを定義する. 60 63 */ 61 #ifndef SYSLOG_GET_LOGTIM62 #define SYSLOG_GET_LOGTIM(p_logtim) \64 #ifndef TRACE_GET_LOGTIM 65 #define TRACE_GET_LOGTIM(p_logtim) \ 63 66 (*(p_logtim) = target_hrt_get_current()) 64 #endif /* SYSLOG_GET_TIM */65 66 /* 67 * トレースログの開始 67 #endif /* TRACE_GET_TIM */ 68 69 /* 70 * トレースログの開始(受け口関数) 68 71 */ 69 72 ER … … 81 84 82 85 /* 83 * トレースログの書込み 86 * トレースログの書込み(受け口関数) 84 87 */ 85 88 ER … … 94 97 * トレース時刻の設定 95 98 */ 96 SYSLOG_GET_LOGTIM(&(((SYSLOG *) p_trace)->logtim));99 TRACE_GET_LOGTIM(&(((SYSLOG *) p_trace)->logtim)); 97 100 98 101 /* … … 121 124 122 125 /* 123 * トレースログの読出し 126 * トレースログの読出し(受け口関数) 124 127 */ 125 128 ER … … 203 206 p_tcb = (TCB *) info; 204 207 if (p_tcb == NULL) { 205 tskid = 0;208 tskid = TSK_NONE; 206 209 } 207 210 else { … … 240 243 } 241 244 245 #ifdef TOPPERS_SUPPORT_PROTECT 246 247 static intptr_t 248 get_somid(intptr_t info) 249 { 250 SOMINIB *p_sominib; 251 ID somid; 252 253 p_sominib = (SOMINIB *) info; 254 if (p_sominib == NULL) { 255 somid = TSOM_STP; 256 } 257 else { 258 somid = SOMID(p_sominib); 259 } 260 return((intptr_t) somid); 261 } 262 263 static intptr_t 264 get_twd_domid(intptr_t info) 265 { 266 TWDINIB *p_twdinib; 267 ID domid; 268 269 p_twdinib = (TWDINIB *) info; 270 domid = (ID)(p_twdinib->p_dominib - dominib_table) + TMIN_DOMID; 271 return((intptr_t) domid); 272 } 273 274 #endif /* TOPPERS_SUPPORT_PROTECT */ 275 242 276 /* 243 277 * トレースログの表示 … … 267 301 tracemsg = "dispatch to task %d."; 268 302 break; 303 304 #ifdef TOPPERS_SUPPORT_PROTECT 305 case LOG_TYPE_SCYC|LOG_START: 306 traceinfo[0] = get_somid(p_trace->logpar[0]); 307 tracemsg = "system cycle starts with system operating mode %d."; 308 break; 309 case LOG_TYPE_TWD|LOG_START: 310 if (p_trace->logpar[0] == 0) { 311 tracemsg = "idle window starts."; 312 } 313 else { 314 traceinfo[0] = get_twd_domid(p_trace->logpar[0]); 315 tracemsg = "time window for domain %d starts."; 316 } 317 break; 318 #endif /* TOPPERS_SUPPORT_PROTECT */ 319 269 320 case LOG_TYPE_COMMENT: 270 321 for (i = 1; i < TNUM_LOGPAR; i++) { … … 313 364 } 314 365 315 /* 316 * トレースログのダンプ 317 */ 318 void 319 e TraceLog_dump(void)366 /* 367 * トレースログのダンプ(受け口関数) 368 */ 369 void 370 eDump_main(uintptr_t exinf) 320 371 { 321 372 TRACE trace; … … 325 376 } 326 377 } 327 328 /*329 * トレースログのダンプ(受け口関数)330 */331 void332 tTraceLog_eDump_main(uintptr_t exinf)333 {334 eTraceLog_dump();335 } -
EcnlProtoTool/trunk/asp3_dcre/arch/tracelog/tTraceLog.cdl
r321 r429 1 1 /* 2 * TOPPERS/ASP Kernel 3 * Toyohashi Open Platform for Embedded Real-Time Systems/ 4 * Advanced Standard Profile Kernel 2 * TOPPERS Software 3 * Toyohashi Open Platform for Embedded Real-Time Systems 5 4 * 6 5 * Copyright (C) 2015 by Ushio Laboratory 7 6 * Graduate School of Engineering Science, Osaka Univ., JAPAN 8 * Copyright (C) 2015 ,2016by Embedded and Real-Time Systems Laboratory7 * Copyright (C) 2015-2018 by Embedded and Real-Time Systems Laboratory 9 8 * Graduate School of Information Science, Nagoya Univ., JAPAN 10 9 * … … 68 67 */ 69 68 ER read([out] TRACE *p_trace); 70 71 /*72 * トレースログのダンプ73 */74 void dump(void);75 69 }; 76 70 … … 81 75 celltype tTraceLog { 82 76 entry sTraceLog eTraceLog; 83 entry sRoutineBody eDump; /* 終了処理ルーチンとの接続*/84 call sPutLog cPutLog; /* 低レベル出力との接続 */77 entry sRoutineBody eDump; /* トレースログのダンプ */ 78 call sPutLog cPutLog; /* ダンプ先との接続 */ 85 79 86 80 attr { -
EcnlProtoTool/trunk/asp3_dcre/arch/tracelog/trace_log.h
r331 r429 5 5 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory 6 6 * Toyohashi Univ. of Technology, JAPAN 7 * Copyright (C) 2004-201 6by Embedded and Real-Time Systems Laboratory7 * Copyright (C) 2004-2019 by Embedded and Real-Time Systems Laboratory 8 8 * Graduate School of Information Science, Nagoya Univ., JAPAN 9 9 * … … 41 41 42 42 /* 43 * トレースログ に関する設定43 * トレースログ機能のヘッダファイル 44 44 * 45 45 * このインクルードファイルは,target_kernel_impl.hおよび 46 * target_syssvc.h のみからインクルードされる.また,トレースログ機能の47 * 初期化や記録の開始/停止,トレースログのダンプを行うプログラムから48 * インクルードすることを想定している.49 */ 50 51 #ifndef TOPPERS_TRACE_ CONFIG_H52 #define TOPPERS_TRACE_ CONFIG_H46 * target_syssvc.hからインクルードされる.また,トレースログ機能の初 47 * 期化や記録の開始/停止,トレースログのダンプを行うプログラムからイ 48 * ンクルードすることを想定している. 49 */ 50 51 #ifndef TOPPERS_TRACE_LOG_H 52 #define TOPPERS_TRACE_LOG_H 53 53 54 54 /* … … 75 75 76 76 /* 77 * TECSで記述された テストプログラム用のサービスを直接呼び出すための定義77 * TECSで記述されたトレースログ機能を直接呼び出すための定義 78 78 * 79 79 * C言語で記述されたアプリケーションから,TECSで記述されたトレースログ … … 134 134 135 135 Inline void 136 trace_write_1(uint_t type, intptr_targ1)136 trace_write_1(uint_t type, LOGPAR arg1) 137 137 { 138 138 TRACE trace; … … 144 144 145 145 Inline void 146 trace_write_2(uint_t type, intptr_t arg1, intptr_targ2)146 trace_write_2(uint_t type, LOGPAR arg1, LOGPAR arg2) 147 147 { 148 148 TRACE trace; … … 155 155 156 156 Inline void 157 trace_write_3(uint_t type, intptr_t arg1, intptr_t arg2, intptr_targ3)157 trace_write_3(uint_t type, LOGPAR arg1, LOGPAR arg2, LOGPAR arg3) 158 158 { 159 159 TRACE trace; … … 174 174 175 175 #define trace_1(type, arg1) \ 176 trace_write_1(type, ( intptr_t)(arg1))176 trace_write_1(type, (LOGPAR)(arg1)) 177 177 178 178 #define trace_2(type, arg1, arg2) \ 179 trace_write_2(type, ( intptr_t)(arg1), (intptr_t)(arg2))179 trace_write_2(type, (LOGPAR)(arg1), (LOGPAR)(arg2)) 180 180 181 181 #define trace_3(type, arg1, arg2, arg3) \ 182 trace_write_3(type, ( intptr_t)(arg1), (intptr_t)(arg2), \183 ( intptr_t)(arg3))182 trace_write_3(type, (LOGPAR)(arg1), (LOGPAR)(arg2), \ 183 (LOGPAR)(arg3)) 184 184 185 185 /* 186 186 * トレースログのダンプ 187 *188 * トレースログをダンプする.終了処理ルーチンとして登録することも想定189 * している.引数として,ダンプ先となる文字出力関数へのポインタを渡す.190 * ターゲット依存の低レベル文字出力を利用する場合には,target_putcを渡191 * す.192 187 */ 193 188 Inline void … … 203 198 */ 204 199 #define LOG_TSKSTAT(p_tcb) trace_2(LOG_TYPE_TSKSTAT, p_tcb, p_tcb->tstat) 200 201 #define LOG_DSP_LEAVE(p_tcb) trace_1(LOG_TYPE_DSP|LOG_LEAVE, p_tcb) 202 203 #ifdef TOPPERS_SUPPORT_PROTECT 204 #define LOG_SCYC_START(p_sominib) trace_1(LOG_TYPE_SCYC|LOG_START, p_sominib) 205 #define LOG_TWD_START(p_twdinib) trace_1(LOG_TYPE_TWD|LOG_START, p_twdinib) 206 #endif /* TOPPERS_SUPPORT_PROTECT */ 205 207 206 208 #define LOG_TSYSLOG_ESYSLOG_WRITE_ENTER(priority, p_syslog) \ 207 209 trace_wri_log((TRACE *) p_syslog) 208 210 209 #endif /* TOPPERS_TRACE_ CONFIG_H */211 #endif /* TOPPERS_TRACE_LOG_H */ -
EcnlProtoTool/trunk/asp3_dcre/cfg/GenFile.rb
r321 r429 37 37 # の責任を負わない. 38 38 # 39 # $Id $39 # $Id: GenFile.rb 111 2016-03-16 23:50:27Z ertl-hiro $ 40 40 # 41 41 -
EcnlProtoTool/trunk/asp3_dcre/cfg/MANIFEST
r270 r429 1 PACKAGE cfg 2 VERSION 1.5.0 3 1 4 MANIFEST 2 5 cfg.rb -
EcnlProtoTool/trunk/asp3_dcre/cfg/SRecord.rb
r321 r429 36 36 # の責任を負わない. 37 37 # 38 # $Id $38 # $Id: SRecord.rb 161 2018-12-12 00:45:04Z ertl-hiro $ 39 39 # 40 40 … … 170 170 end 171 171 end 172 173 # 文字列としてのデータ取得 174 def get_string(address) 175 str = "" 176 targetChar = get_data(address, 1).hex 177 while (!targetChar.nil? && targetChar != 0) 178 str += targetChar.chr 179 address += 1 180 targetChar = get_data(address, 1).hex 181 end 182 return(str) 183 end 172 184 end -
EcnlProtoTool/trunk/asp3_dcre/cfg/cfg.rb
r331 r429 1 #!/usr/bin/env ruby 1 #!/usr/bin/env ruby -Eutf-8 -w 2 2 # -*- coding: utf-8 -*- 3 3 # … … 5 5 # 6 6 # Copyright (C) 2015 by FUJI SOFT INCORPORATED, JAPAN 7 # Copyright (C) 2015 ,2016by Embedded and Real-Time Systems Laboratory7 # Copyright (C) 2015-2019 by Embedded and Real-Time Systems Laboratory 8 8 # Graduate School of Information Science, Nagoya Univ., JAPAN 9 9 # … … 37 37 # の責任を負わない. 38 38 # 39 # $Id $39 # $Id: cfg.rb 175 2019-06-19 01:51:58Z ertl-hiro $ 40 40 # 41 41 … … 56 56 # 57 57 # 共通 58 VERSION = "1. 2.2"58 VERSION = "1.5.0" 59 59 60 60 # cfg1_out関係 61 CFG1_PREFIX = "TOPPERS_cfg_" 62 CFG1_MAGIC_NUM = "TOPPERS_magic_number" 63 CFG1_SIZEOF_SIGNED = "TOPPERS_sizeof_signed_t" 64 CFG1_OUT_C = "cfg1_out.c" 65 CFG1_OUT_DB = "cfg1_out.db" 66 CFG1_OUT_SREC = "cfg1_out.srec" 67 CFG1_OUT_SYMS = "cfg1_out.syms" 68 CFG1_OUT_TIMESTAMP = "cfg1_out.timestamp" 69 CFG1_OUT_TARGET_H = "target_cfg1_out.h" 61 CFG1_PREFIX = "TOPPERS_cfg_" 62 CFG1_MAGIC_NUM = "TOPPERS_magic_number" 63 CFG1_SIZEOF_SIGNED = "TOPPERS_sizeof_signed_t" 64 CFG1_SIZEOF_INTPTR = "TOPPERS_sizeof_intptr_t" 65 CFG1_SIZEOF_CHARPTR = "TOPPERS_sizeof_char_ptr_t" 66 CFG1_OUT_C = "cfg1_out.c" 67 CFG1_OUT_DB = "cfg1_out.db" 68 CFG1_OUT_SREC = "cfg1_out.srec" 69 CFG1_OUT_SYMS = "cfg1_out.syms" 70 CFG1_OUT_TIMESTAMP = "cfg1_out.timestamp" 71 CFG1_OUT_TARGET_H = "target_cfg1_out.h" 70 72 71 73 # cfg2_out関係 … … 105 107 $noParseError = 0 106 108 def parse_error(cfgFile, message) 107 error(message, "#{cfgFile.getFileName ()}:#{cfgFile.getLineNo}:")109 error(message, "#{cfgFile.getFileName}:#{cfgFile.getLineNo}:") 108 110 if ($noParseError += 1) >= 10 109 111 abort("too many errors emitted, stopping now") … … 113 115 # システムコンフィギュレーションファイルの構文解析時の警告 114 116 def parse_warning(cfgFile, message) 115 warning(message, "#{cfgFile.getFileName ()}:#{cfgFile.getLineNo}:")117 warning(message, "#{cfgFile.getFileName}:#{cfgFile.getLineNo}:") 116 118 end 117 119 … … 155 157 def error_ercd(errorCode, params, message) 156 158 error_api(params, "#{errorCode}: #{message}") 157 end158 159 # 静的API処理時の警告(エラーコード付き)160 def warning_ercd(errorCode, params, message)161 warning_api(params, "#{errorCode}: #{message}")162 159 end 163 160 … … 316 313 # ハッシュのキーとして使う時の比較も数値情報で行う 317 314 def eql?(other) 318 @val == other .val315 @val == other 319 316 end 320 317 … … 390 387 if symbolData.has_key?(:VALUE) 391 388 eval("$#{symbolName} = #{symbolData[:VALUE]}") 389 if symbolData.has_key?(:NUMSTRVAR) 390 eval("$#{symbolData[:NUMSTRVAR]} = " \ 391 "NumStr.new(symbolData[:VALUE], symbolData[:EXPR])") 392 end 392 393 end 393 394 end … … 431 432 432 433 # 434 # インクルードディレクティブ(#include)の生成 435 # 436 def GenerateIncludes(genFile) 437 $cfgFileInfo.each do |cfgInfo| 438 if cfgInfo.has_key?(:DIRECTIVE) 439 genFile.add(cfgInfo[:DIRECTIVE]) 440 end 441 end 442 end 443 444 # 433 445 # パス3の処理 434 446 # … … 439 451 db = PStore.new(CFG2_OUT_DB) 440 452 db.transaction(true) do 441 $apiDefinition = db[:apiDefinition] 442 $symbolValueTable = db[:symbolValueTable] 443 $cfgFileInfo = db[:cfgFileInfo] 444 $includeFiles = db[:includeFiles] 445 $cfgData = db[:cfgData] 446 $asmLabel = db[:asmLabel] 447 $endianLittle = db[:endianLittle] 448 $cfg2Data = db[:cfg2Data] 449 end 450 $cfg3Data = {} 453 db.roots.each do |var| 454 eval("$#{var} = db[:#{var}]") 455 end 456 end 451 457 452 458 # … … 465 471 # パス4に引き渡す情報をファイルに生成 466 472 # 467 if $omitOutputDb.nil?473 if !$omitOutputDb 468 474 db = PStore.new(CFG3_OUT_DB) 469 475 db.transaction do 470 db[:apiDefinition] = $apiDefinition 471 db[:symbolValueTable] = $symbolValueTable 472 db[:cfgFileInfo] = $cfgFileInfo 473 db[:includeFiles] = $includeFiles 474 db[:cfgData] = $cfgData 475 db[:asmLabel] = $asmLabel 476 db[:endianLittle] = $endianLittle 477 db[:cfg3Data] = $cfg3Data 476 $globalVars.each do |var| 477 eval("db[:#{var}] = $#{var}") 478 end 478 479 end 479 480 end … … 489 490 db = PStore.new(CFG3_OUT_DB) 490 491 db.transaction(true) do 491 $apiDefinition = db[:apiDefinition] 492 $symbolValueTable = db[:symbolValueTable] 493 $cfgFileInfo = db[:cfgFileInfo] 494 $includeFiles = db[:includeFiles] 495 $cfgData = db[:cfgData] 496 $asmLabel = db[:asmLabel] 497 $endianLittle = db[:endianLittle] 498 $cfg3Data = db[:cfg3Data] || db[:cfg2Data] 492 db.roots.each do |var| 493 eval("$#{var} = db[:#{var}]") 494 end 499 495 end 500 496 … … 557 553 $romImageFileName = nil 558 554 $romSymbolFileName = nil 559 $dependencyFileName = nil560 555 $idInputFileName = nil 561 556 $idOutputFileName = nil 557 $dependencyFileName = nil 558 $omitOutputDb = false 559 $supportDomain = false 560 $supportClass = false 562 561 563 562 # 564 563 # オプションの処理 565 564 # 566 OptionParser.new( banner="Usage: cfg.rb [options] CONFIG-FILE", 40) do |opt|565 OptionParser.new("Usage: cfg.rb [options] CONFIG-FILE", 40) do |opt| 567 566 opt.version = VERSION 567 opt.release = nil 568 568 opt.on("-k KERNEL", "--kernel KERNEL", "kernel profile name") do |val| 569 569 $kernel = val … … 605 605 $omitOutputDb = true 606 606 end 607 opt.on("--enable-domain", "enable DOMAIN support") do 608 $supportDomain = true 609 end 610 opt.on("--enable-class", "enable CLASS support") do 611 $supportClass = true 612 end 607 613 opt.on("-v", "--version", "show version number") do 608 abort(opt.ver) 614 puts(opt.ver) 615 exit(0) 609 616 end 610 617 opt.on("-h", "--help", "show help (this)") do 611 abort(opt.help) 618 puts(opt.help) 619 exit(0) 612 620 end 613 621 opt.parse!(ARGV) … … 642 650 $supportDomain = true 643 651 when /^fmp/ 652 $supportClass = true 653 when /^hrmp/ 654 $supportDomain = true 644 655 $supportClass = true 645 656 end -
EcnlProtoTool/trunk/asp3_dcre/cfg/pass1.rb
r360 r429 4 4 # 5 5 # Copyright (C) 2015 by FUJI SOFT INCORPORATED, JAPAN 6 # Copyright (C) 2015-201 7by Embedded and Real-Time Systems Laboratory6 # Copyright (C) 2015-2018 by Embedded and Real-Time Systems Laboratory 7 7 # Graduate School of Information Science, Nagoya Univ., JAPAN 8 8 # … … 36 36 # の責任を負わない. 37 37 # 38 # $Id $38 # $Id: pass1.rb 165 2019-01-11 01:29:47Z ertl-hiro $ 39 39 # 40 40 … … 61 61 "LONG_MAX" => { EXPR: "LONG_MAX", SIGNED: true }, 62 62 "LONG_MIN" => { EXPR: "LONG_MIN", SIGNED: true }, 63 "ULONG_MAX" => { EXPR: "ULONG_MAX" } 63 "ULONG_MAX" => { EXPR: "ULONG_MAX" }, 64 "SIL_ENDIAN_BIG" \ 65 => { EXPR: "true", BOOL: true, CONDITION: "defined(SIL_ENDIAN_BIG)" }, 66 "SIL_ENDIAN_LITTLE" \ 67 => { EXPR: "true", BOOL: true, CONDITION: "defined(SIL_ENDIAN_LITTLE)" } 64 68 } 65 69 … … 68 72 # 69 73 $apiDefinition = { "INCLUDE" => 70 { :PARAM => [ { :NAME => :file, :STRING => true }]}}74 { :PARAM => [ { :NAME => :file, :STRING_LITERAL => true }]}} 71 75 72 76 # … … 121 125 apiParam[:EXPTYPE] = "signed_t" 122 126 apiParam[:SIGNED] = true 127 when "^" # ポインタ整数定数式パラメータ 128 apiParam[:EXPTYPE] = "uintptr_t" 129 apiParam[:INTPTR] = true 123 130 when "&" # 一般整数定数式パラメータ 124 131 # do nothing 125 132 when "$" # 文字列定数式パラメータ 126 133 apiParam[:STRING] = true 134 apiParam[:EXPTYPE] = "char *" 127 135 else 128 136 error_exit("`#{param}' is invalid") … … 171 179 { skip_blanks: true, skip_lines: /^#/ }) 172 180 symvalCsv.each do |record| 181 symbol = {} 182 173 183 # 変数名 174 184 if record[0].nil? 175 185 error_exit("invalid variable name in " \ 176 186 "`#{symvalTableFileName}:#{symvalCsv.to_io.lineno}'") 177 end 178 179 symbol = {} 180 variable = record[0] 187 elsif /^(.+)\[(.+)\]$/ =~ record[0] 188 variable = $1 189 symbol[:NUMSTRVAR] = $2 190 else 191 variable = record[0] 192 end 181 193 182 194 # 式 … … 192 204 when /^[bB]/ # 真偽値 193 205 symbol[:BOOL] = true 206 when /^[iI]/ # ポインタ整数値 207 symbol[:INTPTR] = true 194 208 when /^[uU]/ # 符号無し整数値 195 209 # 何も設定しない … … 367 381 skipSpace(cfgFile, withinApi) 368 382 if @line.nil? # ファイル末であればエラー終了 369 error_exit(" unexpexced end-of-file")383 error_exit("#{cfgFile.getFileName}: unexpeced end-of-file") 370 384 end 371 385 end … … 472 486 end 473 487 474 if apiParam.has_key?(:STRING )488 if apiParam.has_key?(:STRING_LITERAL) 475 489 return(param.unquote) 476 490 else … … 604 618 # プリプロセッサディレクティブを読む 605 619 case @line 606 when /^#include\b(.*)$/ 607 $includeFiles.push($1.strip) 608 when /^#(ifdef|ifndef|if|endif|else|elif)\b/ 609 directive = { :DIRECTIVE => @line.strip } 620 when /^#(include|ifdef|ifndef|if|endif|else|elif)\b/ 621 directive = {} 622 directive[:DIRECTIVE] = @line.strip 623 directive[:_FILE_] = cfgFile.getFileName 624 directive[:_LINE_] = cfgFile.getLineNo 610 625 $cfgFileInfo.push(directive) 611 626 else … … 619 634 case apiName 620 635 when "KERNEL_DOMAIN" 621 if $supportDomain.nil?636 if !$supportDomain 622 637 parse_warning(cfgFile, "`KERNEL_DOMAIN' is not supported") 623 638 end … … 629 644 @@nestDC.push("domain") 630 645 when "DOMAIN" 631 if $supportDomain.nil?646 if !$supportDomain 632 647 parse_warning(cfgFile, "`DOMAIN' is not supported") 633 648 end … … 655 670 @@nestDC.push("domain") 656 671 when "CLASS" 657 if $supportClass.nil?672 if !$supportClass 658 673 parse_warning(cfgFile, "`CLASS' is not supported") 659 674 end … … 676 691 includeFilePath = SearchFilePath(staticApi[:file]) 677 692 if includeFilePath.nil? 678 parse_error(cfgFile, "`#{staticApi[:file]}' not found") 693 error = {} 694 error[:DIRECTIVE] = "#error '#{staticApi[:file]}' not found." 695 error[:_FILE_] = cfgFile.getFileName 696 error[:_LINE_] = cfgFile.getLineNo 697 $cfgFileInfo.push(error) 679 698 else 680 699 $dependencyFiles.push(includeFilePath) … … 694 713 $cfgFileInfo.push(staticApi) 695 714 end 715 716 # ";"を読む 717 skipToToken(cfgFile, false) # 次の文字まで読み飛ばす 718 if (/^\;(.*)$/ =~ @line) 719 @line = $1 720 else 721 parse_error(cfgFile, "`;' expected after static API") 722 end 696 723 else 697 724 parse_error(cfgFile, "unknown static API: #{apiName}") … … 727 754 # 728 755 def self.OutLineNumber(cfgInfo) 729 @cfg1Out.add("#line #{cfgInfo[:_LINE_]} \"#{cfgInfo[:_FILE_] .gsub('\\', '/')}\"")756 @cfg1Out.add("#line #{cfgInfo[:_LINE_]} \"#{cfgInfo[:_FILE_]}\"") 730 757 end 731 758 … … 734 761 # 735 762 def self.OutClassLineNumber(cfgInfo) 736 @cfg1Out.add("#line #{cfgInfo[:CLASS_LINE_]} \"#{cfgInfo[:CLASS_FILE_] .gsub('\\', '/')}\"")763 @cfg1Out.add("#line #{cfgInfo[:CLASS_LINE_]} \"#{cfgInfo[:CLASS_FILE_]}\"") 737 764 end 738 765 … … 763 790 EOS 764 791 765 # インクルードヘッダファイル 766 $includeFiles.each do |file| 767 @cfg1Out.add("#include #{file}") 792 # インクルードディレクティブ(#include)の生成 793 $cfgFileInfo.each do |cfgInfo| 794 if cfgInfo.has_key?(:DIRECTIVE) 795 OutLineNumber(cfgInfo) 796 @cfg1Out.add(cfgInfo[:DIRECTIVE]) 797 end 768 798 end 769 799 … … 780 810 #include "#{CFG1_OUT_TARGET_H}" 781 811 782 #if defined(SIL_ENDIAN_BIG) && defined(SIL_ENDIAN_LITTLE)783 #error Both SIL_ENDIAN_BIG and SIL_ENDIAN_LITTLE are defined.784 #endif785 #if !defined(SIL_ENDIAN_BIG) && !defined(SIL_ENDIAN_LITTLE)786 #error Neither SIL_ENDIAN_BIG nor SIL_ENDIAN_LITTLE is defined.787 #endif788 789 812 const uint32_t #{CFG1_MAGIC_NUM} = 0x12345678; 790 813 const uint32_t #{CFG1_SIZEOF_SIGNED} = sizeof(signed_t); 814 const uint32_t #{CFG1_SIZEOF_INTPTR} = sizeof(intptr_t); 815 const uint32_t #{CFG1_SIZEOF_CHARPTR} = sizeof(char *); 791 816 EOS 792 817 793 818 # 値取得シンボルの処理 794 819 $symbolValueTable.each do |symbolName, symbolData| 795 if symbolData.has_key?(:BOOL) || symbolData.has_key?(:SIGNED) 820 if symbolData.has_key?(:BOOL) 821 type = "signed_t" 822 elsif symbolData.has_key?(:INTPTR) 823 type = "uintptr_t" 824 elsif symbolData.has_key?(:SIGNED) 796 825 type = "signed_t" 797 826 else … … 825 854 $cfgFileInfo.each do |cfgInfo| 826 855 if cfgInfo.has_key?(:DIRECTIVE) 827 @cfg1Out.add2(cfgInfo[:DIRECTIVE]) 856 # 条件ディレクティブを出力 857 if cfgInfo[:DIRECTIVE] =~ /^#(ifdef|ifndef|if|endif|else|elif)\b/ 858 OutLineNumber(cfgInfo) 859 @cfg1Out.add2(cfgInfo[:DIRECTIVE]) 860 end 828 861 else 829 862 apiDef = $apiDefinition[cfgInfo[:APINAME]] … … 882 915 $cfgFileInfo = [] 883 916 $dependencyFiles = $configFileNames.dup 884 $includeFiles = []885 917 $domainId = { "TDOM_KERNEL" => -1, "TDOM_NONE" => -2 } 886 918 $configFileNames.each do |configFileName| … … 939 971 # パス2に引き渡す情報をファイルに生成 940 972 # 941 if $omitOutputDb.nil?973 if !$omitOutputDb 942 974 db = PStore.new(CFG1_OUT_DB) 943 975 db.transaction do … … 945 977 db[:symbolValueTable] = $symbolValueTable 946 978 db[:cfgFileInfo] = $cfgFileInfo 947 db[:includeFiles] = $includeFiles948 979 db[:domainId] = $domainId 949 980 end -
EcnlProtoTool/trunk/asp3_dcre/cfg/pass2.rb
r331 r429 4 4 # 5 5 # Copyright (C) 2015 by FUJI SOFT INCORPORATED, JAPAN 6 # Copyright (C) 2015-201 7by Embedded and Real-Time Systems Laboratory6 # Copyright (C) 2015-2018 by Embedded and Real-Time Systems Laboratory 7 7 # Graduate School of Information Science, Nagoya Univ., JAPAN 8 8 # … … 36 36 # の責任を負わない. 37 37 # 38 # $Id $38 # $Id: pass2.rb 175 2019-06-19 01:51:58Z ertl-hiro $ 39 39 # 40 40 … … 59 59 60 60 # 61 # Sレコードファイルからシンボルの文字列を取り出す 62 # 63 def self.GetSymbolString(symbol) 64 if @symbolAddress.has_key?(symbol) \ 65 && !(address = @cfg1SRec.get_value(@symbolAddress[symbol], \ 66 $sizeOfCharPtr, false)).nil? 67 return(@cfg1SRec.get_string(address)) 68 else 69 return(nil) 70 end 71 end 72 73 # 61 74 # パス1の生成物の読み込み(メインの処理) 62 75 # … … 72 85 end 73 86 74 # マジックナンバーの取得 87 # マジックナンバーの取得とエンディアンの設定 75 88 if @symbolAddress.has_key?(CFG1_MAGIC_NUM) 76 89 $asmLabel = "" … … 95 108 # 固定出力した変数の取得 96 109 $sizeOfSigned = GetSymbolValue($asmLabel + CFG1_SIZEOF_SIGNED, 4, false) 110 $sizeOfIntptr = GetSymbolValue($asmLabel + CFG1_SIZEOF_INTPTR, 4, false) 111 $sizeOfCharPtr = GetSymbolValue($asmLabel + CFG1_SIZEOF_CHARPTR, 4, false) 97 112 98 113 # 値取得シンボルの取得 … … 106 121 end 107 122 else 108 value = GetSymbolValue(symbol, $sizeOfSigned, \ 123 if symbolData.has_key?(:INTPTR) 124 value = GetSymbolValue(symbol, $sizeOfIntptr, \ 109 125 symbolData.has_key?(:SIGNED)) 126 else 127 value = GetSymbolValue(symbol, $sizeOfSigned, \ 128 symbolData.has_key?(:SIGNED)) 129 end 110 130 if !value.nil? 111 131 symbolData[:VALUE] = value 112 132 end 133 end 134 end 135 136 # SILによるエンディアン定義のチェック 137 if $symbolValueTable["SIL_ENDIAN_BIG"].has_key?(:VALUE) 138 if $symbolValueTable["SIL_ENDIAN_LITTLE"].has_key?(:VALUE) 139 error_exit("Both SIL_ENDIAN_BIG and SIL_ENDIAN_LITTLE are defined.") 140 else 141 if $endianLittle 142 error_exit("Definition of SIL_ENDIAN_BIG seems to be wrong.") 143 end 144 end 145 else 146 if $symbolValueTable["SIL_ENDIAN_LITTLE"].has_key?(:VALUE) 147 if !$endianLittle 148 error_exit("Definition of SIL_ENDIAN_LITTLE seems to be wrong.") 149 end 150 else 151 # 両方が未定義の場合のエラーチェックは,sil.hで実施する 113 152 end 114 153 end … … 133 172 134 173 # 135 # ドメイン生成データをコンフィギュレーションデータ($cfgData)に格納 136 # 137 $cfgData[:CRE_DOM] = {} 138 $domainId.each do |domainName, domainVal| 139 domid = NumStr.new(domainVal, domainName) 140 $cfgData[:CRE_DOM][domainVal] = { :domid => domid } 174 # ドメインデータ($domData)を生成 175 # 176 if $supportDomain 177 $domData = {} 178 $domainId.each do |domainName, domainVal| 179 domid = NumStr.new(domainVal, domainName) 180 $domData[domainVal] = { :domid => domid } 181 end 182 $globalVars.push("domData") 141 183 end 142 184 … … 146 188 # 147 189 # パラメータの値を取り出す 190 # 191 # 生成スクリプト内で追加された静的APIの場合には,apiIndexがnilになる. 148 192 # 149 193 def self.GetParamValue(paramName, param, apiIndex, index, apiParam, cfgInfo) … … 160 204 value = nil 161 205 end 206 elsif apiParam.has_key?(:STRING) # 文字列パラメータ 207 if !apiIndex.nil? 208 symbol = "#{$cfg1_prefix}valueof_#{paramName}_#{apiIndex}#{index}" 209 return(GetSymbolString(symbol)) 210 else 211 return(param) 212 end 162 213 elsif apiParam.has_key?(:EXPTYPE) # 整数定数式パラメータ 163 if apiIndex.nil? 214 if !apiIndex.nil? 215 symbol = "#{$cfg1_prefix}valueof_#{paramName}_#{apiIndex}#{index}" 216 if apiParam.has_key?(:INTPTR) 217 value = GetSymbolValue(symbol, $sizeOfIntptr, \ 218 apiParam.has_key?(:SIGNED)) 219 else 220 value = GetSymbolValue(symbol, $sizeOfSigned, \ 221 apiParam.has_key?(:SIGNED)) 222 end 223 else 164 224 if param.is_a?(NumStr) 165 225 return(param) … … 167 227 return(NumStr.new(param)) 168 228 end 169 else 170 symbol = "#{$cfg1_prefix}valueof_#{paramName}_#{apiIndex}#{index}" 171 value = GetSymbolValue(symbol, $sizeOfSigned, \ 172 apiParam.has_key?(:SIGNED)) 173 end 174 else # 一般定数式/文字列パラメータ 229 end 230 else # 一般定数式パラメータ 175 231 return(param) 176 232 end … … 201 257 202 258 # ID番号割り当ての前処理 203 objidParamNameList = []204 259 $cfgFileInfo.each do |cfgInfo| 205 260 # プリプロセッサディレクティブは読み飛ばす … … 228 283 @objidValues[objidParamName][objName] = nil 229 284 end 230 objidParamNameList.push(objidParamName)231 285 end 232 286 end … … 234 288 235 289 # ID番号の割当て処理 236 objidParamNameList.each do |objidParamName| 237 objidList = @objidValues[objidParamName] 238 290 @objidValues.each do |objidParamName, objidList| 239 291 # 未使用のID番号のリスト(使用したものから消していく) 240 292 unusedObjidList = (1.upto(objidList.keys.size)).to_a … … 311 363 # クラスIDを追加 312 364 if cfgInfo.has_key?(:CLASS) 313 if apiIndex.nil? 314 params[:class] = cfgInfo[:CLASS] 315 else 365 if !apiIndex.nil? 316 366 symbol = "#{$cfg1_prefix}valueof_CLASS_#{apiIndex}" 317 367 value = GetSymbolValue(symbol, $sizeOfSigned, true) 318 368 params[:class] = NumStr.new(value, cfgInfo[:CLASS]) 369 else 370 params[:class] = cfgInfo[:CLASS] 319 371 end 320 372 end … … 343 395 344 396 # 397 # ID番号の割当て結果の上書き 398 # 399 def self.SetObjidList(objidParamName, objidList) 400 @objidValues[objidParamName] = objidList 401 end 402 403 # 345 404 # ID番号出力ファイルの生成 346 405 # … … 364 423 db = PStore.new(CFG1_OUT_DB) 365 424 db.transaction(true) do 366 $apiDefinition = db[:apiDefinition] 367 $symbolValueTable = db[:symbolValueTable] 368 $cfgFileInfo = db[:cfgFileInfo] 369 $includeFiles = db[:includeFiles] 370 $domainId = db[:domainId] 371 end 372 $cfg2Data = {} 425 db.roots.each do |var| 426 eval("$#{var} = db[:#{var}]") 427 end 428 end 429 430 # 431 # パス3以降に引き渡す情報の定義 432 # 433 $globalVars = [ "globalVars", 434 "apiDefinition", 435 "symbolValueTable", 436 "cfgFileInfo", 437 "cfgData", 438 "asmLabel", 439 "endianLittle" ] 373 440 374 441 # … … 404 471 # パス3に引き渡す情報をファイルに生成 405 472 # 406 if $omitOutputDb.nil?473 if !$omitOutputDb 407 474 db = PStore.new(CFG2_OUT_DB) 408 475 db.transaction do 409 db[:apiDefinition] = $apiDefinition 410 db[:symbolValueTable] = $symbolValueTable 411 db[:cfgFileInfo] = $cfgFileInfo 412 db[:includeFiles] = $includeFiles 413 db[:cfgData] = $cfgData 414 db[:asmLabel] = $asmLabel 415 db[:endianLittle] = $endianLittle 416 db[:cfg2Data] = $cfg2Data 476 $globalVars.each do |var| 477 eval("db[:#{var}] = $#{var}") 478 end 417 479 end 418 480 end -
EcnlProtoTool/trunk/asp3_dcre/configure.rb
r331 r429 7 7 # Copyright (C) 2001-2003 by Embedded and Real-Time Systems Laboratory 8 8 # Toyohashi Univ. of Technology, JAPAN 9 # Copyright (C) 2006-201 6by Embedded and Real-Time Systems Laboratory9 # Copyright (C) 2006-2019 by Embedded and Real-Time Systems Laboratory 10 10 # Graduate School of Information Science, Nagoya Univ., JAPAN 11 11 # … … 42 42 # 43 43 44 Encoding.default_external = 'utf-8' 44 45 require "optparse" 45 46 require "fileutils" … … 56 57 # ル名)名 57 58 # -C <cdlflle> コンポーネント記述ファイル(.cdlファイル)名 58 # -U <applobjs> 他のアプリケーションプログラムファイル59 # -U <applobjs> アプリケーションの追加のオブジェクトファイル 59 60 # (.oファイル名で指定.複数指定可) 60 # -S <syssvcobjs> システムサービスの プログラムファイル61 # -S <syssvcobjs> システムサービスのオブジェクトファイル 61 62 # (.oファイル名で指定.複数指定可) 63 # -B <bannerobj> バナー表示のオブジェクトファイル(.oファイル名で指定) 62 64 # -L <kernel_lib> カーネルライブラリ(libkernel.a)のディレクトリ名 63 65 # (省略した場合,カーネルライブラリもmakeする) … … 67 69 # -m <tempmakefile> Makefileのテンプレートのファイル名の指定(デフォル 68 70 # トはsampleディレクトリのMakefile) 69 # -d <depdir> 依存関係ファイルのディレクトリ名(デフォルトはdeps) 71 # -d <objdir> 中間オブジェクトファイルと依存関係ファイルを置く 72 # ディレクトリ名(デフォルトはobjs) 70 73 # -w TECSを使用しない 74 # -W <tecsdir> TECS関係ファイルのディレクトリ名(デフォルトはソー 75 # スファイルのディレクトリの下のtecsgen) 71 76 # -r トレースログ記録のサンプルコードを使用するかどうか 72 77 # の指定 … … 77 82 # -o <options> コンパイルオプション(COPTSに追加) 78 83 # -O <options> シンボル定義オプション(CDEFSに追加) 79 # -k <options> リンカオプション(LDFLAGS等に追加) 84 # -k <options> リンカオプション(LDFLAGSに追加) 85 # -b <options> リンカオプション(LIBSに追加) 80 86 # -e <tinetdir> TINET のソースの置かれているディレクトリ 81 87 # -i <net_if> ネットワークインタフェース(TINETが有効の場合は必須) … … 111 117 # 112 118 # % ../configure.rb -T gr_sakura_gcc -A sample1n \ 113 # -e tinet -i ether -v if_ rx62n-n inet4 -s tcp -U sample1.o119 # -e tinet -i ether -v if_mbed -n inet4 -s tcp -U sample1.o 114 120 # TINETを有効にする. 115 121 … … 119 125 $target = nil 120 126 $appldirs = [] 127 $applname = nil 128 $option_t = false 129 $cfgfile = nil 130 $cdlfile = nil 121 131 $applobjs = [] 122 132 $syssvcobjs = [] 133 $bannerobj = nil 123 134 $kernel_lib = "" 124 135 $kernel_funcobjs = "" 136 $srcdir = nil 125 137 $srclang = "c" 126 $depdir = "deps" 138 $tempmakefile = nil 139 $objdir = "objs" 127 140 $omit_tecs = "" 141 $tecsdir = nil 128 142 $enable_trace = "" 129 143 $devtooldir = "" 130 144 $ruby = "ruby" 145 $cfg = nil 146 $tecsgen = nil 131 147 $copts = [] 132 148 $cdefs = [] 133 149 $ldflags = [] 150 $libs = [] 134 151 135 152 # … … 141 158 end 142 159 opt.on("-a appldirs", "application directories") do |val| 143 $appldirs += val.split( "\s+")160 $appldirs += val.split(/\s+/) 144 161 end 145 162 opt.on("-A applname", "application program name") do |val| … … 156 173 end 157 174 opt.on("-U applobjs", "additional application object files") do |val| 158 $applobjs += val.split( "\s+")175 $applobjs += val.split(/\s+/) 159 176 end 160 177 opt.on("-S syssvcobjs", "system service object files") do |val| 161 $syssvcobjs += val.split("\s+") 178 $syssvcobjs += val.split(/\s+/) 179 end 180 opt.on("-B bannerobj", "banner display object file") do |val| 181 $bannerobj = val 162 182 end 163 183 opt.on("-L kernel_lib", "directory of built kernel library") do |val| … … 165 185 end 166 186 opt.on("-f", "each function is complied separately in kernel") do |val| 167 $kernel_funcobjs = true187 $kernel_funcobjs = "true" 168 188 end 169 189 opt.on("-D srcdir", "path of source code directory") do |val| … … 176 196 $tempmakefile = val 177 197 end 178 opt.on("-d depdir", "dependency relationfile directory") do |val|179 $ depdir = val198 opt.on("-d objdir", "relocatable object file directory") do |val| 199 $objdir = val 180 200 end 181 201 opt.on("-w", "TECS is not used at all") do |val| 182 $omit_tecs = true 202 $omit_tecs = "true" 203 end 204 opt.on("-W tecsdir", "path of TECS file directory") do |val| 205 $tecsdir = val 183 206 end 184 207 opt.on("-r", "use the sample code for trace log") do |val| 185 $enable_trace = true208 $enable_trace = "true" 186 209 end 187 210 opt.on("-V devtooldir", "development tools directory") do |val| … … 198 221 end 199 222 opt.on("-o options", "compiler options") do |val| 200 $copts += val.split( "\s+")223 $copts += val.split(/\s+/) 201 224 end 202 225 opt.on("-O options", "symbol definition options") do |val| 203 $cdefs += val.split( "\s+")226 $cdefs += val.split(/\s+/) 204 227 end 205 228 opt.on("-k options", "linker options") do |val| 206 $ldflags += val.split("\s+") 229 $ldflags += val.split(/\s+/) 230 end 231 opt.on("-b options", "linker options for linking libraries") do |val| 232 $libs += val.split(/\s+/) 207 233 end 208 234 opt.on("-e options", "path of TINET directory") do |val| … … 236 262 237 263 # 238 # 変数のデフォルト値 264 # 変数のデフォルト値(文字列変数のデフォルト値は初期化で与える) 239 265 # 240 266 if $appldirs.empty? … … 242 268 end 243 269 $applname ||= "sample1" 244 if $option_t.nil?245 $applobjs.unshift($applname + ".o")246 end247 270 $cfgfile ||= $applname + ".cfg" 248 271 $cdlfile ||= $applname + ".cdl" 272 $applobjs.unshift($applname + ".o") if !$option_t 273 $bannerobj ||= ($omit_tecs == "") ? "tBannerMain.o" : "banner.o" 249 274 if $srcdir.nil? 250 275 # ソースディレクトリ名を取り出す … … 261 286 end 262 287 $tempmakefile ||= $srcdir + "/sample/Makefile" 288 $tecsdir ||= "\$(SRCDIR)/tecsgen" 263 289 $cfg ||= $ruby + " \$(SRCDIR)/cfg/cfg.rb" 264 $tecsgen ||= $ruby + " \$( SRCDIR)/tecsgen/tecsgen.rb"290 $tecsgen ||= $ruby + " \$(TECSDIR)/tecsgen.rb" 265 291 266 292 # … … 294 320 $vartable["APPLOBJS"] = $applobjs.join(" ") 295 321 $vartable["SYSSVCOBJS"] = $syssvcobjs.join(" ") 322 $vartable["BANNEROBJ"] = $bannerobj 296 323 $vartable["KERNEL_LIB"] = $kernel_lib 297 324 $vartable["KERNEL_FUNCOBJS"] = $kernel_funcobjs … … 299 326 $vartable["SRCABSDIR"] = $srcabsdir 300 327 $vartable["SRCLANG"] = $srclang 301 $vartable[" DEPDIR"] = $depdir328 $vartable["OBJDIR"] = $objdir 302 329 $vartable["OMIT_TECS"] = $omit_tecs 330 $vartable["TECSDIR"] = $tecsdir 303 331 $vartable["ENABLE_TRACE"] = $enable_trace 304 332 $vartable["DEVTOOLDIR"] = $devtooldir … … 309 337 $vartable["CDEFS"] = $cdefs.join(" ") 310 338 $vartable["LDFLAGS"] = $ldflags.join(" ") 339 $vartable["LIBS"] = $libs.join(" ") 311 340 $vartable["OBJEXT"] = GetObjectExtension() 312 341 $vartable["TINETDIR"] = $tinetdir … … 362 391 # 依存関係ファイルのディレクトリの作成 363 392 # 364 if !File.directory?($ depdir)365 Dir.mkdir($ depdir)366 end 393 if !File.directory?($objdir) 394 Dir.mkdir($objdir) 395 end -
EcnlProtoTool/trunk/asp3_dcre/include/kernel.h
r331 r429 6 6 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory 7 7 * Toyohashi Univ. of Technology, JAPAN 8 * Copyright (C) 2004-201 5by Embedded and Real-Time Systems Laboratory8 * Copyright (C) 2004-2019 by Embedded and Real-Time Systems Laboratory 9 9 * Graduate School of Information Science, Nagoya Univ., JAPAN 10 10 * … … 80 80 #endif /* TOPPERS_TARGET_SUPPORT_ENA_INT */ 81 81 82 #ifdef TOPPERS_TARGET_SUPPORT_CLR_INT 83 #define TOPPERS_SUPPORT_CLR_INT /* clr_intがサポートされている */ 84 #endif /* TOPPERS_TARGET_SUPPORT_CLR_INT */ 85 86 #ifdef TOPPERS_TARGET_SUPPORT_RAS_INT 87 #define TOPPERS_SUPPORT_RAS_INT /* ras_intがサポートされている */ 88 #endif /* TOPPERS_TARGET_SUPPORT_RAS_INT */ 89 90 #ifdef TOPPERS_TARGET_SUPPORT_PRB_INT 91 #define TOPPERS_SUPPORT_PRB_INT /* prb_intがサポートされている */ 92 #endif /* TOPPERS_TARGET_SUPPORT_PRB_INT */ 93 82 94 #define TOPPERS_SUPPORT_DYNAMIC_CRE /* 動的生成機能拡張 */ 83 95 … … 195 207 PRI itskpri; /* タスクの起動時優先度 */ 196 208 size_t stksz; /* タスクのスタック領域のサイズ */ 197 STK_T 209 STK_T *stk; /* タスクのスタック領域の先頭番地 */ 198 210 } T_CTSK; 199 211 … … 235 247 ATR dtqatr; /* データキュー属性 */ 236 248 uint_t dtqcnt; /* データキュー管理領域に格納できるデータ数 */ 237 void 249 void *dtqmb; /* データキュー管理領域の先頭番地 */ 238 250 } T_CDTQ; 239 251 … … 249 261 PRI maxdpri; /* 優先度データキューに送信できるデータ優先度の最 250 262 大値 */ 251 void 263 void *pdqmb; /* 優先度データキュー管理領域の先頭番地 */ 252 264 } T_CPDQ; 253 265 … … 275 287 uint_t blkcnt; /* 獲得できる固定長メモリブロックの数 */ 276 288 uint_t blksz; /* 固定長メモリブロックのサイズ */ 277 MPF_T 278 void 289 MPF_T *mpf; /* 固定長メモリプール領域の先頭番地 */ 290 void *mpfmb; /* 固定長メモリプール管理領域の先頭番地 */ 279 291 } T_CMPF; 280 292 … … 471 483 extern ER dis_int(INTNO intno) throw(); 472 484 extern ER ena_int(INTNO intno) throw(); 485 extern ER clr_int(INTNO intno) throw(); 486 extern ER ras_int(INTNO intno) throw(); 487 extern ER_BOOL prb_int(INTNO intno) throw(); 473 488 extern ER chg_ipm(PRI intpri) throw(); 474 489 extern ER get_ipm(PRI *p_intpri) throw(); … … 508 523 #define idis_int(intno) dis_int(intno) 509 524 #define iena_int(intno) ena_int(intno) 525 #define iclr_int(intno) clr_int(intno) 526 #define iras_int(intno) ras_int(intno) 527 #define iprb_int(intno) prb_int(intno) 510 528 #define ixsns_dpn(p_excinf) xsns_dpn(p_excinf) 511 529 … … 613 631 #define TKERNEL_MAKER UINT_C(0x0118) /* カーネルのメーカーコード */ 614 632 #define TKERNEL_PRID UINT_C(0x0007) /* カーネルの識別番号 */ 615 #define TKERNEL_SPVER UINT_C(0xf63 1) /* カーネル仕様のバージョン番号 */616 #define TKERNEL_PRVER UINT_C(0x30 10) /* カーネルのバージョン番号 */633 #define TKERNEL_SPVER UINT_C(0xf634) /* カーネル仕様のバージョン番号 */ 634 #define TKERNEL_PRVER UINT_C(0x3050) /* カーネルのバージョン番号 */ 617 635 618 636 /* … … 632 650 * システム時刻の調整できる範囲(単位:μ秒) 633 651 */ 634 #define TMIN_ADJTIM -1000000/* システム時刻の最小調整時間 */652 #define TMIN_ADJTIM (-1000000) /* システム時刻の最小調整時間 */ 635 653 #define TMAX_ADJTIM 1000000 /* システム時刻の最大調整時間 */ 636 654 … … 654 672 #define ROUND_MPF_T(blksz) TOPPERS_ROUND_SZ(blksz, sizeof(MPF_T)) 655 673 674 #define COUNT_MB_T(sz) TOPPERS_COUNT_SZ(sz, sizeof(MB_T)) 675 #define ROUND_MB_T(sz) TOPPERS_ROUND_SZ(sz, sizeof(MB_T)) 676 656 677 #define TSZ_DTQMB(dtqcnt) (sizeof(intptr_t) * (dtqcnt)) 657 #define TCNT_DTQMB(dtqcnt) TOPPERS_COUNT_SZ(TSZ_DTQMB(dtqcnt), sizeof(MB_T))678 #define TCNT_DTQMB(dtqcnt) COUNT_MB_T(TSZ_DTQMB(dtqcnt)) 658 679 659 680 #ifndef TSZ_PDQMB 660 681 #define TSZ_PDQMB(pdqcnt) (sizeof(intptr_t) * 3 * (pdqcnt)) 661 682 #endif /* TSZ_PDQMB */ 662 #define TCNT_PDQMB(pdqcnt) TOPPERS_COUNT_SZ(TSZ_PDQMB(pdqcnt), sizeof(MB_T))683 #define TCNT_PDQMB(pdqcnt) COUNT_MB_T(TSZ_PDQMB(pdqcnt)) 663 684 664 685 #define TSZ_MPFMB(blkcnt) (sizeof(uint_t) * (blkcnt)) 665 #define TCNT_MPFMB(blkcnt) TOPPERS_COUNT_SZ(TSZ_MPFMB(blkcnt), sizeof(MB_T))686 #define TCNT_MPFMB(blkcnt) COUNT_MB_T(TSZ_MPFMB(blkcnt)) 666 687 667 688 /* -
EcnlProtoTool/trunk/asp3_dcre/include/sil.h
r321 r429 5 5 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory 6 6 * Toyohashi Univ. of Technology, JAPAN 7 * Copyright (C) 2004-201 1by Embedded and Real-Time Systems Laboratory7 * Copyright (C) 2004-2018 by Embedded and Real-Time Systems Laboratory 8 8 * Graduate School of Information Science, Nagoya Univ., JAPAN 9 9 * … … 276 276 #endif /* TOPPERS_OMIT_SIL_ACCESS */ 277 277 278 #ifndef TOPPERS_OMIT_SIL_SYNC_WRITE 279 280 /* 281 * 8ビット単位の同期書込み 282 */ 283 #ifdef UINT8_MAX 284 285 Inline void 286 sil_swrb_mem(uint8_t *mem, uint8_t data) 287 { 288 sil_wrb_mem(mem, data); 289 TOPPERS_SIL_WRITE_SYNC(); 290 } 291 292 #endif /* UINT8_MAX */ 293 294 /* 295 * 16ビット単位の同期書込み 296 */ 297 298 Inline void 299 sil_swrh_mem(uint16_t *mem, uint16_t data) 300 { 301 sil_wrh_mem(mem, data); 302 TOPPERS_SIL_WRITE_SYNC(); 303 } 304 305 Inline void 306 sil_swrh_lem(uint16_t *mem, uint16_t data) 307 { 308 sil_wrh_lem(mem, data); 309 TOPPERS_SIL_WRITE_SYNC(); 310 } 311 312 Inline void 313 sil_swrh_bem(uint16_t *mem, uint16_t data) 314 { 315 sil_wrh_bem(mem, data); 316 TOPPERS_SIL_WRITE_SYNC(); 317 } 318 319 /* 320 * 32ビット単位の同期書込み 321 */ 322 323 Inline void 324 sil_swrw_mem(uint32_t *mem, uint32_t data) 325 { 326 sil_wrw_mem(mem, data); 327 TOPPERS_SIL_WRITE_SYNC(); 328 } 329 330 Inline void 331 sil_swrw_lem(uint32_t *mem, uint32_t data) 332 { 333 sil_wrw_lem(mem, data); 334 TOPPERS_SIL_WRITE_SYNC(); 335 } 336 337 Inline void 338 sil_swrw_bem(uint32_t *mem, uint32_t data) 339 { 340 sil_wrw_bem(mem, data); 341 TOPPERS_SIL_WRITE_SYNC(); 342 } 343 344 #endif /* TOPPERS_OMIT_SIL_SYNC_WRITE */ 345 278 346 #endif /* TOPPERS_MACRO_ONLY */ 279 347 -
EcnlProtoTool/trunk/asp3_dcre/include/t_stddef.h
r321 r429 5 5 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory 6 6 * Toyohashi Univ. of Technology, JAPAN 7 * Copyright (C) 2004-201 5by Embedded and Real-Time Systems Laboratory7 * Copyright (C) 2004-2019 by Embedded and Real-Time Systems Laboratory 8 8 * Graduate School of Information Science, Nagoya Univ., JAPAN 9 9 * … … 113 113 #endif /* UINT64_MAX */ 114 114 typedef uint32_t PRCTIM; /* プロセッサ時間[NGKI0573]*/ 115 #ifndef USE_64BIT_HRTCNT 115 116 typedef uint32_t HRTCNT; /* 高分解能タイマのカウント値 */ 117 #else /* USE_64BIT_HRTCNT */ 118 #ifndef UINT64_MAX 119 #error 64bit data types are required when USE_64BIT_HRTCNT. 120 #endif 121 typedef uint64_t HRTCNT; /* 高分解能タイマのカウント値 */ 122 #endif /* USE_64BIT_HRTCNT */ 116 123 117 124 typedef TOPPERS_fp FP; /* プログラムの起動番地 */ … … 214 221 */ 215 222 #ifndef offsetof 216 #define offsetof(structure, field) ((uintptr_t) &(((structure *) 0)->field)) 223 #define offsetof(structure, field) \ 224 ((uintptr_t)(((char *) &(((structure *) 0)->field)) - ((char *) 0))) 217 225 #endif /* offsetof */ 218 226 -
EcnlProtoTool/trunk/asp3_dcre/include/t_stdlib.h
r321 r429 61 61 extern const char *itron_strerror(ER ercd) throw(); 62 62 63 /*64 * エラーメッセージのログ出力65 *66 * サービスコールがエラーを返した場合に,そのファイル名,行番号,メイ67 * ンエラーコード等を表示するための関数.68 */69 extern void t_perror(uint_t prio, const char *file, int_t line,70 const char *expr, ER ercd) throw();71 72 63 #ifdef __cplusplus 73 64 } -
EcnlProtoTool/trunk/asp3_dcre/include/t_syslog.h
r321 r429 1 1 /* 2 * TOPPERS/ASP Kernel 3 * Toyohashi Open Platform for Embedded Real-Time Systems/ 4 * Advanced Standard Profile Kernel 2 * TOPPERS Software 3 * Toyohashi Open Platform for Embedded Real-Time Systems 5 4 * 6 5 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory 7 6 * Toyohashi Univ. of Technology, JAPAN 8 * Copyright (C) 2004-201 4by Embedded and Real-Time Systems Laboratory7 * Copyright (C) 2004-2019 by Embedded and Real-Time Systems Laboratory 9 8 * Graduate School of Information Science, Nagoya Univ., JAPAN 10 9 * … … 69 68 #include <t_stddef.h> 70 69 70 #ifndef TOPPERS_MACRO_ONLY 71 #include <stdarg.h> 72 #endif /* TOPPERS_MACRO_ONLY */ 73 71 74 /* 72 75 * ログ情報の種別の定義 … … 77 80 #define LOG_TYPE_INH UINT_C(0x11) /* 割込みハンドラ */ 78 81 #define LOG_TYPE_ISR UINT_C(0x12) /* 割込みサービスルーチン */ 79 #define LOG_TYPE_CYC UINT_C(0x13) /* 周期 ハンドラ*/80 #define LOG_TYPE_ALM UINT_C(0x14) /* アラーム ハンドラ*/82 #define LOG_TYPE_CYC UINT_C(0x13) /* 周期通知 */ 83 #define LOG_TYPE_ALM UINT_C(0x14) /* アラーム通知 */ 81 84 #define LOG_TYPE_OVR UINT_C(0x15) /* オーバランハンドラ */ 82 85 #define LOG_TYPE_EXC UINT_C(0x16) /* CPU例外ハンドラ */ … … 124 127 125 128 /* 126 * ログ情報の重要度のビットマップを作るためのマクロ 127 */ 128 #define LOG_MASK(prio) (1U << (prio)) 129 #define LOG_UPTO(prio) ((1U << ((prio) + 1)) - 1) 130 131 /* 132 * パケット形式の定義 133 */ 134 typedef struct t_syslog_rlog { 135 uint_t count; /* ログバッファ中のログの数 */ 136 uint_t lost; /* 失われたログの数 */ 137 uint_t logmask; /* ログバッファに記録すべき重要度 */ 138 uint_t lowmask; /* 低レベル出力すべき重要度 */ 139 } T_SYSLOG_RLOG; 129 * ログ情報の出力 130 * 131 * ログ情報の出力は,システムログ機能のアダプタ経由で行う. 132 */ 133 134 extern ER syslog_wri_log(uint_t prio, const SYSLOG *p_syslog) throw(); 135 136 #define syslog_write(prio, p_syslog) \ 137 ((void) syslog_wri_log(prio, p_syslog)) 140 138 141 139 #ifndef TOPPERS_OMIT_SYSLOG 142 143 /* 144 * ログ情報を出力するためのライブラリ関数 145 * 146 * TECSで記述されたシステムログ機能を直接呼び出す. 147 */ 148 149 extern ER tSysLog_eSysLog_write(uint_t prio, const SYSLOG *p_syslog) throw(); 150 151 Inline void 152 _syslog_0(uint_t prio, uint_t type) 153 { 154 SYSLOG logbuf; 155 156 logbuf.logtype = type; 157 (void) tSysLog_eSysLog_write(prio, &logbuf); 158 } 159 160 Inline void 161 _syslog_1(uint_t prio, uint_t type, LOGPAR arg1) 162 { 163 SYSLOG logbuf; 164 165 logbuf.logtype = type; 166 logbuf.logpar[0] = arg1; 167 (void) tSysLog_eSysLog_write(prio, &logbuf); 168 } 169 170 Inline void 171 _syslog_2(uint_t prio, uint_t type, LOGPAR arg1, LOGPAR arg2) 172 { 173 SYSLOG logbuf; 174 175 logbuf.logtype = type; 176 logbuf.logpar[0] = arg1; 177 logbuf.logpar[1] = arg2; 178 (void) tSysLog_eSysLog_write(prio, &logbuf); 179 } 180 181 Inline void 182 _syslog_3(uint_t prio, uint_t type, LOGPAR arg1, LOGPAR arg2, LOGPAR arg3) 140 /* 141 * システムログ出力のための下位のライブラリ関数 142 */ 143 144 Inline void 145 t_syslog_0(uint_t prio, uint_t type) 146 { 147 SYSLOG logbuf; 148 149 logbuf.logtype = type; 150 syslog_write(prio, &logbuf); 151 } 152 153 Inline void 154 t_syslog_1(uint_t prio, uint_t type, LOGPAR arg1) 155 { 156 SYSLOG logbuf; 157 158 logbuf.logtype = type; 159 logbuf.logpar[0] = arg1; 160 syslog_write(prio, &logbuf); 161 } 162 163 Inline void 164 t_syslog_2(uint_t prio, uint_t type, LOGPAR arg1, LOGPAR arg2) 165 { 166 SYSLOG logbuf; 167 168 logbuf.logtype = type; 169 logbuf.logpar[0] = arg1; 170 logbuf.logpar[1] = arg2; 171 syslog_write(prio, &logbuf); 172 } 173 174 Inline void 175 t_syslog_3(uint_t prio, uint_t type, LOGPAR arg1, LOGPAR arg2, LOGPAR arg3) 183 176 { 184 177 SYSLOG logbuf; … … 188 181 logbuf.logpar[1] = arg2; 189 182 logbuf.logpar[2] = arg3; 190 (void) tSysLog_eSysLog_write(prio, &logbuf);191 } 192 193 Inline void 194 _syslog_4(uint_t prio, uint_t type, LOGPAR arg1, LOGPAR arg2,183 syslog_write(prio, &logbuf); 184 } 185 186 Inline void 187 t_syslog_4(uint_t prio, uint_t type, LOGPAR arg1, LOGPAR arg2, 195 188 LOGPAR arg3, LOGPAR arg4) 196 189 { … … 202 195 logbuf.logpar[2] = arg3; 203 196 logbuf.logpar[3] = arg4; 204 (void) tSysLog_eSysLog_write(prio, &logbuf);205 } 206 207 Inline void 208 _syslog_5(uint_t prio, uint_t type, LOGPAR arg1, LOGPAR arg2,197 syslog_write(prio, &logbuf); 198 } 199 200 Inline void 201 t_syslog_5(uint_t prio, uint_t type, LOGPAR arg1, LOGPAR arg2, 209 202 LOGPAR arg3, LOGPAR arg4, LOGPAR arg5) 210 203 { … … 217 210 logbuf.logpar[3] = arg4; 218 211 logbuf.logpar[4] = arg5; 219 (void) tSysLog_eSysLog_write(prio, &logbuf);220 } 221 222 Inline void 223 _syslog_6(uint_t prio, uint_t type, LOGPAR arg1, LOGPAR arg2,212 syslog_write(prio, &logbuf); 213 } 214 215 Inline void 216 t_syslog_6(uint_t prio, uint_t type, LOGPAR arg1, LOGPAR arg2, 224 217 LOGPAR arg3, LOGPAR arg4, LOGPAR arg5, LOGPAR arg6) 225 218 { … … 233 226 logbuf.logpar[4] = arg5; 234 227 logbuf.logpar[5] = arg6; 235 (void) tSysLog_eSysLog_write(prio, &logbuf);228 syslog_write(prio, &logbuf); 236 229 } 237 230 … … 239 232 * ログ情報(コメント)を出力するためのライブラリ関数(vasyslog.c) 240 233 */ 241 extern void syslog(uint_t prio, const char *format, ...) throw(); 234 extern void tt_syslog(SYSLOG *p_logbuf, const char *format, va_list ap); 235 236 Inline void 237 syslog(uint_t prio, const char *format, ...) 238 { 239 va_list ap; 240 SYSLOG logbuf; 241 242 va_start(ap, format); 243 tt_syslog(&logbuf, format, ap); 244 va_end(ap); 245 syslog_write(prio, &logbuf); 246 } 247 248 /* 249 * エラーメッセージを出力するためのライブラリ関数(t_perror.c) 250 */ 251 extern void tt_perror(SYSLOG *p_logbuf, const char *file, int_t line, 252 const char *expr, ER ercd); 253 254 Inline void 255 t_perror(uint_t prio, const char *file, int_t line, const char *expr, ER ercd) 256 { 257 SYSLOG logbuf; 258 259 tt_perror(&logbuf, file, line, expr, ercd); 260 syslog_write(prio, &logbuf); 261 } 242 262 243 263 #else /* TOPPERS_OMIT_SYSLOG */ 244 245 264 /* 246 265 * システムログ出力を抑止する場合 … … 248 267 249 268 Inline void 250 _syslog_0(uint_t prio, uint_t type)251 { 252 } 253 254 Inline void 255 _syslog_1(uint_t prio, uint_t type, LOGPAR arg1)256 { 257 } 258 259 Inline void 260 _syslog_2(uint_t prio, uint_t type, LOGPAR arg1, LOGPAR arg2)261 { 262 } 263 264 Inline void 265 _syslog_3(uint_t prio, uint_t type, LOGPAR arg1, LOGPAR arg2, LOGPAR arg3)266 { 267 } 268 269 Inline void 270 _syslog_4(uint_t prio, uint_t type, LOGPAR arg1, LOGPAR arg2,269 t_syslog_0(uint_t prio, uint_t type) 270 { 271 } 272 273 Inline void 274 t_syslog_1(uint_t prio, uint_t type, LOGPAR arg1) 275 { 276 } 277 278 Inline void 279 t_syslog_2(uint_t prio, uint_t type, LOGPAR arg1, LOGPAR arg2) 280 { 281 } 282 283 Inline void 284 t_syslog_3(uint_t prio, uint_t type, LOGPAR arg1, LOGPAR arg2, LOGPAR arg3) 285 { 286 } 287 288 Inline void 289 t_syslog_4(uint_t prio, uint_t type, LOGPAR arg1, LOGPAR arg2, 271 290 LOGPAR arg3, LOGPAR arg4) 272 291 { … … 274 293 275 294 Inline void 276 _syslog_5(uint_t prio, uint_t type, LOGPAR arg1, LOGPAR arg2,295 t_syslog_5(uint_t prio, uint_t type, LOGPAR arg1, LOGPAR arg2, 277 296 LOGPAR arg3, LOGPAR arg4, LOGPAR arg5) 278 297 { … … 280 299 281 300 Inline void 282 _syslog_6(uint_t prio, uint_t type, LOGPAR arg1, LOGPAR arg2,301 t_syslog_6(uint_t prio, uint_t type, LOGPAR arg1, LOGPAR arg2, 283 302 LOGPAR arg3, LOGPAR arg4, LOGPAR arg5, LOGPAR arg6) 284 303 { … … 289 308 { 290 309 } 310 311 Inline void 312 t_perror(uint_t prio, const char *file, int_t line, const char *expr, ER ercd) 313 { 314 } 291 315 292 316 #endif /* TOPPERS_OMIT_SYSLOG */ 293 317 294 318 /* 295 * ログ情報(コメント)を出力するためのマクロ319 * システムログ出力のためのライブラリ関数 296 320 * 297 321 * formatおよび後続の引数から作成したメッセージを,重大度prioでログ情 … … 301 325 302 326 #define syslog_0(prio, format) \ 303 _syslog_1(prio, LOG_TYPE_COMMENT, (LOGPAR)(format))327 t_syslog_1(prio, LOG_TYPE_COMMENT, (LOGPAR)(format)) 304 328 305 329 #define syslog_1(prio, format, arg1) \ 306 _syslog_2(prio, LOG_TYPE_COMMENT, (LOGPAR)(format), \330 t_syslog_2(prio, LOG_TYPE_COMMENT, (LOGPAR)(format), \ 307 331 (LOGPAR)(arg1)) 308 332 309 333 #define syslog_2(prio, format, arg1, arg2) \ 310 _syslog_3(prio, LOG_TYPE_COMMENT, (LOGPAR)(format), \334 t_syslog_3(prio, LOG_TYPE_COMMENT, (LOGPAR)(format), \ 311 335 (LOGPAR)(arg1), (LOGPAR)(arg2)) 312 336 313 337 #define syslog_3(prio, format, arg1, arg2, arg3) \ 314 _syslog_4(prio, LOG_TYPE_COMMENT, (LOGPAR)(format), \338 t_syslog_4(prio, LOG_TYPE_COMMENT, (LOGPAR)(format), \ 315 339 (LOGPAR)(arg1), (LOGPAR)(arg2), (LOGPAR)(arg3)) 316 340 317 341 #define syslog_4(prio, format, arg1, arg2, arg3, arg4) \ 318 _syslog_5(prio, LOG_TYPE_COMMENT, (LOGPAR)(format), \342 t_syslog_5(prio, LOG_TYPE_COMMENT, (LOGPAR)(format), \ 319 343 (LOGPAR)(arg1), (LOGPAR)(arg2), (LOGPAR)(arg3), \ 320 344 (LOGPAR)(arg4)) 321 345 322 346 #define syslog_5(prio, format, arg1, arg2, arg3, arg4, arg5) \ 323 _syslog_6(prio, LOG_TYPE_COMMENT, (LOGPAR)(format), \347 t_syslog_6(prio, LOG_TYPE_COMMENT, (LOGPAR)(format), \ 324 348 (LOGPAR)(arg1), (LOGPAR)(arg2), (LOGPAR)(arg3), \ 325 349 (LOGPAR)(arg4), (LOGPAR)(arg5)) … … 330 354 #ifndef TOPPERS_assert_fail 331 355 #define TOPPERS_assert_fail(exp, file, line) \ 332 _syslog_3(LOG_EMERG, LOG_TYPE_ASSERT, (LOGPAR)(file), \356 t_syslog_3(LOG_EMERG, LOG_TYPE_ASSERT, (LOGPAR)(file), \ 333 357 (LOGPAR)(line), (LOGPAR)(exp)) 334 358 #endif /* TOPPERS_assert_fail */ -
EcnlProtoTool/trunk/asp3_dcre/kernel/Makefile.kernel
r321 r429 6 6 # Copyright (C) 2003 by Embedded and Real-Time Systems Laboratory 7 7 # Toyohashi Univ. of Technology, JAPAN 8 # Copyright (C) 2005-201 6by Embedded and Real-Time Systems Laboratory8 # Copyright (C) 2005-2018 by Embedded and Real-Time Systems Laboratory 9 9 # Graduate School of Information Science, Nagoya Univ., JAPAN 10 10 # … … 68 68 wobjwai.o wobjwaitmo.o iniwque.o 69 69 70 time_event = tmeini.o tmeup.o tmedown.o tmecur.o tmeset.o \71 tme reg.o tmeenq.o tmedeq.o tmechk.o tmeltim.o sigtim.o70 time_event = tmeini.o tmeup.o tmedown.o tmecur.o tmeset.o tmereg.o \ 71 tmeenqrel.o tmedeq.o tmechk.o tmeltim.o sigtim.o 72 72 73 73 task_manage = acre_tsk.o del_tsk.o act_tsk.o can_act.o get_tst.o \ … … 112 112 sns_ctx.o sns_loc.o sns_dsp.o sns_dpn.o sns_ker.o 113 113 114 interrupt = isrini.o isrcal.o acre_isr.o del_isr.o \115 intini.o dis_int.o ena_int.o chg_ipm.o get_ipm.o114 interrupt = isrini.o isrcal.o acre_isr.o del_isr.o intini.o \ 115 dis_int.o ena_int.o clr_int.o ras_int.o prb_int.o chg_ipm.o get_ipm.o 116 116 117 117 exception = excini.o xsns_dpn.o … … 120 120 # 生成されるオブジェクトファイルの依存関係の定義 121 121 # 122 $( startup) $(startup:.o=.s): startup.c123 $( task) $(task:.o=.s): task.c124 $( taskhook) $(taskhook:.o=.s): taskhook.c125 $( wait) $(wait:.o=.s): wait.c126 $( time_event) $(time_event:.o=.s): time_event.c127 $( task_manage) $(task_manage:.o=.s): task_manage.c128 $( task_refer) $(task_refer:.o=.s): task_refer.c129 $( task_sync) $(task_sync:.o=.s): task_sync.c130 $( task_term) $(task_term:.o=.s): task_term.c131 $( semaphore) $(semaphore:.o=.s): semaphore.c132 $( eventflag) $(eventflag:.o=.s): eventflag.c133 $( dataqueue) $(dataqueue:.o=.s): dataqueue.c134 $( pridataq) $(pridataq:.o=.s): pridataq.c135 $( mutex) $(mutex:.o=.s): mutex.c136 $( mempfix) $(mempfix:.o=.s): mempfix.c137 $( time_manage) $(time_manage:.o=.s): time_manage.c138 $( cyclic) $(cyclic:.o=.s): cyclic.c139 $(a larm) $(alarm:.o=.s): alarm.c140 $( sys_manage) $(sys_manage:.o=.s): sys_manage.c141 $( interrupt) $(interrupt:.o=.s): interrupt.c142 $( exception) $(exception:.o=.s): exception.c122 $(addprefix $(OBJDIR)/, $(startup)) $(startup:.o=.s): startup.c 123 $(addprefix $(OBJDIR)/, $(task)) $(task:.o=.s): task.c 124 $(addprefix $(OBJDIR)/, $(taskhook)) $(taskhook:.o=.s): taskhook.c 125 $(addprefix $(OBJDIR)/, $(wait)) $(wait:.o=.s): wait.c 126 $(addprefix $(OBJDIR)/, $(time_event)) $(time_event:.o=.s): time_event.c 127 $(addprefix $(OBJDIR)/, $(task_manage)) $(task_manage:.o=.s): task_manage.c 128 $(addprefix $(OBJDIR)/, $(task_refer)) $(task_refer:.o=.s): task_refer.c 129 $(addprefix $(OBJDIR)/, $(task_sync)) $(task_sync:.o=.s): task_sync.c 130 $(addprefix $(OBJDIR)/, $(task_term)) $(task_term:.o=.s): task_term.c 131 $(addprefix $(OBJDIR)/, $(semaphore)) $(semaphore:.o=.s): semaphore.c 132 $(addprefix $(OBJDIR)/, $(eventflag)) $(eventflag:.o=.s): eventflag.c 133 $(addprefix $(OBJDIR)/, $(dataqueue)) $(dataqueue:.o=.s): dataqueue.c 134 $(addprefix $(OBJDIR)/, $(pridataq)) $(pridataq:.o=.s): pridataq.c 135 $(addprefix $(OBJDIR)/, $(mutex)) $(mutex:.o=.s): mutex.c 136 $(addprefix $(OBJDIR)/, $(mempfix)) $(mempfix:.o=.s): mempfix.c 137 $(addprefix $(OBJDIR)/, $(time_manage)) $(time_manage:.o=.s): time_manage.c 138 $(addprefix $(OBJDIR)/, $(cyclic)) $(cyclic:.o=.s): cyclic.c 139 $(addprefix $(OBJDIR)/, $(alarm)) $(alarm:.o=.s): alarm.c 140 $(addprefix $(OBJDIR)/, $(sys_manage)) $(sys_manage:.o=.s): sys_manage.c 141 $(addprefix $(OBJDIR)/, $(interrupt)) $(interrupt:.o=.s): interrupt.c 142 $(addprefix $(OBJDIR)/, $(exception)) $(exception:.o=.s): exception.c -
EcnlProtoTool/trunk/asp3_dcre/kernel/alarm.c
r321 r429 6 6 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory 7 7 * Toyohashi Univ. of Technology, JAPAN 8 * Copyright (C) 2005-201 6by Embedded and Real-Time Systems Laboratory8 * Copyright (C) 2005-2018 by Embedded and Real-Time Systems Laboratory 9 9 * Graduate School of Information Science, Nagoya Univ., JAPAN 10 10 * … … 164 164 ALMINIB *p_alminib; 165 165 ATR almatr; 166 T_NFYINFO nfyinfo,*p_nfyinfo;167 ER ercd , rercd;166 T_NFYINFO *p_nfyinfo; 167 ER ercd; 168 168 169 169 LOG_ACRE_ALM_ENTER(pk_calm); … … 171 171 172 172 almatr = pk_calm->almatr; 173 nfyinfo = pk_calm->nfyinfo; 174 175 CHECK_RSATR(almatr, TA_NULL); 176 rercd = check_nfyinfo(&nfyinfo); 177 if (rercd != E_OK) { 178 ercd = rercd; 173 174 CHECK_VALIDATR(almatr, TA_NULL); 175 ercd = check_nfyinfo(&(pk_calm->nfyinfo)); 176 if (ercd != E_OK) { 179 177 goto error_exit; 180 178 } … … 189 187 p_alminib = (ALMINIB *)(p_almcb->p_alminib); 190 188 p_alminib->almatr = almatr; 191 if ( nfyinfo.nfymode == TNFY_HANDLER) {192 p_alminib->exinf = nfyinfo.nfy.handler.exinf;193 p_alminib->nfyhdr = (NFYHDR)( nfyinfo.nfy.handler.tmehdr);189 if (pk_calm->nfyinfo.nfymode == TNFY_HANDLER) { 190 p_alminib->exinf = pk_calm->nfyinfo.nfy.handler.exinf; 191 p_alminib->nfyhdr = (NFYHDR)(pk_calm->nfyinfo.nfy.handler.tmehdr); 194 192 } 195 193 else { 196 194 p_nfyinfo = &aalm_nfyinfo_table[p_alminib - aalminib_table]; 197 *p_nfyinfo = nfyinfo;195 *p_nfyinfo = pk_calm->nfyinfo; 198 196 p_alminib->exinf = (intptr_t) p_nfyinfo; 199 197 p_alminib->nfyhdr = notify_handler; … … 283 281 p_almcb->almsta = true; 284 282 } 285 tmevtb_enqueue (&(p_almcb->tmevtb), almtim);283 tmevtb_enqueue_reltim(&(p_almcb->tmevtb), almtim); 286 284 ercd = E_OK; 287 285 } … … 385 383 /* 386 384 * 通知ハンドラを,CPUロック解除状態で呼び出す. 385 * 386 * アラーム通知の生成/削除はタスクからしか行えないため,アラーム 387 * 通知初期化ブロックをCPUロック解除状態で参照しても問題ない. 387 388 */ 388 389 unlock_cpu(); -
EcnlProtoTool/trunk/asp3_dcre/kernel/alarm.trb
r321 r429 6 6 # 7 7 # Copyright (C) 2015 by FUJI SOFT INCORPORATED, JAPAN 8 # Copyright (C) 2015 ,2016by Embedded and Real-Time Systems Laboratory8 # Copyright (C) 2015-2019 by Embedded and Real-Time Systems Laboratory 9 9 # Graduate School of Information Science, Nagoya Univ., JAPAN 10 10 # … … 52 52 53 53 def prepare(key, params) 54 # almatrが無効の場合(E_RSATR)[NGKI2491] 55 #(TA_ STA以外のビットがセットされている場合)56 if (params[:almatr] & ~($TA_STA)) != 054 # almatrが無効の場合(E_RSATR)[NGKI2491][NGKI3423][NGKI3424] 55 #(TA_NULLでない場合) 56 if (params[:almatr] != $TA_NULL) 57 57 error_illegal_id("E_RSATR", params, :almatr, :almid) 58 58 end -
EcnlProtoTool/trunk/asp3_dcre/kernel/allfunc.h
r321 r429 4 4 * Advanced Standard Profile Kernel 5 5 * 6 * Copyright (C) 2005-201 5by Embedded and Real-Time Systems Laboratory6 * Copyright (C) 2005-2018 by Embedded and Real-Time Systems Laboratory 7 7 * Graduate School of Information Science, Nagoya Univ., JAPAN 8 8 * … … 81 81 #define TOPPERS_tmeset 82 82 #define TOPPERS_tmereg 83 #define TOPPERS_tmeenq 83 #define TOPPERS_tmeenqrel 84 84 #define TOPPERS_tmedeq 85 85 #define TOPPERS_tmechk … … 257 257 #define TOPPERS_dis_int 258 258 #define TOPPERS_ena_int 259 #define TOPPERS_clr_int 260 #define TOPPERS_ras_int 261 #define TOPPERS_prb_int 259 262 #define TOPPERS_chg_ipm 260 263 #define TOPPERS_get_ipm -
EcnlProtoTool/trunk/asp3_dcre/kernel/check.h
r321 r429 6 6 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory 7 7 * Toyohashi Univ. of Technology, JAPAN 8 * Copyright (C) 2005-201 5by Embedded and Real-Time Systems Laboratory8 * Copyright (C) 2005-2019 by Embedded and Real-Time Systems Laboratory 9 9 * Graduate School of Information Science, Nagoya Univ., JAPAN 10 10 * … … 65 65 66 66 /* 67 * オブジェクト番号の範囲の判定68 */69 #ifndef VALID_INTNO_DISINT70 #define VALID_INTNO_DISINT(intno) VALID_INTNO(intno)71 #endif /* VALID_INTNO_DISINT */72 73 #ifndef VALID_INTNO_CREISR74 #define VALID_INTNO_CREISR(intno) VALID_INTNO(intno)75 #endif /* VALID_INTNO_CREISR */76 77 /*78 67 * 優先度の範囲の判定 79 68 */ … … 85 74 (TMIN_ISRPRI <= (isrpri) && (isrpri) <= TMAX_ISRPRI) 86 75 87 #ifndef VALID_INTPRI_CHGIPM88 #define VALID_INTPRI_CHGIPM(intpri) \89 (TMIN_INTPRI <= (intpri) && (intpri) <= TIPM_ENAALL)90 #endif /* VALID_INTPRI_CHGIPM */91 92 76 /* 93 77 * 相対時間の範囲の判定 … … 98 82 * タイムアウト指定値の範囲の判定 99 83 */ 100 #define VALID_TMOUT(tmout) ((tmout) <= TMAX_RELTIM || (tmout) == TMO_FEVR \ 101 || (tmout) == TMO_POL) 84 #define VALID_TMOUT(tmout) ((tmout) <= TMAX_RELTIM || (tmout) == TMO_FEVR) 102 85 103 86 /* … … 208 191 209 192 /* 210 * オブジェクトIDのチェック(E_ID)193 * 不正ID番号のチェック(E_ID) 211 194 */ 212 195 #define CHECK_ID(exp) do { \ … … 218 201 219 202 /* 220 * 予約属性エラーのチェック(E_RSATR)221 */ 222 #define CHECK_ RSATR(atr, valid_atr) do { \203 * 属性が無効なビットが立っていないかのチェック(E_RSATR) 204 */ 205 #define CHECK_VALIDATR(atr, valid_atr) do { \ 223 206 if (((atr) & ~(valid_atr)) != 0U) { \ 224 207 ercd = E_RSATR; \ … … 238 221 239 222 /* 240 * 不正使用エラーのチェック(E_ILUSE)223 * サービスコール不正使用のチェック(E_ILUSE) 241 224 */ 242 225 #define CHECK_ILUSE(exp) do { \ … … 248 231 249 232 /* 250 * 静的なオブジェクト状態エラーのチェック(E_OBJ)233 * オブジェクト状態エラーのチェック(E_OBJ) 251 234 */ 252 235 #define CHECK_OBJ(exp) do { \ -
EcnlProtoTool/trunk/asp3_dcre/kernel/cyclic.c
r321 r429 6 6 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory 7 7 * Toyohashi Univ. of Technology, JAPAN 8 * Copyright (C) 2005-201 6by Embedded and Real-Time Systems Laboratory8 * Copyright (C) 2005-2018 by Embedded and Real-Time Systems Laboratory 9 9 * Graduate School of Information Science, Nagoya Univ., JAPAN 10 10 * … … 175 175 CYCINIB *p_cycinib; 176 176 ATR cycatr; 177 T_NFYINFO nfyinfo, *p_nfyinfo; 178 RELTIM cyctim; 179 RELTIM cycphs; 180 ER ercd, rercd; 177 RELTIM cyctim, cycphs; 178 T_NFYINFO *p_nfyinfo; 179 ER ercd; 181 180 182 181 LOG_ACRE_CYC_ENTER(pk_ccyc); … … 184 183 185 184 cycatr = pk_ccyc->cycatr; 186 nfyinfo = pk_ccyc->nfyinfo;187 185 cyctim = pk_ccyc->cyctim; 188 186 cycphs = pk_ccyc->cycphs; 189 187 190 CHECK_RSATR(cycatr, TA_STA); 191 rercd = check_nfyinfo(&nfyinfo); 192 if (rercd != E_OK) { 193 ercd = rercd; 188 CHECK_VALIDATR(cycatr, TA_STA); 189 ercd = check_nfyinfo(&(pk_ccyc->nfyinfo)); 190 if (ercd != E_OK) { 194 191 goto error_exit; 195 192 } … … 206 203 p_cycinib = (CYCINIB *)(p_cyccb->p_cycinib); 207 204 p_cycinib->cycatr = cycatr; 208 if ( nfyinfo.nfymode == TNFY_HANDLER) {209 p_cycinib->exinf = nfyinfo.nfy.handler.exinf;210 p_cycinib->nfyhdr = (NFYHDR)( nfyinfo.nfy.handler.tmehdr);205 if (pk_ccyc->nfyinfo.nfymode == TNFY_HANDLER) { 206 p_cycinib->exinf = pk_ccyc->nfyinfo.nfy.handler.exinf; 207 p_cycinib->nfyhdr = (NFYHDR)(pk_ccyc->nfyinfo.nfy.handler.tmehdr); 211 208 } 212 209 else { 213 210 p_nfyinfo = &acyc_nfyinfo_table[p_cycinib - acycinib_table]; 214 *p_nfyinfo = nfyinfo;211 *p_nfyinfo = pk_ccyc->nfyinfo; 215 212 p_cycinib->exinf = (intptr_t) p_nfyinfo; 216 213 p_cycinib->nfyhdr = notify_handler; … … 221 218 if ((p_cyccb->p_cycinib->cycatr & TA_STA) != 0U) { 222 219 p_cyccb->cycsta = true; 223 tmevtb_enqueue(&(p_cyccb->tmevtb), p_cyccb->p_cycinib->cycphs); 220 tmevtb_enqueue_reltim(&(p_cyccb->tmevtb), 221 p_cyccb->p_cycinib->cycphs); 224 222 } 225 223 else { … … 311 309 * 初回の起動のためのタイムイベントを登録する[ASPD1036]. 312 310 */ 313 tmevtb_enqueue (&(p_cyccb->tmevtb), p_cyccb->p_cycinib->cycphs);311 tmevtb_enqueue_reltim(&(p_cyccb->tmevtb), p_cyccb->p_cycinib->cycphs); 314 312 ercd = E_OK; 315 313 } … … 414 412 /* 415 413 * 通知ハンドラを,CPUロック解除状態で呼び出す. 414 * 415 * 周期通知の生成/削除はタスクからしか行えないため,周期通知初期 416 * 化ブロックをCPUロック解除状態で参照しても問題ない. 416 417 */ 417 418 unlock_cpu(); -
EcnlProtoTool/trunk/asp3_dcre/kernel/cyclic.trb
r321 r429 6 6 # 7 7 # Copyright (C) 2015 by FUJI SOFT INCORPORATED, JAPAN 8 # Copyright (C) 2015 ,2016by Embedded and Real-Time Systems Laboratory8 # Copyright (C) 2015-2019 by Embedded and Real-Time Systems Laboratory 9 9 # Graduate School of Information Science, Nagoya Univ., JAPAN 10 10 # … … 52 52 53 53 def prepare(key, params) 54 # cycatrが無効の場合(E_RSATR)[NGKI2383] 54 # cycatrが無効の場合(E_RSATR)[NGKI2383][NGKI2370][ASPS0172] 55 55 #(TA_STA以外のビットがセットされている場合) 56 56 if (params[:cycatr] & ~($TA_STA)) != 0 … … 58 58 end 59 59 60 # (0 < cyctim && cyctim <= TMAX_RELTIM)でない場合(E_PAR)[NGKI2397] 60 # cyctimが有効範囲外の場合(E_PAR)[NGKI2397] 61 #(0 < cyctim && cyctim <= TMAX_RELTIMでない場合) 61 62 if !(0 < params[:cyctim] && params[:cyctim] <= $TMAX_RELTIM) 62 63 error_illegal_id("E_PAR", params, :cyctim, :cycid) 63 64 end 64 65 65 # (0 <= cycphs && cycphs <= TMAX_RELTIM)でない場合(E_PAR)[NGKI2399] 66 # cycphsが有効範囲外の場合(E_PAR)[NGKI2399] 67 #(0 <= cycphs && cycphs <= TMAX_RELTIMでない場合) 66 68 if !(0 <= params[:cycphs] && params[:cycphs] <= $TMAX_RELTIM) 67 69 error_illegal_id("E_PAR", params, :cycphs, :cycid) -
EcnlProtoTool/trunk/asp3_dcre/kernel/dataqueue.c
r321 r429 6 6 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory 7 7 * Toyohashi Univ. of Technology, JAPAN 8 * Copyright (C) 2005-201 7by Embedded and Real-Time Systems Laboratory8 * Copyright (C) 2005-2018 by Embedded and Real-Time Systems Laboratory 9 9 * Graduate School of Information Science, Nagoya Univ., JAPAN 10 10 * … … 356 356 p_dtqmb = pk_cdtq->dtqmb; 357 357 358 CHECK_RSATR(dtqatr, TA_TPRI); 358 CHECK_VALIDATR(dtqatr, TA_TPRI); 359 if (p_dtqmb != NULL) { 360 CHECK_PAR(MB_ALIGN(p_dtqmb)); 361 } 359 362 360 363 lock_cpu(); … … 364 367 else { 365 368 if (dtqcnt != 0 && p_dtqmb == NULL) { 366 p_dtqmb = kernel_malloc(sizeof(DTQMB) * dtqcnt);369 p_dtqmb = malloc_mpk(sizeof(DTQMB) * dtqcnt); 367 370 dtqatr |= TA_MBALLOC; 368 371 } … … 423 426 p_dtqinib = (DTQINIB *)(p_dtqcb->p_dtqinib); 424 427 if ((p_dtqinib->dtqatr & TA_MBALLOC) != 0U) { 425 kernel_free(p_dtqinib->p_dtqmb);428 free_mpk(p_dtqinib->p_dtqmb); 426 429 } 427 430 p_dtqinib->dtqatr = TA_NOEXS; … … 449 452 snd_dtq(ID dtqid, intptr_t data) 450 453 { 451 DTQCB *p_dtqcb;452 WINFO_SDTQ 453 ER ercd;454 DTQCB *p_dtqcb; 455 WINFO_SDTQ winfo_sdtq; 456 ER ercd; 454 457 455 458 LOG_SND_DTQ_ENTER(dtqid, data); … … 473 476 else { 474 477 winfo_sdtq.data = data; 475 p_runtsk->tstat = TS_WAITING_SDTQ;476 wobj_make_wait((WOBJCB *) p_dtqcb,(WINFO_WOBJ *) &winfo_sdtq);478 wobj_make_wait((WOBJCB *) p_dtqcb, TS_WAITING_SDTQ, 479 (WINFO_WOBJ *) &winfo_sdtq); 477 480 dispatch(); 478 481 ercd = winfo_sdtq.winfo.wercd; … … 513 516 } 514 517 else { 515 request_dispatch ();518 request_dispatch_retint(); 516 519 } 517 520 } … … 538 541 tsnd_dtq(ID dtqid, intptr_t data, TMO tmout) 539 542 { 540 DTQCB *p_dtqcb;541 WINFO_SDTQ 542 TMEVTB tmevtb;543 ER ercd;543 DTQCB *p_dtqcb; 544 WINFO_SDTQ winfo_sdtq; 545 TMEVTB tmevtb; 546 ER ercd; 544 547 545 548 LOG_TSND_DTQ_ENTER(dtqid, data, tmout); … … 567 570 else { 568 571 winfo_sdtq.data = data; 569 p_runtsk->tstat = TS_WAITING_SDTQ; 570 wobj_make_wait_tmout((WOBJCB *) p_dtqcb, (WINFO_WOBJ *) &winfo_sdtq, 571 &tmevtb, tmout); 572 wobj_make_wait_tmout((WOBJCB *) p_dtqcb, TS_WAITING_SDTQ, 573 (WINFO_WOBJ *) &winfo_sdtq, &tmevtb, tmout); 572 574 dispatch(); 573 575 ercd = winfo_sdtq.winfo.wercd; … … 612 614 } 613 615 else { 614 request_dispatch ();616 request_dispatch_retint(); 615 617 } 616 618 } 617 ercd = E_OK;619 ercd = E_OK; 618 620 } 619 621 unlock_cpu(); … … 634 636 rcv_dtq(ID dtqid, intptr_t *p_data) 635 637 { 636 DTQCB *p_dtqcb;637 WINFO_RDTQ 638 ER ercd;638 DTQCB *p_dtqcb; 639 WINFO_RDTQ winfo_rdtq; 640 ER ercd; 639 641 640 642 LOG_RCV_DTQ_ENTER(dtqid, p_data); … … 657 659 } 658 660 else { 659 p_runtsk->tstat = TS_WAITING_RDTQ; 660 make_wait(&(winfo_rdtq.winfo)); 661 make_wait(TS_WAITING_RDTQ, &(winfo_rdtq.winfo)); 661 662 queue_insert_prev(&(p_dtqcb->rwait_queue), &(p_runtsk->task_queue)); 662 663 winfo_rdtq.p_dtqcb = p_dtqcb; … … 723 724 trcv_dtq(ID dtqid, intptr_t *p_data, TMO tmout) 724 725 { 725 DTQCB *p_dtqcb;726 WINFO_RDTQ 727 TMEVTB tmevtb;728 ER ercd;726 DTQCB *p_dtqcb; 727 WINFO_RDTQ winfo_rdtq; 728 TMEVTB tmevtb; 729 ER ercd; 729 730 730 731 LOG_TRCV_DTQ_ENTER(dtqid, p_data, tmout); … … 751 752 } 752 753 else { 753 p_runtsk->tstat = TS_WAITING_RDTQ; 754 make_wait_tmout(&(winfo_rdtq.winfo), &tmevtb, tmout); 754 make_wait_tmout(TS_WAITING_RDTQ, &(winfo_rdtq.winfo), &tmevtb, tmout); 755 755 queue_insert_prev(&(p_dtqcb->rwait_queue), &(p_runtsk->task_queue)); 756 756 winfo_rdtq.p_dtqcb = p_dtqcb; -
EcnlProtoTool/trunk/asp3_dcre/kernel/dataqueue.trb
r321 r429 6 6 # 7 7 # Copyright (C) 2015 by FUJI SOFT INCORPORATED, JAPAN 8 # Copyright (C) 2015 ,2016by Embedded and Real-Time Systems Laboratory8 # Copyright (C) 2015-2019 by Embedded and Real-Time Systems Laboratory 9 9 # Graduate School of Information Science, Nagoya Univ., JAPAN 10 10 # … … 54 54 params[:dtqmb] ||= "NULL" 55 55 56 # dtqatrが無効の場合(E_RSATR)[NGKI1669] 56 # dtqatrが無効の場合(E_RSATR)[NGKI1669][NGKI1661] 57 57 #(TA_TPRI以外のビットがセットされている場合) 58 58 if (params[:dtqatr] & ~($TA_TPRI)) != 0 -
EcnlProtoTool/trunk/asp3_dcre/kernel/eventflag.c
r321 r429 6 6 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory 7 7 * Toyohashi Univ. of Technology, JAPAN 8 * Copyright (C) 2005-201 7by Embedded and Real-Time Systems Laboratory8 * Copyright (C) 2005-2018 by Embedded and Real-Time Systems Laboratory 9 9 * Graduate School of Information Science, Nagoya Univ., JAPAN 10 10 * … … 216 216 flgatr = pk_cflg->flgatr; 217 217 218 CHECK_ RSATR(flgatr, TA_TPRI|TA_WMUL|TA_CLR);218 CHECK_VALIDATR(flgatr, TA_TPRI|TA_WMUL|TA_CLR); 219 219 220 220 lock_cpu(); … … 292 292 set_flg(ID flgid, FLGPTN setptn) 293 293 { 294 FLGCB *p_flgcb; 295 QUEUE *p_queue; 296 TCB *p_tcb; 297 WINFO_FLG *p_winfo_flg; 298 ER ercd; 294 FLGCB *p_flgcb; 295 QUEUE *p_queue; 296 TCB *p_tcb; 297 WINFO_FLG *p_winfo_flg; 298 bool_t lock; 299 ER ercd; 299 300 300 301 LOG_SET_FLG_ENTER(flgid, setptn); 301 CHECK_UNL();302 lock = sense_lock(); 302 303 CHECK_ID(VALID_FLGID(flgid)); 303 304 p_flgcb = get_flgcb(flgid); 304 305 305 lock_cpu(); 306 if (!lock) 307 lock_cpu(); 306 308 if (p_flgcb->p_flginib->flgatr == TA_NOEXS) { 307 309 ercd = E_NOEXS; … … 328 330 } 329 331 else { 330 request_dispatch ();332 request_dispatch_retint(); 331 333 } 332 334 } 333 335 ercd = E_OK; 334 336 } 335 unlock_cpu(); 337 if (!lock) 338 unlock_cpu(); 336 339 337 340 error_exit: … … 351 354 { 352 355 FLGCB *p_flgcb; 356 bool_t lock; 353 357 ER ercd; 354 358 355 359 LOG_CLR_FLG_ENTER(flgid, clrptn); 356 CHECK_TSKCTX_UNL();360 lock = sense_lock(); 357 361 CHECK_ID(VALID_FLGID(flgid)); 358 362 p_flgcb = get_flgcb(flgid); 359 363 360 lock_cpu(); 364 if (!lock) 365 lock_cpu(); 361 366 if (p_flgcb->p_flginib->flgatr == TA_NOEXS) { 362 367 ercd = E_NOEXS; … … 366 371 ercd = E_OK; 367 372 } 368 unlock_cpu(); 373 if (!lock) 374 unlock_cpu(); 369 375 370 376 error_exit: … … 383 389 wai_flg(ID flgid, FLGPTN waiptn, MODE wfmode, FLGPTN *p_flgptn) 384 390 { 385 FLGCB *p_flgcb;386 WINFO_FLG 387 ER ercd;391 FLGCB *p_flgcb; 392 WINFO_FLG winfo_flg; 393 ER ercd; 388 394 389 395 LOG_WAI_FLG_ENTER(flgid, waiptn, wfmode, p_flgptn); … … 411 417 winfo_flg.waiptn = waiptn; 412 418 winfo_flg.wfmode = wfmode; 413 p_runtsk->tstat = TS_WAITING_FLG;414 wobj_make_wait((WOBJCB *) p_flgcb,(WINFO_WOBJ *) &winfo_flg);419 wobj_make_wait((WOBJCB *) p_flgcb, TS_WAITING_FLG, 420 (WINFO_WOBJ *) &winfo_flg); 415 421 dispatch(); 416 422 ercd = winfo_flg.winfo.wercd; … … 477 483 twai_flg(ID flgid, FLGPTN waiptn, MODE wfmode, FLGPTN *p_flgptn, TMO tmout) 478 484 { 479 FLGCB *p_flgcb;480 WINFO_FLG 481 TMEVTB tmevtb;482 ER ercd;485 FLGCB *p_flgcb; 486 WINFO_FLG winfo_flg; 487 TMEVTB tmevtb; 488 ER ercd; 483 489 484 490 LOG_TWAI_FLG_ENTER(flgid, waiptn, wfmode, p_flgptn, tmout); … … 510 516 winfo_flg.waiptn = waiptn; 511 517 winfo_flg.wfmode = wfmode; 512 p_runtsk->tstat = TS_WAITING_FLG; 513 wobj_make_wait_tmout((WOBJCB *) p_flgcb, (WINFO_WOBJ *) &winfo_flg, 514 &tmevtb, tmout); 518 wobj_make_wait_tmout((WOBJCB *) p_flgcb, TS_WAITING_FLG, 519 (WINFO_WOBJ *) &winfo_flg, &tmevtb, tmout); 515 520 dispatch(); 516 521 ercd = winfo_flg.winfo.wercd; … … 575 580 FLGCB *p_flgcb; 576 581 ER ercd; 577 582 bool_t lock; 583 578 584 LOG_REF_FLG_ENTER(flgid, pk_rflg); 579 CHECK_TSKCTX_UNL();585 lock = sense_lock(); 580 586 CHECK_ID(VALID_FLGID(flgid)); 581 587 p_flgcb = get_flgcb(flgid); 582 588 583 lock_cpu(); 589 if (!lock) 590 lock_cpu(); 584 591 if (p_flgcb->p_flginib->flgatr == TA_NOEXS) { 585 592 ercd = E_NOEXS; … … 590 597 ercd = E_OK; 591 598 } 592 unlock_cpu(); 599 if (!lock) 600 unlock_cpu(); 593 601 594 602 error_exit: -
EcnlProtoTool/trunk/asp3_dcre/kernel/eventflag.trb
r321 r429 6 6 # 7 7 # Copyright (C) 2015 by FUJI SOFT INCORPORATED, JAPAN 8 # Copyright (C) 2015 ,2016by Embedded and Real-Time Systems Laboratory8 # Copyright (C) 2015-2019 by Embedded and Real-Time Systems Laboratory 9 9 # Graduate School of Information Science, Nagoya Univ., JAPAN 10 10 # … … 51 51 52 52 def prepare(key, params) 53 # flgatrが無効の場合(E_RSATR)[NGKI1562] 53 # flgatrが無効の場合(E_RSATR)[NGKI1562][NGKI1550] 54 54 #(TA_TPRI,TA_WMUL,TA_CLR以外のビットがセットされている場合) 55 55 if (params[:flgatr] & ~($TA_TPRI|$TA_WMUL|$TA_CLR)) != 0 -
EcnlProtoTool/trunk/asp3_dcre/kernel/exception.trb
r321 r429 6 6 # 7 7 # Copyright (C) 2015 by FUJI SOFT INCORPORATED, JAPAN 8 # Copyright (C) 2015 ,2016by Embedded and Real-Time Systems Laboratory8 # Copyright (C) 2015-2019 by Embedded and Real-Time Systems Laboratory 9 9 # Graduate School of Information Science, Nagoya Univ., JAPAN 10 10 # … … 51 51 52 52 # 53 # DEF_EXCで使用できるCPU例外ハンドラ番号のデフォルト定義 54 # 55 if !defined?($EXCNO_DEFEXC_VALID) 56 $EXCNO_DEFEXC_VALID = $EXCNO_VALID 57 end 58 59 # 53 60 # CPU例外ハンドラに関するエラーチェック 54 61 # 55 $cfgData[:DEF_EXC].each do | key, params|56 # excnoが CPU例外ハンドラ番号として正しくない場合(E_PAR)[NGKI3134]57 if $EXCNO_VALID.index(params[:excno]).nil?62 $cfgData[:DEF_EXC].each do |_, params| 63 # excnoが有効範囲外の場合(E_PAR)[NGKI3134] 64 if !$EXCNO_DEFEXC_VALID.include?(params[:excno]) 58 65 error_illegal("E_PAR", params, :excno) 59 66 end 60 67 61 # excatrが無効の場合(E_RSATR)[NGKI3131] 68 # excatrが無効の場合(E_RSATR)[NGKI3131][NGKI5178][NGKI3123] 62 69 #(TARGET_EXCATR以外のビットがセットされている場合) 63 70 if (params[:excatr] & ~($TARGET_EXCATR)) != 0 64 71 error_illegal_sym("E_RSATR", params, :excatr, :excno) 72 end 73 74 # ターゲット依存のエラーチェック 75 if defined? TargetCheckDefExc() 76 TargetCheckDefExc(params) 65 77 end 66 78 end … … 82 94 # CPU例外ハンドラのエントリ 83 95 # 84 $cfgData[:DEF_EXC].each do | key, params|96 $cfgData[:DEF_EXC].each do |_, params| 85 97 $kernelCfgC.add("EXCHDR_ENTRY(#{params[:excno]}, " \ 86 98 "#{params[:excno].val}, #{params[:exchdr]})") … … 92 104 # 93 105 $kernelCfgC.add("const EXCINIB _kernel_excinib_table[TNUM_DEF_EXCNO] = {") 94 $cfgData[:DEF_EXC].each_with_index do |( key, params), index|106 $cfgData[:DEF_EXC].each_with_index do |(_, params), index| 95 107 $kernelCfgC.add(",") if index > 0 96 108 $kernelCfgC.append("\t{ (#{params[:excno]}), (#{params[:excatr]}), " \ -
EcnlProtoTool/trunk/asp3_dcre/kernel/genoffset.trb
r321 r429 1 1 # -*- coding: utf-8 -*- 2 # 3 # TOPPERS Software 4 # Toyohashi Open Platform for Embedded Real-Time Systems 2 5 # 3 # TOPPERS/ASP Kernel 4 # Toyohashi Open Platform for Embedded Real-Time Systems/ 5 # Advanced Standard Profile Kernel 6 # 7 # Copyright (C) 2011-2016 by Embedded and Real-Time Systems Laboratory 6 # Copyright (C) 2011-2018 by Embedded and Real-Time Systems Laboratory 8 7 # Graduate School of Information Science, Nagoya Univ., JAPAN 9 8 # … … 37 36 # の責任を負わない. 38 37 # 39 # $Id $38 # $Id: genoffset.trb 936 2018-04-07 09:46:42Z ertl-hiro $ 40 39 # 41 40 … … 44 43 # 45 44 46 # 45 # 47 46 # タイムスタンプファイルの指定 48 # 47 # 49 48 $timeStampFileName = "offset.timestamp" 50 49 51 # 50 # 52 51 # offset.hの先頭部分の生成 53 # 52 # 54 53 $offsetH = GenFile.new("offset.h") 55 54 $offsetH.add2("/* offset.h */") 56 55 57 # 58 # #defineディレクティブの生成 59 # 60 def GenerateDefine(symbol, value) 61 $offsetH.add("#define #{symbol}\t#{value}") 62 end 63 64 # 56 # 65 57 # ビットのサーチ 66 # 58 # 67 59 def SearchBit(val) 68 60 (0..7).each do |valBit| … … 74 66 end 75 67 76 # 77 # ビットフィールドのオフセットとビット位置の 定義の生成78 # 79 def GenerateDefineBit(label, structSize, outputSize)68 # 69 # ビットフィールドのオフセットとビット位置の算出 70 # 71 def BitOffsetPosition(label, structSize, outputSize) 80 72 top = SYMBOL(label) 81 73 if top.nil? … … 96 88 error_exit("bit not found in `#{label}'") 97 89 else 98 valBit= SearchBit(val)90 position = SearchBit(val) 99 91 case outputSize 100 when "W"101 if $ SIL_ENDIAN_BIG102 valBit = valBit + 24 -((offset & 0x03) << 3)92 when 4, "W" 93 if $endianLittle 94 position = position + ((offset & 0x03) << 3) 103 95 else 104 valBit = valBit +((offset & 0x03) << 3)96 position = position + 24 - ((offset & 0x03) << 3) 105 97 end 106 98 offset &= ~0x03 107 when "H"108 if $ SIL_ENDIAN_BIG109 valBit = valBit + 8 -((offset & 0x01) << 3)99 when 2, "H" 100 if $endianLittle 101 position = position + ((offset & 0x01) << 3) 110 102 else 111 valBit = valBit +((offset & 0x01) << 3)103 position = position + 8 - ((offset & 0x01) << 3) 112 104 end 113 105 offset &= ~0x01 114 106 end 115 107 end 116 117 $offsetH.add("#define #{label}\t#{offset}") 118 $offsetH.add("#define #{label}_bit\t#{valBit}") 119 $offsetH.add("#define #{label}_mask\t#{sprintf("0x%x", 1 << valBit)}") 108 return offset, position 120 109 end 121 110 end 122 111 123 # 124 # バイト配置のチェック 125 # 126 def magicCheck(size, check) 127 label = "MAGIC_#{size}" 128 top = SYMBOL(label) 129 if top.nil? 130 error_exit("label `#{label}' not found") 131 else 132 1.upto(size).each do |offset| 133 if $SIL_ENDIAN_BIG 134 val = PEEK(top + offset - 1, 1) 135 else 136 val = PEEK(top + size - offset, 1) 137 end 138 if val != check.at(offset - 1) 139 error_exit("value check of `#{label}' failed") 140 end 141 end 112 # 以下の定義は,過去のバージョンとの互換性のために残している. 113 114 # 115 # #defineディレクティブの生成 116 # 117 def GenerateDefine(symbol, value) 118 $offsetH.add("#define #{symbol}\t#{value}") 119 end 120 121 # 122 # ビットフィールドのオフセットとビット位置の定義の生成 123 # 124 def GenerateDefineBit(label, structSize, outputSize) 125 offset, position = BitOffsetPosition(label, structSize, outputSize) 126 if !offset.nil? 127 GenerateDefine(label, offset) 128 GenerateDefine("#{label}_bit", position) 129 GenerateDefine("#{label}_mask", sprintf("0x%x", 1 << position)) 142 130 end 143 131 end 144 145 magicCheck(1, [ 0x12 ])146 magicCheck(2, [ 0x12, 0x34 ])147 magicCheck(4, [ 0x12, 0x34, 0x56, 0x78 ]) -
EcnlProtoTool/trunk/asp3_dcre/kernel/interrupt.c
r321 r429 6 6 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory 7 7 * Toyohashi Univ. of Technology, JAPAN 8 * Copyright (C) 2005-201 6by Embedded and Real-Time Systems Laboratory8 * Copyright (C) 2005-2019 by Embedded and Real-Time Systems Laboratory 9 9 * Graduate School of Information Science, Nagoya Univ., JAPAN 10 10 * … … 93 93 #endif /* LOG_ENA_INT_LEAVE */ 94 94 95 #ifndef LOG_CLR_INT_ENTER 96 #define LOG_CLR_INT_ENTER(intno) 97 #endif /* LOG_CLR_INT_ENTER */ 98 99 #ifndef LOG_CLR_INT_LEAVE 100 #define LOG_CLR_INT_LEAVE(ercd) 101 #endif /* LOG_CLR_INT_LEAVE */ 102 103 #ifndef LOG_RAS_INT_ENTER 104 #define LOG_RAS_INT_ENTER(intno) 105 #endif /* LOG_RAS_INT_ENTER */ 106 107 #ifndef LOG_RAS_INT_LEAVE 108 #define LOG_RAS_INT_LEAVE(ercd) 109 #endif /* LOG_RAS_INT_LEAVE */ 110 111 #ifndef LOG_PRB_INT_ENTER 112 #define LOG_PRB_INT_ENTER(intno) 113 #endif /* LOG_PRB_INT_ENTER */ 114 115 #ifndef LOG_PRB_INT_LEAVE 116 #define LOG_PRB_INT_LEAVE(ercd) 117 #endif /* LOG_PRB_INT_LEAVE */ 118 95 119 #ifndef LOG_CHG_IPM_ENTER 96 120 #define LOG_CHG_IPM_ENTER(intpri) … … 108 132 #define LOG_GET_IPM_LEAVE(ercd, p_intpri) 109 133 #endif /* LOG_GET_IPM_LEAVE */ 134 135 /* 136 * 割込み番号の範囲の判定 137 */ 138 #ifndef VALID_INTNO_DISINT 139 #define VALID_INTNO_DISINT(intno) VALID_INTNO(intno) 140 #endif /* VALID_INTNO_DISINT */ 141 142 #ifndef VALID_INTNO_CLRINT 143 #define VALID_INTNO_CLRINT(intno) VALID_INTNO(intno) 144 #endif /* VALID_INTNO_CLRINT */ 145 146 #ifndef VALID_INTNO_RASINT 147 #define VALID_INTNO_RASINT(intno) VALID_INTNO(intno) 148 #endif /* VALID_INTNO_RASINT */ 149 150 #ifndef VALID_INTNO_PRBINT 151 #define VALID_INTNO_PRBINT(intno) VALID_INTNO(intno) 152 #endif /* VALID_INTNO_PRBINT */ 153 154 #ifndef VALID_INTNO_CREISR 155 #define VALID_INTNO_CREISR(intno) VALID_INTNO(intno) 156 #endif /* VALID_INTNO_CREISR */ 157 158 /* 159 * 割込み優先度の範囲の判定 160 */ 161 #ifndef VALID_INTPRI_CHGIPM 162 #define VALID_INTPRI_CHGIPM(intpri) \ 163 (TMIN_INTPRI <= (intpri) && (intpri) <= TIPM_ENAALL) 164 #endif /* VALID_INTPRI_CHGIPM */ 110 165 111 166 /* … … 266 321 isrpri = pk_cisr->isrpri; 267 322 268 CHECK_ RSATR(isratr, TARGET_ISRATR);323 CHECK_VALIDATR(isratr, TARGET_ISRATR); 269 324 CHECK_PAR(VALID_INTNO_CREISR(intno)); 270 325 CHECK_PAR(FUNC_ALIGN(isr)); … … 384 439 lock_cpu(); 385 440 } 386 if (disable_int(intno)) { /*[NGKI3086]*/ 441 if (check_intno_cfg(intno)) { 442 disable_int(intno); /*[NGKI3086]*/ 387 443 ercd = E_OK; 388 444 } … … 421 477 lock_cpu(); 422 478 } 423 if (enable_int(intno)) { /*[NGKI3099]*/ 479 if (check_intno_cfg(intno)) { 480 enable_int(intno); /*[NGKI3099]*/ 424 481 ercd = E_OK; 425 482 } … … 438 495 #endif /* TOPPERS_SUPPORT_ENA_INT */ 439 496 #endif /* TOPPERS_ena_int */ 497 498 /* 499 * 割込み要求のクリア[NGKI3920] 500 */ 501 #ifdef TOPPERS_clr_int 502 #ifdef TOPPERS_SUPPORT_CLR_INT /*[NGKI3927]*/ 503 504 ER 505 clr_int(INTNO intno) 506 { 507 bool_t locked; 508 ER ercd; 509 510 LOG_CLR_INT_ENTER(intno); 511 CHECK_PAR(VALID_INTNO_CLRINT(intno)); /*[NGKI3921][NGKI3930]*/ 512 513 locked = sense_lock(); 514 if (!locked) { 515 lock_cpu(); 516 } 517 if (check_intno_cfg(intno) && check_intno_clear(intno)) { 518 clear_int(intno); /*[NGKI3924]*/ 519 ercd = E_OK; 520 } 521 else { 522 ercd = E_OBJ; /*[NGKI3923][NGKI3929]*/ 523 } 524 if (!locked) { 525 unlock_cpu(); 526 } 527 528 error_exit: 529 LOG_CLR_INT_LEAVE(ercd); 530 return(ercd); 531 } 532 533 #endif /* TOPPERS_SUPPORT_CLR_INT */ 534 #endif /* TOPPERS_clr_int */ 535 536 /* 537 * 割込みの要求[NGKI3932] 538 */ 539 #ifdef TOPPERS_ras_int 540 #ifdef TOPPERS_SUPPORT_RAS_INT /*[NGKI3939]*/ 541 542 ER 543 ras_int(INTNO intno) 544 { 545 bool_t locked; 546 ER ercd; 547 548 LOG_RAS_INT_ENTER(intno); 549 CHECK_PAR(VALID_INTNO_RASINT(intno)); /*[NGKI3933][NGKI3942]*/ 550 551 locked = sense_lock(); 552 if (!locked) { 553 lock_cpu(); 554 } 555 if (check_intno_cfg(intno) && check_intno_raise(intno)) { 556 raise_int(intno); /*[NGKI3936]*/ 557 ercd = E_OK; 558 } 559 else { 560 ercd = E_OBJ; /*[NGKI3935][NGKI3941]*/ 561 } 562 if (!locked) { 563 unlock_cpu(); 564 } 565 566 error_exit: 567 LOG_RAS_INT_LEAVE(ercd); 568 return(ercd); 569 } 570 571 #endif /* TOPPERS_SUPPORT_RAS_INT */ 572 #endif /* TOPPERS_ras_int */ 573 574 /* 575 * 割込み要求のチェック[NGKI3944] 576 */ 577 #ifdef TOPPERS_prb_int 578 #ifdef TOPPERS_SUPPORT_PRB_INT /*[NGKI3951]*/ 579 580 ER_BOOL 581 prb_int(INTNO intno) 582 { 583 bool_t locked; 584 ER_BOOL ercd; 585 586 LOG_PRB_INT_ENTER(intno); 587 CHECK_PAR(VALID_INTNO_PRBINT(intno)); /*[NGKI3945][NGKI3952]*/ 588 589 locked = sense_lock(); 590 if (!locked) { 591 lock_cpu(); 592 } 593 if (check_intno_cfg(intno)) { 594 ercd = (ER_BOOL) probe_int(intno); /*[NGKI3948]*/ 595 } 596 else { 597 ercd = E_OBJ; /*[NGKI3947]*/ 598 } 599 if (!locked) { 600 unlock_cpu(); 601 } 602 603 error_exit: 604 LOG_PRB_INT_LEAVE(ercd); 605 return(ercd); 606 } 607 608 #endif /* TOPPERS_SUPPORT_PRB_INT */ 609 #endif /* TOPPERS_prb_int */ 440 610 441 611 /* … … 456 626 t_set_ipm(intpri); /*[NGKI3111]*/ 457 627 if (intpri == TIPM_ENAALL && enadsp) { 458 dspflg = true; 459 p_schedtsk = search_schedtsk(); 628 set_dspflg(); 460 629 if (p_runtsk->raster && p_runtsk->enater) { 461 630 task_terminate(p_runtsk); -
EcnlProtoTool/trunk/asp3_dcre/kernel/interrupt.trb
r321 r429 6 6 # 7 7 # Copyright (C) 2015 by FUJI SOFT INCORPORATED, JAPAN 8 # Copyright (C) 2015 ,2016by Embedded and Real-Time Systems Laboratory8 # Copyright (C) 2015-2019 by Embedded and Real-Time Systems Laboratory 9 9 # Graduate School of Information Science, Nagoya Univ., JAPAN 10 10 # … … 38 38 # の責任を負わない. 39 39 # 40 # $Id $40 # $Id: interrupt.trb 1167 2019-02-03 17:06:17Z ertl-hiro $ 41 41 # 42 42 … … 54 54 # フォルト定義 55 55 # 56 if $INTNO_CREISR_VALID.nil?56 if !defined?($INTNO_CREISR_VALID) 57 57 $INTNO_CREISR_VALID = $INTNO_VALID 58 58 end 59 if $INHNO_CREISR_VALID.nil?59 if !defined?($INHNO_CREISR_VALID) 60 60 $INHNO_CREISR_VALID = $INHNO_VALID 61 61 end … … 64 64 # CFG_INTで使用できる割込み優先度のデフォルト定義 65 65 # 66 if $INTPRI_CFGINT_VALID.nil?66 if !defined?($INTPRI_CFGINT_VALID) 67 67 $INTPRI_CFGINT_VALID = $TMIN_INTPRI.upto($TMAX_INTPRI).to_a 68 68 end … … 87 87 # 割込み要求ラインに関するエラーチェック 88 88 # 89 $cfgData[:CFG_INT].each do | key, params|90 # intnoが割込み番号として正しくない場合(E_PAR)[NGKI2972]91 if $INTNO_VALID.index(params[:intno]).nil?89 $cfgData[:CFG_INT].each do |_, params| 90 # intnoが有効範囲外の場合(E_PAR)[NGKI2972] 91 if !$INTNO_VALID.include?(params[:intno]) 92 92 error_illegal("E_PAR", params, :intno) 93 93 end 94 94 95 # intatrが無効の場合(E_RSATR)[NGKI2969]95 # intatrが無効の場合(E_RSATR)[NGKI2969][NGKI2944][NGKI2945] 96 96 #(TA_ENAINT,TA_EDGE,TARGET_INTATR以外のビットがセットされている場合) 97 97 if (params[:intatr] & ~($TA_ENAINT|$TA_EDGE|$TARGET_INTATR)) != 0 … … 99 99 end 100 100 101 # 102 # 103 if $INTPRI_CFGINT_VALID.index(params[:intpri]).nil?104 error_illegal_sym("E_ OBJ", params, :intpri, :intno)105 end 106 107 # カーネル管理外に固定されているintnoに対して,intpriにTMIN_INTPRI よ108 # りも小さい値が指定されなかった場合(E_OBJ)[NGKI2983]109 if !$INTNO_FIX_NONKERNEL.nil?110 if !$INTNO_FIX_NONKERNEL.index(params[:intno]).nil? 111 112 101 # intpriがCFG_INTに対する割込み優先度として正しくない場合(E_PAR) 102 # [NGKI2973] 103 if !$INTPRI_CFGINT_VALID.include?(params[:intpri]) 104 error_illegal_sym("E_PAR", params, :intpri, :intno) 105 end 106 107 # カーネル管理外に固定されているintnoに対して,intpriにTMIN_INTPRI以 108 # 上の値が指定された場合(E_OBJ)[NGKI2983] 109 if defined?($INTNO_FIX_NONKERNEL) \ 110 && $INTNO_FIX_NONKERNEL.include?(params[:intno]) 111 if params[:intpri] >= $TMIN_INTPRI 112 error_ercd("E_OBJ", params, "%%intno must have higher priority " \ 113 113 "than TMIN_INTPRI in %apiname") 114 end 115 end 116 end 117 118 # カーネル管理に固定されているintnoに対して,intpriにTMIN_INTPRIより 119 # も小さい値が指定された場合(E_OBJ)[NGKI2984] 120 if !$INTNO_FIX_KERNEL.nil? 121 if !$INTNO_FIX_KERNEL.index(params[:intno]).nil? 122 if params[:intpri] < $TMIN_INTPRI 123 error_ercd("E_OBJ", params, "%%intno must have lower or equal " \ 114 end 115 end 116 117 # カーネル管理に固定されているintnoに対して,intpriにTMIN_INTPRIより 118 # も小さい値が指定された場合(E_OBJ)[NGKI2984] 119 if defined?($INTNO_FIX_KERNEL) \ 120 && $INTNO_FIX_KERNEL.include?(params[:intno]) 121 if params[:intpri] < $TMIN_INTPRI 122 error_ercd("E_OBJ", params, "%%intno must have lower or equal " \ 124 123 "priority to TMIN_INTPRI in %apiname") 125 end 126 end 124 end 125 end 126 127 # ターゲット依存のエラーチェック[NGKI2985] 128 if defined? TargetCheckCfgInt() 129 TargetCheckCfgInt(params) 127 130 end 128 131 end … … 131 134 # 割込みハンドラに関するエラーチェック 132 135 # 133 $cfgData[:DEF_INH].each do | key, params|134 # inhnoが 割込みハンドラ番号として正しくない場合(E_PAR)[NGKI3055]135 if $INHNO_VALID.index(params[:inhno]).nil?136 $cfgData[:DEF_INH].each do |_, params| 137 # inhnoが有効範囲外の場合(E_PAR)[NGKI3055] 138 if !$INHNO_VALID.include?(params[:inhno]) 136 139 error_illegal("E_PAR", params, :inhno) 137 140 end 138 141 139 # inhatrが無効の場合(E_RSATR)[NGKI3052] 142 # inhatrが無効の場合(E_RSATR)[NGKI3052][NGKI2957][NGKI2959] 140 143 #(TARGET_INHATR以外のビットがセットされている場合) 141 144 if (params[:inhatr] & ~($TARGET_INHATR)) != 0 … … 143 146 end 144 147 145 # 146 # 147 if !$INHNO_FIX_NONKERNEL.nil?148 if !$INHNO_FIX_NONKERNEL.index(params[:inhno]).nil? 149 150 148 # カーネル管理外に固定されているinhnoに対して,inhatrにTA_NONKERNELが 149 # 指定されていない場合(E_RSATR)[NGKI3067] 150 if defined?($INHNO_FIX_NONKERNEL) \ 151 && $INHNO_FIX_NONKERNEL.include?(params[:inhno]) 152 if (params[:inhatr] & $TA_NONKERNEL) == 0 153 error_ercd("E_RSATR", params, "%%inhno must be " \ 151 154 "non-kernel interrupt in %apiname") 152 end 153 end 154 end 155 156 # カーネル管理に固定されているinhnoに対して,inhatrにTA_NONKERNELが指 157 # 定されている場合(E_RSATR)[NGKI3068] 158 if !$INHNO_FIX_KERNEL.nil? 159 if !$INHNO_FIX_KERNEL.index(params[:inhno]).nil? 160 if (params[:inhatr] & $TA_NONKERNEL) != 0 161 error_ercd("E_RSATR", params, "%%inhno must not be " \ 155 end 156 end 157 158 # カーネル管理に固定されているinhnoに対して,inhatrにTA_NONKERNELが指 159 # 定されている場合(E_RSATR)[NGKI3068] 160 if defined?($INHNO_FIX_KERNEL) \ 161 && $INHNO_FIX_KERNEL.include?(params[:inhno]) 162 if (params[:inhatr] & $TA_NONKERNEL) != 0 163 error_ercd("E_RSATR", params, "%%inhno must not be " \ 162 164 "non-kernel interrupt in %apiname") 163 164 165 end 166 167 if $toIntnoVal.has_key?(params[:inhno].val)165 end 166 end 167 168 if $INHNO_CREISR_VALID.include?(params[:inhno]) 169 # 割込みハンドラ番号に対応する割込み番号がある場合 168 170 intnoVal = $toIntnoVal[params[:inhno].val] 169 171 … … 174 176 else 175 177 intnoParams = $cfgData[:CFG_INT][intnoVal] 178 176 179 if (params[:inhatr] & $TA_NONKERNEL) == 0 177 180 # inhatrにTA_NONKERNELが指定されておらず,inhnoに対応するintno … … 193 196 end 194 197 end 198 199 # ターゲット依存のエラーチェック[NGKI3078] 200 if defined? TargetCheckDefInh() 201 TargetCheckDefInh(params) 202 end 195 203 end 196 204 … … 198 206 # 割込みサービスルーチン(ISR)に関するエラーチェック 199 207 # 200 $cfgData[:CRE_ISR].sort.each do | key, params|201 # isratrが無効の場合(E_RSATR)[NGKI2998]208 $cfgData[:CRE_ISR].sort.each do |_, params| 209 # isratrが無効の場合(E_RSATR)[NGKI2998][NGKI2952][NGKI5176] 202 210 #(TARGET_ISRATR以外のビットがセットされている場合) 203 211 if (params[:isratr] & ~($TARGET_ISRATR)) != 0 … … 205 213 end 206 214 207 # intnoがCRE_ISRに対する割込み番号として正しくない場合(E_PAR) 208 # [NGKI3003] 209 if $INTNO_CREISR_VALID.index(params[:intno]).nil? 215 # intnoが有効範囲外の場合(E_PAR)[NGKI3003] 216 if !$INTNO_CREISR_VALID.include?(params[:intno]) 210 217 error_illegal("E_PAR", params, "intno") 211 218 end 212 219 213 # (TMIN_ISRPRI <= isrpri && isrpri <= TMAX_ISRPRI)でない場合(E_PAR)214 # [NGKI3005]220 # isrpriが有効範囲外の場合(E_PAR)[NGKI3005] 221 #(TMIN_ISRPRI <= isrpri && isrpri <= TMAX_ISRPRIでない場合) 215 222 if !($TMIN_ISRPRI <= params[:isrpri] && params[:isrpri] <= $TMAX_ISRPRI) 216 223 error_illegal("E_PAR", params, "isrpri") 217 224 end 218 end 219 220 $INTNO_CREISR_VALID.each do |intnoVal| 221 # 割込み番号intnoに対して登録されたISRのリストの作成 222 isrParamsList = [] 223 $cfgData[:CRE_ISR].sort.each do |key, params| 224 if params[:intno] == intnoVal 225 isrParamsList.push(params) 226 end 227 end 228 229 # 割込み番号intnoに対して登録されたISRが存在する場合 230 if isrParamsList.size > 0 231 inhnoVal = $toInhnoVal[intnoVal] 232 233 # intnoに対応するinhnoに対してDEF_INHがある場合(E_OBJ)[NGKI3013] 234 if $cfgData[:DEF_INH].has_key?(inhnoVal) 235 inhnoParams = $cfgData[:DEF_INH][inhnoVal] 236 error_ercd("E_OBJ", isrParamsList[0], "%%intno in %apiname " \ 237 "is duplicated with inhno #{inhnoParams[:inhno]}") 238 end 239 240 # intnoに対するCFG_INTがない場合(E_OBJ)[NGKI3012] 241 if !$cfgData[:CFG_INT].has_key?(intnoVal) 242 error_ercd("E_OBJ", isrParamsList[0], "%%intno in %apiname " \ 225 226 # intnoに対応するinhnoに対してDEF_INHがある場合(E_OBJ)[NGKI3013] 227 inhnoVal = $toInhnoVal[params[:intno].val] 228 if $cfgData[:DEF_INH].has_key?(inhnoVal) 229 error_ercd("E_OBJ", params, "%%intno in %apiname is duplicated " \ 230 "with inhno #{$cfgData[:DEF_INH][inhnoVal][:inhno]}") 231 end 232 233 # intnoに対するCFG_INTがない場合(E_OBJ)[NGKI3012] 234 if !$cfgData[:CFG_INT].has_key?(params[:intno]) 235 error_ercd("E_OBJ", params, "%%intno in %apiname " \ 243 236 "is not configured with CFG_INT") 244 else 245 intnoParams = $cfgData[:CFG_INT][intnoVal] 246 247 # intnoに対してCFG_INTで設定された割込み優先度がTMIN_INTPRIよりも 248 # 小さい場合(E_OBJ)[NGKI3014] 249 if intnoParams[:intpri] < $TMIN_INTPRI 250 error_ercd("E_OBJ", isrParamsList[0], 251 "intpri `#{intnoParams[:intpri]}' configured for " \ 252 "%%intno with CFG_INT in higher than TMIN_INTPRI") 253 end 254 end 237 else 238 intnoParams = $cfgData[:CFG_INT][params[:intno]] 239 240 # intnoでカーネル管理外の割込みを指定した場合(E_OBJ)[NGKI3014] 241 #(intnoに対してCFG_INTで設定された割込み優先度がTMIN_INTPRIよりも小 242 # さい場合) 243 if intnoParams[:intpri] < $TMIN_INTPRI 244 error_ercd("E_OBJ", params, 245 "intpri `#{intnoParams[:intpri]}' configured for " \ 246 "%%intno with CFG_INT in higher than TMIN_INTPRI") 247 end 248 end 249 250 # ターゲット依存のエラーチェック 251 if defined? TargetCheckCreIsr() 252 TargetCheckCreIsr(params) 255 253 end 256 254 end … … 298 296 inhnoVal = $toInhnoVal[intnoVal] 299 297 300 # 次の DEF_INHに相当するデータを生成298 # 次の静的APIに相当するデータを生成 301 299 # DEF_INH(inhno, { TA_NULL, _kernel_inthdr_<intno> } ); 302 300 $cfgData[:DEF_INH][inhnoVal] = { … … 306 304 } 307 305 308 # 割込みサービスルーチン 用の割込みハンドラ306 # 割込みサービスルーチンを呼び出す割込みハンドラの生成[NGKI2941] 309 307 $kernelCfgC.add("void") 310 308 $kernelCfgC.add("_kernel_inthdr_#{intnoVal}(void)") … … 335 333 336 334 # 割込みサービスルーチン生成順序テーブルの生成 337 $kernelCfgC.add("const ID _kernel_isrorder_table[TNUM_SISRID] = { ") 338 $kernelCfgC.append("\t") 339 $cfgData[:CRE_ISR].each_with_index do |(key, params), index| 340 $kernelCfgC.append(", ") if index > 0 341 $kernelCfgC.append("#{params[:isrid]}") 342 end 343 $kernelCfgC.add 344 $kernelCfgC.add2("};") 335 if $cfgData[:CRE_ISR].size != 0 336 $kernelCfgC.add("const ID _kernel_isrorder_table[TNUM_SISRID] = { ") 337 $kernelCfgC.append("\t") 338 $cfgData[:CRE_ISR].each_with_index do |(_, params), index| 339 $kernelCfgC.append(", ") if index > 0 340 $kernelCfgC.append("#{params[:isrid]}") 341 end 342 $kernelCfgC.add 343 $kernelCfgC.add2("};") 344 else 345 $kernelCfgC.add2("TOPPERS_EMPTY_LABEL(const ID, " \ 346 "_kernel_isrorder_table);") 347 end 345 348 346 349 # … … 360 363 # 割込みハンドラのエントリ 361 364 # 362 $cfgData[:DEF_INH].each do | key, params|365 $cfgData[:DEF_INH].each do |_, params| 363 366 if (params[:inhatr] & $TA_NONKERNEL) == 0 364 367 $kernelCfgC.add("INTHDR_ENTRY(#{params[:inhno]}, " \ … … 372 375 # 373 376 $kernelCfgC.add("const INHINIB _kernel_inhinib_table[TNUM_DEF_INHNO] = {") 374 $cfgData[:DEF_INH].each_with_index do |( key, params), index|377 $cfgData[:DEF_INH].each_with_index do |(_, params), index| 375 378 $kernelCfgC.add(",") if index > 0 376 379 if (params[:inhatr] & $TA_NONKERNEL) == 0 … … 407 410 if $cfgData[:CFG_INT].size != 0 408 411 $kernelCfgC.add("const INTINIB _kernel_intinib_table[TNUM_CFG_INTNO] = {") 409 $cfgData[:CFG_INT].each_with_index do |( key, params), index|412 $cfgData[:CFG_INT].each_with_index do |(_, params), index| 410 413 $kernelCfgC.add(",") if index > 0 411 414 $kernelCfgC.append("\t{ (#{params[:intno]}), (#{params[:intatr]}), " \ -
EcnlProtoTool/trunk/asp3_dcre/kernel/kernel.trb
r321 r429 6 6 # 7 7 # Copyright (C) 2015 by FUJI SOFT INCORPORATED, JAPAN 8 # Copyright (C) 2015 ,2016by Embedded and Real-Time Systems Laboratory8 # Copyright (C) 2015-2019 by Embedded and Real-Time Systems Laboratory 9 9 # Graduate School of Information Science, Nagoya Univ., JAPAN 10 10 # … … 38 38 # の責任を負わない. 39 39 # 40 # $Id $40 # $Id: kernel.trb 1167 2019-02-03 17:06:17Z ertl-hiro $ 41 41 # 42 42 … … 75 75 76 76 # 77 # インクルードディレクティブ(#include) 77 # インクルードディレクティブ(#include)の生成 78 78 # 79 79 $kernelCfgC.comment_header("Include Directives") 80 $includeFiles.each do |file| 81 $kernelCfgC.add("#include #{file}") 82 end 80 GenerateIncludes($kernelCfgC) 83 81 $kernelCfgC.add() 84 82 … … 91 89 def AllocStack(stack, size) 92 90 # 大きい方に丸めたサイズで確保する[NGKI1050][NGKI3220] 93 $kernelCfgC.add(" /*static*/STK_T #{stack}[COUNT_STK_T(#{size})];")91 $kernelCfgC.add("static STK_T #{stack}[COUNT_STK_T(#{size})];") 94 92 return("ROUND_STK_T(#{size})") 95 93 end … … 107 105 @OBJ_S = obj_s.tr("a-z", "A-Z") 108 106 @objid = (obj + "id").to_sym 107 @noobj = ("no" + obj).to_sym 109 108 @api = "CRE_#{@OBJ}".to_sym 109 @aidapi = "AID_#{@OBJ}".to_sym 110 110 @inibList = { "#{@OBJ_S}INIB" => "a#{@obj_s}inib_table"} 111 111 end … … 114 114 # AID_@OBJの処理 115 115 numAutoObjid = 0 116 $cfgData[ "AID_#{@OBJ}".to_sym].each do |key, params|117 numAutoObjid += params[ "no#{@obj}".to_sym]116 $cfgData[@aidapi].each do |_, params| 117 numAutoObjid += params[@noobj] 118 118 end 119 119 numObjid = $cfgData[@api].size + numAutoObjid … … 123 123 124 124 # オブジェクトのID番号のマクロ定義の生成 125 $cfgData[@api].sort.each do | key, params|125 $cfgData[@api].sort.each do |_, params| 126 126 $kernelCfgH.add("#define #{params[@objid]}\t#{params[@objid].val}") 127 127 end … … 130 130 # オブジェクトのID番号を保持する変数 131 131 if $USE_EXTERNAL_ID 132 $cfgData[@api].sort.each do | key, params|132 $cfgData[@api].sort.each do |_, params| 133 133 $kernelCfgC.add("const ID #{params[@objid]}_id" \ 134 134 " = #{params[@objid].val};") … … 203 203 nfymode1 = nfymode & 0x0f 204 204 nfymode2 = nfymode & ~0x0f 205 par1 = params[:par1]205 # par1 = params[:par1] 206 206 par2 = params[:par2] 207 207 … … 232 232 error_api(params, "too many parameters for nfymode `#{nfymode}' " \ 233 233 "in %apiname of %#{objid}") 234 elsif nfymode == $TNFY_HANDLER234 elsif nfymode1 == $TNFY_HANDLER && nfymode2 == 0 #[NGKI3721] 235 235 # タイムイベントハンドラの呼出し 236 236 funcname = "(NFYHDR)(#{par2})" … … 269 269 270 270 # イベント通知処理の処理 271 if nfymode1 == $TNFY_SETVAR && nfymode2 == 0 271 if nfymode1 == $TNFY_SETVAR && nfymode2 == 0 #[NGKI3721] 272 272 # 変数の設定 273 273 $kernelCfgC.add("\t*((intptr_t *) exinf) = (#{par2});") 274 elsif nfymode1 == $TNFY_INCVAR && nfymode2 == 0 274 elsif nfymode1 == $TNFY_INCVAR && nfymode2 == 0 #[NGKI3721] 275 275 # 変数のインクリメント 276 276 $kernelCfgC.add("\t(void) loc_cpu();") … … 293 293 $kernelCfgC.add("\t#{errorCode}psnd_dtq(((ID) exinf), #{par2});") 294 294 else 295 # nfymodeの値が正しくない場合(E_PAR)[NGKI3730] 295 296 error_illegal_id("E_PAR", params, :nfymode, objid) 296 297 end 297 298 298 299 if nfymode2 != 0 299 300 # エラー通知処理の処理 300 301 $kernelCfgC.add("\tif (ercd != E_OK) {") 301 302 302 303 303 if nfymode2 == $TENFY_SETVAR … … 326 326 " (intptr_t) ercd);") 327 327 else 328 # nfymodeの値が正しくない場合(E_PAR)[NGKI3730] 328 329 error_illegal_id("E_PAR", params, :nfymode, objid) 329 330 end … … 360 361 if $cfgData[:DEF_ICS].size == 0 361 362 # DEF_ICSがない場合のデフォルト値の設定 362 if $DEFAULT_ISTK.nil?363 if !defined?($DEFAULT_ISTK) 363 364 # スタック領域の自動割付け 364 365 istksz = AllocStack("_kernel_istack", "DEFAULT_ISTKSZ") … … 369 370 end 370 371 else 371 # 静的API「DEF_ICS」が複数ある (E_OBJ)[NGKI3216]372 # 静的API「DEF_ICS」が複数ある場合(E_OBJ)[NGKI3216] 372 373 if $cfgData[:DEF_ICS].size > 1 373 374 error("E_OBJ: too many DEF_ICS") … … 375 376 376 377 # DEF_ICSがある場合の処理 377 params = $cfgData[:DEF_ICS][1]378 params0 = $cfgData[:DEF_ICS][1] 378 379 379 380 # パラメータが省略された時のデフォルト値の設定 380 params [:istk] ||= "NULL"381 params0[:istk] ||= "NULL" 381 382 382 383 # istkszがターゲット定義の最小値(TARGET_MIN_ISTKSZ,未定義の場合は1) 383 384 # よりも小さい場合(E_PAR)[NGKI3254] 384 if params [:istksz] < $TARGET_MIN_ISTKSZ385 error_wrong("E_PAR", params , :istksz, "too small")386 end 387 388 if params [:istk] == "NULL"385 if params0[:istksz] < $TARGET_MIN_ISTKSZ 386 error_wrong("E_PAR", params0, :istksz, "too small") 387 end 388 389 if params0[:istk] == "NULL" 389 390 # スタック領域の自動割付け 390 istksz = AllocStack("_kernel_istack", params [:istksz])391 istksz = AllocStack("_kernel_istack", params0[:istksz]) 391 392 istk = "_kernel_istack" 392 393 else 393 # istkszが スタック領域のサイズとして正しくない場合(E_PAR)[NGKI3222]394 if (params [:istksz] & ($CHECK_STKSZ_ALIGN - 1)) != 0395 error_wrong("E_PAR", params , :istksz, "not aligned")396 end 397 398 istksz = "(#{params [:istksz]})"399 istk = "(void *)(#{params [:istk]})"394 # istkszがターゲット定義の制約に合致しない場合(E_PAR)[NGKI3222] 395 if (params0[:istksz] & ($CHECK_STKSZ_ALIGN - 1)) != 0 396 error_wrong("E_PAR", params0, :istksz, "not aligned") 397 end 398 399 istksz = "(#{params0[:istksz]})" 400 istk = "(void *)(#{params0[:istk]})" 400 401 end 401 402 end … … 411 412 412 413 # 413 # カーネル が割り付けるメモリ領域414 # 415 $kernelCfgC.comment_header(" Memory Area Allocated by Kernel")416 417 if $cfgData[:DEF_ KMM].size == 0418 # DEF_ KMMがない場合のデフォルト値の設定419 kmmsz = "0"420 kmm= "NULL"414 # カーネルメモリプール領域 415 # 416 $kernelCfgC.comment_header("Kernel Memory Pool Area") 417 418 if $cfgData[:DEF_MPK].size == 0 419 # DEF_MPKがない場合のデフォルト値の設定 420 mpksz = "0" 421 mpk = "NULL" 421 422 else 422 # 静的API「DEF_ KMM」が複数ある(E_OBJ)423 if ($cfgData[:DEF_ KMM].size > 1)424 error("E_OBJ: too many DEF_ KMM")425 end 426 427 # DEF_ KMMがある場合の処理428 params = $cfgData[:DEF_KMM][1]423 # 静的API「DEF_MPK」が複数ある(E_OBJ)[NGKI5073] 424 if ($cfgData[:DEF_MPK].size > 1) 425 error("E_OBJ: too many DEF_MPK") 426 end 427 428 # DEF_MPKがある場合の処理 429 params0 = $cfgData[:DEF_MPK][1] 429 430 430 431 # パラメータが省略された時のデフォルト値の設定 431 params [:kmm] ||= "NULL"432 433 # kmmszが0の場合(E_PAR)434 if params [:kmmsz] == 0435 error_wrong("E_PAR", params , :kmmsz, "zero")436 end 437 438 if params [:kmm] == "NULL"439 # カーネル が割り付けるメモリ領域の自動割付け440 $kernelCfgC.add("static MB_T _kernel_memory " \441 "[ TOPPERS_COUNT_SZ(#{params[:kmmsz]}, sizeof(MB_T))];")442 kmmsz = "TOPPERS_ROUND_SZ(#{params[:kmmsz]}, sizeof(MB_T))"443 kmm = "_kernel_memory"432 params0[:mpk] ||= "NULL" 433 434 # mpkszが0の場合(E_PAR)[NGKI5071] 435 if params0[:mpksz] == 0 436 error_wrong("E_PAR", params0, :mpksz, "zero") 437 end 438 439 if params0[:mpk] == "NULL" 440 # カーネルメモリプール領域の自動割付け 441 $kernelCfgC.add("static MB_T _kernel_memory_pool" \ 442 "[COUNT_MB_T(#{params0[:mpksz]})];") 443 mpksz = "ROUND_MB_T(#{params0[:mpksz]})" 444 mpk = "_kernel_memory_pool" 444 445 else 445 # kmmszがカーネルが割り付けるメモリ領域のサイズとして正しくない場合 446 # (E_PAR) 447 if (params[:kmmsz] & ($CHECK_MB_ALIGN - 1)) != 0 448 error_wrong("E_PAR", params, :kmmsz, "not aligned") 449 end 450 451 kmmsz = "(#{params[:kmmsz]})" 452 kmm = "(void *)(#{params[:kmm]})" 446 # mpkszがターゲット定義の制約に合致しない場合(E_PAR)[NGKI5083] 447 if (params0[:mpksz] & ($CHECK_MB_ALIGN - 1)) != 0 448 error_wrong("E_PAR", params0, :mpksz, "not aligned") 449 end 450 451 mpksz = "(#{params0[:mpksz]})" 452 mpk = "(void *)(#{params0[:mpk]})" 453 453 end 454 454 end 455 455 456 456 $kernelCfgC.add(<<EOS) 457 const size_t _kernel_ kmmsz = #{kmmsz};458 MB_T *const _kernel_ kmm = #{kmm};457 const size_t _kernel_mpksz = #{mpksz}; 458 MB_T *const _kernel_mpk = #{mpk}; 459 459 EOS 460 460 … … 484 484 # 初期化ルーチン機能 485 485 # 486 487 # kernel_cfg.hの生成 488 $kernelCfgH.add2("#define TNUM_INIRTN\t#{$cfgData[:ATT_INI].size}") 489 490 # kernel_cfg.cの生成 486 491 $kernelCfgC.comment_header("Initialization Routine") 487 492 488 493 # エラーチェック 489 $cfgData[:ATT_INI].each do | key, params|490 # iniatrが無効の場合(E_RSATR)[NGKI3241] 494 $cfgData[:ATT_INI].each do |_, params| 495 # iniatrが無効の場合(E_RSATR)[NGKI3241][NGKI3202][NGKI3203] 491 496 #(TA_NULLでない場合) 492 497 if (params[:iniatr] != $TA_NULL) … … 495 500 end 496 501 497 # 初期化ルーチンの実行関数の生成 498 $kernelCfgC.append(<<EOS) 499 void 500 _kernel_call_inirtn(void) 501 { 502 EOS 503 $cfgData[:ATT_INI].each do |key, params| 504 $kernelCfgC.add("\t((INIRTN)(#{params[:inirtn]}))" \ 505 "((intptr_t)(#{params[:exinf]}));") 506 end 507 $kernelCfgC.add2("}") 502 # 初期化ルーチンの数の定義 503 $kernelCfgC.add2("const uint_t _kernel_tnum_inirtn = TNUM_INIRTN;"); 504 505 # 初期化ルーチンテーブルの生成 506 if $cfgData[:ATT_INI].size > 0 507 $kernelCfgC.add("const INIRTNB _kernel_inirtnb_table[TNUM_INIRTN] = {") 508 $cfgData[:ATT_INI].each_with_index do |(_, params), index| 509 $kernelCfgC.add(",") if index > 0 510 $kernelCfgC.append("\t{ (INIRTN)(#{params[:inirtn]}), " \ 511 "(intptr_t)(#{params[:exinf]}) }") 512 end 513 $kernelCfgC.add 514 $kernelCfgC.add2("};") 515 else 516 $kernelCfgC.add2("TOPPERS_EMPTY_LABEL(const INIRTNB, " \ 517 "_kernel_inirtnb_table);") 518 end 508 519 509 520 # 510 521 # 終了処理ルーチン機能 511 522 # 523 524 # kernel_cfg.hの生成 525 $kernelCfgH.add2("#define TNUM_TERRTN\t#{$cfgData[:ATT_TER].size}") 526 527 # kernel_cfg.cの生成 512 528 $kernelCfgC.comment_header("Termination Routine") 513 529 514 530 # エラーチェック 515 $cfgData[:ATT_TER].each do | key, params|516 # teratrが無効の場合(E_RSATR)[NGKI3248] 531 $cfgData[:ATT_TER].each do |_, params| 532 # teratrが無効の場合(E_RSATR)[NGKI3248][NGKI3208][NGKI3209] 517 533 #(TA_NULLでない場合) 518 534 if (params[:teratr] != $TA_NULL) … … 521 537 end 522 538 523 # 終了処理ルーチンの実行関数の生成 524 $kernelCfgC.append(<<EOS) 525 void 526 _kernel_call_terrtn(void) 527 { 528 EOS 529 $cfgData[:ATT_TER].reverse_each do |key, params| 530 $kernelCfgC.add("\t((TERRTN)(#{params[:terrtn]}))" \ 531 "((intptr_t)(#{params[:exinf]}));") 532 end 533 $kernelCfgC.add2("}") 539 # 終了処理ルーチンの数の定義 540 $kernelCfgC.add2("const uint_t _kernel_tnum_terrtn = TNUM_TERRTN;"); 541 542 # 終了処理ルーチンテーブルの生成 543 if $cfgData[:ATT_TER].size > 0 544 $kernelCfgC.add("const TERRTNB _kernel_terrtnb_table[TNUM_TERRTN] = {") 545 $cfgData[:ATT_TER].reverse_each.each_with_index do |(_, params), index| 546 $kernelCfgC.add(",") if index > 0 547 $kernelCfgC.append("\t{ (TERRTN)(#{params[:terrtn]}), " \ 548 "(intptr_t)(#{params[:exinf]}) }") 549 end 550 $kernelCfgC.add 551 $kernelCfgC.add2("};") 552 else 553 $kernelCfgC.add2("TOPPERS_EMPTY_LABEL(const TERRTNB, " \ 554 "_kernel_terrtnb_table);") 555 end 534 556 535 557 # -
EcnlProtoTool/trunk/asp3_dcre/kernel/kernel_api.def
r331 r429 23 23 DEF_EXC .excno* { .excatr &exchdr } 24 24 DEF_ICS { .istksz &istk? } 25 DEF_ KMM { .kmmsz &kmm? }25 DEF_MPK { .mpksz &mpk? } 26 26 ATT_INI { .iniatr &exinf &inirtn } 27 27 ATT_TER { .teratr &exinf &terrtn } -
EcnlProtoTool/trunk/asp3_dcre/kernel/kernel_check.trb
r321 r429 1 1 # -*- coding: utf-8 -*- 2 # 2 # 3 3 # TOPPERS/ASP Kernel 4 4 # Toyohashi Open Platform for Embedded Real-Time Systems/ … … 6 6 # 7 7 # Copyright (C) 2015 by FUJI SOFT INCORPORATED, JAPAN 8 # Copyright (C) 2015 ,2016by Embedded and Real-Time Systems Laboratory8 # Copyright (C) 2015-2019 by Embedded and Real-Time Systems Laboratory 9 9 # Graduate School of Information Science, Nagoya Univ., JAPAN 10 10 # … … 38 38 # の責任を負わない. 39 39 # 40 # $Id $40 # $Id: kernel_check.trb 1167 2019-02-03 17:06:17Z ertl-hiro $ 41 41 # 42 42 … … 45 45 # 46 46 47 # 47 # 48 48 # タイムスタンプファイルの指定 49 # 49 # 50 50 $timeStampFileName = "check.timestamp" 51 51 … … 53 53 # データセクションのLMAからVMAへのコピー 54 54 # 55 if !$lmaList.nil?55 if defined?($lmaList) 56 56 $lmaList.each do |lma| 57 57 startData = SYMBOL(lma[:START_DATA]) … … 92 92 # 通知処理のパラメータが2つの場合 93 93 epar1 = params[:par3] 94 epar2 = params[:par4]94 # epar2 = params[:par4] 95 95 else 96 96 # 通知処理のパラメータが1つの場合 97 97 epar1 = params[:par2] 98 epar2 = params[:par3] 99 end 100 101 # タイムイベントハンドラの先頭番地のチェック[NGKI3693] 98 # epar2 = params[:par3] 99 end 100 101 # タイムイベントハンドラの先頭番地が,プログラムの先頭番地として正し 102 # くない場合(E_PAR)[NGKI3693] 102 103 if nfymode == $TNFY_HANDLER 103 104 tmehdr = nfyhdr … … 112 113 end 113 114 114 # 115 # イベント通知処理の変数の番地とオブジェクトIDのチェック 115 116 if nfymode1 == $TNFY_SETVAR || nfymode1 == $TNFY_INCVAR 116 117 # 変数の設定/インクリメントによるタイムイベントの通知 … … 119 120 params1[:p_var] = par1 120 121 121 # 変数の番地のチェック[NGKI3699][NGKI3897] 122 # 通知方法中の変数の番地が,intptr_t型の変数の番地として正しくない 123 # 場合(E_PAR)[NGKI3699][NGKI3897] 122 124 if (p_var & ($CHECK_INTPTR_ALIGN - 1)) != 0 123 125 error_wrong_id("E_PAR", params1, :p_var, objid, "not aligned") … … 132 134 params1[:tskid] = par1 133 135 134 # タスクIDのチェック[NGKI3704]136 # 通知方法中のタスクIDが有効範囲外の場合(E_ID)[NGKI3704] 135 137 if !($TMIN_TSKID <= tskid && tskid <= $tmax_tskid) 136 138 error_illegal_id("E_ID", params1, :tskid, objid) … … 142 144 params1[:semid] = par1 143 145 144 # セマフォIDのチェック[NGKI3707]146 # 通知方法中のセマフォIDが有効範囲外の場合(E_ID)[NGKI3707] 145 147 if !($TMIN_SEMID <= semid && semid <= $tmax_semid) 146 148 error_illegal_id("E_ID", params1, :semid, objid) … … 152 154 params1[:flgid] = par1 153 155 154 # イベントフラグIDのチェック[NGKI3710]156 # 通知方法中のイベントフラグIDが有効範囲外の場合(E_ID)[NGKI3710] 155 157 if !($TMIN_FLGID <= flgid && flgid <= $tmax_flgid) 156 158 error_illegal_id("E_ID", params1, :flgid, objid) … … 162 164 params1[:dtqid] = par1 163 165 164 # データキューIDのチェック[NGKI3713]166 # 通知方法中のデータキューIDが有効範囲外の場合(E_ID)[NGKI3713] 165 167 if !($TMIN_DTQID <= dtqid && dtqid <= $tmax_dtqid) 166 168 error_illegal_id("E_ID", params1, :dtqid, objid) … … 175 177 params1[:p_var] = epar1 176 178 177 # 変数の番地のチェック[NGKI3701][NGKI3897] 179 # 通知方法中の変数の番地が,intptr_t型の変数の番地として正しくない 180 # 場合(E_PAR)[NGKI3701][NGKI3897] 178 181 if (p_var & ($CHECK_INTPTR_ALIGN - 1)) != 0 179 182 error_wrong_id("E_PAR", params1, :p_var, objid, "not aligned") … … 188 191 params1[:tskid] = epar1 189 192 190 # タスクIDのチェック[NGKI3704]193 # 通知方法中のタスクIDが有効範囲外の場合(E_ID)[NGKI3704] 191 194 if !($TMIN_TSKID <= tskid && tskid <= $tmax_tskid) 192 195 error_illegal_id("E_ID", params1, :tskid, objid) … … 198 201 params1[:semid] = epar1 199 202 200 # セマフォIDのチェック[NGKI3707]203 # 通知方法中のセマフォIDが有効範囲外の場合(E_ID)[NGKI3707] 201 204 if !($TMIN_SEMID <= semid && semid <= $tmax_semid) 202 205 error_illegal_id("E_ID", params1, :semid, objid) … … 208 211 params1[:flgid] = epar1 209 212 210 # イベントフラグIDのチェック[NGKI3710]213 # 通知方法中のイベントフラグIDが有効範囲外の場合(E_ID)[NGKI3710] 211 214 if !($TMIN_FLGID <= flgid && flgid <= $tmax_flgid) 212 215 error_illegal_id("E_ID", params1, :flgid, objid) … … 218 221 params1[:dtqid] = epar1 219 222 220 # データキューIDのチェック[NGKI3715]223 # 通知方法中のデータキューIDが有効範囲外の場合(E_ID)[NGKI3715] 221 224 if !($TMIN_DTQID <= dtqid && dtqid <= $tmax_dtqid) 222 225 error_illegal_id("E_ID", params1, :dtqid, objid) … … 225 228 end 226 229 227 # 230 # 228 231 # タスクに関するチェック 229 # 232 # 230 233 tinib = SYMBOL("_kernel_tinib_table") 231 234 $cfgData[:CRE_TSK].sort.each do |key, params| 235 # taskがプログラムの先頭番地として正しくない場合(E_PAR)[NGKI1033] 232 236 task = PEEK(tinib + $offsetof_TINIB_task, $sizeof_TASK) 233 234 # タスクの先頭番地のチェック[NGKI1033]235 237 if (task & ($CHECK_FUNC_ALIGN - 1)) != 0 236 238 error_wrong_id("E_PAR", params, :task, :tskid, "not aligned") … … 240 242 end 241 243 242 # タスクのスタック領域の先頭番地のチェック[NGKI1056]244 # stkがターゲット定義の制約に合致しない場合(E_PAR)[NGKI1056] 243 245 if $USE_TSKINICTXB 244 246 stk = GetStackTskinictxb(key, params, tinib) … … 256 258 end 257 259 258 # 260 # 259 261 # 固定長メモリプールに関するチェック 260 # 262 # 261 263 mpfinib = SYMBOL("_kernel_mpfinib_table") 262 $cfgData[:CRE_MPF].sort.each do | key, params|264 $cfgData[:CRE_MPF].sort.each do |_, params| 263 265 mpf = PEEK(mpfinib + $offsetof_MPFINIB_mpf, $sizeof_void_ptr) 264 266 265 # 固定長メモリプール領域の先頭番地のチェック[NGKI2249]267 # mpfがターゲット定義の制約に合致しない場合(E_PAR)[NGKI2249] 266 268 if (mpf & ($CHECK_MPF_ALIGN - 1)) != 0 267 269 error_wrong_id("E_PAR", params, :mpf, :mpfid, "not aligned") … … 274 276 end 275 277 276 # 278 # 277 279 # 周期通知に関するチェック 278 # 280 # 279 281 cycinib = SYMBOL("_kernel_cycinib_table") 280 282 $cfgData[:CRE_CYC].sort.each do |key, params| … … 282 284 nfyhdr = PEEK(cycinib + $offsetof_CYCINIB_nfyhdr, $sizeof_NFYHDR) 283 285 284 # 286 # 通知情報のチェック 285 287 checkNotifyHandler(key, params, :cycid, exinf, nfyhdr) 286 288 … … 288 290 end 289 291 290 # 292 # 291 293 # アラーム通知に関するチェック 292 # 294 # 293 295 alminib = SYMBOL("_kernel_alminib_table") 294 296 $cfgData[:CRE_ALM].sort.each do |key, params| … … 296 298 nfyhdr = PEEK(alminib + $offsetof_ALMINIB_nfyhdr, $sizeof_NFYHDR) 297 299 298 # 300 # 通知情報のチェック 299 301 checkNotifyHandler(key, params, :almid, exinf, nfyhdr) 300 302 … … 306 308 # 307 309 isrinib = SYMBOL("_kernel_isrinib_table") 308 $cfgData[:CRE_ISR].sort.each do | key, params|310 $cfgData[:CRE_ISR].sort.each do |_, params| 309 311 isr = PEEK(isrinib + $offsetof_ISRINIB_isr, $sizeof_ISR) 310 312 311 # 割込みサービスルーチンの先頭番地のチェック[NGKI3004]313 # isrがプログラムの先頭番地として正しくない場合[NGKI3004] 312 314 if (isr & ($CHECK_FUNC_ALIGN - 1)) != 0 313 315 error_wrong_id("E_PAR", params, :isr, :isrid, "not aligned") … … 320 322 end 321 323 322 # 324 # 323 325 # 非タスクコンテキスト用のスタック領域に関するチェック 324 # 325 i stkAddr = SYMBOL("_kernel_istk")326 if !istkAddr.nil? 327 istk = PEEK( istkAddr, $sizeof_void_ptr)328 329 # 非タスクコンテキスト用のスタック領域の先頭番地のチェック[NGKI3222]326 # 327 if $cfgData[:DEF_ICS].size > 0 328 params0 = $cfgData[:DEF_ICS][1] 329 istk = PEEK(SYMBOL("_kernel_istk"), $sizeof_void_ptr) 330 331 # istkがターゲット定義の制約に合致しない場合(E_PAR)[NGKI3222] 330 332 if (istk & ($CHECK_STACK_ALIGN - 1)) != 0 331 error_wrong("E_PAR", $cfgData[:DEF_ICS][1], :istk, "not aligned")333 error_wrong("E_PAR", params0, :istk, "not aligned") 332 334 end 333 335 if $CHECK_STACK_NONNULL && istk == 0 334 error_wrong("E_PAR", $cfgData[:DEF_ICS][1], :istk, "null") 335 end 336 end 337 338 # 339 # カーネルが割り付けるメモリ領域に関するチェック 340 # 341 kmmAddr = SYMBOL("_kernel_kmm") 342 if !kmmAddr.nil? 343 kmm = PEEK(kmmAddr, $sizeof_void_ptr) 344 345 # カーネルが割り付けるメモリ領域の先頭番地のチェック 346 if (kmm & ($CHECK_MB_ALIGN - 1)) != 0 347 error_wrong("E_PAR", $cfgData[:DEF_KMM][1], :kmm, "not aligned") 348 end 349 end 336 error_wrong("E_PAR", params0, :istk, "null") 337 end 338 end 339 340 # 341 # カーネルメモリプール領域に関するチェック 342 # 343 if $cfgData[:DEF_MPK].size > 0 344 params0 = $cfgData[:DEF_MPK][1] 345 mpk = PEEK(SYMBOL("_kernel_mpk"), $sizeof_void_ptr) 346 347 # mpkがターゲット定義の制約に合致しない場合(E_PAR)[NGKI5083] 348 if (mpk & ($CHECK_MPK_ALIGN - 1)) != 0 349 error_wrong("E_PAR", params0, :mpk, "not aligned") 350 end 351 if $CHECK_MPK_NONNULL && mpk == 0 352 error_wrong("E_PAR", params0, :mpk, "null") 353 end 354 end 355 356 # 357 # 初期化ルーチンに関するチェック 358 # 359 inirtnb = SYMBOL("_kernel_inirtnb_table") 360 $cfgData[:ATT_INI].each do |_, params| 361 inirtn = PEEK(inirtnb + $offsetof_INIRTNB_inirtn, $sizeof_INIRTN) 362 363 # inirtnがプログラムの先頭番地として正しくない場合(E_PAR)[NGKI3243] 364 if (inirtn & ($CHECK_FUNC_ALIGN - 1)) != 0 365 error_wrong("E_PAR", params, :inirtn, "not aligned") 366 end 367 if $CHECK_FUNC_NONNULL && inirtn == 0 368 error_wrong("E_PAR", params, :inirtn, "null") 369 end 370 371 inirtnb += $sizeof_INIRTNB 372 end 373 374 # 375 # 終了処理ルーチンに関するチェック 376 # 377 terrtnb = SYMBOL("_kernel_terrtnb_table") 378 $cfgData[:ATT_TER].each do |_, params| 379 terrtn = PEEK(terrtnb + $offsetof_TERRTNB_terrtn, $sizeof_TERRTN) 380 381 # terrtnがプログラムの先頭番地として正しくない場合(E_PAR)[NGKI3250] 382 if (terrtn & ($CHECK_FUNC_ALIGN - 1)) != 0 383 error_wrong("E_PAR", params, :terrtn, "not aligned") 384 end 385 if $CHECK_FUNC_NONNULL && terrtn == 0 386 error_wrong("E_PAR", params, :terrtn, "null") 387 end 388 389 terrtnb += $sizeof_TERRTNB 390 end -
EcnlProtoTool/trunk/asp3_dcre/kernel/kernel_impl.h
r321 r429 6 6 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory 7 7 * Toyohashi Univ. of Technology, JAPAN 8 * Copyright (C) 2004-201 6by Embedded and Real-Time Systems Laboratory8 * Copyright (C) 2004-2018 by Embedded and Real-Time Systems Laboratory 9 9 * Graduate School of Information Science, Nagoya Univ., JAPAN 10 10 * … … 71 71 72 72 /* 73 * 型キャストを行うマクロの定義74 */ 75 #if ndef CAST76 # define CAST(type, val) ((type)(val))77 #endif /* CAST*/73 * トレースログに関する設定 74 */ 75 #ifdef TOPPERS_ENABLE_TRACE 76 #include "arch/tracelog/trace_log.h" 77 #endif /* TOPPERS_ENABLE_TRACE */ 78 78 79 79 /* … … 157 157 #endif /* TARGET_ISRATR */ 158 158 159 #ifndef TARGET_MIN_STKSZ /* タスクのスタックサイズの最小値 */ 160 #define TARGET_MIN_STKSZ 1U /* 未定義の場合は0でないことをチェック */ 161 #endif /* TARGET_MIN_STKSZ */ 162 159 163 /* 160 164 * ヘッダファイルを持たないモジュールの関数・変数の宣言 … … 173 177 174 178 /* 175 * 初期化ルーチンの実行(kernel_cfg.c) 176 */ 177 extern void call_inirtn(void); 178 179 /* 180 * 終了処理ルーチンの実行(kernel_cfg.c) 181 */ 182 extern void call_terrtn(void); 179 * 初期化ルーチン関係の定義(kernel_cfg.c) 180 */ 181 typedef struct initialization_routine_block { 182 INIRTN inirtn; /* 初期化ルーチンの先頭番地 */ 183 intptr_t exinf; /* 初期化ルーチンの拡張情報 */ 184 } INIRTNB; 185 186 extern const uint_t tnum_inirtn; /* 初期化ルーチンの数 */ 187 188 extern const INIRTNB inirtnb_table[]; /* 初期化ルーチンブロックテーブル */ 189 190 /* 191 * 終了処理ルーチン関係の定義(kernel_cfg.c) 192 */ 193 typedef struct termination_routine_block { 194 TERRTN terrtn; /* 終了処理ルーチンの先頭番地 */ 195 intptr_t exinf; /* 終了処理ルーチンの拡張情報 */ 196 } TERRTNB; 197 198 extern const uint_t tnum_terrtn; /* 終了処理ルーチンの数 */ 199 200 extern const TERRTNB terrtnb_table[]; /* 終了処理ルーチンブロックテーブル */ 183 201 184 202 /* … … 192 210 193 211 /* 194 * カーネル が割り付けるメモリ領域(kernel_cfg.c)195 */ 196 extern const size_t kmmsz; /* カーネルが割り付けるメモリ領域のサイズ */197 extern MB_T *const kmm; /* カーネルが割り付けるメモリ領域の先頭番地 */212 * カーネルメモリプール領域(kernel_cfg.c) 213 */ 214 extern const size_t mpksz; /* カーネルメモリプール領域のサイズ */ 215 extern MB_T *const mpk; /* カーネルメモリプール領域の先頭番地 */ 198 216 199 217 /* … … 203 221 204 222 /* 223 * カーネルメモリプール領域有効フラグ(startup.c) 224 */ 225 extern bool_t mpk_valid; 226 227 /* 205 228 * カーネルの起動(startup.c) 206 229 */ … … 213 236 214 237 /* 215 * カーネルの割り付けるメモリ領域の管理(startup.c) 216 */ 217 extern void initialize_kmm(void); 218 extern void *kernel_malloc(size_t size); 219 extern void kernel_free(void *ptr); 238 * メモリプール領域の管理(startup.c) 239 */ 240 extern bool_t initialize_mempool(MB_T *mempool, size_t size); 241 extern void *malloc_mempool(MB_T *mempool, size_t size); 242 extern void free_mempool(MB_T *mempool, void *ptr); 243 244 /* 245 * カーネルメモリプール領域からのメモリ獲得/解放 246 */ 247 Inline void * 248 malloc_mpk(size_t size) 249 { 250 if (mpk_valid) { 251 return(malloc_mempool(mpk, size)); 252 } 253 else { 254 return(NULL); 255 } 256 } 257 258 Inline void 259 free_mpk(void *ptr) 260 { 261 if (mpk_valid) { 262 free_mempool(mpk, ptr); 263 } 264 } 220 265 221 266 /* … … 225 270 226 271 /* 227 * 通知方法のエラーチェック 272 * 通知方法のエラーチェック(time_manage.c) 228 273 */ 229 274 extern ER check_nfyinfo(const T_NFYINFO *p_nfyinfo); 230 275 231 276 /* 232 * 通知ハンドラ 277 * 通知ハンドラ(time_manage.c) 233 278 */ 234 279 extern void notify_handler(intptr_t exinf); -
EcnlProtoTool/trunk/asp3_dcre/kernel/kernel_rename.def
r331 r429 1 1 # startup.c 2 2 kerflg 3 mpk_valid 3 4 exit_kernel 4 initialize_ kmm5 kernel_malloc 6 kernel_free 5 initialize_mempool 6 malloc_mempool 7 free_mempool 7 8 8 9 # task.c … … 51 52 set_hrt_event 52 53 tmevtb_register 53 tmevtb_enqueue 54 tmevtb_enqueue_reltim 54 55 tmevtb_dequeue 55 56 check_adjtim … … 124 125 # kernel_cfg.c 125 126 initialize_object 126 call_inirtn 127 call_terrtn 127 tnum_inirtn 128 inirtnb_table 129 tnum_terrtn 130 terrtnb_table 128 131 tmax_tskid 129 132 tmax_stskid … … 193 196 istk 194 197 istkpt 195 kmmsz 196 kmm 198 mpksz 199 mpk 200 201 # tTraceLog.c 202 log_dsp_enter 203 log_dsp_leave 204 log_inh_enter 205 log_inh_leave 206 log_exc_enter 207 log_exc_leave 197 208 198 209 INCLUDE "target" -
EcnlProtoTool/trunk/asp3_dcre/kernel/kernel_rename.h
r321 r429 8 8 */ 9 9 #define kerflg _kernel_kerflg 10 #define mpk_valid _kernel_mpk_valid 10 11 #define exit_kernel _kernel_exit_kernel 11 #define initialize_ kmm _kernel_initialize_kmm12 #define kernel_malloc _kernel_kernel_malloc13 #define kernel_free _kernel_kernel_free12 #define initialize_mempool _kernel_initialize_mempool 13 #define malloc_mempool _kernel_malloc_mempool 14 #define free_mempool _kernel_free_mempool 14 15 15 16 /* … … 66 67 #define set_hrt_event _kernel_set_hrt_event 67 68 #define tmevtb_register _kernel_tmevtb_register 68 #define tmevtb_enqueue _kernel_tmevtb_enqueue69 #define tmevtb_enqueue_reltim _kernel_tmevtb_enqueue_reltim 69 70 #define tmevtb_dequeue _kernel_tmevtb_dequeue 70 71 #define check_adjtim _kernel_check_adjtim … … 163 164 */ 164 165 #define initialize_object _kernel_initialize_object 165 #define call_inirtn _kernel_call_inirtn 166 #define call_terrtn _kernel_call_terrtn 166 #define tnum_inirtn _kernel_tnum_inirtn 167 #define inirtnb_table _kernel_inirtnb_table 168 #define tnum_terrtn _kernel_tnum_terrtn 169 #define terrtnb_table _kernel_terrtnb_table 167 170 #define tmax_tskid _kernel_tmax_tskid 168 171 #define tmax_stskid _kernel_tmax_stskid … … 232 235 #define istk _kernel_istk 233 236 #define istkpt _kernel_istkpt 234 #define kmmsz _kernel_kmmsz 235 #define kmm _kernel_kmm 237 #define mpksz _kernel_mpksz 238 #define mpk _kernel_mpk 239 240 /* 241 * tTraceLog.c 242 */ 243 #define log_dsp_enter _kernel_log_dsp_enter 244 #define log_dsp_leave _kernel_log_dsp_leave 245 #define log_inh_enter _kernel_log_inh_enter 246 #define log_inh_leave _kernel_log_inh_leave 247 #define log_exc_enter _kernel_log_exc_enter 248 #define log_exc_leave _kernel_log_exc_leave 236 249 237 250 -
EcnlProtoTool/trunk/asp3_dcre/kernel/kernel_sym.def
r331 r429 1 USE_EXTERNAL_ID,true,bool,defined(USE_EXTERNAL_ID) 2 SIL_ENDIAN_BIG,true,bool,defined(SIL_ENDIAN_BIG) 3 SIL_ENDIAN_LITTLE,true,bool,defined(SIL_ENDIAN_LITTLE) 1 USE_EXTERNAL_ID,true,bool,defined(USE_EXTERNAL_ID),false 4 2 TA_NULL 5 3 TA_ACT … … 48 46 TMIN_CYCID,,signed 49 47 TMIN_ALMID,,signed 50 USE_TSKINICTXB,true,bool,defined(USE_TSKINICTXB) 51 OMIT_INITIALIZE_INTERRUPT,true,bool,defined(OMIT_INITIALIZE_INTERRUPT) 52 USE_INHINIB_TABLE,true,bool,defined(USE_INHINIB_TABLE) 53 USE_INTINIB_TABLE,true,bool,defined(USE_INTINIB_TABLE) 54 OMIT_INITIALIZE_EXCEPTION,true,bool,defined(OMIT_INITIALIZE_EXCEPTION) 55 DEFAULT_ISTK,, ,defined(DEFAULT_ISTK)56 TARGET_TSKATR ,,,defined(TARGET_TSKATR),048 USE_TSKINICTXB,true,bool,defined(USE_TSKINICTXB),false 49 OMIT_INITIALIZE_INTERRUPT,true,bool,defined(OMIT_INITIALIZE_INTERRUPT),false 50 USE_INHINIB_TABLE,true,bool,defined(USE_INHINIB_TABLE),false 51 USE_INTINIB_TABLE,true,bool,defined(USE_INTINIB_TABLE),false 52 OMIT_INITIALIZE_EXCEPTION,true,bool,defined(OMIT_INITIALIZE_EXCEPTION),false 53 DEFAULT_ISTK,,intptr,defined(DEFAULT_ISTK) 54 TARGET_TSKATR 57 55 TARGET_INTATR,,,defined(TARGET_INTATR),0 58 56 TARGET_INHATR,,,defined(TARGET_INHATR),0 59 TARGET_ISRATR ,,,defined(TARGET_ISRATR),057 TARGET_ISRATR 60 58 TARGET_EXCATR,,,defined(TARGET_EXCATR),0 61 TARGET_MIN_STKSZ ,,,defined(TARGET_MIN_STKSZ),159 TARGET_MIN_STKSZ 62 60 TARGET_MIN_ISTKSZ,,,defined(TARGET_MIN_ISTKSZ),1 63 61 CHECK_STKSZ_ALIGN,,,defined(CHECK_STKSZ_ALIGN),1 64 62 CHECK_INTPTR_ALIGN,,,defined(CHECK_INTPTR_ALIGN),1 65 CHECK_INTPTR_NONNULL,true,bool,defined(CHECK_INTPTR_NONNULL) 63 CHECK_INTPTR_NONNULL,true,bool,defined(CHECK_INTPTR_NONNULL),false 66 64 CHECK_FUNC_ALIGN,,,defined(CHECK_FUNC_ALIGN),1 67 CHECK_FUNC_NONNULL,true,bool,defined(CHECK_FUNC_NONNULL) 65 CHECK_FUNC_NONNULL,true,bool,defined(CHECK_FUNC_NONNULL),false 68 66 CHECK_STACK_ALIGN,,,defined(CHECK_STACK_ALIGN),1 69 CHECK_STACK_NONNULL,true,bool,defined(CHECK_STACK_NONNULL) 67 CHECK_STACK_NONNULL,true,bool,defined(CHECK_STACK_NONNULL),false 70 68 CHECK_MPF_ALIGN,,,defined(CHECK_MPF_ALIGN),1 71 CHECK_MPF_NONNULL,true,bool,defined(CHECK_MPF_NONNULL) 69 CHECK_MPF_NONNULL,true,bool,defined(CHECK_MPF_NONNULL),false 70 CHECK_MPK_ALIGN,,,defined(CHECK_MPK_ALIGN),1 71 CHECK_MPK_NONNULL,true,bool,defined(CHECK_MPK_NONNULL),false 72 72 CHECK_MB_ALIGN,,,defined(CHECK_MB_ALIGN),1 73 73 sizeof_void_ptr,sizeof(void*) … … 138 138 offsetof_ISRINIB_isrpri,"offsetof(ISRINIB,isrpri)" 139 139 sizeof_INHINIB,sizeof(INHINIB),,!defined(OMIT_INITIALIZE_INTERRUPT) 140 offset _INHINIB_inhno,"offsetof(INHINIB,inhno)",,!defined(OMIT_INITIALIZE_INTERRUPT)141 offset _INHINIB_inhatr,"offsetof(INHINIB,inhatr)",,!defined(OMIT_INITIALIZE_INTERRUPT),,142 offset _INHINIB_int_entry,"offsetof(INHINIB,int_entry)",,!defined(OMIT_INITIALIZE_INTERRUPT),,140 offsetof_INHINIB_inhno,"offsetof(INHINIB,inhno)",,!defined(OMIT_INITIALIZE_INTERRUPT) 141 offsetof_INHINIB_inhatr,"offsetof(INHINIB,inhatr)",,!defined(OMIT_INITIALIZE_INTERRUPT),, 142 offsetof_INHINIB_int_entry,"offsetof(INHINIB,int_entry)",,!defined(OMIT_INITIALIZE_INTERRUPT),, 143 143 sizeof_INTINIB,sizeof(INTINIB),,!defined(OMIT_INITIALIZE_INTERRUPT) 144 offset _INTINIB_intno,"offsetof(INTINIB,intno)",,!defined(OMIT_INITIALIZE_INTERRUPT)145 offset _INTINIB_intatr,"offsetof(INTINIB,intatr)",,!defined(OMIT_INITIALIZE_INTERRUPT)146 offset _INTINIB_intpri,"offsetof(INTINIB,intpri)",,!defined(OMIT_INITIALIZE_INTERRUPT)144 offsetof_INTINIB_intno,"offsetof(INTINIB,intno)",,!defined(OMIT_INITIALIZE_INTERRUPT) 145 offsetof_INTINIB_intatr,"offsetof(INTINIB,intatr)",,!defined(OMIT_INITIALIZE_INTERRUPT) 146 offsetof_INTINIB_intpri,"offsetof(INTINIB,intpri)",,!defined(OMIT_INITIALIZE_INTERRUPT) 147 147 sizeof_EXCINIB,sizeof(EXCINIB),,!defined(OMIT_INITIALIZE_EXCEPTION) 148 offset_EXCINIB_excno,"offsetof(EXCINIB,excno)",,!defined(OMIT_INITIALIZE_EXCEPTION) 149 offset_EXCINIB_excatr,"offsetof(EXCINIB,excatr)",,!defined(OMIT_INITIALIZE_EXCEPTION) 150 offset_EXCINIB_exc_entry,"offsetof(EXCINIB,exc_entry)",,!defined(OMIT_INITIALIZE_EXCEPTION) 148 offsetof_EXCINIB_excno,"offsetof(EXCINIB,excno)",,!defined(OMIT_INITIALIZE_EXCEPTION) 149 offsetof_EXCINIB_excatr,"offsetof(EXCINIB,excatr)",,!defined(OMIT_INITIALIZE_EXCEPTION) 150 offsetof_EXCINIB_exc_entry,"offsetof(EXCINIB,exc_entry)",,!defined(OMIT_INITIALIZE_EXCEPTION) 151 sizeof_INIRTNB,sizeof(INIRTNB) 152 offsetof_INIRTNB_inirtn,"offsetof(INIRTNB,inirtn)" 153 offsetof_INIRTNB_exinf,"offsetof(INIRTNB,exinf)" 154 sizeof_TERRTNB,sizeof(TERRTNB) 155 offsetof_TERRTNB_terrtn,"offsetof(TERRTNB,terrtn)" 156 offsetof_TERRTNB_exinf,"offsetof(TERRTNB,exinf)" -
EcnlProtoTool/trunk/asp3_dcre/kernel/kernel_unrename.h
r321 r429 9 9 */ 10 10 #undef kerflg 11 #undef mpk_valid 11 12 #undef exit_kernel 12 #undef initialize_ kmm13 #undef kernel_malloc14 #undef kernel_free13 #undef initialize_mempool 14 #undef malloc_mempool 15 #undef free_mempool 15 16 16 17 /* … … 67 68 #undef set_hrt_event 68 69 #undef tmevtb_register 69 #undef tmevtb_enqueue 70 #undef tmevtb_enqueue_reltim 70 71 #undef tmevtb_dequeue 71 72 #undef check_adjtim … … 164 165 */ 165 166 #undef initialize_object 166 #undef call_inirtn 167 #undef call_terrtn 167 #undef tnum_inirtn 168 #undef inirtnb_table 169 #undef tnum_terrtn 170 #undef terrtnb_table 168 171 #undef tmax_tskid 169 172 #undef tmax_stskid … … 233 236 #undef istk 234 237 #undef istkpt 235 #undef kmmsz 236 #undef kmm 238 #undef mpksz 239 #undef mpk 240 241 /* 242 * tTraceLog.c 243 */ 244 #undef log_dsp_enter 245 #undef log_dsp_leave 246 #undef log_inh_enter 247 #undef log_inh_leave 248 #undef log_exc_enter 249 #undef log_exc_leave 237 250 238 251 -
EcnlProtoTool/trunk/asp3_dcre/kernel/mempfix.c
r321 r429 6 6 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory 7 7 * Toyohashi Univ. of Technology, JAPAN 8 * Copyright (C) 2005-201 6by Embedded and Real-Time Systems Laboratory8 * Copyright (C) 2005-2018 by Embedded and Real-Time Systems Laboratory 9 9 * Graduate School of Information Science, Nagoya Univ., JAPAN 10 10 * … … 226 226 p_mpfmb = pk_cmpf->mpfmb; 227 227 228 CHECK_ RSATR(mpfatr, TA_TPRI);228 CHECK_VALIDATR(mpfatr, TA_TPRI); 229 229 CHECK_PAR(blkcnt != 0); 230 230 CHECK_PAR(blksz != 0); … … 242 242 else { 243 243 if (mpf == NULL) { 244 mpf = kernel_malloc(ROUND_MPF_T(blksz) * blkcnt);244 mpf = malloc_mpk(ROUND_MPF_T(blksz) * blkcnt); 245 245 mpfatr |= TA_MEMALLOC; 246 246 } … … 250 250 else { 251 251 if (p_mpfmb == NULL) { 252 p_mpfmb = kernel_malloc(sizeof(MPFMB) * blkcnt);252 p_mpfmb = malloc_mpk(sizeof(MPFMB) * blkcnt); 253 253 mpfatr |= TA_MBALLOC; 254 254 } 255 255 if (p_mpfmb == NULL) { 256 if ( mpf == NULL) {257 kernel_free(mpf);256 if (pk_cmpf->mpf == NULL) { 257 free_mpk(mpf); 258 258 } 259 259 ercd = E_NOMEM; … … 313 313 p_mpfinib = (MPFINIB *)(p_mpfcb->p_mpfinib); 314 314 if ((p_mpfinib->mpfatr & TA_MEMALLOC) != 0U) { 315 kernel_free(p_mpfinib->mpf);315 free_mpk(p_mpfinib->mpf); 316 316 } 317 317 if ((p_mpfinib->mpfatr & TA_MBALLOC) != 0U) { 318 kernel_free(p_mpfinib->p_mpfmb);318 free_mpk(p_mpfinib->p_mpfmb); 319 319 } 320 320 p_mpfinib->mpfatr = TA_NOEXS; … … 342 342 get_mpf(ID mpfid, void **p_blk) 343 343 { 344 MPFCB *p_mpfcb;345 WINFO_MPF 346 ER ercd;344 MPFCB *p_mpfcb; 345 WINFO_MPF winfo_mpf; 346 ER ercd; 347 347 348 348 LOG_GET_MPF_ENTER(mpfid, p_blk); … … 363 363 } 364 364 else { 365 p_runtsk->tstat = TS_WAITING_MPF;366 wobj_make_wait((WOBJCB *) p_mpfcb,(WINFO_WOBJ *) &winfo_mpf);365 wobj_make_wait((WOBJCB *) p_mpfcb, TS_WAITING_MPF, 366 (WINFO_WOBJ *) &winfo_mpf); 367 367 dispatch(); 368 368 ercd = winfo_mpf.winfo.wercd; … … 424 424 tget_mpf(ID mpfid, void **p_blk, TMO tmout) 425 425 { 426 MPFCB *p_mpfcb;427 WINFO_MPF 428 TMEVTB tmevtb;429 ER ercd;426 MPFCB *p_mpfcb; 427 WINFO_MPF winfo_mpf; 428 TMEVTB tmevtb; 429 ER ercd; 430 430 431 431 LOG_TGET_MPF_ENTER(mpfid, p_blk, tmout); … … 450 450 } 451 451 else { 452 p_runtsk->tstat = TS_WAITING_MPF; 453 wobj_make_wait_tmout((WOBJCB *) p_mpfcb, (WINFO_WOBJ *) &winfo_mpf, 454 &tmevtb, tmout); 452 wobj_make_wait_tmout((WOBJCB *) p_mpfcb, TS_WAITING_MPF, 453 (WINFO_WOBJ *) &winfo_mpf, &tmevtb, tmout); 455 454 dispatch(); 456 455 ercd = winfo_mpf.winfo.wercd; -
EcnlProtoTool/trunk/asp3_dcre/kernel/mempfix.trb
r321 r429 6 6 # 7 7 # Copyright (C) 2015 by FUJI SOFT INCORPORATED, JAPAN 8 # Copyright (C) 2015 ,2016by Embedded and Real-Time Systems Laboratory8 # Copyright (C) 2015-2019 by Embedded and Real-Time Systems Laboratory 9 9 # Graduate School of Information Science, Nagoya Univ., JAPAN 10 10 # … … 55 55 params[:mpfmb] ||= "NULL" 56 56 57 # mpfatrが無効の場合(E_RSATR)[NGKI2225] 57 # mpfatrが無効の場合(E_RSATR)[NGKI2225][NGKI2218] 58 58 #(TA_TPRI以外のビットがセットされている場合) 59 59 if (params[:mpfatr] & ~($TA_TPRI)) != 0 -
EcnlProtoTool/trunk/asp3_dcre/kernel/mutex.c
r321 r429 4 4 * Advanced Standard Profile Kernel 5 5 * 6 * Copyright (C) 2005-201 6by Embedded and Real-Time Systems Laboratory6 * Copyright (C) 2005-2018 by Embedded and Real-Time Systems Laboratory 7 7 * Graduate School of Information Science, Nagoya Univ., JAPAN 8 8 * … … 378 378 } 379 379 else { 380 CHECK_ RSATR(mtxatr, TA_TPRI);/*[NGKI2025]*/380 CHECK_VALIDATR(mtxatr, TA_TPRI); /*[NGKI2025]*/ 381 381 } 382 382 … … 473 473 loc_mtx(ID mtxid) 474 474 { 475 MTXCB *p_mtxcb;476 WINFO_MTX 477 ER ercd;475 MTXCB *p_mtxcb; 476 WINFO_MTX winfo_mtx; 477 ER ercd; 478 478 479 479 LOG_LOC_MTX_ENTER(mtxid); … … 506 506 } 507 507 else { 508 p_runtsk->tstat = TS_WAITING_MTX;509 wobj_make_wait((WOBJCB *) p_mtxcb,(WINFO_WOBJ *) &winfo_mtx);508 wobj_make_wait((WOBJCB *) p_mtxcb, TS_WAITING_MTX, 509 (WINFO_WOBJ *) &winfo_mtx); 510 510 dispatch(); 511 511 ercd = winfo_mtx.winfo.wercd; … … 576 576 tloc_mtx(ID mtxid, TMO tmout) 577 577 { 578 MTXCB *p_mtxcb;579 WINFO_MTX 580 TMEVTB tmevtb;581 ER ercd;578 MTXCB *p_mtxcb; 579 WINFO_MTX winfo_mtx; 580 TMEVTB tmevtb; 581 ER ercd; 582 582 583 583 LOG_TLOC_MTX_ENTER(mtxid, tmout); … … 614 614 } 615 615 else { 616 p_runtsk->tstat = TS_WAITING_MTX; 617 wobj_make_wait_tmout((WOBJCB *) p_mtxcb, (WINFO_WOBJ *) &winfo_mtx, 618 &tmevtb, tmout); 616 wobj_make_wait_tmout((WOBJCB *) p_mtxcb, TS_WAITING_MTX, 617 (WINFO_WOBJ *) &winfo_mtx, &tmevtb, tmout); 619 618 dispatch(); 620 619 ercd = winfo_mtx.winfo.wercd; -
EcnlProtoTool/trunk/asp3_dcre/kernel/mutex.trb
r321 r429 6 6 # 7 7 # Copyright (C) 2015 by FUJI SOFT INCORPORATED, JAPAN 8 # Copyright (C) 2015 ,2016by Embedded and Real-Time Systems Laboratory8 # Copyright (C) 2015-2019 by Embedded and Real-Time Systems Laboratory 9 9 # Graduate School of Information Science, Nagoya Univ., JAPAN 10 10 # … … 51 51 52 52 def prepare(key, params) 53 # mtxatrが無効の場合(E_RSATR)[NGKI2025] 54 # 53 # mtxatrが無効の場合(E_RSATR)[NGKI2025][NGKI2010] 54 #(TA_NULL,TA_TPRI,TA_CEILINGのいずれでもない場合) 55 55 if !(params[:mtxatr] == $TA_NULL || params[:mtxatr] == $TA_TPRI \ 56 56 || params[:mtxatr] == $TA_CEILING) … … 60 60 if params[:mtxatr] == $TA_CEILING 61 61 # 優先度上限ミューテックスの場合 62 # ceilpri が未指定の場合はエラーとする63 if params[:ceilpri].nil?62 # ceilpriの記述が省略されている場合[NGKI2035] 63 if !params.has_key?(:ceilpri) 64 64 error_api(params, "ceilpri must be specified in %apiname of %mtxid") 65 65 66 # (TMIN_TPRI <= ceilpri && ceilpri <= TMAX_TPRI)でない場合(E_PAR)67 # [NGKI2037]66 # ceilpriが有効範囲外の場合(E_PAR)[NGKI2037] 67 #(TMIN_TPRI <= ceilpri && ceilpri <= TMAX_TPRIでない場合) 68 68 elsif !($TMIN_TPRI <= params[:ceilpri] && params[:ceilpri] <= $TMAX_TPRI) 69 69 error_illegal_id("E_PAR", params, :ceilpri, :mtxid) … … 71 71 else 72 72 # 優先度上限ミューテックスでない場合 73 # ceilpriが 指定されている場合は警告メッセージを出す74 if !params[:ceilpri].nil?73 # ceilpriが記述されている場合は警告メッセージを出す 74 if params.has_key?(:ceilpri) 75 75 warning_api(params, "%%ceilpri is ignored in %apiname of %mtxid") 76 76 end -
EcnlProtoTool/trunk/asp3_dcre/kernel/pridataq.c
r321 r429 6 6 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory 7 7 * Toyohashi Univ. of Technology, JAPAN 8 * Copyright (C) 2005-201 6by Embedded and Real-Time Systems Laboratory8 * Copyright (C) 2005-2018 by Embedded and Real-Time Systems Laboratory 9 9 * Graduate School of Information Science, Nagoya Univ., JAPAN 10 10 * … … 335 335 p_pdqmb = pk_cpdq->pdqmb; 336 336 337 CHECK_ RSATR(pdqatr, TA_TPRI);337 CHECK_VALIDATR(pdqatr, TA_TPRI); 338 338 CHECK_PAR(VALID_DPRI(maxdpri)); 339 if (p_pdqmb != NULL) { 340 CHECK_PAR(MB_ALIGN(p_pdqmb)); 341 } 339 342 340 343 lock_cpu(); … … 344 347 else { 345 348 if (pdqcnt != 0 && p_pdqmb == NULL) { 346 p_pdqmb = kernel_malloc(sizeof(PDQMB) * pdqcnt);349 p_pdqmb = malloc_mpk(sizeof(PDQMB) * pdqcnt); 347 350 pdqatr |= TA_MBALLOC; 348 351 } … … 405 408 p_pdqinib = (PDQINIB *)(p_pdqcb->p_pdqinib); 406 409 if ((p_pdqinib->pdqatr & TA_MBALLOC) != 0U) { 407 kernel_free(p_pdqinib->p_pdqmb);410 free_mpk(p_pdqinib->p_pdqmb); 408 411 } 409 412 p_pdqinib->pdqatr = TA_NOEXS; … … 431 434 snd_pdq(ID pdqid, intptr_t data, PRI datapri) 432 435 { 433 PDQCB *p_pdqcb;434 WINFO_SPDQ 435 ER ercd;436 PDQCB *p_pdqcb; 437 WINFO_SPDQ winfo_spdq; 438 ER ercd; 436 439 437 440 LOG_SND_PDQ_ENTER(pdqid, data, datapri); … … 460 463 winfo_spdq.data = data; 461 464 winfo_spdq.datapri = datapri; 462 p_runtsk->tstat = TS_WAITING_SPDQ;463 wobj_make_wait((WOBJCB *) p_pdqcb,(WINFO_WOBJ *) &winfo_spdq);465 wobj_make_wait((WOBJCB *) p_pdqcb, TS_WAITING_SPDQ, 466 (WINFO_WOBJ *) &winfo_spdq); 464 467 dispatch(); 465 468 ercd = winfo_spdq.winfo.wercd; … … 504 507 } 505 508 else { 506 request_dispatch ();509 request_dispatch_retint(); 507 510 } 508 511 } … … 529 532 tsnd_pdq(ID pdqid, intptr_t data, PRI datapri, TMO tmout) 530 533 { 531 PDQCB *p_pdqcb;532 WINFO_SPDQ 533 TMEVTB tmevtb;534 ER ercd;534 PDQCB *p_pdqcb; 535 WINFO_SPDQ winfo_spdq; 536 TMEVTB tmevtb; 537 ER ercd; 535 538 536 539 LOG_TSND_PDQ_ENTER(pdqid, data, datapri, tmout); … … 563 566 winfo_spdq.data = data; 564 567 winfo_spdq.datapri = datapri; 565 p_runtsk->tstat = TS_WAITING_SPDQ; 566 wobj_make_wait_tmout((WOBJCB *) p_pdqcb, (WINFO_WOBJ *) &winfo_spdq, 567 &tmevtb, tmout); 568 wobj_make_wait_tmout((WOBJCB *) p_pdqcb, TS_WAITING_SPDQ, 569 (WINFO_WOBJ *) &winfo_spdq, &tmevtb, tmout); 568 570 dispatch(); 569 571 ercd = winfo_spdq.winfo.wercd; … … 586 588 rcv_pdq(ID pdqid, intptr_t *p_data, PRI *p_datapri) 587 589 { 588 PDQCB *p_pdqcb;589 WINFO_RPDQ 590 ER ercd;590 PDQCB *p_pdqcb; 591 WINFO_RPDQ winfo_rpdq; 592 ER ercd; 591 593 592 594 LOG_RCV_PDQ_ENTER(pdqid, p_data, p_datapri); … … 609 611 } 610 612 else { 611 p_runtsk->tstat = TS_WAITING_RPDQ; 612 make_wait(&(winfo_rpdq.winfo)); 613 make_wait(TS_WAITING_RPDQ, &(winfo_rpdq.winfo)); 613 614 queue_insert_prev(&(p_pdqcb->rwait_queue), &(p_runtsk->task_queue)); 614 615 winfo_rpdq.p_pdqcb = p_pdqcb; … … 676 677 trcv_pdq(ID pdqid, intptr_t *p_data, PRI *p_datapri, TMO tmout) 677 678 { 678 PDQCB *p_pdqcb;679 WINFO_RPDQ 680 TMEVTB tmevtb;681 ER ercd;679 PDQCB *p_pdqcb; 680 WINFO_RPDQ winfo_rpdq; 681 TMEVTB tmevtb; 682 ER ercd; 682 683 683 684 LOG_TRCV_PDQ_ENTER(pdqid, p_data, p_datapri, tmout); … … 704 705 } 705 706 else { 706 p_runtsk->tstat = TS_WAITING_RPDQ; 707 make_wait_tmout(&(winfo_rpdq.winfo), &tmevtb, tmout); 707 make_wait_tmout(TS_WAITING_RPDQ, &(winfo_rpdq.winfo), &tmevtb, tmout); 708 708 queue_insert_prev(&(p_pdqcb->rwait_queue), &(p_runtsk->task_queue)); 709 709 winfo_rpdq.p_pdqcb = p_pdqcb; -
EcnlProtoTool/trunk/asp3_dcre/kernel/pridataq.trb
r321 r429 6 6 # 7 7 # Copyright (C) 2015 by FUJI SOFT INCORPORATED, JAPAN 8 # Copyright (C) 2015 ,2016by Embedded and Real-Time Systems Laboratory8 # Copyright (C) 2015-2019 by Embedded and Real-Time Systems Laboratory 9 9 # Graduate School of Information Science, Nagoya Univ., JAPAN 10 10 # … … 54 54 params[:pdqmb] ||= "NULL" 55 55 56 # pdqatrが無効の場合(E_RSATR)[NGKI1804] 56 # pdqatrが無効の場合(E_RSATR)[NGKI1804][NGKI1795] 57 57 #(TA_TPRI以外のビットがセットされている場合) 58 58 if (params[:pdqatr] & ~($TA_TPRI)) != 0 … … 60 60 end 61 61 62 # (TMIN_DPRI <= maxdpri && maxdpri <= TMAX_DPRI)でない場合(E_PAR) 63 # [NGKI1819]62 # maxdpriが有効範囲外の場合(E_PAR)[NGKI1819] 63 #(TMIN_DPRI <= maxdpri && maxdpri <= TMAX_DPRIでない場合) 64 64 if !($TMIN_DPRI <= params[:maxdpri] && params[:maxdpri] <= $TMAX_DPRI) 65 65 error_illegal_id("E_PAR", params, :maxdpri, :pdqid) -
EcnlProtoTool/trunk/asp3_dcre/kernel/semaphore.c
r321 r429 6 6 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory 7 7 * Toyohashi Univ. of Technology, JAPAN 8 * Copyright (C) 2005-201 6by Embedded and Real-Time Systems Laboratory8 * Copyright (C) 2005-2018 by Embedded and Real-Time Systems Laboratory 9 9 * Graduate School of Information Science, Nagoya Univ., JAPAN 10 10 * … … 186 186 maxsem = pk_csem->maxsem; 187 187 188 CHECK_ RSATR(sematr, TA_TPRI);188 CHECK_VALIDATR(sematr, TA_TPRI); 189 189 CHECK_PAR(0 <= isemcnt && isemcnt <= maxsem); 190 190 CHECK_PAR(1 <= maxsem && maxsem <= TMAX_MAXSEM); … … 286 286 } 287 287 else { 288 request_dispatch ();288 request_dispatch_retint(); 289 289 } 290 290 } … … 315 315 wai_sem(ID semid) 316 316 { 317 SEMCB *p_semcb;318 WINFO_SEM 319 ER ercd;317 SEMCB *p_semcb; 318 WINFO_SEM winfo_sem; 319 ER ercd; 320 320 321 321 LOG_WAI_SEM_ENTER(semid); … … 336 336 } 337 337 else { 338 p_runtsk->tstat = TS_WAITING_SEM;339 wobj_make_wait((WOBJCB *) p_semcb,(WINFO_WOBJ *) &winfo_sem);338 wobj_make_wait((WOBJCB *) p_semcb, TS_WAITING_SEM, 339 (WINFO_WOBJ *) &winfo_sem); 340 340 dispatch(); 341 341 ercd = winfo_sem.winfo.wercd; … … 394 394 twai_sem(ID semid, TMO tmout) 395 395 { 396 SEMCB *p_semcb;397 WINFO_SEM 398 TMEVTB tmevtb;399 ER ercd;396 SEMCB *p_semcb; 397 WINFO_SEM winfo_sem; 398 TMEVTB tmevtb; 399 ER ercd; 400 400 401 401 LOG_TWAI_SEM_ENTER(semid, tmout); … … 420 420 } 421 421 else { 422 p_runtsk->tstat = TS_WAITING_SEM; 423 wobj_make_wait_tmout((WOBJCB *) p_semcb, (WINFO_WOBJ *) &winfo_sem, 424 &tmevtb, tmout); 422 wobj_make_wait_tmout((WOBJCB *) p_semcb, TS_WAITING_SEM, 423 (WINFO_WOBJ *) &winfo_sem, &tmevtb, tmout); 425 424 dispatch(); 426 425 ercd = winfo_sem.winfo.wercd; -
EcnlProtoTool/trunk/asp3_dcre/kernel/semaphore.trb
r321 r429 6 6 # 7 7 # Copyright (C) 2015 by FUJI SOFT INCORPORATED, JAPAN 8 # Copyright (C) 2015 ,2016by Embedded and Real-Time Systems Laboratory8 # Copyright (C) 2015-2019 by Embedded and Real-Time Systems Laboratory 9 9 # Graduate School of Information Science, Nagoya Univ., JAPAN 10 10 # … … 51 51 52 52 def prepare(key, params) 53 # sematrが無効の場合(E_RSATR)[NGKI1456] 53 # sematrが無効の場合(E_RSATR)[NGKI1456][NGKI1448] 54 54 #(TA_TPRI以外のビットがセットされている場合) 55 55 if (params[:sematr] & ~($TA_TPRI)) != 0 … … 57 57 end 58 58 59 # (1 <= maxsem && maxsem <= TMAX_MAXSEM)でない場合(E_PAR)[NGKI1468] 59 # maxsemが有効範囲外の場合(E_PAR)[NGKI1468] 60 #(1 <= maxsem && maxsem <= TMAX_MAXSEMでない場合) 60 61 if !(1 <= params[:maxsem] && params[:maxsem] <= $TMAX_MAXSEM) 61 62 error_illegal_id("E_PAR", params, :maxsem, :semid) 62 63 end 63 64 64 # (0 <= isemcnt && isemcnt <= maxsem)でない場合(E_PAR)[NGKI1466] 65 # isemcntが有効範囲外の場合(E_PAR)[NGKI1466] 66 #(0 <= isemcnt && isemcnt <= maxsemでない場合) 65 67 if !(0 <= params[:isemcnt] && params[:isemcnt] <= params[:maxsem]) 66 68 error_wrong_id("E_PAR", params, :isemcnt, :semid, "too large") -
EcnlProtoTool/trunk/asp3_dcre/kernel/startup.c
r321 r429 6 6 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory 7 7 * Toyohashi Univ. of Technology, JAPAN 8 * Copyright (C) 2005-201 6by Embedded and Real-Time Systems Laboratory8 * Copyright (C) 2005-2018 by Embedded and Real-Time Systems Laboratory 9 9 * Graduate School of Information Science, Nagoya Univ., JAPAN 10 10 * … … 79 79 80 80 /* 81 * カーネルメモリプール領域有効フラグ 82 */ 83 bool_t mpk_valid; 84 85 /* 81 86 * カーネルの起動 82 87 */ … … 84 89 sta_ker(void) 85 90 { 91 uint_t i; 92 86 93 /* 87 94 * TECSの初期化 … … 102 109 * する必要がある. 103 110 */ 104 initialize_kmm(); 111 if (mpk != NULL) { 112 mpk_valid = initialize_mempool(mpk, mpksz); 113 } 114 else { 115 mpk_valid = false; 116 } 105 117 initialize_tmevt(); /*[ASPD1061]*/ 106 118 initialize_object(); … … 109 121 * 初期化ルーチンの実行 110 122 */ 111 call_inirtn(); 123 for (i = 0; i < tnum_inirtn; i++) { 124 (*(inirtnb_table[i].inirtn))(inirtnb_table[i].exinf); 125 } 112 126 113 127 /* … … 172 186 exit_kernel(void) 173 187 { 188 uint_t i; 189 174 190 /* 175 191 * 終了処理ルーチンの実行 176 192 */ 177 call_terrtn(); 193 for (i = 0; i < tnum_terrtn; i++) { 194 (*(terrtnb_table[i].terrtn))(terrtnb_table[i].exinf); 195 } 178 196 179 197 /* … … 187 205 188 206 /* 189 * カーネルの割り付けるメモリ領域の管理207 * デフォルトのメモリプール管理機能 190 208 * 191 * メモリ領域を先頭から順に割り当て,解放されたメモリ領域を再利用しな 192 * いメモリ管理モジュール. 209 * メモリプール領域の先頭から順に割り当てを行い,すべてのメモリ領域が 210 * 解放されるまで解放されたメモリ領域を再利用しないメモリプール管理機 211 * 能. 193 212 */ 194 213 #ifdef TOPPERS_kermem 195 #ifndef OMIT_KMM_ALLOCONLY 196 197 static void *kmm_brk; 198 199 void 200 initialize_kmm(void) 201 { 202 kmm_brk = ((char *) kmm) + kmmsz; 214 #ifndef OMIT_MEMPOOL_DEFAULT 215 216 typedef struct { 217 void *brk; /* メモリプール領域の未使用領域の先頭番地 */ 218 void *limit; /* メモリプール領域の上限 */ 219 uint_t count; /* 割り当てたメモリ領域の数 */ 220 } MEMPOOLCB; 221 222 bool_t 223 initialize_mempool(MB_T *mempool, size_t size) 224 { 225 MEMPOOLCB *p_mempoolcb = ((MEMPOOLCB *) mempool); 226 227 if (size >= sizeof(MEMPOOLCB)) { 228 p_mempoolcb->brk = ((char *) mempool) + sizeof(MEMPOOLCB); 229 p_mempoolcb->limit = ((char *) mempool) + size; 230 p_mempoolcb->count = 0; 231 return(true); 232 } 233 else { 234 return(false); 235 } 203 236 } 204 237 205 238 void * 206 kernel_malloc(size_t size) 207 { 208 if (((char *) kmm_brk) - ((char *) kmm) >= size) { 209 kmm_brk = ((char *) kmm_brk) - size; 210 return(kmm_brk); 239 malloc_mempool(MB_T *mempool, size_t size) 240 { 241 MEMPOOLCB *p_mempoolcb = ((MEMPOOLCB *) mempool); 242 void *brk; 243 244 brk = ((MEMPOOLCB *) mempool)->brk; 245 if (((char *)(p_mempoolcb->limit)) - ((char *) brk) >= size) { 246 p_mempoolcb->brk = ((char *) brk) + size; 247 p_mempoolcb->count += 1; 248 return(brk); 211 249 } 212 250 else { … … 216 254 217 255 void 218 kernel_free(void *ptr) 219 { 220 } 221 222 #endif /* OMIT_KMM_ALLOCONLY */ 256 free_mempool(MB_T *mempool, void *ptr) 257 { 258 MEMPOOLCB *p_mempoolcb = ((MEMPOOLCB *) mempool); 259 260 p_mempoolcb->count -= 1; 261 if (p_mempoolcb->count == 0) { 262 p_mempoolcb->brk = ((char *) mempool) + sizeof(MEMPOOLCB); 263 } 264 } 265 266 #endif /* OMIT_MEMPOOL_DEFAULT */ 223 267 #endif /* TOPPERS_kermem */ -
EcnlProtoTool/trunk/asp3_dcre/kernel/sys_manage.c
r321 r429 6 6 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory 7 7 * Toyohashi Univ. of Technology, JAPAN 8 * Copyright (C) 2005-201 5by Embedded and Real-Time Systems Laboratory8 * Copyright (C) 2005-2019 by Embedded and Real-Time Systems Laboratory 9 9 * Graduate School of Information Science, Nagoya Univ., JAPAN 10 10 * … … 184 184 } 185 185 else { 186 request_dispatch ();186 request_dispatch_retint(); 187 187 } 188 188 } … … 205 205 get_tid(ID *p_tskid) 206 206 { 207 bool_t lock; 207 208 ER ercd; 208 209 209 210 LOG_GET_TID_ENTER(p_tskid); 210 CHECK_UNL(); /*[NGKI2707]*/ 211 212 lock_cpu(); 211 //CHECK_UNL(); /*[NGKI2707]*/ 212 lock = sense_lock(); 213 214 if (!lock) 215 lock_cpu(); 213 216 *p_tskid = (p_runtsk == NULL) ? TSK_NONE : TSKID(p_runtsk); 214 ercd = E_OK; 215 unlock_cpu(); 217 ercd = E_OK; /*[NGKI2710][NGKI2709]*/ 218 if (!lock) 219 unlock_cpu(); 216 220 217 221 error_exit: … … 399 403 enadsp = true; 400 404 if (t_get_ipm() == TIPM_ENAALL) { 401 dspflg = true; 402 p_schedtsk = search_schedtsk(); 405 set_dspflg(); 403 406 if (p_runtsk->raster && p_runtsk->enater) { 404 407 task_terminate(p_runtsk); -
EcnlProtoTool/trunk/asp3_dcre/kernel/task.c
r321 r429 6 6 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory 7 7 * Toyohashi Univ. of Technology, JAPAN 8 * Copyright (C) 2005-201 4by Embedded and Real-Time Systems Laboratory8 * Copyright (C) 2005-2017 by Embedded and Real-Time Systems Laboratory 9 9 * Graduate School of Information Science, Nagoya Univ., JAPAN 10 10 * … … 113 113 p_tcb->actque = false; 114 114 make_dormant(p_tcb); 115 p_tcb->p_lastmtx = NULL; 115 116 if ((p_tcb->p_tinib->tskatr & TA_ACT) != 0U) { 116 117 make_active(p_tcb); … … 232 233 * 233 234 * 実行すべきタスクを更新するのは,実行できるタスクがなかった場合と, 234 * p_tcbの優先度が実行すべきタスクの優先度よりも高い場合である. 235 * p_tcbで指定されるタスクの優先度が実行すべきタスクの優先度よりも高 236 * い場合である. 235 237 */ 236 238 #ifdef TOPPERS_tskrun … … 256 258 * 実行できる状態から他の状態への遷移 257 259 * 258 * 実行すべきタスクを更新するのは,p_tcbが実行すべきタスクであった場合 259 * である.p_tcbと同じ優先度のタスクが他にある場合は,p_tcbの次のタス 260 * クが実行すべきタスクになる.そうでない場合は,レディキューをサーチ 261 * する必要がある. 260 * 実行すべきタスクを更新するのは,p_tcbで指定されるタスクが実行すべ 261 * きタスクであった場合である.p_tcbで指定されるタスクと同じ優先度の 262 * タスクが他にある場合は,そのタスクの次のタスクが実行すべきタスクに 263 * なる.そうでない場合は,レディキューをサーチする必要がある. 264 * 265 * 自タスクに対してこの関数が呼ばれるのは,タスクディスパッチ可能状態 266 * に限られる.またこの関数は,非タスクコンテキストから呼ばれることは 267 * ないため,p_runtskとp_schedtskは必ず一致している.そのため,p_tcb 268 * とp_schedtskが一致するときは,必ずタスクディスパッチ可能状態である. 262 269 */ 263 270 #ifdef TOPPERS_tsknrun … … 325 332 * タスクの優先度の変更 326 333 * 327 * タスクが実行できる状態の場合には,レディキューの中での位置を変更す 328 * る.オブジェクトの待ちキューの中で待ち状態になっている場合には,待 329 * ちキューの中での位置を変更する. 330 * 331 * 実行すべきタスクを更新するのは,(1) p_tcbが実行すべきタスクであって, 332 * その優先度を下げた場合,(2) p_tcbが実行すべきタスクではなく,変更後 333 * の優先度が実行すべきタスクの優先度よりも高い場合である.(1)の場合に 334 * は,レディキューをサーチする必要がある. 334 * p_tcbで指定されるタスクが実行できる状態の場合には,レディキューの 335 * 中での位置を変更する.オブジェクトの待ちキューの中で待ち状態になっ 336 * ている場合には,待ちキューの中での位置を変更する. 337 * 338 * 実行すべきタスクを更新するのは,(1) p_tcbで指定されるタスクが実行 339 * すべきタスクであった場合には,優先度を下げた(または優先度が変わら 340 * なかった)時,(2) p_tcbで指定されるタスクが実行すべきタスクでなかっ 341 * た場合には,変更後の優先度が実行すべきタスクの優先度よりも高いか同 342 * じ時(同じ場合に更新が必要になるのは,実際には,mtxmodeがtrueの場 343 * 合のみ)である.(1)の場合には,レディキューをサーチする必要がある. 335 344 */ 336 345 #ifdef TOPPERS_tskpri … … 367 376 } 368 377 else { 369 if (mtxmode ? newpri <= p_schedtsk->priority 370 : newpri < p_schedtsk->priority) { 371 p_schedtsk = p_tcb; 378 if (newpri <= p_schedtsk->priority) { 379 p_schedtsk = (TCB *)(ready_queue[newpri].p_next); 372 380 } 373 381 } -
EcnlProtoTool/trunk/asp3_dcre/kernel/task.h
r321 r429 6 6 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory 7 7 * Toyohashi Univ. of Technology, JAPAN 8 * Copyright (C) 2005-201 5by Embedded and Real-Time Systems Laboratory8 * Copyright (C) 2005-2017 by Embedded and Real-Time Systems Laboratory 9 9 * Graduate School of Information Science, Nagoya Univ., JAPAN 10 10 * … … 186 186 * が,実行効率が悪くなるために採用していない.他のオブジェクトについ 187 187 * ても同様に扱う. 188 *189 * タスク初期化ブロックには,DEF_TEXで定義されるタスク例外処理ルーチ190 * ンに関する情報も含む.191 188 */ 192 189 typedef struct task_initialization_block { … … 239 236 BIT_FIELD_UINT tstat : 8; /* タスク状態(内部表現)*/ 240 237 BIT_FIELD_UINT bpriority : 8; /* ベース優先度(内部表現)*/ 241 BIT_FIELD_UINT priority : 8 /* 現在の優先度(内部表現)*/;238 BIT_FIELD_UINT priority : 8; /* 現在の優先度(内部表現)*/ 242 239 #endif /* UINT8_MAX */ 243 240 BIT_FIELD_BOOL actque : 1; /* 起動要求キューイング */ … … 380 377 * 実行できる状態への遷移 381 378 * 382 * p_tcbで指定されるタスクをレディキューに挿入する.レディキューに挿入 383 * したタスクの優先度が,実行すべきタスクの優先度よりも高い場合は,実 384 * 行すべきタスクを更新する. 379 * p_tcbで指定されるタスクをレディキューに挿入する.また,必要な場合 380 * には,実行すべきタスクを更新する. 385 381 */ 386 382 extern void make_runnable(TCB *p_tcb); … … 396 392 397 393 /* 394 * タスクディスパッチ可能状態への遷移 395 * 396 * タスクディスパッチ可能状態であることを示すフラグ(dspflg)をtrueに 397 * し,実行すべきタスクを更新する. 398 */ 399 Inline void 400 set_dspflg(void) 401 { 402 dspflg = true; 403 p_schedtsk = search_schedtsk(); 404 } 405 406 /* 398 407 * 休止状態への遷移 399 408 * … … 417 426 * 必要な場合には,実行すべきタスクを更新する. 418 427 * 419 * p_tcbで指定されるタスクの優先順位は,優先度が同じタスクの中で, 420 * mtxmodeがfalseの時は最低,mtxmodeがtrueの時は最高とする. 428 * p_tcbで指定されるタスクが実行できる状態である場合,その優先順位は, 429 * 優先度が同じタスクの中で,mtxmodeがfalseの時は最低,mtxmodeがtrue 430 * の時は最高とする. 421 431 */ 422 432 extern void change_priority(TCB *p_tcb, uint_t newpri, bool_t mtxmode); … … 425 435 * レディキューの回転 426 436 * 427 * レディキュー中の,p_queueで指定されるタスクキューを回転させる.ま た,428 * 必要な場合には,実行すべきタスクを更新する.437 * レディキュー中の,p_queueで指定されるタスクキューを回転させる.ま 438 * た,必要な場合には,実行すべきタスクを更新する. 429 439 */ 430 440 extern void rotate_ready_queue(QUEUE *p_queue); -
EcnlProtoTool/trunk/asp3_dcre/kernel/task.trb
r321 r429 6 6 # 7 7 # Copyright (C) 2015 by FUJI SOFT INCORPORATED, JAPAN 8 # Copyright (C) 2015 ,2016by Embedded and Real-Time Systems Laboratory8 # Copyright (C) 2015-2019 by Embedded and Real-Time Systems Laboratory 9 9 # Graduate School of Information Science, Nagoya Univ., JAPAN 10 10 # … … 54 54 params[:stk] ||= "NULL" 55 55 56 # tskatrが無効の場合(E_RSATR)[NGKI1028] 56 # tskatrが無効の場合(E_RSATR)[NGKI1028][NGKI3526][ASPS0009] 57 # [NGKI1016] 57 58 #(TA_ACT,TA_NOACTQUE,TARGET_TSKATR以外のビットがセットされている場合) 58 59 if (params[:tskatr] & ~($TA_ACT|$TA_NOACTQUE|$TARGET_TSKATR)) != 0 … … 60 61 end 61 62 62 # (TMIN_TPRI <= itskpri && itskpri <= TMAX_TPRI)でない場合[NGKI1034] 63 # itskpriが有効範囲外の場合(E_PAR)[NGKI1034] 64 #(TMIN_TPRI <= itskpri && itskpri <= TMAX_TPRIでない場合) 63 65 if !($TMIN_TPRI <= params[:itskpri] && params[:itskpri] <= $TMAX_TPRI) 64 66 error_illegal_id("E_PAR", params, :itskpri, :tskid) … … 66 68 67 69 # stkszがターゲット定義の最小値(TARGET_MIN_STKSZ,未定義の場合は1) 68 # よりも小さい場合 [NGKI1042]70 # よりも小さい場合(E_PAR)[NGKI1042] 69 71 if params[:stksz] < $TARGET_MIN_STKSZ 70 72 error_wrong_id("E_PAR", params, :stksz, :tskid, "too small") … … 78 80 params[:tinib_stk] = stkName 79 81 else 80 # stkszが スタック領域のサイズとして正しくない場合[NGKI1056]82 # stkszがターゲット定義の制約に合致しない場合(E_PAR)[NGKI1056] 81 83 if (params[:stksz] & ($CHECK_STKSZ_ALIGN - 1)) != 0 82 84 error_wrong_id("E_PAR", params, :stksz, :tskid, "not aligned") … … 85 87 params[:tinib_stksz] = params[:stksz] 86 88 params[:tinib_stk] = "(void *)(#{params[:stk]})" 89 end 90 91 # ターゲット依存の処理(ターゲット依存のエラーチェックを含む) 92 if defined? TargetTaskPrepare() 93 TargetTaskPrepare(key, params) 87 94 end 88 95 end … … 100 107 end 101 108 109 # タスクが1つも登録されていない場合[NGKI0033] 110 if $cfgData[:CRE_TSK].size() == 0 111 error("no task is registered") 112 end 113 102 114 # 103 115 # タスク管理に関する情報の生成 104 116 # 105 117 $kernelCfgC.comment_header("Task Management Functions") 106 if $cfgData[:CRE_TSK].size() == 0107 error("no task is registered")108 end109 118 TaskObject.new.generate() 110 119 … … 112 121 $kernelCfgC.add("const ID _kernel_torder_table[TNUM_STSKID] = { ") 113 122 $kernelCfgC.append("\t") 114 $cfgData[:CRE_TSK].each_with_index do |( key, params), index|123 $cfgData[:CRE_TSK].each_with_index do |(_, params), index| 115 124 $kernelCfgC.append(", ") if index > 0 116 125 $kernelCfgC.append("#{params[:tskid]}") -
EcnlProtoTool/trunk/asp3_dcre/kernel/task_manage.c
r321 r429 6 6 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory 7 7 * Toyohashi Univ. of Technology, JAPAN 8 * Copyright (C) 2005-201 7by Embedded and Real-Time Systems Laboratory8 * Copyright (C) 2005-2018 by Embedded and Real-Time Systems Laboratory 9 9 * Graduate School of Information Science, Nagoya Univ., JAPAN 10 10 * … … 126 126 #ifdef TOPPERS_acre_tsk 127 127 128 #ifndef TARGET_MIN_STKSZ129 #define TARGET_MIN_STKSZ 1U /* 未定義の場合は0でないことをチェック */130 #endif /* TARGET_MIN_STKSZ */131 132 128 ER_UINT 133 129 acre_tsk(const T_CTSK *pk_ctsk) … … 151 147 stk = pk_ctsk->stk; 152 148 153 CHECK_ RSATR(tskatr, TA_ACT|TA_NOACTQUE|TARGET_TSKATR);149 CHECK_VALIDATR(tskatr, TA_ACT|TA_NOACTQUE|TARGET_TSKATR); 154 150 CHECK_PAR(FUNC_ALIGN(task)); 155 151 CHECK_PAR(FUNC_NONNULL(task)); … … 168 164 if (stk == NULL) { 169 165 stksz = ROUND_STK_T(stksz); 170 stk = kernel_malloc(stksz);166 stk = malloc_mpk(stksz); 171 167 tskatr |= TA_MEMALLOC; 172 168 } … … 189 185 190 186 p_tcb->actque = false; 187 p_tcb->p_lastmtx = NULL; 191 188 make_dormant(p_tcb); 192 189 if ((p_tcb->p_tinib->tskatr & TA_ACT) != 0U) { 193 190 make_active(p_tcb); 191 if (p_runtsk != p_schedtsk) { 192 dispatch(); 193 } 194 194 } 195 195 ercd = TSKID(p_tcb); … … 235 235 #else /* USE_TSKINICTXB */ 236 236 if ((p_tinib->tskatr & TA_MEMALLOC) != 0U) { /*[NGKI1109]*/ 237 kernel_free(p_tinib->stk);237 free_mpk(p_tinib->stk); 238 238 } 239 239 #endif /* USE_TSKINICTXB */ … … 283 283 } 284 284 else { 285 request_dispatch ();285 request_dispatch_retint(); 286 286 } 287 287 } … … 423 423 } 424 424 if (tskpri == TPRI_INI) { 425 /* 426 * 以下の代入文は,対象タスクが未登録の場合に無効なフィールド 427 * を参照するが,その場合はnewbpriの値を使わないので,問題な 428 * い. 429 */ 425 430 newbpri = p_tcb->p_tinib->ipriority; /*[NGKI1199]*/ 426 431 } -
EcnlProtoTool/trunk/asp3_dcre/kernel/task_refer.c
r321 r429 4 4 * Advanced Standard Profile Kernel 5 5 * 6 * Copyright (C) 2005-201 4by Embedded and Real-Time Systems Laboratory6 * Copyright (C) 2005-2018 by Embedded and Real-Time Systems Laboratory 7 7 * Graduate School of Information Science, Nagoya Univ., JAPAN 8 8 * … … 67 67 68 68 /* 69 * タスクの状態参照 69 * タスクの状態参照[NGKI1217] 70 70 */ 71 71 #ifdef TOPPERS_ref_tsk … … 79 79 80 80 LOG_REF_TSK_ENTER(tskid, pk_rtsk); 81 CHECK_TSKCTX_UNL(); 81 CHECK_TSKCTX_UNL(); /*[NGKI1218][NGKI1219]*/ 82 82 if (tskid == TSK_SELF) { 83 p_tcb = p_runtsk; 83 p_tcb = p_runtsk; /*[NGKI1248]*/ 84 84 } 85 85 else { 86 CHECK_ID(VALID_TSKID(tskid)); 86 CHECK_ID(VALID_TSKID(tskid)); /*[NGKI1220]*/ 87 87 p_tcb = get_tcb(tskid); 88 88 } … … 90 90 lock_cpu(); 91 91 if (p_tcb->p_tinib->tskatr == TA_NOEXS) { 92 ercd = E_NOEXS; 92 ercd = E_NOEXS; /*[NGKI1221]*/ 93 93 } 94 94 else { … … 96 96 if (TSTAT_DORMANT(tstat)) { 97 97 /* 98 * 対象タスクが休止状態の場合 98 * 対象タスクが休止状態の場合[NGKI1225] 99 99 */ 100 100 pk_rtsk->tskstat = TTS_DMT; … … 102 102 else { 103 103 /* 104 * タスク状態の取出し 104 * タスク状態の取出し[NGKI1225] 105 105 */ 106 106 if (TSTAT_SUSPENDED(tstat)) { … … 123 123 124 124 /* 125 * 現在優先度とベース優先度の取出し 125 * 現在優先度とベース優先度の取出し[NGKI1227] 126 126 */ 127 127 pk_rtsk->tskpri = EXT_TSKPRI(p_tcb->priority); … … 130 130 if (TSTAT_WAITING(tstat)) { 131 131 /* 132 * 待ち要因と待ち対象のオブジェクトのIDの取出し 132 * 待ち要因と待ち対象のオブジェクトのIDの取出し[NGKI1229] 133 * [NGKI1231] 133 134 */ 134 switch (tstat ) {135 switch (tstat & TS_WAITING_MASK) { 135 136 case TS_WAITING_SLP: 136 137 pk_rtsk->tskwait = TTW_SLP; … … 185 186 */ 186 187 if (p_tcb->p_winfo->p_tmevtb != NULL) { 187 pk_rtsk->lefttmo 188 pk_rtsk->lefttmo /*[NGKI1233][NGKI1235]*/ 188 189 = (TMO) tmevt_lefttim(p_tcb->p_winfo->p_tmevtb); 189 190 } 190 191 else { 191 pk_rtsk->lefttmo = TMO_FEVR; 192 } 193 } 194 195 /* 196 * 起床要求キューイング数の取出し 192 pk_rtsk->lefttmo = TMO_FEVR; /*[NGKI1234]*/ 193 } 194 } 195 196 /* 197 * 起床要求キューイング数の取出し[NGKI1239] 197 198 */ 198 199 pk_rtsk->wupcnt = p_tcb->wupque ? 1U : 0U; 199 200 200 201 /* 201 * タスク終了要求状態の取出し 202 * タスク終了要求状態の取出し[NGKI3467] 202 203 */ 203 204 pk_rtsk->raster = p_tcb->raster; 204 205 205 206 /* 206 * タスク終了禁止状態の取出し 207 * タスク終了禁止状態の取出し[NGKI3468] 207 208 */ 208 209 pk_rtsk->dister = !(p_tcb->enater); … … 210 211 211 212 /* 212 * 起動要求キューイング数の取出し 213 * 起動要求キューイング数の取出し[NGKI1238] 213 214 */ 214 215 pk_rtsk->actcnt = p_tcb->actque ? 1U : 0U; -
EcnlProtoTool/trunk/asp3_dcre/kernel/task_sync.c
r321 r429 6 6 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory 7 7 * Toyohashi Univ. of Technology, JAPAN 8 * Copyright (C) 2005-201 5by Embedded and Real-Time Systems Laboratory8 * Copyright (C) 2005-2018 by Embedded and Real-Time Systems Laboratory 9 9 * Graduate School of Information Science, Nagoya Univ., JAPAN 10 10 * … … 118 118 119 119 /* 120 * 起床待ち 120 * 起床待ち[NGKI1252] 121 121 */ 122 122 #ifdef TOPPERS_slp_tsk … … 129 129 130 130 LOG_SLP_TSK_ENTER(); 131 CHECK_DISPATCH(); 131 CHECK_DISPATCH(); /*[NGKI1254]*/ 132 132 133 133 lock_cpu_dsp(); 134 134 if (p_runtsk->raster) { 135 ercd = E_RASTER; 135 ercd = E_RASTER; /*[NGKI3455]*/ 136 136 } 137 137 else if (p_runtsk->wupque) { 138 p_runtsk->wupque = false; 139 ercd = E_OK; 140 } 141 else { 142 p_runtsk->tstat = TS_WAITING_SLP; 143 make_wait(&winfo); 138 p_runtsk->wupque = false; /*[NGKI1259]*/ 139 ercd = E_OK; 140 } 141 else { 142 make_wait(TS_WAITING_SLP, &winfo); /*[NGKI1260]*/ 144 143 LOG_TSKSTAT(p_runtsk); 145 144 dispatch(); … … 156 155 157 156 /* 158 * 起床待ち(タイムアウトあり) 157 * 起床待ち(タイムアウトあり)[NGKI1253] 159 158 */ 160 159 #ifdef TOPPERS_tslp_tsk … … 168 167 169 168 LOG_TSLP_TSK_ENTER(tmout); 170 CHECK_DISPATCH(); 171 CHECK_PAR(VALID_TMOUT(tmout)); 169 CHECK_DISPATCH(); /*[NGKI1254]*/ 170 CHECK_PAR(VALID_TMOUT(tmout)); /*[NGKI1256]*/ 172 171 173 172 lock_cpu_dsp(); 174 173 if (p_runtsk->raster) { 175 ercd = E_RASTER; 174 ercd = E_RASTER; /*[NGKI3455]*/ 176 175 } 177 176 else if (p_runtsk->wupque) { 178 p_runtsk->wupque = false; 177 p_runtsk->wupque = false; /*[NGKI1259]*/ 179 178 ercd = E_OK; 180 179 } 181 180 else if (tmout == TMO_POL) { 182 ercd = E_TMOUT; 183 } 184 else { 185 p_runtsk->tstat = TS_WAITING_SLP; 186 make_wait_tmout(&winfo, &tmevtb, tmout); 181 ercd = E_TMOUT; /*[NGKI1257]*/ 182 } 183 else { /*[NGKI1260]*/ 184 make_wait_tmout(TS_WAITING_SLP, &winfo, &tmevtb, tmout); 187 185 LOG_TSKSTAT(p_runtsk); 188 186 dispatch(); … … 199 197 200 198 /* 201 * タスクの起床 199 * タスクの起床[NGKI3531] 202 200 */ 203 201 #ifdef TOPPERS_wup_tsk … … 210 208 211 209 LOG_WUP_TSK_ENTER(tskid); 212 CHECK_UNL(); 210 CHECK_UNL(); /*[NGKI1265]*/ 213 211 if (tskid == TSK_SELF && !sense_context()) { 214 p_tcb = p_runtsk; 215 } 216 else { 217 CHECK_ID(VALID_TSKID(tskid)); 212 p_tcb = p_runtsk; /*[NGKI1275]*/ 213 } 214 else { 215 CHECK_ID(VALID_TSKID(tskid)); /*[NGKI1267]*/ 218 216 p_tcb = get_tcb(tskid); 219 217 } … … 221 219 lock_cpu(); 222 220 if (p_tcb->p_tinib->tskatr == TA_NOEXS) { 223 ercd = E_NOEXS; 221 ercd = E_NOEXS; /*[NGKI1268]*/ 224 222 } 225 223 else if (TSTAT_DORMANT(p_tcb->tstat)) { 226 ercd = E_OBJ; 224 ercd = E_OBJ; /*[NGKI1270]*/ 227 225 } 228 226 else if (TSTAT_WAIT_SLP(p_tcb->tstat)) { 229 wait_complete(p_tcb); 227 wait_complete(p_tcb); /*[NGKI1271]*/ 230 228 if (p_runtsk != p_schedtsk) { 231 229 if (!sense_context()) { … … 233 231 } 234 232 else { 235 request_dispatch ();233 request_dispatch_retint(); 236 234 } 237 235 } … … 239 237 } 240 238 else if (!(p_tcb->wupque)) { 241 p_tcb->wupque = true; 242 ercd = E_OK; 243 } 244 else { 245 ercd = E_QOVR; 239 p_tcb->wupque = true; /*[NGKI1273]*/ 240 ercd = E_OK; 241 } 242 else { 243 ercd = E_QOVR; /*[NGKI1274]*/ 246 244 } 247 245 unlock_cpu(); … … 255 253 256 254 /* 257 * タスク起床要求のキャンセル 255 * タスク起床要求のキャンセル[NGKI1276] 258 256 */ 259 257 #ifdef TOPPERS_can_wup … … 266 264 267 265 LOG_CAN_WUP_ENTER(tskid); 268 CHECK_TSKCTX_UNL(); 266 CHECK_TSKCTX_UNL(); /*[NGKI1277][NGKI1278]*/ 269 267 if (tskid == TSK_SELF) { 270 p_tcb = p_runtsk; 271 } 272 else { 273 CHECK_ID(VALID_TSKID(tskid)); 268 p_tcb = p_runtsk; /*[NGKI1285]*/ 269 } 270 else { 271 CHECK_ID(VALID_TSKID(tskid)); /*[NGKI1280]*/ 274 272 p_tcb = get_tcb(tskid); 275 273 } … … 277 275 lock_cpu(); 278 276 if (p_tcb->p_tinib->tskatr == TA_NOEXS) { 279 ercd = E_NOEXS; 277 ercd = E_NOEXS; /*[NGKI1281]*/ 280 278 } 281 279 else if (TSTAT_DORMANT(p_tcb->tstat)) { 282 ercd = E_OBJ; 283 } 284 else { 285 ercd = p_tcb->wupque ? 1 : 0; 286 p_tcb->wupque = false; 280 ercd = E_OBJ; /*[NGKI1283]*/ 281 } 282 else { 283 ercd = p_tcb->wupque ? 1 : 0; /*[NGKI1284]*/ 284 p_tcb->wupque = false; /*[NGKI1284]*/ 287 285 } 288 286 unlock_cpu(); … … 296 294 297 295 /* 298 * 待ち状態の強制解除 296 * 待ち状態の強制解除[NGKI3532] 299 297 */ 300 298 #ifdef TOPPERS_rel_wai … … 307 305 308 306 LOG_REL_WAI_ENTER(tskid); 309 CHECK_UNL(); 310 CHECK_ID(VALID_TSKID(tskid)); 307 CHECK_UNL(); /*[NGKI1290]*/ 308 CHECK_ID(VALID_TSKID(tskid)); /*[NGKI1292]*/ 311 309 p_tcb = get_tcb(tskid); 312 310 313 311 lock_cpu(); 314 312 if (p_tcb->p_tinib->tskatr == TA_NOEXS) { 315 ercd = E_NOEXS; 313 ercd = E_NOEXS; /*[NGKI1293]*/ 316 314 } 317 315 else if (!TSTAT_WAITING(p_tcb->tstat)) { 318 ercd = E_OBJ; 319 } 320 else { 321 wait_dequeue_wobj(p_tcb); 316 ercd = E_OBJ; /*[NGKI1295]*/ 317 } 318 else { 319 wait_dequeue_wobj(p_tcb); /*[NGKI1296]*/ 322 320 wait_dequeue_tmevtb(p_tcb); 323 p_tcb->p_winfo->wercd = E_RLWAI; 321 p_tcb->p_winfo->wercd = E_RLWAI; /*[NGKI1297]*/ 324 322 make_non_wait(p_tcb); 325 323 if (p_runtsk != p_schedtsk) { … … 328 326 } 329 327 else { 330 request_dispatch ();328 request_dispatch_retint(); 331 329 } 332 330 } … … 409 407 410 408 /* 411 * 強制待ち状態からの再開 409 * 強制待ち状態からの再開[NGKI1312] 412 410 */ 413 411 #ifdef TOPPERS_rsm_tsk … … 420 418 421 419 LOG_RSM_TSK_ENTER(tskid); 422 CHECK_TSKCTX_UNL(); 423 CHECK_ID(VALID_TSKID(tskid)); 420 CHECK_TSKCTX_UNL(); /*[NGKI1313][NGKI1314]*/ 421 CHECK_ID(VALID_TSKID(tskid)); /*[NGKI1316]*/ 424 422 p_tcb = get_tcb(tskid); 425 423 426 424 lock_cpu(); 427 425 if (p_tcb->p_tinib->tskatr == TA_NOEXS) { 428 ercd = E_NOEXS; 426 ercd = E_NOEXS; /*[NGKI1317]*/ 429 427 } 430 428 else if (!TSTAT_SUSPENDED(p_tcb->tstat)) { 431 ercd = E_OBJ; 432 } 433 else if (!TSTAT_WAITING(p_tcb->tstat)){429 ercd = E_OBJ; /*[NGKI1319]*/ 430 } 431 else { 434 432 /* 435 * 強制待ち 状態から実行できる状態への遷移433 * 強制待ちからの再開[NGKI1320] 436 434 */ 437 p_tcb->tstat = TS_RUNNABLE; 438 LOG_TSKSTAT(p_tcb); 439 make_runnable(p_tcb); 440 if (p_runtsk != p_schedtsk) { 441 dispatch(); 435 if (!TSTAT_WAITING(p_tcb->tstat)) { 436 p_tcb->tstat = TS_RUNNABLE; 437 LOG_TSKSTAT(p_tcb); 438 make_runnable(p_tcb); 439 if (p_runtsk != p_schedtsk) { 440 dispatch(); 441 } 442 442 } 443 ercd = E_OK; 444 } 445 else { 446 /* 447 * 二重待ち状態から待ち状態への遷移 448 */ 449 p_tcb->tstat &= ~TS_SUSPENDED; 450 LOG_TSKSTAT(p_tcb); 443 else { 444 p_tcb->tstat &= ~TS_SUSPENDED; 445 LOG_TSKSTAT(p_tcb); 446 } 451 447 ercd = E_OK; 452 448 } … … 461 457 462 458 /* 463 * 自タスクの遅延 459 * 自タスクの遅延[NGKI1348] 464 460 */ 465 461 #ifdef TOPPERS_dly_tsk … … 473 469 474 470 LOG_DLY_TSK_ENTER(dlytim); 475 CHECK_DISPATCH(); 476 CHECK_PAR(VALID_RELTIM(dlytim)); 471 CHECK_DISPATCH(); /*[NGKI1349]*/ 472 CHECK_PAR(VALID_RELTIM(dlytim)); /*[NGKI1351]*/ 477 473 478 474 lock_cpu_dsp(); 479 475 if (p_runtsk->raster) { 480 ercd = E_RASTER; 481 } 482 else { 483 p_runtsk->tstat = TS_WAITING_DLY; 476 ercd = E_RASTER; /*[NGKI3456]*/ 477 } 478 else { 479 p_runtsk->tstat = TS_WAITING_DLY; /*[NGKI1353]*/ 484 480 make_non_runnable(p_runtsk); 485 481 p_runtsk->p_winfo = &winfo; … … 487 483 tmevtb.callback = (CBACK) wait_tmout_ok; 488 484 tmevtb.arg = (void *) p_runtsk; 489 tmevtb_enqueue (&tmevtb, dlytim);485 tmevtb_enqueue_reltim(&tmevtb, dlytim); 490 486 LOG_TSKSTAT(p_runtsk); 491 487 dispatch(); -
EcnlProtoTool/trunk/asp3_dcre/kernel/task_term.c
r321 r429 6 6 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory 7 7 * Toyohashi Univ. of Technology, JAPAN 8 * Copyright (C) 2005-201 4by Embedded and Real-Time Systems Laboratory8 * Copyright (C) 2005-2017 by Embedded and Real-Time Systems Laboratory 9 9 * Graduate School of Information Science, Nagoya Univ., JAPAN 10 10 * … … 109 109 ext_tsk(void) 110 110 { 111 PRI intpri;112 111 ER ercd; 113 112 … … 126 125 } 127 126 128 intpri = t_get_ipm(); 129 if (!enadsp || intpri != TIPM_ENAALL) { 127 if (!dspflg) { 130 128 if (!enadsp) { 131 129 /* … … 135 133 enadsp = true; 136 134 } 137 if ( intpri!= TIPM_ENAALL) {135 if (t_get_ipm() != TIPM_ENAALL) { 138 136 /* 139 137 * 割込み優先度マスク(IPM)がTIPM_ENAALL以外の状態で … … 143 141 t_set_ipm(TIPM_ENAALL); 144 142 } 145 dspflg = true; 146 p_schedtsk = search_schedtsk(); 143 set_dspflg(); 147 144 } 148 145 -
EcnlProtoTool/trunk/asp3_dcre/kernel/time_event.c
r321 r429 6 6 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory 7 7 * Toyohashi Univ. of Technology, JAPAN 8 * Copyright (C) 2005-201 6by Embedded and Real-Time Systems Laboratory8 * Copyright (C) 2005-2019 by Embedded and Real-Time Systems Laboratory 9 9 * Graduate School of Information Science, Nagoya Univ., JAPAN 10 10 * … … 49 49 50 50 /* 51 * TCYC_HRTCNTの定義のチェック 52 */ 53 #if defined(USE_64BIT_HRTCNT) && defined(TCYC_HRTCNT) 54 #error TCYC_HRTCNT must not be defined when USE_64BIT_HRTCNT. 55 #endif 56 57 /* 51 58 * TSTEP_HRTCNTの範囲チェック 52 59 */ … … 56 63 57 64 /* 58 * HRTCNT_BOUNDの範囲チェック 59 */ 65 * HRTCNT_BOUNDの定義のチェック 66 */ 67 #ifndef USE_64BIT_HRTCNT 68 60 69 #if HRTCNT_BOUND >= 4294000000U 61 70 #error HRTCNT_BOUND is too large. … … 67 76 #endif /* HRTCNT_BOUND >= TCYC_HRTCNT */ 68 77 #endif /* TCYC_HRTCNT */ 78 79 #else /* USE_64BIT_HRTCNT */ 80 81 #ifdef HRTCNT_BOUND 82 #error USE_64BIT_HRTCNT is not supported on this target. 83 #endif /* HRTCNT_BOUND */ 84 85 #endif /* USE_64BIT_HRTCNT */ 69 86 70 87 /* … … 367 384 } 368 385 #endif /* TCYC_HRTCNT */ 386 current_hrtcnt = new_hrtcnt; /*[ASPD1016]*/ 369 387 370 388 previous_evttim = current_evttim; 371 389 current_evttim += (EVTTIM) hrtcnt_advance; /*[ASPD1015]*/ 372 current_hrtcnt = new_hrtcnt; /*[ASPD1016]*/373 390 boundary_evttim = current_evttim - BOUNDARY_MARGIN; /*[ASPD1011]*/ 374 391 … … 407 424 408 425 if (p_last_tmevtn < p_top_tmevtn) { 426 /* 427 * タイムイベントがない場合 428 */ 429 #ifdef USE_64BIT_HRTCNT 430 target_hrt_clear_event(); 431 #else /* USE_64BIT_HRTCNT */ 409 432 target_hrt_set_event(HRTCNT_BOUND); /*[ASPD1007]*/ 433 #endif /* USE_64BIT_HRTCNT */ 410 434 } 411 435 else if (EVTTIM_LE(top_evttim, current_evttim)) { … … 414 438 else { 415 439 hrtcnt = (HRTCNT)(top_evttim - current_evttim); 440 #ifdef USE_64BIT_HRTCNT 441 target_hrt_set_event(hrtcnt); 442 #else /* USE_64BIT_HRTCNT */ 416 443 if (hrtcnt > HRTCNT_BOUND) { 417 444 target_hrt_set_event(HRTCNT_BOUND); /*[ASPD1006]*/ … … 420 447 target_hrt_set_event(hrtcnt); /*[ASPD1002]*/ 421 448 } 449 #endif /* USE_64BIT_HRTCNT */ 422 450 } 423 451 } … … 442 470 * 443 471 */ 444 #ifdef TOPPERS_tmeenq 472 #ifdef TOPPERS_tmeenqrel 445 473 446 474 void 447 tmevtb_enqueue (TMEVTB *p_tmevtb, RELTIM time)475 tmevtb_enqueue_reltim(TMEVTB *p_tmevtb, RELTIM time) 448 476 { 449 477 /* … … 467 495 } 468 496 469 #endif /* TOPPERS_tmeenq */497 #endif /* TOPPERS_tmeenqrel */ 470 498 471 499 /* … … 502 530 503 531 bool_t 504 check_adjtim(int _t adjtim)532 check_adjtim(int32_t adjtim) 505 533 { 506 534 if (adjtim > 0) { 507 535 return(p_last_tmevtn >= p_top_tmevtn /*[NGKI3588]*/ 508 && EVTTIM_LE(top_evttim , current_evttim - TMAX_ADJTIM));536 && EVTTIM_LE(top_evttim + TMAX_ADJTIM, current_evttim)); 509 537 } 510 538 else if (adjtim < 0) { /*[NGKI3589]*/ … … 559 587 TMEVTB *p_tmevtb; 560 588 bool_t callflag; 589 #ifndef TOPPERS_OMIT_SYSLOG 590 uint_t nocall = 0; 591 #endif /* TOPPERS_OMIT_SYSLOG */ 561 592 562 593 assert(sense_context()); … … 587 618 (*(p_tmevtb->callback))(p_tmevtb->arg); 588 619 callflag = true; 620 #ifndef TOPPERS_OMIT_SYSLOG 621 nocall += 1; 622 #endif /* TOPPERS_OMIT_SYSLOG */ 589 623 } 590 624 } while (callflag); /*[ASPD1020]*/ 591 625 626 #ifndef TOPPERS_OMIT_SYSLOG 627 /* 628 * タイムイベントが処理されなかった場合. 629 */ 630 if (nocall == 0) { 631 syslog_0(LOG_NOTICE, "no time event is processed in hrt interrupt."); 632 } 633 #endif /* TOPPERS_OMIT_SYSLOG */ 634 592 635 /* 593 636 * 高分解能タイマ割込みの発生タイミングを設定する[ASPD1025]. -
EcnlProtoTool/trunk/asp3_dcre/kernel/time_event.h
r321 r429 6 6 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory 7 7 * Toyohashi Univ. of Technology, JAPAN 8 * Copyright (C) 2005-201 5by Embedded and Real-Time Systems Laboratory8 * Copyright (C) 2005-2019 by Embedded and Real-Time Systems Laboratory 9 9 * Graduate School of Information Science, Nagoya Univ., JAPAN 10 10 * … … 162 162 * の発生時刻,コールバック関数,コールバック関数へ渡す引数は, 163 163 * p_tmevtbが指すタイムイベントブロック中に設定しておく. 164 * 165 * 高分解能タイマ割込みの発生タイミングの設定を行わないため,カーネル 166 * の初期化時か,高分解能タイマ割込みの処理中で,それが必要ない場合に 167 * のみ使用する. 164 168 */ 165 169 extern void tmevtb_register(TMEVTB *p_tmevtb); … … 173 177 * ントブロック中に設定しておく. 174 178 */ 175 extern void tmevtb_enqueue (TMEVTB *p_tmevtb, RELTIM time);179 extern void tmevtb_enqueue_reltim(TMEVTB *p_tmevtb, RELTIM time); 176 180 177 181 /* … … 187 191 * ベント時刻を取得した後に呼び出すことを想定している. 188 192 */ 189 extern bool_t check_adjtim(int _t adjtim);193 extern bool_t check_adjtim(int32_t adjtim); 190 194 191 195 /* -
EcnlProtoTool/trunk/asp3_dcre/kernel/time_manage.c
r321 r429 53 53 #include "time_event.h" 54 54 #include "target_timer.h" 55 #include <sil.h> 55 56 56 57 /* … … 98 99 { 99 100 ER ercd; 101 bool_t lock; 100 102 101 103 LOG_SET_TIM_ENTER(systim); 102 CHECK_TSKCTX_UNL(); /*[NGKI3564][NGKI3565]*/ 103 104 lock_cpu(); 104 //CHECK_TSKCTX_UNL(); /*[NGKI3564][NGKI3565]*/ 105 CHECK_TSKCTX(); 106 lock = sense_lock(); 107 108 if (!lock) 109 lock_cpu(); 105 110 update_current_evttim(); /*[ASPD1059]*/ 106 111 systim_offset = systim - monotonic_evttim; /*[ASPD1060]*/ 107 112 ercd = E_OK; 108 unlock_cpu(); 113 if (!lock) 114 unlock_cpu(); 109 115 110 116 error_exit: … … 124 130 { 125 131 ER ercd; 132 bool_t lock; 126 133 127 134 LOG_GET_TIM_ENTER(p_systim); 128 CHECK_TSKCTX_UNL(); /*[NGKI2350][NGKI2351]*/ 129 130 lock_cpu(); 135 //CHECK_TSKCTX_UNL(); /*[NGKI2350][NGKI2351]*/ 136 CHECK_TSKCTX(); 137 lock = sense_lock(); 138 139 if (!lock) 140 lock_cpu(); 131 141 update_current_evttim(); /*[ASPD1057]*/ 132 142 *p_systim = systim_offset + monotonic_evttim; /*[ASPD1058]*/ 133 143 ercd = E_OK; 134 unlock_cpu(); 144 if (!lock) 145 unlock_cpu(); 135 146 136 147 error_exit: … … 176 187 } 177 188 178 set_hrt_event(); /*[ASPD1056]*/ 189 if (!in_signal_time) { 190 set_hrt_event(); /*[ASPD1056]*/ 191 } 179 192 ercd = E_OK; 180 193 } -
EcnlProtoTool/trunk/asp3_dcre/kernel/wait.c
r321 r429 6 6 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory 7 7 * Toyohashi Univ. of Technology, JAPAN 8 * Copyright (C) 2005-201 5by Embedded and Real-Time Systems Laboratory8 * Copyright (C) 2005-2018 by Embedded and Real-Time Systems Laboratory 9 9 * Graduate School of Information Science, Nagoya Univ., JAPAN 10 10 * … … 54 54 55 55 void 56 make_wait_tmout( WINFO *p_winfo, TMEVTB *p_tmevtb, TMO tmout)56 make_wait_tmout(uint_t tstat, WINFO *p_winfo, TMEVTB *p_tmevtb, TMO tmout) 57 57 { 58 p_runtsk->tstat = tstat; 58 59 make_non_runnable(p_runtsk); 59 60 p_runtsk->p_winfo = p_winfo; … … 66 67 p_tmevtb->callback = (CBACK) wait_tmout; 67 68 p_tmevtb->arg = (void *) p_runtsk; 68 tmevtb_enqueue (p_tmevtb, (RELTIM) tmout);69 tmevtb_enqueue_reltim(p_tmevtb, (RELTIM) tmout); 69 70 } 70 71 } … … 99 100 make_non_wait(p_tcb); 100 101 if (p_runtsk != p_schedtsk) { 101 request_dispatch ();102 request_dispatch_retint(); 102 103 } 103 104 … … 119 120 make_non_wait(p_tcb); 120 121 if (p_runtsk != p_schedtsk) { 121 request_dispatch ();122 request_dispatch_retint(); 122 123 } 123 124 … … 155 156 156 157 void 157 wobj_make_wait(WOBJCB *p_wobjcb, WINFO_WOBJ *p_winfo_wobj)158 wobj_make_wait(WOBJCB *p_wobjcb, uint_t tstat, WINFO_WOBJ *p_winfo_wobj) 158 159 { 159 make_wait( &(p_winfo_wobj->winfo));160 make_wait(tstat, &(p_winfo_wobj->winfo)); 160 161 wobj_queue_insert(p_wobjcb); 161 162 p_winfo_wobj->p_wobjcb = p_wobjcb; … … 167 168 168 169 void 169 wobj_make_wait_tmout(WOBJCB *p_wobjcb, WINFO_WOBJ *p_winfo_wobj,170 170 wobj_make_wait_tmout(WOBJCB *p_wobjcb, uint_t tstat, 171 WINFO_WOBJ *p_winfo_wobj, TMEVTB *p_tmevtb, TMO tmout) 171 172 { 172 make_wait_tmout( &(p_winfo_wobj->winfo), p_tmevtb, tmout);173 make_wait_tmout(tstat, &(p_winfo_wobj->winfo), p_tmevtb, tmout); 173 174 wobj_queue_insert(p_wobjcb); 174 175 p_winfo_wobj->p_wobjcb = p_wobjcb; -
EcnlProtoTool/trunk/asp3_dcre/kernel/wait.h
r321 r429 6 6 * Copyright (C) 2000 by Embedded and Real-Time Systems Laboratory 7 7 * Toyohashi Univ. of Technology, JAPAN 8 * Copyright (C) 2005-201 4by Embedded and Real-Time Systems Laboratory8 * Copyright (C) 2005-2018 by Embedded and Real-Time Systems Laboratory 9 9 * Graduate School of Information Science, Nagoya Univ., JAPAN 10 10 * … … 77 77 * 待ち状態への遷移 78 78 * 79 * 実行中のタスクを待ち状態に遷移させる.具体的には,実行中のタスクを 80 * レディキューから削除し,TCBのp_winfoフィールド,WINFOのp_tmevtbフィー 81 * ルドを設定する. 82 */ 83 Inline void 84 make_wait(WINFO *p_winfo) 85 { 79 * 実行中のタスクを待ち状態に遷移させる.具体的には,実行中のタスクの 80 * タスク状態をtstatにしてレディキューから削除し,TCBのp_winfoフィー 81 * ルド,WINFOのp_tmevtbフィールドを設定する. 82 */ 83 Inline void 84 make_wait(uint_t tstat, WINFO *p_winfo) 85 { 86 p_runtsk->tstat = tstat; 86 87 make_non_runnable(p_runtsk); 87 88 p_runtsk->p_winfo = p_winfo; … … 93 94 * 94 95 * 実行中のタスクを,タイムアウト指定付きで待ち状態に遷移させる.具体 95 * 的には,実行中のタスクをレディキューから削除し,TCBのp_winfoフィー 96 * ルド,WINFOのp_tmevtbフィールドを設定する.また,タイムイベントブ 97 * ロックを登録する. 98 */ 99 extern void make_wait_tmout(WINFO *p_winfo, TMEVTB *p_tmevtb, TMO tmout); 96 * 的には,実行中のタスクのタスク状態をtstatにしてレディキューから削 97 * 除し,TCBのp_winfoフィールド,WINFOのp_tmevtbフィールドを設定する. 98 * また,タイムイベントブロックを登録する. 99 */ 100 extern void make_wait_tmout(uint_t tstat, WINFO *p_winfo, 101 TMEVTB *p_tmevtb, TMO tmout); 100 102 101 103 /* … … 246 248 * wobj_make_wait_tmoutは,タイムイベントブロックの登録も行う. 247 249 */ 248 extern void wobj_make_wait(WOBJCB *p_wobjcb, WINFO_WOBJ *p_winfo); 249 extern void wobj_make_wait_tmout(WOBJCB *p_wobjcb, WINFO_WOBJ *p_winfo, 250 TMEVTB *p_tmevtb, TMO tmout); 250 extern void wobj_make_wait(WOBJCB *p_wobjcb, uint_t tstat, 251 WINFO_WOBJ *p_winfo_wobj); 252 extern void wobj_make_wait_tmout(WOBJCB *p_wobjcb, uint_t tstat, 253 WINFO_WOBJ *p_winfo_wobj, TMEVTB *p_tmevtb, TMO tmout); 251 254 252 255 /* -
EcnlProtoTool/trunk/asp3_dcre/library/log_output.c
r321 r429 5 5 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory 6 6 * Toyohashi Univ. of Technology, JAPAN 7 * Copyright (C) 2004-201 4by Embedded and Real-Time Systems Laboratory7 * Copyright (C) 2004-2018 by Embedded and Real-Time Systems Laboratory 8 8 * Graduate School of Information Science, Nagoya Univ., JAPAN 9 9 * … … 174 174 syslog_printf((const char *)(p_syslog->logpar[0]), 175 175 &(p_syslog->logpar[1]), putc); 176 (*putc)('\n'); 176 177 break; 177 178 case LOG_TYPE_ASSERT: 178 179 syslog_printf("%s:%u: Assertion `%s' failed.", 179 180 &(p_syslog->logpar[0]), putc); 181 (*putc)('\n'); 180 182 break; 181 183 default: -
EcnlProtoTool/trunk/asp3_dcre/library/t_perror.c
r321 r429 5 5 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory 6 6 * Toyohashi Univ. of Technology, JAPAN 7 * Copyright (C) 2004-20 06by Embedded and Real-Time Systems Laboratory7 * Copyright (C) 2004-2018 by Embedded and Real-Time Systems Laboratory 8 8 * Graduate School of Information Science, Nagoya Univ., JAPAN 9 9 * … … 48 48 #include <t_stdlib.h> 49 49 50 #ifndef TOPPERS_OMIT_SYSLOG 51 52 static const char message[] = "%s (%d) reported by `%s' in line %d of `%s'."; 53 50 54 void 51 t_perror(uint_t prio, const char *file, int_t line, const char *expr, ER ercd) 55 tt_perror(SYSLOG *p_logbuf, const char *file, int_t line, 56 const char *expr, ER ercd) 52 57 { 53 syslog_5(prio, "%s (%d) reported by `%s' in line %d of `%s'.", 54 itron_strerror(ercd), SERCD(ercd), expr, line, file); 58 p_logbuf->logtype = LOG_TYPE_COMMENT; 59 p_logbuf->logpar[0] = (LOGPAR) message; 60 p_logbuf->logpar[1] = (LOGPAR) itron_strerror(ercd); 61 p_logbuf->logpar[2] = (LOGPAR) SERCD(ercd); 62 p_logbuf->logpar[3] = (LOGPAR) expr; 63 p_logbuf->logpar[4] = (LOGPAR) line; 64 p_logbuf->logpar[5] = (LOGPAR) file; 65 } 55 66 56 } 67 #endif /* TOPPERS_OMIT_SYSLOG */ -
EcnlProtoTool/trunk/asp3_dcre/library/vasyslog.c
r321 r429 5 5 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory 6 6 * Toyohashi Univ. of Technology, JAPAN 7 * Copyright (C) 2004-201 4by Embedded and Real-Time Systems Laboratory7 * Copyright (C) 2004-2018 by Embedded and Real-Time Systems Laboratory 8 8 * Graduate School of Information Science, Nagoya Univ., JAPAN 9 9 * … … 51 51 52 52 void 53 vsyslog(uint_t prio, const char *format, va_list ap)53 tt_syslog(SYSLOG *p_logbuf, const char *format, va_list ap) 54 54 { 55 SYSLOG logbuf;56 55 uint_t i; 57 56 char sz; 58 57 char c; 59 58 60 logbuf.logtype = LOG_TYPE_COMMENT;61 logbuf.logpar[0] = (LOGPAR) format;59 p_logbuf->logtype = LOG_TYPE_COMMENT; 60 p_logbuf->logpar[0] = (LOGPAR) format; 62 61 i = 1U; 63 62 … … 78 77 switch (c) { 79 78 case 'd': 80 logbuf.logpar[i++] = (sz == 'l') ? (LOGPAR) va_arg(ap, long_t)81 82 83 79 p_logbuf->logpar[i++] = (sz == 'l') ? (LOGPAR) va_arg(ap, long_t) 80 : (sz == 't') ? (LOGPAR) va_arg(ap, int32_t) 81 : (sz == 'T') ? (LOGPAR) va_arg(ap, SYSTIM) 82 : (LOGPAR) va_arg(ap, int_t); 84 83 break; 85 84 case 'u': 86 85 case 'x': 87 86 case 'X': 88 logbuf.logpar[i++] = (sz == 'l') ? (LOGPAR) va_arg(ap, ulong_t)89 90 91 87 p_logbuf->logpar[i++] = (sz == 'l') ? (LOGPAR) va_arg(ap, ulong_t) 88 : (sz == 't') ? (LOGPAR) va_arg(ap, uint32_t) 89 : (sz == 'T') ? (LOGPAR) va_arg(ap, SYSTIM) 90 : (LOGPAR) va_arg(ap, uint_t); 92 91 break; 93 92 case 'p': 94 logbuf.logpar[i++] = (LOGPAR) va_arg(ap, void *);93 p_logbuf->logpar[i++] = (LOGPAR) va_arg(ap, void *); 95 94 break; 96 95 case 'c': 97 logbuf.logpar[i++] = (LOGPAR) va_arg(ap, int);96 p_logbuf->logpar[i++] = (LOGPAR) va_arg(ap, int); 98 97 break; 99 98 case 's': 100 logbuf.logpar[i++] = (LOGPAR) va_arg(ap, const char *);99 p_logbuf->logpar[i++] = (LOGPAR) va_arg(ap, const char *); 101 100 break; 102 101 case '\0': … … 107 106 } 108 107 } 109 (void) tSysLog_eSysLog_write(prio, &logbuf);110 }111 112 void113 syslog(uint_t prio, const char *format, ...)114 {115 va_list ap;116 va_start(ap, format);117 vsyslog(prio, format, ap);118 va_end(ap);119 }120 121 /* mbed weak error function */122 void123 error(const char* format, ...) {124 va_list arg;125 va_start(arg, format);126 vsyslog(LOG_ERROR, format, arg);127 va_end(arg);128 ext_ker();129 108 } 130 109 -
EcnlProtoTool/trunk/asp3_dcre/mbed/Makefile.mbed
r321 r429 14 14 # 15 15 INCLUDES := $(INCLUDES)\ 16 -I$(MBEDDIR)/api\ 16 -I$(MBEDDIR)\ 17 -I$(MBEDDIR)/cmsis\ 18 -I$(MBEDDIR)/cmsis/TARGET_CORTEX_A\ 17 19 -I$(MBEDDIR)/hal\ 18 -I$(MBEDDIR)/targets/cmsis\ 19 -I$(MBEDDIR)/targets/cmsis/TARGET_RENESAS/TARGET_RZ_A1H\ 20 -I$(MBEDDIR)/targets/cmsis/TARGET_RENESAS/TARGET_RZ_A1H/inc\ 21 -I$(MBEDDIR)/targets/cmsis/TARGET_RENESAS/TARGET_RZ_A1H/inc/iodefines\ 22 -I$(MBEDDIR)/targets/hal/TARGET_RENESAS/TARGET_RZ_A1H\ 23 -I$(MBEDDIR)/targets/hal/TARGET_RENESAS/TARGET_RZ_A1H/TARGET_MBED_MBRZA1H 20 -I$(MBEDDIR)/platform\ 21 -I$(MBEDDIR)/targets/TARGET_RENESAS\ 22 -I$(MBEDDIR)/targets/TARGET_RENESAS/TARGET_RZA1XX\ 23 -I$(MBEDDIR)/targets/TARGET_RENESAS/TARGET_RZA1XX/TARGET_RZ_A1H\ 24 -I$(MBEDDIR)/targets/TARGET_RENESAS/TARGET_RZA1XX/TARGET_RZ_A1H/TARGET_MBED_MBRZA1H\ 25 -I$(MBEDDIR)/targets/TARGET_RENESAS/TARGET_RZA1XX/TARGET_RZ_A1H/device\ 26 -I$(MBEDDIR)/targets/TARGET_RENESAS/TARGET_RZA1XX/TARGET_RZ_A1H/device/inc\ 27 -I$(MBEDDIR)/targets/TARGET_RENESAS/TARGET_RZA1XX/TARGET_RZ_A1H/device/inc/iobitmasks\ 28 -I$(MBEDDIR)/targets/TARGET_RENESAS/TARGET_RZA1XX/TARGET_RZ_A1H/device/inc/iodefines\ 29 -I$(MBEDDIR)/targets/TARGET_RENESAS/TARGET_RZA1XX/common\ 30 -I$(MBEDDIR)/rtos/TARGET_CORTEX 24 31 COPTS := $(COPTS)\ 25 32 -mthumb\ … … 39 46 -mno-unaligned-access 40 47 CDEFS := $(CDEFS)\ 41 -DTARGET_RZ_A1H\ 42 -DTARGET_MBRZA1H\ 43 -DTOOLCHAIN_GCC_ARM\ 44 -DTOOLCHAIN_GCC\ 45 -DTARGET_CORTEX_A\ 46 -DMBED_BUILD_TIMESTAMP=1460441486.52\ 47 -DTARGET_RENESAS\ 48 -D__FPU_PRESENT 48 -DARM_MATH_CA9 \ 49 -DDEVICE_ANALOGIN=1 \ 50 -DDEVICE_CAN=1 \ 51 -DDEVICE_EMAC=1 \ 52 -DDEVICE_ETHERNET=1 \ 53 -DDEVICE_FLASH=1 \ 54 -DDEVICE_I2C=1 \ 55 -DDEVICE_I2CSLAVE=1 \ 56 -DDEVICE_I2C_ASYNCH=1 \ 57 -DDEVICE_INTERRUPTIN=1 \ 58 -DDEVICE_LPTICKER=1 \ 59 -DDEVICE_PORTIN=1 \ 60 -DDEVICE_PORTINOUT=1 \ 61 -DDEVICE_PORTOUT=1 \ 62 -DDEVICE_PWMOUT=1 \ 63 -DDEVICE_RTC=1 \ 64 -DDEVICE_SEMIHOST=1 \ 65 -DDEVICE_SERIAL=1 \ 66 -DDEVICE_SERIAL_ASYNCH=1 \ 67 -DDEVICE_SERIAL_FC=1 \ 68 -DDEVICE_SLEEP=1 \ 69 -DDEVICE_SPI=1 \ 70 -DDEVICE_SPISLAVE=1 \ 71 -DDEVICE_SPI_ASYNCH=1 \ 72 -DDEVICE_STDIO_MESSAGES=1 \ 73 -DDEVICE_USTICKER=1 \ 74 -DMBED_BUILD_TIMESTAMP=1550103323.92 \ 75 -DTARGET_A9 \ 76 -DTARGET_CORTEX \ 77 -DTARGET_CORTEX_A \ 78 -DTARGET_FF_ARDUINO \ 79 -DTARGET_LIKE_CORTEX_A9 \ 80 -DTARGET_LIKE_MBED \ 81 -DTARGET_MBRZA1H \ 82 -DTARGET_RELEASE \ 83 -DTARGET_RENESAS \ 84 -DTARGET_RZA1H \ 85 -DTARGET_RZ_A1H \ 86 -DTARGET_RZ_A1XX \ 87 -DTARGET_RZ_A1_EMAC \ 88 -DTOOLCHAIN_GCC \ 89 -DTOOLCHAIN_GCC_ARM \ 90 -DTOOLCHAIN_object \ 91 -D__CMSIS_RTOS \ 92 -D__CORTEX_A9 \ 93 -D__EVAL \ 94 -D__FPU_PRESENT=1 \ 95 -D__MBED_CMSIS_RTOS_CA9 \ 96 -D__MBED__=1 \ 97 -DIRQ_GIC_LINE_COUNT=587 \ 98 #-DDEVICE_STDIO_MESSAGES=1 49 99 50 100 # … … 52 102 # 53 103 SYSSVC_DIRS := $(SYSSVC_DIRS)\ 54 $(MBEDDIR)/common\ 55 $(MBEDDIR)/targets/cmsis/TARGET_RENESAS/TARGET_RZ_A1H\ 56 $(MBEDDIR)/targets/cmsis/TARGET_RENESAS/TARGET_RZ_A1H/TOOLCHAIN_GCC_ARM\ 57 $(MBEDDIR)/targets/cmsis/TOOLCHAIN_GCC/TARGET_CORTEX_A\ 58 $(MBEDDIR)/targets/hal/TARGET_RENESAS/TARGET_RZ_A1H 59 SYSSVC_ASMOBJS := $(SYSSVC_ASMOBJS)\ 60 cache.o 61 START_OBJS = startup_RZ1AH.o 104 $(MBEDDIR)\ 105 $(MBEDDIR)/hal\ 106 $(MBEDDIR)/platform\ 107 $(MBEDDIR)/cmsis/TARGET_CORTEX_A\ 108 $(MBEDDIR)/targets/TARGET_RENESAS\ 109 $(MBEDDIR)/targets/TARGET_RENESAS/TARGET_RZA1XX\ 110 $(MBEDDIR)/targets/TARGET_RENESAS/TARGET_RZA1XX/TARGET_RZ_A1H\ 111 $(MBEDDIR)/targets/TARGET_RENESAS/TARGET_RZA1XX/TARGET_RZ_A1H/TARGET_MBED_MBRZA1H\ 112 $(MBEDDIR)/targets/TARGET_RENESAS/TARGET_RZA1XX/TARGET_RZ_A1H/device\ 113 $(MBEDDIR)/targets/TARGET_RENESAS/TARGET_RZA1XX/TARGET_RZ_A1H/device/TOOLCHAIN_GCC_ARM\ 114 $(MBEDDIR)/targets/TARGET_RENESAS/TARGET_RZA1XX/common 115 SYSSVC_ASMOBJS := $(SYSSVC_ASMOBJS) 116 START_OBJS := startup_RZ1AH.o 117 START_OBJS := $(addprefix $(OBJDIR)/, $(START_OBJS)) 62 118 SYSSVC_COBJS := $(SYSSVC_COBJS)\ 63 assert.o board.o gpio.o lp_ticker_api.o mbed_interface.o\ 64 pinmap_common.o rtc_time.o semihost_api.o ticker_api.o us_ticker_api.o\ 65 RZ_A1_Init.o cmsis_nvic.o gic.o mbed_sf_boot.o mmu_Renesas_RZ_A1.o\ 66 nvic_wrapper.o pl310.o rza_io_regrw.o system_MBRZA1H.o\ 67 analogin_api.o can_api.o ethernet_api.o gpio_api.o gpio_irq_api.o i2c_api.o\ 68 pinmap.o port_api.o pwmout_api.o rtc_api.o serial_api.o spi_api.o 69 #wait_api.o us_ticker.o 70 CFG_DMY := cfg_dmy.o mmu_Renesas_RZ_A1.o mbed_sf_boot.o RZ_A1_Init.o system_MBRZA1H.o cache.o pl310.o gic.o 119 mbed_critical_section_api.o mbed_flash_api.o mbed_gpio.o mbed_lp_ticker_api.o\ 120 mbed_lp_ticker_wrapper.o mbed_pinmap_common.o mbed_sleep_manager.o mbed_mktime.o\ 121 mbed_ticker_api.o mbed_us_ticker_api.o mbed_assert.o mbed_board.o\ 122 mbed_critical.o mbed_error.o mbed_error_hist.o mbed_interface.o\ 123 mbed_rtc_time.o mbed_semihost_api.o mbed_stats.o\ 124 PeripheralPins.o RZ_A1_Init.o mbed_sf_boot.o mmu_RZ_A1H.o\ 125 system_RZ_A1H.o trng_api_esp32.o analogin_api.o can_api.o cmsis_nvic.o\ 126 irq_ctrl_gic.o nvic_wrapper.o rza_io_regrw.o ethernet_api.o flash_api.o\ 127 gpio_api.o gpio_irq_api.o i2c_api.o lp_ticker.o mtu2.o pinmap.o port_api.o\ 128 pwmout_api.o rtc_api.o serial_api.o sleep.o spi_api.o trng_api.o us_ticker.o 129 #mbed_wait_api_no_rtos.o 130 CFG_DMY := cfg_dmy.o mmu_RZ_A1H.o mbed_sf_boot.o RZ_A1_Init.o system_RZ_A1H.o irq_ctrl_gic.o 71 131 -
EcnlProtoTool/trunk/asp3_dcre/mbed/hal/analogin_api.h
r321 r429 1 2 /** \addtogroup hal */ 3 /** @{*/ 1 4 /* mbed Microcontroller Library 2 5 * Copyright (c) 2006-2013 ARM Limited … … 25 28 #endif 26 29 30 /** Analogin hal structure. analogin_s is declared in the target's hal 31 */ 27 32 typedef struct analogin_s analogin_t; 28 33 29 void analogin_init (analogin_t *obj, PinName pin); 30 float analogin_read (analogin_t *obj); 34 /** 35 * \defgroup hal_analogin Analogin hal functions 36 * @{ 37 */ 38 39 /** Initialize the analogin peripheral 40 * 41 * Configures the pin used by analogin. 42 * @param obj The analogin object to initialize 43 * @param pin The analogin pin name 44 */ 45 void analogin_init(analogin_t *obj, PinName pin); 46 47 /** Read the input voltage, represented as a float in the range [0.0, 1.0] 48 * 49 * @param obj The analogin object 50 * @return A floating value representing the current input voltage 51 */ 52 float analogin_read(analogin_t *obj); 53 54 /** Read the value from analogin pin, represented as an unsigned 16bit value 55 * 56 * @param obj The analogin object 57 * @return An unsigned 16bit value representing the current input voltage 58 */ 31 59 uint16_t analogin_read_u16(analogin_t *obj); 60 61 /**@}*/ 32 62 33 63 #ifdef __cplusplus … … 38 68 39 69 #endif 70 71 /** @}*/ -
EcnlProtoTool/trunk/asp3_dcre/mbed/hal/analogout_api.h
r321 r429 1 2 /** \addtogroup hal */ 3 /** @{*/ 1 4 /* mbed Microcontroller Library 2 5 * Copyright (c) 2006-2013 ARM Limited … … 25 28 #endif 26 29 30 /** Analogout hal structure. dac_s is declared in the target's hal 31 */ 27 32 typedef struct dac_s dac_t; 28 33 29 void analogout_init (dac_t *obj, PinName pin); 30 void analogout_free (dac_t *obj); 31 void analogout_write (dac_t *obj, float value); 32 void analogout_write_u16(dac_t *obj, uint16_t value); 33 float analogout_read (dac_t *obj); 34 uint16_t analogout_read_u16 (dac_t *obj); 34 /** 35 * \defgroup hal_analogout Analogout hal functions 36 * @{ 37 */ 38 39 /** Initialize the analogout peripheral 40 * 41 * Configures the pin used by analogout. 42 * @param obj The analogout object to initialize 43 * @param pin The analogout pin name 44 */ 45 void analogout_init(dac_t *obj, PinName pin); 46 47 /** Release the analogout object 48 * 49 * Note: This is not currently used in the mbed-drivers 50 * @param obj The analogout object 51 */ 52 void analogout_free(dac_t *obj); 53 54 /** Set the output voltage, specified as a percentage (float) 55 * 56 * @param obj The analogin object 57 * @param value The floating-point output voltage to be set 58 */ 59 void analogout_write(dac_t *obj, float value); 60 61 /** Set the output voltage, specified as unsigned 16-bit 62 * 63 * @param obj The analogin object 64 * @param value The unsigned 16-bit output voltage to be set 65 */ 66 void analogout_write_u16(dac_t *obj, uint16_t value); 67 68 /** Read the current voltage value on the pin 69 * 70 * @param obj The analogin object 71 * @return A floating-point value representing the current voltage on the pin, 72 * measured as a percentage 73 */ 74 float analogout_read(dac_t *obj); 75 76 /** Read the current voltage value on the pin, as a normalized unsigned 16bit value 77 * 78 * @param obj The analogin object 79 * @return An unsigned 16-bit value representing the current voltage on the pin 80 */ 81 uint16_t analogout_read_u16(dac_t *obj); 82 83 /**@}*/ 35 84 36 85 #ifdef __cplusplus … … 41 90 42 91 #endif 92 93 /** @}*/ -
EcnlProtoTool/trunk/asp3_dcre/mbed/hal/buffer.h
r321 r429 1 2 /** \addtogroup hal */ 3 /** @{*/ 1 4 /* mbed Microcontroller Library 2 5 * Copyright (c) 2014-2015 ARM Limited … … 29 32 30 33 #endif 34 35 /** @}*/ -
EcnlProtoTool/trunk/asp3_dcre/mbed/hal/can_api.h
r321 r429 1 2 /** \addtogroup hal */ 3 /** @{*/ 1 4 /* mbed Microcontroller Library 2 * Copyright (c) 2006-201 3ARM Limited5 * Copyright (c) 2006-2016 ARM Limited 3 6 * 4 7 * Licensed under the Apache License, Version 2.0 (the "License"); … … 23 26 #include "PinNames.h" 24 27 #include "PeripheralNames.h" 25 #include " can_helper.h"28 #include "hal/can_helper.h" 26 29 27 30 #ifdef __cplusplus … … 56 59 57 60 void can_init (can_t *obj, PinName rd, PinName td); 61 void can_init_freq(can_t *obj, PinName rd, PinName td, int hz); 58 62 void can_free (can_t *obj); 59 63 int can_frequency(can_t *obj, int hz); … … 79 83 80 84 #endif 85 86 /** @}*/ -
EcnlProtoTool/trunk/asp3_dcre/mbed/hal/dma_api.h
r321 r429 1 2 /** \addtogroup hal */ 3 /** @{*/ 1 4 /* mbed Microcontroller Library 2 5 * Copyright (c) 2014-2015 ARM Limited … … 44 47 45 48 #endif 49 50 /** @}*/ -
EcnlProtoTool/trunk/asp3_dcre/mbed/hal/ethernet_api.h
r321 r429 1 2 /** \addtogroup hal */ 3 /** @{*/ 1 4 /* mbed Microcontroller Library 2 5 * Copyright (c) 2006-2013 ARM Limited … … 42 45 int ethernet_send(void); 43 46 44 // rec ieve from ethernet buffer, returning packet size, or 0 if no packet47 // receive from ethernet buffer, returning packet size, or 0 if no packet 45 48 int ethernet_receive(void); 46 49 … … 66 69 #endif 67 70 71 72 /** @}*/ -
EcnlProtoTool/trunk/asp3_dcre/mbed/hal/gpio_api.h
r321 r429 1 2 /** \addtogroup hal */ 3 /** @{*/ 1 4 /* mbed Microcontroller Library 2 5 * Copyright (c) 2006-2013 ARM Limited … … 17 20 #define MBED_GPIO_API_H 18 21 22 #include <stdint.h> 19 23 #include "device.h" 20 24 … … 23 27 #endif 24 28 25 /* Set the given pin as GPIO 29 /** 30 * \defgroup hal_gpio GPIO HAL functions 31 * @{ 32 */ 33 34 /** Set the given pin as GPIO 35 * 26 36 * @param pin The pin to be set as GPIO 27 37 * @return The GPIO port mask for this pin 28 38 **/ 29 39 uint32_t gpio_set(PinName pin); 30 31 40 /* Checks if gpio object is connected (pin was not initialized with NC) 32 41 * @param pin The pin to be set as GPIO … … 35 44 int gpio_is_connected(const gpio_t *obj); 36 45 37 /* GPIO object */ 46 /** Initialize the GPIO pin 47 * 48 * @param obj The GPIO object to initialize 49 * @param pin The GPIO pin to initialize 50 */ 38 51 void gpio_init(gpio_t *obj, PinName pin); 39 52 40 void gpio_mode (gpio_t *obj, PinMode mode); 41 void gpio_dir (gpio_t *obj, PinDirection direction); 53 /** Set the input pin mode 54 * 55 * @param obj The GPIO object 56 * @param mode The pin mode to be set 57 */ 58 void gpio_mode(gpio_t *obj, PinMode mode); 42 59 60 /** Set the pin direction 61 * 62 * @param obj The GPIO object 63 * @param direction The pin direction to be set 64 */ 65 void gpio_dir(gpio_t *obj, PinDirection direction); 66 67 /** Set the output value 68 * 69 * @param obj The GPIO object 70 * @param value The value to be set 71 */ 43 72 void gpio_write(gpio_t *obj, int value); 44 int gpio_read (gpio_t *obj);45 73 46 // the following set of functions are generic and are implemented in the common gpio.c file 74 /** Read the input value 75 * 76 * @param obj The GPIO object 77 * @return An integer value 1 or 0 78 */ 79 int gpio_read(gpio_t *obj); 80 81 // the following functions are generic and implemented in the common gpio.c file 82 // TODO: fix, will be moved to the common gpio header file 83 84 /** Init the input pin and set mode to PullDefault 85 * 86 * @param gpio The GPIO object 87 * @param pin The pin name 88 */ 47 89 void gpio_init_in(gpio_t* gpio, PinName pin); 90 91 /** Init the input pin and set the mode 92 * 93 * @param gpio The GPIO object 94 * @param pin The pin name 95 * @param mode The pin mode to be set 96 */ 48 97 void gpio_init_in_ex(gpio_t* gpio, PinName pin, PinMode mode); 98 99 /** Init the output pin as an output, with predefined output value 0 100 * 101 * @param gpio The GPIO object 102 * @param pin The pin name 103 * @return An integer value 1 or 0 104 */ 49 105 void gpio_init_out(gpio_t* gpio, PinName pin); 106 107 /** Init the pin as an output and set the output value 108 * 109 * @param gpio The GPIO object 110 * @param pin The pin name 111 * @param value The value to be set 112 */ 50 113 void gpio_init_out_ex(gpio_t* gpio, PinName pin, int value); 114 115 /** Init the pin to be in/out 116 * 117 * @param gpio The GPIO object 118 * @param pin The pin name 119 * @param direction The pin direction to be set 120 * @param mode The pin mode to be set 121 * @param value The value to be set for an output pin 122 */ 51 123 void gpio_init_inout(gpio_t* gpio, PinName pin, PinDirection direction, PinMode mode, int value); 124 125 /**@}*/ 52 126 53 127 #ifdef __cplusplus … … 56 130 57 131 #endif 132 133 /** @}*/ -
EcnlProtoTool/trunk/asp3_dcre/mbed/hal/gpio_irq_api.h
r321 r429 1 2 /** \addtogroup hal */ 3 /** @{*/ 1 4 /* mbed Microcontroller Library 2 5 * Copyright (c) 2006-2013 ARM Limited … … 25 28 #endif 26 29 30 /** GPIO IRQ events 31 */ 27 32 typedef enum { 28 33 IRQ_NONE, … … 31 36 } gpio_irq_event; 32 37 38 /** GPIO IRQ HAL structure. gpio_irq_s is declared in the target's HAL 39 */ 33 40 typedef struct gpio_irq_s gpio_irq_t; 34 41 35 42 typedef void (*gpio_irq_handler)(uint32_t id, gpio_irq_event event); 36 43 37 int gpio_irq_init(gpio_irq_t *obj, PinName pin, gpio_irq_handler handler, uint32_t id); 44 /** 45 * \defgroup hal_gpioirq GPIO IRQ HAL functions 46 * @{ 47 */ 48 49 /** Initialize the GPIO IRQ pin 50 * 51 * @param obj The GPIO object to initialize 52 * @param pin The GPIO pin name 53 * @param handler The handler to be attached to GPIO IRQ 54 * @param id The object ID (id != 0, 0 is reserved) 55 * @return -1 if pin is NC, 0 otherwise 56 */ 57 int gpio_irq_init(gpio_irq_t *obj, PinName pin, gpio_irq_handler handler, uint32_t id); 58 59 /** Release the GPIO IRQ PIN 60 * 61 * @param obj The gpio object 62 */ 38 63 void gpio_irq_free(gpio_irq_t *obj); 39 void gpio_irq_set (gpio_irq_t *obj, gpio_irq_event event, uint32_t enable); 64 65 /** Enable/disable pin IRQ event 66 * 67 * @param obj The GPIO object 68 * @param event The GPIO IRQ event 69 * @param enable The enable flag 70 */ 71 void gpio_irq_set(gpio_irq_t *obj, gpio_irq_event event, uint32_t enable); 72 73 /** Enable GPIO IRQ 74 * 75 * This is target dependent, as it might enable the entire port or just a pin 76 * @param obj The GPIO object 77 */ 40 78 void gpio_irq_enable(gpio_irq_t *obj); 79 80 /** Disable GPIO IRQ 81 * 82 * This is target dependent, as it might disable the entire port or just a pin 83 * @param obj The GPIO object 84 */ 41 85 void gpio_irq_disable(gpio_irq_t *obj); 86 87 /**@}*/ 42 88 43 89 #ifdef __cplusplus … … 48 94 49 95 #endif 96 97 /** @}*/ -
EcnlProtoTool/trunk/asp3_dcre/mbed/hal/i2c_api.h
r321 r429 1 2 /** \addtogroup hal */ 3 /** @{*/ 1 4 /* mbed Microcontroller Library 2 5 * Copyright (c) 2006-2015 ARM Limited … … 18 21 19 22 #include "device.h" 20 #include "buffer.h" 23 #include "hal/buffer.h" 24 25 #if DEVICE_I2C_ASYNCH 26 #include "hal/dma_api.h" 27 #endif 21 28 22 29 #if DEVICE_I2C 23 30 24 31 /** 25 * @defgroup I2CEvents I2C Events Macros32 * @defgroup hal_I2CEvents I2C Events Macros 26 33 * 27 34 * @{ … … 36 43 37 44 #if DEVICE_I2C_ASYNCH 38 /** Asynch i2c halstructure45 /** Asynch I2C HAL structure 39 46 */ 40 47 typedef struct { 41 struct i2c_s i2c; /**< Target specific i2cstructure */48 struct i2c_s i2c; /**< Target specific I2C structure */ 42 49 struct buffer_s tx_buff; /**< Tx buffer */ 43 50 struct buffer_s rx_buff; /**< Rx buffer */ … … 45 52 46 53 #else 47 /** Non-asynch i2c halstructure54 /** Non-asynch I2C HAL structure 48 55 */ 49 56 typedef struct i2c_s i2c_t; … … 61 68 62 69 /** 63 * \defgroup GeneralI2C I2C Configuration Functions70 * \defgroup hal_GeneralI2C I2C Configuration Functions 64 71 * @{ 65 72 */ 66 73 67 74 /** Initialize the I2C peripheral. It sets the default parameters for I2C 68 * peripheral, and configure its specifieds pins. 69 * @param obj The i2c object 75 * peripheral, and configures its specifieds pins. 76 * 77 * @param obj The I2C object 70 78 * @param sda The sda pin 71 79 * @param scl The scl pin … … 73 81 void i2c_init(i2c_t *obj, PinName sda, PinName scl); 74 82 75 /** Configure the I2C frequency. 76 * @param obj The i2c object 83 /** Configure the I2C frequency 84 * 85 * @param obj The I2C object 77 86 * @param hz Frequency in Hz 78 87 */ 79 88 void i2c_frequency(i2c_t *obj, int hz); 80 89 81 /** Send START command. 82 * @param obj The i2c object 90 /** Send START command 91 * 92 * @param obj The I2C object 83 93 */ 84 94 int i2c_start(i2c_t *obj); 85 95 86 /** Send STOP command. 87 * @param obj The i2c object 96 /** Send STOP command 97 * 98 * @param obj The I2C object 88 99 */ 89 100 int i2c_stop(i2c_t *obj); 90 101 91 /** Blocking reading data. 92 * @param obj The i2c object 102 /** Blocking reading data 103 * 104 * @param obj The I2C object 93 105 * @param address 7-bit address (last bit is 1) 94 106 * @param data The buffer for receiving … … 97 109 * @return Number of read bytes 98 110 */ 99 int i2c_read(i2c_t *obj, int address, char *data, int length, int stop); 100 101 /** Blocking sending data. 102 * @param obj The i2c object 111 int i2c_read(i2c_t *obj, int address, char *data, int length, int stop); 112 113 /** Blocking sending data 114 * 115 * @param obj The I2C object 103 116 * @param address 7-bit address (last bit is 0) 104 117 * @param data The buffer for sending 105 * @param length Number of bytes to wr te118 * @param length Number of bytes to write 106 119 * @param stop Stop to be generated after the transfer is done 107 * @return Number of written bytes 108 */ 109 int i2c_write(i2c_t *obj, int address, const char *data, int length, int stop); 110 111 /** Reset I2C peripheral. TODO: The action here. Most of the implementation sends stop(). 112 * @param obj The i2c object 120 * @return 121 * zero or non-zero - Number of written bytes 122 * negative - I2C_ERROR_XXX status 123 */ 124 int i2c_write(i2c_t *obj, int address, const char *data, int length, int stop); 125 126 /** Reset I2C peripheral. TODO: The action here. Most of the implementation sends stop() 127 * 128 * @param obj The I2C object 113 129 */ 114 130 void i2c_reset(i2c_t *obj); 115 131 116 /** Read one byte. 117 * @param obj The i2c object 132 /** Read one byte 133 * 134 * @param obj The I2C object 118 135 * @param last Acknoledge 119 136 * @return The read byte 120 137 */ 121 int i2c_byte_read(i2c_t *obj, int last); 122 123 /** Write one byte. 124 * @param obj The i2c object 138 int i2c_byte_read(i2c_t *obj, int last); 139 140 /** Write one byte 141 * 142 * @param obj The I2C object 125 143 * @param data Byte to be written 126 * @return 1 if NAK was received, 0if ACK was received, 2 for timeout.127 */ 128 int 144 * @return 0 if NAK was received, 1 if ACK was received, 2 for timeout. 145 */ 146 int i2c_byte_write(i2c_t *obj, int data); 129 147 130 148 /**@}*/ … … 139 157 /** Configure I2C as slave or master. 140 158 * @param obj The I2C object 159 * @param enable_slave Enable i2c hardware so you can receive events with ::i2c_slave_receive 141 160 * @return non-zero if a value is available 142 161 */ … … 152 171 /** Configure I2C as slave or master. 153 172 * @param obj The I2C object 173 * @param data The buffer for receiving 174 * @param length Number of bytes to read 154 175 * @return non-zero if a value is available 155 176 */ … … 158 179 /** Configure I2C as slave or master. 159 180 * @param obj The I2C object 181 * @param data The buffer for sending 182 * @param length Number of bytes to write 160 183 * @return non-zero if a value is available 161 184 */ … … 177 200 178 201 /** 179 * \defgroup AsynchI2C Asynchronous I2C Hardware Abstraction Layer 180 * @{ 181 */ 182 183 /** Start i2c asynchronous transfer. 202 * \defgroup hal_AsynchI2C Asynchronous I2C Hardware Abstraction Layer 203 * @{ 204 */ 205 206 /** Start I2C asynchronous transfer 207 * 184 208 * @param obj The I2C object 185 * @param tx The buffer to send186 * @param tx_length The number of words to transmit187 * @param rx The buffer to receive188 * @param rx_length The number of words to receive189 * @param address The address to be set - 7bit or 9 209 * @param tx The transmit buffer 210 * @param tx_length The number of bytes to transmit 211 * @param rx The receive buffer 212 * @param rx_length The number of bytes to receive 213 * @param address The address to be set - 7bit or 9bit 190 214 * @param stop If true, stop will be generated after the transfer is done 191 215 * @param handler The I2C IRQ handler to be set 216 * @param event Event mask for the transfer. See \ref hal_I2CEvents 192 217 * @param hint DMA hint usage 193 218 */ … … 195 220 196 221 /** The asynchronous IRQ handler 222 * 197 223 * @param obj The I2C object which holds the transfer information 198 * @return event flags if a transfer termination condition was met or 0 otherwise.224 * @return Event flags if a transfer termination condition was met, otherwise return 0. 199 225 */ 200 226 uint32_t i2c_irq_handler_asynch(i2c_t *obj); 201 227 202 /** Attempts to determine if I2C peripheral is already in use. 203 * @param obj The I2C object 204 * @return non-zero if the I2C module is active or zero if it is not 228 /** Attempts to determine if the I2C peripheral is already in use 229 * 230 * @param obj The I2C object 231 * @return Non-zero if the I2C module is active or zero if it is not 205 232 */ 206 233 uint8_t i2c_active(i2c_t *obj); 207 234 208 /** Abort ongoing asynchronous transaction. 235 /** Abort asynchronous transfer 236 * 237 * This function does not perform any check - that should happen in upper layers. 209 238 * @param obj The I2C object 210 239 */ … … 222 251 223 252 #endif 253 254 /** @}*/ -
EcnlProtoTool/trunk/asp3_dcre/mbed/hal/lp_ticker_api.h
r321 r429 1 2 /** \addtogroup hal */ 3 /** @{*/ 1 4 /* mbed Microcontroller Library 2 5 * Copyright (c) 2015 ARM Limited … … 19 22 #include "device.h" 20 23 21 #if DEVICE_L OWPOWERTIMER22 23 #include " ticker_api.h"24 #if DEVICE_LPTICKER 25 26 #include "hal/ticker_api.h" 24 27 25 28 #ifdef __cplusplus … … 28 31 29 32 /** 30 * \defgroup LpTicker Low Power Ticker Functions 33 * \defgroup hal_lp_ticker Low Power Ticker 34 * Low level interface to the low power ticker of a target 35 * 36 * # Defined behavior 37 * * Has a reported frequency between 4KHz and 64KHz - verified by ::lp_ticker_info_test 38 * * Has a counter that is at least 12 bits wide - verified by ::lp_ticker_info_test 39 * * Continues operating in deep sleep mode - verified by ::lp_ticker_deepsleep_test 40 * * All behavior defined by the @ref hal_ticker_shared "ticker specification" 41 * 42 * # Undefined behavior 43 * * See the @ref hal_ticker_shared "ticker specification" 44 * * Calling any function other than lp_ticker_init after calling lp_ticker_free 45 * 46 * # Potential bugs 47 * * Glitches due to ripple counter - Verified by ::lp_ticker_glitch_test 48 * 49 * @see hal_lp_ticker_tests 50 * 31 51 * @{ 32 52 */ 33 53 54 /** 55 * \defgroup hal_lp_ticker_tests Low Power Ticker tests 56 * Tests to validate the proper implementation of the low power ticker 57 * 58 * To run the low power ticker hal tests use the command: 59 * 60 * mbed test -t <toolchain> -m <target> -n tests-mbed_hal-common_ticker*,tests-mbed_hal-lp_ticker* 61 * 62 */ 63 64 typedef void (*ticker_irq_handler_type)(const ticker_data_t *const); 65 66 /** Set low power ticker IRQ handler 67 * 68 * @param ticker_irq_handler IRQ handler to be connected 69 * 70 * @return previous ticker IRQ handler 71 * 72 * @note by default IRQ handler is set to ::ticker_irq_handler 73 * @note this function is primarily for testing purposes and it's not required part of HAL implementation 74 * 75 */ 76 ticker_irq_handler_type set_lp_ticker_irq_handler(ticker_irq_handler_type ticker_irq_handler); 77 34 78 /** Get low power ticker's data 35 79 * 36 80 * @return The low power ticker data 37 81 */ 38 const ticker_data_t *get_lp_ticker_data(void);82 const ticker_data_t *get_lp_ticker_data(void); 39 83 40 84 /** The wrapper for ticker_irq_handler, to pass lp ticker's data … … 47 91 /** Initialize the low power ticker 48 92 * 93 * Initialize or re-initialize the ticker. This resets all the 94 * clocking and prescaler registers, along with disabling 95 * the compare interrupt. 96 * 97 * Pseudo Code: 98 * @code 99 * void lp_ticker_init() 100 * { 101 * // Enable clock gate so processor can read LPTMR registers 102 * POWER_CTRL |= POWER_CTRL_LPTMR_Msk; 103 * 104 * // Disable the timer and ensure it is powered down 105 * LPTMR_CTRL &= ~(LPTMR_CTRL_ENABLE_Msk | LPTMR_CTRL_COMPARE_ENABLE_Msk); 106 * 107 * // Configure divisors - no division necessary 108 * LPTMR_PRESCALE = 0; 109 * LPTMR_CTRL |= LPTMR_CTRL_ENABLE_Msk; 110 * 111 * // Install the interrupt handler 112 * NVIC_SetVector(LPTMR_IRQn, (uint32_t)lp_ticker_irq_handler); 113 * NVIC_EnableIRQ(LPTMR_IRQn); 114 * } 115 * @endcode 49 116 */ 50 117 void lp_ticker_init(void); 51 118 52 /** Read the current counter 53 * 54 * @return The current timer's counter value in microseconds 119 /** Deinitialize the lower power ticker 120 * 121 * Powerdown the lp ticker in preparation for sleep, powerdown, or reset. 122 * 123 * After calling this function no other ticker functions should be called except 124 * lp_ticker_init(). Calling any function other than init after freeing is 125 * undefined. 126 * 127 * @note This function stops the ticker from counting. 128 */ 129 void lp_ticker_free(void); 130 131 /** Read the current tick 132 * 133 * If no rollover has occurred, the seconds passed since lp_ticker_init() 134 * was called can be found by dividing the ticks returned by this function 135 * by the frequency returned by ::lp_ticker_get_info. 136 * 137 * @return The current timer's counter value in ticks 138 * 139 * Pseudo Code: 140 * @code 141 * uint32_t lp_ticker_read() 142 * { 143 * uint16_t count; 144 * uint16_t last_count; 145 * 146 * // Loop until the same tick is read twice since this 147 * // is ripple counter on a different clock domain. 148 * count = LPTMR_COUNT; 149 * do { 150 * last_count = count; 151 * count = LPTMR_COUNT; 152 * } while (last_count != count); 153 * 154 * return count; 155 * } 156 * @endcode 55 157 */ 56 158 uint32_t lp_ticker_read(void); … … 58 160 /** Set interrupt for specified timestamp 59 161 * 60 * @param timestamp The time in microseconds to be set 162 * @param timestamp The time in ticks to be set 163 * 164 * @note no special handling needs to be done for times in the past 165 * as the common timer code will detect this and call 166 * lp_ticker_fire_interrupt() if this is the case 167 * 168 * @note calling this function with timestamp of more than the supported 169 * number of bits returned by ::lp_ticker_get_info results in undefined 170 * behavior. 171 * 172 * Pseudo Code: 173 * @code 174 * void lp_ticker_set_interrupt(timestamp_t timestamp) 175 * { 176 * LPTMR_COMPARE = timestamp; 177 * LPTMR_CTRL |= LPTMR_CTRL_COMPARE_ENABLE_Msk; 178 * } 179 * @endcode 61 180 */ 62 181 void lp_ticker_set_interrupt(timestamp_t timestamp); … … 64 183 /** Disable low power ticker interrupt 65 184 * 185 * Pseudo Code: 186 * @code 187 * void lp_ticker_disable_interrupt(void) 188 * { 189 * // Disable the compare interrupt 190 * LPTMR_CTRL &= ~LPTMR_CTRL_COMPARE_ENABLE_Msk; 191 * } 192 * @endcode 66 193 */ 67 194 void lp_ticker_disable_interrupt(void); … … 69 196 /** Clear the low power ticker interrupt 70 197 * 198 * Pseudo Code: 199 * @code 200 * void lp_ticker_clear_interrupt(void) 201 * { 202 * // Write to the ICR (interrupt clear register) of the LPTMR 203 * LPTMR_ICR = LPTMR_ICR_COMPARE_Msk; 204 * } 205 * @endcode 71 206 */ 72 207 void lp_ticker_clear_interrupt(void); 208 209 /** Set pending interrupt that should be fired right away. 210 * 211 * Pseudo Code: 212 * @code 213 * void lp_ticker_fire_interrupt(void) 214 * { 215 * NVIC_SetPendingIRQ(LPTMR_IRQn); 216 * } 217 * @endcode 218 */ 219 void lp_ticker_fire_interrupt(void); 220 221 /** Get frequency and counter bits of this ticker. 222 * 223 * Pseudo Code: 224 * @code 225 * const ticker_info_t* lp_ticker_get_info() 226 * { 227 * static const ticker_info_t info = { 228 * 32768, // 32KHz 229 * 16 // 16 bit counter 230 * }; 231 * return &info; 232 * } 233 * @endcode 234 */ 235 const ticker_info_t *lp_ticker_get_info(void); 73 236 74 237 /**@}*/ … … 81 244 82 245 #endif 246 247 /** @}*/ -
EcnlProtoTool/trunk/asp3_dcre/mbed/hal/pinmap.h
r321 r429 1 2 /** \addtogroup hal */ 3 /** @{*/ 1 4 /* mbed Microcontroller Library 2 5 * Copyright (c) 2006-2013 ARM Limited … … 44 47 45 48 #endif 49 50 /** @}*/ -
EcnlProtoTool/trunk/asp3_dcre/mbed/hal/port_api.h
r321 r429 1 2 /** \addtogroup hal */ 3 /** @{*/ 1 4 /* mbed Microcontroller Library 2 5 * Copyright (c) 2006-2013 ARM Limited … … 25 28 #endif 26 29 30 /** Port HAL structure. port_s is declared in the target's HAL 31 */ 27 32 typedef struct port_s port_t; 28 33 34 /** 35 * \defgroup hal_port Port HAL functions 36 * @{ 37 */ 38 39 /** Get the pin name from the port's pin number 40 * 41 * @param port The port name 42 * @param pin_n The pin number within the specified port 43 * @return The pin name for the port's pin number 44 */ 29 45 PinName port_pin(PortName port, int pin_n); 30 46 31 void port_init (port_t *obj, PortName port, int mask, PinDirection dir); 32 void port_mode (port_t *obj, PinMode mode); 33 void port_dir (port_t *obj, PinDirection dir); 47 /** Initilize the port 48 * 49 * @param obj The port object to initialize 50 * @param port The port name 51 * @param mask The bitmask to identify which bits in the port should be included (0 - ignore) 52 * @param dir The port direction 53 */ 54 void port_init(port_t *obj, PortName port, int mask, PinDirection dir); 55 56 /** Set the input port mode 57 * 58 * @param obj The port object 59 * @param mode THe port mode to be set 60 */ 61 void port_mode(port_t *obj, PinMode mode); 62 63 /** Set port direction (in/out) 64 * 65 * @param obj The port object 66 * @param dir The port direction to be set 67 */ 68 void port_dir(port_t *obj, PinDirection dir); 69 70 /** Write value to the port 71 * 72 * @param obj The port object 73 * @param value The value to be set 74 */ 34 75 void port_write(port_t *obj, int value); 35 int port_read (port_t *obj); 76 77 /** Read the current value on the port 78 * 79 * @param obj The port object 80 * @return An integer with each bit corresponding to an associated port pin setting 81 */ 82 int port_read(port_t *obj); 83 84 /**@}*/ 36 85 37 86 #ifdef __cplusplus … … 41 90 42 91 #endif 92 93 /** @}*/ -
EcnlProtoTool/trunk/asp3_dcre/mbed/hal/pwmout_api.h
r321 r429 1 2 /** \addtogroup hal */ 3 /** @{*/ 1 4 /* mbed Microcontroller Library 2 5 * Copyright (c) 2006-2013 ARM Limited … … 25 28 #endif 26 29 30 /** Pwmout hal structure. pwmout_s is declared in the target's hal 31 */ 27 32 typedef struct pwmout_s pwmout_t; 28 33 29 void pwmout_init (pwmout_t* obj, PinName pin); 30 void pwmout_free (pwmout_t* obj); 34 /** 35 * \defgroup hal_pwmout Pwmout hal functions 36 * @{ 37 */ 31 38 32 void pwmout_write (pwmout_t* obj, float percent); 33 float pwmout_read (pwmout_t* obj); 39 /** Initialize the pwm out peripheral and configure the pin 40 * 41 * @param obj The pwmout object to initialize 42 * @param pin The pwmout pin to initialize 43 */ 44 void pwmout_init(pwmout_t *obj, PinName pin); 34 45 35 void pwmout_period (pwmout_t* obj, float seconds); 36 void pwmout_period_ms (pwmout_t* obj, int ms); 37 void pwmout_period_us (pwmout_t* obj, int us); 46 /** Deinitialize the pwmout object 47 * 48 * @param obj The pwmout object 49 */ 50 void pwmout_free(pwmout_t *obj); 38 51 39 void pwmout_pulsewidth (pwmout_t* obj, float seconds); 40 void pwmout_pulsewidth_ms(pwmout_t* obj, int ms); 41 void pwmout_pulsewidth_us(pwmout_t* obj, int us); 52 /** Set the output duty-cycle in range <0.0f, 1.0f> 53 * 54 * Value 0.0f represents 0 percentage, 1.0f represents 100 percent. 55 * @param obj The pwmout object 56 * @param percent The floating-point percentage number 57 */ 58 void pwmout_write(pwmout_t *obj, float percent); 59 60 /** Read the current float-point output duty-cycle 61 * 62 * @param obj The pwmout object 63 * @return A floating-point output duty-cycle 64 */ 65 float pwmout_read(pwmout_t *obj); 66 67 /** Set the PWM period specified in seconds, keeping the duty cycle the same 68 * 69 * Periods smaller than microseconds (the lowest resolution) are set to zero. 70 * @param obj The pwmout object 71 * @param seconds The floating-point seconds period 72 */ 73 void pwmout_period(pwmout_t *obj, float seconds); 74 75 /** Set the PWM period specified in miliseconds, keeping the duty cycle the same 76 * 77 * @param obj The pwmout object 78 * @param ms The milisecond period 79 */ 80 void pwmout_period_ms(pwmout_t *obj, int ms); 81 82 /** Set the PWM period specified in microseconds, keeping the duty cycle the same 83 * 84 * @param obj The pwmout object 85 * @param us The microsecond period 86 */ 87 void pwmout_period_us(pwmout_t *obj, int us); 88 89 /** Set the PWM pulsewidth specified in seconds, keeping the period the same. 90 * 91 * @param obj The pwmout object 92 * @param seconds The floating-point pulsewidth in seconds 93 */ 94 void pwmout_pulsewidth(pwmout_t *obj, float seconds); 95 96 /** Set the PWM pulsewidth specified in miliseconds, keeping the period the same. 97 * 98 * @param obj The pwmout object 99 * @param ms The floating-point pulsewidth in miliseconds 100 */ 101 void pwmout_pulsewidth_ms(pwmout_t *obj, int ms); 102 103 /** Set the PWM pulsewidth specified in microseconds, keeping the period the same. 104 * 105 * @param obj The pwmout object 106 * @param us The floating-point pulsewidth in microseconds 107 */ 108 void pwmout_pulsewidth_us(pwmout_t *obj, int us); 109 110 /**@}*/ 42 111 43 112 #ifdef __cplusplus … … 48 117 49 118 #endif 119 120 /** @}*/ -
EcnlProtoTool/trunk/asp3_dcre/mbed/hal/rtc_api.h
r321 r429 14 14 * limitations under the License. 15 15 */ 16 17 /** \addtogroup hal */ 18 /** @{*/ 19 16 20 #ifndef MBED_RTC_API_H 17 21 #define MBED_RTC_API_H 18 22 19 23 #include "device.h" 20 21 #if DEVICE_RTC22 24 23 25 #include <time.h> … … 27 29 #endif 28 30 31 /** 32 * \defgroup hal_rtc RTC hal 33 * 34 * The RTC hal provides a low level interface to the Real Time Counter (RTC) of a 35 * target. 36 * 37 * # Defined behaviour 38 * * The function ::rtc_init is safe to call repeatedly - Verified by test ::rtc_init_test. 39 * * RTC accuracy is at least 10% - Verified by test ::rtc_accuracy_test. 40 * * Init/free doesn't stop RTC from counting - Verified by test ::rtc_persist_test. 41 * * Software reset doesn't stop RTC from counting - Verified by test ::rtc_reset_test. 42 * * Sleep modes don't stop RTC from counting - Verified by test ::rtc_sleep_test. 43 * * Shutdown mode doesn't stop RTC from counting - Not verified. 44 * * The functions ::rtc_write/::rtc_read provides availability to set/get RTC time 45 * - Verified by test ::rtc_write_read_test. 46 * * The functions ::rtc_isenabled returns 1 if the RTC is counting and the time has been set, 47 * 0 otherwise - Verified by test ::rtc_enabled_test. 48 * 49 * # Undefined behaviour 50 * * Calling any function other than ::rtc_init before the initialisation of the RTC 51 * 52 * # Potential bugs 53 * * Incorrect overflow handling - Verified by ::rtc_range_test 54 * * Glitches due to ripple counter - Verified by ::rtc_glitch_test 55 * 56 * @see hal_rtc_tests 57 * 58 * @{ 59 */ 60 61 /** 62 * \defgroup hal_rtc_tests RTC hal tests 63 * The RTC test validate proper implementation of the RTC hal. 64 * 65 * To run the RTC hal tests use the command: 66 * 67 * mbed test -t <toolchain> -m <target> -n tests-mbed_hal-rtc* 68 */ 69 70 71 /** Initialize the RTC peripheral 72 * 73 * Powerup the RTC in perpetration for access. This function must be called 74 * before any other RTC functions ares called. This does not change the state 75 * of the RTC. It just enables access to it. 76 * 77 * @note This function is safe to call repeatedly - Tested by ::rtc_init_test 78 * 79 * Example Implementation Pseudo Code: 80 * @code 81 * void rtc_init() 82 * { 83 * // Enable clock gate so processor can read RTC registers 84 * POWER_CTRL |= POWER_CTRL_RTC_Msk; 85 * 86 * // See if the RTC is already setup 87 * if (!(RTC_STATUS & RTC_STATUS_COUNTING_Msk)) { 88 * 89 * // Setup the RTC clock source 90 * RTC_CTRL |= RTC_CTRL_CLK32_Msk; 91 * } 92 * } 93 * @endcode 94 */ 29 95 void rtc_init(void); 96 97 /** Deinitialize RTC 98 * 99 * Powerdown the RTC in preparation for sleep, powerdown or reset. That should only 100 * affect the CPU domain and not the time keeping logic. 101 * After this function is called no other RTC functions should be called 102 * except for ::rtc_init. 103 * 104 * @note This function does not stop the RTC from counting - Tested by ::rtc_persist_test 105 * 106 * Example Implementation Pseudo Code: 107 * @code 108 * void rtc_free() 109 * { 110 * // Disable clock gate since processor no longer needs to read RTC registers 111 * POWER_CTRL &= ~POWER_CTRL_RTC_Msk; 112 * } 113 * @endcode 114 */ 30 115 void rtc_free(void); 116 117 /** Check if the RTC has the time set and is counting 118 * 119 * @retval 0 The time reported by the RTC is not valid 120 * @retval 1 The time has been set the RTC is counting 121 * 122 * Example Implementation Pseudo Code: 123 * @code 124 * int rtc_isenabled() 125 * { 126 * if (RTC_STATUS & RTC_STATUS_COUNTING_Msk) { 127 * return 1; 128 * } else { 129 * return 0; 130 * } 131 * } 132 * @endcode 133 */ 31 134 int rtc_isenabled(void); 32 135 136 /** Get the current time from the RTC peripheral 137 * 138 * @return The current time in seconds 139 * 140 * @note Some RTCs are not synchronized with the main clock. If 141 * this is the case with your RTC then you must read the RTC time 142 * in a loop to prevent reading the wrong time due to a glitch. 143 * The test ::rtc_glitch_test is intended to catch this bug. 144 * 145 * Example implementation for an unsynchronized ripple counter: 146 * @code 147 * time_t rtc_read() 148 * { 149 * uint32_t val; 150 * uint32_t last_val; 151 * 152 * // Loop until the same value is read twice 153 * val = RTC_SECONDS; 154 * do { 155 * last_val = val; 156 * val = RTC_SECONDS; 157 * } while (last_val != val); 158 * 159 * return (time_t)val; 160 * } 161 * @endcode 162 */ 33 163 time_t rtc_read(void); 164 165 /** Write the current time in seconds to the RTC peripheral 166 * 167 * @param t The current time to be set in seconds. 168 * 169 * Example Implementation Pseudo Code: 170 * @code 171 * void rtc_write(time_t t) 172 * { 173 * RTC_SECONDS = t; 174 * } 175 * @endcode 176 */ 34 177 void rtc_write(time_t t); 178 179 /**@}*/ 35 180 36 181 #ifdef __cplusplus … … 40 185 #endif 41 186 42 #endif 187 /** @}*/ -
EcnlProtoTool/trunk/asp3_dcre/mbed/hal/serial_api.h
r321 r429 1 2 /** \addtogroup hal */ 3 /** @{*/ 1 4 /* mbed Microcontroller Library 2 5 * Copyright (c) 2006-2013 ARM Limited … … 18 21 19 22 #include "device.h" 20 #include " buffer.h"21 #include " dma_api.h"23 #include "hal/buffer.h" 24 #include "hal/dma_api.h" 22 25 23 26 #if DEVICE_SERIAL … … 81 84 82 85 #if DEVICE_SERIAL_ASYNCH 83 /** Asynch serial halstructure86 /** Asynch serial HAL structure 84 87 */ 85 88 typedef struct { 86 89 struct serial_s serial; /**< Target specific serial structure */ 87 struct buffer_s tx_buff; /**< T xbuffer */88 struct buffer_s rx_buff; /**< R xbuffer */90 struct buffer_s tx_buff; /**< TX buffer */ 91 struct buffer_s rx_buff; /**< RX buffer */ 89 92 uint8_t char_match; /**< Character to be matched */ 90 93 uint8_t char_found; /**< State of the matched character */ … … 92 95 93 96 #else 94 /** Non-asynch serial halstructure97 /** Non-asynch serial HAL structure 95 98 */ 96 99 typedef struct serial_s serial_t; … … 103 106 104 107 /** 105 * \defgroup GeneralSerial Serial Configuration Functions108 * \defgroup hal_GeneralSerial Serial Configuration Functions 106 109 * @{ 107 110 */ 108 111 109 112 /** Initialize the serial peripheral. It sets the default parameters for serial 110 * peripheral, and configure its specifieds pins.111 * 112 * @param obj The serial object 113 * @param tx The TX pin 114 * @param rx The RX pin 113 * peripheral, and configures its specifieds pins. 114 * 115 * @param obj The serial object 116 * @param tx The TX pin name 117 * @param rx The RX pin name 115 118 */ 116 119 void serial_init(serial_t *obj, PinName tx, PinName rx); … … 139 142 void serial_format(serial_t *obj, int data_bits, SerialParity parity, int stop_bits); 140 143 141 /** The serial interrupt handler registration .144 /** The serial interrupt handler registration 142 145 * 143 146 * @param obj The serial object 144 * @param handler The interrupt handler which will be invoked when interrupt fires.147 * @param handler The interrupt handler which will be invoked when the interrupt fires 145 148 * @param id The SerialBase object 146 149 */ … … 161 164 int serial_getc(serial_t *obj); 162 165 163 /** Puta character. This is a blocking call, waiting for a peripheral to be available166 /** Send a character. This is a blocking call, waiting for a peripheral to be available 164 167 * for writing 165 168 * … … 172 175 * 173 176 * @param obj The serial object 174 * @return Non-zero value if a character can be read, 0 if nothing to read .177 * @return Non-zero value if a character can be read, 0 if nothing to read 175 178 */ 176 179 int serial_readable(serial_t *obj); … … 203 206 /** Configure the TX pin for UART function. 204 207 * 205 * @param tx The pin used for TX208 * @param tx The pin name used for TX 206 209 */ 207 210 void serial_pinout_tx(PinName tx); … … 212 215 * @param obj The serial object 213 216 * @param type The type of the flow control. Look at the available FlowControl types. 214 * @param rxflow The tx pin215 * @param txflow The rx pin217 * @param rxflow The TX pin name 218 * @param txflow The RX pin name 216 219 */ 217 220 void serial_set_flow_control(serial_t *obj, FlowControl type, PinName rxflow, PinName txflow); … … 222 225 223 226 /** 224 * \defgroup AsynchSerial Asynchronous Serial Hardware Abstraction Layer227 * \defgroup hal_AsynchSerial Asynchronous Serial Hardware Abstraction Layer 225 228 * @{ 226 229 */ … … 230 233 * 231 234 * @param obj The serial object 232 * @param tx The buffer for sending233 * @param tx_length The number of words to transmit234 * @param tx_width The bit width of buffer word235 * @param tx The transmit buffer 236 * @param tx_length The number of bytes to transmit 237 * @param tx_width Deprecated argument 235 238 * @param handler The serial handler 236 239 * @param event The logical OR of events to be registered 237 240 * @param hint A suggestion for how to use DMA with this transfer 238 * @return Returns number of data transfered, o r 0 otherwise241 * @return Returns number of data transfered, otherwise returns 0 239 242 */ 240 243 int serial_tx_asynch(serial_t *obj, const void *tx, size_t tx_length, uint8_t tx_width, uint32_t handler, uint32_t event, DMAUsage hint); … … 244 247 * 245 248 * @param obj The serial object 246 * @param rx The buffer for sending247 * @param rx_length The number of words to transmit248 * @param rx_width The bit width of buffer word249 * @param rx The receive buffer 250 * @param rx_length The number of bytes to receive 251 * @param rx_width Deprecated argument 249 252 * @param handler The serial handler 250 253 * @param event The logical OR of events to be registered … … 272 275 * 273 276 * @param obj The serial object 274 * @return Returns event flags if a RX transfer termination condition was met or 0 otherwise277 * @return Returns event flags if an RX transfer termination condition was met; otherwise returns 0 275 278 */ 276 279 int serial_irq_handler_asynch(serial_t *obj); 277 280 278 281 /** Abort the ongoing TX transaction. It disables the enabled interupt for TX and 279 * flush TX hardware buffer if TX FIFO is used282 * flushes the TX hardware buffer if TX FIFO is used 280 283 * 281 284 * @param obj The serial object … … 283 286 void serial_tx_abort_asynch(serial_t *obj); 284 287 285 /** Abort the ongoing RX transaction It disables the enabled interrupt for RX and286 * flush RX hardware buffer if RX FIFO is used288 /** Abort the ongoing RX transaction. It disables the enabled interrupt for RX and 289 * flushes the RX hardware buffer if RX FIFO is used 287 290 * 288 291 * @param obj The serial object … … 301 304 302 305 #endif 306 307 /** @}*/ -
EcnlProtoTool/trunk/asp3_dcre/mbed/hal/sleep_api.h
r321 r429 1 2 /** \addtogroup hal */ 3 /** @{*/ 1 4 /* mbed Microcontroller Library 2 5 * Copyright (c) 2006-2013 ARM Limited … … 25 28 #endif 26 29 30 /** 31 * \defgroup hal_sleep sleep hal requirements 32 * Low level interface to the sleep mode of a target. 33 * 34 * # Defined behaviour 35 * 36 * * Sleep mode 37 * * wake-up time should be less than 10 us - Verified by sleep_usticker_test(). 38 * * the processor can be woken up by any internal peripheral interrupt - Verified by sleep_usticker_test(). 39 * * all peripherals operate as in run mode - not verified. 40 * * the processor can be woken up by external pin interrupt - not verified. 41 * * Deep sleep 42 * * the wake-up time should be less than 10 ms - Verified by deepsleep_lpticker_test(). 43 * * lp ticker should wake up a target from this mode - Verified by deepsleep_lpticker_test(). 44 * * RTC should wake up a target from this mode - not verified. 45 * * an external interrupt on a pin should wake up a target from this mode - not verified. 46 * * a watchdog timer should wake up a target from this mode - not verified. 47 * * High-speed clocks are turned off - Verified by deepsleep_high_speed_clocks_turned_off_test(). 48 * * RTC keeps time - Verified by rtc_sleep_test(). 49 * 50 * # Undefined behaviour 51 * 52 * * peripherals aside from RTC, GPIO and lp ticker result in undefined behaviour in deep sleep. 53 * @{ 54 */ 55 56 /** 57 * \defgroup hal_sleep_tests sleep hal tests 58 * The sleep HAL tests ensure driver conformance to defined behaviour. 59 * 60 * To run the sleep hal tests use the command: 61 * 62 * mbed test -t <toolchain> -m <target> -n tests-mbed_hal-sleep* 63 * 64 */ 65 27 66 /** Send the microcontroller to sleep 28 67 * 29 * The processor is setup ready for sleep, and sent to sleep using __WFI(). In this mode, the68 * The processor is setup ready for sleep, and sent to sleep. In this mode, the 30 69 * system clock to the core is stopped until a reset or an interrupt occurs. This eliminates 31 70 * dynamic power used by the processor, memory systems and buses. The processor, peripheral and … … 34 73 * The processor can be woken up by any internal peripheral interrupt or external pin interrupt. 35 74 * 36 * @note 37 * The mbed interface semihosting is disconnected as part of going to sleep, and can not be restored. 38 * Flash re-programming and the USB serial port will remain active, but the mbed program will no longer be 39 * able to access the LocalFileSystem 75 * The wake-up time shall be less than 10 us. 76 * 40 77 */ 41 void sleep(void);78 void hal_sleep(void); 42 79 43 80 /** Send the microcontroller to deep sleep 44 81 * 45 82 * This processor is setup ready for deep sleep, and sent to sleep using __WFI(). This mode 46 * has the same sleep features as sleep plus it powers down peripherals and clocks. All state47 * is still maintained.83 * has the same sleep features as sleep plus it powers down peripherals and high frequency clocks. 84 * All state is still maintained. 48 85 * 49 * The processor can only be woken up by an external interrupt on a pin or a watchdog timer.86 * The processor can only be woken up by low power ticker, RTC, an external interrupt on a pin or a watchdog timer. 50 87 * 51 * @note 52 * The mbed interface semihosting is disconnected as part of going to sleep, and can not be restored. 53 * Flash re-programming and the USB serial port will remain active, but the mbed program will no longer be 54 * able to access the LocalFileSystem 88 * The wake-up time shall be less than 10 ms. 55 89 */ 56 void deepsleep(void); 90 void hal_deepsleep(void); 91 92 /**@}*/ 57 93 58 94 #ifdef __cplusplus … … 63 99 64 100 #endif 101 102 /** @}*/ -
EcnlProtoTool/trunk/asp3_dcre/mbed/hal/spi_api.h
r321 r429 1 2 /** \addtogroup hal */ 3 /** @{*/ 1 4 /* mbed Microcontroller Library 2 5 * Copyright (c) 2006-2013 ARM Limited … … 18 21 19 22 #include "device.h" 20 #include " dma_api.h"21 #include " buffer.h"23 #include "hal/dma_api.h" 24 #include "hal/buffer.h" 22 25 23 26 #if DEVICE_SPI … … 28 31 #define SPI_EVENT_ALL (SPI_EVENT_ERROR | SPI_EVENT_COMPLETE | SPI_EVENT_RX_OVERFLOW) 29 32 30 #define SPI_EVENT_INTERNAL_TRANSFER_COMPLETE (1 << 30) // internal flag to report an event occurred33 #define SPI_EVENT_INTERNAL_TRANSFER_COMPLETE (1 << 30) // Internal flag to report that an event occurred 31 34 32 35 #define SPI_FILL_WORD (0xFFFF) 36 #define SPI_FILL_CHAR (0xFF) 33 37 34 38 #if DEVICE_SPI_ASYNCH 35 /** Asynch spi halstructure39 /** Asynch SPI HAL structure 36 40 */ 37 41 typedef struct { 38 struct spi_s spi; /**< Target specific spistructure */42 struct spi_s spi; /**< Target specific SPI structure */ 39 43 struct buffer_s tx_buff; /**< Tx buffer */ 40 44 struct buffer_s rx_buff; /**< Rx buffer */ … … 42 46 43 47 #else 44 /** Non-asynch spi halstructure48 /** Non-asynch SPI HAL structure 45 49 */ 46 50 typedef struct spi_s spi_t; … … 53 57 54 58 /** 55 * \defgroup GeneralSPI SPI Configuration Functions59 * \defgroup hal_GeneralSPI SPI Configuration Functions 56 60 * @{ 57 61 */ … … 82 86 /** Configure the SPI format 83 87 * 84 * Set the number of bits per frame, configure clock polarity and phase, shift order and master/slave mode 88 * Set the number of bits per frame, configure clock polarity and phase, shift order and master/slave mode. 89 * The default bit order is MSB. 85 90 * @param[in,out] obj The SPI object to configure 86 91 * @param[in] bits The number of bits per frame … … 113 118 int spi_master_write(spi_t *obj, int value); 114 119 120 /** Write a block out in master mode and receive a value 121 * 122 * The total number of bytes sent and received will be the maximum of 123 * tx_length and rx_length. The bytes written will be padded with the 124 * value 0xff. 125 * 126 * @param[in] obj The SPI peripheral to use for sending 127 * @param[in] tx_buffer Pointer to the byte-array of data to write to the device 128 * @param[in] tx_length Number of bytes to write, may be zero 129 * @param[in] rx_buffer Pointer to the byte-array of data to read from the device 130 * @param[in] rx_length Number of bytes to read, may be zero 131 * @param[in] write_fill Default data transmitted while performing a read 132 * @returns 133 * The number of bytes written and read from the device. This is 134 * maximum of tx_length and rx_length. 135 */ 136 int spi_master_block_write(spi_t *obj, const char *tx_buffer, int tx_length, char *rx_buffer, int rx_length, char write_fill); 137 115 138 /** Check if a value is available to read 116 139 * … … 160 183 /** Begin the SPI transfer. Buffer pointers and lengths are specified in tx_buff and rx_buff 161 184 * 162 * @param[in] obj The SPI object whichholds the transfer information163 * @param[in] tx The buffer to send164 * @param[in] tx_length The number of words to transmit165 * @param[in] rx The buffer to receive166 * @param[in] rx_length The number of words to receive185 * @param[in] obj The SPI object that holds the transfer information 186 * @param[in] tx The transmit buffer 187 * @param[in] tx_length The number of bytes to transmit 188 * @param[in] rx The receive buffer 189 * @param[in] rx_length The number of bytes to receive 167 190 * @param[in] bit_width The bit width of buffer words 168 191 * @param[in] event The logical OR of events to be registered … … 176 199 * Reads the received values out of the RX FIFO, writes values into the TX FIFO and checks for transfer termination 177 200 * conditions, such as buffer overflows or transfer complete. 178 * @param[in] obj The SPI object whichholds the transfer information179 * @return event flags if a transfer termination condition was met or 0 otherwise.201 * @param[in] obj The SPI object that holds the transfer information 202 * @return Event flags if a transfer termination condition was met; otherwise 0. 180 203 */ 181 204 uint32_t spi_irq_handler_asynch(spi_t *obj); 182 205 183 /** Attempts to determine if the SPI peripheral is already in use .206 /** Attempts to determine if the SPI peripheral is already in use 184 207 * 185 208 * If a temporary DMA channel has been allocated, peripheral is in use. … … 190 213 * there are any bytes in the FIFOs. 191 214 * @param[in] obj The SPI object to check for activity 192 * @return non-zero if the SPI port is active or zero if it is not.215 * @return Non-zero if the SPI port is active or zero if it is not. 193 216 */ 194 217 uint8_t spi_active(spi_t *obj); … … 212 235 213 236 #endif // MBED_SPI_API_H 237 238 /** @}*/ -
EcnlProtoTool/trunk/asp3_dcre/mbed/hal/ticker_api.h
r321 r429 1 2 /** \addtogroup hal */ 3 /** @{*/ 1 4 /* mbed Microcontroller Library 2 5 * Copyright (c) 2015 ARM Limited … … 17 20 #define MBED_TICKER_API_H 18 21 22 #include <stdint.h> 23 #include <stdbool.h> 19 24 #include "device.h" 20 25 26 /** 27 * Legacy format representing a timestamp in us. 28 * Given it is modeled as a 32 bit integer, this type can represent timestamp 29 * up to 4294 seconds (71 minutes). 30 * Prefer using us_timestamp_t which store timestamp as 64 bits integer. 31 */ 21 32 typedef uint32_t timestamp_t; 22 33 34 /** 35 * A us timestamp stored in a 64 bit integer. 36 * Can store timestamp up to 584810 years. 37 */ 38 typedef uint64_t us_timestamp_t; 39 23 40 /** Ticker's event structure 24 41 */ 25 42 typedef struct ticker_event_s { 26 timestamp_ttimestamp; /**< Event's timestamp */43 us_timestamp_t timestamp; /**< Event's timestamp */ 27 44 uint32_t id; /**< TimerEvent object */ 28 45 struct ticker_event_s *next; /**< Next event in the queue */ … … 30 47 31 48 typedef void (*ticker_event_handler)(uint32_t id); 49 50 /** Information about the ticker implementation 51 */ 52 typedef struct { 53 uint32_t frequency; /**< Frequency in Hz this ticker runs at */ 54 uint32_t bits; /**< Number of bits this ticker supports */ 55 } ticker_info_t; 56 32 57 33 58 /** Ticker's interface structure - required API for a ticker … … 39 64 void (*clear_interrupt)(void); /**< Clear interrupt function */ 40 65 void (*set_interrupt)(timestamp_t timestamp); /**< Set interrupt function */ 66 void (*fire_interrupt)(void); /**< Fire interrupt right-away */ 67 void (*free)(void); /**< Disable function */ 68 const ticker_info_t *(*get_info)(void); /**< Return info about this ticker's implementation */ 41 69 } ticker_interface_t; 42 70 43 /** Ticker s eventsqueue structure71 /** Ticker's event queue structure 44 72 */ 45 73 typedef struct { 46 74 ticker_event_handler event_handler; /**< Event handler */ 47 75 ticker_event_t *head; /**< A pointer to head */ 76 uint32_t frequency; /**< Frequency of the timer in Hz */ 77 uint32_t bitmask; /**< Mask to be applied to time values read */ 78 uint32_t max_delta; /**< Largest delta in ticks that can be used when scheduling */ 79 uint64_t max_delta_us; /**< Largest delta in us that can be used when scheduling */ 80 uint32_t tick_last_read; /**< Last tick read */ 81 uint64_t tick_remainder; /**< Ticks that have not been added to base_time */ 82 us_timestamp_t present_time; /**< Store the timestamp used for present time */ 83 bool initialized; /**< Indicate if the instance is initialized */ 84 bool dispatching; /**< The function ticker_irq_handler is dispatching */ 85 bool suspended; /**< Indicate if the instance is suspended */ 86 uint8_t frequency_shifts; /**< If frequency is a value of 2^n, this is n, otherwise 0 */ 48 87 } ticker_event_queue_t; 49 88 50 /** Ticker s data structure89 /** Ticker's data structure 51 90 */ 52 91 typedef struct { 53 92 const ticker_interface_t *interface; /**< Ticker's interface */ 54 ticker_event_queue_t *queue; /**< Ticker's event squeue */93 ticker_event_queue_t *queue; /**< Ticker's event queue */ 55 94 } ticker_data_t; 56 95 … … 59 98 #endif 60 99 61 /** Initialize a ticker and sets the event handler 62 * 63 * @param data The ticker's data 100 /** 101 * \defgroup hal_ticker Ticker HAL functions 102 * @{ 103 */ 104 105 /** Initialize a ticker and set the event handler 106 * 107 * @param ticker The ticker object. 64 108 * @param handler A handler to be set 65 109 */ 66 void ticker_set_handler(const ticker_data_t *const data, ticker_event_handler handler);67 68 /** I rq handler which goes through the events to trigger events in the past.69 * 70 * @param data The ticker's data71 */ 72 void ticker_irq_handler(const ticker_data_t *const data);110 void ticker_set_handler(const ticker_data_t *const ticker, ticker_event_handler handler); 111 112 /** IRQ handler that goes through the events to trigger overdue events. 113 * 114 * @param ticker The ticker object. 115 */ 116 void ticker_irq_handler(const ticker_data_t *const ticker); 73 117 74 118 /** Remove an event from the queue 75 119 * 76 * @param data The ticker's data 77 * @param obj The event's queue to be removed 78 */ 79 void ticker_remove_event(const ticker_data_t *const data, ticker_event_t *obj); 80 81 /** Insert an event from the queue 82 * 83 * @param data The ticker's data 84 * @param obj The event's queue to be removed 120 * @param ticker The ticker object. 121 * @param obj The event object to be removed from the queue 122 */ 123 void ticker_remove_event(const ticker_data_t *const ticker, ticker_event_t *obj); 124 125 /** Insert an event to the queue 126 * 127 * The event will be executed in timestamp - ticker_read(). 128 * 129 * @warning This function does not consider timestamp in the past. If an event 130 * is inserted with a timestamp less than the current timestamp then the event 131 * will be executed in timestamp - ticker_read() us. 132 * The internal counter wrap very quickly it is hard to decide weither an 133 * event is in the past or in 1 hour. 134 * 135 * @note prefer the use of ticker_insert_event_us which allows registration of 136 * absolute timestamp. 137 * 138 * @param ticker The ticker object. 139 * @param obj The event object to be inserted to the queue 85 140 * @param timestamp The event's timestamp 86 141 * @param id The event object 87 142 */ 88 void ticker_insert_event(const ticker_data_t *const data, ticker_event_t *obj, timestamp_t timestamp, uint32_t id); 89 90 /** Read the current ticker's timestamp 91 * 92 * @param data The ticker's data 143 void ticker_insert_event(const ticker_data_t *const ticker, ticker_event_t *obj, timestamp_t timestamp, uint32_t id); 144 145 /** Insert an event to the queue 146 * 147 * The event will be executed in timestamp - ticker_read_us() us. 148 * 149 * @note If an event is inserted with a timestamp less than the current 150 * timestamp then the event will be scheduled immediately resulting in 151 * an instant call to event handler. 152 * 153 * @param ticker The ticker object. 154 * @param obj The event object to be inserted to the queue 155 * @param timestamp The event's timestamp 156 * @param id The event object 157 */ 158 void ticker_insert_event_us(const ticker_data_t *const ticker, ticker_event_t *obj, us_timestamp_t timestamp, uint32_t id); 159 160 /** Read the current (relative) ticker's timestamp 161 * 162 * @warning Return a relative timestamp because the counter wrap every 4294 163 * seconds. 164 * 165 * @param ticker The ticker object. 93 166 * @return The current timestamp 94 167 */ 95 timestamp_t ticker_read(const ticker_data_t *const data); 168 timestamp_t ticker_read(const ticker_data_t *const ticker); 169 170 /** Read the current (absolute) ticker's timestamp 171 * 172 * @warning Return an absolute timestamp counting from the initialization of the 173 * ticker. 174 * 175 * @param ticker The ticker object. 176 * @return The current timestamp 177 */ 178 us_timestamp_t ticker_read_us(const ticker_data_t *const ticker); 96 179 97 180 /** Read the next event's timestamp 98 181 * 99 * @param data The ticker's data 182 * @param ticker The ticker object. 183 * @param timestamp The timestamp object. 100 184 * @return 1 if timestamp is pending event, 0 if there's no event pending 101 185 */ 102 int ticker_get_next_timestamp(const ticker_data_t *const data, timestamp_t *timestamp); 186 int ticker_get_next_timestamp(const ticker_data_t *const ticker, timestamp_t *timestamp); 187 188 /** Suspend this ticker 189 * 190 * When suspended reads will always return the same time and no 191 * events will be dispatched. When suspended the common layer 192 * will only ever call the interface function clear_interrupt() 193 * and that is only if ticker_irq_handler is called. 194 * 195 * 196 * @param ticker The ticker object. 197 */ 198 void ticker_suspend(const ticker_data_t *const ticker); 199 200 /** Resume this ticker 201 * 202 * When resumed the ticker will ignore any time that has passed 203 * and continue counting up where it left off. 204 * 205 * @param ticker The ticker object. 206 */ 207 void ticker_resume(const ticker_data_t *const ticker); 208 209 /* Private functions 210 * 211 * @cond PRIVATE 212 * 213 */ 214 215 int _ticker_match_interval_passed(timestamp_t prev_tick, timestamp_t cur_tick, timestamp_t match_tick); 216 217 /* 218 * @endcond PRIVATE 219 * 220 */ 221 222 /**@}*/ 103 223 104 224 #ifdef __cplusplus … … 107 227 108 228 #endif 229 230 /** @}*/ -
EcnlProtoTool/trunk/asp3_dcre/mbed/hal/us_ticker_api.h
r321 r429 1 2 /** \addtogroup hal */ 3 /** @{*/ 1 4 /* mbed Microcontroller Library 2 5 * Copyright (c) 2006-2015 ARM Limited … … 18 21 19 22 #include <stdint.h> 20 #include " ticker_api.h"23 #include "hal/ticker_api.h" 21 24 22 25 #ifdef __cplusplus … … 25 28 26 29 /** 27 * \defgroup UsTicker Microseconds Ticker Functions 30 * \defgroup hal_us_ticker Microsecond Ticker 31 * Low level interface to the microsecond ticker of a target 32 * 33 * # Defined behavior 34 * * Has a reported frequency between 250KHz and 8MHz - Verified by test ::us_ticker_info_test 35 * * Has a counter that is at least 16 bits wide - Verified by test ::us_ticker_info_test 36 * * All behavior defined by the @ref hal_ticker_shared "ticker specification" 37 * 38 * # Undefined behavior 39 * * See the @ref hal_ticker_shared "ticker specification" 40 * 41 * @see hal_us_ticker_tests 42 * 28 43 * @{ 29 44 */ 30 45 46 /** 47 * \defgroup hal_us_ticker_tests Microsecond Ticker tests 48 * Tests to validate the proper implementation of the microsecond ticker 49 * 50 * To run the microsecond ticker hal tests use the command: 51 * 52 * mbed test -t <toolchain> -m <target> -n tests-mbed_hal-common_ticker*,tests-mbed_hal-us_ticker* 53 * 54 * @see hal_ticker_tests 55 * 56 */ 57 58 /** 59 * \defgroup hal_ticker_shared Ticker Hal 60 * Low level interface to the ticker of a target 61 * 62 * # Defined behavior 63 * * The function ticker_init is safe to call repeatedly - Verified by test ::ticker_init_test 64 * * The function ticker_init allows the ticker to keep counting and disables the ticker interrupt - Verified by test ::ticker_init_test 65 * * Ticker frequency is non-zero and counter is at least 8 bits - Verified by ::ticker_info_test 66 * * The ticker rolls over at (1 << bits) and continues counting starting from 0 - Verified by ::ticker_overflow_test 67 * * The ticker counts at the specified frequency +- 10% - Verified by ::ticker_frequency_test 68 * * The ticker increments by 1 each tick - Verified by ::ticker_increment_test 69 * * The ticker interrupt fires only when the ticker times increments to or past the value set by ticker_set_interrupt. 70 * Verified by ::ticker_interrupt_test and ::ticker_past_test 71 * * It is safe to call ticker_set_interrupt repeatedly before the handler is called - Verified by ::ticker_repeat_reschedule_test 72 * * The function ticker_fire_interrupt causes ticker_irq_handler to be called immediately from interrupt context - 73 * Verified by ::ticker_fire_now_test 74 * * The ticker operations ticker_read, ticker_clear_interrupt, ticker_set_interrupt and ticker_fire_interrupt 75 * take less than 20us to complete - Verified by ::ticker_speed_test 76 * 77 * # Undefined behavior 78 * * Calling any function other than ticker_init before the initialization of the ticker 79 * * Whether ticker_irq_handler is called a second time if the time wraps and matches the value set by ticker_set_interrupt again 80 * * Calling ticker_set_interrupt with a value that has more than the supported number of bits 81 * * Calling any function other than us_ticker_init after calling us_ticker_free 82 * 83 * # Potential bugs 84 * * Drift due to reschedule - Verified by ::ticker_repeat_reschedule_test 85 * * Incorrect overflow handling of timers - Verified by ::ticker_overflow_test 86 * * Interrupting at a time of 0 - Verified by ::ticker_overflow_test 87 * * Interrupt triggered more than once - Verified by ::ticker_interrupt_test 88 * 89 * @ingroup hal_us_ticker 90 * @ingroup hal_lp_ticker 91 */ 92 93 /** 94 * \defgroup hal_ticker_tests Ticker Tests 95 * Tests to validate the proper implementation of a ticker 96 * 97 * To run the ticker hal tests use the command: 98 * 99 * mbed test -t <toolchain> -m <target> -n tests-mbed_hal-common_ticker* 100 * 101 * @ingroup hal_us_ticker 102 * @ingroup hal_lp_ticker 103 */ 104 105 106 typedef void (*ticker_irq_handler_type)(const ticker_data_t *const); 107 108 /** Set ticker IRQ handler 109 * 110 * @param ticker_irq_handler IRQ handler to be connected 111 * 112 * @return previous ticker IRQ handler 113 * 114 * @note by default IRQ handler is set to ::ticker_irq_handler 115 * @note this function is primarily for testing purposes and it's not required part of HAL implementation 116 * 117 */ 118 ticker_irq_handler_type set_us_ticker_irq_handler(ticker_irq_handler_type ticker_irq_handler); 119 31 120 /** Get ticker's data 32 121 * 33 * @return The low powerticker data34 */ 35 const ticker_data_t *get_us_ticker_data(void);122 * @return The microsecond ticker data 123 */ 124 const ticker_data_t *get_us_ticker_data(void); 36 125 37 126 … … 45 134 /** Initialize the ticker 46 135 * 136 * Initialize or re-initialize the ticker. This resets all the 137 * clocking and prescaler registers, along with disabling 138 * the compare interrupt. 139 * 140 * @note Initialization properties tested by ::ticker_init_test 141 * 142 * Pseudo Code: 143 * @code 144 * void us_ticker_init() 145 * { 146 * // Enable clock gate so processor can read TIMER registers 147 * POWER_CTRL |= POWER_CTRL_TIMER_Msk; 148 * 149 * // Disable the timer and ensure it is powered down 150 * TIMER_CTRL &= ~(TIMER_CTRL_ENABLE_Msk | TIMER_CTRL_COMPARE_ENABLE_Msk); 151 * 152 * // Configure divisors 153 * uint32_t prescale = SystemCoreClock / 1000000; 154 * TIMER_PRESCALE = prescale - 1; 155 * TIMER_CTRL |= TIMER_CTRL_ENABLE_Msk; 156 * 157 * // Install the interrupt handler 158 * NVIC_SetVector(TIMER_IRQn, (uint32_t)us_ticker_irq_handler); 159 * NVIC_EnableIRQ(TIMER_IRQn); 160 * } 161 * @endcode 47 162 */ 48 163 void us_ticker_init(void); 49 164 165 /** Deinitialize the us ticker 166 * 167 * Powerdown the us ticker in preparation for sleep, powerdown, or reset. 168 * 169 * After this function is called, no other ticker functions should be called 170 * except us_ticker_init(), calling any function other than init is undefined. 171 * 172 * @note This function stops the ticker from counting. 173 * 174 * Pseudo Code: 175 * @code 176 * uint32_t us_ticker_free() 177 * { 178 * // Disable timer 179 * TIMER_CTRL &= ~TIMER_CTRL_ENABLE_Msk; 180 * 181 * // Disable the compare interrupt 182 * TIMER_CTRL &= ~TIMER_CTRL_COMPARE_ENABLE_Msk; 183 * 184 * // Disable timer interrupt 185 * NVIC_DisableIRQ(TIMER_IRQn); 186 * 187 * // Disable clock gate so processor cannot read TIMER registers 188 * POWER_CTRL &= ~POWER_CTRL_TIMER_Msk; 189 * } 190 * @endcode 191 * 192 */ 193 void us_ticker_free(void); 194 50 195 /** Read the current counter 51 196 * 52 * @return The current timer's counter value in microseconds 197 * Read the current counter value without performing frequency conversions. 198 * If no rollover has occurred, the seconds passed since us_ticker_init() 199 * was called can be found by dividing the ticks returned by this function 200 * by the frequency returned by ::us_ticker_get_info. 201 * 202 * @return The current timer's counter value in ticks 203 * 204 * Pseudo Code: 205 * @code 206 * uint32_t us_ticker_read() 207 * { 208 * return TIMER_COUNT; 209 * } 210 * @endcode 53 211 */ 54 212 uint32_t us_ticker_read(void); … … 56 214 /** Set interrupt for specified timestamp 57 215 * 58 * @param timestamp The time in microseconds to be set 216 * @param timestamp The time in ticks to be set 217 * 218 * @note no special handling needs to be done for times in the past 219 * as the common timer code will detect this and call 220 * us_ticker_fire_interrupt() if this is the case 221 * 222 * @note calling this function with timestamp of more than the supported 223 * number of bits returned by ::us_ticker_get_info results in undefined 224 * behavior. 225 * 226 * Pseudo Code: 227 * @code 228 * void us_ticker_set_interrupt(timestamp_t timestamp) 229 * { 230 * TIMER_COMPARE = timestamp; 231 * TIMER_CTRL |= TIMER_CTRL_COMPARE_ENABLE_Msk; 232 * } 233 * @endcode 59 234 */ 60 235 void us_ticker_set_interrupt(timestamp_t timestamp); … … 62 237 /** Disable us ticker interrupt 63 238 * 239 * Pseudo Code: 240 * @code 241 * void us_ticker_disable_interrupt(void) 242 * { 243 * // Disable the compare interrupt 244 * TIMER_CTRL &= ~TIMER_CTRL_COMPARE_ENABLE_Msk; 245 * } 246 * @endcode 64 247 */ 65 248 void us_ticker_disable_interrupt(void); … … 67 250 /** Clear us ticker interrupt 68 251 * 252 * Pseudo Code: 253 * @code 254 * void us_ticker_clear_interrupt(void) 255 * { 256 * // Write to the ICR (interrupt clear register) of the TIMER 257 * TIMER_ICR = TIMER_ICR_COMPARE_Msk; 258 * } 259 * @endcode 69 260 */ 70 261 void us_ticker_clear_interrupt(void); 262 263 /** Set pending interrupt that should be fired right away. 264 * 265 * The ticker should be initialized prior calling this function. 266 * 267 * Pseudo Code: 268 * @code 269 * void us_ticker_fire_interrupt(void) 270 * { 271 * NVIC_SetPendingIRQ(TIMER_IRQn); 272 * } 273 * @endcode 274 */ 275 void us_ticker_fire_interrupt(void); 276 277 /** Get frequency and counter bits of this ticker. 278 * 279 * Pseudo Code: 280 * @code 281 * const ticker_info_t* us_ticker_get_info() 282 * { 283 * static const ticker_info_t info = { 284 * 1000000, // 1 MHz 285 * 32 // 32 bit counter 286 * }; 287 * return &info; 288 * } 289 * @endcode 290 */ 291 const ticker_info_t *us_ticker_get_info(void); 71 292 72 293 /**@}*/ … … 77 298 78 299 #endif 300 301 /** @}*/ -
EcnlProtoTool/trunk/asp3_dcre/sample/Makefile
r331 r429 6 6 # Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory 7 7 # Toyohashi Univ. of Technology, JAPAN 8 # Copyright (C) 2006-201 6by Embedded and Real-Time Systems Laboratory8 # Copyright (C) 2006-2019 by Embedded and Real-Time Systems Laboratory 9 9 # Graduate School of Information Science, Nagoya Univ., JAPAN 10 10 # … … 91 91 92 92 # 93 # TECS関係ファイルのディレクトリの定義 94 # 95 TECSDIR = @(TECSDIR) 96 97 # 93 98 # トレースログを取得するかどうかの定義 94 99 # … … 119 124 120 125 # 121 # 依存関係ファイルを置くディレクトリの定義 122 # 123 DEPDIR = @(DEPDIR) 126 # 中間オブジェクトファイルと依存関係ファイルを置くディレクトリの定義 127 # 128 OBJDIR = @(OBJDIR) 129 DEPDIR = @(OBJDIR) 124 130 125 131 # … … 149 155 -include $(TECSGENDIR)/Makefile.tecsgen 150 156 endif 157 158 TINETDIR = 151 159 152 160 # … … 191 199 APPL_COBJS := @(APPLOBJS) 192 200 endif 193 APPL_COBJS := $(APPL_COBJS) log_output.o vasyslog.o t_perror.o strerror.o 201 APPL_COBJS := $(APPL_COBJS) log_output.o vasyslog.o t_perror.o strerror.o mbed_stub.o 194 202 APPL_CFLAGS := $(APPL_CFLAGS) 195 203 ifdef APPLDIRS … … 197 205 endif 198 206 199 # 200 # ネットワークサービスの定義 201 # 202 203 NO_USE_TINET_LIBRARY = true 204 205 # ネットワークインタフェースの選択、何れか一つ選択する。 206 207 NET_IF = ether 208 209 # イーサネット・ディバイスドライバの選択 210 211 NET_DEV = if_mbed 212 213 # ネットワーク層の選択 214 215 #SUPPORT_INET6 = true 216 SUPPORT_INET4 = true 217 218 # API に組込む機能の選択 219 220 #API_CFG_IP4MAPPED_ADDR = true 221 222 # トランスポート層の選択 223 224 SUPPORT_TCP = true 225 #SUPPORT_UDP = true 226 227 # 228 # システムサービスの Makefile のインクルード 229 # 230 include $(SRCDIR)/tinet/Makefile.tinet 207 ifdef TINETDIR 208 # 209 # ネットワークサービスの定義 210 # 211 NO_USE_TINET_LIBRARY = true 212 213 # ネットワークインタフェースの選択、何れか一つ選択する。 214 NET_IF = ether 215 216 # イーサネット・ディバイスドライバの選択 217 NET_DEV = if_mbed 218 219 # ネットワーク層の選択 220 #SUPPORT_INET6 = true 221 SUPPORT_INET4 = true 222 223 # API に組込む機能の選択 224 #API_CFG_IP4MAPPED_ADDR = true 225 226 # トランスポート層の選択 227 SUPPORT_TCP = true 228 #SUPPORT_UDP = true 229 230 # IGMPを有効に設定 231 #SUPPORT_IGMP = true 232 233 # 234 # ネットワークサービスの Makefile のインクルード 235 # 236 include $(SRCDIR)/$(TINETDIR)/Makefile.tinet 237 endif 231 238 232 239 # … … 236 243 $(SYSSVC_DIRS) $(SRCDIR)/syssvc 237 244 SYSSVC_ASMOBJS := $(SYSSVC_ASMOBJS) 238 SYSSVC_COBJS := $( INIT_TECS_COBJ) $(TECS_COBJS) $(SYSSVC_COBJS) \239 @(SYSSVCOBJS) $(CXXRTS)245 SYSSVC_COBJS := $(SYSSVC_COBJS) $(TECS_COBJS) \ 246 $(INIT_TECS_COBJ) $(CXXRTS) 240 247 SYSSVC_CFLAGS := $(SYSSVC_CFLAGS) 241 248 INCLUDES := $(INCLUDES) -I$(TECSGENDIR) -I$(SRCDIR)/tecs_kernel 242 249 243 250 # 251 # トレースログ記録のサンプルコードに関する定義 252 # 253 ifdef ENABLE_TRACE 254 COPTS := $(COPTS) -DTOPPERS_ENABLE_TRACE 255 SYSSVC_DIRS := $(SYSSVC_DIRS) $(SRCDIR)/arch/tracelog 256 endif 257 258 # 244 259 # ターゲットファイル 245 260 # 246 261 .PHONY: all 247 262 ifndef OMIT_TECS 248 all: tecs 263 all: tecs | $(DEPDIR) 249 264 # @$(MAKE) check 250 265 @$(MAKE) check $(OBJNAME).bin … … 261 276 # コンフィギュレータに関する定義 262 277 # 263 CFG_TABS := --api-table $(SRCDIR)/tinet/tcpip_api.def:tcpip \ 278 CFG_KERNEL := --kernel asp 279 ifndef TINETDIR 280 CFG_TRB := -T $(TARGETDIR)/target_kernel.trb 281 CFG_TABS := --api-table $(SRCDIR)/kernel/kernel_api.def \ 282 --symval-table $(SRCDIR)/kernel/kernel_sym.def $(CFG_TABS) 283 else 284 CFG_TRB := -T $(TINET_ROOT)/tinet.trb:tcpip -T $(TARGETDIR)/target_kernel.trb:kernel 285 CFG_TABS := --api-table $(TINET_ROOT)/tcpip_api.def:tcpip \ 264 286 --api-table $(SRCDIR)/kernel/kernel_api.def:kernel \ 265 --symval-table $( SRCDIR)/tinet/tcpip_sym.def \287 --symval-table $(TINET_ROOT)/tcpip_sym.def \ 266 288 --symval-table $(SRCDIR)/kernel/kernel_sym.def $(CFG_TABS) 289 endif 267 290 CFG_ASMOBJS := $(CFG_ASMOBJS) 268 291 CFG_COBJS := kernel_cfg.o $(CFG_COBJS) 269 CFG_OBJS := $(CFG_ASMOBJS) $(CFG_COBJS) 292 CFG_CFLAGS := -DTOPPERS_CB_TYPE_ONLY $(CFG_CFLAGS) 293 270 294 CFG2_OUT_SRCS := kernel_cfg.h kernel_cfg.c $(CFG2_OUT_SRCS) 271 CFG_CFLAGS := -DTOPPERS_CB_TYPE_ONLY $(CFG_CFLAGS)272 295 273 296 # … … 300 323 $(foreach file,$(KERNEL_FCSRCS),$(file:.c=.o)) 301 324 endif 302 ifdef OMIT_OFFSET_H 303 OFFSET_H = 304 else 325 ifdef TARGET_OFFSET_TRB 305 326 OFFSET_H = offset.h 306 327 endif … … 318 339 endif 319 340 ifndef TARGET_TCPIP_TRB 320 TARGET_TCPIP_TRB := $(SRCDIR)/ tinet/tinet.trb341 TARGET_TCPIP_TRB := $(SRCDIR)/$(TINETDIR)/tinet.trb 321 342 endif 322 343 … … 330 351 331 352 # 353 # 中間オブジェクトファイルを置くディレクトリの処理 354 # 355 APPL_ASMOBJS := $(addprefix $(OBJDIR)/, $(APPL_ASMOBJS)) 356 APPL_CXXOBJS := $(addprefix $(OBJDIR)/, $(APPL_CXXOBJS)) 357 APPL_COBJS := $(addprefix $(OBJDIR)/, $(APPL_COBJS)) 358 SYSSVC_ASMOBJS := $(addprefix $(OBJDIR)/, $(SYSSVC_ASMOBJS)) 359 SYSSVC_COBJS := $(addprefix $(OBJDIR)/, $(SYSSVC_COBJS)) 360 KERNEL_ASMOBJS := $(addprefix $(OBJDIR)/, $(KERNEL_ASMOBJS)) 361 KERNEL_COBJS := $(addprefix $(OBJDIR)/, $(KERNEL_COBJS)) 362 KERNEL_LCOBJS := $(addprefix $(OBJDIR)/, $(KERNEL_LCOBJS)) 363 CFG_ASMOBJS := $(addprefix $(OBJDIR)/, $(CFG_ASMOBJS)) 364 CFG_COBJS := $(addprefix $(OBJDIR)/, $(CFG_COBJS)) 365 366 # 332 367 # コンパイルのための変数の定義 333 368 # 369 APPL_OBJS = $(APPL_ASMOBJS) $(APPL_COBJS) $(APPL_CXXOBJS) 370 SYSSVC_OBJS = $(SYSSVC_ASMOBJS) $(SYSSVC_COBJS) 334 371 KERNEL_LIB_OBJS = $(KERNEL_ASMOBJS) $(KERNEL_COBJS) $(KERNEL_LCOBJS) 335 SYSSVC_OBJS = $(SYSSVC_ASMOBJS) $(SYSSVC_COBJS) 336 APPL_OBJS = $(APPL_ASMOBJS) $(APPL_COBJS) $(APPL_CXXOBJS) 372 CFG_OBJS = $(CFG_ASMOBJS) $(CFG_COBJS) 337 373 ALL_OBJS = $(START_OBJS) $(APPL_OBJS) $(SYSSVC_OBJS) $(CFG_OBJS) \ 338 374 $(END_OBJS) $(HIDDEN_OBJS) … … 368 404 tecs $(TECSGEN_SRCS) $(TECS_HEADERS): $(TECSGEN_TIMESTAMP) ; 369 405 $(TECSGEN_TIMESTAMP): $(APPL_CDL) $(TECS_IMPORTS) 370 $(TECSGEN) $< -R $(INCLUDES) --cpp "$( TECS_CPP)" -g $(TECSGENDIR)406 $(TECSGEN) $< -R $(INCLUDES) --cpp "$(subst ", \", $(TECS_CPP))" -g $(TECSGENDIR) 371 407 372 408 # … … 375 411 cfg1_out.c cfg1_out.db: cfg1_out.timestamp ; 376 412 cfg1_out.timestamp: $(APPL_CFG) $(TECSGEN_TIMESTAMP) 377 $(CFG) --pass 1 --kernel asp$(INCLUDES) $(CFG_TABS) \413 $(CFG) --pass 1 $(CFG_KERNEL) $(INCLUDES) $(CFG_TABS) \ 378 414 -M $(DEPDIR)/cfg1_out_c.d $(TARGET_KERNEL_CFG) $< 379 415 380 $(CFG1_OUT): $(START_OBJS) cfg1_out.o $(CFG_DMY) $(END_OBJS) $(HIDDEN_OBJS)416 $(CFG1_OUT): $(START_OBJS) $(OBJDIR)/cfg1_out.o $(CFG_DMY) $(END_OBJS) $(HIDDEN_OBJS) 381 417 $(LINK) $(CFLAGS) $(LDFLAGS) $(CFG1_OUT_LDFLAGS) -o $(CFG1_OUT) \ 382 $(START_OBJS) cfg1_out.o $(CFG_DMY) $(END_OBJS)418 $(START_OBJS) $(OBJDIR)/cfg1_out.o $(CFG_DMY) $(LIBS) $(END_OBJS) 383 419 384 420 cfg1_out.syms: $(CFG1_OUT) … … 390 426 $(CFG2_OUT_SRCS) cfg2_out.db: kernel_cfg.timestamp ; 391 427 kernel_cfg.timestamp: cfg1_out.db cfg1_out.syms cfg1_out.srec 392 $(CFG) --pass 2 --kernel asp $(INCLUDES) -T $(TARGET_TCPIP_TRB):tcpip -T $(TARGET_KERNEL_TRB):kernel428 $(CFG) --pass 2 $(CFG_KERNEL) $(INCLUDES) $(CFG_TRB) 393 429 394 430 # … … 397 433 $(OFFSET_H): offset.timestamp ; 398 434 offset.timestamp: cfg1_out.db cfg1_out.syms cfg1_out.srec 399 $(CFG) --pass 2 -O --kernel asp$(INCLUDES) -T $(TARGET_OFFSET_TRB) \435 $(CFG) --pass 2 -O $(CFG_KERNEL) $(INCLUDES) -T $(TARGET_OFFSET_TRB) \ 400 436 --rom-symbol cfg1_out.syms --rom-image cfg1_out.srec 401 437 … … 409 445 410 446 # 447 # 並列makeのための依存関係の定義 448 # 449 $(APPL_OBJS) $(SYSSVC_OBJS): | kernel_cfg.timestamp 450 $(APPL_ASMOBJS) $(SYSSVC_ASMOBJS) $(KERNEL_ASMOBJS) $(CFG_ASMOBJS): \ 451 | offset.timestamp 452 453 # 411 454 # 特別な依存関係の定義 412 455 # 413 tBannerMain.o: $(filter-out tBannerMain.o,$(ALL_OBJS)) $(LIBS_DEP) 456 $(OBJDIR)/@(BANNEROBJ): $(filter-out $(OBJDIR)/@(BANNEROBJ),$(ALL_OBJS)) \ 457 $(LIBS_DEP) 414 458 415 459 # … … 417 461 # 418 462 $(OBJFILE): $(ALL_OBJS) $(LIBS_DEP) 419 $(LINK) $(CFLAGS) $(LDFLAGS) $(OBJ_LDFLAGS) -o $(OBJFILE) \463 $(LINK) $(CFLAGS) $(LDFLAGS) $(OBJ_LDFLAGS) -o $(OBJFILE) -Wl,-Map=$(OBJNAME).map,--cref \ 420 464 $(START_OBJS) $(APPL_OBJS) $(SYSSVC_OBJS) $(CFG_OBJS) \ 421 465 $(ALL_LIBS) $(END_OBJS) 466 467 # 468 # 依存関係フォルダの作成 469 # 470 $(DEPDIR): 471 mkdir $@ 422 472 423 473 # … … 445 495 check: check.timestamp ; 446 496 check.timestamp: cfg2_out.db $(OBJNAME).syms $(OBJNAME).srec 447 $(CFG) --pass 3 --kernel asp-O $(INCLUDES) -T $(TARGET_CHECK_TRB) \497 $(CFG) --pass 3 $(CFG_KERNEL) -O $(INCLUDES) -T $(TARGET_CHECK_TRB) \ 448 498 --rom-symbol $(OBJNAME).syms --rom-image $(OBJNAME).srec 449 499 @echo "configuration check passed" … … 454 504 .PHONY: clean 455 505 clean: 456 rm -f \#* *~ *.o $(DEPDIR)/*.d $(CLEAN_FILES) check.timestamp506 rm -f \#* *~ $(OBJDIR)/*.o $(DEPDIR)/*.d $(CLEAN_FILES) check.timestamp 457 507 rm -f $(OBJFILE) $(OBJNAME).syms $(OBJNAME).srec $(OBJNAME).bin 458 508 rm -f kernel_cfg.timestamp $(CFG2_OUT_SRCS) cfg2_out.db … … 468 518 cleankernel: 469 519 rm -f $(OFFSET_H) $(KERNEL_LIB_OBJS) 470 rm -f $(KERNEL_LIB_OBJS: %.o=$(DEPDIR)/%.d)520 rm -f $(KERNEL_LIB_OBJS:$(OBJDIR)/%.o=$(DEPDIR)/%.d) 471 521 472 522 .PHONY: realclean … … 480 530 # のみを付けてコンパイルする. 481 531 # 482 ALL_CFG_COBJS = $(CFG_COBJS) cfg1_out.o532 ALL_CFG_COBJS = $(CFG_COBJS) $(OBJDIR)/cfg1_out.o 483 533 ALL_CFG_ASMOBJS = $(CFG_ASMOBJS) 484 534 485 $(ALL_CFG_COBJS): %.o: %.c486 $(CC) -c - MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(CFG_CFLAGS) $<487 488 $(ALL_CFG_COBJS: .o=.s): %.s: %.c489 $(CC) -S $(CFLAGS) $(CFG_CFLAGS) $<490 491 $(ALL_CFG_ASMOBJS): %.o: %.S492 $(CC) -c - MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(CFG_CFLAGS) $<535 $(ALL_CFG_COBJS): $(OBJDIR)/%.o: %.c 536 $(CC) -c -o $@ -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(CFG_CFLAGS) $< 537 538 $(ALL_CFG_COBJS:$(OBJDIR)/%.o=%.s): %.s: %.c 539 $(CC) -S -o $@ $(CFLAGS) $(CFG_CFLAGS) $< 540 541 $(ALL_CFG_ASMOBJS): $(OBJDIR)/%.o: %.S 542 $(CC) -c -o $@ -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(CFG_CFLAGS) $< 493 543 494 544 # … … 541 591 # コンパイルルールの定義 542 592 # 543 $(KERNEL_COBJS): %.o: %.c544 $(CC) -c - MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(KERNEL_CFLAGS) $<545 546 $(KERNEL_COBJS: .o=.s): %.s: %.c547 $(CC) -S $(CFLAGS) $(KERNEL_CFLAGS) $<548 549 $(KERNEL_LCOBJS): %.o:550 $(CC) - DTOPPERS_$(*F) -o $@ -c-MD -MP -MF $(DEPDIR)/$*.d \593 $(KERNEL_COBJS): $(OBJDIR)/%.o: %.c 594 $(CC) -c -o $@ -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(KERNEL_CFLAGS) $< 595 596 $(KERNEL_COBJS:$(OBJDIR)/%.o=%.s): %.s: %.c 597 $(CC) -S -o $@ $(CFLAGS) $(KERNEL_CFLAGS) $< 598 599 $(KERNEL_LCOBJS): $(OBJDIR)/%.o: 600 $(CC) -c -o $@ -DTOPPERS_$(*F) -MD -MP -MF $(DEPDIR)/$*.d \ 551 601 $(CFLAGS) $(KERNEL_CFLAGS) $< 552 602 553 $(KERNEL_LCOBJS: .o=.s): %.s:554 $(CC) - DTOPPERS_$(*F) -o $@ -S$(CFLAGS) $(KERNEL_CFLAGS) $<555 556 $(KERNEL_ASMOBJS): %.o: %.S557 $(CC) -c - MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(KERNEL_CFLAGS) $<558 559 $(SYSSVC_COBJS): %.o: %.c560 $(CC) -c - MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(SYSSVC_CFLAGS) $<561 562 $(SYSSVC_COBJS: .o=.s): %.s: %.c563 $(CC) -S $(CFLAGS) $(SYSSVC_CFLAGS) $<564 565 $(SYSSVC_ASMOBJS): %.o: %.S566 $(CC) -c - MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(SYSSVC_CFLAGS) $<567 568 $(APPL_COBJS): %.o: %.c569 $(CC) -c - MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(APPL_CFLAGS) $<570 571 $(APPL_COBJS: .o=.s): %.s: %.c572 $(CC) -S $(CFLAGS) $(APPL_CFLAGS) $<573 574 $(APPL_CXXOBJS): %.o: %.cpp575 $(CXX) -c - MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(APPL_CFLAGS) $<576 577 $(APPL_CXXOBJS: .o=.s): %.s: %.cpp578 $(CXX) -S $(CFLAGS) $(APPL_CFLAGS) $<579 580 $(APPL_ASMOBJS): %.o: %.S581 $(CC) -c - MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(APPL_CFLAGS) $<603 $(KERNEL_LCOBJS:$(OBJDIR)/%.o=%.s): %.s: 604 $(CC) -S -o $@ -DTOPPERS_$(*F) $(CFLAGS) $(KERNEL_CFLAGS) $< 605 606 $(KERNEL_ASMOBJS): $(OBJDIR)/%.o: %.S 607 $(CC) -c -o $@ -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(KERNEL_CFLAGS) $< 608 609 $(SYSSVC_COBJS): $(OBJDIR)/%.o: %.c 610 $(CC) -c -o $@ -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(SYSSVC_CFLAGS) $< 611 612 $(SYSSVC_COBJS:$(OBJDIR)/%.o=%.s): %.s: %.c 613 $(CC) -S -o $@ $(CFLAGS) $(SYSSVC_CFLAGS) $< 614 615 $(SYSSVC_ASMOBJS): $(OBJDIR)/%.o: %.S 616 $(CC) -c -o $@ -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(SYSSVC_CFLAGS) $< 617 618 $(APPL_COBJS): $(OBJDIR)/%.o: %.c 619 $(CC) -c -o $@ -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(APPL_CFLAGS) $< 620 621 $(APPL_COBJS:$(OBJDIR)/%.o=%.s): %.s: %.c 622 $(CC) -S -o $@ $(CFLAGS) $(APPL_CFLAGS) $< 623 624 $(APPL_CXXOBJS): $(OBJDIR)/%.o: %.cpp 625 $(CXX) -c -o $@ -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(APPL_CFLAGS) $< 626 627 $(APPL_CXXOBJS:$(OBJDIR)/%.o=%.s): %.s: %.cpp 628 $(CXX) -S -o $@ $(CFLAGS) $(APPL_CFLAGS) $< 629 630 $(APPL_ASMOBJS): $(OBJDIR)/%.o: %.S 631 $(CC) -c -o $@ -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(APPL_CFLAGS) $< 582 632 583 633 # 584 634 # デフォルトコンパイルルールを上書き 585 635 # 586 %.o: %.c636 $(OBJDIR)/%.o: %.c 587 637 @echo "*** Default compile rules should not be used." 588 $(CC) -c - MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $<638 $(CC) -c -o $@ -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $< 589 639 590 640 %.s: %.c 591 641 @echo "*** Default compile rules should not be used." 592 $(CC) -S $(CFLAGS) $<593 594 %.o: %.cpp642 $(CC) -S -o $@ $(CFLAGS) $< 643 644 $(OBJDIR)/%.o: %.cpp 595 645 @echo "*** Default compile rules should not be used." 596 $(CXX) -c - MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $<646 $(CXX) -c -o $@ -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $< 597 647 598 648 %.s: %.cpp 599 649 @echo "*** Default compile rules should not be used." 600 $(CXX) -S $(CFLAGS) $<601 602 %.o: %.S650 $(CXX) -S -o $@ $(CFLAGS) $< 651 652 $(OBJDIR)/%.o: %.S 603 653 @echo "*** Default compile rules should not be used." 604 $(CC) -c - MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $<654 $(CC) -c -o $@ -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $< -
EcnlProtoTool/trunk/asp3_dcre/sample/sample1.c
r331 r429 6 6 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory 7 7 * Toyohashi Univ. of Technology, JAPAN 8 * Copyright (C) 2004-201 6by Embedded and Real-Time Systems Laboratory8 * Copyright (C) 2004-2019 by Embedded and Real-Time Systems Laboratory 9 9 * Graduate School of Information Science, Nagoya Univ., JAPAN 10 10 * … … 48 48 * プログラムの概要: 49 49 * 50 * ユーザインタフェースを受け持つメインタスク( タスクID: MAIN_TASK,優51 * 先度: MAIN_PRIORITY)と,3つの並行実行されるタスク(タスクID:52 * TASK1~TASK3,初期優先度: MID_PRIORITY)で構成される.また,起動周53 * 期が2秒の周期ハンドラ(周期ハンドラID: CYCHDR1)を用いる.54 * 55 * 並行実行されるタスクは,task_loop回空ループを実行する度に,タスクが56 * 実行中であることをあらわすメッセージを表示する.空ループを実行する57 * のは,空ループなしでメッセージを出力すると,多量のメッセージが出力58 * され,プログラムの動作が確認しずらくなるためである.また,低速なシ50 * ユーザインタフェースを受け持つメインタスク(MAIN_TASK)と,3つの並 51 * 行実行されるタスク(TASK1~TASK3),例外処理タスク(EXC_TASK)の5 52 * つのタスクを用いる.これらの他に,システムログタスクが動作する.ま 53 * た,周期ハンドラ,アラームハンドラ,割込みサービスルーチン,CPU例 54 * 外ハンドラをそれぞれ1つ用いる. 55 * 56 * 並行実行されるタスクは,task_loop回のループを実行する度に,タスク 57 * が実行中であることをあらわすメッセージを表示する.ループを実行する 58 * のは,プログラムの動作を確認しやすくするためである.また,低速なシ 59 59 * リアルポートを用いてメッセージを出力する場合に,すべてのメッセージ 60 60 * が出力できるように,メッセージの量を制限するという理由もある. 61 61 * 62 * 周期ハンドラは,三つの優先度(HIGH_PRIORITY,MID_PRIORITY, 63 * LOW_PRIORITY)のレディキューを回転させる.プログラムの起動直後は, 64 * 周期ハンドラは停止状態になっている. 65 * 66 * メインタスクは,シリアルI/Oポートからの文字入力を行い(文字入力を 67 * 待っている間は,並行実行されるタスクが実行されている),入力された 68 * 文字に対応した処理を実行する.入力された文字と処理の関係は次の通り. 62 * 周期ハンドラ,アラームハンドラ,割込みサービスルーチンは,3つの優 63 * 先度(HIGH_PRIORITY,MID_PRIORITY,LOW_PRIORITY)のレディキューを 64 * 回転させる.周期ハンドラは,プログラムの起動直後は停止状態になって 65 * いる. 66 * 67 * CPU例外ハンドラは,CPU例外からの復帰が可能な場合には,例外処理タス 68 * クを起動する.例外処理タスクは,CPU例外を起こしたタスクに対して, 69 * 終了要求を行う. 70 * 71 * メインタスクは,シリアルポートからの文字入力を行い(文字入力を待っ 72 * ている間は,並行実行されるタスクが実行されている),入力された文字 73 * に対応した処理を実行する.入力された文字と処理の関係は次の通り. 69 74 * Control-Cまたは'Q'が入力されると,プログラムを終了する. 70 75 * … … 97 102 * 'b' : アラームハンドラを5秒後に起動するよう動作開始させる. 98 103 * 'B' : アラームハンドラを動作停止させる. 99 * 'z' : 対象タスクにCPU例外を発生させる(タスクを終了させる). 100 * 'Z' : 対象タスクにCPUロック状態でCPU例外を発生させる(プログラムを 101 * 終了する). 104 * 'z' : 対象タスクにCPU例外を発生させる(ターゲットによっては復帰可能). 105 * 'Z' : 対象タスクにCPUロック状態でCPU例外を発生させる(復帰不可能). 102 106 * '@' : タスク3をacre_tskにより生成する. 103 107 * '!' : 対象タスクをdel_tskにより削除する. 104 108 * '$' : アラームハンドラをacre_almにより生成する. 105 109 * '#' : アラームハンドラをdel_almにより削除する. 106 * 'V' : fch_hrtで高分解能タイマを2回読む.110 * 'V' : 短いループを挟んで,fch_hrtで高分解能タイマを2回読む. 107 111 * 'v' : 発行したシステムコールを表示する(デフォルト). 108 112 * 'q' : 発行したシステムコールを表示しない. … … 116 120 #include "kernel_cfg.h" 117 121 #include "sample1.h" 118 /*#include "sample1n.h"*/119 122 120 123 /* … … 132 135 133 136 /* 137 * プロセッサ時間の消費 138 * 139 * ループによりプロセッサ時間を消費する.最適化ができないように,ルー 140 * プ内でvolatile変数を読み込む. 141 */ 142 static volatile long_t volatile_var; 143 144 static void 145 consume_time(ulong_t ctime) 146 { 147 ulong_t i; 148 149 for (i = 0; i < ctime; i++) { 150 (void) volatile_var; 151 } 152 } 153 154 /* 134 155 * 並行実行されるタスクへのメッセージ領域 135 156 */ … … 144 165 * 並行実行されるタスク 145 166 */ 146 void task(intptr_t exinf)147 { 148 volatile ulong_t i; 167 void 168 task(intptr_t exinf) 169 { 149 170 int_t n = 0; 150 171 int_t tskno = (int_t) exinf; … … 155 176 syslog(LOG_NOTICE, "task%d is running (%03d). %s", 156 177 tskno, ++n, graph[tskno-1]); 157 for (i = 0; i < task_loop; i++);178 consume_time(task_loop); 158 179 c = message[tskno-1]; 159 180 message[tskno-1] = 0; … … 202 223 203 224 /* 204 * 割込みハンドラ 225 * 割込みサービスルーチン 226 * 227 * HIGH_PRIORITY,MID_PRIORITY,LOW_PRIORITY の各優先度のレディキュー 228 * を回転させる. 205 229 */ 206 230 #ifdef INTNO1 207 231 208 void intno1_isr(intptr_t exinf) 232 void 233 intno1_isr(intptr_t exinf) 209 234 { 210 235 intno1_clear(); … … 235 260 "sns_dpn() is not true in CPU exception handler."); 236 261 } 237 syslog(LOG_INFO, "sns_loc = %d sns_dsp = %dxsns_dpn = %d",262 syslog(LOG_INFO, "sns_loc = %d, sns_dsp = %d, xsns_dpn = %d", 238 263 sns_loc(), sns_dsp(), xsns_dpn(p_excinf)); 239 264 … … 244 269 } 245 270 246 #ifdef PREPARE_RETURN_CPUEXC247 PREPARE_RETURN_CPUEXC;248 271 SVC_PERROR(get_tid(&cpuexc_tskid)); 249 272 SVC_PERROR(act_tsk(EXC_TASK)); 250 #else /* PREPARE_RETURN_CPUEXC */251 syslog(LOG_NOTICE, "Sample program ends with exception.");252 SVC_PERROR(ext_ker());253 assert(0);254 #endif /* PREPARE_RETURN_CPUEXC */255 273 } 256 274 … … 263 281 * を回転させる. 264 282 */ 265 void cyclic_handler(intptr_t exinf) 283 void 284 cyclic_handler(intptr_t exinf) 266 285 { 267 286 SVC_PERROR(rot_rdq(HIGH_PRIORITY)); … … 276 295 * を回転させる. 277 296 */ 278 void alarm_handler(intptr_t exinf) 297 void 298 alarm_handler(intptr_t exinf) 279 299 { 280 300 SVC_PERROR(rot_rdq(HIGH_PRIORITY)); … … 286 306 * 例外処理タスク 287 307 */ 288 void exc_task(intptr_t exinf) 308 void 309 exc_task(intptr_t exinf) 289 310 { 290 311 SVC_PERROR(ras_ter(cpuexc_tskid)); … … 294 315 * メインタスク 295 316 */ 296 void main_task(intptr_t exinf) 317 void 318 main_task(intptr_t exinf) 297 319 { 298 320 char c; … … 302 324 PRI tskpri; 303 325 #ifndef TASK_LOOP 304 volatile ulong_t i;305 326 SYSTIM stime1, stime2; 306 327 #endif /* TASK_LOOP */ … … 332 353 * ループ回数の設定 333 354 * 334 * 並行実行されるタスク内での 空ループの回数(task_loop)は,空ルー335 * プの実行時間が約0.4秒になるように設定する.この設定のために,336 * LOOP_REF回の 空ループの実行時間を,その前後でget_timを呼ぶことで337 * 測定し,その測定結果から空ループの実行時間が0.4秒になるループ 回338 * 数を求め,task_loopに設定する.355 * 並行実行されるタスク内でのループの回数(task_loop)は,ループ 356 * の実行時間が約0.4秒になるように設定する.この設定のために, 357 * LOOP_REF回のループの実行時間を,その前後でget_timを呼ぶことで 358 * 測定し,その測定結果から空ループの実行時間が0.4秒になるループ 359 * 回数を求め,task_loopに設定する. 339 360 * 340 * LOOP_REFは,デフォルトでは1,000,000に設定しているが,想定したよ 341 * り遅いプロセッサでは,サンプルプログラムの実行開始に時間がかか 342 * りすぎるという問題を生じる.逆に想定したより速いプロセッサでは, 343 * LOOP_REF回の空ループの実行時間が短くなり,task_loopに設定する値 344 * の誤差が大きくなるという問題がある. 345 * 346 * そこで,そのようなターゲットでは,target_test.hで,LOOP_REFを適 347 * 切な値に定義するのが望ましい. 361 * LOOP_REFは,デフォルトでは1,000,000に設定しているが,想定した 362 * より遅いプロセッサでは,サンプルプログラムの実行開始に時間がか 363 * かりすぎるという問題を生じる.逆に想定したより速いプロセッサで 364 * は,LOOP_REF回のループの実行時間が短くなり,task_loopに設定す 365 * る値の誤差が大きくなるという問題がある.そこで,そのようなター 366 * ゲットでは,target_test.hで,LOOP_REFを適切な値に定義すること 367 * とする. 348 368 * 349 369 * また,task_loopの値を固定したい場合には,その値をTASK_LOOPにマ 350 * クロ定義する.TASK_LOOPがマクロ定義されている場合,上記の測定 を351 * 行わずに,TASK_LOOPに定義された値を空ループの回数とする.370 * クロ定義する.TASK_LOOPがマクロ定義されている場合,上記の測定 371 * を行わずに,TASK_LOOPに定義された値をループの回数とする. 352 372 * 353 * ターゲットによっては,空ループの実行時間の1回目の測定で,本来よ354 * りも長めになるものがある.このようなターゲットでは,MEASURE_TWICE355 * をマクロ定義することで,1回目の測定結果を捨てて,2回目の測定結果356 * を使う.373 * ターゲットによっては,ループの実行時間の1回目の測定で,本来より 374 * も長めになるものがある.このようなターゲットでは,MEASURE_TWICE 375 * をマクロ定義することで,1回目の測定結果を捨てて,2回目の測定結 376 * 果を使う. 357 377 */ 358 378 #ifdef TASK_LOOP … … 361 381 362 382 #ifdef MEASURE_TWICE 363 task_loop = LOOP_REF;364 383 SVC_PERROR(get_tim(&stime1)); 365 for (i = 0; i < task_loop; i++);384 consume_time(LOOP_REF); 366 385 SVC_PERROR(get_tim(&stime2)); 367 386 #endif /* MEASURE_TWICE */ 368 387 369 task_loop = LOOP_REF;370 388 SVC_PERROR(get_tim(&stime1)); 371 for (i = 0; i < task_loop; i++);389 consume_time(LOOP_REF); 372 390 SVC_PERROR(get_tim(&stime2)); 373 391 task_loop = LOOP_REF * 400LU / (ulong_t)(stime2 - stime1) * 1000LU; … … 477 495 break; 478 496 case 'c': 479 syslog(LOG_INFO, "#sta_cyc( 1)");497 syslog(LOG_INFO, "#sta_cyc(CYCHDR1)"); 480 498 SVC_PERROR(sta_cyc(CYCHDR1)); 481 499 break; 482 500 case 'C': 483 syslog(LOG_INFO, "#stp_cyc( 1)");501 syslog(LOG_INFO, "#stp_cyc(CYCHDR1)"); 484 502 SVC_PERROR(stp_cyc(CYCHDR1)); 485 503 break; 486 504 case 'b': 487 syslog(LOG_INFO, "#sta_alm( 1, 5000000)");505 syslog(LOG_INFO, "#sta_alm(ALMHDR1, 5000000)"); 488 506 SVC_PERROR(sta_alm(ALMHDR1, 5000000)); 489 507 break; 490 508 case 'B': 491 syslog(LOG_INFO, "#stp_alm( 1)");509 syslog(LOG_INFO, "#stp_alm(ALMHDR1)"); 492 510 SVC_PERROR(stp_alm(ALMHDR1)); 493 511 break; … … 499 517 ctsk.stksz = STACK_SIZE; 500 518 ctsk.stk = NULL; 501 SVC_PERROR(TASK3 = acre_tsk(&ctsk)); 502 syslog(LOG_NOTICE, "task3 is created with tskid = %d.", 519 SVC_PERROR(ercd = acre_tsk(&ctsk)); 520 if (ercd >= 0) { 521 TASK3 = ercd; 522 syslog(LOG_NOTICE, "task3 is created with tskid = %d.", 503 523 (int_t) TASK3); 524 } 504 525 break; 505 526 case '!': … … 512 533 calm.nfyinfo.nfy.handler.exinf = (intptr_t) 0; 513 534 calm.nfyinfo.nfy.handler.tmehdr = (TMEHDR) alarm_handler; 514 SVC_PERROR(ALMHDR1 = acre_alm(&calm)); 515 syslog(LOG_NOTICE, "alarm handler is created with almid = %d.", 535 SVC_PERROR(ercd = acre_alm(&calm)); 536 if (ercd >= 0) { 537 ALMHDR1 = ercd; 538 syslog(LOG_NOTICE, "alarm handler is created with almid = %d.", 516 539 (int_t) ALMHDR1); 540 } 517 541 break; 518 542 case '#': 519 syslog(LOG_INFO, "#del_alm( 1)");543 syslog(LOG_INFO, "#del_alm(ALMHDR1)"); 520 544 SVC_PERROR(del_alm(ALMHDR1)); 521 545 break; … … 523 547 case 'V': 524 548 hrtcnt1 = fch_hrt(); 549 consume_time(1000LU); 525 550 hrtcnt2 = fch_hrt(); 526 551 syslog(LOG_NOTICE, "hrtcnt1 = %tu, hrtcnt2 = %tu", 527 hrtcnt1,hrtcnt2);552 (uint32_t) hrtcnt1, (uint32_t) hrtcnt2); 528 553 break; 529 554 … … 552 577 #endif /* BIT_KERNEL */ 553 578 579 case '\003': 580 case 'Q': 581 break; 582 554 583 default: 584 syslog(LOG_INFO, "Unknown command: '%c'.", c); 555 585 break; 556 586 } -
EcnlProtoTool/trunk/asp3_dcre/sample/sample1.cdl
r321 r429 30 30 31 31 /* 32 * システムログ機能の組上げ記述 32 * システムログ機能のアダプタの組上げ記述 33 * 34 * システムログ機能のアダプタは,C言語で記述されたコードから,TECSベー 35 * スのシステムログ機能を呼び出すためのセルである.システムログ機能の 36 * サービスコール(syslog,syslog_0~syslog_5,t_perrorを含む)を呼び 37 * 出さない場合には,以下のセルの組上げ記述を削除してよい. 38 */ 39 cell tSysLogAdapter SysLogAdapter { 40 cSysLog = SysLog.eSysLog; 41 }; 42 43 /* 44 * シリアルインタフェースドライバのアダプタの組上げ記述 45 * 46 * シリアルインタフェースドライバのアダプタは,C言語で記述されたコー 47 * ドから,TECSベースのシリアルインタフェースドライバを呼び出すための 48 * セルである.シリアルインタフェースドライバのサービスコールを呼び出 49 * さない場合には,以下のセルの組上げ記述を削除してよい. 50 */ 51 cell tSerialAdapter SerialAdapter { 52 cSerialPort[0] = SerialPort1.eSerialPort; 53 }; 54 55 /* 56 * システムログ機能の組上げ記述 33 57 * 34 58 * システムログ機能を外す場合には,以下のセルの組上げ記述を削除し,コ … … 49 73 50 74 /* 51 * C言語で記述されたアプリケーションから,TECSベースのシステムログ機能 52 * を呼び出すためのアダプタの組上げ記述 53 * 54 * システムログ機能のサービスコール(syslog関数とsyslog_0関数~syslog_5 55 * 関数以外のもの)ルをC言語で記述されたアプリケーションから呼び出さな 56 * い場合には,以下のセルの組上げ記述を削除すればよい. 57 */ 58 cell tSysLogAdapter SysLogAdapter { 59 cSysLog = SysLog.eSysLog; 60 }; 61 62 /* 63 * シリアルインタフェースドライバの組上げ記述 75 * シリアルインタフェースドライバの組上げ記述 64 76 * 65 77 * シリアルインタフェースドライバを外す場合には,以下のセルの組上げ記 … … 78 90 79 91 /* 80 * C言語で記述されたアプリケーションから,TECSベースのシリアルインタ 81 * フェースドライバを呼び出すためのアダプタの組上げ記述 82 * 83 * シリアルインタフェースドライバのサービスコールをC言語で記述されたア 84 * プリケーションから呼び出さない場合には,以下のセルの組上げ記述を削 85 * 除すればよい. 86 */ 87 cell tSerialAdapter SerialAdapter { 88 cSerialPort[0] = SerialPort1.eSerialPort; 89 }; 90 91 /* 92 * システムログタスクの組上げ記述 92 * システムログタスクの組上げ記述 93 93 * 94 94 * システムログタスクを外す場合には,以下のセルの組上げ記述を削除すれ … … 111 111 112 112 /* 113 * 113 * カーネル起動メッセージ出力の組上げ記述 114 114 * 115 115 * カーネル起動メッセージの出力を外す場合には,以下のセルの組上げ記述 -
EcnlProtoTool/trunk/asp3_dcre/sample/sample1.cfg
r321 r429 21 21 DEF_EXC(CPUEXC1, { TA_NULL, cpuexc_handler }); 22 22 #endif /* CPUEXC1 */ 23 DEF_ KMM({ KMM_SIZE, NULL });23 DEF_MPK({ MPK_SIZE, NULL }); -
EcnlProtoTool/trunk/asp3_dcre/sample/sample1.h
r321 r429 6 6 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory 7 7 * Toyohashi Univ. of Technology, JAPAN 8 * Copyright (C) 2004-201 6by Embedded and Real-Time Systems Laboratory8 * Copyright (C) 2004-2018 by Embedded and Real-Time Systems Laboratory 9 9 * Graduate School of Information Science, Nagoya Univ., JAPAN 10 10 * … … 57 57 58 58 #define EXC_PRIORITY 1 /* 例外処理タスクの優先度 */ 59 #define MAIN_PRIORITY 6/* メインタスクの優先度 */59 #define MAIN_PRIORITY 5 /* メインタスクの優先度 */ 60 60 /* HIGH_PRIORITYより高くすること */ 61 61 … … 76 76 #endif /* STACK_SIZE */ 77 77 78 #ifndef KMM_SIZE79 #define KMM_SIZE (STACK_SIZE * 16) /* カーネルが割り付ける */80 #endif /* KMM_SIZE */ /* メモリ領域のサイズ*/78 #ifndef MPK_SIZE /* カーネルメモリプール領域のサイズ */ 79 #define MPK_SIZE (STACK_SIZE * 16) 80 #endif /* MPK_SIZE */ 81 81 82 82 #ifndef LOOP_REF -
EcnlProtoTool/trunk/asp3_dcre/sample/sample1n.h
r331 r429 62 62 63 63 extern void net_syslog(uint_t prio, const char *format, ...) throw(); 64 externER_UINT net_serial_rea_dat(ID portid, char *buf, uint_t len) throw();64 static ER_UINT net_serial_rea_dat(ID portid, char *buf, uint_t len) throw(); 65 65 extern ER net_serial_ctl_por(ID portid, uint_t ioctl) throw(); 66 66 -
EcnlProtoTool/trunk/asp3_dcre/sample/tSample2.c
r321 r429 3 3 * Toyohashi Open Platform for Embedded Real-Time Systems/ 4 4 * Advanced Standard Profile Kernel 5 * 5 * 6 6 * Copyright (C) 2015-2016 by Ushio Laboratory 7 7 * Graduate School of Engineering Science, Osaka Univ., JAPAN 8 * Copyright (C) 2015-201 6by Embedded and Real-Time Systems Laboratory8 * Copyright (C) 2015-2019 by Embedded and Real-Time Systems Laboratory 9 9 * Graduate School of Information Science, Nagoya Univ., JAPAN 10 10 * … … 42 42 43 43 /* 44 * サンプルプログラム( 1)の本体45 * 46 * ASPカーネルの基本的な動作を確認するためのサンプルプログラム .44 * サンプルプログラム(2)の本体 45 * 46 * ASPカーネルの基本的な動作を確認するためのサンプルプログラム(TECS版). 47 47 * 48 48 * プログラムの概要: 49 49 * 50 * ユーザインタフェースを受け持つメインタスク( タスクID: MAIN_TASK,優51 * 先度: MAIN_PRIORITY)と,3つの並行実行されるタスク(タスクID:52 * TASK1~TASK3,初期優先度: MID_PRIORITY)で構成される.また,起動周53 * 期が2秒の周期ハンドラ(周期ハンドラID: CYCHDR1)を用いる.54 * 55 * 並行実行されるタスクは,task_loop回空ループを実行する度に,タスクが56 * 実行中であることをあらわすメッセージを表示する.空ループを実行する57 * のは,空ループなしでメッセージを出力すると,多量のメッセージが出力58 * され,プログラムの動作が確認しずらくなるためである.また,低速なシ50 * ユーザインタフェースを受け持つメインタスク(MainTask)と,3つの並 51 * 行実行されるタスク(Task1~Task3),例外処理タスク(ExceptionTask) 52 * の5つのタスクを用いる.これらの他に,システムログタスクが動作する. 53 * また,周期ハンドラ,アラームハンドラ,割込みサービスルーチン,CPU 54 * 例外ハンドラをそれぞれ1つ用いる. 55 * 56 * 並行実行されるタスクは,task_loop回のループを実行する度に,タスク 57 * が実行中であることをあらわすメッセージを表示する.ループを実行する 58 * のは,プログラムの動作を確認しやすくするためである.また,低速なシ 59 59 * リアルポートを用いてメッセージを出力する場合に,すべてのメッセージ 60 60 * が出力できるように,メッセージの量を制限するという理由もある. 61 61 * 62 * 周期ハンドラは,三つの優先度(HIGH_PRIORITY,MID_PRIORITY, 63 * LOW_PRIORITY)のレディキューを回転させる.プログラムの起動直後は, 64 * 周期ハンドラは停止状態になっている. 65 * 66 * メインタスクは,シリアルI/Oポートからの文字入力を行い(文字入力を 67 * 待っている間は,並列実行されるタスクが実行されている),入力された 68 * 文字に対応した処理を実行する.入力された文字と処理の関係は次の通り. 62 * 周期ハンドラ,アラームハンドラ,割込みサービスルーチンは,3つの優 63 * 先度(HIGH_PRIORITY,MID_PRIORITY,LOW_PRIORITY)のレディキューを 64 * 回転させる.周期ハンドラは,プログラムの起動直後は停止状態になって 65 * いる. 66 * 67 * CPU例外ハンドラは,CPU例外からの復帰が可能な場合には,例外処理タス 68 * クを起動する.例外処理タスクは,CPU例外を起こしたタスクに対して, 69 * 終了要求を行う. 70 * 71 * メインタスクは,シリアルポートからの文字入力を行い(文字入力を待っ 72 * ている間は,並行実行されるタスクが実行されている),入力された文字 73 * に対応した処理を実行する.入力された文字と処理の関係は次の通り. 69 74 * Control-Cまたは'Q'が入力されると,プログラムを終了する. 70 75 * … … 97 102 * 'b' : アラームハンドラを5秒後に起動するよう動作開始させる. 98 103 * 'B' : アラームハンドラを動作停止させる. 99 * 'z' : 対象タスクにCPU例外を発生させる(タ スクを終了させる).100 * 'Z' : 対象タスクにCPUロック状態でCPU例外を発生させる( プログラムを101 * 終了する).102 * 'V' : fetchHighResolutionTimerで高分解能タイマを2回読む.104 * 'z' : 対象タスクにCPU例外を発生させる(ターゲットによっては復帰可能). 105 * 'Z' : 対象タスクにCPUロック状態でCPU例外を発生させる(復帰不可能). 106 * 'V' : 短いループを挟んで,fetchHighResolutionTimerで高分解能タイマを 107 * 2回読む. 103 108 * 'v' : 発行したシステムコールを表示する(デフォルト). 104 109 * 'q' : 発行したシステムコールを表示しない. 105 * 呼び口関数 #_TCPF_# 106 * require port: signature:sKernel context:task 107 * ER getExtendedInformation( intptr_t* p_exinf ); 108 * ER sleep( ); 109 * ER sleepTimeout( TMO timeout ); 110 * ER delay( RELTIM delayTime ); 111 * ER exit( ); 112 * ER disableTerminate( ); 113 * ER enableTerminate( ); 114 * bool_t senseTerminate( ); 115 * ER setTime( SYSTIM systemTime ); 116 * ER getTime( SYSTIM* p_systemTime ); 117 * ER adjustTime( int32_t adjustTime ); 118 * HRTCNT fetchHighResolutionTimer( ); 119 * ER rotateReadyQueue( PRI taskPriority ); 120 * ER getTaskId( ID* p_taskId ); 121 * ER getLoad( PRI taskPriority, uint_t* p_load ); 122 * ER getNthTask( PRI taskPriority, uint_t nth, ID* p_taskID ); 123 * ER lockCpu( ); 124 * ER unlockCpu( ); 125 * ER disableDispatch( ); 126 * ER enableDispatch( ); 127 * bool_t senseContext( ); 128 * bool_t senseLock( ); 129 * bool_t senseDispatch( ); 130 * bool_t senseDispatchPendingState( ); 131 * bool_t senseKernel( ); 132 * ER exitKernel( ); 133 * ER changeInterruptPriorityMask( PRI interruptPriority ); 134 * ER getInterruptPriorityMask( PRI* p_interruptPriority ); 135 * require port: signature:siKernel context:non-task 136 * HRTCNT ciKernel_fetchHighResolutionTimer( ); 137 * ER ciKernel_rotateReadyQueue( PRI taskPriority ); 138 * ER ciKernel_getTaskId( ID* p_taskId ); 139 * ER ciKernel_lockCpu( ); 140 * ER ciKernel_unlockCpu( ); 141 * bool_t ciKernel_senseContext( ); 142 * bool_t ciKernel_senseLock( ); 143 * bool_t ciKernel_senseDispatch( ); 144 * bool_t ciKernel_senseDispatchPendingState( ); 145 * bool_t ciKernel_senseKernel( ); 146 * ER ciKernel_exitKernel( ); 147 * bool_t ciKernel_exceptionSenseDispatchPendingState( const void* p_exceptionInformation ); 148 * call port: cTask signature: sTask context:task 149 * ER cTask_activate( subscript ); 150 * ER_UINT cTask_cancelActivate( subscript ); 151 * ER cTask_getTaskState( subscript, STAT* p_tskstat ); 152 * ER cTask_changePriority( subscript, PRI priority ); 153 * ER cTask_getPriority( subscript, PRI* p_priority ); 154 * ER cTask_refer( subscript, T_RTSK* pk_taskStatus ); 155 * ER cTask_wakeup( subscript ); 156 * ER_UINT cTask_cancelWakeup( subscript ); 157 * ER cTask_releaseWait( subscript ); 158 * ER cTask_suspend( subscript ); 159 * ER cTask_resume( subscript ); 160 * ER cTask_raiseTerminate( subscript ); 161 * ER cTask_terminate( subscript ); 162 * subscript: 0...(NCP_cTask-1) 163 * call port: cExceptionTask signature: sTask context:task 164 * ER cExceptionTask_activate( ); 165 * ER_UINT cExceptionTask_cancelActivate( ); 166 * ER cExceptionTask_getTaskState( STAT* p_tskstat ); 167 * ER cExceptionTask_changePriority( PRI priority ); 168 * ER cExceptionTask_getPriority( PRI* p_priority ); 169 * ER cExceptionTask_refer( T_RTSK* pk_taskStatus ); 170 * ER cExceptionTask_wakeup( ); 171 * ER_UINT cExceptionTask_cancelWakeup( ); 172 * ER cExceptionTask_releaseWait( ); 173 * ER cExceptionTask_suspend( ); 174 * ER cExceptionTask_resume( ); 175 * ER cExceptionTask_raiseTerminate( ); 176 * ER cExceptionTask_terminate( ); 177 * call port: cCyclic signature: sCyclic context:task 178 * ER cCyclic_start( ); 179 * ER cCyclic_stop( ); 180 * ER cCyclic_refer( T_RCYC* pk_cyclicHandlerStatus ); 181 * call port: cAlarm signature: sAlarm context:task 182 * ER cAlarm_start( RELTIM alarmTime ); 183 * ER cAlarm_stop( ); 184 * ER cAlarm_refer( T_RALM* pk_alarmStatus ); 185 * call port: cSerialPort signature: sSerialPort context:task optional:true 186 * bool_t is_cSerialPort_joined() check if joined 187 * ER cSerialPort_open( ); 188 * ER cSerialPort_close( ); 189 * ER_UINT cSerialPort_read( char* buffer, uint_t length ); 190 * ER_UINT cSerialPort_write( const char* buffer, uint_t length ); 191 * ER cSerialPort_control( uint_t ioControl ); 192 * ER cSerialPort_refer( T_SERIAL_RPOR* pk_rpor ); 193 * call port: cSysLog signature: sSysLog context:task 194 * ER cSysLog_write( uint_t priority, const SYSLOG* p_syslog ); 195 * ER_UINT cSysLog_read( SYSLOG* p_syslog ); 196 * ER cSysLog_mask( uint_t logMask, uint_t lowMask ); 197 * ER cSysLog_refer( T_SYSLOG_RLOG* pk_rlog ); 198 * ER cSysLog_flush( ); 199 * #[</PREAMBLE>]# */ 110 */ 200 111 201 112 #include "tSample2_tecsgen.h" … … 220 131 221 132 /* 133 * プロセッサ時間の消費 134 * 135 * ループによりプロセッサ時間を消費する.最適化ができないように,ルー 136 * プ内でvolatile変数を読み込む. 137 */ 138 static volatile long_t volatile_var; 139 140 static void 141 consume_time(ulong_t ctime) 142 { 143 ulong_t i; 144 145 for (i = 0; i < ctime; i++) { 146 (void) volatile_var; 147 } 148 } 149 150 /* 222 151 * 並行実行されるタスクへのメッセージ領域 223 152 */ … … 232 161 * 並行実行されるタスク 233 162 */ 234 void eSampleTask_main(int_t subscript)235 { 236 volatile ulong_t i; 163 void 164 eSampleTask_main(int_t subscript) 165 { 237 166 int_t n = 0; 238 167 int_t tskno = subscript + 1; … … 243 172 syslog(LOG_NOTICE, "task%d is running (%03d). %s", 244 173 tskno, ++n, graph[tskno-1]); 245 for (i = 0; i < task_loop; i++);174 consume_time(task_loop); 246 175 c = message[tskno-1]; 247 176 message[tskno-1] = 0; … … 290 219 291 220 /* 221 * 割込みサービスルーチン 222 * 223 * HIGH_PRIORITY,MID_PRIORITY,LOW_PRIORITY の各優先度のレディキュー 224 * を回転させる. 225 */ 226 #ifdef INTNO1 227 228 void 229 eiISR_main(void) 230 { 231 intno1_clear(); 232 SVC_PERROR(ciKernel_rotateReadyQueue(HIGH_PRIORITY)); 233 SVC_PERROR(ciKernel_rotateReadyQueue(MID_PRIORITY)); 234 SVC_PERROR(ciKernel_rotateReadyQueue(LOW_PRIORITY)); 235 } 236 237 #endif /* INTNO1 */ 238 239 /* 292 240 * CPU例外ハンドラ 293 241 */ 294 295 242 ID cpuexc_tskid; /* CPU例外を起こしたタスクのID */ 296 243 … … 298 245 299 246 void 300 cpuexc_handler(void *p_excinf)247 eiCpuExceptionHandler_main(const void *p_excinf) 301 248 { 302 249 303 250 syslog(LOG_NOTICE, "CPU exception handler (p_excinf = %08p).", p_excinf); 304 251 if (ciKernel_senseContext() != true) { 305 syslog(LOG_WARNING, 306 "ciKernel_senseContext() is not truein CPU exception handler.");252 syslog(LOG_WARNING, "ciKernel_senseContext() is not true" 253 " in CPU exception handler."); 307 254 } 308 255 if (ciKernel_senseDispatchPendingState() != true) { 309 syslog(LOG_WARNING, 310 "ciKernel_senseDispatchPendingState() is not true in CPU exception handler."); 311 } 312 syslog(LOG_INFO, "ciKernel_senseLock() = %d ciKernel_senseDispatch() = %d ciKernel_exceptionSenseDispatchPendingState() = %d", 313 ciKernel_senseLock(), ciKernel_senseDispatch(), ciKernel_exceptionSenseDispatchPendingState(p_excinf)); 256 syslog(LOG_WARNING, "ciKernel_senseDispatchPendingState() is not true" 257 " in CPU exception handler."); 258 } 259 syslog(LOG_INFO, "ciKernel_senseLock() = %d, ciKernel_senseDispatch() = %d", 260 ciKernel_senseLock(), ciKernel_senseDispatch()); 261 syslog(LOG_INFO, "ciKernel_exceptionSenseDispatchPendingState() = %d", 262 ciKernel_exceptionSenseDispatchPendingState(p_excinf)); 314 263 315 264 if (ciKernel_exceptionSenseDispatchPendingState(p_excinf)) { 316 265 syslog(LOG_NOTICE, "Sample program ends with exception."); 317 SVC_PERROR(ciKernel_ senseKernel());266 SVC_PERROR(ciKernel_exitKernel()); 318 267 assert(0); 319 268 } 320 269 321 #ifdef PREPARE_RETURN_CPUEXC322 PREPARE_RETURN_CPUEXC;323 270 SVC_PERROR(ciKernel_getTaskId(&cpuexc_tskid)); 324 271 cExceptionTask_activate(); 325 #else /* PREPARE_RETURN_CPUEXC */326 syslog(LOG_NOTICE, "Sample program ends with exception.");327 SVC_PERROR(ciKernel_exitKernel());328 assert(0);329 #endif /* PREPARE_RETURN_CPUEXC */330 272 } 331 273 … … 338 280 * を回転させる. 339 281 */ 340 /* #[<ENTRY_FUNC>]# eiCyclicHandler_main 341 * name: eiCyclicHandler_main 342 * global_name: tSample2_eiCyclicHandler_main 343 * oneway: 344 * #[/ENTRY_FUNC>]# */ 345 void 346 eiCyclicHandler_main() 282 void 283 eiCyclicHandler_main(void) 347 284 { 348 285 SVC_PERROR(ciKernel_rotateReadyQueue(HIGH_PRIORITY)); … … 357 294 * を回転させる. 358 295 */ 359 /* #[<ENTRY_FUNC>]# eiAlarmHandler_main 360 * name: eiAlarmHandler_main 361 * global_name: tSample2_eiAlarmHandler_main 362 * oneway: 363 * #[/ENTRY_FUNC>]# */ 364 void 365 eiAlarmHandler_main() 296 void 297 eiAlarmHandler_main(void) 366 298 { 367 299 SVC_PERROR(ciKernel_rotateReadyQueue(HIGH_PRIORITY)); … … 369 301 SVC_PERROR(ciKernel_rotateReadyQueue(LOW_PRIORITY)); 370 302 } 303 371 304 /* 372 305 * 例外処理タスク 373 306 */ 374 /* #[<ENTRY_FUNC>]# eExceptionTask_main 375 * name: eExceptionTask_main 376 * global_name: tSample2_eExceptionTask_main 377 * oneway: 378 * #[/ENTRY_FUNC>]# */ 379 void eExceptionTask_main() 307 void 308 eExceptionTask_main(void) 380 309 { 381 310 SVC_PERROR(ras_ter(cpuexc_tskid)); 382 311 } 312 383 313 /* 384 314 * メインタスク 385 315 */ 386 /* 属性の設定 *//* #[<ENTRY_FUNC>]# eMainTask_main 387 * name: eMainTask_main 388 * global_name: tSample2_eMainTask_main 389 * oneway: 390 * #[/ENTRY_FUNC>]# */ 391 void 392 eMainTask_main() 316 void 317 eMainTask_main(void) 393 318 { 394 319 char c; 395 volatile ulong_t i;396 ulong_t j;397 320 int_t tskno = 1; 398 321 ER_UINT ercd; 399 322 PRI tskpri; 323 #ifndef TASK_LOOP 400 324 SYSTIM stime1, stime2; 325 #endif /* TASK_LOOP */ 401 326 HRTCNT hrtcnt1, hrtcnt2; 402 327 403 if (is_cSerialPort_joined()) { 404 SVC_PERROR(cSysLog_mask(LOG_UPTO(LOG_INFO), LOG_UPTO(LOG_ERROR))); 405 } else { 406 /* 407 * シリアル出力ができない場合、ログメッセージを全て 408 * 低レベル出力により出力する。 409 */ 410 SVC_PERROR(cSysLog_mask(LOG_UPTO(LOG_INFO), LOG_UPTO(LOG_DEBUG))); 411 } 328 SVC_PERROR(cSysLog_mask(LOG_UPTO(LOG_INFO), LOG_UPTO(LOG_EMERG))); 412 329 syslog(LOG_NOTICE, "Sample program starts."); 413 330 … … 419 336 * ない. 420 337 */ 421 422 if (is_cSerialPort_joined()) { 423 ercd = cSerialPort_open(); 424 if (ercd < 0 && MERCD(ercd) != E_OBJ) { 425 syslog(LOG_ERROR, "%s (%d) reported by `cSerialPort_open'.", 426 itron_strerror(ercd), SERCD(ercd)); 427 } 428 SVC_PERROR(cSerialPort_control(IOCTL_CRLF | IOCTL_FCSND | IOCTL_FCRCV)); 429 } 338 ercd = cSerialPort_open(); 339 if (ercd < 0 && MERCD(ercd) != E_OBJ) { 340 syslog(LOG_ERROR, "%s (%d) reported by `cSerialPort_open'.", 341 itron_strerror(ercd), SERCD(ercd)); 342 } 343 SVC_PERROR(cSerialPort_control(IOCTL_CRLF | IOCTL_FCSND | IOCTL_FCRCV)); 430 344 431 345 /* 432 346 * ループ回数の設定 433 347 * 434 * 並行実行されるタスク内での 空ループの回数(task_loop)は,空ルー435 * プの実行時間が約0.4秒になるように設定する.この設定のために,436 * LOOP_REF回の 空ループの実行時間を,その前後でget_timを呼ぶことで437 * 測定し,その測定結果から空ループの実行時間が0.4秒になるループ 回438 * 数を求め,task_loopに設定する.348 * 並行実行されるタスク内でのループの回数(task_loop)は,ループ 349 * の実行時間が約0.4秒になるように設定する.この設定のために, 350 * LOOP_REF回のループの実行時間を,その前後でgetTimeを呼ぶことで 351 * 測定し,その測定結果から空ループの実行時間が0.4秒になるループ 352 * 回数を求め,task_loopに設定する. 439 353 * 440 * LOOP_REFは,デフォルトでは1,000,000に設定しているが,想定したよ 441 * り遅いプロセッサでは,サンプルプログラムの実行開始に時間がかか 442 * りすぎるという問題を生じる.逆に想定したより速いプロセッサでは, 443 * LOOP_REF回の空ループの実行時間が短くなり,task_loopに設定する値 444 * の誤差が大きくなるという問題がある. 445 * 446 * そこで,そのようなターゲットでは,target_test.hで,LOOP_REFを適 447 * 切な値に定義するのが望ましい. 354 * LOOP_REFは,デフォルトでは1,000,000に設定しているが,想定した 355 * より遅いプロセッサでは,サンプルプログラムの実行開始に時間がか 356 * かりすぎるという問題を生じる.逆に想定したより速いプロセッサで 357 * は,LOOP_REF回のループの実行時間が短くなり,task_loopに設定す 358 * る値の誤差が大きくなるという問題がある.そこで,そのようなター 359 * ゲットでは,target_test.hで,LOOP_REFを適切な値に定義すること 360 * とする. 448 361 * 449 362 * また,task_loopの値を固定したい場合には,その値をTASK_LOOPにマ 450 * クロ定義する.TASK_LOOPがマクロ定義されている場合,上記の測定 を451 * 行わずに,TASK_LOOPに定義された値を空ループの回数とする.363 * クロ定義する.TASK_LOOPがマクロ定義されている場合,上記の測定 364 * を行わずに,TASK_LOOPに定義された値をループの回数とする. 452 365 * 453 * ターゲットによっては,空ループの実行時間の1回目の測定で,本来よ454 * りも長めになるものがある.このようなターゲットでは,MEASURE_TWICE455 * をマクロ定義することで,1回目の測定結果を捨てて,2回目の測定結果456 * を使う.366 * ターゲットによっては,ループの実行時間の1回目の測定で,本来より 367 * も長めになるものがある.このようなターゲットでは,MEASURE_TWICE 368 * をマクロ定義することで,1回目の測定結果を捨てて,2回目の測定結 369 * 果を使う. 457 370 */ 458 371 #ifdef TASK_LOOP … … 461 374 462 375 #ifdef MEASURE_TWICE 463 task_loop = LOOP_REF; 464 SVC_PERROR(get_tim(&stime1)); 465 for (i = 0; i < task_loop; i++); 466 SVC_PERROR(get_tim(&stime2)); 376 SVC_PERROR(getTime(&stime1)); 377 consume_time(LOOP_REF); 378 SVC_PERROR(getTime(&stime2)); 467 379 #endif /* MEASURE_TWICE */ 468 380 469 task_loop = LOOP_REF; 470 SVC_PERROR(get_tim(&stime1)); 471 for (i = 0; i < task_loop; i++); 472 SVC_PERROR(get_tim(&stime2)); 381 SVC_PERROR(getTime(&stime1)); 382 consume_time(LOOP_REF); 383 SVC_PERROR(getTime(&stime2)); 473 384 task_loop = LOOP_REF * 400LU / (ulong_t)(stime2 - stime1) * 1000LU; 474 385 … … 478 389 * タスクの起動 479 390 */ 480 481 SVC_PERROR(cTask_activate( 1 )); 482 SVC_PERROR(cTask_activate( 2 )); 483 SVC_PERROR(cTask_activate( 3 )); 391 SVC_PERROR(cTask_activate(1)); 392 SVC_PERROR(cTask_activate(2)); 393 SVC_PERROR(cTask_activate(3)); 484 394 485 395 /* 486 396 * メインループ 487 397 */ 488 if (is_cSerialPort_joined()) { 489 do { 490 SVC_PERROR(cSerialPort_read(&c, 1)); 491 switch (c) { 492 case 'e': 493 case 's': 494 case 'S': 495 case 'd': 496 case 'y': 497 case 'Y': 498 case 'z': 499 case 'Z': 500 message[tskno-1] = c; 501 break; 502 case '1': 503 tskno = 1; 504 break; 505 case '2': 506 tskno = 2; 507 break; 508 case '3': 509 tskno = 3; 510 break; 511 case 'a': 512 syslog(LOG_INFO, "#cTask_activate(%d)", tskno); 513 SVC_PERROR(cTask_activate(tskno)); 514 break; 515 case 'A': 516 syslog(LOG_INFO, "#cTask_cancelActivate(%d)", tskno); 517 SVC_PERROR(cTask_cancelActivate(tskno)); 518 519 if (ercd >= 0) { 520 syslog(LOG_NOTICE, "cTask_cancelActivate(%d) returns %d", tskno, ercd); 521 } 522 break; 523 case 't': 524 syslog(LOG_INFO, "#cTask_terminate(%d)", tskno); 525 SVC_PERROR(cTask_terminate(tskno)); 526 break; 527 case '>': 528 syslog(LOG_INFO, "#cTask_changePriority(%d, HIGH_PRIORITY)", tskno); 529 SVC_PERROR(cTask_changePriority(tskno, HIGH_PRIORITY)); 530 break; 531 case '=': 532 syslog(LOG_INFO, "#cTask_changePriority(%d, MID_PRIORITY)", tskno); 533 SVC_PERROR(cTask_changePriority(tskno, MID_PRIORITY)); 534 break; 535 case '<': 536 syslog(LOG_INFO, "#(cTask_changePriority(%d, LOW_PRIORITY)", tskno); 537 SVC_PERROR(cTask_changePriority(tskno, LOW_PRIORITY)); 538 break; 539 case 'G': 540 syslog(LOG_INFO, "#cTask_getPriority(%d, &tskpri)", tskno); 541 SVC_PERROR(ercd = cTask_getPriority(tskno, &tskpri)); 542 if (ercd >= 0) { 543 syslog(LOG_NOTICE, "priority of task %d is %d", tskno, tskpri); 544 } 545 break; 546 case 'w': 547 syslog(LOG_INFO, "#cTask_wakeup(%d)", tskno); 548 SVC_PERROR(cTask_wakeup(tskno)); 549 break; 550 case 'W': 551 syslog(LOG_INFO, "#cTask_cancelWakeup(%d)", tskno); 552 SVC_PERROR(ercd = cTask_cancelWakeup(tskno)); 553 if (ercd >= 0) { 554 syslog(LOG_NOTICE, "cTask_cancelWakeup(%d) returns %d", tskno, ercd); 555 } 556 break; 557 case 'l': 558 syslog(LOG_INFO, "#cTask_releaseWait(%d)", tskno); 559 SVC_PERROR(cTask_releaseWait(tskno)); 560 break; 561 case 'u': 562 syslog(LOG_INFO, "#cTask_suspend(%d)", tskno); 563 SVC_PERROR(cTask_suspend(tskno)); 564 break; 565 case 'm': 566 syslog(LOG_INFO, "#cTask_resume(%d)", tskno); 567 SVC_PERROR(cTask_resume(tskno)); 568 break; 569 case 'x': 570 syslog(LOG_INFO, "#cTask_raiseTerminate(%d)", tskno); 571 SVC_PERROR(cTask_raiseTerminate(tskno)); 572 break; 573 case 'X': 574 syslog(LOG_INFO, "#cTask_raiseTerminate(%d)", tskno); 575 SVC_PERROR(cTask_raiseTerminate(tskno)); 576 break; 577 case 'r': 578 syslog(LOG_INFO, "#rotateReadyQueue(three priorities)"); 579 SVC_PERROR(rotateReadyQueue(HIGH_PRIORITY)); 580 SVC_PERROR(rotateReadyQueue(MID_PRIORITY)); 581 SVC_PERROR(rotateReadyQueue(LOW_PRIORITY)); 582 break; 583 case 'c': 584 syslog(LOG_INFO, "#cCyclic_start(1)"); 585 SVC_PERROR(cCyclic_start()); 586 break; 587 case 'C': 588 syslog(LOG_INFO, "#cCyclic_stop(1)"); 589 SVC_PERROR(cCyclic_stop()); 590 break; 591 case 'b': 592 syslog(LOG_INFO, "#cAlarm_start(1, 5000000)"); 593 SVC_PERROR(cAlarm_start(5000000)); 594 break; 595 case 'B': 596 syslog(LOG_INFO, "#cAlarm_stop()(1)"); 597 SVC_PERROR(cAlarm_stop()); 598 break; 599 case 'V': 600 hrtcnt1 = fetchHighResolutionTimer(); 601 hrtcnt2 = fetchHighResolutionTimer(); 602 syslog(LOG_NOTICE, "hrtcnt1 = %tu, hrtcnt2 = %tu", 603 hrtcnt1, hrtcnt2); 604 break; 605 case 'v': 606 SVC_PERROR(cSysLog_mask(LOG_UPTO(LOG_INFO), 607 LOG_UPTO(LOG_EMERG))); 608 break; 609 case 'q': 610 SVC_PERROR(cSysLog_mask(LOG_UPTO(LOG_NOTICE), 611 LOG_UPTO(LOG_EMERG))); 612 break; 613 #ifdef BIT_KERNEL 614 case ' ': 615 SVC_PERROR(lockCpu()); 616 { 617 extern ER bit_kernel(void); 618 619 SVC_PERROR(ercd = bit_kernel()); 620 if (ercd >= 0) { 621 syslog(LOG_NOTICE, "bit_kernel passed."); 622 } 623 } 624 SVC_PERROR(unlockCpu()); 625 break; 626 #endif /* BIT_KERNEL */ 627 628 default: 629 break; 398 do { 399 SVC_PERROR(cSerialPort_read(&c, 1)); 400 switch (c) { 401 case 'e': 402 case 's': 403 case 'S': 404 case 'd': 405 case 'y': 406 case 'Y': 407 case 'z': 408 case 'Z': 409 message[tskno-1] = c; 410 break; 411 case '1': 412 tskno = 1; 413 break; 414 case '2': 415 tskno = 2; 416 break; 417 case '3': 418 tskno = 3; 419 break; 420 case 'a': 421 syslog(LOG_INFO, "#cTask_activate(%d)", tskno); 422 SVC_PERROR(cTask_activate(tskno)); 423 break; 424 case 'A': 425 syslog(LOG_INFO, "#cTask_cancelActivate(%d)", tskno); 426 SVC_PERROR(ercd = cTask_cancelActivate(tskno)); 427 if (ercd >= 0) { 428 syslog(LOG_NOTICE, "cTask_cancelActivate(%d) returns %d", 429 tskno, ercd); 630 430 } 631 } while (c != '\003' && c != 'Q'); 632 } else { 633 syslog(LOG_NOTICE, "cSerialPort of tSample2 is not joined."); 634 syslog(LOG_NOTICE, "Sample program will halt after 40 seconds."); 635 for (j = 0; j < 100; j++) { 636 for (i = 0; i < task_loop; i++); 431 break; 432 case 't': 433 syslog(LOG_INFO, "#cTask_terminate(%d)", tskno); 434 SVC_PERROR(cTask_terminate(tskno)); 435 break; 436 case '>': 437 syslog(LOG_INFO, "#cTask_changePriority(%d, HIGH_PRIORITY)", tskno); 438 SVC_PERROR(cTask_changePriority(tskno, HIGH_PRIORITY)); 439 break; 440 case '=': 441 syslog(LOG_INFO, "#cTask_changePriority(%d, MID_PRIORITY)", tskno); 442 SVC_PERROR(cTask_changePriority(tskno, MID_PRIORITY)); 443 break; 444 case '<': 445 syslog(LOG_INFO, "#(cTask_changePriority(%d, LOW_PRIORITY)", tskno); 446 SVC_PERROR(cTask_changePriority(tskno, LOW_PRIORITY)); 447 break; 448 case 'G': 449 syslog(LOG_INFO, "#cTask_getPriority(%d, &tskpri)", tskno); 450 SVC_PERROR(ercd = cTask_getPriority(tskno, &tskpri)); 451 if (ercd >= 0) { 452 syslog(LOG_NOTICE, "priority of task %d is %d", tskno, tskpri); 453 } 454 break; 455 case 'w': 456 syslog(LOG_INFO, "#cTask_wakeup(%d)", tskno); 457 SVC_PERROR(cTask_wakeup(tskno)); 458 break; 459 case 'W': 460 syslog(LOG_INFO, "#cTask_cancelWakeup(%d)", tskno); 461 SVC_PERROR(ercd = cTask_cancelWakeup(tskno)); 462 if (ercd >= 0) { 463 syslog(LOG_NOTICE, "cTask_cancelWakeup(%d) returns %d", 464 tskno, ercd); 465 } 466 break; 467 case 'l': 468 syslog(LOG_INFO, "#cTask_releaseWait(%d)", tskno); 469 SVC_PERROR(cTask_releaseWait(tskno)); 470 break; 471 case 'u': 472 syslog(LOG_INFO, "#cTask_suspend(%d)", tskno); 473 SVC_PERROR(cTask_suspend(tskno)); 474 break; 475 case 'm': 476 syslog(LOG_INFO, "#cTask_resume(%d)", tskno); 477 SVC_PERROR(cTask_resume(tskno)); 478 break; 479 case 'x': 480 syslog(LOG_INFO, "#cTask_raiseTerminate(%d)", tskno); 481 SVC_PERROR(cTask_raiseTerminate(tskno)); 482 break; 483 case 'X': 484 syslog(LOG_INFO, "#cTask_raiseTerminate(%d)", tskno); 485 SVC_PERROR(cTask_raiseTerminate(tskno)); 486 break; 487 case 'r': 488 syslog(LOG_INFO, "#rotateReadyQueue(three priorities)"); 489 SVC_PERROR(rotateReadyQueue(HIGH_PRIORITY)); 490 SVC_PERROR(rotateReadyQueue(MID_PRIORITY)); 491 SVC_PERROR(rotateReadyQueue(LOW_PRIORITY)); 492 break; 493 case 'c': 494 syslog(LOG_INFO, "#cCyclic_start()"); 495 SVC_PERROR(cCyclic_start()); 496 break; 497 case 'C': 498 syslog(LOG_INFO, "#cCyclic_stop()"); 499 SVC_PERROR(cCyclic_stop()); 500 break; 501 case 'b': 502 syslog(LOG_INFO, "#cAlarm_start(5000000)"); 503 SVC_PERROR(cAlarm_start(5000000)); 504 break; 505 case 'B': 506 syslog(LOG_INFO, "#cAlarm_stop()"); 507 SVC_PERROR(cAlarm_stop()); 508 break; 509 510 case 'V': 511 hrtcnt1 = fetchHighResolutionTimer(); 512 consume_time(1000LU); 513 hrtcnt2 = fetchHighResolutionTimer(); 514 syslog(LOG_NOTICE, "hrtcnt1 = %tu, hrtcnt2 = %tu", 515 (uint32_t) hrtcnt1, (uint32_t) hrtcnt2); 516 break; 517 518 case 'v': 519 SVC_PERROR(cSysLog_mask(LOG_UPTO(LOG_INFO), 520 LOG_UPTO(LOG_EMERG))); 521 break; 522 case 'q': 523 SVC_PERROR(cSysLog_mask(LOG_UPTO(LOG_NOTICE), 524 LOG_UPTO(LOG_EMERG))); 525 break; 526 527 case '\003': 528 case 'Q': 529 break; 530 531 default: 532 syslog(LOG_INFO, "Unknown command: '%c'.", c); 533 break; 637 534 } 638 } 535 } while (c != '\003' && c != 'Q'); 639 536 640 537 syslog(LOG_NOTICE, "Sample program ends."); 641 SVC_PERROR( ciKernel_exitKernel());538 SVC_PERROR(exitKernel()); 642 539 assert(0); 643 540 } -
EcnlProtoTool/trunk/asp3_dcre/sample/tSample2.cdl
r321 r429 4 4 * $Id$ 5 5 */ 6 6 7 /* 7 8 * カーネルオブジェクトの定義 8 9 */ 9 import( "kernel.cdl");10 import(<kernel.cdl>); 10 11 11 12 /* … … 14 15 import("syssvc/tSerialPort.cdl"); 15 16 import("syssvc/tSysLog.cdl"); 17 import("syssvc/tSysLogAdapter.cdl"); 16 18 import("syssvc/tLogTask.cdl"); 17 19 import("syssvc/tBanner.cdl"); … … 23 25 24 26 /* 27 * サンプルプログラムのC言語ヘッダファイルの取り込み 28 */ 29 import_C("tSample2.h"); 30 31 /* 25 32 * 「セルの組上げ記述」とは,"cell"で始まる行から,それに対応する"};" 26 33 * の行までのことを言う. … … 28 35 29 36 /* 30 * システムログ機能の組上げ記述 37 * システムログ機能のアダプタの組上げ記述 38 * 39 * システムログ機能のアダプタは,C言語で記述されたコードから,TECSベー 40 * スのシステムログ機能を呼び出すためのセルである.システムログ機能の 41 * サービスコール(syslog,syslog_0~syslog_5,t_perrorを含む)を呼び 42 * 出さない場合には,以下のセルの組上げ記述を削除してよい. 43 */ 44 cell tSysLogAdapter SysLogAdapter { 45 cSysLog = SysLog.eSysLog; 46 }; 47 48 /* 49 * システムログ機能の組上げ記述 31 50 * 32 51 * システムログ機能を外す場合には,以下のセルの組上げ記述を削除し,コ … … 42 61 initLowMask = C_EXP("LOG_UPTO(LOG_EMERG)"); 43 62 /* 低レベル出力すべき重要度 */ 44 45 63 /* 低レベル出力との結合 */ 46 64 cPutLog = PutLogTarget.ePutLog; … … 48 66 49 67 /* 50 * 68 * シリアルインタフェースドライバの組上げ記述 51 69 * 52 70 * シリアルインタフェースドライバを外す場合には,以下のセルの組上げ記 … … 65 83 66 84 /* 67 * 85 * システムログタスクの組上げ記述 68 86 * 69 87 * システムログタスクを外す場合には,以下のセルの組上げ記述を削除すれ … … 86 104 87 105 /* 88 * 106 * カーネル起動メッセージ出力の組上げ記述 89 107 * 90 108 * カーネル起動メッセージの出力を外す場合には,以下のセルの組上げ記述 … … 98 116 99 117 /* 100 * サンプルプログラムの定義118 * サンプルプログラムのセルタイプの定義 101 119 */ 102 120 [singleton] … … 111 129 call sAlarm cAlarm; 112 130 113 [optional] call sSerialPort cSerialPort;/* シリアルドライバとの接続 */131 call sSerialPort cSerialPort; /* シリアルドライバとの接続 */ 114 132 call sSysLog cSysLog; /* システムログ機能との接続 */ 115 133 … … 118 136 entry sTaskBody eExceptionTask; /* 例外処理タスク */ 119 137 120 entry siHandlerBody eiCyclicHandler;/* 周期ハンドラ*/ 121 entry siHandlerBody eiAlarmHandler; /* アラームハンドラ */ 122 }; 123 124 /* 125 * 組み上げ記述 126 */ 127 128 /* Sample2のプロトタイプ宣言 */ 129 cell tSample2 Sample2; 130 131 cell tKernel ASPKernel{ 138 entry siHandlerBody eiCyclicHandler; /* 周期ハンドラ*/ 139 entry siHandlerBody eiAlarmHandler; /* アラームハンドラ */ 140 141 entry siHandlerBody eiISR; /* 割込みサービスルーチン */ 142 143 entry siCpuExceptionHandlerBody eiCpuExceptionHandler; 144 /* CPU例外ハンドラ */ 145 }; 146 147 /* 148 * 組み上げ記述 149 */ 150 151 cell tKernel ASPKernel { 132 152 }; 133 153 … … 181 201 182 202 cell tAlarmHandler AlarmHandler { 203 /* 呼び口の結合 */ 183 204 ciHandlerBody = Sample2.eiAlarmHandler; 184 205 }; 185 206 207 cell tInterruptRequest InterruptRequest { 208 /* 属性の設定 */ 209 interruptNumber = C_EXP("INTNO1"); 210 attribute = C_EXP("INTNO1_INTATR"); 211 interruptPriority = C_EXP("INTNO1_INTPRI"); 212 }; 213 214 cell tISR InterruptServiceRoutine { 215 /* 呼び口の結合 */ 216 ciISRBody = Sample2.eiISR; 217 /* 属性の設定 */ 218 attribute = C_EXP("TA_NULL"); 219 interruptNumber = C_EXP("INTNO1"); 220 }; 221 222 cell tCpuExceptionHandler CpuExceptionHandler { 223 /* 呼び口の結合 */ 224 ciCpuExceptionHandlerBody = Sample2.eiCpuExceptionHandler; 225 /* 属性の設定 */ 226 cpuExceptionHandlerNumber = C_EXP("CPUEXC1"); 227 }; 228 186 229 cell tSample2 Sample2 { 187 230 /* 呼び口の結合 */ 188 cTask[ 0] = MainTask.eTask;189 cTask[ 1] = Task1.eTask;190 cTask[ 2] = Task2.eTask;191 cTask[ 3] = Task3.eTask;231 cTask[0] = MainTask.eTask; 232 cTask[1] = Task1.eTask; 233 cTask[2] = Task2.eTask; 234 cTask[3] = Task3.eTask; 192 235 193 236 cExceptionTask = ExceptionTask.eTask; -
EcnlProtoTool/trunk/asp3_dcre/sample/tSample2.cfg
r321 r429 4 4 * $Id$ 5 5 */ 6 INCLUDE("gen/tecsgen.cfg"); 7 8 #include "tSample2.h" 9 10 #ifdef CPUEXC1 11 DEF_EXC(CPUEXC1, { TA_NULL, cpuexc_handler }); 12 #endif /* CPUEXC1 */ 6 INCLUDE("tecsgen.cfg"); -
EcnlProtoTool/trunk/asp3_dcre/sample/tSample2.h
r321 r429 6 6 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory 7 7 * Toyohashi Univ. of Technology, JAPAN 8 * Copyright (C) 2004-20 07by Embedded and Real-Time Systems Laboratory8 * Copyright (C) 2004-2018 by Embedded and Real-Time Systems Laboratory 9 9 * Graduate School of Information Science, Nagoya Univ., JAPAN 10 10 * … … 55 55 56 56 #define EXC_PRIORITY 1 /* 例外処理タスクの優先度 */ 57 #define MAIN_PRIORITY 6/* メインタスクの優先度 */57 #define MAIN_PRIORITY 5 /* メインタスクの優先度 */ 58 58 /* HIGH_PRIORITYより高くすること */ 59 59 … … 75 75 76 76 /* 77 * 関数のプロトタイプ宣言77 * 必要な定義のチェック 78 78 */ 79 #ifndef TOPPERS_MACRO_ONLY 80 81 //extern void task(intptr_t exinf); 82 extern void main_task(intptr_t exinf); 83 extern void cyclic_handler(intptr_t exinf); 84 extern void alarm_handler(intptr_t exinf); 85 extern void cpuexc_handler(void *p_excinf); 86 87 #endif /* TOPPERS_MACRO_ONLY */ 79 #ifndef INTNO1 80 #error INTNO1 is necessary for this sample program. 81 #endif /* INTNO1 */ 82 #ifndef CPUEXC1 83 #error CPUEXC1 is necessary for this sample program. 84 #endif /* CPUEXC1 */ -
EcnlProtoTool/trunk/asp3_dcre/syssvc/histogram.h
r321 r429 3 3 * Toyohashi Open Platform for Embedded Real-Time Systems 4 4 * 5 * Copyright (C) 2006-201 6by Embedded and Real-Time Systems Laboratory5 * Copyright (C) 2006-2018 by Embedded and Real-Time Systems Laboratory 6 6 * Graduate School of Information Science, Nagoya Univ., JAPAN 7 7 * … … 54 54 * 実行時間分布計測の初期化 55 55 */ 56 extern voidinit_hist(ID histid);56 extern ER init_hist(ID histid); 57 57 58 58 /* 59 59 * 実行時間計測の開始 60 60 */ 61 extern voidbegin_measure(ID histid);61 extern ER begin_measure(ID histid); 62 62 63 63 /* 64 64 * 実行時間計測の終了 65 65 */ 66 extern voidend_measure(ID histid);66 extern ER end_measure(ID histid); 67 67 68 68 /* 69 69 * 実行時間分布計測の表示 70 70 */ 71 extern voidprint_hist(ID histid);71 extern ER print_hist(ID histid); 72 72 73 73 #ifdef __cplusplus -
EcnlProtoTool/trunk/asp3_dcre/syssvc/serial.h
r321 r429 1 1 /* 2 * TOPPERS/ASP Kernel 3 * Toyohashi Open Platform for Embedded Real-Time Systems/ 4 * Advanced Standard Profile Kernel 2 * TOPPERS Software 3 * Toyohashi Open Platform for Embedded Real-Time Systems 5 4 * 6 5 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory … … 48 47 #define TOPPERS_SERIAL_H 49 48 50 #include <kernel.h>51 52 49 #ifdef __cplusplus 53 50 extern "C" { 54 51 #endif 52 53 #include <kernel.h> 55 54 56 55 /* … … 62 61 } T_SERIAL_RPOR; 63 62 63 #ifdef TOPPERS_OMIT_TECS 64 /* 65 * シリアルインタフェースドライバの初期化ルーチン 66 */ 67 extern void serial_initialize(intptr_t exinf) throw(); 68 69 /* 70 * シリアルインタフェースドライバからの未送信文字の取出し 71 */ 72 extern bool_t serial_get_chr(ID portid, char *p_c) throw(); 73 #endif 74 64 75 /* 65 76 * シリアルインタフェースドライバのサービスコール … … 67 78 extern ER serial_opn_por(ID portid) throw(); 68 79 extern ER serial_cls_por(ID portid) throw(); 69 extern ER_UINT serial_ rea_dat(ID portid, char *buf, uint_t len) throw();80 extern ER_UINT serial_trea_dat(ID portid, char *buf, uint_t len, TMO tmout) throw(); 70 81 extern ER_UINT serial_wri_dat(ID portid, const char *buf, uint_t len) throw(); 71 82 extern ER serial_ctl_por(ID portid, uint_t ioctl) throw(); 72 83 extern ER serial_ref_por(ID portid, T_SERIAL_RPOR *pk_rpor) throw(); 84 85 Inline ER_UINT serial_rea_dat(ID portid, char *buf, uint_t len) 86 { 87 return serial_trea_dat(portid, buf, len, TMO_FEVR); 88 } 73 89 74 90 /* -
EcnlProtoTool/trunk/asp3_dcre/syssvc/syslog.h
r321 r429 1 1 /* 2 * TOPPERS/ASP Kernel 3 * Toyohashi Open Platform for Embedded Real-Time Systems/ 4 * Advanced Standard Profile Kernel 2 * TOPPERS Software 3 * Toyohashi Open Platform for Embedded Real-Time Systems 5 4 * 6 5 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory … … 55 54 #include <t_syslog.h> 56 55 56 #ifdef TOPPERS_OMIT_TECS 57 /* 58 * ログバッファのサイズ 59 */ 60 #ifndef TCNT_SYSLOG_BUFFER 61 #define TCNT_SYSLOG_BUFFER 32 /* ログバッファのサイズ */ 62 #endif /* TCNT_SYSLOG_BUFFER */ 63 64 /* 65 * システムログ機能の初期化 66 */ 67 extern void syslog_initialize(intptr_t exinf) throw(); 68 #endif 69 70 /* 71 * ログ情報の重要度のビットマップを作るためのマクロ 72 */ 73 #define LOG_MASK(prio) (1U << (prio)) 74 #define LOG_UPTO(prio) ((1U << ((prio) + 1)) - 1) 75 76 /* 77 * パケット形式の定義 78 */ 79 typedef struct t_syslog_rlog { 80 uint_t count; /* ログバッファ中のログの数 */ 81 uint_t lost; /* 失われたログの数 */ 82 uint_t logmask; /* ログバッファに記録すべき重要度 */ 83 uint_t lowmask; /* 低レベル出力すべき重要度 */ 84 } T_SYSLOG_RLOG; 85 57 86 /* 58 87 * ログ情報の出力 … … 68 97 * 出力すべきログ情報の重要度の設定 69 98 */ 70 extern ER syslog_msk_log(uint_t logmask, uint_t lowmask) throw();99 extern ER syslog_msk_log(uint_t logmask, uint_t lowmask) throw(); 71 100 72 101 /* 73 102 * ログバッファの状態参照 74 103 */ 75 extern ER syslog_ref_log(T_SYSLOG_RLOG *pk_rlog) throw();104 extern ER syslog_ref_log(T_SYSLOG_RLOG *pk_rlog) throw(); 76 105 77 106 /* 78 107 * 低レベル出力によるすべてのログ情報の出力 79 108 */ 80 extern ER syslog_fls_log(void) throw();109 extern ER syslog_fls_log(void) throw(); 81 110 82 111 #ifdef __cplusplus -
EcnlProtoTool/trunk/asp3_dcre/syssvc/tBanner.cdl
r321 r429 1 1 /* 2 * TOPPERS/ASP Kernel 3 * Toyohashi Open Platform for Embedded Real-Time Systems/ 4 * Advanced Standard Profile Kernel 2 * TOPPERS Software 3 * Toyohashi Open Platform for Embedded Real-Time Systems 5 4 * 6 5 * Copyright (C) 2016 by Embedded and Real-Time Systems Laboratory -
EcnlProtoTool/trunk/asp3_dcre/syssvc/tBannerMain.c
r321 r429 6 6 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory 7 7 * Toyohashi Univ. of Technology, JAPAN 8 * Copyright (C) 2004-201 7by Embedded and Real-Time Systems Laboratory8 * Copyright (C) 2004-2019 by Embedded and Real-Time Systems Laboratory 9 9 * Graduate School of Information Science, Nagoya Univ., JAPAN 10 10 * … … 56 56 "Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory\n" 57 57 " Toyohashi Univ. of Technology, JAPAN\n" 58 "Copyright (C) 2004-201 7by Embedded and Real-Time Systems Laboratory\n"58 "Copyright (C) 2004-2019 by Embedded and Real-Time Systems Laboratory\n" 59 59 " Graduate School of Information Science, Nagoya Univ., JAPAN\n" 60 60 "%s"; -
EcnlProtoTool/trunk/asp3_dcre/syssvc/tHistogram.c
r321 r429 3 3 * Toyohashi Open Platform for Embedded Real-Time Systems 4 4 * 5 * Copyright (C) 2006-201 6by Embedded and Real-Time Systems Laboratory5 * Copyright (C) 2006-2018 by Embedded and Real-Time Systems Laboratory 6 6 * Graduate School of Information Science, Nagoya Univ., JAPAN 7 7 * … … 43 43 44 44 #include "tHistogram_tecsgen.h" 45 #define syslog_write cSysLog_write46 45 #include <t_syslog.h> 47 #include <log_output.h>48 46 49 47 /* 50 48 * 実行時間分布計測の初期化(受け口関数) 51 49 */ 52 void 50 ER 53 51 eHistogram_initialize(CELLIDX idx) 54 52 { … … 61 59 VAR_over = 0U; 62 60 VAR_under = 0U; 61 return(E_OK); 63 62 } 64 63 … … 66 65 * 実行時間計測の開始(受け口関数) 67 66 */ 68 void 67 ER 69 68 eHistogram_beginMeasure(CELLIDX idx) 70 69 { … … 73 72 HIST_BM_HOOK(); 74 73 HIST_GET_TIM(&VAR_begin_time); 74 return(E_OK); 75 75 } 76 76 … … 78 78 * 実行時間計測の終了(受け口関数) 79 79 */ 80 void 80 ER 81 81 eHistogram_endMeasure(CELLIDX idx) 82 82 { … … 103 103 VAR_under++; 104 104 } 105 return(E_OK); 105 106 } 106 107 … … 108 109 * 実行時間分布計測の表示(受け口関数) 109 110 */ 110 void 111 ER 111 112 eHistogram_print(CELLIDX idx) 112 113 { … … 125 126 syslog_1(LOG_NOTICE, "> INT_MAX : %d", VAR_under); 126 127 } 128 return(E_OK); 127 129 } -
EcnlProtoTool/trunk/asp3_dcre/syssvc/tHistogram.cdl
r321 r429 3 3 * Toyohashi Open Platform for Embedded Real-Time Systems 4 4 * 5 * Copyright (C) 2016 by Embedded and Real-Time Systems Laboratory5 * Copyright (C) 2016-2018 by Embedded and Real-Time Systems Laboratory 6 6 * Graduate School of Information Science, Nagoya Univ., JAPAN 7 7 * … … 51 51 * 実行時間分布計測の初期化 52 52 */ 53 voidinitialize(void);53 ER initialize(void); 54 54 55 55 /* 56 56 * 実行時間計測の開始 57 57 */ 58 voidbeginMeasure(void);58 ER beginMeasure(void); 59 59 60 60 /* 61 61 * 実行時間計測の終了 62 62 */ 63 voidendMeasure(void);63 ER endMeasure(void); 64 64 65 65 /* 66 66 * 実行時間分布計測の表示 67 67 */ 68 voidprint(void);68 ER print(void); 69 69 }; 70 70 -
EcnlProtoTool/trunk/asp3_dcre/syssvc/tHistogramAdapter.c
r321 r429 1 1 /* 2 * TOPPERS/ASP Kernel 3 * Toyohashi Open Platform for Embedded Real-Time Systems/ 4 * Advanced Standard Profile Kernel 2 * TOPPERS Software 3 * Toyohashi Open Platform for Embedded Real-Time Systems 5 4 * 6 * Copyright (C) 2016 by Embedded and Real-Time Systems Laboratory5 * Copyright (C) 2016-2018 by Embedded and Real-Time Systems Laboratory 7 6 * Graduate School of Information Science, Nagoya Univ., JAPAN 8 7 * … … 48 47 49 48 /* 49 * 実行時間分布計測IDの範囲の判定 50 */ 51 #define VALID_HISTID(histid) (1 <= histid && histid <= N_CP_cHistogram) 52 53 /* 50 54 * 実行時間分布計測の初期化(サービスコール) 51 55 */ 52 void 56 ER 53 57 init_hist(ID histid) 54 58 { 55 assert(1 <= histid && histid <= N_CP_cHistogram); 56 return(cHistogram_initialize(histid - 1)); 59 ER ercd; 60 61 if (!VALID_HISTID(histid)) { 62 ercd = E_ID; 63 } 64 else { 65 ercd = cHistogram_initialize(histid - 1); 66 } 67 return(ercd); 57 68 } 58 69 … … 60 71 * 実行時間計測の開始 61 72 */ 62 void 73 ER 63 74 begin_measure(ID histid) 64 75 { 65 assert(1 <= histid && histid <= N_CP_cHistogram); 66 return(cHistogram_beginMeasure(histid - 1)); 76 ER ercd; 77 78 if (!VALID_HISTID(histid)) { 79 ercd = E_ID; 80 } 81 else { 82 ercd = cHistogram_beginMeasure(histid - 1); 83 } 84 return(ercd); 67 85 } 68 86 … … 70 88 * 実行時間計測の終了 71 89 */ 72 void 90 ER 73 91 end_measure(ID histid) 74 92 { 75 assert(1 <= histid && histid <= N_CP_cHistogram); 76 return(cHistogram_endMeasure(histid - 1)); 93 ER ercd; 94 95 if (!VALID_HISTID(histid)) { 96 ercd = E_ID; 97 } 98 else { 99 ercd = cHistogram_endMeasure(histid - 1); 100 } 101 return(ercd); 77 102 } 78 103 … … 80 105 * 実行時間分布計測の表示 81 106 */ 82 void 107 ER 83 108 print_hist(ID histid) 84 109 { 85 assert(1 <= histid && histid <= N_CP_cHistogram); 86 return(cHistogram_print(histid - 1)); 110 ER ercd; 111 112 if (!VALID_HISTID(histid)) { 113 ercd = E_ID; 114 } 115 else { 116 ercd = cHistogram_print(histid - 1); 117 } 118 return(ercd); 87 119 } -
EcnlProtoTool/trunk/asp3_dcre/syssvc/tLogTask.cdl
r321 r429 1 1 /* 2 * TOPPERS/ASP Kernel 3 * Toyohashi Open Platform for Embedded Real-Time Systems/ 4 * Advanced Standard Profile Kernel 2 * TOPPERS Software 3 * Toyohashi Open Platform for Embedded Real-Time Systems 5 4 * 6 5 * Copyright (C) 2015 by Ushio Laboratory -
EcnlProtoTool/trunk/asp3_dcre/syssvc/tLogTaskMain.c
r321 r429 1 1 /* 2 * TOPPERS/ASP Kernel 3 * Toyohashi Open Platform for Embedded Real-Time Systems/ 4 * Advanced Standard Profile Kernel 2 * TOPPERS Software 3 * Toyohashi Open Platform for Embedded Real-Time Systems 5 4 * 6 5 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory 7 6 * Toyohashi Univ. of Technology, JAPAN 8 * Copyright (C) 2005-201 6by Embedded and Real-Time Systems Laboratory7 * Copyright (C) 2005-2018 by Embedded and Real-Time Systems Laboratory 9 8 * Graduate School of Information Science, Nagoya Univ., JAPAN 10 9 * … … 82 81 } 83 82 else { 84 for (;;) {83 while (true) { 85 84 if (cSysLog_refer(&rlog) < 0) { 86 85 ercd = E_SYS; … … 113 112 rercd = dly_tsk(ATTR_flushWait); 114 113 if (rercd < 0) { 115 ercd = ( rercd== E_RLWAI) ? rercd : E_SYS;114 ercd = (MERCD(rercd) == E_RLWAI) ? rercd : E_SYS; 116 115 goto error_exit; 117 116 } … … 130 129 { 131 130 SYSLOG syslog; 132 uint_t lost;133 131 ER_UINT rercd; 134 132 … … 136 134 syslog_0(LOG_NOTICE, "System logging task is started."); 137 135 138 for (;;) { 139 lost = 0U; 136 while (true) { 140 137 while ((rercd = cSysLog_read(&syslog)) >= 0) { 141 lost += (uint_t) rercd; 142 if (lost > 0U) { 143 syslog_lostmsg(lost, logtask_putc); 144 lost = 0U; 138 if (((uint_t) rercd) > 0U) { 139 syslog_lostmsg((uint_t) rercd, logtask_putc); 145 140 } 146 141 syslog_print(&syslog, logtask_putc); 147 logtask_putc('\n');148 142 } 149 if (lost > 0U) { 150 syslog_lostmsg(lost, logtask_putc); 151 } 152 dly_tsk(ATTR_interval); 143 (void) dly_tsk(ATTR_interval); 153 144 } 154 145 } … … 189 180 syslog_lostmsg((uint_t) rercd, target_fput_log); 190 181 } 191 if (syslog.logtype >= LOG_TYPE_COMMENT) { 192 syslog_print(&syslog, target_fput_log); 193 target_fput_log('\n'); 194 } 182 syslog_print(&syslog, target_fput_log); 195 183 } 196 184 } -
EcnlProtoTool/trunk/asp3_dcre/syssvc/tSerialAdapter.c
r321 r429 1 1 /* 2 * TOPPERS/ASP Kernel 3 * Toyohashi Open Platform for Embedded Real-Time Systems/ 4 * Advanced Standard Profile Kernel 2 * TOPPERS Software 3 * Toyohashi Open Platform for Embedded Real-Time Systems 5 4 * 6 5 * Copyright (C) 2015,2016 by Embedded and Real-Time Systems Laboratory … … 83 82 */ 84 83 ER_UINT 85 serial_ rea_dat(ID portid, char *buf, uint_t len)84 serial_trea_dat(ID portid, char *buf, uint_t len, TMO tmout) 86 85 { 87 86 if (sns_dpn()) { /* コンテキストのチェック */ … … 92 91 } 93 92 94 return(cSerialPort_read(portid - 1, buf, len ));93 return(cSerialPort_read(portid - 1, buf, len, tmout)); 95 94 } 96 95 -
EcnlProtoTool/trunk/asp3_dcre/syssvc/tSerialPort.cdl
r321 r429 1 1 /* 2 * TOPPERS/ASP Kernel 3 * Toyohashi Open Platform for Embedded Real-Time Systems/ 4 * Advanced Standard Profile Kernel 2 * TOPPERS Software 3 * Toyohashi Open Platform for Embedded Real-Time Systems 5 4 * 6 5 * Copyright (C) 2015 by Ushio Laboratory … … 57 56 ER open(void); 58 57 ER close(void); 59 ER_UINT read([out,size_is(length)] char *buffer, [in] uint_t length );58 ER_UINT read([out,size_is(length)] char *buffer, [in] uint_t length, [in] TMO tmout); 60 59 ER_UINT write([in,size_is(length)] const char *buffer, [in] uint_t length); 61 60 ER control([in] uint_t ioControl); -
EcnlProtoTool/trunk/asp3_dcre/syssvc/tSerialPortMain.c
r321 r429 1 1 /* 2 * TOPPERS/ASP Kernel 3 * Toyohashi Open Platform for Embedded Real-Time Systems/ 4 * Advanced Standard Profile Kernel 2 * TOPPERS Software 3 * Toyohashi Open Platform for Embedded Real-Time Systems 5 4 * 6 5 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory 7 6 * Toyohashi Univ. of Technology, JAPAN 8 * Copyright (C) 2006-201 5by Embedded and Real-Time Systems Laboratory7 * Copyright (C) 2006-2018 by Embedded and Real-Time Systems Laboratory 9 8 * Graduate School of Information Science, Nagoya Univ., JAPAN 10 9 * … … 242 241 243 242 /* 244 * シリアルポートへの文字送信243 * SIOポートへの文字送信 245 244 * 246 * p_cellcbで指定される SIOポートに対して,文字cを送信する.文字を送信247 * レジスタにいれた場合にはtrueを返す.そうでない場合には,送信レジス248 * タが空いたことを通知するコールバック関数を許可し,falseを返す.この249 * 関数は,CPUロック状態で呼び出される.245 * p_cellcbで指定されるシリアルポートに対応するSIOポートに対して,文 246 * 字cを送信する.文字を送信レジスタにいれた場合にはtrueを返す.そう 247 * でない場合には,送信レジスタが空いたことを通知するコールバック関数 248 * を許可し,falseを返す.この関数は,CPUロック状態で呼び出される. 250 249 */ 251 250 Inline bool_t … … 268 267 { 269 268 bool_t buffer_full; 270 ER ercd, rercd; 269 ER_BOOL ercd; 270 ER rercd; 271 271 272 272 /* … … 359 359 * シリアルポートからの1文字受信 360 360 */ 361 static bool_t361 static ER_BOOL 362 362 serialPort_readChar(CELLCB *p_cellcb, char *p_c) 363 363 { 364 364 bool_t buffer_empty; 365 ER 365 ER_BOOL ercd; 366 366 367 367 SVC(loc_cpu(), gen_ercd_sys(p_cellcb)); … … 397 397 */ 398 398 ER_UINT 399 eSerialPort_read(CELLIDX idx, char *buffer, uint_t length )399 eSerialPort_read(CELLIDX idx, char *buffer, uint_t length, TMO tmout) 400 400 { 401 401 CELLCB *p_cellcb; … … 423 423 while (reacnt < length) { 424 424 if (buffer_empty) { 425 SVC(rercd = cReceiveSemaphore_wait(), 426 gen_ercd_wait(rercd, p_cellcb)); 425 rercd = cReceiveSemaphore_waitTimeout(tmout); 426 if (rercd == E_TMOUT) 427 return E_TMOUT; 428 if (rercd < 0) { 429 gen_ercd_wait(rercd, p_cellcb); 430 ercd = rercd; 431 goto error_exit; 432 } 427 433 } 428 434 SVC(rercd = serialPort_readChar(p_cellcb, &c), rercd); … … 519 525 if (VAR_receiveFlowControl != '\0') { 520 526 /* 521 * START/STOP 527 * START/STOPを送信する. 522 528 */ 523 529 (void) cSIOPort_putChar(VAR_receiveFlowControl); … … 569 575 */ 570 576 VAR_sendStopped = false; 571 if(VAR_sendCount > 0U) {577 while (VAR_sendCount > 0U) { 572 578 c = VAR_sendBuffer[VAR_sendReadPointer]; 573 579 if (serialPort_sendChar(p_cellcb, c)) { … … 580 586 VAR_sendCount--; 581 587 } 588 else { 589 break; 590 } 582 591 } 583 592 } -
EcnlProtoTool/trunk/asp3_dcre/syssvc/tSysLog.c
r321 r429 1 1 /* 2 * TOPPERS/ASP Kernel 3 * Toyohashi Open Platform for Embedded Real-Time Systems/ 4 * Advanced Standard Profile Kernel 2 * TOPPERS Software 3 * Toyohashi Open Platform for Embedded Real-Time Systems 5 4 * 6 5 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory 7 6 * Toyohashi Univ. of Technology, JAPAN 8 * Copyright (C) 2005-201 6by Embedded and Real-Time Systems Laboratory7 * Copyright (C) 2005-2018 by Embedded and Real-Time Systems Laboratory 9 8 * Graduate School of Information Science, Nagoya Univ., JAPAN 10 9 * … … 50 49 #include <t_syslog.h> 51 50 #include <log_output.h> 51 52 /* 53 * トレースログに関する設定 54 */ 55 #ifdef TOPPERS_ENABLE_TRACE 56 #include "arch/tracelog/trace_log.h" 57 #endif /* TOPPERS_ENABLE_TRACE */ 58 59 /* 60 * ターゲット依存情報の定義 61 */ 52 62 #include "target_syssvc.h" 53 63 … … 126 136 if ((VAR_lowMask & LOG_MASK(priority)) != 0U) { 127 137 syslog_print(p_syslog, low_putchar); 128 low_putchar('\n');129 138 } 130 139 … … 212 221 213 222 while ((rercd = eSysLog_read(&logbuf)) >= 0) { 214 if ( rercd > 0) {223 if (((uint_t) rercd) > 0U) { 215 224 syslog_lostmsg((uint_t) rercd, low_putchar); 216 225 } 217 if (logbuf.logtype >= LOG_TYPE_COMMENT) { 218 syslog_print(&logbuf, low_putchar); 219 low_putchar('\n'); 220 } 221 } 222 223 SIL_UNL_INT(); 224 return(E_OK); 225 } 226 syslog_print(&logbuf, low_putchar); 227 } 228 229 SIL_UNL_INT(); 230 return(E_OK); 231 } -
EcnlProtoTool/trunk/asp3_dcre/syssvc/tSysLog.cdl
r321 r429 1 1 /* 2 * TOPPERS/ASP Kernel 3 * Toyohashi Open Platform for Embedded Real-Time Systems/ 4 * Advanced Standard Profile Kernel 2 * TOPPERS Software 3 * Toyohashi Open Platform for Embedded Real-Time Systems 5 4 * 6 5 * Copyright (C) 2015 by Ushio Laboratory … … 46 45 47 46 /* 48 * システムログ 出力に関する定義47 * システムログ機能に関する定義 49 48 */ 50 import_C(" t_syslog.h");49 import_C("syssvc/syslog.h"); 51 50 52 51 /* -
EcnlProtoTool/trunk/asp3_dcre/syssvc/tSysLogAdapter.c
r321 r429 1 1 /* 2 * TOPPERS/ASP Kernel 3 * Toyohashi Open Platform for Embedded Real-Time Systems/ 4 * Advanced Standard Profile Kernel 2 * TOPPERS Software 3 * Toyohashi Open Platform for Embedded Real-Time Systems 5 4 * 6 5 * Copyright (C) 2015,2016 by Embedded and Real-Time Systems Laboratory -
EcnlProtoTool/trunk/asp3_dcre/syssvc/tTestService.c
r321 r429 1 1 /* 2 * TOPPERS/ASP Kernel 3 * Toyohashi Open Platform for Embedded Real-Time Systems/ 4 * Advanced Standard Profile Kernel 2 * TOPPERS Software 3 * Toyohashi Open Platform for Embedded Real-Time Systems 5 4 * 6 * Copyright (C) 2016 by Embedded and Real-Time Systems Laboratory5 * Copyright (C) 2016-2018 by Embedded and Real-Time Systems Laboratory 7 6 * Graduate School of Information Science, Nagoya Univ., JAPAN 8 7 * … … 52 51 * テストプログラムの開始(受け口関数) 53 52 */ 54 void 53 ER 55 54 eTestService_start(const char *progname) 56 55 { 57 56 syslog_1(LOG_NOTICE, "Test program: %s", progname); 58 57 VAR_check_count = 0U; 59 } 60 61 /* 62 * 自己診断関数の設定 63 */ 64 void 65 eTestService_setBuiltInTest(Descriptor(sBuiltInTest) desc) 66 { 67 cBuiltInTest_set_descriptor(desc); 58 return(E_OK); 68 59 } 69 60 … … 87 78 * チェックポイント(受け口関数) 88 79 */ 89 void 80 ER 90 81 eTestService_checkPoint(uint_t count) 91 82 { … … 133 124 */ 134 125 SIL_UNL_INT(); 126 return(E_OK); 135 127 } 136 128 … … 138 130 * 完了チェックポイント(受け口関数) 139 131 */ 140 void 132 ER 141 133 eTestService_finishPoint(uint_t count) 142 134 { … … 146 138 } 147 139 test_finish(); 140 return(E_OK); 148 141 } 149 142 … … 151 144 * 条件チェックのエラー処理(受け口関数) 152 145 */ 153 void 146 ER 154 147 eTestService_assertError(const char *expr, const char *file, int_t line) 155 148 { … … 157 150 expr, file, line); 158 151 test_finish(); 159 } 160 161 /* 162 * エラーコードチェックのエラー処理(受け口関数) 163 */ 164 void 165 eTestService_serviceError(ER ercd, const char *file, int_t line) 166 { 167 syslog_3(LOG_ERROR, "## Unexpected error %s detected at %s:%u.\007", 168 itron_strerror(ercd), file, line); 169 test_finish(); 152 return(E_OK); 170 153 } 171 154 … … 174 157 */ 175 158 ER 159 eTestService_serviceError(ER ercd, const char *file, int_t line) 160 { 161 syslog_3(LOG_ERROR, "## Unexpected error %s detected at %s:%u.\007", 162 itron_strerror(ercd), file, line); 163 test_finish(); 164 return(E_OK); 165 } 166 167 /* 168 * 割込み優先度マスクの取得(受け口関数) 169 */ 170 ER 176 171 eTestService_getInterruptPriorityMask(PRI *p_ipm) 177 172 { -
EcnlProtoTool/trunk/asp3_dcre/syssvc/tTestService.cdl
r321 r429 1 1 /* 2 * TOPPERS/ASP Kernel 3 * Toyohashi Open Platform for Embedded Real-Time Systems/ 4 * Advanced Standard Profile Kernel 2 * TOPPERS Software 3 * Toyohashi Open Platform for Embedded Real-Time Systems 5 4 * 6 * Copyright (C) 2016 by Embedded and Real-Time Systems Laboratory5 * Copyright (C) 2016-2018 by Embedded and Real-Time Systems Laboratory 7 6 * Graduate School of Information Science, Nagoya Univ., JAPAN 8 7 * … … 46 45 * 自己診断サービスのシグニチャ 47 46 */ 47 [callback] 48 48 signature sBuiltInTest { 49 49 ER builtInTest(void); … … 52 52 /* 53 53 * テストプログラム用サービスのシグニチャ 54 *55 * setBuiltInTestは,TECSの中では動的結合を使って実現すべきであるが,56 * C言語のアプリケーションから呼び出しやすくするために,TECSの作法違57 * 反のコードとなっている.58 54 * 59 55 * getInterruptPriorityMaskは,そのままカーネルを呼び出すだけの関数で … … 64 60 */ 65 61 signature sTestService { 66 void start([in, string] const char *progname); 67 void setBuiltInTest([in] Descriptor(sBuiltInTest) desc); 68 void checkPoint([in] uint_t count); 69 void finishPoint([in] uint_t count); 70 void assertError([in, string] const char *expr, 62 ER start([in, string] const char *progname); 63 ER checkPoint([in] uint_t count); 64 ER finishPoint([in] uint_t count); 65 ER assertError([in, string] const char *expr, 71 66 [in, string] const char *file, [in] int_t line); 72 voidserviceError([in] ER ercd,67 ER serviceError([in] ER ercd, 73 68 [in, string] const char *file, [in] int_t line); 74 69 ER getInterruptPriorityMask([out] PRI *p_ipm); … … 80 75 [singleton, active] 81 76 celltype tTestService { 82 entry sTestService eTestService;83 [dynamic, optional] call sBuiltInTest cBuiltInTest;84 call sSysLog cSysLog;77 entry sTestService eTestService; 78 call sSysLog cSysLog; 79 [optional] call sBuiltInTest cBuiltInTest; 85 80 86 81 var { … … 88 83 }; 89 84 }; 90 91 /*92 * 自己診断サービスのディスクリプタを取得するシグニチャ93 */94 signature sGetBuiltInTestDescriptor {95 ER getDescriptor([out] Descriptor(sBuiltInTest) *p_desc,96 [in] int_t i);97 };98 99 /*100 * 自己診断サービスのディスクリプタを取得するセルタイプ101 */102 [singleton, active]103 celltype tBuiltInTestAdaptor {104 [ref_desc] call sBuiltInTest cBuiltInTest[];105 entry sGetBuiltInTestDescriptor eGetBuiltInTestDescriptor;106 }; -
EcnlProtoTool/trunk/asp3_dcre/syssvc/test_svc.h
r321 r429 1 1 /* 2 * TOPPERS/ASP Kernel 3 * Toyohashi Open Platform for Embedded Real-Time Systems/ 4 * Advanced Standard Profile Kernel 2 * TOPPERS Software 3 * Toyohashi Open Platform for Embedded Real-Time Systems 5 4 * 6 * Copyright (C) 2005-201 6by Embedded and Real-Time Systems Laboratory5 * Copyright (C) 2005-2018 by Embedded and Real-Time Systems Laboratory 7 6 * Graduate School of Information Science, Nagoya Univ., JAPAN 8 7 * … … 54 53 55 54 /* 56 * TECSで記述されたテストプログラム用のサービスを直接呼び出すための定義 57 * 58 * C言語で記述されたアプリケーションから,TECSで記述されたテストプログ 59 * ラム用のサービスを呼び出すためには,アダプタを用いるのが正当な方法 60 * であるが,テストプログラム用のサービスがシングルトンであることを利 61 * 用して直接呼び出す. 55 * テストプログラム用サービスのサービスコール 62 56 */ 63 extern void tTestService_eTestService_start(const char* progname); 64 extern void tTestService_eTestService_setBuiltInTest(void *desc); 65 extern void tTestService_eTestService_checkPoint(uint_t count); 66 extern void tTestService_eTestService_finishPoint(uint_t count); 67 extern void tTestService_eTestService_assertError(const char* expr, 68 const char* file, int_t line); 69 extern void tTestService_eTestService_serviceError(ER ercd, 70 const char* file, int_t line); 71 extern ER tTestService_eTestService_getInterruptPriorityMask(PRI* p_ipm); 72 73 /* 74 * テストプログラムの開始 75 */ 76 Inline void 77 test_start(const char *progname) 78 { 79 tTestService_eTestService_start(progname); 80 } 81 82 /* 83 * 自己診断関数の設定 84 */ 85 Inline void 86 set_bit_service(void *bit_service) 87 { 88 tTestService_eTestService_setBuiltInTest(bit_service); 89 } 90 91 /* 92 * チェックポイント 93 */ 94 Inline void 95 check_point(uint_t count) 96 { 97 tTestService_eTestService_checkPoint(count); 98 } 99 100 /* 101 * 完了チェックポイント 102 */ 103 Inline void 104 check_finish(uint_t count) 105 { 106 tTestService_eTestService_finishPoint(count); 107 } 57 extern void test_start(const char *progname); 58 extern void check_point(uint_t count); 59 extern void check_finish(uint_t count); 60 extern void check_assert_error(const char *expr, const char *file, int_t line); 61 extern void check_ercd_error(ER ercd, const char *file, int_t line); 62 extern ER get_interrupt_priority_mask(PRI *p_ipm); 108 63 109 64 /* 110 65 * 条件チェック 111 66 */ 112 Inline void113 check_assert_error(const char *expr, const char *file, int_t line)114 {115 tTestService_eTestService_assertError(expr, file, line);116 }117 118 67 #define check_assert(exp) \ 119 68 ((void)(!(exp) ? (check_assert_error(#exp, __FILE__, __LINE__), 0) : 0)) … … 122 71 * エラーコードチェック 123 72 */ 124 Inline void125 check_ercd_error(ER ercd, const char *file, int_t line)126 {127 tTestService_eTestService_serviceError(ercd, file, line);128 }129 130 73 #define check_ercd(ercd, expected_ercd) \ 131 74 ((void)((ercd) != (expected_ercd) ? \ … … 146 89 * 割込み優先度マスクのチェック 147 90 */ 148 #define check_ipm(ipm) do { 149 PRI intpri; 150 ER ercd; 151 152 ercd = tTestService_eTestService_getInterruptPriorityMask(&intpri); \153 check_ercd(ercd, E_OK); 154 check_assert(intpri == ipm); 91 #define check_ipm(ipm) do { \ 92 PRI intpri; \ 93 ER ercd; \ 94 \ 95 ercd = get_interrupt_priority_mask(&intpri); \ 96 check_ercd(ercd, E_OK); \ 97 check_assert(intpri == ipm); \ 155 98 } while (false); 156 99 … … 159 102 #endif 160 103 161 /*162 * TECSで記述された自己診断サービスを直接呼び出すための定義163 *164 * C言語で記述されたアプリケーションから,TECSで記述された自己診断サー165 * ビスを呼び出すためには,アダプタを用いるのが正当な方法であるが,自166 * 己診断サービスがシングルトンであることを利用して直接呼び出す.167 */168 extern ER tBuiltInTestAdaptor_eGetBuiltInTestDescriptor_getDescriptor169 (void **p_desc, int_t i);170 171 Inline void *172 get_bit_kernel(void)173 {174 void *desc;175 176 tBuiltInTestAdaptor_eGetBuiltInTestDescriptor_getDescriptor(&desc, 0);177 return(desc);178 }179 180 Inline void *181 get_bit_mutex(void)182 {183 void *desc;184 185 tBuiltInTestAdaptor_eGetBuiltInTestDescriptor_getDescriptor(&desc, 1);186 return(desc);187 }188 189 104 #endif /* TOPPERS_TEST_SVC_H */ -
EcnlProtoTool/trunk/asp3_dcre/target/gr_peach_gcc/Makefile.target
r321 r429 2 2 # Makefile のターゲット依存部(GR-PEACH用) 3 3 # 4 # $Id $4 # $Id: Makefile.target 732 2016-04-03 03:08:05Z ertl-hiro $ 5 5 # 6 6 … … 31 31 32 32 # 33 # MPCoreの種類の定義33 # FPUサポートとコーリングコンベンション 34 34 # 35 MPCORE_TYPE = CA9 35 # FPUを使用する場合は,USE_ARM_FPUをマクロ定義し,使用するコーリング 36 # コンベンションに応じて,-mfloat-abi=softfpまたは-mfloat-abi=hardオ 37 # プションをつける. 38 # 39 #CDEFS := $(CDEFS) -DUSE_ARM_FPU 40 #COPTS := $(COPTS) -mfloat-abi=softfp 41 COPTS := $(COPTS) -mfloat-abi=hard 36 42 37 43 # … … 46 52 # 47 53 KERNEL_DIRS := $(KERNEL_DIRS) $(TARGETDIR) 48 KERNEL_COBJS := $(KERNEL_COBJS) target_kernel_impl.o core_pl310.o54 KERNEL_COBJS := $(KERNEL_COBJS) target_kernel_impl.o 49 55 KERNEL_ASMOBJS := $(KERNEL_ASMOBJS) target_support.o 50 56 … … 55 61 CDEFS := $(CDEFS) -DTOPPERS_EXECUTE_ON_ROM 56 62 #LDSCRIPT = $(TARGETDIR)/gr_peach_rom.ld 57 LDSCRIPT = $(SRCDIR)/mbed/targets/ cmsis/TARGET_RENESAS/TARGET_RZ_A1H/TOOLCHAIN_GCC_ARM/RZA1H.ld63 LDSCRIPT = $(SRCDIR)/mbed/targets/TARGET_RENESAS/TARGET_RZA1XX/TARGET_RZ_A1H/device/TOOLCHAIN_GCC_ARM/RZA1H.ld 58 64 else 59 65 CDEFS := $(CDEFS) -DTOPPERS_EXECUTE_ON_RAM … … 62 68 63 69 # 64 # GNU開発環境のターゲットアーキテクチャの定義70 # チップ依存部 65 71 # 66 GCC_TARGET = arm-none-eabi 67 #GCC_TARGET = arm-atollic-eabi 68 69 # 70 # トレースログ記録のサンプルコードに関する定義 71 # 72 ifeq ($(ENABLE_TRACE),true) 73 COPTS := $(COPTS) -DTOPPERS_ENABLE_TRACE 74 SYSSVC_DIRS := $(SYSSVC_DIRS) $(SRCDIR)/arch/tracelog 75 endif 76 77 # 78 # チップ依存部のインクルード 79 # 80 include $(SRCDIR)/arch/arm_gcc/rza1/Makefile.chip 72 include $(SRCDIR)/arch/$(CORE)_$(TOOL)/$(CHIP)/Makefile.chip -
EcnlProtoTool/trunk/asp3_dcre/target/gr_peach_gcc/Makefile.tinet
r321 r429 29 29 # 接的または間接的に生じたいかなる損害に関しても,その責任を負わない. 30 30 # 31 # @(#) $Id $31 # @(#) $Id: Makefile.tinet,v 1.6 2012/07/18 04:17:01 abe Exp abe $ 32 32 # 33 33 -
EcnlProtoTool/trunk/asp3_dcre/target/gr_peach_gcc/cfg_dmy.c
r321 r429 1 1 #include "MBRZA1H.h" 2 #include <stdlib.h> 2 3 3 IRQHandler _kernel_inh_table[R enesas_RZ_A1_IRQ_MAX+1];4 IRQHandler _kernel_inh_table[RZ_A1_IRQ_MAX+1]; 4 5 uint32_t _kernel_excpt_nest_count = 0; 5 6 … … 23 24 { 24 25 } 26 25 27 void _kernel_irq_handler() 26 28 { … … 30 32 { 31 33 } 34 35 void __libc_init_array() 36 { 37 } 38 39 void *memset(void *dst, int c, size_t size) 40 { 41 return NULL; 42 } 43 44 void *memcpy(void *dst, void * src, size_t size) 45 { 46 return NULL; 47 } 48 49 int main() 50 { 51 } 52 53 void exit(int exitcd) 54 { 55 } -
EcnlProtoTool/trunk/asp3_dcre/target/gr_peach_gcc/gr_peach.h
r321 r429 1 1 /* 2 * TOPPERS/ASP Kernel 3 * Toyohashi Open Platform for Embedded Real-Time Systems/ 4 * Advanced Standard Profile Kernel 5 * 2 * TOPPERS Software 3 * Toyohashi Open Platform for Embedded Real-Time Systems 4 * 6 5 * Copyright (C) 2011-2016 by Embedded and Real-Time Systems Laboratory 7 6 * Graduate School of Information Science, Nagoya Univ., JAPAN 8 * 7 * 9 8 * 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ 10 9 * ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改 … … 29 28 * 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを 30 29 * 免責すること. 31 * 30 * 32 31 * 本ソフトウェアは,無保証で提供されているものである.上記著作権者お 33 32 * よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的 … … 35 34 * アの利用により直接的または間接的に生じたいかなる損害に関しても,そ 36 35 * の責任を負わない. 37 * 36 * 37 * $Id$ 38 38 */ 39 39 … … 58 58 59 59 /* 60 * ボーレート設定 61 */ 62 #define UART_BAUDRATE 115200 63 64 /* 60 65 * LEDの点灯/消灯 61 66 */ -
EcnlProtoTool/trunk/asp3_dcre/target/gr_peach_gcc/gr_peach_ram.ld
r321 r429 1 1 /* 2 * $Id $2 * $Id: gr_peach_ram.ld 720 2016-04-01 22:16:17Z ertl-hiro $ 3 3 */ 4 4 5 OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")5 OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") 6 6 OUTPUT_ARCH(arm) 7 7 ENTRY(start); -
EcnlProtoTool/trunk/asp3_dcre/target/gr_peach_gcc/gr_peach_rom.ld
r321 r429 1 1 /* 2 * $Id $2 * $Id: gr_peach_rom.ld 720 2016-04-01 22:16:17Z ertl-hiro $ 3 3 */ 4 4 5 OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")5 OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") 6 6 OUTPUT_ARCH(arm) 7 7 ENTRY(start); -
EcnlProtoTool/trunk/asp3_dcre/target/gr_peach_gcc/tSIOPortGRPeach.cdl
r321 r429 6 6 * Copyright (C) 2015 by Ushio Laboratory 7 7 * Graduate School of Engineering Science, Osaka Univ., JAPAN 8 * Copyright (C) 2015 ,2016by Embedded and Real-Time Systems Laboratory8 * Copyright (C) 2015-2018 by Embedded and Real-Time Systems Laboratory 9 9 * Graduate School of Information Science, Nagoya Univ., JAPAN 10 10 * … … 47 47 48 48 /* 49 * GR-PEACH とRZ/A1に関する定義49 * GR-PEACHのハードウェア資源の定義 50 50 */ 51 51 import_C("gr_peach.h"); 52 import_C(" rza1.h");53 54 /* 55 * FIFO内蔵シリアルコミュニケーションインタフェース用 簡易SIOドライバ56 */ 57 import("t SCIF.cdl");52 import_C("device.h"); 53 54 /* 55 * シリアルインタフェースドライバのチップ依存部(RZ/A1用) 56 */ 57 import("tMbedSerial.cdl"); 58 58 59 59 /* … … 73 73 call sSIOPort cSIOPort; 74 74 [inline] entry siSIOCBR eiSIOCBR; 75 76 /*77 * 割込み要求ライン操作のための結合78 */79 call sInterruptRequest cRxInterruptRequest;80 call sInterruptRequest cTxInterruptRequest;81 75 }; 82 76 … … 85 79 * ト)のセルタイプ 86 80 */ 87 [active]88 81 composite tSIOPortGRPeach { 89 82 /* … … 97 90 */ 98 91 attr { 99 uintptr_t baseAddress; /* ベースアドレス */ 100 INTNO rxInterruptNumber; /* 受信割込み番号 */ 101 INTNO txInterruptNumber; /* 送信割込み番号 */ 102 PRI isrPriority = 1; /* ISR優先度 */ 103 PRI interruptPriority = -4; /* 割込み優先度 */ 92 int32_t tx; /* 送信Pin */ 93 int32_t rx; /* 受信Pin */ 104 94 uint32_t baudRate = 115200; /* ボーレートの設定値 */ 105 95 }; … … 108 98 * SIOドライバ 109 99 */ 110 cell tSCIF SCIF { 111 baseAddress = composite.baseAddress; 100 cell tMbedSerial MbedSerial { 101 tx = composite.tx; 102 rx = composite.rx; 112 103 baudRate = composite.baudRate; 113 104 ciSIOCBR = SIOPortMain.eiSIOCBR; … … 119 110 cell tSIOPortGRPeachMain SIOPortMain { 120 111 ciSIOCBR => composite.ciSIOCBR; 121 cSIOPort = SCIF.eSIOPort; 122 cRxInterruptRequest = RxInterruptRequest.eInterruptRequest; 123 cTxInterruptRequest = TxInterruptRequest.eInterruptRequest; 112 cSIOPort = MbedSerial.eSIOPort; 124 113 }; 125 114 composite.eSIOPort => SIOPortMain.eSIOPort; 126 127 /*128 * SIOの受信割込みサービスルーチンと割込み要求ライン129 */130 cell tISR RxISRInstance {131 interruptNumber = composite.rxInterruptNumber;132 isrPriority = composite.isrPriority;133 ciISRBody = SCIF.eiRxISR;134 };135 cell tInterruptRequest RxInterruptRequest {136 interruptNumber = composite.rxInterruptNumber;137 interruptPriority = composite.interruptPriority;138 };139 140 /*141 * SIOの受信割込みサービスルーチンと割込み要求ライン142 */143 cell tISR TxISRInstance {144 interruptNumber = composite.txInterruptNumber;145 isrPriority = composite.isrPriority;146 ciISRBody = SCIF.eiTxISR;147 };148 cell tInterruptRequest TxInterruptRequest {149 interruptNumber = composite.txInterruptNumber;150 interruptPriority = composite.interruptPriority;151 };152 115 }; 153 116 … … 157 120 * サンプルプログラムが使うポートが,SIOPortTarget1に固定されているた 158 121 * め,ポート1とポート3を入れ換えている.具体的には,SIOPortTarget1は 159 * SCIFのチャネル2(チャネル番号は0から始まるので,ポート3のこと)に,160 * SIOPortTarget3は SCIFのチャネル0につながっている.122 * MbedSerialのチャネル2(チャネル番号は0から始まるので,ポート3のこと)に, 123 * SIOPortTarget3はMbedSerialのチャネル0につながっている. 161 124 */ 162 125 [prototype] 163 126 cell tSIOPortGRPeach SIOPortTarget1 { 164 127 /* 属性の設定 */ 165 baseAddress = C_EXP("SCIF2_BASE"); 166 rxInterruptNumber = C_EXP("INTNO_SCIF2_RXI"); 167 txInterruptNumber = C_EXP("INTNO_SCIF2_TXI"); 128 tx = C_EXP("P6_3"); 129 rx = C_EXP("P6_2"); 168 130 }; 169 131 … … 171 133 cell tSIOPortGRPeach SIOPortTarget2 { 172 134 /* 属性の設定 */ 173 baseAddress = C_EXP("SCIF1_BASE"); 174 rxInterruptNumber = C_EXP("INTNO_SCIF1_RXI"); 175 txInterruptNumber = C_EXP("INTNO_SCIF1_TXI"); 135 tx = C_EXP("P2_5"); 136 rx = C_EXP("P2_6"); 176 137 }; 177 138 … … 179 140 cell tSIOPortGRPeach SIOPortTarget3 { 180 141 /* 属性の設定 */ 181 baseAddress = C_EXP("SCIF0_BASE"); 182 rxInterruptNumber = C_EXP("INTNO_SCIF0_RXI"); 183 txInterruptNumber = C_EXP("INTNO_SCIF0_TXI"); 142 tx = C_EXP("P4_12"); 143 rx = C_EXP("P4_13"); 184 144 }; 185 145 … … 187 147 cell tSIOPortGRPeach SIOPortTarget4 { 188 148 /* 属性の設定 */ 189 baseAddress = C_EXP("SCIF3_BASE"); 190 rxInterruptNumber = C_EXP("INTNO_SCIF3_RXI"); 191 txInterruptNumber = C_EXP("INTNO_SCIF3_TXI"); 149 tx = C_EXP("P2_14"); 150 rx = C_EXP("P2_15"); 192 151 }; 193 152 … … 195 154 cell tSIOPortGRPeach SIOPortTarget5 { 196 155 /* 属性の設定 */ 197 baseAddress = C_EXP("SCIF4_BASE"); 198 rxInterruptNumber = C_EXP("INTNO_SCIF4_RXI"); 199 txInterruptNumber = C_EXP("INTNO_SCIF4_TXI"); 156 tx = C_EXP("P4_14"); 157 rx = C_EXP("P4_15"); 200 158 }; 201 159 … … 203 161 cell tSIOPortGRPeach SIOPortTarget6 { 204 162 /* 属性の設定 */ 205 baseAddress = C_EXP("SCIF5_BASE"); 206 rxInterruptNumber = C_EXP("INTNO_SCIF5_RXI"); 207 txInterruptNumber = C_EXP("INTNO_SCIF5_TXI"); 163 tx = C_EXP("P5_3"); 164 rx = C_EXP("P5_4"); 208 165 }; 209 166 … … 211 168 cell tSIOPortGRPeach SIOPortTarget7 { 212 169 /* 属性の設定 */ 213 baseAddress = C_EXP("SCIF6_BASE"); 214 rxInterruptNumber = C_EXP("INTNO_SCIF6_RXI"); 215 txInterruptNumber = C_EXP("INTNO_SCIF6_TXI"); 170 tx = C_EXP("P8_8"); 171 rx = C_EXP("P8_9"); 216 172 }; 217 173 … … 219 175 cell tSIOPortGRPeach SIOPortTarget8 { 220 176 /* 属性の設定 */ 221 baseAddress = C_EXP("SCIF7_BASE"); 222 rxInterruptNumber = C_EXP("INTNO_SCIF7_RXI"); 223 txInterruptNumber = C_EXP("INTNO_SCIF7_TXI"); 224 }; 177 tx = C_EXP("P5_0"); 178 rx = C_EXP("P5_1"); 179 }; 180 181 [prototype] 182 cell tSIOPortGRPeach SIOPortTarget9 { 183 /* 属性の設定 */ 184 tx = C_EXP("P8_14"); 185 rx = C_EXP("P8_15"); 186 }; 187 188 [prototype] 189 cell tSIOPortGRPeach SIOPortTarget10 { 190 /* 属性の設定 */ 191 tx = C_EXP("P8_13"); 192 rx = C_EXP("P8_11"); 193 }; 194 195 [prototype] 196 cell tSIOPortGRPeach SIOPortTarget11 { 197 /* 属性の設定 */ 198 tx = C_EXP("P11_10"); 199 rx = C_EXP("P11_11"); 200 }; 201 202 [prototype] 203 cell tSIOPortGRPeach SIOPortTarget12 { 204 /* 属性の設定 */ 205 tx = C_EXP("P6_6"); 206 rx = C_EXP("P6_7"); 207 }; 208 209 [prototype] 210 cell tSIOPortGRPeach SIOPortTarget13 { 211 /* 属性の設定 */ 212 tx = C_EXP("P5_6"); 213 rx = C_EXP("P5_7"); 214 }; 215 216 [prototype] 217 cell tSIOPortGRPeach SIOPortTarget14 { 218 /* 属性の設定 */ 219 tx = C_EXP("P11_1"); 220 rx = C_EXP("P11_2"); 221 }; 222 223 [prototype] 224 cell tSIOPortGRPeach SIOPortTarget15 { 225 /* 属性の設定 */ 226 tx = C_EXP("P7_4"); 227 rx = C_EXP("P7_5"); 228 }; -
EcnlProtoTool/trunk/asp3_dcre/target/gr_peach_gcc/tSIOPortGRPeachMain_inline.h
r321 r429 57 57 */ 58 58 cSIOPort_open(); 59 60 /*61 * SIOの割込みマスクを解除する.62 */63 cRxInterruptRequest_enable();64 cTxInterruptRequest_enable();65 59 } 66 60 … … 77 71 */ 78 72 cSIOPort_close(); 79 80 /*81 * SIOの割込みをマスクする.82 */83 cRxInterruptRequest_disable();84 cTxInterruptRequest_disable();85 73 } 86 74 -
EcnlProtoTool/trunk/asp3_dcre/target/gr_peach_gcc/target.cdl
r321 r429 6 6 * Copyright (C) 2015 by Ushio Laboratory 7 7 * Graduate School of Engineering Science, Osaka Univ., JAPAN 8 * Copyright (C) 2015 ,2016by Embedded and Real-Time Systems Laboratory8 * Copyright (C) 2015-2018 by Embedded and Real-Time Systems Laboratory 9 9 * Graduate School of Information Science, Nagoya Univ., JAPAN 10 10 * … … 42 42 43 43 /* 44 * コンポーネント記述ファイルのターゲット依存部(GR-PEACH用) 45 */ 46 47 /* 44 48 * タスクのスタックサイズのデフォルト 45 49 */ … … 60 64 * ターゲット依存のセルタイプの定義 61 65 */ 62 import(" tPutLogGRPeach.cdl");66 import("syssvc/tPutLogSIOPort.cdl"); 63 67 import("tSIOPortGRPeach.cdl"); 64 68 … … 72 76 * 低レベル出力の組み上げ記述 73 77 */ 74 cell tPutLog GRPeachPutLogTarget {78 cell tPutLogSIOPort PutLogTarget { 75 79 /* SIOドライバとの結合 */ 76 80 cSIOPort = SIOPortTarget1.eSIOPort; -
EcnlProtoTool/trunk/asp3_dcre/target/gr_peach_gcc/target_check.trb
r321 r429 1 1 # -*- coding: utf-8 -*- 2 2 # 3 # パス3の生成スクリプトのターゲット依存部(GR-PEACH用) 3 # パス3の生成スクリプトのターゲット依存部 4 # 5 # $Id: target_check.trb 1071 2018-11-25 01:27:37Z ertl-hiro $ 4 6 # 5 7 -
EcnlProtoTool/trunk/asp3_dcre/target/gr_peach_gcc/target_kernel.cfg
r321 r429 4 4 * $Id$ 5 5 */ 6 INCLUDE("target_timer.cfg") 6 INCLUDE("target_timer.cfg"); -
EcnlProtoTool/trunk/asp3_dcre/target/gr_peach_gcc/target_kernel.h
r321 r429 1 /*2 * TOPPERS/ASP Kernel3 * Toyohashi Open Platform for Embedded Real-Time Systems/4 * Advanced Standard Profile Kernel5 *6 * Copyright (C) 2006-2016 by Embedded and Real-Time Systems Laboratory7 * Graduate School of Information Science, Nagoya Univ., JAPAN8 *9 * 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ10 * ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改11 * 変・再配布(以下,利用と呼ぶ)することを無償で許諾する.12 * (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作13 * 権表示,この利用条件および下記の無保証規定が,そのままの形でソー14 * スコード中に含まれていること.15 * (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使16 * 用できる形で再配布する場合には,再配布に伴うドキュメント(利用17 * 者マニュアルなど)に,上記の著作権表示,この利用条件および下記18 * の無保証規定を掲載すること.19 * (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使20 * 用できない形で再配布する場合には,次のいずれかの条件を満たすこ21 * と.22 * (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著23 * 作権表示,この利用条件および下記の無保証規定を掲載すること.24 * (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに25 * 報告すること.26 * (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損27 * 害からも,上記著作権者およびTOPPERSプロジェクトを免責すること.28 * また,本ソフトウェアのユーザまたはエンドユーザからのいかなる理29 * 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを30 * 免責すること.31 *32 * 本ソフトウェアは,無保証で提供されているものである.上記著作権者お33 * よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的34 * に対する適合性も含めて,いかなる保証も行わない.また,本ソフトウェ35 * アの利用により直接的または間接的に生じたいかなる損害に関しても,そ36 * の責任を負わない.37 *38 * $Id$39 */40 41 1 /* 42 2 * kernel.hのターゲット依存部(GR-PEACH用) … … 45 5 * から直接インクルードすることはない.このファイルをインクルードする 46 6 * 前に,t_stddef.hがインクルードされるので,それに依存してもよい. 7 * 8 * $Id$ 47 9 */ 48 10 49 11 #ifndef TOPPERS_TARGET_KERNEL_H 50 12 #define TOPPERS_TARGET_KERNEL_H 13 14 /* 15 * 高分解能タイマのタイマ周期 16 * 17 * 2^32 / 33.33…を丸めた値とする. 18 */ 19 #define TCYC_HRTCNT 128849019U 20 21 /* 22 * 高分解能タイマのカウント値の進み幅 23 */ 24 #define TSTEP_HRTCNT 1U 25 26 /* 27 * オーバランハンドラの残りプロセッサ時間に指定できる最大値 28 * 29 * この値をOSタイマへの設定値に変換してタイマに設定した後,タイマの現 30 * 在値を読み出してμ秒単位に変換できる値としている.タイマの現在値を 31 * μ秒単位に変換する時に34を加えるため,以下の条件を満たす最大の値と 32 * する. 33 * (TMAX_OVRTIM * 33 + TMAX_OVRTIM / 3 + 1) + 34 < 2^32 34 */ 35 #define TMAX_OVRTIM 128849017U 51 36 52 37 /* -
EcnlProtoTool/trunk/asp3_dcre/target/gr_peach_gcc/target_kernel.trb
r321 r429 1 1 # -*- coding: utf-8 -*- 2 2 # 3 # パス2の生成スクリプトのターゲット依存部(GR-PEACH用) 3 # パス2の生成スクリプトのターゲット依存部 4 # 5 # $Id: target_kernel.trb 1071 2018-11-25 01:27:37Z ertl-hiro $ 4 6 # 5 7 … … 7 9 # 生成スクリプトのチップ依存部 8 10 # 9 IncludeTrb("chip_kernel.trb") 11 IncludeTrb("chip_kernel.trb"); -
EcnlProtoTool/trunk/asp3_dcre/target/gr_peach_gcc/target_kernel_impl.c
r321 r429 3 3 * Toyohashi Open Platform for Embedded Real-Time Systems/ 4 4 * Advanced Standard Profile Kernel 5 * 6 * Copyright (C) 2007-201 6by Embedded and Real-Time Systems Laboratory5 * 6 * Copyright (C) 2007-2018 by Embedded and Real-Time Systems Laboratory 7 7 * Graduate School of Information Science, Nagoya Univ., JAPAN 8 * 8 * 9 9 * 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ 10 10 * ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改 … … 29 29 * 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを 30 30 * 免責すること. 31 * 31 * 32 32 * 本ソフトウェアは,無保証で提供されているものである.上記著作権者お 33 33 * よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的 … … 35 35 * アの利用により直接的または間接的に生じたいかなる損害に関しても,そ 36 36 * の責任を負わない. 37 * 37 * 38 38 * $Id$ 39 39 */ … … 48 48 #include "rza1.h" 49 49 #include "scif.h" 50 #include "core_pl310.h" 51 #include "us_ticker_api.h" 50 51 /* 52 * C++のグローバルコンストラクタ呼び出し 53 */ 54 void __libc_init_array() 55 { 56 /* グローバルコンストラクタでOS APIを呼び出す場合は、 57 タスクが起動してから行う */ 58 } 52 59 53 60 /* … … 63 70 * MMUへの設定属性(第1レベルディスクリプタ) 64 71 */ 65 #define MMU_ATTR_RAM (ARM_MMU_DSCR1_SHARED|ARM V6_MMU_DSCR1_APX0\66 |ARM _MMU_DSCR1_TEX001|ARM_MMU_DSCR1_AP11 \67 |ARM_MMU_DSCR1_CB11) 68 #define MMU_ATTR_IODEV (ARM_MMU_DSCR1_SHARED|ARMV6_MMU_DSCR1_APX0\69 |ARM _MMU_DSCR1_TEX000|ARM_MMU_DSCR1_AP11 \70 |ARM_MMU_DSCR1_CB01|ARMV6_MMU_DSCR1_NOEXEC) 72 #define MMU_ATTR_RAM (ARM_MMU_DSCR1_SHARED|ARM_MMU_DSCR1_TEX001 \ 73 |ARMV6_MMU_DSCR1_AP011|ARM_MMU_DSCR1_CB11) 74 #define MMU_ATTR_IODEV (ARM_MMU_DSCR1_SHARED|ARM_MMU_DSCR1_TEX000 \ 75 |ARMV6_MMU_DSCR1_AP011|ARM_MMU_DSCR1_CB01 \ 76 |ARMV6_MMU_DSCR1_NOEXEC) 77 71 78 /* 72 79 * MMUの設定情報(メモリエリアの情報) 73 80 */ 74 ARM_MMU_CONFIG arm_memory_area[] = {81 const ARM_MMU_CONFIG arm_memory_area[] = { 75 82 { SPI_ADDR, SPI_ADDR, SPI_SIZE, MMU_ATTR_RAM }, 76 83 { SRAM_ADDR, SRAM_ADDR, SRAM_SIZE, MMU_ATTR_RAM }, … … 206 213 * システムログの低レベル出力のための初期化 207 214 * 208 * セルタイプtPutLog GRPeach内に実装されている関数を直接呼び出す.209 */ 210 extern void tPutLog GRPeach_initialize(void);215 * セルタイプtPutLogSIOPort内に実装されている関数を直接呼び出す. 216 */ 217 extern void tPutLogSIOPort_initialize(void); 211 218 212 219 /* … … 244 251 245 252 /* 246 * L2キャッシュコントローラ(PL310)の初期化247 */248 /*pl310_initialize(0x0U, ~0x0U);*/249 250 /*251 253 * LEDを青色に点灯させる 252 254 */ … … 254 256 255 257 /* 256 * 低レベル出力用にSIOを初期化258 * SIOを初期化 257 259 */ 258 260 #ifndef TOPPERS_OMIT_TECS 259 tPutLog GRPeach_initialize();261 tPutLogSIOPort_initialize(); 260 262 #endif /* TOPPERS_OMIT_TECS */ 261 263 } … … 268 270 { 269 271 static int first = 1; 272 extern void software_term_hook(void); 273 void (*volatile fp)(void) = software_term_hook; 274 275 /* 276 * software_term_hookへのポインタを,一旦volatile指定のあるfpに代 277 * 入してから使うのは,0との比較が最適化で削除されないようにするた 278 * めである. 279 */ 280 if (fp != 0) { 281 (*fp)(); 282 } 270 283 271 284 /* … … 293 306 rza1_config_port(RZA1_PORT_P(6), led, set); 294 307 } 295 296 void us_ticker_init(void)297 {298 }299 300 uint32_t us_ticker_read()301 {302 ER ret;303 SYSTIM now;304 305 ret = get_tim(&now);306 if(ret != E_OK)307 return 0;308 309 return now;310 }311 312 void us_ticker_set_interrupt(timestamp_t timestamp)313 {314 Asm("bkpt #0");315 }316 317 void us_ticker_disable_interrupt(void)318 {319 }320 321 void us_ticker_clear_interrupt(void)322 {323 }324 325 void wait(float s)326 {327 wait_us(s * 1000000.0f);328 }329 330 void wait_ms(int ms)331 {332 wait_us(ms * 1000);333 }334 335 void wait_us(int us)336 {337 ER ret;338 339 ret = dly_tsk(us);340 if (ret == E_CTX){341 uint32_t start = us_ticker_read();342 while ((us_ticker_read() - start) < (uint32_t)us);343 }344 } -
EcnlProtoTool/trunk/asp3_dcre/target/gr_peach_gcc/target_kernel_impl.h
r321 r429 3 3 * Toyohashi Open Platform for Embedded Real-Time Systems/ 4 4 * Advanced Standard Profile Kernel 5 * 5 * 6 6 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory 7 7 * Toyohashi Univ. of Technology, JAPAN 8 * Copyright (C) 2006-201 6by Embedded and Real-Time Systems Laboratory8 * Copyright (C) 2006-2018 by Embedded and Real-Time Systems Laboratory 9 9 * Graduate School of Information Science, Nagoya Univ., JAPAN 10 * 10 * 11 11 * 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ 12 12 * ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改 … … 31 31 * 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを 32 32 * 免責すること. 33 * 33 * 34 34 * 本ソフトウェアは,無保証で提供されているものである.上記著作権者お 35 35 * よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的 … … 37 37 * アの利用により直接的または間接的に生じたいかなる損害に関しても,そ 38 38 * の責任を負わない. 39 * 39 * 40 40 * $Id$ 41 41 */ … … 57 57 58 58 /* 59 * トレースログに関する設定60 */61 #ifdef TOPPERS_ENABLE_TRACE62 #include "arch/tracelog/trace_log.h"63 #endif /* TOPPERS_ENABLE_TRACE */64 65 /*66 * デフォルトの非タスクコンテキスト用のスタック領域の定義67 */68 #define DEFAULT_ISTKSZ 0x2000U /* 8KB */69 70 /*71 59 * 微少時間待ちのための定義(本来はSILのターゲット依存部) 72 60 */ 73 #define SIL_DLY_TIM1 35274 #define SIL_DLY_TIM2 20061 #define SIL_DLY_TIM1 110 62 #define SIL_DLY_TIM2 72 75 63 76 64 /* … … 84 72 * ターゲットシステム依存の初期化 85 73 */ 86 extern void 74 extern void target_initialize(void); 87 75 88 76 /* … … 91 79 * システムを終了する時に使う. 92 80 */ 93 extern void 81 extern void target_exit(void) NoReturn; 94 82 95 83 #endif /* TOPPERS_MACRO_ONLY */ -
EcnlProtoTool/trunk/asp3_dcre/target/gr_peach_gcc/target_rename.def
r331 r429 1 1 # target_kernel_impl.c 2 arm_tnum_memory_area 3 arm_memory_area 2 4 target_initialize 3 5 target_exit 4 6 5 # tTraceLog.c6 log_dsp_enter7 log_dsp_leave8 log_inh_enter9 log_inh_leave10 log_exc_enter11 log_exc_leave12 13 7 INCLUDE "chip" -
EcnlProtoTool/trunk/asp3_dcre/target/gr_peach_gcc/target_rename.h
r321 r429 7 7 * target_kernel_impl.c 8 8 */ 9 #define arm_tnum_memory_area _kernel_arm_tnum_memory_area 10 #define arm_memory_area _kernel_arm_memory_area 9 11 #define target_initialize _kernel_target_initialize 10 12 #define target_exit _kernel_target_exit 11 12 /*13 * tTraceLog.c14 */15 #define log_dsp_enter _kernel_log_dsp_enter16 #define log_dsp_leave _kernel_log_dsp_leave17 #define log_inh_enter _kernel_log_inh_enter18 #define log_inh_leave _kernel_log_inh_leave19 #define log_exc_enter _kernel_log_exc_enter20 #define log_exc_leave _kernel_log_exc_leave21 13 22 14 -
EcnlProtoTool/trunk/asp3_dcre/target/gr_peach_gcc/target_sil.h
r321 r429 1 1 /* 2 * TOPPERS Software 3 * Toyohashi Open Platform for Embedded Real-Time Systems 4 * 5 * Copyright (C) 2007-2015 by Embedded and Real-Time Systems Laboratory 6 * Graduate School of Information Science, Nagoya Univ., JAPAN 7 * 8 * 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ 9 * ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改 10 * 変・再配布(以下,利用と呼ぶ)することを無償で許諾する. 11 * (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作 12 * 権表示,この利用条件および下記の無保証規定が,そのままの形でソー 13 * スコード中に含まれていること. 14 * (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使 15 * 用できる形で再配布する場合には,再配布に伴うドキュメント(利用 16 * 者マニュアルなど)に,上記の著作権表示,この利用条件および下記 17 * の無保証規定を掲載すること. 18 * (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使 19 * 用できない形で再配布する場合には,次のいずれかの条件を満たすこ 20 * と. 21 * (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著 22 * 作権表示,この利用条件および下記の無保証規定を掲載すること. 23 * (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに 24 * 報告すること. 25 * (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損 26 * 害からも,上記著作権者およびTOPPERSプロジェクトを免責すること. 27 * また,本ソフトウェアのユーザまたはエンドユーザからのいかなる理 28 * 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを 29 * 免責すること. 30 * 31 * 本ソフトウェアは,無保証で提供されているものである.上記著作権者お 32 * よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的 33 * に対する適合性も含めて,いかなる保証も行わない.また,本ソフトウェ 34 * アの利用により直接的または間接的に生じたいかなる損害に関しても,そ 35 * の責任を負わない. 36 * 37 * $Id$ 38 */ 39 40 /* 41 * sil.hのチップ依存部(GR-PEACH用) 2 * sil.hのターゲット依存部(GR-PEACH用) 42 3 * 43 4 * このヘッダファイルは,sil.hからインクルードされる.他のファイルから 44 5 * 直接インクルードすることはない.このファイルをインクルードする前に, 45 6 * t_stddef.hがインクルードされるので,それに依存してもよい. 7 * 8 * $Id$ 46 9 */ 47 10 … … 57 20 * コアで共通な定義(チップ依存部は飛ばす) 58 21 */ 59 #ifndef TECSGEN60 22 #include "core_sil.h" 61 #endif /* TECSGEN */62 23 63 24 #endif /* TOPPERS_TARGET_SIL_H */ -
EcnlProtoTool/trunk/asp3_dcre/target/gr_peach_gcc/target_stddef.h
r321 r429 1 /*2 * TOPPERS Software3 * Toyohashi Open Platform for Embedded Real-Time Systems4 *5 * Copyright (C) 2007-2016 by Embedded and Real-Time Systems Laboratory6 * Graduate School of Information Science, Nagoya Univ., JAPAN7 *8 * 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ9 * ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改10 * 変・再配布(以下,利用と呼ぶ)することを無償で許諾する.11 * (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作12 * 権表示,この利用条件および下記の無保証規定が,そのままの形でソー13 * スコード中に含まれていること.14 * (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使15 * 用できる形で再配布する場合には,再配布に伴うドキュメント(利用16 * 者マニュアルなど)に,上記の著作権表示,この利用条件および下記17 * の無保証規定を掲載すること.18 * (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使19 * 用できない形で再配布する場合には,次のいずれかの条件を満たすこ20 * と.21 * (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著22 * 作権表示,この利用条件および下記の無保証規定を掲載すること.23 * (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに24 * 報告すること.25 * (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損26 * 害からも,上記著作権者およびTOPPERSプロジェクトを免責すること.27 * また,本ソフトウェアのユーザまたはエンドユーザからのいかなる理28 * 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを29 * 免責すること.30 *31 * 本ソフトウェアは,無保証で提供されているものである.上記著作権者お32 * よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的33 * に対する適合性も含めて,いかなる保証も行わない.また,本ソフトウェ34 * アの利用により直接的または間接的に生じたいかなる損害に関しても,そ35 * の責任を負わない.36 *37 * $Id$38 */39 40 1 /* 41 2 * t_stddef.hのターゲット依存部(GR-PEACH用) … … 44 5 * イルからは直接インクルードすることはない.他のヘッダファイルに先立っ 45 6 * て処理されるため,他のヘッダファイルに依存してはならない. 7 * 8 * $Id$ 46 9 */ 47 10 … … 56 19 57 20 /* 58 * 開発環境で共通な定義 59 */ 60 #ifndef TOPPERS_MACRO_ONLY 61 #include <stdint.h> 62 #endif /* TOPPERS_MACRO_ONLY */ 63 64 #define TOPPERS_STDFLOAT_TYPE1 65 #include "tool_stddef.h" 66 67 /* 68 * チッブ依存で共通な定義 21 * チッブで共通な定義 69 22 */ 70 23 #include "chip_stddef.h" -
EcnlProtoTool/trunk/asp3_dcre/target/gr_peach_gcc/target_support.S
r321 r429 51 51 #define CAST(type, val) (val) /* 型キャストを行うマクロ */ 52 52 #include "kernel_impl.h" 53 #include " core_pl310.h"53 #include "pl310.h" 54 54 #include "core_asm.inc" 55 55 … … 71 71 ldrb r0, [r2] /* ダミーリード */ 72 72 73 /* 73 /* 74 74 * クロック関係の初期化 75 75 * … … 103 103 104 104 #ifdef TOPPERS_RZA1H 105 /* 105 /* 106 106 * 画像処理クロックを「×2/3」に(266.67MHz) 107 107 */ … … 115 115 #endif /* TOPPERS_RZA1H */ 116 116 117 /* 117 /* 118 118 * ソフトウェアスタンバイ復帰中でなくなるまで待つ 119 119 */ -
EcnlProtoTool/trunk/asp3_dcre/target/gr_peach_gcc/target_syssvc.h
r426 r429 1 1 /* 2 * TOPPERS/ASP Kernel 3 * Toyohashi Open Platform for Embedded Real-Time Systems/ 4 * Advanced Standard Profile Kernel 5 * 6 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory 7 * Toyohashi Univ. of Technology, JAPAN 8 * Copyright (C) 2005-2016 by Embedded and Real-Time Systems Laboratory 9 * Graduate School of Information Science, Nagoya Univ., JAPAN 10 * 11 * 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ 12 * ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改 13 * 変・再配布(以下,利用と呼ぶ)することを無償で許諾する. 14 * (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作 15 * 権表示,この利用条件および下記の無保証規定が,そのままの形でソー 16 * スコード中に含まれていること. 17 * (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使 18 * 用できる形で再配布する場合には,再配布に伴うドキュメント(利用 19 * 者マニュアルなど)に,上記の著作権表示,この利用条件および下記 20 * の無保証規定を掲載すること. 21 * (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使 22 * 用できない形で再配布する場合には,次のいずれかの条件を満たすこ 23 * と. 24 * (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著 25 * 作権表示,この利用条件および下記の無保証規定を掲載すること. 26 * (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに 27 * 報告すること. 28 * (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損 29 * 害からも,上記著作権者およびTOPPERSプロジェクトを免責すること. 30 * また,本ソフトウェアのユーザまたはエンドユーザからのいかなる理 31 * 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを 32 * 免責すること. 33 * 34 * 本ソフトウェアは,無保証で提供されているものである.上記著作権者お 35 * よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的 36 * に対する適合性も含めて,いかなる保証も行わない.また,本ソフトウェ 37 * アの利用により直接的または間接的に生じたいかなる損害に関しても,そ 38 * の責任を負わない. 39 * 40 * $Id$ 41 */ 42 43 /* 44 * システムサービスのターゲット依存部(GR-PEACH用) 2 * システムサービスのターゲット依存部 45 3 * 46 4 * システムサービスのターゲット依存部のヘッダファイル.システムサービ 47 5 * スのターゲット依存の設定は,できる限りコンポーネント記述ファイルで 48 6 * 記述し,このファイルに記述するものは最小限とする. 7 * 8 * $Id$ 49 9 */ 50 10 51 11 #ifndef TOPPERS_TARGET_SYSSVC_H 52 12 #define TOPPERS_TARGET_SYSSVC_H 53 54 #include "gr_peach.h"55 56 /*57 * トレースログに関する設定58 */59 #ifdef TOPPERS_ENABLE_TRACE60 #include "arch/tracelog/trace_log.h"61 #endif /* TOPPERS_ENABLE_TRACE */62 13 63 14 /* -
EcnlProtoTool/trunk/asp3_dcre/target/gr_peach_gcc/target_test.h
r321 r429 3 3 * Toyohashi Open Platform for Embedded Real-Time Systems/ 4 4 * Advanced Standard Profile Kernel 5 * 5 * 6 6 * Copyright (C) 2007-2016 by Embedded and Real-Time Systems Laboratory 7 7 * Graduate School of Information Science, Nagoya Univ., JAPAN 8 * 8 * 9 9 * 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ 10 10 * ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改 … … 29 29 * 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを 30 30 * 免責すること. 31 * 31 * 32 32 * 本ソフトウェアは,無保証で提供されているものである.上記著作権者お 33 33 * よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的 … … 35 35 * アの利用により直接的または間接的に生じたいかなる損害に関しても,そ 36 36 * の責任を負わない. 37 * 37 * 38 38 * $Id$ 39 39 */ … … 49 49 50 50 /* 51 * サンプルプログラム で使用する割込みに関する定義51 * サンプルプログラム/テストプログラムで使用する割込みに関する定義 52 52 */ 53 53 #define INTNO1 INTNO_IRQ5 54 54 #define INTNO1_INTATR TA_ENAINT|TA_NEGEDGE 55 #define INTNO1_INTPRI -1555 #define INTNO1_INTPRI (-15) 56 56 #define intno1_clear() rza1_clear_irq(INTNO_IRQ5) 57 57 -
EcnlProtoTool/trunk/asp3_dcre/target/gr_peach_gcc/target_timer.cfg
r321 r429 5 5 */ 6 6 7 #include "gr_peach.h"8 7 #include "target_timer.h" 9 8 10 9 /* 11 * チップ依存部 (RZ/A1用)10 * チップ依存部 12 11 */ 13 12 INCLUDE("chip_timer.cfg"); -
EcnlProtoTool/trunk/asp3_dcre/target/gr_peach_gcc/target_timer.h
r321 r429 1 1 /* 2 * TOPPERS/ASP Kernel 3 * Toyohashi Open Platform for Embedded Real-Time Systems/ 4 * Advanced Standard Profile Kernel 5 * 6 * Copyright (C) 2007-2016 by Embedded and Real-Time Systems Laboratory 7 * Graduate School of Information Science, Nagoya Univ., JAPAN 8 * 9 * 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ 10 * ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改 11 * 変・再配布(以下,利用と呼ぶ)することを無償で許諾する. 12 * (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作 13 * 権表示,この利用条件および下記の無保証規定が,そのままの形でソー 14 * スコード中に含まれていること. 15 * (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使 16 * 用できる形で再配布する場合には,再配布に伴うドキュメント(利用 17 * 者マニュアルなど)に,上記の著作権表示,この利用条件および下記 18 * の無保証規定を掲載すること. 19 * (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使 20 * 用できない形で再配布する場合には,次のいずれかの条件を満たすこ 21 * と. 22 * (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著 23 * 作権表示,この利用条件および下記の無保証規定を掲載すること. 24 * (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに 25 * 報告すること. 26 * (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損 27 * 害からも,上記著作権者およびTOPPERSプロジェクトを免責すること. 28 * また,本ソフトウェアのユーザまたはエンドユーザからのいかなる理 29 * 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを 30 * 免責すること. 31 * 32 * 本ソフトウェアは,無保証で提供されているものである.上記著作権者お 33 * よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的 34 * に対する適合性も含めて,いかなる保証も行わない.また,本ソフトウェ 35 * アの利用により直接的または間接的に生じたいかなる損害に関しても,そ 36 * の責任を負わない. 37 * 2 * タイマドライバ 3 * 38 4 * $Id$ 39 */40 41 /*42 * タイマドライバ(GR-PEACH用)43 5 */ 44 6 … … 47 9 48 10 /* 49 * チップで共通な定義 (RZ/A1用)11 * チップで共通な定義 50 12 */ 51 13 #include "chip_timer.h" -
EcnlProtoTool/trunk/asp3_dcre/target/gr_peach_gcc/target_unrename.h
r321 r429 8 8 * target_kernel_impl.c 9 9 */ 10 #undef arm_tnum_memory_area 11 #undef arm_memory_area 10 12 #undef target_initialize 11 13 #undef target_exit 12 13 /*14 * tTraceLog.c15 */16 #undef log_dsp_enter17 #undef log_dsp_leave18 #undef log_inh_enter19 #undef log_inh_leave20 #undef log_exc_enter21 #undef log_exc_leave22 14 23 15 -
EcnlProtoTool/trunk/asp3_dcre/target/gr_peach_gcc/target_user.txt
r331 r429 3 3 GR-PEACH依存部 ユーザーズマニュアル 4 4 5 対応バージョン: Release 3. 16 最終更新: 201 6年4月2日5 対応バージョン: Release 3.5.0 6 最終更新: 2019年10月6日 7 7 8 8 このドキュメントは,TOPPERS/ASP3カーネルのGR-PEACHターゲット依存部を使 … … 14 14 Advanced Standard Profile Kernel 15 15 16 Copyright (C) 2008-201 6by Embedded and Real-Time Systems Laboratory16 Copyright (C) 2008-2019 by Embedded and Real-Time Systems Laboratory 17 17 Graduate School of Information Science, Nagoya Univ., JAPAN 18 18 19 上記著作権者は,以下の(1) 〜(4)の条件を満たす場合に限り,本ソフトウェ19 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ 20 20 ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改 21 21 変・再配布(以下,利用と呼ぶ)することを無償で許諾する. … … 46 46 の責任を負わない. 47 47 48 $Id: target_user.txt 1 145 2017-02-06 04:26:43Z coas-nagasima$48 $Id: target_user.txt 1280 2019-10-06 01:47:52Z ertl-hiro $ 49 49 ---------------------------------------------------------------------- 50 50 … … 57 57 58 58 ○目次 59 60 1.GR-PEACHターゲット依存部の概要 61 1.1 対応するターゲットシステムとターゲット略称 62 1.2 ターゲット依存部の構成 63 1.3 依存している個別パッケージのバージョン番号 64 1.4 開発環境/デバッグ環境と動作確認条件 65 1.5 メモリマップ 66 2.ターゲット定義事項の規定 67 3.ドライバ関連の情報 68 3.1 タイマドライバ 69 3.2 シリアルインタフェースドライバ 70 3.3 システムログの低レベル出力 71 4.システム構築手順と実行手順 72 4.1 ROM実行の場合の構築手順と実行手順 73 4.2 RAM実行の場合の構築手順と実行手順 74 4.3 ドライバのインストール 75 5.リファレンス 76 5.1 ディレクトリ構成・ファイル構成 77 5.2 バージョン履歴 59 78 60 79 … … 98 117 arm_gcc/doc/ ARM依存部に関するドキュメント 99 118 gcc/ GCC開発環境依存部 100 tracelog/ トレースログ記録のサンプルコード101 119 102 120 1.3 依存している個別パッケージのバージョン番号 103 121 104 GR-PEACHターゲット依存部(バージョン 3. 1.0)の個別パッケージが依存して122 GR-PEACHターゲット依存部(バージョン 3.4.0)の個別パッケージが依存して 105 123 いる個別パッケージと,動作確認を行ったバージョンは次の通り. 106 124 107 125 個別パッケージの名称 バージョン 個別パッケージファイル名 108 126 ------------------------------------------------------------------ 109 ターゲット非依存部 3. 1.0 asp3-3.1.0.tar.gz127 ターゲット非依存部 3.4.0 asp3-3.4.0.tar.gz 110 128 111 129 1.4 開発環境/デバッグ環境と動作確認条件 112 130 113 開発環境として,以下のURLからプリビルド版をダウンロードすることができる 114 GCC ARM Embeddedを用いている. 115 116 https://launchpad.net/gcc-arm-embedded/ 131 開発環境として,以下のURLからプリビルド版をダウンロードすることができ 132 るGNU ARM Embedded Toolchainを用いている(Cortex-MとCortex-R向けの開発 133 環境であるが,Cortex-A向けにも使用できる). 134 135 https://developer.arm.com/open-source/gnu-toolchain/gnu-rm 117 136 118 137 動作確認を行ったバージョンは次の通り. 119 138 120 gcc: version 4.8.3 20140228121 binutils(objcopy,objdump):2. 23.2.20140228122 123 デバッグ環境として,オンボードのCMSIS-DAPから,OpenOCDを経由して,GDB を124 用いる環境で動作確認を行っている.動作確認を行ったデバッグ環境のバージョ 125 ンは次の通り.139 gcc: 7.3.1 20180622 140 binutils(objcopy,objdump):2.30.0.20180329 141 142 デバッグ環境として,オンボードのCMSIS-DAPから,OpenOCDを経由して,GDB 143 を用いる環境で動作確認を行っている.動作確認を行ったデバッグ環境のバー 144 ジョンは次の通り. 126 145 127 146 gdb: 7.6.0.20140228-cvs 128 147 openocd: 0.10.0-dev-00287-g85cec24 129 148 130 古いバージョンのOpenOCDでは正しく動作しないことが報告されているため,注 131 意が必要である. 132 133 GUIベースの開発環境/デバッグ環境として,Atollic TrueStudioを用いること 134 ができる. 149 新しいgdb(8.1.0.20180315-git)を使用したところ,OpenOCDとうまく接続で 150 きなかったため,やや古いgdbを使用している.また,異なるバージョンの 151 OpenOCDでは正しく動作しないことが報告されているため,注意が必要である. 152 153 GUIベースの開発環境/デバッグ環境として,Atollic TrueSTUDIOを用いるこ 154 とができる. 135 155 136 156 1.5 メモリマップ … … 143 163 0xe8000000 - 0xffffffff:I/O領域(384MB),予約領域を含む 144 164 145 内蔵SRAM領域の先頭の16KBは,ブートローダを置くために使用する. 165 シリアルフラッシュメモリの先頭の16KBは,ブートローダを置くために使用す 166 る. 146 167 147 168 RAM実行の場合は,以下のメモリマップを想定している. 148 169 149 0x20000000 - 0x200fffff: 内蔵SRAM(1MB)… ROM領域として使用150 0x20100000 - 0x209fffff: 内蔵SRAM(9MB)170 0x20000000 - 0x200fffff:ROMとみなす内蔵SRAM領域(1MB) 171 0x20100000 - 0x209fffff:RAMとみなす内蔵SRAM領域(9MB) 151 172 0x3fe00000 - 0x3fffffff:I/O領域(2MB),予約領域を含む 152 173 0xe8000000 - 0xffffffff:I/O領域(384MB),予約領域を含む … … 156 177 157 178 メモリマップを変更する場合には,target_kernel_impl.cとgr_peach_rom.ld 158 (または,pr_peach_ram. kd)を修正する必要がある.179 (または,pr_peach_ram.ld)を修正する必要がある. 159 180 160 181 … … 164 185 装されている.ARMコア依存部およびRZ/A1チップ依存部におけるターゲット定 165 186 義事項の規定については,「ARM依存部 ユーザーズマニュアル」を参照するこ 166 と. それらの規定以外に,GR-PEACHターゲット定義の事項はない.187 と. 167 188 168 189 … … 180 201 コミュニケーションインタフェースをサポートしている. 181 202 182 USB経由でホストと接続できるポートは,SCIFのチャネル2(チャネル番号は0か 183 ら始まるので,ポート3に相当)である.一方,sample1.cdlでは,ログタスク 184 およびサンプルプログラムが使うポートがポート1となっているため,ポート1 185 とポート3を入れ換えている.すなわち,シリアルインタフェースドライバのポー 186 ト1がSCIFのチャネル2,ポート2がチャネル1,ポート3がチャネル0,ポート4が 187 チャネル3,…に対応している. 203 GR-PEACHでUSB経由でホストと接続できるポートは,SCIFのチャネル2(チャネ 204 ル番号は0から始まるので,ポート3に相当)である.一方,サンプルプログラ 205 ム(sample1.cdl)では,ログタスクおよびサンプルプログラムが使うポート 206 がポート1となっているため,ポート1とポート3を入れ換えている.すなわち, 207 シリアルインタフェースドライバのポート1がSCIFのチャネル2,ポート2がチャ 208 ネル1,ポート3がチャネル0,ポート4がチャネル3,…に対応している.この 209 対応を変更するには,tSIOPortGRPeach.cdlを修正する必要がある. 210 211 各ポートは,以下の通りに設定している. 188 212 189 213 ボーレート:115200bps … … 191 215 パリティ:なし 192 216 ストップビット:1ビット 193 フロー制御:なし 194 195 この対応を変更するには,tSIOPortGRPeach.cdlを修正する必要がある.217 218 この設定は,RZ/A1チップ依存部で行っているが,tSIOPortGRPeach.cdlを修正 219 することで変更することができる. 196 220 197 221 3.3 システムログの低レベル出力 … … 292 316 renesas_rza1h_swd.cfg OpenOCDの起動スクリプト 293 317 sf_boot.c ブートローダ(ROM実行用) 294 tPutLogGRPeach.c システムログの低レベル出力295 tPutLogGRPeach.cdl システムログの低レベル出力のコンポーネント記述296 318 tSIOPortGRPeach.cdl シリアルインタフェースドライバのターゲット 297 319 依存部(GR-PEACH用)のコンポーネント記述 298 tSIOPortGRPeachMain_inline.h シリアルインタフェースドライバの299 ターゲット依存部(GR-PEACH用)300 320 target.cdl コンポーネント記述ファイルのターゲット依存部 301 321 target_cfg1_out.h cfg1_out.cのリンクに必要なスタブの定義 … … 322 342 323 343 2016年5月15日 Release 3.1.0 最初の一般公開 344 2017年7月21日 Release 3.2.0 345 2018年4月19日 Release 3.3.0 346 2019年3月20日 Release 3.4.0 347 2019年10月6日 Release 3.5.0 324 348 325 349 以上 -
EcnlProtoTool/trunk/asp3_dcre/target/gr_peach_gcc/tinet_target_config.h
r331 r429 182 182 #define NUM_IF_MBED_RXBUF NUM_OF_RX_DESCRIPTOR /* 受信バッファ数 */ 183 183 184 #define TMO_IF_MBED_GET_NET_BUF 1000 /* [ ms]、受信用 net_buf 獲得タイムアウト */184 #define TMO_IF_MBED_GET_NET_BUF 1000 /* [us]、受信用 net_buf 獲得タイムアウト */ 185 185 /* [s]、 送信タイムアウト */ 186 186 #define TMO_IF_MBED_XMIT (2*IF_TIMER_HZ) 187 187 188 188 /*#define IF_MBED_CFG_ACCEPT_ALL マルチキャスト、エラーフレームも受信するときはコメントを外す。*/ 189 190 /* 191 * Bluetooth USB PAN に関する定義 192 */ 193 194 #define NUM_IF_BTUSB_TXBUF 2 /* 送信バッファ数 */ 195 #define NUM_IF_BTUSB_RXBUF 2 /* 受信バッファ数 */ 196 #define IF_BTUSB_BUF_PAGE_SIZE 1518 /* バッファサイズ */ 197 198 #define TMO_IF_BTUSB_GET_NET_BUF 1000 /* [us]、受信用 net_buf 獲得タイムアウト */ 199 /* [s]、 送信タイムアウト */ 200 #define TMO_IF_BTUSB_XMIT (2*IF_TIMER_HZ) 189 201 190 202 /* -
EcnlProtoTool/trunk/asp3_dcre/tecs_kernel/kernel.cdl
r321 r429 6 6 * Copyright (C) 2015,2016 by Ushio Laboratory 7 7 * Graduate School of Engineering Science, Osaka Univ., JAPAN 8 * Copyright (C) 2015 ,2016by Embedded and Real-Time Systems Laboratory8 * Copyright (C) 2015-2018 by Embedded and Real-Time Systems Laboratory 9 9 * Graduate School of Information Science, Nagoya Univ., JAPAN 10 10 * … … 299 299 ER sendForce([in] intptr_t data); 300 300 ER receive([out] intptr_t *p_data); 301 ER receivePolling([out] intptr_t *p_ Data);301 ER receivePolling([out] intptr_t *p_data); 302 302 ER receiveTimeout([out] intptr_t *p_data, [in] TMO timeout); 303 303 ER initialize(void); … … 397 397 ER unlock(void); 398 398 ER initialize(void); 399 ER refer([out] T_R SEM*pk_mutexStatus);399 ER refer([out] T_RMTX *pk_mutexStatus); 400 400 }; 401 401 … … 501 501 502 502 attr { 503 ID id = C_EXP(" ALMID_$id$");503 ID id = C_EXP("CYCID_$id$"); 504 504 [omit] ATR attribute = C_EXP("TA_NULL"); 505 505 [omit] bool_t ignoreErrors = false; … … 536 536 537 537 /* 538 * 周期通知に ユーザーハンドラを指定するための複合セルタイプ538 * 周期通知にタイムイベントハンドラを指定するための複合セルタイプ 539 539 */ 540 540 [active] … … 544 544 545 545 attr { 546 ID id = C_EXP(" ALMID_$id$");546 ID id = C_EXP("CYCID_$id$"); 547 547 [omit] ATR attribute = C_EXP("TA_NULL"); 548 548 [omit] RELTIM cycleTime; … … 630 630 631 631 /* 632 * アラーム通知に ユーザーハンドラを指定するための複合セルタイプ632 * アラーム通知にタイムイベントハンドラを指定するための複合セルタイプ 633 633 */ 634 634 [active] … … 663 663 ER disable(void); 664 664 ER enable(void); 665 ER clear(void); 666 ER raise(void); 667 ER_BOOL probe(void); 665 668 }; 666 669 … … 715 718 716 719 attr { 717 INHNO interruptHandlerNumber; 718 [omit] ATR attribute = C_EXP("TA_NULL"); 719 }; 720 721 factory { 722 write("tecsgen.cfg", 723 "DEF_INH(%s, { %s, tInterruptHandler_start });", attribute); 720 [omit] INHNO interruptHandlerNumber; 721 [omit] ATR attribute = C_EXP("TA_NULL"); 722 }; 723 724 factory { 725 write("tecsgen.cfg", "DEF_INH(%s, { %s, $id$_start });", 726 interruptHandlerNumber, attribute); 727 write("$ct$_tecsgen.h", 728 "#ifndef TOPPERS_MACRO_ONLY\n" 729 "extern void $id$_start(void);\n" 730 "#endif /* TOPPERS_MACRO_ONLY */\n"); 731 write("$ct$.c", 732 "void $id$_start()\n" 733 "{\n" 734 " CELLCB *p_cellcb = $cbp$;\n" 735 " ciInterruptHandlerBody_main();\n" 736 "}\n"); 724 737 }; 725 738 FACTORY { 726 739 write("tecsgen.cfg", "#include \"$ct$_tecsgen.h\""); 727 }; 740 write("$ct$.c", "#include \"$ct$_tecsgen.h\""); 741 }; 742 }; 743 744 /* 745 * CPU例外ハンドラ本体のシグニチャ 746 */ 747 [context("non-task")] 748 signature siCpuExceptionHandlerBody { 749 void main([in] const void *p_excinf); 728 750 }; 729 751 … … 733 755 [active] 734 756 celltype tCpuExceptionHandler { 735 call siHandlerBody ciCpuExceptionHandlerBody; 736 737 attr { 738 EXCNO cpuExceptionHandlerNumber; 739 [omit] ATR attribute = C_EXP("TA_NULL"); 740 }; 741 742 factory { 743 write("tecsgen.cfg", 744 "DEF_EXC(%s, { %s, tCpuExceptionHandler_start });", attribute); 757 call siCpuExceptionHandlerBody ciCpuExceptionHandlerBody; 758 759 attr { 760 [omit] EXCNO cpuExceptionHandlerNumber; 761 [omit] ATR attribute = C_EXP("TA_NULL"); 762 }; 763 764 factory { 765 write("tecsgen.cfg", "DEF_EXC(%s, { %s, $id$_start });", 766 cpuExceptionHandlerNumber, attribute); 767 write("$ct$_tecsgen.h", 768 "#ifndef TOPPERS_MACRO_ONLY\n" 769 "extern void $id$_start(void *p_excinf);\n" 770 "#endif /* TOPPERS_MACRO_ONLY */\n"); 771 write("$ct$.c", 772 "void $id$_start(void *p_excinf)\n" 773 "{\n" 774 " CELLCB *p_cellcb = $cbp$;\n" 775 " ciCpuExceptionHandlerBody_main(p_excinf);\n" 776 "}\n"); 745 777 }; 746 778 FACTORY { 747 779 write("tecsgen.cfg", "#include \"$ct$_tecsgen.h\""); 780 write("$ct$.c", "#include \"$ct$_tecsgen.h\""); 748 781 }; 749 782 }; -
EcnlProtoTool/trunk/asp3_dcre/tecs_kernel/tAlarmNotifier_inline.h
r321 r429 6 6 * Copyright (C) 2015 by Ushio Laboratory 7 7 * Graduate School of Engineering Science, Osaka Univ., JAPAN 8 * Copyright (C) 2015 by Embedded and Real-Time Systems Laboratory8 * Copyright (C) 2015-2018 by Embedded and Real-Time Systems Laboratory 9 9 * Graduate School of Information Science, Nagoya Univ., JAPAN 10 10 * … … 81 81 { 82 82 CELLCB *p_cellcb = GET_CELLCB(idx); 83 return( ista_alm(ATTR_id, alarmTime));83 return(sta_alm(ATTR_id, alarmTime)); 84 84 } 85 85 … … 91 91 { 92 92 CELLCB *p_cellcb = GET_CELLCB(idx); 93 return( istp_alm(ATTR_id));93 return(stp_alm(ATTR_id)); 94 94 } 95 95 -
EcnlProtoTool/trunk/asp3_dcre/tecs_kernel/tFixedSizeMemoryPool_inline.h
r321 r429 51 51 { 52 52 CELLCB *p_cellcb = GET_CELLCB(idx); 53 return(get_mpf( 53 return(get_mpf(ATTR_id, p_block)); 54 54 } 55 55 -
EcnlProtoTool/trunk/asp3_dcre/tecs_kernel/tInitializeRoutine.c
r321 r429 46 46 * 初期化ルーチン本体の呼出し 47 47 */ 48 void tInitializeRoutine_start(intptr_t exinf) 48 void 49 tInitializeRoutine_start(intptr_t exinf) 49 50 { 50 51 CELLCB *p_cellcb = (CELLCB *) exinf; -
EcnlProtoTool/trunk/asp3_dcre/tecs_kernel/tInterruptRequest_inline.h
r321 r429 6 6 * Copyright (C) 2015 by Ushio Laboratory 7 7 * Graduate School of Engineering Science, Osaka Univ., JAPAN 8 * Copyright (C) 2015 by Embedded and Real-Time Systems Laboratory8 * Copyright (C) 2015-2017 by Embedded and Real-Time Systems Laboratory 9 9 * Graduate School of Information Science, Nagoya Univ., JAPAN 10 10 * … … 64 64 } 65 65 66 /* 67 * 割込み要求のクリア 68 */ 69 Inline ER 70 eInterruptRequest_clear(CELLIDX idx) 71 { 72 CELLCB *p_cellcb = GET_CELLCB(idx); 73 return(clr_int(ATTR_interruptNumber)); 74 } 75 76 /* 77 * 割込みの要求 78 */ 79 Inline ER 80 eInterruptRequest_raise(CELLIDX idx) 81 { 82 CELLCB *p_cellcb = GET_CELLCB(idx); 83 return(ras_int(ATTR_interruptNumber)); 84 } 85 86 /* 87 * 割込み要求のチェック 88 */ 89 Inline ER_BOOL 90 eInterruptRequest_probe(CELLIDX idx) 91 { 92 CELLCB *p_cellcb = GET_CELLCB(idx); 93 return(prb_int(ATTR_interruptNumber)); 94 } 95 66 96 #endif /* TOPPERS_TINTERRUPTREQUEST_INLINE_H */ -
EcnlProtoTool/trunk/asp3_dcre/tecs_kernel/tKernel_inline.h
r321 r429 185 185 eKernel_getNthTask(PRI taskPriority, uint_t nth, ID* p_taskID) 186 186 { 187 return (get_nth(taskPriority, nth, p_taskID)); 188 } 187 return(get_nth(taskPriority, nth, p_taskID)); 188 } 189 189 190 /* 190 191 * CPUロック状態への遷移 -
EcnlProtoTool/trunk/asp3_dcre/tecs_kernel/tMutex_inline.h
r321 r429 71 71 { 72 72 CELLCB *p_cellcb = GET_CELLCB(idx); 73 return( ploc_mtx(ATTR_id, timeout));73 return(tloc_mtx(ATTR_id, timeout)); 74 74 } 75 75 -
EcnlProtoTool/trunk/asp3_dcre/tecs_kernel/tTask_inline.h
r321 r429 6 6 * Copyright (C) 2015 by Ushio Laboratory 7 7 * Graduate School of Engineering Science, Osaka Univ., JAPAN 8 * Copyright (C) 2015 by Embedded and Real-Time Systems Laboratory8 * Copyright (C) 2015-2019 by Embedded and Real-Time Systems Laboratory 9 9 * Graduate School of Information Science, Nagoya Univ., JAPAN 10 10 * … … 191 191 { 192 192 CELLCB *p_cellcb= GET_CELLCB(idx); 193 return( iwup_tsk(ATTR_id));193 return(wup_tsk(ATTR_id)); 194 194 } 195 195 … … 201 201 { 202 202 CELLCB *p_cellcb = GET_CELLCB(idx); 203 return( irel_wai(ATTR_id));203 return(rel_wai(ATTR_id)); 204 204 } 205 205 -
EcnlProtoTool/trunk/asp3_dcre/tecs_kernel/tTerminateRoutine.c
r321 r429 46 46 * 終了処理ルーチン本体の呼出し 47 47 */ 48 49 voidtTerminateRoutine_start(intptr_t exinf)48 void 49 tTerminateRoutine_start(intptr_t exinf) 50 50 { 51 51 CELLCB *p_cellcb = (CELLCB *) exinf; -
EcnlProtoTool/trunk/asp3_dcre/tecs_kernel/tecs_kernel.h
r321 r429 47 47 #include <kernel.h> 48 48 49 extern void tTask_start(intptr_t exinf); 50 51 extern void tTimeEventHandler_start(intptr_t exinf); 49 extern void tTask_start(intptr_t exinf); 52 50 53 51 extern void tISR_start(intptr_t exinf); 54 extern void tInterruptHandler_start(void);55 extern void tCpuExceptionHandler_start(void *p_excinf);56 52 57 53 extern void tInitializeRoutine_start(intptr_t exinf); -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/MANIFEST_for_asp3
r270 r429 25 25 tecslib/core/tecs_lang.rb 26 26 tecslib/core/tecsgen.rb 27 tecslib/core/tecsinfo.rb 28 tecslib/core/tool_info.rb 27 29 tecslib/core/types.rb 30 tecslib/core/unjoin_plugin.rb 28 31 tecslib/core/value.rb 29 32 … … 36 39 tecslib/plugin/CellPlugin.rb 37 40 tecslib/plugin/CelltypePlugin.rb 41 tecslib/plugin/CompositePlugin.rb 38 42 tecslib/plugin/DomainPlugin.rb 39 43 tecslib/plugin/Mruby2CBridgePlugin.rb 40 44 tecslib/plugin/MrubyBridgePlugin.rb 45 tecslib/plugin/MultiPlugin.rb 41 46 tecslib/plugin/NotifierPlugin.rb 42 47 tecslib/plugin/RPCPlugin.rb … … 97 102 tecs/rpc/tTDR_inline.h 98 103 tecs/rpc/tecs_rpc.h 104 tecs/rpc/tMessageBufferCEP.cdl 105 tecs/rpc/tMessageBufferCEP_inline.h 106 tecs/rpc/tMessageBufferChannel.cdl -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/MANIFEST_tecsgen_body
r270 r429 2 2 3 3 Makefile 4 4 tecscde 5 tecscde.rb 5 6 tecsgen 6 7 tecsgen.rb 8 tecsgen_rcov.rb 7 9 tecsmerge 8 10 tecsmerge.rb 9 tecslib/version.rb 10 11 cdelib/Makefile 12 cdelib/cell_plugin_dialog.rb 13 cdelib/cell_plugin_dialog_ui_definition.rb 14 cdelib/palette.rb 15 cdelib/saveload.rb 16 cdelib/tcontrol.rb 17 cdelib/tmodel.rb 18 cdelib/tview.rb 19 cdelib/version.rb 20 tecs/TECSInfo/TECSInfo.cdl 21 tecs/TECSInfo/TECSInfoAccessor.cdl 22 tecs/TECSInfo/nTECSInfo_tArrayTypeInfo.c 23 tecs/TECSInfo/nTECSInfo_tBoolTypeInfo.c 24 tecs/TECSInfo/nTECSInfo_tCallInfo.c 25 tecs/TECSInfo/nTECSInfo_tCellInfo.c 26 tecs/TECSInfo/nTECSInfo_tCelltypeInfo.c 27 tecs/TECSInfo/nTECSInfo_tDefinedTypeInfo.c 28 tecs/TECSInfo/nTECSInfo_tDescriptorTypeInfo.c 29 tecs/TECSInfo/nTECSInfo_tEntryInfo.c 30 tecs/TECSInfo/nTECSInfo_tFloatTypeInfo.c 31 tecs/TECSInfo/nTECSInfo_tFunctionInfo.c 32 tecs/TECSInfo/nTECSInfo_tIntTypeInfo.c 33 tecs/TECSInfo/nTECSInfo_tNamespaceInfo.c 34 tecs/TECSInfo/nTECSInfo_tParamInfo.c 35 tecs/TECSInfo/nTECSInfo_tPtrTypeInfo.c 36 tecs/TECSInfo/nTECSInfo_tRawEntryDescriptorInfo.c 37 tecs/TECSInfo/nTECSInfo_tRegionInfo.c 38 tecs/TECSInfo/nTECSInfo_tSignatureInfo.c 39 tecs/TECSInfo/nTECSInfo_tStructTypeInfo.c 40 tecs/TECSInfo/nTECSInfo_tTECSInfoAccessor.c 41 tecs/TECSInfo/nTECSInfo_tTECSInfoSub.c 42 tecs/TECSInfo/nTECSInfo_tTECSInfo_inline.h 43 tecs/TECSInfo/nTECSInfo_tTypeInfo.c 44 tecs/TECSInfo/nTECSInfo_tVarDeclInfo.c 45 tecs/TECSInfo/nTECSInfo_tVoidTypeInfo.c 46 tecs/TECSInfo/tTECSInfoAccessor.c 47 tecs/TLSFMalloc/README-TLSF.txt 48 tecs/TLSFMalloc/tTLSFMalloc.cdl 49 tecs/TLSFMalloc/tTLSFMalloc_inline.h 50 tecs/mruby/README-mruby.txt 51 tecs/mruby/TECSPointer.h 52 tecs/mruby/TECSStruct.h 53 tecs/mruby/mruby.cdl 54 tecs/mruby/mrubyBridge.txt 55 tecs/mruby/mrubyInitializer.cdl 56 tecs/mruby/mrubyPointers.cdl 57 tecs/mruby/mrubyTECSPointer.txt 58 tecs/mruby/mrubyTECSStruct.txt 59 tecs/mruby/mrubyVMs.cdl 60 tecs/mruby/nMruby_tBoolPointer.c 61 tecs/mruby/nMruby_tCharPointer.c 62 tecs/mruby/nMruby_tDouble64Pointer.c 63 tecs/mruby/nMruby_tFloat32Pointer.c 64 tecs/mruby/nMruby_tInt16Pointer.c 65 tecs/mruby/nMruby_tInt32Pointer.c 66 tecs/mruby/nMruby_tInt64Pointer.c 67 tecs/mruby/nMruby_tInt8Pointer.c 68 tecs/mruby/nMruby_tIntPointer.c 69 tecs/mruby/nMruby_tLongPointer.c 70 tecs/mruby/nMruby_tMruby.c 71 tecs/mruby/nMruby_tMrubyCyclicTaskBody.c 72 tecs/mruby/nMruby_tMrubyProc.c 73 tecs/mruby/nMruby_tMrubyTaskBody.c 74 tecs/mruby/nMruby_tMrubyVM.c 75 tecs/mruby/nMruby_tSCharPointer.c 76 tecs/mruby/nMruby_tShortPointer.c 77 tecs/mruby/nMruby_tTECSInitializer.c 78 tecs/mruby/nMruby_tUCharPointer.c 79 tecs/mruby/nMruby_tUInt16Pointer.c 80 tecs/mruby/nMruby_tUInt32Pointer.c 81 tecs/mruby/nMruby_tUInt64Pointer.c 82 tecs/mruby/nMruby_tUInt8Pointer.c 83 tecs/mruby/nMruby_tUIntPointer.c 84 tecs/mruby/nMruby_tULongPointer.c 85 tecs/mruby/nMruby_tUShortPointer.c 86 tecs/mruby/sMruby.cdl 87 tecs/mruby/tMruby.cdl 88 tecs/mruby/tecs_mruby.h 89 tecs/posix/posix.cdl 90 tecs/rpc/PPAllocator.cdl 91 tecs/rpc/RPCTask.cdl 92 tecs/rpc/TDR.cdl 93 tecs/rpc/rpc.cdl 94 tecs/rpc/rpc_string.h 95 tecs/rpc/sChannel.cdl 96 tecs/rpc/sRPCErrorHandler.cdl 97 tecs/rpc/tDataqueueAdaptor_inline.h 98 tecs/rpc/tDataqueueOWChannel.cdl 99 tecs/rpc/tMessageBufferCEP.cdl 100 tecs/rpc/tMessageBufferCEP_inline.h 101 tecs/rpc/tMessageBufferChannel.cdl 102 tecs/rpc/tNBOTDR_inline.h 103 tecs/rpc/tPPAllocator.c 104 tecs/rpc/tRPCDedicatedTaskMain.c 105 tecs/rpc/tRPCDedicatedTaskMainWithOpener.c 106 tecs/rpc/tRPCSharedChannelMan.c 107 tecs/rpc/tRPCSharedTaskMain.c 108 tecs/rpc/tRPCSharedTaskMainWithOpener.c 109 tecs/rpc/tSocketChannel.cdl 110 tecs/rpc/tSocketClient.c 111 tecs/rpc/tSocketServer.c 112 tecs/rpc/tTDR_inline.h 113 tecs/rpc/tTINETChannel.cdl 114 tecs/rpc/tTINETClient.c 115 tecs/rpc/tTINETServer.c 116 tecs/rpc/tecs_rpc.h 117 tecs/sMalloc.cdl 118 tecs/tecs.h 119 tecs/tecs.xsd 11 120 tecslib/core/C_parser.tab.rb 12 121 tecslib/core/C_parser.y.rb … … 26 135 tecslib/core/tecs_lang.rb 27 136 tecslib/core/tecsgen.rb 137 tecslib/core/tecsinfo.rb 138 tecslib/core/tool_info.rb 28 139 tecslib/core/types.rb 140 tecslib/core/unjoin_plugin.rb 29 141 tecslib/core/value.rb 30 31 142 tecslib/messages/messages_console_en_US.rb 32 143 tecslib/messages/messages_console_ja_JP.rb 33 144 tecslib/messages/messages_file_en_US.rb 34 145 tecslib/messages/messages_file_ja_JP.rb 35 36 146 tecslib/plugin/ATK1AlarmPlugin.rb 37 147 tecslib/plugin/ATK1DelayTaskPlugin.rb … … 44 154 tecslib/plugin/CellPlugin.rb 45 155 tecslib/plugin/CelltypePlugin.rb 156 tecslib/plugin/CompositePlugin.rb 46 157 tecslib/plugin/DomainPlugin.rb 47 158 tecslib/plugin/HRP2AlarmHandlerPlugin.rb … … 61 172 tecslib/plugin/HRP2SemaphorePlugin.rb 62 173 tecslib/plugin/HRP2TaskPlugin.rb 174 tecslib/plugin/HRPHandlerPlugin.rb 175 tecslib/plugin/HRPKernelObjectManager.rb 176 tecslib/plugin/HRPKernelObjectPlugin.rb 177 tecslib/plugin/HRPObjectPlugin.rb 178 tecslib/plugin/HRPPlugin.rb 179 tecslib/plugin/HRPRPCPlugin.rb 180 tecslib/plugin/HRPSVCPlugin.rb 181 tecslib/plugin/HRPTaskPlugin.rb 63 182 tecslib/plugin/Mruby2CBridgePlugin.rb 183 tecslib/plugin/MrubyBridgeCellPlugin.rb 184 tecslib/plugin/MrubyBridgeCelltypePlugin.rb 185 tecslib/plugin/MrubyBridgeCompositePlugin.rb 64 186 tecslib/plugin/MrubyBridgePlugin.rb 187 tecslib/plugin/MrubyBridgeSignaturePlugin.rb 188 tecslib/plugin/MultiPlugin.rb 65 189 tecslib/plugin/NotifierPlugin.rb 66 190 tecslib/plugin/OpaqueMarshalerPlugin.rb 67 191 tecslib/plugin/OpaqueRPCPlugin.rb 68 192 tecslib/plugin/RPCPlugin.rb 193 tecslib/plugin/RepeatCellPlugin.rb 194 tecslib/plugin/RepeatJoinPlugin.rb 69 195 tecslib/plugin/SharedOpaqueRPCPlugin.rb 70 196 tecslib/plugin/SharedRPCPlugin.rb 71 197 tecslib/plugin/SignaturePlugin.rb 72 198 tecslib/plugin/TECS2CBridgePlugin.rb 199 tecslib/plugin/TECSInfoPlugin.rb 73 200 tecslib/plugin/ThroughPlugin.rb 74 201 tecslib/plugin/TracePlugin.rb … … 77 204 tecslib/plugin/lib/GenParamCopy.rb 78 205 tecslib/plugin/lib/GenTransparentMarshaler.rb 79 80 tecs/mruby/TECSPointer.h 81 tecs/mruby/TECSStruct.h 82 tecs/mruby/mruby.cdl 83 tecs/mruby/mrubyInitializer.cdl 84 tecs/mruby/mrubyPointers.cdl 85 tecs/mruby/mrubyVMs.cdl 86 tecs/mruby/nMruby_tBoolPointer.c 87 tecs/mruby/nMruby_tCharPointer.c 88 tecs/mruby/nMruby_tDouble64Pointer.c 89 tecs/mruby/nMruby_tFloat32Pointer.c 90 tecs/mruby/nMruby_tInt16Pointer.c 91 tecs/mruby/nMruby_tInt32Pointer.c 92 tecs/mruby/nMruby_tInt64Pointer.c 93 tecs/mruby/nMruby_tInt8Pointer.c 94 tecs/mruby/nMruby_tIntPointer.c 95 tecs/mruby/nMruby_tLongPointer.c 96 tecs/mruby/nMruby_tMruby.c 97 tecs/mruby/nMruby_tMrubyProc.c 98 tecs/mruby/nMruby_tMrubyProc_1_0.c 99 tecs/mruby/nMruby_tSCharPointer.c 100 tecs/mruby/nMruby_tShortPointer.c 101 tecs/mruby/nMruby_tTECSInitializer.c 102 tecs/mruby/nMruby_tUCharPointer.c 103 tecs/mruby/nMruby_tUInt16Pointer.c 104 tecs/mruby/nMruby_tUInt32Pointer.c 105 tecs/mruby/nMruby_tUInt64Pointer.c 106 tecs/mruby/nMruby_tUInt8Pointer.c 107 tecs/mruby/nMruby_tUIntPointer.c 108 tecs/mruby/nMruby_tULongPointer.c 109 tecs/mruby/nMruby_tUShortPointer.c 110 tecs/mruby/tMruby.cdl 111 tecs/mruby/tecs_mruby.h 112 tecs/posix/posix.cdl 113 tecs/rpc/PPAllocator.cdl 114 tecs/rpc/RPCTask.cdl 115 tecs/rpc/TDR.cdl 116 tecs/rpc/rpc.cdl 117 tecs/rpc/rpc_string.h 118 tecs/rpc/sChannel.cdl 119 tecs/rpc/sRPCErrorHandler.cdl 120 tecs/rpc/tDataqueueAdaptor_inline.h 121 tecs/rpc/tDataqueueOWChannel.cdl 122 tecs/rpc/tNBOTDR_inline.h 123 tecs/rpc/tPPAllocator.c 124 tecs/rpc/tRPCDedicatedTaskMain.c 125 tecs/rpc/tRPCDedicatedTaskMainWithOpener.c 126 tecs/rpc/tRPCSharedChannelMan.c 127 tecs/rpc/tRPCSharedTaskMain.c 128 tecs/rpc/tRPCSharedTaskMainWithOpener.c 129 tecs/rpc/tSocketChannel.cdl 130 tecs/rpc/tSocketClient.c 131 tecs/rpc/tSocketServer.c 132 tecs/rpc/tTDR_inline.h 133 tecs/rpc/tTINETChannel.cdl 134 tecs/rpc/tTINETClient.c 135 tecs/rpc/tTINETServer.c 136 tecs/rpc/tecs_rpc.h 137 tecs/tecs.h 138 tecs/tecs.xsd 206 tecslib/plugin/lib/MrubyBridgeCelltypePluginModule.rb 207 tecslib/version.rb -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/Makefile
r321 r429 34 34 # の責任を負わない. 35 35 # 36 # $Id $36 # $Id: Makefile 2640 2017-06-03 11:27:12Z okuma-top $ 37 37 #++ 38 38 … … 76 76 C_TAB = $(LIB_PATH)/C_parser.tab.rb 77 77 EXERB_EXE = tecsgen.exe 78 EXERB_EXY = tecsgen.exy79 78 80 79 all: generator … … 105 104 racc -v -g -o $(GEN_TAB_DEB) $(BNF) # yydebug を有効にする 106 105 107 # exerb : $(EXERB_EXE)108 exerb :109 @echo "!!! please build using ActiveScriptRuby !!!"110 exit 1111 112 # $(EXERB_EXE) : $(EXERB_EXY) $(GEN_SRC) $(PLUGIN_SRC)113 # exerb $(EXERB_EXY)114 # tecsgen.exy.ini から tecsgen.exy を生成するのは util/release.sh により行われる115 # MANIFEST に記載のバージョン番号が、tecsgen.exy.ini の文字列置換により、埋め込まれる116 117 exerb_check : $(EXERB_EXE)118 119 $(EXERB_EXE) : $(EXERB_EXY) $(GEN_SRC) $(PLUGIN_SRC)120 @echo "### Need make_tecsgen_exerb on ActiveScriptRuby to update tecsgen.exerb ###"121 122 106 print_error : # エラーメッセージを拾い出す 123 107 grep -e "Generator\.error" -e cdl_error $(LIB_PATH)/*.rb \ 124 108 | grep -v bnf.tab.rb \ 125 | sed -e "s/\s*Generator\.error(/ /" -e "s/\s*cdl_error(//" -e "s/).*$$//"109 | sed -e "s/\s*Generator\.error(//" -e "s/\s*cdl_error[0-9]*(//" -e "s/).*$$//" 126 110 127 111 print_error2 : # エラーメッセージを拾い出す -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/in_exerb.rb
r321 r429 35 35 # の責任を負わない. 36 36 # 37 # $Id $37 # $Id: in_exerb.rb 1011 2016-07-11 02:20:01Z coas-nagasima $ 38 38 #++ 39 39 -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecs/mruby/TECSPointer.h
r321 r429 102 102 { \ 103 103 if( sizeof( type ) > sizeof( mrb_int ) ){ \ 104 if( val > = (((type)1) << (sizeof(mrb_int)*8-1))\105 || val < -(((type)1) << (sizeof(mrb_int)*8-1))) \104 if( val > TYPE ## _MAX \ 105 || val < TYPE ## _MIN ) \ 106 106 /* '=' unecessary for negative value */ \ 107 107 /* ignore warning on int32_t */ \ … … 126 126 { \ 127 127 if( sizeof( type ) > sizeof( mrb_int ) ){ \ 128 if( val >= (((type)1) << (sizeof(mrb_int)*8)))\128 if( val > TYPE ## _MAX ) \ 129 129 /* '=' unecessary for negative value */ \ 130 130 /* ignore warning on int32_t */ \ … … 148 148 VALCHECK_MRB_INT( Int16, INT16, int16_t ) 149 149 VALCHECK_UINT( UInt8, UINT8, uint8_t ) 150 #define VALCHECK_MRB_UInt8 150 #define VALCHECK_MRB_UInt8(mrb,val) 151 151 VALCHECK_UINT( UInt16, UINT16, uint16_t ) 152 #define VALCHECK_MRB_UInt16 152 #define VALCHECK_MRB_UInt16(mrb,val) 153 153 VALCHECK_INT( Int32, INT32, int32_t ) 154 #define VALCHECK_MRB_Int32 154 #define VALCHECK_MRB_Int32(mrb,val) 155 155 VALCHECK_UINT( UInt32, UINT32, uint32_t ) 156 #define VALCHECK_MRB_UInt32 156 #define VALCHECK_MRB_UInt32(mrb,val) 157 157 158 158 VALCHECK_INT( Int64, INT64, int64_t ) … … 163 163 VALCHECK_MRB_UINT( UInt64, UINT64, uint64_t ) 164 164 #else 165 #define VALCHECK_MRB_Int64 // 範囲チェックが無意味であるため、警告が出るのを回避する166 #define VALCHECK_MRB_UInt64 // 範囲チェックが無意味であるため、警告が出るのを回避する165 #define VALCHECK_MRB_Int64(mrb,val) // 範囲チェックが無意味であるため、警告が出るのを回避する 166 #define VALCHECK_MRB_UInt64(mrb,val) // 範囲チェックが無意味であるため、警告が出るのを回避する 167 167 #endif 168 168 -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecs/mruby/TECSStruct.h
r321 r429 105 105 Struct_ ## TAG ## _initialize( mrb_state *mrb, mrb_value self) \ 106 106 { \ 107 mrb_int length; \108 struct TAG *structBody; \109 107 \ 110 108 DATA_TYPE( self ) = &Struct ## TAG ## Body_mrb_data_type; \ -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecs/mruby/mruby.cdl
r321 r429 1 /* 2 * Copyright (C) 2008-2017 by TOPPERS Project 3 * 4 * 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ 5 * ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改 6 * 変・再配布(以下,利用と呼ぶ)することを無償で許諾する. 7 * (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作 8 * 権表示,この利用条件および下記の無保証規定が,そのままの形でソー 9 * スコード中に含まれていること. 10 * (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使 11 * 用できる形で再配布する場合には,再配布に伴うドキュメント(利用 12 * 者マニュアルなど)に,上記の著作権表示,この利用条件および下記 13 * の無保証規定を掲載すること. 14 * (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使 15 * 用できない形で再配布する場合には,次のいずれかの条件を満たすこ 16 * と. 17 * (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著 18 * 作権表示,この利用条件および下記の無保証規定を掲載すること. 19 * (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに 20 * 報告すること. 21 * (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損 22 * 害からも,上記著作権者およびTOPPERSプロジェクトを免責すること. 23 * また,本ソフトウェアのユーザまたはエンドユーザからのいかなる理 24 * 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを 25 * 免責すること. 26 * 27 * 本ソフトウェアは,無保証で提供されているものである.上記著作権者お 28 * よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的 29 * に対する適合性も含めて,いかなる保証も行わない.また,本ソフトウェ 30 * アの利用により直接的または間接的に生じたいかなる損害に関しても,そ 31 * の責任を負わない. 32 * 33 * @(#) $Id$ 34 */ 35 1 36 import_C( "tecs_mruby.h" ); 2 37 -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecs/mruby/mrubyInitializer.cdl
r321 r429 1 /* 2 * Copyright (C) 2008-2017 by TOPPERS Project 3 * 4 * 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ 5 * ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改 6 * 変・再配布(以下,利用と呼ぶ)することを無償で許諾する. 7 * (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作 8 * 権表示,この利用条件および下記の無保証規定が,そのままの形でソー 9 * スコード中に含まれていること. 10 * (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使 11 * 用できる形で再配布する場合には,再配布に伴うドキュメント(利用 12 * 者マニュアルなど)に,上記の著作権表示,この利用条件および下記 13 * の無保証規定を掲載すること. 14 * (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使 15 * 用できない形で再配布する場合には,次のいずれかの条件を満たすこ 16 * と. 17 * (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著 18 * 作権表示,この利用条件および下記の無保証規定を掲載すること. 19 * (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに 20 * 報告すること. 21 * (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損 22 * 害からも,上記著作権者およびTOPPERSプロジェクトを免責すること. 23 * また,本ソフトウェアのユーザまたはエンドユーザからのいかなる理 24 * 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを 25 * 免責すること. 26 * 27 * 本ソフトウェアは,無保証で提供されているものである.上記著作権者お 28 * よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的 29 * に対する適合性も含めて,いかなる保証も行わない.また,本ソフトウェ 30 * アの利用により直接的または間接的に生じたいかなる損害に関しても,そ 31 * の責任を負わない. 32 * 33 * @(#) $Id$ 34 */ 1 35 2 36 namespace nMruby{ -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecs/mruby/mrubyPointers.cdl
r321 r429 1 /* 2 * Copyright (C) 2008-2017 by TOPPERS Project 3 * 4 * 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ 5 * ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改 6 * 変・再配布(以下,利用と呼ぶ)することを無償で許諾する. 7 * (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作 8 * 権表示,この利用条件および下記の無保証規定が,そのままの形でソー 9 * スコード中に含まれていること. 10 * (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使 11 * 用できる形で再配布する場合には,再配布に伴うドキュメント(利用 12 * 者マニュアルなど)に,上記の著作権表示,この利用条件および下記 13 * の無保証規定を掲載すること. 14 * (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使 15 * 用できない形で再配布する場合には,次のいずれかの条件を満たすこ 16 * と. 17 * (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著 18 * 作権表示,この利用条件および下記の無保証規定を掲載すること. 19 * (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに 20 * 報告すること. 21 * (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損 22 * 害からも,上記著作権者およびTOPPERSプロジェクトを免責すること. 23 * また,本ソフトウェアのユーザまたはエンドユーザからのいかなる理 24 * 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを 25 * 免責すること. 26 * 27 * 本ソフトウェアは,無保証で提供されているものである.上記著作権者お 28 * よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的 29 * に対する適合性も含めて,いかなる保証も行わない.また,本ソフトウェ 30 * アの利用により直接的または間接的に生じたいかなる損害に関しても,そ 31 * の責任を負わない. 32 * 33 * @(#) $Id$ 34 */ 35 1 36 // Pointer celltypes 2 37 -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecs/mruby/mrubyVMs.cdl
r321 r429 1 /* 2 * Copyright (C) 2008-2017 by TOPPERS Project 3 * 4 * 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ 5 * ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改 6 * 変・再配布(以下,利用と呼ぶ)することを無償で許諾する. 7 * (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作 8 * 権表示,この利用条件および下記の無保証規定が,そのままの形でソー 9 * スコード中に含まれていること. 10 * (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使 11 * 用できる形で再配布する場合には,再配布に伴うドキュメント(利用 12 * 者マニュアルなど)に,上記の著作権表示,この利用条件および下記 13 * の無保証規定を掲載すること. 14 * (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使 15 * 用できない形で再配布する場合には,次のいずれかの条件を満たすこ 16 * と. 17 * (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著 18 * 作権表示,この利用条件および下記の無保証規定を掲載すること. 19 * (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに 20 * 報告すること. 21 * (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損 22 * 害からも,上記著作権者およびTOPPERSプロジェクトを免責すること. 23 * また,本ソフトウェアのユーザまたはエンドユーザからのいかなる理 24 * 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを 25 * 免責すること. 26 * 27 * 本ソフトウェアは,無保証で提供されているものである.上記著作権者お 28 * よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的 29 * に対する適合性も含めて,いかなる保証も行わない.また,本ソフトウェ 30 * アの利用により直接的または間接的に生じたいかなる損害に関しても,そ 31 * の責任を負わない. 32 * 33 * @(#) $Id$ 34 */ 35 1 36 import( <posix.cdl> ); 2 37 3 38 /* 4 * tools/mruby/mruby.c から cInit_initializeBridge( mrb ) を呼び出すように変更したもの 39 * POSIX 環境用の VM 40 * mrbgems の mrbgems/mruby-bin-mruby/tools/mruby/mruby.c を参考に作成したもの 5 41 */ 6 42 namespace nMruby{ -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecs/mruby/nMruby_tBoolPointer.c
r321 r429 1 /* 2 * Copyright (C) 2008-2017 by TOPPERS Project 3 * 4 * 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ 5 * ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改 6 * 変・再配布(以下,利用と呼ぶ)することを無償で許諾する. 7 * (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作 8 * 権表示,この利用条件および下記の無保証規定が,そのままの形でソー 9 * スコード中に含まれていること. 10 * (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使 11 * 用できる形で再配布する場合には,再配布に伴うドキュメント(利用 12 * 者マニュアルなど)に,上記の著作権表示,この利用条件および下記 13 * の無保証規定を掲載すること. 14 * (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使 15 * 用できない形で再配布する場合には,次のいずれかの条件を満たすこ 16 * と. 17 * (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著 18 * 作権表示,この利用条件および下記の無保証規定を掲載すること. 19 * (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに 20 * 報告すること. 21 * (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損 22 * 害からも,上記著作権者およびTOPPERSプロジェクトを免責すること. 23 * また,本ソフトウェアのユーザまたはエンドユーザからのいかなる理 24 * 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを 25 * 免責すること. 26 * 27 * 本ソフトウェアは,無保証で提供されているものである.上記著作権者お 28 * よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的 29 * に対する適合性も含めて,いかなる保証も行わない.また,本ソフトウェ 30 * アの利用により直接的または間接的に生じたいかなる損害に関しても,そ 31 * の責任を負わない. 32 * 33 * @(#) $Id$ 34 */ 35 1 36 /* #[<PREAMBLE>]# 2 37 * #[<...>]# から #[</...>]# で囲まれたコメントは編集しないでください -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecs/mruby/nMruby_tCharPointer.c
r321 r429 1 /* 2 * Copyright (C) 2008-2017 by TOPPERS Project 3 * 4 * 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ 5 * ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改 6 * 変・再配布(以下,利用と呼ぶ)することを無償で許諾する. 7 * (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作 8 * 権表示,この利用条件および下記の無保証規定が,そのままの形でソー 9 * スコード中に含まれていること. 10 * (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使 11 * 用できる形で再配布する場合には,再配布に伴うドキュメント(利用 12 * 者マニュアルなど)に,上記の著作権表示,この利用条件および下記 13 * の無保証規定を掲載すること. 14 * (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使 15 * 用できない形で再配布する場合には,次のいずれかの条件を満たすこ 16 * と. 17 * (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著 18 * 作権表示,この利用条件および下記の無保証規定を掲載すること. 19 * (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに 20 * 報告すること. 21 * (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損 22 * 害からも,上記著作権者およびTOPPERSプロジェクトを免責すること. 23 * また,本ソフトウェアのユーザまたはエンドユーザからのいかなる理 24 * 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを 25 * 免責すること. 26 * 27 * 本ソフトウェアは,無保証で提供されているものである.上記著作権者お 28 * よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的 29 * に対する適合性も含めて,いかなる保証も行わない.また,本ソフトウェ 30 * アの利用により直接的または間接的に生じたいかなる損害に関しても,そ 31 * の責任を負わない. 32 * 33 * @(#) $Id$ 34 */ 35 1 36 /* #[<PREAMBLE>]# 2 37 * #[<...>]# から #[</...>]# で囲まれたコメントは編集しないでください -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecs/mruby/nMruby_tDouble64Pointer.c
r321 r429 1 /* 2 * Copyright (C) 2008-2017 by TOPPERS Project 3 * 4 * 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ 5 * ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改 6 * 変・再配布(以下,利用と呼ぶ)することを無償で許諾する. 7 * (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作 8 * 権表示,この利用条件および下記の無保証規定が,そのままの形でソー 9 * スコード中に含まれていること. 10 * (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使 11 * 用できる形で再配布する場合には,再配布に伴うドキュメント(利用 12 * 者マニュアルなど)に,上記の著作権表示,この利用条件および下記 13 * の無保証規定を掲載すること. 14 * (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使 15 * 用できない形で再配布する場合には,次のいずれかの条件を満たすこ 16 * と. 17 * (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著 18 * 作権表示,この利用条件および下記の無保証規定を掲載すること. 19 * (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに 20 * 報告すること. 21 * (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損 22 * 害からも,上記著作権者およびTOPPERSプロジェクトを免責すること. 23 * また,本ソフトウェアのユーザまたはエンドユーザからのいかなる理 24 * 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを 25 * 免責すること. 26 * 27 * 本ソフトウェアは,無保証で提供されているものである.上記著作権者お 28 * よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的 29 * に対する適合性も含めて,いかなる保証も行わない.また,本ソフトウェ 30 * アの利用により直接的または間接的に生じたいかなる損害に関しても,そ 31 * の責任を負わない. 32 * 33 * @(#) $Id$ 34 */ 35 1 36 /* #[<PREAMBLE>]# 2 37 * #[<...>]# から #[</...>]# で囲まれたコメントは編集しないでください -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecs/mruby/nMruby_tFloat32Pointer.c
r321 r429 1 /* 2 * Copyright (C) 2008-2017 by TOPPERS Project 3 * 4 * 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ 5 * ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改 6 * 変・再配布(以下,利用と呼ぶ)することを無償で許諾する. 7 * (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作 8 * 権表示,この利用条件および下記の無保証規定が,そのままの形でソー 9 * スコード中に含まれていること. 10 * (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使 11 * 用できる形で再配布する場合には,再配布に伴うドキュメント(利用 12 * 者マニュアルなど)に,上記の著作権表示,この利用条件および下記 13 * の無保証規定を掲載すること. 14 * (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使 15 * 用できない形で再配布する場合には,次のいずれかの条件を満たすこ 16 * と. 17 * (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著 18 * 作権表示,この利用条件および下記の無保証規定を掲載すること. 19 * (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに 20 * 報告すること. 21 * (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損 22 * 害からも,上記著作権者およびTOPPERSプロジェクトを免責すること. 23 * また,本ソフトウェアのユーザまたはエンドユーザからのいかなる理 24 * 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを 25 * 免責すること. 26 * 27 * 本ソフトウェアは,無保証で提供されているものである.上記著作権者お 28 * よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的 29 * に対する適合性も含めて,いかなる保証も行わない.また,本ソフトウェ 30 * アの利用により直接的または間接的に生じたいかなる損害に関しても,そ 31 * * の責任を負わない. 32 * 33 * @(#) $Id$ 34 */ 35 36 1 37 /* #[<PREAMBLE>]# 2 38 * #[<...>]# から #[</...>]# で囲まれたコメントは編集しないでください -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecs/mruby/nMruby_tInt16Pointer.c
r321 r429 1 /* 2 * Copyright (C) 2008-2017 by TOPPERS Project 3 * 4 * 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ 5 * ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改 6 * 変・再配布(以下,利用と呼ぶ)することを無償で許諾する. 7 * (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作 8 * 権表示,この利用条件および下記の無保証規定が,そのままの形でソー 9 * スコード中に含まれていること. 10 * (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使 11 * 用できる形で再配布する場合には,再配布に伴うドキュメント(利用 12 * 者マニュアルなど)に,上記の著作権表示,この利用条件および下記 13 * の無保証規定を掲載すること. 14 * (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使 15 * 用できない形で再配布する場合には,次のいずれかの条件を満たすこ 16 * と. 17 * (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著 18 * 作権表示,この利用条件および下記の無保証規定を掲載すること. 19 * (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに 20 * 報告すること. 21 * (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損 22 * 害からも,上記著作権者およびTOPPERSプロジェクトを免責すること. 23 * また,本ソフトウェアのユーザまたはエンドユーザからのいかなる理 24 * 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを 25 * 免責すること. 26 * 27 * 本ソフトウェアは,無保証で提供されているものである.上記著作権者お 28 * よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的 29 * に対する適合性も含めて,いかなる保証も行わない.また,本ソフトウェ 30 * アの利用により直接的または間接的に生じたいかなる損害に関しても,そ 31 * の責任を負わない. 32 * 33 * @(#) $Id$ 34 */ 35 1 36 /* #[<PREAMBLE>]# 2 37 * #[<...>]# から #[</...>]# で囲まれたコメントは編集しないでください -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecs/mruby/nMruby_tInt32Pointer.c
r321 r429 1 /* 2 * Copyright (C) 2008-2017 by TOPPERS Project 3 * 4 * 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ 5 * ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改 6 * 変・再配布(以下,利用と呼ぶ)することを無償で許諾する. 7 * (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作 8 * 権表示,この利用条件および下記の無保証規定が,そのままの形でソー 9 * スコード中に含まれていること. 10 * (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使 11 * 用できる形で再配布する場合には,再配布に伴うドキュメント(利用 12 * 者マニュアルなど)に,上記の著作権表示,この利用条件および下記 13 * の無保証規定を掲載すること. 14 * (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使 15 * 用できない形で再配布する場合には,次のいずれかの条件を満たすこ 16 * と. 17 * (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著 18 * 作権表示,この利用条件および下記の無保証規定を掲載すること. 19 * (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに 20 * 報告すること. 21 * (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損 22 * 害からも,上記著作権者およびTOPPERSプロジェクトを免責すること. 23 * また,本ソフトウェアのユーザまたはエンドユーザからのいかなる理 24 * 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを 25 * 免責すること. 26 * 27 * 本ソフトウェアは,無保証で提供されているものである.上記著作権者お 28 * よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的 29 * に対する適合性も含めて,いかなる保証も行わない.また,本ソフトウェ 30 * アの利用により直接的または間接的に生じたいかなる損害に関しても,そ 31 * の責任を負わない. 32 * 33 * @(#) $Id$ 34 */ 35 1 36 /* #[<PREAMBLE>]# 2 37 * #[<...>]# から #[</...>]# で囲まれたコメントは編集しないでください -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecs/mruby/nMruby_tInt64Pointer.c
r321 r429 1 /* 2 * Copyright (C) 2012 by Ubiquitous Computing and Networking Laboratory 3 * Ritsumeikan Univ., JAPAN 4 * 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ 5 * ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改 6 * 変・再配布(以下,利用と呼ぶ)することを無償で許諾する. 7 * (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作 8 * 権表示,この利用条件および下記の無保証規定が,そのままの形でソー 9 * スコード中に含まれていること. 10 * (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使 11 * 用できる形で再配布する場合には,再配布に伴うドキュメント(利用 12 * 者マニュアルなど)に,上記の著作権表示,この利用条件および下記 13 * の無保証規定を掲載すること. 14 * (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使 15 * 用できない形で再配布する場合には,次のいずれかの条件を満たすこ 16 * と. 17 * (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著 18 * 作権表示,この利用条件および下記の無保証規定を掲載すること. 19 * (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに 20 * 報告すること. 21 * (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損 22 * 害からも,上記著作権者およびTOPPERSプロジェクトを免責すること. 23 * また,本ソフトウェアのユーザまたはエンドユーザからのいかなる理 24 * 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを 25 * 免責すること. 26 * 27 * 本ソフトウェアは,無保証で提供されているものである.上記著作権者お 28 * よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的 29 * に対する適合性も含めて,いかなる保証も行わない.また,本ソフトウェ 30 * アの利用により直接的または間接的に生じたいかなる損害に関しても,そ 31 * の責任を負わない. 32 * 33 * @(#) $Id$ 34 */ 35 1 36 /* #[<PREAMBLE>]# 2 37 * #[<...>]# から #[</...>]# で囲まれたコメントは編集しないでください -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecs/mruby/nMruby_tInt8Pointer.c
r321 r429 1 /* 2 * Copyright (C) 2008-2017 by TOPPERS Project 3 * 4 * 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ 5 * ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改 6 * 変・再配布(以下,利用と呼ぶ)することを無償で許諾する. 7 * (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作 8 * 権表示,この利用条件および下記の無保証規定が,そのままの形でソー 9 * スコード中に含まれていること. 10 * (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使 11 * 用できる形で再配布する場合には,再配布に伴うドキュメント(利用 12 * 者マニュアルなど)に,上記の著作権表示,この利用条件および下記 13 * の無保証規定を掲載すること. 14 * (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使 15 * 用できない形で再配布する場合には,次のいずれかの条件を満たすこ 16 * と. 17 * (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著 18 * 作権表示,この利用条件および下記の無保証規定を掲載すること. 19 * (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに 20 * 報告すること. 21 * (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損 22 * 害からも,上記著作権者およびTOPPERSプロジェクトを免責すること. 23 * また,本ソフトウェアのユーザまたはエンドユーザからのいかなる理 24 * 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを 25 * 免責すること. 26 * 27 * 本ソフトウェアは,無保証で提供されているものである.上記著作権者お 28 * よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的 29 * に対する適合性も含めて,いかなる保証も行わない.また,本ソフトウェ 30 * アの利用により直接的または間接的に生じたいかなる損害に関しても,そ 31 * の責任を負わない. 32 * 33 * @(#) $Id$ 34 */ 35 1 36 /* #[<PREAMBLE>]# 2 37 * #[<...>]# から #[</...>]# で囲まれたコメントは編集しないでください -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecs/mruby/nMruby_tIntPointer.c
r321 r429 1 /* 2 * Copyright (C) 2008-2017 by TOPPERS Project 3 * 4 * 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ 5 * ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改 6 * 変・再配布(以下,利用と呼ぶ)することを無償で許諾する. 7 * (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作 8 * 権表示,この利用条件および下記の無保証規定が,そのままの形でソー 9 * スコード中に含まれていること. 10 * (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使 11 * 用できる形で再配布する場合には,再配布に伴うドキュメント(利用 12 * 者マニュアルなど)に,上記の著作権表示,この利用条件および下記 13 * の無保証規定を掲載すること. 14 * (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使 15 * 用できない形で再配布する場合には,次のいずれかの条件を満たすこ 16 * と. 17 * (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著 18 * 作権表示,この利用条件および下記の無保証規定を掲載すること. 19 * (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに 20 * 報告すること. 21 * (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損 22 * 害からも,上記著作権者およびTOPPERSプロジェクトを免責すること. 23 * また,本ソフトウェアのユーザまたはエンドユーザからのいかなる理 24 * 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを 25 * 免責すること. 26 * 27 * 本ソフトウェアは,無保証で提供されているものである.上記著作権者お 28 * よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的 29 * に対する適合性も含めて,いかなる保証も行わない.また,本ソフトウェ 30 * アの利用により直接的または間接的に生じたいかなる損害に関しても,そ 31 * の責任を負わない. 32 * 33 * @(#) $Id$ 34 */ 35 1 36 /* #[<PREAMBLE>]# 2 37 * #[<...>]# から #[</...>]# で囲まれたコメントは編集しないでください -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecs/mruby/nMruby_tLongPointer.c
r321 r429 1 /* 2 * Copyright (C) 2008-2017 by TOPPERS Project 3 * 4 * 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ 5 * ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改 6 * 変・再配布(以下,利用と呼ぶ)することを無償で許諾する. 7 * (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作 8 * 権表示,この利用条件および下記の無保証規定が,そのままの形でソー 9 * スコード中に含まれていること. 10 * (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使 11 * 用できる形で再配布する場合には,再配布に伴うドキュメント(利用 12 * 者マニュアルなど)に,上記の著作権表示,この利用条件および下記 13 * の無保証規定を掲載すること. 14 * (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使 15 * 用できない形で再配布する場合には,次のいずれかの条件を満たすこ 16 * と. 17 * (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著 18 * 作権表示,この利用条件および下記の無保証規定を掲載すること. 19 * (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに 20 * 報告すること. 21 * (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損 22 * 害からも,上記著作権者およびTOPPERSプロジェクトを免責すること. 23 * また,本ソフトウェアのユーザまたはエンドユーザからのいかなる理 24 * 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを 25 * 免責すること. 26 * 27 * 本ソフトウェアは,無保証で提供されているものである.上記著作権者お 28 * よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的 29 * に対する適合性も含めて,いかなる保証も行わない.また,本ソフトウェ 30 * アの利用により直接的または間接的に生じたいかなる損害に関しても,そ 31 * の責任を負わない. 32 * 33 * @(#) $Id$ 34 */ 35 1 36 /* #[<PREAMBLE>]# 2 37 * #[<...>]# から #[</...>]# で囲まれたコメントは編集しないでください -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecs/mruby/nMruby_tMruby.c
r321 r429 1 /* 2 * Copyright (C) 2008-2017 by TOPPERS Project 3 * 4 * 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ 5 * ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改 6 * 変・再配布(以下,利用と呼ぶ)することを無償で許諾する. 7 * (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作 8 * 権表示,この利用条件および下記の無保証規定が,そのままの形でソー 9 * スコード中に含まれていること. 10 * (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使 11 * 用できる形で再配布する場合には,再配布に伴うドキュメント(利用 12 * 者マニュアルなど)に,上記の著作権表示,この利用条件および下記 13 * の無保証規定を掲載すること. 14 * (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使 15 * 用できない形で再配布する場合には,次のいずれかの条件を満たすこ 16 * と. 17 * (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著 18 * 作権表示,この利用条件および下記の無保証規定を掲載すること. 19 * (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに 20 * 報告すること. 21 * (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損 22 * 害からも,上記著作権者およびTOPPERSプロジェクトを免責すること. 23 * また,本ソフトウェアのユーザまたはエンドユーザからのいかなる理 24 * 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを 25 * 免責すること. 26 * 27 * 本ソフトウェアは,無保証で提供されているものである.上記著作権者お 28 * よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的 29 * に対する適合性も含めて,いかなる保証も行わない.また,本ソフトウェ 30 * アの利用により直接的または間接的に生じたいかなる損害に関しても,そ 31 * の責任を負わない. 32 * 33 * @(#) $Id$ 34 */ 35 1 36 /* #[<PREAMBLE>]# 2 37 * #[<...>]# から #[</...>]# で囲まれたコメントは編集しないでください -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecs/mruby/nMruby_tMrubyProc.c
r321 r429 1 1 /* 2 * This file comes from mruby. (renamed from tools/mruby/mruby.c) 3 * This file is distributed under ruby's license. (not under TOPPERS license) 4 * see https://github.com/mruby/mruby 5 * A little modification is done to to call initializer registering TECS components. 2 * Copyright (C) 2008-2017 by TOPPERS Project 6 3 * 7 * このファイルは、mruby のものです。 8 * mruby のライセンスのもとで、配布されます。(TOPPERS ライセンスではありません) 9 * 参照: https://github.com/mruby/mruby 10 * TECS コンポーネントを登録する初期化子を呼ぶため、少しの修正がなされています。 4 * 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ 5 * ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改 6 * 変・再配布(以下,利用と呼ぶ)することを無償で許諾する. 7 * (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作 8 * 権表示,この利用条件および下記の無保証規定が,そのままの形でソー 9 * スコード中に含まれていること. 10 * (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使 11 * 用できる形で再配布する場合には,再配布に伴うドキュメント(利用 12 * 者マニュアルなど)に,上記の著作権表示,この利用条件および下記 13 * の無保証規定を掲載すること. 14 * (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使 15 * 用できない形で再配布する場合には,次のいずれかの条件を満たすこ 16 * と. 17 * (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著 18 * 作権表示,この利用条件および下記の無保証規定を掲載すること. 19 * (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに 20 * 報告すること. 21 * (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損 22 * 害からも,上記著作権者およびTOPPERSプロジェクトを免責すること. 23 * また,本ソフトウェアのユーザまたはエンドユーザからのいかなる理 24 * 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを 25 * 免責すること. 26 * 27 * 本ソフトウェアは,無保証で提供されているものである.上記著作権者お 28 * よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的 29 * に対する適合性も含めて,いかなる保証も行わない.また,本ソフトウェ 30 * アの利用により直接的または間接的に生じたいかなる損害に関しても,そ 31 * の責任を負わない. 32 * 33 * @(#) $Id$ 11 34 */ 12 35 13 #include "nMruby_tMrubyProc_tecsgen.h" 36 /* 37 * 以前の nMruby_tMrubyProc.c は、mruby の本体に含まれていた 38 * mrbgems/mruby-bin-mruby/tools/mruby/mruby.c 39 * をベースに TECS のコードを足していたが、TOPPERS ライセンスと異なるため 40 * 新たに書き下ろした。(小さなコードのため、概ね似たようなものになるが。 41 */ 14 42 15 43 #include <stdio.h> … … 17 45 #include <string.h> 18 46 #include "mruby.h" 47 #include "mruby/string.h" 19 48 #include "mruby/array.h" 20 49 #include "mruby/compile.h" … … 22 51 #include "mruby/variable.h" 23 52 24 #ifndef ENABLE_STDIO 25 static void 26 p(mrb_state *mrb, mrb_value obj) 27 { 28 obj = mrb_funcall(mrb, obj, "inspect", 0); 29 fwrite(RSTRING_PTR(obj), RSTRING_LEN(obj), 1, stdout); 30 putc('\n', stdout); 31 } 32 #else 33 #define p(mrb,obj) mrb_p(mrb,obj) 53 /* #[<PREAMBLE>]# 54 * Don't edit the comments between #[<...>]# and #[</...>]# 55 * These comment are used by tecsmerege when merging. 56 * 57 * attr access macro #_CAAM_# 58 * mrb mrb_state* VAR_mrb 59 * 60 * call port function #_TCPF_# 61 * call port: cInit signature: nMruby_sInitializeBridge context:task optional:true 62 * bool_t is_cInit_joined() check if joined 63 * void cInit_initializeBridge( const mrb_state* mrb ); 64 * 65 * #[</PREAMBLE>]# */ 66 67 /* プロトタイプ宣言や変数の定義をここに書きます #_PAC_# */ 68 #include "nMruby_tMrubyProc_tecsgen.h" 69 70 #ifndef E_OK 71 #define E_OK 0 /* success */ 72 #define E_ID (-18) /* illegal ID */ 34 73 #endif 35 74 36 void mrb_show_version(mrb_state *); 37 void mrb_show_copyright(mrb_state *); 75 /* 受け口関数 #_TEPF_# */ 76 /* #[<ENTRY_PORT>]# eMain 77 * entry port: eMain 78 * signature: nPosix_sMain 79 * context: task 80 * #[</ENTRY_PORT>]# */ 38 81 39 struct _args { 40 FILE *rfp; 41 char* cmdline; 42 mrb_bool fname : 1; 43 mrb_bool mrbfile : 1; 44 mrb_bool check_syntax : 1; 45 mrb_bool verbose : 1; 46 int argc; 47 char** argv; 48 }; 82 /* #[<ENTRY_FUNC>]# eMain_main 83 * name: eMain_main 84 * global_name: nMruby_tMrubyProc_eMain_main 85 * oneway: false 86 * #[</ENTRY_FUNC>]# */ 87 int 88 eMain_main(CELLIDX idx, int argc, const char** argv) 89 { 90 CELLCB *p_cellcb; 91 mrb_state *mrb; 92 mrbc_context* context; 93 if (VALID_IDX(idx)) { 94 p_cellcb = GET_CELLCB(idx); 95 } 96 else { 97 /* エラー処理コードをここに記述します */ 98 return -1; 99 } /* end if VALID_IDX(idx) */ 49 100 50 static void 51 usage(const char *name) 52 { 53 static const char *const usage_msg[] = {54 "switches:",55 "-b load and execute RiteBinary (mrb) file",56 "-c check syntax only",57 "-e 'command' one line of script",58 "-v print version number, then run in verbose mode",59 "--verbose run in verbose mode",60 "--version print the version",61 "--copyright print the copyright",62 NULL63 };64 const char *const *p = usage_msg;101 /* ここに処理本体を記述します #_TEFB_# */ 102 if (argc != 2) { 103 printf("usage: %s script.rb\n", argv[0]); 104 goto error_return; 105 } 106 mrb = mrb_open(); 107 if( mrb == 0 ){ 108 printf("%s: mrb_open() failed\n", argv[0]); 109 goto error_return; 110 } 111 context = mrbc_context_new(mrb); 112 if (context == 0) { 113 printf("%s: mrbc_context_new() failed\n", argv[0]); 114 goto error_close; 115 } 65 116 66 printf("Usage: %s [switches] programfile\n", name); 67 while (*p) 68 printf(" %s\n", *p++); 117 /*-------- ARGV ----------*/ 118 { 119 mrb_value ARGV = mrb_ary_new_capa(mrb, argc); 120 int i; 121 for (i = 0; i < argc; i++) { 122 mrb_ary_push(mrb, ARGV, mrb_str_new_cstr(mrb, argv[i])); 123 } 124 mrb_define_global_const(mrb, "ARGV", ARGV); 125 } 126 /*-------- $0 ----------*/ 127 { 128 mrb_sym zero_sym = mrb_intern_lit(mrb, "$0"); 129 mrbc_filename(mrb, context, argv[0]); 130 mrb_gv_set(mrb, zero_sym, mrb_str_new_cstr(mrb, argv[0])); 131 } 132 133 /* ------- register TECS bridge classes -------*/ 134 if (is_cInit_joined()) { 135 cInit_initializeBridge(mrb); 136 } 137 138 /*-------- load .rb file -------*/ 139 { 140 FILE *file = fopen(argv[1], "r"); 141 if (file == NULL) { 142 printf("file not found: %s\n", argv[1]); 143 goto error_free; 144 } 145 146 mrb_value val = mrb_load_file_cxt(mrb, file, context); 147 if (mrb->exc) { 148 if(! mrb_undef_p(val)){ 149 mrb_print_error(mrb); 150 } 151 } 152 } 153 154 /*---------- success case --------*/ 155 mrbc_context_free(mrb, context); 156 mrb_close( mrb ); 157 return 0; 158 159 /*---------- error case ----------*/ 160 error_free: 161 mrbc_context_free(mrb, context); 162 error_close: 163 mrb_close( mrb ); 164 error_return: 165 166 return -1; 69 167 } 70 168 71 static int 72 parse_args(mrb_state *mrb, int argc, char **argv, struct _args *args) 73 { 74 char **origargv = argv; 75 static const struct _args args_zero = { 0 }; 76 77 *args = args_zero; 78 79 for (argc--,argv++; argc > 0; argc--,argv++) { 80 char *item; 81 if (argv[0][0] != '-') break; 82 83 if (strlen(*argv) <= 1) { 84 argc--; argv++; 85 args->rfp = stdin; 86 break; 87 } 88 89 item = argv[0] + 1; 90 switch (*item++) { 91 case 'b': 92 args->mrbfile = TRUE; 93 break; 94 case 'c': 95 args->check_syntax = TRUE; 96 break; 97 case 'e': 98 if (item[0]) { 99 goto append_cmdline; 100 } 101 else if (argc > 1) { 102 argc--; argv++; 103 item = argv[0]; 104 append_cmdline: 105 if (!args->cmdline) { 106 size_t buflen; 107 char *buf; 108 109 buflen = strlen(item) + 1; 110 buf = (char *)mrb_malloc(mrb, buflen); 111 memcpy(buf, item, buflen); 112 args->cmdline = buf; 113 } 114 else { 115 size_t cmdlinelen; 116 size_t itemlen; 117 118 cmdlinelen = strlen(args->cmdline); 119 itemlen = strlen(item); 120 args->cmdline = 121 (char *)mrb_realloc(mrb, args->cmdline, cmdlinelen + itemlen + 2); 122 args->cmdline[cmdlinelen] = '\n'; 123 memcpy(args->cmdline + cmdlinelen + 1, item, itemlen + 1); 124 } 125 } 126 else { 127 printf("%s: No code specified for -e\n", *origargv); 128 return EXIT_SUCCESS; 129 } 130 break; 131 case 'v': 132 if (!args->verbose) mrb_show_version(mrb); 133 args->verbose = TRUE; 134 break; 135 case '-': 136 if (strcmp((*argv) + 2, "version") == 0) { 137 mrb_show_version(mrb); 138 exit(EXIT_SUCCESS); 139 } 140 else if (strcmp((*argv) + 2, "verbose") == 0) { 141 args->verbose = TRUE; 142 break; 143 } 144 else if (strcmp((*argv) + 2, "copyright") == 0) { 145 mrb_show_copyright(mrb); 146 exit(EXIT_SUCCESS); 147 } 148 default: 149 return EXIT_FAILURE; 150 } 151 } 152 153 if (args->rfp == NULL && args->cmdline == NULL) { 154 if (*argv == NULL) args->rfp = stdin; 155 else { 156 args->rfp = fopen(argv[0], args->mrbfile ? "rb" : "r"); 157 if (args->rfp == NULL) { 158 printf("%s: Cannot open program file. (%s)\n", *origargv, *argv); 159 return EXIT_FAILURE; 160 } 161 args->fname = TRUE; 162 args->cmdline = argv[0]; 163 argc--; argv++; 164 } 165 } 166 args->argv = (char **)mrb_realloc(mrb, args->argv, sizeof(char*) * (argc + 1)); 167 memcpy(args->argv, argv, (argc+1) * sizeof(char*)); 168 args->argc = argc; 169 170 return EXIT_SUCCESS; 171 } 172 173 static void 174 cleanup(mrb_state *mrb, struct _args *args) 175 { 176 if (args->rfp && args->rfp != stdin) 177 fclose(args->rfp); 178 if (args->cmdline && !args->fname) 179 mrb_free(mrb, args->cmdline); 180 if (args->argv) 181 mrb_free(mrb, args->argv); 182 mrb_close(mrb); 183 } 184 185 int 186 // main(int argc, char **argv) 187 eMain_main( CELLIDX idx, int argc, const char **argv) 188 189 { 190 CELLCB *p_cellcb = GET_CELLCB( idx ); 191 mrb_state *mrb = mrb_open(); 192 int n = -1; 193 int i; 194 struct _args args; 195 mrb_value ARGV; 196 mrbc_context *c; 197 mrb_value v; 198 mrb_sym zero_sym; 199 200 cInit_initializeBridge( mrb ); // TECS 201 202 203 if (mrb == NULL) { 204 fputs("Invalid mrb_state, exiting mruby\n", stderr); 205 return EXIT_FAILURE; 206 } 207 208 n = parse_args(mrb, argc, (char **)argv, &args); 209 if (n == EXIT_FAILURE || (args.cmdline == NULL && args.rfp == NULL)) { 210 cleanup(mrb, &args); 211 usage(argv[0]); 212 return n; 213 } 214 215 ARGV = mrb_ary_new_capa(mrb, args.argc); 216 for (i = 0; i < args.argc; i++) { 217 mrb_ary_push(mrb, ARGV, mrb_str_new_cstr(mrb, args.argv[i])); 218 } 219 mrb_define_global_const(mrb, "ARGV", ARGV); 220 221 c = mrbc_context_new(mrb); 222 if (args.verbose) 223 c->dump_result = TRUE; 224 if (args.check_syntax) 225 c->no_exec = TRUE; 226 227 /* Set $0 */ 228 zero_sym = mrb_intern_lit(mrb, "$0"); 229 if (args.rfp) { 230 char *cmdline; 231 cmdline = args.cmdline ? args.cmdline : "-"; 232 mrbc_filename(mrb, c, cmdline); 233 mrb_gv_set(mrb, zero_sym, mrb_str_new_cstr(mrb, cmdline)); 234 } 235 else { 236 mrbc_filename(mrb, c, "-e"); 237 mrb_gv_set(mrb, zero_sym, mrb_str_new_lit(mrb, "-e")); 238 } 239 240 /* Load program */ 241 if (args.mrbfile) { 242 v = mrb_load_irep_file_cxt(mrb, args.rfp, c); 243 } 244 else if (args.rfp) { 245 v = mrb_load_file_cxt(mrb, args.rfp, c); 246 } 247 else { 248 v = mrb_load_string_cxt(mrb, args.cmdline, c); 249 } 250 251 mrbc_context_free(mrb, c); 252 if (mrb->exc) { 253 if (!mrb_undef_p(v)) { 254 mrb_print_error(mrb); 255 } 256 n = -1; 257 } 258 else if (args.check_syntax) { 259 printf("Syntax OK\n"); 260 } 261 cleanup(mrb, &args); 262 263 return n == 0 ? EXIT_SUCCESS : EXIT_FAILURE; 264 } 169 /* #[<POSTAMBLE>]# 170 * Put non-entry functions below. 171 * #[</POSTAMBLE>]#*/ -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecs/mruby/nMruby_tSCharPointer.c
r321 r429 1 /* 2 * Copyright (C) 2008-2017 by TOPPERS Project 3 * 4 * 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ 5 * ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改 6 * 変・再配布(以下,利用と呼ぶ)することを無償で許諾する. 7 * (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作 8 * 権表示,この利用条件および下記の無保証規定が,そのままの形でソー 9 * スコード中に含まれていること. 10 * (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使 11 * 用できる形で再配布する場合には,再配布に伴うドキュメント(利用 12 * 者マニュアルなど)に,上記の著作権表示,この利用条件および下記 13 * の無保証規定を掲載すること. 14 * (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使 15 * 用できない形で再配布する場合には,次のいずれかの条件を満たすこ 16 * と. 17 * (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著 18 * 作権表示,この利用条件および下記の無保証規定を掲載すること. 19 * (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに 20 * 報告すること. 21 * (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損 22 * 害からも,上記著作権者およびTOPPERSプロジェクトを免責すること. 23 * また,本ソフトウェアのユーザまたはエンドユーザからのいかなる理 24 * 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを 25 * 免責すること. 26 * 27 * 本ソフトウェアは,無保証で提供されているものである.上記著作権者お 28 * よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的 29 * に対する適合性も含めて,いかなる保証も行わない.また,本ソフトウェ 30 * アの利用により直接的または間接的に生じたいかなる損害に関しても,そ 31 * の責任を負わない. 32 * 33 * @(#) $Id$ 34 */ 35 1 36 /* #[<PREAMBLE>]# 2 37 * #[<...>]# から #[</...>]# で囲まれたコメントは編集しないでください -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecs/mruby/nMruby_tShortPointer.c
r321 r429 1 /* 2 * Copyright (C) 2008-2017 by TOPPERS Project 3 * 4 * 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ 5 * ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改 6 * 変・再配布(以下,利用と呼ぶ)することを無償で許諾する. 7 * (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作 8 * 権表示,この利用条件および下記の無保証規定が,そのままの形でソー 9 * スコード中に含まれていること. 10 * (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使 11 * 用できる形で再配布する場合には,再配布に伴うドキュメント(利用 12 * 者マニュアルなど)に,上記の著作権表示,この利用条件および下記 13 * の無保証規定を掲載すること. 14 * (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使 15 * 用できない形で再配布する場合には,次のいずれかの条件を満たすこ 16 * と. 17 * (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著 18 * 作権表示,この利用条件および下記の無保証規定を掲載すること. 19 * (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに 20 * 報告すること. 21 * (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損 22 * 害からも,上記著作権者およびTOPPERSプロジェクトを免責すること. 23 * また,本ソフトウェアのユーザまたはエンドユーザからのいかなる理 24 * 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを 25 * 免責すること. 26 * 27 * 本ソフトウェアは,無保証で提供されているものである.上記著作権者お 28 * よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的 29 * に対する適合性も含めて,いかなる保証も行わない.また,本ソフトウェ 30 * アの利用により直接的または間接的に生じたいかなる損害に関しても,そ 31 * の責任を負わない. 32 * 33 * @(#) $Id$ 34 */ 35 1 36 /* #[<PREAMBLE>]# 2 37 * #[<...>]# から #[</...>]# で囲まれたコメントは編集しないでください -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecs/mruby/nMruby_tTECSInitializer.c
r321 r429 1 /* 2 * Copyright (C) 2008-2017 by TOPPERS Project 3 * 4 * 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ 5 * ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改 6 * 変・再配布(以下,利用と呼ぶ)することを無償で許諾する. 7 * (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作 8 * 権表示,この利用条件および下記の無保証規定が,そのままの形でソー 9 * スコード中に含まれていること. 10 * (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使 11 * 用できる形で再配布する場合には,再配布に伴うドキュメント(利用 12 * 者マニュアルなど)に,上記の著作権表示,この利用条件および下記 13 * の無保証規定を掲載すること. 14 * (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使 15 * 用できない形で再配布する場合には,次のいずれかの条件を満たすこ 16 * と. 17 * (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著 18 * 作権表示,この利用条件および下記の無保証規定を掲載すること. 19 * (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに 20 * 報告すること. 21 * (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損 22 * 害からも,上記著作権者およびTOPPERSプロジェクトを免責すること. 23 * また,本ソフトウェアのユーザまたはエンドユーザからのいかなる理 24 * 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを 25 * 免責すること. 26 * 27 * 本ソフトウェアは,無保証で提供されているものである.上記著作権者お 28 * よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的 29 * に対する適合性も含めて,いかなる保証も行わない.また,本ソフトウェ 30 * アの利用により直接的または間接的に生じたいかなる損害に関しても,そ 31 * の責任を負わない. 32 * 33 * @(#) $Id$ 34 */ 35 1 36 /* #[<PREAMBLE>]# 2 37 * #[<...>]# から #[</...>]# で囲まれたコメントは編集しないでください -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecs/mruby/nMruby_tUCharPointer.c
r321 r429 1 /* 2 * Copyright (C) 2008-2017 by TOPPERS Project 3 * 4 * 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ 5 * ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改 6 * 変・再配布(以下,利用と呼ぶ)することを無償で許諾する. 7 * (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作 8 * 権表示,この利用条件および下記の無保証規定が,そのままの形でソー 9 * スコード中に含まれていること. 10 * (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使 11 * 用できる形で再配布する場合には,再配布に伴うドキュメント(利用 12 * 者マニュアルなど)に,上記の著作権表示,この利用条件および下記 13 * の無保証規定を掲載すること. 14 * (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使 15 * 用できない形で再配布する場合には,次のいずれかの条件を満たすこ 16 * と. 17 * (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著 18 * 作権表示,この利用条件および下記の無保証規定を掲載すること. 19 * (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに 20 * 報告すること. 21 * (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損 22 * 害からも,上記著作権者およびTOPPERSプロジェクトを免責すること. 23 * また,本ソフトウェアのユーザまたはエンドユーザからのいかなる理 24 * 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを 25 * 免責すること. 26 * 27 * 本ソフトウェアは,無保証で提供されているものである.上記著作権者お 28 * よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的 29 * に対する適合性も含めて,いかなる保証も行わない.また,本ソフトウェ 30 * アの利用により直接的または間接的に生じたいかなる損害に関しても,そ 31 * の責任を負わない. 32 * 33 * @(#) $Id$ 34 */ 35 1 36 /* #[<PREAMBLE>]# 2 37 * #[<...>]# から #[</...>]# で囲まれたコメントは編集しないでください -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecs/mruby/nMruby_tUInt16Pointer.c
r321 r429 1 /* 2 * Copyright (C) 2008-2017 by TOPPERS Project 3 * 4 * 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ 5 * ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改 6 * 変・再配布(以下,利用と呼ぶ)することを無償で許諾する. 7 * (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作 8 * 権表示,この利用条件および下記の無保証規定が,そのままの形でソー 9 * スコード中に含まれていること. 10 * (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使 11 * 用できる形で再配布する場合には,再配布に伴うドキュメント(利用 12 * 者マニュアルなど)に,上記の著作権表示,この利用条件および下記 13 * の無保証規定を掲載すること. 14 * (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使 15 * 用できない形で再配布する場合には,次のいずれかの条件を満たすこ 16 * と. 17 * (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著 18 * 作権表示,この利用条件および下記の無保証規定を掲載すること. 19 * (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに 20 * 報告すること. 21 * (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損 22 * 害からも,上記著作権者およびTOPPERSプロジェクトを免責すること. 23 * また,本ソフトウェアのユーザまたはエンドユーザからのいかなる理 24 * 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを 25 * 免責すること. 26 * 27 * 本ソフトウェアは,無保証で提供されているものである.上記著作権者お 28 * よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的 29 * に対する適合性も含めて,いかなる保証も行わない.また,本ソフトウェ 30 * アの利用により直接的または間接的に生じたいかなる損害に関しても,そ 31 * の責任を負わない. 32 * 33 * @(#) $Id$ 34 */ 35 1 36 /* #[<PREAMBLE>]# 2 37 * #[<...>]# から #[</...>]# で囲まれたコメントは編集しないでください -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecs/mruby/nMruby_tUInt32Pointer.c
r321 r429 1 /* 2 * Copyright (C) 2008-2017 by TOPPERS Project 3 * 4 * 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ 5 * ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改 6 * 変・再配布(以下,利用と呼ぶ)することを無償で許諾する. 7 * (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作 8 * 権表示,この利用条件および下記の無保証規定が,そのままの形でソー 9 * スコード中に含まれていること. 10 * (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使 11 * 用できる形で再配布する場合には,再配布に伴うドキュメント(利用 12 * 者マニュアルなど)に,上記の著作権表示,この利用条件および下記 13 * の無保証規定を掲載すること. 14 * (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使 15 * 用できない形で再配布する場合には,次のいずれかの条件を満たすこ 16 * と. 17 * (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著 18 * 作権表示,この利用条件および下記の無保証規定を掲載すること. 19 * (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに 20 * 報告すること. 21 * (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損 22 * 害からも,上記著作権者およびTOPPERSプロジェクトを免責すること. 23 * また,本ソフトウェアのユーザまたはエンドユーザからのいかなる理 24 * 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを 25 * 免責すること. 26 * 27 * 本ソフトウェアは,無保証で提供されているものである.上記著作権者お 28 * よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的 29 * に対する適合性も含めて,いかなる保証も行わない.また,本ソフトウェ 30 * アの利用により直接的または間接的に生じたいかなる損害に関しても,そ 31 * の責任を負わない. 32 * 33 * @(#) $Id$ 34 */ 35 1 36 /* #[<PREAMBLE>]# 2 37 * #[<...>]# から #[</...>]# で囲まれたコメントは編集しないでください -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecs/mruby/nMruby_tUInt64Pointer.c
r321 r429 1 /* 2 * Copyright (C) 2008-2017 by TOPPERS Project 3 * 4 * 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ 5 * ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改 6 * 変・再配布(以下,利用と呼ぶ)することを無償で許諾する. 7 * (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作 8 * 権表示,この利用条件および下記の無保証規定が,そのままの形でソー 9 * スコード中に含まれていること. 10 * (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使 11 * 用できる形で再配布する場合には,再配布に伴うドキュメント(利用 12 * 者マニュアルなど)に,上記の著作権表示,この利用条件および下記 13 * の無保証規定を掲載すること. 14 * (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使 15 * 用できない形で再配布する場合には,次のいずれかの条件を満たすこ 16 * と. 17 * (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著 18 * 作権表示,この利用条件および下記の無保証規定を掲載すること. 19 * (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに 20 * 報告すること. 21 * (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損 22 * 害からも,上記著作権者およびTOPPERSプロジェクトを免責すること. 23 * また,本ソフトウェアのユーザまたはエンドユーザからのいかなる理 24 * 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを 25 * 免責すること. 26 * 27 * 本ソフトウェアは,無保証で提供されているものである.上記著作権者お 28 * よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的 29 * に対する適合性も含めて,いかなる保証も行わない.また,本ソフトウェ 30 * アの利用により直接的または間接的に生じたいかなる損害に関しても,そ 31 * の責任を負わない. 32 * 33 * @(#) $Id$ 34 */ 35 1 36 /* #[<PREAMBLE>]# 2 37 * #[<...>]# から #[</...>]# で囲まれたコメントは編集しないでください -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecs/mruby/nMruby_tUInt8Pointer.c
r321 r429 1 /* 2 * Copyright (C) 2008-2017 by TOPPERS Project 3 * 4 * 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ 5 * ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改 6 * 変・再配布(以下,利用と呼ぶ)することを無償で許諾する. 7 * (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作 8 * 権表示,この利用条件および下記の無保証規定が,そのままの形でソー 9 * スコード中に含まれていること. 10 * (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使 11 * 用できる形で再配布する場合には,再配布に伴うドキュメント(利用 12 * 者マニュアルなど)に,上記の著作権表示,この利用条件および下記 13 * の無保証規定を掲載すること. 14 * (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使 15 * 用できない形で再配布する場合には,次のいずれかの条件を満たすこ 16 * と. 17 * (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著 18 * 作権表示,この利用条件および下記の無保証規定を掲載すること. 19 * (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに 20 * 報告すること. 21 * (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損 22 * 害からも,上記著作権者およびTOPPERSプロジェクトを免責すること. 23 * また,本ソフトウェアのユーザまたはエンドユーザからのいかなる理 24 * 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを 25 * 免責すること. 26 * 27 * 本ソフトウェアは,無保証で提供されているものである.上記著作権者お 28 * よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的 29 * に対する適合性も含めて,いかなる保証も行わない.また,本ソフトウェ 30 * アの利用により直接的または間接的に生じたいかなる損害に関しても,そ 31 * の責任を負わない. 32 * 33 * @(#) $Id$ 34 */ 35 1 36 /* #[<PREAMBLE>]# 2 37 * #[<...>]# から #[</...>]# で囲まれたコメントは編集しないでください -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecs/mruby/nMruby_tUIntPointer.c
r321 r429 1 /* 2 * Copyright (C) 2008-2017 by TOPPERS Project 3 * 4 * 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ 5 * ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改 6 * 変・再配布(以下,利用と呼ぶ)することを無償で許諾する. 7 * (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作 8 * 権表示,この利用条件および下記の無保証規定が,そのままの形でソー 9 * スコード中に含まれていること. 10 * (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使 11 * 用できる形で再配布する場合には,再配布に伴うドキュメント(利用 12 * 者マニュアルなど)に,上記の著作権表示,この利用条件および下記 13 * の無保証規定を掲載すること. 14 * (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使 15 * 用できない形で再配布する場合には,次のいずれかの条件を満たすこ 16 * と. 17 * (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著 18 * 作権表示,この利用条件および下記の無保証規定を掲載すること. 19 * (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに 20 * 報告すること. 21 * (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損 22 * 害からも,上記著作権者およびTOPPERSプロジェクトを免責すること. 23 * また,本ソフトウェアのユーザまたはエンドユーザからのいかなる理 24 * 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを 25 * 免責すること. 26 * 27 * 本ソフトウェアは,無保証で提供されているものである.上記著作権者お 28 * よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的 29 * に対する適合性も含めて,いかなる保証も行わない.また,本ソフトウェ 30 * アの利用により直接的または間接的に生じたいかなる損害に関しても,そ 31 * の責任を負わない. 32 * 33 * @(#) $Id$ 34 */ 35 1 36 /* #[<PREAMBLE>]# 2 37 * #[<...>]# から #[</...>]# で囲まれたコメントは編集しないでください -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecs/mruby/nMruby_tULongPointer.c
r321 r429 1 /* 2 * Copyright (C) 2008-2017 by TOPPERS Project 3 * 4 * 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ 5 * ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改 6 * 変・再配布(以下,利用と呼ぶ)することを無償で許諾する. 7 * (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作 8 * 権表示,この利用条件および下記の無保証規定が,そのままの形でソー 9 * スコード中に含まれていること. 10 * (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使 11 * 用できる形で再配布する場合には,再配布に伴うドキュメント(利用 12 * 者マニュアルなど)に,上記の著作権表示,この利用条件および下記 13 * の無保証規定を掲載すること. 14 * (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使 15 * 用できない形で再配布する場合には,次のいずれかの条件を満たすこ 16 * と. 17 * (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著 18 * 作権表示,この利用条件および下記の無保証規定を掲載すること. 19 * (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに 20 * 報告すること. 21 * (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損 22 * 害からも,上記著作権者およびTOPPERSプロジェクトを免責すること. 23 * また,本ソフトウェアのユーザまたはエンドユーザからのいかなる理 24 * 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを 25 * 免責すること. 26 * 27 * 本ソフトウェアは,無保証で提供されているものである.上記著作権者お 28 * よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的 29 * に対する適合性も含めて,いかなる保証も行わない.また,本ソフトウェ 30 * アの利用により直接的または間接的に生じたいかなる損害に関しても,そ 31 * の責任を負わない. 32 * 33 * @(#) $Id$ 34 */ 35 1 36 /* #[<PREAMBLE>]# 2 37 * #[<...>]# から #[</...>]# で囲まれたコメントは編集しないでください -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecs/mruby/nMruby_tUShortPointer.c
r321 r429 1 /* 2 * Copyright (C) 2008-2017 by TOPPERS Project 3 * 4 * 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ 5 * ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改 6 * 変・再配布(以下,利用と呼ぶ)することを無償で許諾する. 7 * (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作 8 * 権表示,この利用条件および下記の無保証規定が,そのままの形でソー 9 * スコード中に含まれていること. 10 * (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使 11 * 用できる形で再配布する場合には,再配布に伴うドキュメント(利用 12 * 者マニュアルなど)に,上記の著作権表示,この利用条件および下記 13 * の無保証規定を掲載すること. 14 * (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使 15 * 用できない形で再配布する場合には,次のいずれかの条件を満たすこ 16 * と. 17 * (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著 18 * 作権表示,この利用条件および下記の無保証規定を掲載すること. 19 * (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに 20 * 報告すること. 21 * (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損 22 * 害からも,上記著作権者およびTOPPERSプロジェクトを免責すること. 23 * また,本ソフトウェアのユーザまたはエンドユーザからのいかなる理 24 * 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを 25 * 免責すること. 26 * 27 * 本ソフトウェアは,無保証で提供されているものである.上記著作権者お 28 * よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的 29 * に対する適合性も含めて,いかなる保証も行わない.また,本ソフトウェ 30 * アの利用により直接的または間接的に生じたいかなる損害に関しても,そ 31 * の責任を負わない. 32 * 33 * @(#) $Id$ 34 */ 35 1 36 /* #[<PREAMBLE>]# 2 37 * #[<...>]# から #[</...>]# で囲まれたコメントは編集しないでください -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecs/mruby/tMruby.cdl
r321 r429 1 2 1 /* 3 2 * Copyright (C) 2012 by Ubiquitous Computing and Networking Laboratory … … 38 37 39 38 import(<mruby.cdl>); 39 import(<sMruby.cdl>); 40 import(<tTLSFMalloc.cdl>); 40 41 41 42 namespace nMruby{ 42 celltype tMruby{ 43 entry sTaskBody eMrubyBody; 43 44 /*** mruby VM ***/ 45 celltype tMrubyVM{ 46 entry sMrubyVM eMrubyVM; 44 47 attr{ 45 48 [omit]char_t *mrubyFile; 46 c har_t *irep=C_EXP("&$cell_global$_irep");49 const uint8_t *irep=C_EXP("$cell_global$_irep"); 47 50 }; 48 49 /* write関数の接続先 */ 50 // [optional] call sSerialPort cSerialPort; 51 var{ 52 mrb_irep *var_irep; 53 mrb_state *mrb; 54 struct RProc *rproc; 55 }; 56 57 /* MrubyBridgePlugin の生成する VM_TECSInitializeer.eInitialize へ結合する */ 51 58 [optional] call sInitializeBridge cInit; 52 59 /* 60 * アロケータ 61 * 他と共有しないのであれば、このアロケータは排他制御される必要はない 62 */ 63 call sMalloc cMalloc; 64 53 65 FACTORY{ 54 66 write("Makefile.tecsgen", "clean_mrb_c :"); … … 61 73 write("Makefile.tecsgen", "TECS_COBJS := $(TECS_COBJS) $cell_global$_mrb.o"); 62 74 write("Makefile.tecsgen", "MRB_C := $(MRB_C) $cell_global$_mrb.c"); 63 write("$ct_global$_factory.h","extern const char_t *$cell_global$_irep;");75 write("$ct_global$_factory.h","extern const uint8_t $cell_global$_irep[];"); 64 76 }; 65 77 }; 78 79 /*** Standard Task Versoin ***/ 80 /* 81 * tMruby の eMrubyBody.main が、繰り返し起床されることは想定されていません。 82 */ 83 celltype tMrubyTaskBody{ 84 entry sTaskBody eMrubyBody; 85 call sMrubyVM cMrubyVM; 86 }; 87 composite tMruby{ 88 entry sTaskBody eMrubyBody; 89 [optional] call sInitializeBridge cInit; 90 attr{ 91 [omit]char_t *mrubyFile; 92 size_t memoryPoolSize = 1024 * 1024; /** 1MB default **/ 93 /* note: this requires enough memory */ 94 /* please pay attention to memory layout */ 95 }; 96 97 /** **/ 98 cell tMrubyVM MrubyVM{ 99 mrubyFile = composite.mrubyFile; 100 cInit => composite.cInit; 101 cMalloc = TLSFMalloc.eMalloc; 102 }; 103 cell tMrubyTaskBody MrubyTaskBody { 104 cMrubyVM = MrubyVM.eMrubyVM; 105 }; 106 cell tTLSFMalloc TLSFMalloc { 107 memoryPoolSize = composite.memoryPoolSize; 108 }; 109 composite.eMrubyBody => MrubyTaskBody.eMrubyBody; 110 }; 111 112 /*** Cyclic Task Versoin ***/ 113 /* 114 * tMrubyCyclic の eMrubyBody.main が繰り返し呼び出されることが想定されています。 115 * この実装では mrb_close は呼び出されません (終了は、突然電源が切れることを想定) 116 */ 117 celltype tMrubyCyclicTaskBody{ 118 entry sTaskBody eMrubyBody; 119 call sMrubyVM cMrubyVM; 120 var { 121 bool_t b_init; 122 }; 123 }; 124 composite tMrubyCyclic{ 125 entry sTaskBody eMrubyBody; 126 [optional] call sInitializeBridge cInit; 127 attr{ 128 [omit]char_t *mrubyFile; 129 size_t memoryPoolSize = 1024 * 1024; /** 1MB default **/ 130 /* note: this requires enough memory */ 131 /* please pay attention to memory layout */ 132 }; 133 134 /** **/ 135 cell tMrubyVM MrubyVM{ 136 mrubyFile = composite.mrubyFile; 137 cInit => composite.cInit; 138 cMalloc = TLSFMalloc.eMalloc; 139 }; 140 cell tMrubyCyclicTaskBody MrubyTaskBody { 141 cMrubyVM = MrubyVM.eMrubyVM; 142 }; 143 cell tTLSFMalloc TLSFMalloc { 144 memoryPoolSize = composite.memoryPoolSize; 145 }; 146 composite.eMrubyBody => MrubyTaskBody.eMrubyBody; 147 }; 66 148 }; -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecs/mruby/tecs_mruby.h
r321 r429 1 /* 2 * Copyright (C) 2008-2019 by TOPPERS Project 3 * 4 * 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ 5 * ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改 6 * 変・再配布(以下,利用と呼ぶ)することを無償で許諾する. 7 * (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作 8 * 権表示,この利用条件および下記の無保証規定が,そのままの形でソー 9 * スコード中に含まれていること. 10 * (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使 11 * 用できる形で再配布する場合には,再配布に伴うドキュメント(利用 12 * 者マニュアルなど)に,上記の著作権表示,この利用条件および下記 13 * の無保証規定を掲載すること. 14 * (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使 15 * 用できない形で再配布する場合には,次のいずれかの条件を満たすこ 16 * と. 17 * (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著 18 * 作権表示,この利用条件および下記の無保証規定を掲載すること. 19 * (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに 20 * 報告すること. 21 * (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損 22 * 害からも,上記著作権者およびTOPPERSプロジェクトを免責すること. 23 * また,本ソフトウェアのユーザまたはエンドユーザからのいかなる理 24 * 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを 25 * 免責すること. 26 * 27 * 本ソフトウェアは,無保証で提供されているものである.上記著作権者お 28 * よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的 29 * に対する適合性も含めて,いかなる保証も行わない.また,本ソフトウェ 30 * アの利用により直接的または間接的に生じたいかなる損害に関しても,そ 31 * の責任を負わない. 32 * 33 * @(#) $Id$ 34 */ 35 1 36 #ifndef tecs_mruby_h__ 2 37 #define tecs_mruby_h__ … … 9 44 #include "mruby/data.h" 10 45 #include "mruby/string.h" 46 #include "mruby/irep.h" 47 #include "mruby/dump.h" 48 #include "mruby/proc.h" 11 49 12 50 #include "TECSPointer.h" 13 51 #include "TECSStruct.h" 14 52 15 #if ! defined( MRUBY_RELEASE_MAJOR ) || MRUBY_RELEASE_MAJOR == 1 && MRUBY_RELEASE_MINOR < 216 #ifndef MRB_ARGS_REQ17 #define MRB_ARGS_REQ(n) ARGS_REQ(n)18 #define MRB_ARGS_OPT(n) ARGS_OPT(n)19 #define MRB_ARGS_ARG(n1,n2) ARGS_ARG(n1,n2)20 #define MRB_ARGS_REST() ARGS_REST()21 #define MRB_ARGS_POST(n) ARGS_POST(n)22 #define MRB_ARGS_KEY(n1,n2) ARGS_KEY(n1,n2)23 #define MRB_ARGS_BLOCK() ARGS_BLOCK()24 #define MRB_ARGS_ANY() ARGS_ANY()25 #define MRB_ARGS_NONE() ARGS_NONE()26 #endif /* MRB_ARGS_REQ */27 #endif28 53 29 #if ! defined( MRUBY_RELEASE_MAJOR ) 30 #define mrb_float_value( mrb, val ) mrb_float_value( val ) 31 #endif 32 33 #else 54 #else /* TECSGEN */ 34 55 35 56 /* 36 * fake tecsgen because tecsgen cannot accept actual mruby.h in case of below.57 * fake definition because tecsgen cannot accept actual mruby.h in case of below. 37 58 * types: long long, long long int 38 59 * special keyword __attribute__(x), __extension__ 39 60 */ 40 61 typedef int mrb_state; 41 struct RClass {int dummy;}; 62 typedef int mrb_irep; 63 typedef int mrb_context; 64 struct RClass {uint32_t gcnext;}; // actual definition: struct RBasic *gcnext 65 struct RProc {uint32_t gcnext;}; // actual definition: struct RBasic *gcnext 42 66 43 67 typedef int CELLCB; 68 69 #define GET_SET_BOOL( Type, type ) 70 #define GET_SET_CHAR( Type, type ) 71 #define GET_SET_INT( Type, type ) 72 #define GET_SET_FLOAT( Type, type ) 73 #define POINTER_CLASS( Type, type ) 74 #define CHECK_AND_GET_POINTER( Type, type ) 44 75 45 76 #endif /* TECSGEN */ -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecs/posix/posix.cdl
r321 r429 1 /* 2 * Copyright (C) 2008-2017 by TOPPERS Project 3 * 4 * 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ 5 * ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改 6 * 変・再配布(以下,利用と呼ぶ)することを無償で許諾する. 7 * (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作 8 * 権表示,この利用条件および下記の無保証規定が,そのままの形でソー 9 * スコード中に含まれていること. 10 * (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使 11 * 用できる形で再配布する場合には,再配布に伴うドキュメント(利用 12 * 者マニュアルなど)に,上記の著作権表示,この利用条件および下記 13 * の無保証規定を掲載すること. 14 * (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使 15 * 用できない形で再配布する場合には,次のいずれかの条件を満たすこ 16 * と. 17 * (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著 18 * 作権表示,この利用条件および下記の無保証規定を掲載すること. 19 * (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに 20 * 報告すること. 21 * (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損 22 * 害からも,上記著作権者およびTOPPERSプロジェクトを免責すること. 23 * また,本ソフトウェアのユーザまたはエンドユーザからのいかなる理 24 * 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを 25 * 免責すること. 26 * 27 * 本ソフトウェアは,無保証で提供されているものである.上記著作権者お 28 * よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的 29 * に対する適合性も含めて,いかなる保証も行わない.また,本ソフトウェ 30 * アの利用により直接的または間接的に生じたいかなる損害に関しても,そ 31 * の責任を負わない. 32 * 33 * @(#) $Id$ 34 */ 35 1 36 2 37 namespace nPosix { -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecs/rpc/TDR.cdl
r321 r429 68 68 ER sendSOP( [in]bool_t b_client ); /* StartOfPacket magic を送信 */ 69 69 ER receiveSOP( [in]bool_t b_client ); /* StartOfPacket magic を受信 */ 70 /* b_client: クライアント側なら true, サーバー側なら false */71 72 /* マジックコードの送受信 */73 // ER sendSHSOP( [in]bool_t b_client ); /* StartOfPacket magic を送信 */74 // ER receiveSHSOP( [in]bool_t b_client ); /* StartOfPacket magic を受信 */75 70 /* b_client: クライアント側なら true, サーバー側なら false */ 76 71 … … 150 145 }; 151 146 152 // Straight Order TECS Data Representation (Straight means no endian-conversion is done)147 // Straight Byte Order TECS Data Representation (Data are always sent in native endian) 153 148 celltype tTDR { 154 149 call sChannel cChannel; -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecs/rpc/sChannel.cdl
r321 r429 58 58 }; 59 59 60 /* 61 * size に uint16_t ではなく int16_t を用いるのは、下位層が ER_INT を返す場合を想定したもの. 62 * 63 * sChannel は TECS RPC の TDR の下位層である通信チャンネルとのインタフェースである. 64 * 通信チャンネルは、高水準 I/O のように、バッファリングされることを想定する. 65 * TDR からは、int8_t, int16_t, int32_t, int64_t, (int128_t), float32_t, double64_t bool_t, char_t のような基本型(無符号を含む)が渡される。 66 * 配列や構造体の場合であっても要素ごとに渡される。 67 */ -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecs/rpc/tTDR_inline.h
r321 r429 75 75 return(E_ID); 76 76 } 77 (void)p_cellcb; // to avoid unused warning 77 78 78 79 syslog( LOG_INFO, "TDR: resetting channel" ); … … 102 103 return(E_ID); 103 104 } 105 (void)p_cellcb; // to avoid unused warning 104 106 105 107 /* ここに処理本体を記述します #_TEFB_# */ … … 151 153 return(E_ID); 152 154 } 155 (void)p_cellcb; // to avoid unused warning 153 156 154 157 /* ここに処理本体を記述します #_TEFB_# */ … … 157 160 #endif 158 161 159 162 if( b_client ) 160 163 p_sopMagic = &SOP_MAGIC2; 161 164 else … … 198 201 return(E_ID); 199 202 } 203 (void)p_cellcb; // to avoid unused warning 200 204 201 205 /* ここに処理本体を記述します #_TEFB_# */ … … 234 238 return(E_ID); 235 239 } 240 (void)p_cellcb; // to avoid unused warning 236 241 237 242 /* ここに処理本体を記述します #_TEFB_# */ … … 267 272 return(E_ID); 268 273 } 274 (void)p_cellcb; // to avoid unused warning 269 275 270 276 /* ここに処理本体を記述します #_TEFB_# */ … … 287 293 return(E_ID); 288 294 } 295 (void)p_cellcb; // to avoid unused warning 289 296 290 297 /* ここに処理本体を記述します #_TEFB_# */ … … 307 314 return(E_ID); 308 315 } 316 (void)p_cellcb; // to avoid unused warning 309 317 310 318 /* ここに処理本体を記述します #_TEFB_# */ … … 327 335 return(E_ID); 328 336 } 337 (void)p_cellcb; // to avoid unused warning 329 338 330 339 /* ここに処理本体を記述します #_TEFB_# */ … … 347 356 return(E_ID); 348 357 } 358 (void)p_cellcb; // to avoid unused warning 349 359 350 360 /* ここに処理本体を記述します #_TEFB_# */ … … 368 378 return(E_ID); 369 379 } 380 (void)p_cellcb; // to avoid unused warning 370 381 371 382 /* ここに処理本体を記述します #_TEFB_# */ … … 390 401 return(E_ID); 391 402 } 403 (void)p_cellcb; // to avoid unused warning 392 404 393 405 /* ここに処理本体を記述します #_TEFB_# */ … … 412 424 return(E_ID); 413 425 } 426 (void)p_cellcb; // to avoid unused warning 414 427 415 428 /* ここに処理本体を記述します #_TEFB_# */ … … 434 447 return(E_ID); 435 448 } 449 (void)p_cellcb; // to avoid unused warning 436 450 437 451 /* ここに処理本体を記述します #_TEFB_# */ … … 456 470 return(E_ID); 457 471 } 472 (void)p_cellcb; // to avoid unused warning 458 473 459 474 /* ここに処理本体を記述します #_TEFB_# */ … … 477 492 return(E_ID); 478 493 } /* end if VALID_IDX(idx) */ 494 (void)p_cellcb; // to avoid unused warning 479 495 480 496 /* ここに処理本体を記述します #_TEFB_# */ … … 497 513 return(E_ID); 498 514 } /* end if VALID_IDX(idx) */ 515 (void)p_cellcb; // to avoid unused warning 499 516 500 517 /* ここに処理本体を記述します #_TEFB_# */ … … 517 534 return(E_ID); 518 535 } /* end if VALID_IDX(idx) */ 536 (void)p_cellcb; // to avoid unused warning 519 537 520 538 /* ここに処理本体を記述します #_TEFB_# */ … … 537 555 return(E_ID); 538 556 } /* end if VALID_IDX(idx) */ 557 (void)p_cellcb; // to avoid unused warning 539 558 540 559 /* ここに処理本体を記述します #_TEFB_# */ … … 557 576 return(E_ID); 558 577 } /* end if VALID_IDX(idx) */ 578 (void)p_cellcb; // to avoid unused warning 559 579 560 580 /* ここに処理本体を記述します #_TEFB_# */ … … 578 598 return(E_ID); 579 599 } /* end if VALID_IDX(idx) */ 600 (void)p_cellcb; // to avoid unused warning 580 601 581 602 /* ここに処理本体を記述します #_TEFB_# */ … … 600 621 return(E_ID); 601 622 } /* end if VALID_IDX(idx) */ 623 (void)p_cellcb; // to avoid unused warning 602 624 603 625 /* ここに処理本体を記述します #_TEFB_# */ … … 622 644 return(E_ID); 623 645 } /* end if VALID_IDX(idx) */ 646 (void)p_cellcb; // to avoid unused warning 624 647 625 648 /* ここに処理本体を記述します #_TEFB_# */ … … 644 667 return(E_ID); 645 668 } /* end if VALID_IDX(idx) */ 669 (void)p_cellcb; // to avoid unused warning 646 670 647 671 /* ここに処理本体を記述します #_TEFB_# */ … … 666 690 return(E_ID); 667 691 } /* end if VALID_IDX(idx) */ 692 (void)p_cellcb; // to avoid unused warning 668 693 669 694 /* ここに処理本体を記述します #_TEFB_# */ … … 688 713 return(E_ID); 689 714 } /* end if VALID_IDX(idx) */ 715 (void)p_cellcb; // to avoid unused warning 690 716 691 717 /* ここに処理本体を記述します #_TEFB_# */ … … 705 731 ER ercd = E_OK; 706 732 CELLCB *p_cellcb; 707 uint8_t val; 708 if (VALID_IDX(idx)) { 709 p_cellcb = GET_CELLCB(idx); 710 } 711 else { 712 return(E_ID); 713 } /* end if VALID_IDX(idx) */ 733 uint8_t val = 0; 734 if (VALID_IDX(idx)) { 735 p_cellcb = GET_CELLCB(idx); 736 } 737 else { 738 return(E_ID); 739 } /* end if VALID_IDX(idx) */ 740 (void)p_cellcb; // to avoid unused warning 714 741 715 742 /* ここに処理本体を記述します #_TEFB_# */ … … 737 764 return(E_ID); 738 765 } 766 (void)p_cellcb; // to avoid unused warning 739 767 740 768 /* ここに処理本体を記述します #_TEFB_# */ … … 757 785 return(E_ID); 758 786 } 787 (void)p_cellcb; // to avoid unused warning 759 788 760 789 /* ここに処理本体を記述します #_TEFB_# */ … … 778 807 return(E_ID); 779 808 } 809 (void)p_cellcb; // to avoid unused warning 780 810 781 811 /* ここに処理本体を記述します #_TEFB_# */ … … 800 830 return(E_ID); 801 831 } 832 (void)p_cellcb; // to avoid unused warning 802 833 803 834 /* ここに処理本体を記述します #_TEFB_# */ … … 821 852 return(E_ID); 822 853 } 854 (void)p_cellcb; // to avoid unused warning 823 855 824 856 /* ここに処理本体を記述します #_TEFB_# */ … … 863 895 return(E_ID); 864 896 } /* end if VALID_IDX(idx) */ 897 (void)p_cellcb; // to avoid unused warning 865 898 866 899 /* ここに処理本体を記述します #_TEFB_# */ … … 883 916 return(E_ID); 884 917 } 918 (void)p_cellcb; // to avoid unused warning 885 919 886 920 /* ここに処理本体を記述します #_TEFB_# */ … … 903 937 return(E_ID); 904 938 } 939 (void)p_cellcb; // to avoid unused warning 905 940 906 941 /* ここに処理本体を記述します #_TEFB_# */ … … 923 958 return(E_ID); 924 959 } 960 (void)p_cellcb; // to avoid unused warning 925 961 926 962 /* ここに処理本体を記述します #_TEFB_# */ … … 944 980 return(E_ID); 945 981 } /* end if VALID_IDX(idx) */ 982 (void)p_cellcb; // to avoid unused warning 946 983 947 984 /* ここに処理本体を記述します #_TEFB_# */ … … 966 1003 return(E_ID); 967 1004 } 1005 (void)p_cellcb; // to avoid unused warning 968 1006 969 1007 /* ここに処理本体を記述します #_TEFB_# */ … … 988 1026 return(E_ID); 989 1027 } 1028 (void)p_cellcb; // to avoid unused warning 990 1029 991 1030 /* ここに処理本体を記述します #_TEFB_# */ … … 1010 1049 return(E_ID); 1011 1050 } 1051 (void)p_cellcb; // to avoid unused warning 1012 1052 1013 1053 /* ここに処理本体を記述します #_TEFB_# */ … … 1031 1071 return(E_ID); 1032 1072 } /* end if VALID_IDX(idx) */ 1073 (void)p_cellcb; // to avoid unused warning 1033 1074 1034 1075 /* ここに処理本体を記述します #_TEFB_# */ … … 1051 1092 return(E_ID); 1052 1093 } /* end if VALID_IDX(idx) */ 1094 (void)p_cellcb; // to avoid unused warning 1053 1095 1054 1096 /* ここに処理本体を記述します #_TEFB_# */ … … 1071 1113 return(E_ID); 1072 1114 } /* end if VALID_IDX(idx) */ 1115 (void)p_cellcb; // to avoid unused warning 1073 1116 1074 1117 /* ここに処理本体を記述します #_TEFB_# */ … … 1091 1134 return(E_ID); 1092 1135 } /* end if VALID_IDX(idx) */ 1136 (void)p_cellcb; // to avoid unused warning 1093 1137 1094 1138 /* ここに処理本体を記述します #_TEFB_# */ … … 1112 1156 return(E_ID); 1113 1157 } /* end if VALID_IDX(idx) */ 1158 (void)p_cellcb; // to avoid unused warning 1114 1159 1115 1160 /* ここに処理本体を記述します #_TEFB_# */ … … 1134 1179 return(E_ID); 1135 1180 } /* end if VALID_IDX(idx) */ 1181 (void)p_cellcb; // to avoid unused warning 1136 1182 1137 1183 /* ここに処理本体を記述します #_TEFB_# */ … … 1156 1202 return(E_ID); 1157 1203 } /* end if VALID_IDX(idx) */ 1204 (void)p_cellcb; // to avoid unused warning 1158 1205 1159 1206 /* ここに処理本体を記述します #_TEFB_# */ … … 1178 1225 return(E_ID); 1179 1226 } /* end if VALID_IDX(idx) */ 1227 (void)p_cellcb; // to avoid unused warning 1180 1228 1181 1229 /* ここに処理本体を記述します #_TEFB_# */ … … 1199 1247 return(E_ID); 1200 1248 } 1249 (void)p_cellcb; // to avoid unused warning 1201 1250 1202 1251 /* ここに処理本体を記述します #_TEFB_# */ … … 1220 1269 return(E_ID); 1221 1270 } 1271 (void)p_cellcb; // to avoid unused warning 1222 1272 1223 1273 /* ここに処理本体を記述します #_TEFB_# */ -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecsgen
r321 r429 7 7 # 8 8 # ä¸è¨èä½æ¨©è 9 ã¯ï¼ä»¥ä¸ã®(1) ã(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§9 ã¯ï¼ä»¥ä¸ã®(1)ï½(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§ 10 10 # ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ã使ç¨ã»è¤è£½ã»æ¹ 11 11 # å¤ã»åé -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecsgen.rb
r321 r429 5 5 # Generator for TOPPERS Embedded Component System 6 6 # 7 # Copyright (C) 2008-201 6by TOPPERS Project7 # Copyright (C) 2008-2019 by TOPPERS Project 8 8 #-- 9 9 # 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ … … 54 54 # Authors list is in i-ro-ha order. 55 55 #Version:: see version.rb 56 $Copyright = "Copyright(c) 2008-201 6, TOPPERS project. All rights reserved."56 $Copyright = "Copyright(c) 2008-2019, TOPPERS project. All rights reserved." 57 57 $License = "TOPPERS License" 58 58 … … 223 223 analyze_option addtional_option_parser 224 224 load_modules 225 setup 225 if ! $TECSFLOW then 226 setup 227 end 226 228 227 229 dbgPrint "tecspath: #{$tecsgen_base_path}, __FILE__=#{__FILE__}\n" … … 284 286 ARGV.each { |a| $arguments += " " + a } 285 287 286 $unopt = false # bool: disable optimizing 288 $unopt = false # bool: disable optimizing both call and entry port 289 $unopt_entry= false # bool: disable optimizing entry port 287 290 $gen_base = "gen" # string: folder path to place generated files 288 291 $gen = $gen_base # string: folder path to place generated files … … 385 388 $unopt = true 386 389 } 390 parser.on('--unoptimize-entry', 'unoptimize entry port') { 391 $unopt_entry = true 392 } 387 393 parser.on('-c', '--cpp=cpp_cmd', 'C pre-processor command used import_C (default: gcc -E -DTECSGEN), you can also specify by environment variable TECS_CPP' ){ 388 394 |arg| … … 465 471 } 466 472 467 if ARGV.empty? && ! $print_version && ! $unit_test 473 if ARGV.empty? && ! $print_version && ! $unit_test && ! $TECSFLOW 468 474 ARGV.options{|parser| 469 475 puts parser.help … … 482 488 # このファイルを誤って読み込むと、異なるバージョン名を表示してしまう 483 489 require_tecsgen_lib 'tecslib/version.rb' 484 if ! $no_banner || $print_version 490 if $title then 491 STDERR << "#{$title} version #{$tool_version} (tecsgen version #{$version}) #{$Copyright}\n" 492 elsif ! $no_banner || $print_version 485 493 STDERR << "tecsgen version #{$version} #{$Copyright}\n" 486 494 end … … 488 496 STDERR << "ruby #{RUBY_VERSION} (#{RUBY_RELEASE_DATE} patchlevel #{RUBY_PATCHLEVEL}) [#{RUBY_PLATFORM}]\n" 489 497 end 490 if $print_version && ARGV.empty? 498 if $print_version && ARGV.empty? && ! $TECSFLOW 491 499 exit 492 500 end … … 514 522 require_tecsgen_lib 'tecslib/core/generate.rb' 515 523 require_tecsgen_lib 'tecslib/core/gen_xml.rb' 516 # require_tecsgen_lib 'tecslib/core/tool_info.rb' 524 require_tecsgen_lib 'tecslib/core/tool_info.rb' 525 require_tecsgen_lib 'tecslib/core/tecsinfo.rb' 526 require_tecsgen_lib 'tecslib/core/unjoin_plugin.rb' 517 527 require_tecsgen_lib 'tecslib/plugin/CelltypePlugin.rb' 528 require_tecsgen_lib 'tecslib/plugin/CompositePlugin.rb' 518 529 require_tecsgen_lib 'tecslib/plugin/CellPlugin.rb' 519 530 require_tecsgen_lib 'tecslib/plugin/SignaturePlugin.rb' 520 531 require_tecsgen_lib 'tecslib/plugin/ThroughPlugin.rb' 521 532 require_tecsgen_lib 'tecslib/plugin/DomainPlugin.rb' 533 require_tecsgen_lib 'tecslib/plugin/MultiPlugin.rb' 522 534 523 535 # C 言語パーサ … … 596 608 # クラス変数のリセットを確実に行う必要がある 597 609 598 if $TECSCDE != true then610 if $TECSCDE != true && $TECSFLOW != true then 599 611 begin 600 612 TECSGEN.init … … 602 614 tecsgen.run1 603 615 tecsgen.run2 616 tecsgen.dump_tecsgen_rbdmp 604 617 rescue => evar 605 618 print_exception( evar ) -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecsgen_rcov.rb
r321 r429 44 44 # Usage: tecsgen_rcov.rb [options] CDL-file.cdl 45 45 # 46 47 $:.unshift(File.dirname(__FILE__)) 48 46 49 require 'simplecov' 47 SimpleCov.command_name "tecsgen#{ $$}"50 SimpleCov.command_name "tecsgen#{Time.now.to_f}" 48 51 SimpleCov.root File.dirname( File.expand_path __FILE__ ) 49 52 SimpleCov.at_exit do -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecslib/core/C_parser.tab.rb
r321 r429 1 1 # 2 2 # DO NOT MODIFY!!!! 3 # This file is automatically generated by Racc 1.4. 123 # This file is automatically generated by Racc 1.4.9 4 4 # from Racc grammer file "". 5 5 # … … 8 8 class C_parser < Racc::Parser 9 9 10 module_eval(<<'...end C_parser.y.rb/module_eval...', 'C_parser.y.rb', 715) 11 12 RESERVED = { 13 # keyword 14 'typedef' => :TYPEDEF, 15 'struct' => :STRUCT, 16 'union' => :UNION, 17 'sizeof' => :SIZEOF, 18 'throw' => :THROW, 19 20 # specifier 21 # types 22 'void' => :VOID, 23 'char' => :CHAR, 24 'short' => :SHORT, 25 26 'volatile'=> :VOLATILE, 27 'const' => :CONST, 28 'extern' => :EXTERN, 29 30 'long' => :LONG, 31 'float' => :FLOAT, 32 'double' => :DOUBLE, 33 'signed' => :SIGNED, 34 'unsigned'=> :UNSIGNED, 35 36 'int' => :INT, 37 'enum' => :ENUM, 38 39 'if' => :IF, 40 'else' => :ELSE, 41 'while' => :WHILE, 42 'do' => :DO, 43 'for' => :FOR, 44 'case' => :CASE, 45 'default' => :DEFAULT, 46 'goto' => :GOTO, 47 'continue' => :CONTINUE, 48 'break' => :BREAK, 49 'return' => :RETURN, 50 '__inline__' => :__INLINE__, 51 'inline' => :INLINE, 52 '__inline' => :__INLINE, 53 'Inline' => :CINLINE, # inline starting with Capital letter 54 'static' => :STATIC, 55 'register' => :REGISTER, 56 'auto' => :AUTO, 57 '__extension__' => :EXTENSION, 58 59 } 60 61 @@generator_nest = -1 62 @@generator_stack = [] 63 @@current_locale = [] 64 65 def finalize 66 67 # mikan Namespace.pop 68 Celltype.pop 69 Cell.pop 70 CompositeCelltype.pop 71 Region.pop 72 73 end 74 75 def set_plugin( plugin ) 76 @plugin = plugin 77 end 78 79 def self.get_plugin 80 @@generator_stack[@@generator_nest].get_plugin 81 end 82 83 def get_plugin 84 @plugin 85 end 86 87 def parse(files) 88 89 # mikan Namespace.push 90 Celltype.push 91 Cell.push 92 CompositeCelltype.push 93 Region.push 94 95 @@generator_nest += 1 96 @@generator_stack[@@generator_nest] = self 97 @b_no_type_name = false 98 99 begin 100 101 @q = [] 102 comment = false 103 104 # euc のコメントを utf8 として扱うと、コメントの終わりを誤る問題の対策 105 TECS_LANG::set_kcode_binary 106 107 # 800U, 0xffLL など (整数リテラルに共通の修飾子) 108 integer_qualifier = "([Uu][Ll][Ll]|[Uu][Ll]|[Uu]|[Ll][Ll]|[Ll])?" 109 110 files.each {|file| 111 lineno = 1 112 begin 113 #2.0 IO.foreach(file) {|line| 114 TECSIO.foreach(file) {|line| 115 col = 1 116 line.rstrip! 117 118 until line.empty? 119 120 if comment 121 case line 122 # コメント終了 123 when /\A\*\// 124 comment = false 125 when /\A./ 126 ; 127 end 128 else 129 case line 130 # 空白、プリプロセスディレクティブ 131 when /\A\s+/ 132 ; 133 # 識別子 134 when /\A[a-zA-Z_]\w*/ 135 word = $& 136 @q << [RESERVED[word] || :IDENTIFIER, Token.new(word.intern, file, lineno, col)] 137 # 16 進数定数 138 when /\A0x[0-9A-Fa-f]+#{integer_qualifier}/ 139 @q << [:HEX_CONSTANT, Token.new($&, file, lineno, col)] 140 # 8 進数定数 141 when /\A0[0-7]+#{integer_qualifier}/ 142 @q << [:OCTAL_CONSTANT, Token.new($&, file, lineno, col)] 143 # 浮動小数定数 144 when /\A[0-9]+\.([0-9]*)?([Ee][+-]?[0-9]+)?/ 145 @q << [:FLOATING_CONSTANT, Token.new($&, file, lineno, col)] 146 # 整数定数 147 when /\A\d+#{integer_qualifier}/ 148 # when /\A\d+/ 149 @q << [:INTEGER_CONSTANT, Token.new($&.to_i, file, lineno, col)] 150 # 文字 151 when /\A'(?:[^'\\]|\\.)'/ 152 @q << [:CHARACTER_LITERAL, Token.new($&, file, lineno, col)] 153 # 文字列 154 # "#include #include #include \"../systask/logtask.cfg\" 最後の " 忘れ)で無限ループ 155 # when /\A"(?:[^"\\]+|\\.)*"/ 156 when /\A"(?:[^"\\]|\\.)*"/ # これはうまく行くようだ 157 @q << [:STRING_LITERAL, Token.new($&, file, lineno, col)] 158 # 行コメント 159 when /\A\/\/.*$/ 160 # 読み飛ばすだけ 161 # コメント開始 162 when /\A\/\*/ 163 comment = true 164 when /\A>>=/, /\A<<=/, /\A>>/, /\A<</ 165 @q << [$&, Token.new($&, file, lineno, col)] 166 when /\A\+=/, /\A\-=/, /\A\*=/, /\A\/=/, /\A%=/, /\A&=/, /\A\|=/, /\A\^=/ 167 @q << [$&, Token.new($&, file, lineno, col)] 168 when /\A::/, /\A==/, /\A!=/, /\A>=/, /\A<=/, /\A\->/, /\A\+\+/, /\A\-\-/ 169 @q << [$&, Token.new($&, file, lineno, col)] 170 when /\A./ 171 @q << [$&, Token.new($&, file, lineno, col)] 172 else 173 raise 174 end 175 end 176 177 line = $' 178 col += $&.length 179 end 180 181 lineno += 1 182 } 183 184 rescue => evar 185 Generator.error( "B1002 while open or reading \'$1\'" , file ) 186 print_exception( evar ) 187 end 188 } 189 190 # 終了の印 191 @q << nil 192 193 @yydebug = true 194 do_parse 195 196 ensure 197 @@generator_nest -= 1 198 TECS_LANG::reset_kcode 199 end 200 201 end 202 203 204 def next_token 205 token = @q.shift 206 207 if token then 208 @@current_locale[@@generator_nest] = token[1].locale 209 210 case token[1].val 211 when ";", ":", ",", "(", ")", "{", "}" 212 set_no_type_name false 213 when ".", "->" 214 set_no_type_name true 215 end 216 217 # TYPE_NAME トークンへ置き換え 218 if @b_no_type_name == false 219 if token[0] == :IDENTIFIER && Namespace.is_typename?( token[1].val ) then 220 token[0] = :TYPE_NAME 221 end 222 end 223 224 if $debug then # 070107 token 無効時ここを通さないようした (through 対応 -d の時に例外発生) 225 locale = @@current_locale[@@generator_nest] 226 if token then 227 print( "#{locale[0]}: line #{locale[1]} : #{token[0]} '#{token[1].val}'\n" ) 228 else 229 print( "#{locale[0]}: line #{locale[1]} : EOF\n" ) 230 end 231 end 232 end 233 234 token 235 end 236 237 def on_error(t, v, vstack) 238 if v == "$" then 239 Generator.error( "B1003 Unexpected EOF" ) 240 else 241 Generator.error( "B1004 syntax error near \'$1\'" , v.val ) 242 end 243 244 end 245 246 def self.current_locale 247 @@current_locale[ @@generator_nest ] 248 end 249 250 @@n_error = 0 251 @@n_warning = 0 252 253 # このメソッドは構文解析、意味解析からのみ呼出し可(コード生成でエラー発生は不適切) 254 def self.error( msg ) 255 @@n_error += 1 256 locale = @@current_locale[ @@generator_nest ] 257 258 if locale then 259 Console.puts "error: #{locale[0]}: line #{locale[1]} #{msg}" 260 else 261 Console.puts "error: #{msg}" 262 end 263 end 264 265 # このメソッドは構文解析、意味解析からのみ呼出し可(コード生成でウォーニング発生は不適切) 266 def self.warning( msg ) 267 @@n_warning += 1 268 locale = @@current_locale[ @@generator_nest ] 269 Console.puts "warning: #{locale[0]}: line #{locale[1]} #{msg}" 270 end 271 272 def self.get_n_error 273 @@n_error 274 end 275 276 def self.get_n_warning 277 @@n_warning 278 end 279 280 def self.get_nest 281 @@generator_nest 282 end 283 284 def set_no_type_name b_no_type_name 285 # print "b_no_type_name=#{b_no_type_name}\n" 286 @b_no_type_name = b_no_type_name 287 end 10 module_eval(<<'...end C_parser.y.rb/module_eval...', 'C_parser.y.rb', 784) 11 12 RESERVED = { 13 # keyword 14 'typedef' => :TYPEDEF, 15 'struct' => :STRUCT, 16 'union' => :UNION, 17 'sizeof' => :SIZEOF, 18 'throw' => :THROW, 19 20 # specifier 21 # types 22 'void' => :VOID, 23 'char' => :CHAR, 24 'short' => :SHORT, 25 26 'volatile'=> :VOLATILE, 27 'restrict'=> :RESTRICT, 28 'const' => :CONST, 29 'extern' => :EXTERN, 30 31 'long' => :LONG, 32 'float' => :FLOAT, 33 'double' => :DOUBLE, 34 'signed' => :SIGNED, 35 'unsigned'=> :UNSIGNED, 36 37 'int' => :INT, 38 'enum' => :ENUM, 39 40 'if' => :IF, 41 'else' => :ELSE, 42 'while' => :WHILE, 43 'do' => :DO, 44 'for' => :FOR, 45 'switch' => :SWITCH, 46 'case' => :CASE, 47 'default' => :DEFAULT, 48 'goto' => :GOTO, 49 'continue' => :CONTINUE, 50 'break' => :BREAK, 51 'return' => :RETURN, 52 '__inline__' => :__INLINE__, 53 'inline' => :INLINE, 54 '__inline' => :__INLINE, 55 'Inline' => :CINLINE, # inline starting with Capital letter 56 'static' => :STATIC, 57 'register' => :REGISTER, 58 'auto' => :AUTO, 59 '__extension__' => :EXTENSION, 60 '__asm__' => :_ASM, 61 'asm' => :_ASM 62 63 } 64 65 @@generator_nest = -1 66 @@generator_stack = [] 67 @@current_locale = [] 68 69 def finalize 70 71 # mikan Namespace.pop 72 Celltype.pop 73 Cell.pop 74 CompositeCelltype.pop 75 Region.pop 76 77 end 78 79 def set_plugin( plugin ) 80 @plugin = plugin 81 end 82 83 def self.get_plugin 84 @@generator_stack[@@generator_nest].get_plugin 85 end 86 87 def get_plugin 88 @plugin 89 end 90 91 def parse(files) 92 93 # mikan Namespace.push 94 Celltype.push 95 Cell.push 96 CompositeCelltype.push 97 Region.push 98 99 @@generator_nest += 1 100 @@generator_stack[@@generator_nest] = self 101 @b_no_type_name = false 102 103 begin 104 105 @q = [] 106 comment = false 107 # b_asm = false 108 109 # euc のコメントを utf8 として扱うと、コメントの終わりを誤る問題の対策 110 TECS_LANG::set_kcode_binary 111 112 # 800U, 0xffLL など (整数リテラルに共通の修飾子) 113 integer_qualifier = "([Uu][Ll][Ll]|[Uu][Ll]|[Uu]|[Ll][Ll]|[Ll])?" 114 115 files.each {|file| 116 lineno = 1 117 begin 118 #2.0 IO.foreach(file) {|line| 119 TECSIO.foreach(file) {|line| 120 col = 1 121 line.rstrip! 122 123 until line.empty? 124 125 if comment 126 case line 127 # コメント終了 128 when /\A\*\// 129 comment = false 130 when /\A./ 131 ; 132 end 133 else 134 case line 135 # 空白、プリプロセスディレクティブ 136 when /\A\s+/ 137 ; 138 # 識別子 139 when /\A[a-zA-Z_]\w*/ 140 word = $& 141 @q << [RESERVED[word] || :IDENTIFIER, Token.new(word.intern, file, lineno, col)] 142 # 16 進数定数 143 when /\A0x[0-9A-Fa-f]+#{integer_qualifier}/ 144 @q << [:HEX_CONSTANT, Token.new($&, file, lineno, col)] 145 # 8 進数定数 146 when /\A0[0-7]+#{integer_qualifier}/ 147 @q << [:OCTAL_CONSTANT, Token.new($&, file, lineno, col)] 148 # 浮動小数定数 149 when /\A[0-9]+\.([0-9]*)?([Ee][+-]?[0-9]+)?/ 150 @q << [:FLOATING_CONSTANT, Token.new($&, file, lineno, col)] 151 # 整数定数 152 when /\A\d+#{integer_qualifier}/ 153 # when /\A\d+/ 154 @q << [:INTEGER_CONSTANT, Token.new($&.to_i, file, lineno, col)] 155 # 文字 156 when /\A'(?:[^'\\]|\\.)'/ 157 @q << [:CHARACTER_LITERAL, Token.new($&, file, lineno, col)] 158 # 文字列 159 # "#include #include #include \"../systask/logtask.cfg\" 最後の " 忘れ)で無限ループ 160 # when /\A"(?:[^"\\]+|\\.)*"/ 161 when /\A"(?:[^"\\]|\\.)*"/ # これはうまく行くようだ 162 @q << [:STRING_LITERAL, Token.new($&, file, lineno, col)] 163 # 行コメント 164 when /\A\/\/.*$/ 165 # 読み飛ばすだけ 166 # コメント開始 167 when /\A\/\*/ 168 comment = true 169 when /\A>>=/, /\A<<=/, /\A>>/, /\A<</ 170 @q << [$&, Token.new($&, file, lineno, col)] 171 when /\A\+=/, /\A\-=/, /\A\*=/, /\A\/=/, /\A%=/, /\A&=/, /\A\|=/, /\A\^=/ 172 @q << [$&, Token.new($&, file, lineno, col)] 173 when /\A::/, /\A==/, /\A!=/, /\A>=/, /\A<=/, /\A\->/, /\A\+\+/, /\A\-\-/ 174 @q << [$&, Token.new($&, file, lineno, col)] 175 when /\A\|\|/, /\A\&\&/ 176 @q << [$&, Token.new($&, file, lineno, col)] 177 when /\A./ 178 @q << [$&, Token.new($&, file, lineno, col)] 179 else 180 raise 181 end 182 end 183 184 line = $' 185 col += $&.length 186 end 187 188 lineno += 1 189 } 190 191 rescue => evar 192 Generator.error( "B1002 while open or reading \'$1\'" , file ) 193 print_exception( evar ) 194 end 195 } 196 197 # 終了の印 198 @q << nil 199 200 @yydebug = true 201 do_parse 202 203 ensure 204 @@generator_nest -= 1 205 TECS_LANG::reset_kcode 206 end 207 208 end 209 210 211 def next_token 212 token = @q.shift 213 214 if token then 215 @@current_locale[@@generator_nest] = token[1].locale 216 217 case token[1].val 218 when ";", ":", ",", "(", ")", "{", "}" 219 set_no_type_name false 220 when ".", "->" 221 set_no_type_name true 222 end 223 224 # TYPE_NAME トークンへ置き換え 225 if @b_no_type_name == false 226 if token[0] == :IDENTIFIER && Namespace.is_typename?( token[1].val ) then 227 token[0] = :TYPE_NAME 228 locale = @@current_locale[@@generator_nest] 229 #print( "#{locale[0]}: line #{locale[1]} : #{token[0]} '#{token[1].val}: type_name'\n" ) 230 end 231 end 232 233 if $debug then # 070107 token 無効時ここを通さないようした (through 対応 -d の時に例外発生) 234 locale = @@current_locale[@@generator_nest] 235 if token then 236 print( "#{locale[0]}: line #{locale[1]} : #{token[0]} '#{token[1].val}'\n" ) 237 else 238 print( "#{locale[0]}: line #{locale[1]} : EOF\n" ) 239 end 240 end 241 end 242 243 token 244 end 245 246 def on_error(t, v, vstack) 247 if v == "$" then 248 Generator.error( "B1003 Unexpected EOF" ) 249 else 250 Generator.error( "B1004 syntax error near \'$1\'" , v.val ) 251 end 252 253 end 254 255 def self.current_locale 256 @@current_locale[ @@generator_nest ] 257 end 258 259 @@n_error = 0 260 @@n_warning = 0 261 @@n_info = 0 262 263 # このメソッドは構文解析、意味解析からのみ呼出し可(コード生成でエラー発生は不適切) 264 def self.error( msg ) 265 @@n_error += 1 266 locale = @@current_locale[ @@generator_nest ] 267 268 if locale then 269 Console.puts "#{locale[0]}:#{locale[1]}: error: #{msg}" 270 else 271 Console.puts "error: #{msg}" 272 end 273 end 274 275 # このメソッドは構文解析、意味解析からのみ呼出し可(コード生成でウォーニング発生は不適切) 276 def self.warning( msg ) 277 @@n_warning += 1 278 locale = @@current_locale[ @@generator_nest ] 279 Console.puts "#{locale[0]}:#{locale[1]}: warning: #{msg}" 280 end 281 282 # このメソッドは構文解析、意味解析からのみ呼出し可 283 def self.info( msg ) 284 @@n_info += 1 285 locale = @@current_locale[ @@generator_nest ] 286 Console.puts "#{locale[0]}:#{locale[1]}: info: #{msg}" 287 end 288 289 def self.get_n_error 290 @@n_error 291 end 292 293 def self.get_n_warning 294 @@n_warning 295 end 296 297 def self.get_nest 298 @@generator_nest 299 end 300 301 def set_no_type_name b_no_type_name 302 locale = @@current_locale[ @@generator_nest ] 303 #print "b_no_type_name=#{b_no_type_name} #{locale[0]}: line #{locale[1]}\n" 304 @b_no_type_name = b_no_type_name 305 end 288 306 289 307 ...end C_parser.y.rb/module_eval... … … 291 309 292 310 clist = [ 293 '104,105,106,107,108,110,68,111,66,179,300,141,53,116,117,206,115,118', 294 '119,120,121,122,123,104,105,106,107,108,110,168,111,203,204,207,141', 295 '74,116,117,168,115,118,119,120,121,122,123,303,208,67,299,65,26,27,104', 296 '105,106,107,108,110,73,111,26,27,75,141,348,116,117,167,115,118,119', 297 '120,121,122,123,77,265,195,196,160,304,305,306,307,308,309,310,311,312', 298 '313,262,351,142,8,9,10,11,15,16,17,18,19,20,21,22,53,192,23,25,26,27', 299 '193,194,343,261,142,104,105,106,107,108,110,344,111,172,340,151,141', 300 '272,116,117,251,115,118,119,120,121,122,123,104,105,106,107,108,110', 301 '142,111,355,171,339,141,81,116,117,80,115,118,119,120,121,122,123,104', 302 '105,106,107,108,110,52,111,195,196,3,141,51,116,117,359,115,118,119', 303 '120,121,122,123,104,105,106,107,108,110,373,111,96,335,361,141,334,116', 304 '117,344,115,118,119,120,121,122,123,79,142,247,335,272,251,334,251,51', 305 '104,105,106,107,108,110,81,111,53,80,362,234,363,116,117,142,115,118', 306 '119,120,121,122,123,247,52,364,251,197,198,51,51,197,198,79,197,198', 307 '53,53,142,228,365,8,9,10,11,15,16,17,18,19,20,21,22,77,192,23,25,26', 308 '27,193,194,142,229,95,230,231,232,233,87,235,236,238,239,240,241,192', 309 '199,200,201,202,193,194,197,198,370,37,38,39,40,41,42,43,44,142,104', 310 '105,106,107,108,110,86,111,203,204,85,141,375,116,117,376,115,118,119', 311 '120,121,122,123,104,105,106,107,108,110,377,111,195,196,378,141,379', 312 '116,117,380,115,118,119,120,121,122,123,104,105,106,107,108,110,382', 313 '111,383,35,384,141,63,116,117,60,115,118,119,120,121,122,123,104,105', 314 '106,107,108,110,389,111,209,210,390,141,391,116,117,392,115,118,119', 315 '120,121,122,123,59,142,394,34,396,8,9,10,11,15,16,17,18,19,20,21,22', 316 '52,278,23,25,26,27,51,142,36,52,52,52,35,53,52,51,51,51,197,198,51,45', 317 '53,53,53,277,275,53,269,268,142,267,37,38,39,40,41,42,43,44,181,95,182', 318 '254,183,184,185,199,200,201,202,253,34,142,8,9,10,11,15,16,17,18,19', 319 '20,21,22,245,244,23,25,26,27,243,30,36,104,105,106,107,108,110,214,111', 320 '213,208,207,141,206,116,117,205,115,118,119,120,121,122,123,37,38,39', 321 '40,41,42,43,44,301,104,105,106,107,108,110,314,111,315,317,318,234,319', 322 '116,117,321,115,118,119,120,121,122,123,52,52,52,322,52,323,51,51,51', 323 '324,51,327,174,53,53,53,228,53,8,9,10,11,15,16,17,18,19,20,21,22,77', 324 '173,23,25,26,27,75,95,142,229,169,230,231,232,233,161,235,236,238,239', 325 '240,241,199,200,201,202,346,347,205,,,,37,38,39,40,41,42,43,44,142,104', 326 '105,106,107,108,110,,111,,,,141,,116,117,,115,118,119,120,121,122,123', 327 ',,104,105,106,107,108,110,,111,,,,234,,116,117,,115,118,119,120,121', 328 '122,123,,,,,,,,,,,,,,,,,228,,8,9,10,11,15,16,17,18,19,20,21,22,77,,23', 329 '25,26,27,,,,229,,230,231,232,233,142,235,236,238,239,240,241,,,,,,,', 330 ',,,37,38,39,40,41,42,43,44,142,104,105,106,107,108,110,,111,,,,234,', 331 '116,117,,115,118,119,120,121,122,123,,,,,,,,,,,,,,,,,228,,8,9,10,11', 332 '15,16,17,18,19,20,21,22,77,,23,25,26,27,,,,229,,230,231,232,233,,235', 333 '236,238,239,240,241,,,,,,,,,,,37,38,39,40,41,42,43,44,142,104,105,106', 334 '107,108,110,,111,,,,141,,116,117,,115,118,119,120,121,122,123,104,105', 335 '106,107,108,110,,111,,,,141,,116,117,,115,118,119,120,121,122,123,104', 336 '105,106,107,108,110,,111,,,,141,,116,117,,115,118,119,120,121,122,123', 337 '104,105,106,107,108,110,,111,,,,141,,116,117,,115,118,119,120,121,122', 338 '123,,142,,,,,,,,104,105,106,107,108,110,,111,,,,141,,116,117,142,115', 339 '118,119,120,121,122,123,104,105,106,107,108,110,,111,,366,,141,,116', 340 '117,142,115,118,119,120,121,122,123,,,,,,,,104,105,106,107,108,110,', 341 '111,142,,,234,,116,117,,115,118,119,120,121,122,123,,,,,,,,,,,,,,,,', 342 '228,142,8,9,10,11,15,16,17,18,19,20,21,22,77,,23,25,26,27,,,,229,142', 343 '230,231,232,233,,235,236,238,239,240,241,,,,,,,,,,,37,38,39,40,41,42', 344 '43,44,142,104,105,106,107,108,110,,111,,,,234,,116,117,,115,118,119', 345 '120,121,122,123,,,,,,,,,,,,,,,,,228,,8,9,10,11,15,16,17,18,19,20,21', 346 '22,77,,23,25,26,27,,,,229,,230,231,232,233,,235,236,238,239,240,241', 347 ',,,,,,,,,,37,38,39,40,41,42,43,44,142,104,105,106,107,108,110,,111,', 348 ',,234,,116,117,,115,118,119,120,121,122,123,,,,,,,,,,,,,,,,,228,,8,9', 349 '10,11,15,16,17,18,19,20,21,22,77,,23,25,26,27,,,,229,,230,231,232,233', 350 ',235,236,238,239,240,241,,,,,,,,,,,37,38,39,40,41,42,43,44,142,104,105', 351 '106,107,108,110,,111,,,,141,,116,117,,115,118,119,120,121,122,123,104', 352 '105,106,107,108,110,,111,,,,141,,116,117,,115,118,119,120,121,122,123', 353 '104,105,106,107,108,110,,111,,,,141,,116,117,,115,118,119,120,121,122', 354 '123,104,105,106,107,108,110,,111,,,,141,,116,117,,115,118,119,120,121', 355 '122,123,,142,,,,,,139,,,,,,140,104,105,106,107,108,110,,111,,145,142', 356 '141,,116,117,,115,118,119,120,121,122,123,104,105,106,107,108,110,,111', 357 ',,142,141,,116,117,,115,118,119,120,121,122,123,104,105,106,107,108', 358 '110,,111,,,142,141,,116,117,,115,118,119,120,121,122,123,104,105,106', 359 '107,108,110,,111,,,,141,,116,117,,115,118,119,120,121,122,123,,142,', 360 ',,,,,,104,105,106,107,108,110,,111,,,,141,,116,117,142,115,118,119,120', 361 '121,122,123,104,105,106,107,108,110,,111,,,,141,,116,117,142,115,118', 362 '119,120,121,122,123,104,105,106,107,108,110,,111,,,,141,,116,117,142', 363 '115,118,119,120,121,122,123,104,105,106,107,108,110,,111,,,,141,,116', 364 '117,,115,118,119,120,121,122,123,,142,,,,,,139,349,,,,,140,104,105,106', 365 '107,108,110,,111,,,142,141,,116,117,,115,118,119,120,121,122,123,104', 366 '105,106,107,108,110,,111,,,142,141,,116,117,,115,118,119,120,121,122', 367 '123,104,105,106,107,108,110,,111,,,142,141,,116,117,,115,118,119,120', 368 '121,122,123,104,105,106,107,108,110,,111,,,,141,,116,117,,115,118,119', 369 '120,121,122,123,,142,,,,,,,,104,105,106,107,108,110,,111,,,,141,,116', 370 '117,142,115,118,119,120,121,122,123,104,105,106,107,108,110,,111,,,', 371 '141,,116,117,142,115,118,119,120,121,122,123,104,105,106,107,108,110', 372 ',111,,,,141,,116,117,142,115,118,119,120,121,122,123,,,,,,,,,,104,105', 373 '106,107,108,110,,111,,,,234,,116,117,142,115,118,119,120,121,122,123', 374 ',,,,,,,,,,,,,,,142,228,,8,9,10,11,15,16,17,18,19,20,21,22,77,237,23', 375 '25,26,27,,,142,229,,230,231,232,233,,235,236,238,239,240,241,,,,,,,', 376 ',,,37,38,39,40,41,42,43,44,142,104,105,106,107,108,110,,111,,336,,141', 377 ',116,117,,115,118,119,120,121,122,123,104,105,106,107,108,110,,111,', 378 ',,141,,116,117,,115,118,119,120,121,122,123,8,9,10,11,15,16,17,18,19', 379 '20,21,22,,,23,25,26,27,8,9,10,11,15,16,17,18,19,20,21,22,,,23,25,26', 380 '27,,104,105,106,107,108,110,,111,,,142,141,,116,117,,115,118,119,120', 381 '121,122,123,104,105,106,107,108,110,,111,,,142,141,,116,117,,115,118', 382 '119,120,121,122,123,104,105,106,107,108,110,,111,,,,141,,116,117,,115', 383 '118,119,120,121,122,123,104,105,106,107,108,187,,111,,,,141,,116,117', 384 ',115,118,119,120,121,122,123,,142,,,,,,,,104,105,106,107,108,189,,111', 385 ',,,141,,116,117,142,115,118,119,120,121,122,123,104,105,106,107,108', 386 '189,,111,,,,141,,116,117,142,115,118,119,120,121,122,123,104,105,106', 387 '107,108,110,,111,,,,141,,116,117,142,115,118,119,120,121,122,123,104', 388 '105,106,107,108,110,,111,,,,141,,116,117,,115,118,119,120,121,122,123', 389 ',142,,,,,,139,,,,,,140,272,332,326,251,104,105,106,107,108,110,142,111', 390 ',53,,141,,116,117,,115,118,119,120,121,122,123,,,,,,,142,,,8,9,10,11', 391 '15,16,17,18,19,20,21,22,,,23,25,26,27,,,142,104,105,106,107,108,110', 392 ',111,,,,234,,116,117,,115,118,119,120,121,122,123,37,38,39,40,41,42', 393 '43,44,,,,,,,,,228,142,8,9,10,11,15,16,17,18,19,20,21,22,77,,23,25,26', 394 '27,,,,229,,230,231,232,233,,235,236,238,239,240,241,368,,,,,,,,,,37', 395 '38,39,40,41,42,43,44,142,247,332,,251,,,51,,,,,,,53,,,8,9,10,11,15,16', 396 '17,18,19,20,21,22,,,23,25,26,27,,,8,9,10,11,15,16,17,18,19,20,21,22', 397 ',,23,25,26,27,147,,,,,,37,38,39,40,41,42,43,44,,,,,,,,,328,,,,37,38', 398 '39,40,41,42,43,44,,8,9,10,11,15,16,17,18,19,20,21,22,,,23,25,26,27,8', 399 '9,10,11,15,16,17,18,19,20,21,22,,,23,25,26,27,,,,,,,,,37,38,39,40,41', 400 '42,43,44,,,,,,,,,,,37,38,39,40,41,42,43,44,8,9,10,11,15,16,17,18,19', 401 '20,21,22,,,23,25,26,27,8,9,10,11,15,16,17,18,19,20,21,22,,338,23,25', 402 '26,27,,,,,,,,,37,38,39,40,41,42,43,44,,,,,,,,,,,37,38,39,40,41,42,43', 403 '44,8,9,10,11,15,16,17,18,19,20,21,22,,162,23,25,26,27,8,9,10,11,15,16', 404 '17,18,19,20,21,22,,,23,25,26,27,,,,,,,,,37,38,39,40,41,42,43,44,,,,', 405 ',,,,,,37,38,39,40,41,42,43,44,8,9,10,11,15,16,17,18,19,20,21,22,,,23', 406 '25,26,27,8,9,10,11,15,16,17,18,19,20,21,22,,,23,25,26,27,,,,,,,,,37', 407 '38,39,40,41,42,43,44,,,,,,,,,,,37,38,39,40,41,42,43,44,8,9,10,11,15', 408 '16,17,18,19,20,21,22,,255,23,25,26,27,8,9,10,11,15,16,17,18,19,20,21', 409 '22,,,23,25,26,27,,,,,,,,,37,38,39,40,41,42,43,44,,,,,,,,,,,37,38,39', 410 '40,41,42,43,44,8,9,10,11,15,16,17,18,19,20,21,22,,260,23,25,26,27,8', 411 '9,10,11,15,16,17,18,19,20,21,22,,,23,25,26,27,,,,,,,,,37,38,39,40,41', 412 '42,43,44,,,,,,,,,,,37,38,39,40,41,42,43,44,8,9,10,11,15,16,17,18,19', 413 '20,21,22,,,23,25,26,27,8,9,10,11,15,16,17,18,19,20,21,22,,,23,25,26', 414 '27,,,,,,,,,37,38,39,40,41,42,43,44,8,9,10,11,15,16,17,18,19,20,21,22', 415 ',,23,25,26,27' ] 416 racc_action_table = arr = ::Array.new(2877, nil) 311 '111,112,113,114,115,117,294,118,56,298,55,163,54,123,124,82,54,262,122', 312 '125,126,127,128,129,130,111,112,113,114,115,117,217,118,271,391,101', 313 '163,91,123,124,82,271,271,122,125,126,127,128,129,130,56,70,171,72,82', 314 '69,397,71,80,32,33,34,224,309,271,223,216,226,84,227,228,229,84,392', 315 '101,325,272,171,298,312,80,164,165,172,393,173,174,175,176,177,178,179', 316 '180,149,181,101,218,79,308,369,388,32,33,34,265,266,164,165,172,73,173', 317 '174,175,176,177,178,179,180,149,181,111,112,113,114,115,117,384,118', 318 '32,33,34,163,78,123,124,82,440,402,122,125,126,127,128,129,130,55,219', 319 '271,271,383,101,54,332,248,325,387,55,298,249,250,56,382,54,111,112', 320 '113,114,115,117,56,118,56,171,331,163,395,123,124,82,276,210,122,125', 321 '126,127,128,129,130,420,55,378,210,248,377,396,54,330,249,250,393,92', 322 '164,165,172,56,173,174,175,176,177,178,179,180,149,181,171,9,10,11,12', 323 '13,14,15,16,17,18,19,20,21,22,26,28,30,31,32,33,34,35,36,37,38,355,356', 324 '213,164,165,172,204,173,174,175,176,177,178,179,180,149,181,111,112', 325 '113,114,115,117,404,118,93,378,203,163,377,123,124,82,193,271,122,125', 326 '126,127,128,129,130,111,112,113,114,115,117,290,118,101,86,55,163,85', 327 '123,124,82,54,291,122,125,126,127,128,129,130,56,357,171,13,14,15,16', 328 '17,18,19,20,21,22,26,28,30,31,32,33,34,248,86,322,438,85,249,250,171', 329 '434,435,370,164,165,172,271,173,174,175,176,177,178,179,180,149,181', 330 '259,260,261,321,255,256,257,258,315,316,262,164,165,172,271,173,174', 331 '175,176,177,178,179,180,149,181,111,112,113,114,115,117,403,118,317', 332 '318,263,163,264,123,124,82,320,271,122,125,126,127,128,129,130,13,14', 333 '15,16,17,18,19,20,21,22,26,28,30,31,32,33,34,437,111,112,113,114,115', 334 '117,360,118,400,171,271,163,368,123,124,82,166,103,122,125,126,127,128', 335 '129,130,102,55,255,256,257,258,310,54,255,256,257,258,405,164,165,172', 336 '56,173,174,175,176,177,178,179,180,149,181,171,9,10,11,12,13,14,15,16', 337 '17,18,19,20,21,22,26,28,30,31,32,33,34,35,36,37,38,259,260,301,164,165', 338 '172,300,173,174,175,176,177,178,179,180,149,181,111,112,113,114,115', 339 '117,408,118,253,254,292,163,409,123,124,82,253,254,122,125,126,127,128', 340 '129,130,111,112,113,114,115,117,410,118,253,254,55,163,289,123,124,82', 341 '54,288,122,125,126,127,128,129,130,56,415,171,13,14,15,16,17,18,19,20', 342 '21,22,26,28,30,31,32,33,34,253,254,253,254,251,252,261,171,211,212,285', 343 '164,165,172,284,173,174,175,176,177,178,179,180,149,181,237,238,239', 344 '240,241,242,243,244,245,246,247,164,165,172,283,173,174,175,176,177', 345 '178,179,180,149,181,111,112,113,114,115,117,282,118,251,252,389,163', 346 '389,123,124,82,251,252,122,125,126,127,128,129,130,111,112,113,114,115', 347 '117,101,118,67,82,55,163,64,123,124,82,54,63,122,125,126,127,128,129', 348 '130,56,55,171,55,55,294,280,54,298,54,54,54,279,430,431,432,56,433,56', 349 '56,56,365,436,278,263,275,264,171,273,270,48,164,165,172,444,173,174', 350 '175,176,177,178,179,180,149,181,269,3,,,,,,,,,,164,165,172,,173,174', 351 '175,176,177,178,179,180,149,181,111,112,113,114,115,117,,118,,,,163', 352 ',123,124,82,,,122,125,126,127,128,129,130,111,112,113,114,115,117,,118', 353 ',,,148,,123,124,,,,122,125,126,127,128,129,130,,,171,111,112,113,114', 354 '115,117,,118,,,,148,,123,124,,,,122,125,126,127,128,129,130,,,,164,165', 355 '172,,173,174,175,176,177,178,179,180,149,181,,,,,,,111,112,113,114,115', 356 '117,,118,,411,,148,,123,124,,,149,122,125,126,127,128,129,130,,,,111', 357 '112,113,114,115,117,,118,,,,148,,123,124,,,149,122,125,126,127,128,129', 358 '130,111,112,113,114,115,117,,118,,,,148,,123,124,,,,122,125,126,127', 359 '128,129,130,,,171,,,,,,,,,,,,,149,,111,112,113,114,115,117,,118,,,171', 360 '148,,123,124,,,,122,125,126,127,128,129,130,,149,,,,,,,,111,112,113', 361 '114,115,117,,118,,,,148,,123,124,146,398,149,122,125,126,127,128,129', 362 '130,111,112,113,114,115,117,,118,,,,148,,123,124,,,,122,125,126,127', 363 '128,129,130,111,112,113,114,115,117,,118,,149,,148,,123,124,389,,,122', 364 '125,126,127,128,129,130,,,,147,,,111,112,113,114,115,117,,118,,,,148', 365 '149,123,124,,,,122,125,126,127,128,129,130,111,112,113,114,115,117,', 366 '118,,379,,148,149,123,124,,,,122,125,126,127,128,129,130,,,,,,,,,,,', 367 ',149,,,,,111,112,113,114,115,117,,118,,,,148,,123,124,,,,122,125,126', 368 '127,128,129,130,,149,,,,,,,,,,,,,,,,,,,,,,,,,149,171,9,10,11,12,13,14', 369 '15,16,17,18,19,20,21,22,26,28,30,31,32,33,34,35,36,37,38,111,112,113', 370 '114,115,117,,118,,,,148,,123,124,149,,,122,125,126,127,128,129,130,111', 371 '112,113,114,115,117,,118,,,,148,,123,124,146,,,122,125,126,127,128,129', 372 '130,111,112,113,114,115,117,,118,,,,148,,123,124,,,,122,125,126,127', 373 '128,129,130,,111,112,113,114,115,117,,118,,,,148,,123,124,,,149,122', 374 '125,126,127,128,129,130,,,147,,,111,112,113,114,115,117,,118,,,,148', 375 '149,123,124,,,,122,125,126,127,128,129,130,111,112,113,114,115,117,', 376 '118,,,,148,149,123,124,,,,122,125,126,127,128,129,130,,111,112,113,114', 377 '115,117,,118,,,,148,149,123,124,,,,122,125,126,127,128,129,130,111,112', 378 '113,114,115,117,,118,,,,148,,123,124,146,,149,122,125,126,127,128,129', 379 '130,111,112,113,114,115,117,427,118,,,,148,,123,124,,,149,122,125,126', 380 '127,128,129,130,,111,112,113,114,115,117,,118,,,,148,,123,124,,,149', 381 '122,125,126,127,128,129,130,,,147,,,111,112,113,114,115,117,,118,,185', 382 ',148,149,123,124,,,,122,125,126,127,128,129,130,111,112,113,114,115', 383 '117,,118,,,,148,149,123,124,,,,122,125,126,127,128,129,130,,111,112', 384 '113,114,115,117,,118,,,,148,149,123,124,,,,122,125,126,127,128,129,130', 385 '111,112,113,114,115,117,,118,,,,148,,123,124,,,149,122,125,126,127,128', 386 '129,130,111,112,113,114,115,117,,118,,,,148,,123,124,,,149,122,125,126', 387 '127,128,129,130,,111,112,113,114,115,117,,118,,,,148,,123,124,,,149', 388 '122,125,126,127,128,129,130,111,112,113,114,115,117,,118,,,,148,,123', 389 '124,,,149,122,125,126,127,128,129,130,111,112,113,114,115,117,,118,', 390 ',,148,,123,124,,,149,122,125,126,127,128,129,130,,111,112,113,114,115', 391 '117,,118,,,,148,,123,124,,,149,122,125,126,127,128,129,130,111,112,113', 392 '114,115,117,,118,,,,148,,123,124,,,149,122,125,126,127,128,129,130,111', 393 '112,113,114,115,117,,118,,,,148,,123,124,,,149,122,125,126,127,128,129', 394 '130,,111,112,113,114,115,117,,118,,,,148,,123,124,,,149,122,125,126', 395 '127,128,129,130,111,112,113,114,115,117,,118,,,,148,,123,124,,,149,122', 396 '125,126,127,128,129,130,111,112,113,114,115,117,,118,,,,148,,123,124', 397 ',,149,122,125,126,127,128,129,130,,111,112,113,114,115,117,,118,,,,148', 398 ',123,124,,,149,122,125,126,127,128,129,130,111,112,113,114,115,117,', 399 '118,,,,148,,123,124,,,149,122,125,126,127,128,129,130,111,112,113,114', 400 '115,117,,118,,,,148,,123,124,146,,149,122,125,126,127,128,129,130,,111', 401 '112,113,114,115,117,,118,,,,148,,123,124,,,149,122,125,126,127,128,129', 402 '130,,,,,,,,,,,,,,,,,,149,,,,,,,,,,147,,,111,112,113,114,115,117,,118', 403 ',,,148,149,123,124,,,,122,125,126,127,128,129,130,,111,112,113,114,115', 404 '117,,118,,,,148,149,123,124,,,,122,125,126,127,128,129,130,,,,,,,13', 405 '14,15,16,17,18,19,20,21,22,26,28,30,31,32,33,34,,,111,112,113,114,115', 406 '117,,118,,,,148,,123,124,,,149,122,125,126,127,128,129,130,,111,112', 407 '113,114,115,231,,118,,,,148,,123,124,,,149,122,125,126,127,128,129,130', 408 '111,112,113,114,115,233,,118,,,,148,,123,124,,,,122,125,126,127,128', 409 '129,130,111,112,113,114,115,233,,118,,,,148,,123,124,,,149,122,125,126', 410 '127,128,129,130,,,,,,,,,,,,,111,112,113,114,115,117,149,118,,,,148,', 411 '123,124,,,,122,125,126,127,128,129,130,111,112,113,114,115,117,149,118', 412 ',,,148,,123,124,,,,122,125,126,127,128,129,130,,,,,,,149,13,14,15,16', 413 '17,18,19,20,21,22,26,28,30,31,32,33,34,,,111,112,113,114,115,117,,118', 414 ',,,148,,123,124,,,149,122,125,126,127,128,129,130,111,112,113,114,115', 415 '117,327,118,,,,148,,123,124,,,149,122,125,126,127,128,129,130,,,,,,', 416 ',13,14,15,16,17,18,19,20,21,22,26,28,30,31,32,33,34,,,111,112,113,114', 417 '115,117,,118,,,,148,,123,124,,,149,122,125,126,127,128,129,130,111,112', 418 '113,114,115,117,,118,,,,148,,123,124,,,149,122,125,126,127,128,129,130', 419 '111,112,113,114,115,117,,118,,,,148,,123,124,,,,122,125,126,127,128', 420 '129,130,,111,112,113,114,115,117,429,118,,,,148,,123,124,,,149,122,125', 421 '126,127,128,129,130,,287,,,,111,112,113,114,115,117,,118,,,,148,149', 422 '123,124,146,442,,122,125,126,127,128,129,130,111,112,113,114,115,117', 423 ',118,,,,148,149,123,124,,,,122,125,126,127,128,129,130,,111,112,113', 424 '114,115,117,,118,,,,148,149,123,124,,,,122,125,126,127,128,129,130,', 425 ',147,,,,,,,,,,,,,,46,149,,,,,,,,,,,,,,,,,,,,,,,,,149,,,46,,,,,,,,,,', 426 ',,,,,,,,,,,,149,45,9,10,11,12,13,14,15,16,17,18,19,20,21,22,26,28,30', 427 '31,32,33,34,35,36,37,38,,,47,45,9,10,11,12,13,14,15,16,17,18,19,20,21', 428 '22,26,28,30,31,32,33,34,35,36,37,38,,41,47,294,375,,298,,,54,,,,,,,', 429 ',56,,,,,,,,,,325,375,,298,,,,,,,,,,,,56,,,,,,,,9,10,11,12,13,14,15,16', 430 '17,18,19,20,21,22,26,28,30,31,32,33,34,35,36,37,38,9,10,11,12,13,14', 431 '15,16,17,18,19,20,21,22,26,28,30,31,32,33,34,35,36,37,38,188,,,,,192', 432 ',,,,,,,,,,,,,,,,,,,413,,,,,,,,,,,,,,,,,,,,,,9,10,11,12,13,14,15,16,17', 433 '18,19,20,21,22,26,28,30,31,32,33,34,35,36,37,38,9,10,11,12,13,14,15', 434 '16,17,18,19,20,21,22,26,28,30,31,32,33,34,35,36,37,38,371,9,10,11,12', 435 '13,14,15,16,17,18,19,20,21,22,26,28,30,31,32,33,34,35,36,37,38,,,,,', 436 '205,,,,,,,,,,,,9,10,11,12,13,14,15,16,17,18,19,20,21,22,26,28,30,31', 437 '32,33,34,35,36,37,38,9,10,11,12,13,14,15,16,17,18,19,20,21,22,26,28', 438 '30,31,32,33,34,35,36,37,38,307,,,,,,,,,,,,,,,,,,,,,,,,,381,,,,,,,,,', 439 ',,9,10,11,12,13,14,15,16,17,18,19,20,21,22,26,28,30,31,32,33,34,35,36', 440 '37,38,9,10,11,12,13,14,15,16,17,18,19,20,21,22,26,28,30,31,32,33,34', 441 '35,36,37,38,302,9,10,11,12,13,14,15,16,17,18,19,20,21,22,26,28,30,31', 442 '32,33,34,35,36,37,38,,,,,,,,,,,,9,10,11,12,13,14,15,16,17,18,19,20,21', 443 '22,26,28,30,31,32,33,34,35,36,37,38,9,10,11,12,13,14,15,16,17,18,19', 444 '20,21,22,26,28,30,31,32,33,34,35,36,37,38,9,10,11,12,13,14,15,16,17', 445 '18,19,20,21,22,26,28,30,31,32,33,34,35,36,37,38,9,10,11,12,13,14,15', 446 '16,17,18,19,20,21,22,26,28,30,31,32,33,34,35,36,37,38,9,10,11,12,13', 447 '14,15,16,17,18,19,20,21,22,26,28,30,31,32,33,34,35,36,37,38,9,10,11', 448 '12,13,14,15,16,17,18,19,20,21,22,26,28,30,31,32,33,34,35,36,37,38,9', 449 '10,11,12,13,14,15,16,17,18,19,20,21,22,26,28,30,31,32,33,34,35,36,37', 450 '38' ] 451 racc_action_table = arr = ::Array.new(3198, nil) 417 452 idx = 0 418 453 clist.each do |str| … … 424 459 425 460 clist = [ 426 '208,208,208,208,208,208,24,208,23,112,211,208,53,208,208,295,208,208', 427 '208,208,208,208,208,209,209,209,209,209,209,93,209,130,130,296,209,46', 428 '209,209,170,209,209,209,209,209,209,209,215,297,24,211,23,53,53,187', 429 '187,187,187,187,187,46,187,112,112,48,187,298,187,187,93,187,187,187', 430 '187,187,187,187,48,170,285,285,88,215,215,215,215,215,215,215,215,215', 431 '215,164,301,208,187,187,187,187,187,187,187,187,187,187,187,187,83,283', 432 '187,187,187,187,283,283,273,164,209,392,392,392,392,392,392,273,392', 433 '99,257,82,392,271,392,392,271,392,392,392,392,392,392,392,179,179,179', 434 '179,179,179,187,179,316,99,257,179,50,179,179,50,179,179,179,179,179', 435 '179,179,192,192,192,192,192,192,49,192,286,286,1,192,49,192,192,320', 436 '192,192,192,192,192,192,192,193,193,193,193,193,193,345,193,68,250,322', 437 '193,250,193,193,345,193,193,193,193,193,193,193,49,392,246,330,178,246', 438 '330,178,246,390,390,390,390,390,390,78,390,178,78,325,390,328,390,390', 439 '179,390,390,390,390,390,390,390,150,158,331,150,287,287,150,158,288', 440 '288,246,289,289,150,158,192,390,333,390,390,390,390,390,390,390,390', 441 '390,390,390,390,390,284,390,390,390,390,284,284,193,390,67,390,390,390', 442 '390,64,390,390,390,390,390,390,126,129,129,129,129,126,126,290,290,337', 443 '390,390,390,390,390,390,390,390,390,379,379,379,379,379,379,62,379,293', 444 '293,61,379,352,379,379,353,379,379,379,379,379,379,379,378,378,378,378', 445 '378,378,354,378,127,127,355,378,356,378,378,357,378,378,378,378,378', 446 '378,378,194,194,194,194,194,194,363,194,367,30,369,194,22,194,194,14', 447 '194,194,194,194,194,194,194,195,195,195,195,195,195,380,195,135,135', 448 '385,195,387,195,195,388,195,195,195,195,195,195,195,12,379,391,30,395', 449 '30,30,30,30,30,30,30,30,30,30,30,30,92,183,30,30,30,30,92,378,30,262', 450 '74,4,2,92,72,262,74,4,128,128,72,3,262,74,4,182,180,72,176,175,194,173', 451 '30,30,30,30,30,30,30,30,113,168,113,155,113,113,113,291,291,291,291', 452 '154,2,195,2,2,2,2,2,2,2,2,2,2,2,2,148,146,2,2,2,2,144,2,2,196,196,196', 453 '196,196,196,142,196,140,134,133,196,132,196,196,131,196,196,196,196', 454 '196,196,196,2,2,2,2,2,2,2,2,213,377,377,377,377,377,377,229,377,230', 455 '232,233,377,234,377,377,236,377,377,377,377,377,377,377,340,216,172', 456 '238,52,239,340,216,172,240,52,242,109,340,216,172,377,52,377,377,377', 457 '377,377,377,377,377,377,377,377,377,377,103,377,377,377,377,102,96,196', 458 '377,95,377,377,377,377,89,377,377,377,377,377,377,292,292,292,292,276', 459 '279,294,,,,377,377,377,377,377,377,377,377,377,169,169,169,169,169,169', 460 ',169,,,,169,,169,169,,169,169,169,169,169,169,169,,,376,376,376,376', 461 '376,376,,376,,,,376,,376,376,,376,376,376,376,376,376,376,,,,,,,,,,', 462 ',,,,,,376,,376,376,376,376,376,376,376,376,376,376,376,376,376,,376', 463 '376,376,376,,,,376,,376,376,376,376,169,376,376,376,376,376,376,,,,', 464 ',,,,,,376,376,376,376,376,376,376,376,376,359,359,359,359,359,359,,359', 465 ',,,359,,359,359,,359,359,359,359,359,359,359,,,,,,,,,,,,,,,,,359,,359', 466 '359,359,359,359,359,359,359,359,359,359,359,359,,359,359,359,359,,,', 467 '359,,359,359,359,359,,359,359,359,359,359,359,,,,,,,,,,,359,359,359', 468 '359,359,359,359,359,359,197,197,197,197,197,197,,197,,,,197,,197,197', 469 ',197,197,197,197,197,197,197,348,348,348,348,348,348,,348,,,,348,,348', 470 '348,,348,348,348,348,348,348,348,344,344,344,344,344,344,,344,,,,344', 471 ',344,344,,344,344,344,344,344,344,344,189,189,189,189,189,189,,189,', 472 ',,189,,189,189,,189,189,189,189,189,189,189,,197,,,,,,,,198,198,198', 473 '198,198,198,,198,,,,198,,198,198,348,198,198,198,198,198,198,198,334', 474 '334,334,334,334,334,,334,,334,,334,,334,334,344,334,334,334,334,334', 475 '334,334,,,,,,,,321,321,321,321,321,321,,321,189,,,321,,321,321,,321', 476 '321,321,321,321,321,321,,,,,,,,,,,,,,,,,321,198,321,321,321,321,321', 477 '321,321,321,321,321,321,321,321,,321,321,321,321,,,,321,334,321,321', 478 '321,321,,321,321,321,321,321,321,,,,,,,,,,,321,321,321,321,321,321,321', 479 '321,321,319,319,319,319,319,319,,319,,,,319,,319,319,,319,319,319,319', 480 '319,319,319,,,,,,,,,,,,,,,,,319,,319,319,319,319,319,319,319,319,319', 481 '319,319,319,319,,319,319,319,319,,,,319,,319,319,319,319,,319,319,319', 482 '319,319,319,,,,,,,,,,,319,319,319,319,319,319,319,319,319,396,396,396', 483 '396,396,396,,396,,,,396,,396,396,,396,396,396,396,396,396,396,,,,,,', 484 ',,,,,,,,,,396,,396,396,396,396,396,396,396,396,396,396,396,396,396,', 485 '396,396,396,396,,,,396,,396,396,396,396,,396,396,396,396,396,396,,,', 486 ',,,,,,,396,396,396,396,396,396,396,396,396,318,318,318,318,318,318,', 487 '318,,,,318,,318,318,,318,318,318,318,318,318,318,317,317,317,317,317', 488 '317,,317,,,,317,,317,317,,317,317,317,317,317,317,317,75,75,75,75,75', 489 '75,,75,,,,75,,75,75,,75,75,75,75,75,75,75,315,315,315,315,315,315,,315', 490 ',,,315,,315,315,,315,315,315,315,315,315,315,,318,,,,,,75,,,,,,75,80', 491 '80,80,80,80,80,,80,,80,317,80,,80,80,,80,80,80,80,80,80,80,181,181,181', 492 '181,181,181,,181,,,75,181,,181,181,,181,181,181,181,181,181,181,314', 493 '314,314,314,314,314,,314,,,315,314,,314,314,,314,314,314,314,314,314', 494 '314,302,302,302,302,302,302,,302,,,,302,,302,302,,302,302,302,302,302', 495 '302,302,,80,,,,,,,,199,199,199,199,199,199,,199,,,,199,,199,199,181', 496 '199,199,199,199,199,199,199,200,200,200,200,200,200,,200,,,,200,,200', 497 '200,314,200,200,200,200,200,200,200,300,300,300,300,300,300,,300,,,', 498 '300,,300,300,302,300,300,300,300,300,300,300,275,275,275,275,275,275', 499 ',275,,,,275,,275,275,,275,275,275,275,275,275,275,,199,,,,,,300,300', 500 ',,,,300,201,201,201,201,201,201,,201,,,200,201,,201,201,,201,201,201', 501 '201,201,201,201,207,207,207,207,207,207,,207,,,300,207,,207,207,,207', 502 '207,207,207,207,207,207,210,210,210,210,210,210,,210,,,275,210,,210', 503 '210,,210,210,210,210,210,210,210,202,202,202,202,202,202,,202,,,,202', 504 ',202,202,,202,202,202,202,202,202,202,,201,,,,,,,,269,269,269,269,269', 505 '269,,269,,,,269,,269,269,207,269,269,269,269,269,269,269,203,203,203', 506 '203,203,203,,203,,,,203,,203,203,210,203,203,203,203,203,203,203,204', 507 '204,204,204,204,204,,204,,,,204,,204,204,202,204,204,204,204,204,204', 508 '204,,,,,,,,,,143,143,143,143,143,143,,143,,,,143,,143,143,269,143,143', 509 '143,143,143,143,143,,,,,,,,,,,,,,,,203,143,,143,143,143,143,143,143', 510 '143,143,143,143,143,143,143,143,143,143,143,143,,,204,143,,143,143,143', 511 '143,,143,143,143,143,143,143,,,,,,,,,,,143,143,143,143,143,143,143,143', 512 '143,251,251,251,251,251,251,,251,,251,,251,,251,251,,251,251,251,251', 513 '251,251,251,110,110,110,110,110,110,,110,,,,110,,110,110,,110,110,110', 514 '110,110,110,110,70,70,70,70,70,70,70,70,70,70,70,70,,,70,70,70,70,110', 515 '110,110,110,110,110,110,110,110,110,110,110,,,110,110,110,110,,205,205', 516 '205,205,205,205,,205,,,251,205,,205,205,,205,205,205,205,205,205,205', 517 '206,206,206,206,206,206,,206,,,110,206,,206,206,,206,206,206,206,206', 518 '206,206,114,114,114,114,114,114,,114,,,,114,,114,114,,114,114,114,114', 519 '114,114,114,115,115,115,115,115,115,,115,,,,115,,115,115,,115,115,115', 520 '115,115,115,115,,205,,,,,,,,116,116,116,116,116,116,,116,,,,116,,116', 521 '116,206,116,116,116,116,116,116,116,117,117,117,117,117,117,,117,,,', 522 '117,,117,117,114,117,117,117,117,117,117,117,139,139,139,139,139,139', 523 ',139,,,,139,,139,139,115,139,139,139,139,139,139,139,241,241,241,241', 524 '241,241,,241,,,,241,,241,241,,241,241,241,241,241,241,241,,116,,,,,', 525 '139,,,,,,139,272,272,241,272,235,235,235,235,235,235,117,235,,272,,235', 526 ',235,235,,235,235,235,235,235,235,235,,,,,,,139,,,272,272,272,272,272', 527 '272,272,272,272,272,272,272,,,272,272,272,272,,,241,231,231,231,231', 528 '231,231,,231,,,,231,,231,231,,231,231,231,231,231,231,231,272,272,272', 529 '272,272,272,272,272,,,,,,,,,231,235,231,231,231,231,231,231,231,231', 530 '231,231,231,231,231,,231,231,231,231,,,,231,,231,231,231,231,,231,231', 531 '231,231,231,231,335,,,,,,,,,,231,231,231,231,231,231,231,231,231,247', 532 '247,,247,,,247,,,,,,,247,,,335,335,335,335,335,335,335,335,335,335,335', 533 '335,,,335,335,335,335,,,247,247,247,247,247,247,247,247,247,247,247', 534 '247,,,247,247,247,247,81,,,,,,335,335,335,335,335,335,335,335,,,,,,', 535 ',,245,,,,247,247,247,247,247,247,247,247,,81,81,81,81,81,81,81,81,81', 536 '81,81,81,,,81,81,81,81,245,245,245,245,245,245,245,245,245,245,245,245', 537 ',,245,245,245,245,,,,,,,,,81,81,81,81,81,81,81,81,,,,,,,,,,,245,245', 538 '245,245,245,245,245,245,5,5,5,5,5,5,5,5,5,5,5,5,,,5,5,5,5,252,252,252', 539 '252,252,252,252,252,252,252,252,252,,252,252,252,252,252,,,,,,,,,5,5', 540 '5,5,5,5,5,5,,,,,,,,,,,252,252,252,252,252,252,252,252,90,90,90,90,90', 541 '90,90,90,90,90,90,90,,90,90,90,90,90,153,153,153,153,153,153,153,153', 542 '153,153,153,153,,,153,153,153,153,,,,,,,,,90,90,90,90,90,90,90,90,,', 543 ',,,,,,,,153,153,153,153,153,153,153,153,87,87,87,87,87,87,87,87,87,87', 544 '87,87,,,87,87,87,87,86,86,86,86,86,86,86,86,86,86,86,86,,,86,86,86,86', 545 ',,,,,,,,87,87,87,87,87,87,87,87,,,,,,,,,,,86,86,86,86,86,86,86,86,156', 546 '156,156,156,156,156,156,156,156,156,156,156,,156,156,156,156,156,65', 547 '65,65,65,65,65,65,65,65,65,65,65,,,65,65,65,65,,,,,,,,,156,156,156,156', 548 '156,156,156,156,,,,,,,,,,,65,65,65,65,65,65,65,65,159,159,159,159,159', 549 '159,159,159,159,159,159,159,,159,159,159,159,159,7,7,7,7,7,7,7,7,7,7', 550 '7,7,,,7,7,7,7,,,,,,,,,159,159,159,159,159,159,159,159,,,,,,,,,,,7,7', 551 '7,7,7,7,7,7,6,6,6,6,6,6,6,6,6,6,6,6,,,6,6,6,6,36,36,36,36,36,36,36,36', 552 '36,36,36,36,,,36,36,36,36,,,,,,,,,6,6,6,6,6,6,6,6,71,71,71,71,71,71', 553 '71,71,71,71,71,71,,,71,71,71,71' ] 554 racc_action_check = arr = ::Array.new(2877, nil) 461 '440,440,440,440,440,440,293,440,56,293,52,440,293,440,440,440,52,139', 462 '440,440,440,440,440,440,440,438,438,438,438,438,438,106,438,354,326', 463 '103,438,65,438,438,438,151,326,438,438,438,438,438,438,438,88,29,440', 464 '31,51,29,354,31,109,56,56,56,120,207,286,120,106,120,293,120,120,120', 465 '52,328,212,324,151,438,324,212,51,440,440,440,328,440,440,440,440,440', 466 '440,440,440,440,440,318,110,49,207,286,318,88,88,88,142,142,438,438', 467 '438,31,438,438,438,438,438,438,438,438,438,438,436,436,436,436,436,436', 468 '304,436,120,120,120,436,49,436,436,436,428,362,436,436,436,436,436,436', 469 '436,98,116,428,362,304,316,98,227,340,222,316,309,222,340,340,98,304', 470 '309,167,167,167,167,167,167,222,167,309,436,226,167,333,167,167,167', 471 '167,98,167,167,167,167,167,167,167,394,4,297,309,339,297,334,4,225,339', 472 '339,394,66,436,436,436,4,436,436,436,436,436,436,436,436,436,436,167', 473 '167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167', 474 '167,167,167,167,167,167,167,167,267,267,101,167,167,167,95,167,167,167', 475 '167,167,167,167,167,167,167,429,429,429,429,429,429,364,429,68,373,94', 476 '429,373,429,429,429,87,364,429,429,429,429,429,429,429,427,427,427,427', 477 '427,427,187,427,71,83,217,427,83,427,427,427,217,187,427,427,427,427', 478 '427,427,427,217,269,429,75,75,75,75,75,75,75,75,75,75,75,75,75,75,75', 479 '75,75,133,53,221,426,53,133,133,427,418,418,291,429,429,429,426,429', 480 '429,429,429,429,429,429,429,429,429,137,137,350,220,136,136,136,136', 481 '214,214,351,427,427,427,220,427,427,427,427,427,427,427,427,427,427', 482 '175,175,175,175,175,175,363,175,215,215,352,175,353,175,175,175,218', 483 '363,175,175,175,175,175,175,175,76,76,76,76,76,76,76,76,76,76,76,76', 484 '76,76,76,76,76,425,82,82,82,82,82,82,274,82,357,175,425,82,283,82,82', 485 '82,82,73,82,82,82,82,82,82,82,72,201,347,347,347,347,209,201,348,348', 486 '348,348,365,175,175,175,201,175,175,175,175,175,175,175,175,175,175', 487 '82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82', 488 '82,82,82,349,349,198,82,82,82,197,82,82,82,82,82,82,82,82,82,82,273', 489 '273,273,273,273,273,371,273,135,135,189,273,374,273,273,273,346,346', 490 '273,273,273,273,273,273,273,404,404,404,404,404,404,376,404,345,345', 491 '79,404,186,404,404,404,79,184,404,404,404,404,404,404,404,79,380,273', 492 '47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,344,344,343,343,342', 493 '342,138,404,99,99,179,273,273,273,178,273,273,273,273,273,273,273,273', 494 '273,273,131,131,131,131,131,131,131,131,131,131,131,404,404,404,177', 495 '404,404,404,404,404,404,404,404,404,404,402,402,402,402,402,402,176', 496 '402,341,341,395,402,396,402,402,402,134,134,402,402,402,402,402,402', 497 '402,275,275,275,275,275,275,102,275,27,403,77,275,25,275,275,275,77', 498 '23,275,275,275,275,275,275,275,77,55,402,152,384,191,174,55,191,152', 499 '384,191,173,408,412,414,55,416,152,384,191,281,422,172,140,165,141,275', 500 '163,149,3,402,402,402,437,402,402,402,402,402,402,402,402,402,402,147', 501 '1,,,,,,,,,,275,275,275,,275,275,275,275,275,275,275,275,275,275,360', 502 '360,360,360,360,360,,360,,,,360,,360,360,360,,,360,360,360,360,360,360', 503 '360,249,249,249,249,249,249,,249,,,,249,,249,249,,,,249,249,249,249', 504 '249,249,249,,,360,383,383,383,383,383,383,,383,,,,383,,383,383,,,,383', 505 '383,383,383,383,383,383,,,,360,360,360,,360,360,360,360,360,360,360', 506 '360,360,360,,,,,,,377,377,377,377,377,377,,377,,377,,377,,377,377,,', 507 '249,377,377,377,377,377,377,377,,,,367,367,367,367,367,367,,367,,,,367', 508 ',367,367,,,383,367,367,367,367,367,367,367,366,366,366,366,366,366,', 509 '366,,,,366,,366,366,,,,366,366,366,366,366,366,366,,,367,,,,,,,,,,,', 510 ',377,,393,393,393,393,393,393,,393,,,366,393,,393,393,,,,393,393,393', 511 '393,393,393,393,,367,,,,,,,,356,356,356,356,356,356,,356,,,,356,,356', 512 '356,356,356,366,356,356,356,356,356,356,356,330,330,330,330,330,330', 513 ',330,,,,330,,330,330,,,,330,330,330,330,330,330,330,322,322,322,322', 514 '322,322,,322,,393,,322,,322,322,322,,,322,322,322,322,322,322,322,,', 515 ',356,,,310,310,310,310,310,310,,310,,,,310,356,310,310,,,,310,310,310', 516 '310,310,310,310,298,298,298,298,298,298,,298,,298,,298,330,298,298,', 517 ',,298,298,298,298,298,298,298,,,,,,,,,,,,,322,,,,,282,282,282,282,282', 518 '282,,282,,,,282,,282,282,,,,282,282,282,282,282,282,282,,310,,,,,,,', 519 ',,,,,,,,,,,,,,,,,298,282,282,282,282,282,282,282,282,282,282,282,282', 520 '282,282,282,282,282,282,282,282,282,282,282,282,282,282,280,280,280', 521 '280,280,280,,280,,,,280,,280,280,282,,,280,280,280,280,280,280,280,146', 522 '146,146,146,146,146,,146,,,,146,,146,146,146,,,146,146,146,146,146,146', 523 '146,278,278,278,278,278,278,,278,,,,278,,278,278,,,,278,278,278,278', 524 '278,278,278,,397,397,397,397,397,397,,397,,,,397,,397,397,,,280,397', 525 '397,397,397,397,397,397,,,146,,,405,405,405,405,405,405,,405,,,,405', 526 '146,405,405,,,,405,405,405,405,405,405,405,271,271,271,271,271,271,', 527 '271,,,,271,278,271,271,,,,271,271,271,271,271,271,271,,266,266,266,266', 528 '266,266,,266,,,,266,397,266,266,,,,266,266,266,266,266,266,266,80,80', 529 '80,80,80,80,,80,,,,80,,80,80,80,,405,80,80,80,80,80,80,80,406,406,406', 530 '406,406,406,406,406,,,,406,,406,406,,,271,406,406,406,406,406,406,406', 531 ',265,265,265,265,265,265,,265,,,,265,,265,265,,,266,265,265,265,265', 532 '265,265,265,,,80,,,85,85,85,85,85,85,,85,,85,,85,80,85,85,,,,85,85,85', 533 '85,85,85,85,264,264,264,264,264,264,,264,,,,264,406,264,264,,,,264,264', 534 '264,264,264,264,264,,263,263,263,263,263,263,,263,,,,263,265,263,263', 535 ',,,263,263,263,263,263,263,263,262,262,262,262,262,262,,262,,,,262,', 536 '262,262,,,85,262,262,262,262,262,262,262,261,261,261,261,261,261,,261', 537 ',,,261,,261,261,,,264,261,261,261,261,261,261,261,,260,260,260,260,260', 538 '260,,260,,,,260,,260,260,,,263,260,260,260,260,260,260,260,259,259,259', 539 '259,259,259,,259,,,,259,,259,259,,,262,259,259,259,259,259,259,259,258', 540 '258,258,258,258,258,,258,,,,258,,258,258,,,261,258,258,258,258,258,258', 541 '258,,257,257,257,257,257,257,,257,,,,257,,257,257,,,260,257,257,257', 542 '257,257,257,257,256,256,256,256,256,256,,256,,,,256,,256,256,,,259,256', 543 '256,256,256,256,256,256,255,255,255,255,255,255,,255,,,,255,,255,255', 544 ',,258,255,255,255,255,255,255,255,,254,254,254,254,254,254,,254,,,,254', 545 ',254,254,,,257,254,254,254,254,254,254,254,253,253,253,253,253,253,', 546 '253,,,,253,,253,253,,,256,253,253,253,253,253,253,253,252,252,252,252', 547 '252,252,,252,,,,252,,252,252,,,255,252,252,252,252,252,252,252,,251', 548 '251,251,251,251,251,,251,,,,251,,251,251,,,254,251,251,251,251,251,251', 549 '251,250,250,250,250,250,250,,250,,,,250,,250,250,,,253,250,250,250,250', 550 '250,250,250,389,389,389,389,389,389,,389,,,,389,,389,389,389,,252,389', 551 '389,389,389,389,389,389,,248,248,248,248,248,248,,248,,,,248,,248,248', 552 ',,251,248,248,248,248,248,248,248,,,,,,,,,,,,,,,,,,250,,,,,,,,,,389', 553 ',,117,117,117,117,117,117,,117,,,,117,389,117,117,,,,117,117,117,117', 554 '117,117,117,,236,236,236,236,236,236,,236,,,,236,248,236,236,,,,236', 555 '236,236,236,236,236,236,,,,,,,117,117,117,117,117,117,117,117,117,117', 556 '117,117,117,117,117,117,117,,,121,121,121,121,121,121,,121,,,,121,,121', 557 '121,,,117,121,121,121,121,121,121,121,,122,122,122,122,122,122,,122', 558 ',,,122,,122,122,,,236,122,122,122,122,122,122,122,123,123,123,123,123', 559 '123,,123,,,,123,,123,123,,,,123,123,123,123,123,123,123,124,124,124', 560 '124,124,124,,124,,,,124,,124,124,,,121,124,124,124,124,124,124,124,', 561 ',,,,,,,,,,,233,233,233,233,233,233,122,233,,,,233,,233,233,,,,233,233', 562 '233,233,233,233,233,223,223,223,223,223,223,123,223,,,,223,,223,223', 563 ',,,223,223,223,223,223,223,223,,,,,,,124,233,233,233,233,233,233,233', 564 '233,233,233,233,233,233,233,233,233,233,,,231,231,231,231,231,231,,231', 565 ',,,231,,231,231,,,233,231,231,231,231,231,231,231,224,224,224,224,224', 566 '224,224,224,,,,224,,224,224,,,223,224,224,224,224,224,224,224,,,,,,', 567 ',231,231,231,231,231,231,231,231,231,231,231,231,231,231,231,231,231', 568 ',,213,213,213,213,213,213,,213,,,,213,,213,213,,,231,213,213,213,213', 569 '213,213,213,210,210,210,210,210,210,,210,,,,210,,210,210,,,224,210,210', 570 '210,210,210,210,210,180,180,180,180,180,180,,180,,,,180,,180,180,,,', 571 '180,180,180,180,180,180,180,,407,407,407,407,407,407,407,407,,,,407', 572 ',407,407,,,213,407,407,407,407,407,407,407,,180,,,,435,435,435,435,435', 573 '435,,435,,,,435,210,435,435,435,435,,435,435,435,435,435,435,435,164', 574 '164,164,164,164,164,,164,,,,164,180,164,164,,,,164,164,164,164,164,164', 575 '164,,279,279,279,279,279,279,,279,,,,279,407,279,279,,,,279,279,279', 576 '279,279,279,279,,,435,,,,,,,,,,,,,,41,435,,,,,,,,,,,,,,,,,,,,,,,,,164', 577 ',,2,,,,,,,,,,,,,,,,,,,,,,,279,41,41,41,41,41,41,41,41,41,41,41,41,41', 578 '41,41,41,41,41,41,41,41,41,41,41,41,41,,,41,2,2,2,2,2,2,2,2,2,2,2,2', 579 '2,2,2,2,2,2,2,2,2,2,2,2,2,2,,2,2,294,294,,294,,,294,,,,,,,,,294,,,,', 580 ',,,,,325,325,,325,,,,,,,,,,,,325,,,,,,,,294,294,294,294,294,294,294', 581 '294,294,294,294,294,294,294,294,294,294,294,294,294,294,294,294,294', 582 '294,325,325,325,325,325,325,325,325,325,325,325,325,325,325,325,325', 583 '325,325,325,325,325,325,325,325,325,86,,,,,86,,,,,,,,,,,,,,,,,,,,378', 584 ',,,,,,,,,,,,,,,,,,,,,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86', 585 '86,86,86,86,86,86,86,86,86,378,378,378,378,378,378,378,378,378,378,378', 586 '378,378,378,378,378,378,378,378,378,378,378,378,378,378,292,7,7,7,7', 587 '7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,,,,,,96,,,,,,,,,,,,292,292', 588 '292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292', 589 '292,292,292,292,292,292,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96', 590 '96,96,96,96,96,96,96,96,96,96,202,,,,,,,,,,,,,,,,,,,,,,,,,299,,,,,,', 591 ',,,,,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202', 592 '202,202,202,202,202,202,202,202,202,299,299,299,299,299,299,299,299', 593 '299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299', 594 '199,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92', 595 '92,92,92,,,,,,,,,,,,199,199,199,199,199,199,199,199,199,199,199,199', 596 '199,199,199,199,199,199,199,199,199,199,199,199,199,8,8,8,8,8,8,8,8', 597 '8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,196,196,196,196,196,196,196,196,196', 598 '196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,6,6', 599 '6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5', 600 '5,5,5,5,5,5,5,5,5,5,5,5,5,5,93,93,93,93,93,93,93,93,93,93,93,93,93,93', 601 '93,93,93,93,93,93,93,93,93,93,93,69,69,69,69,69,69,69,69,69,69,69,69', 602 '69,69,69,69,69,69,69,69,69,69,69,69,69' ] 603 racc_action_check = arr = ::Array.new(3198, nil) 555 604 idx = 0 556 605 clist.each do |str| … … 562 611 563 612 racc_action_pointer = [ 564 nil, 173, 432, 442, 425, 2414, 2764, 2712, nil, nil, 565 nil, nil, 363, nil, 332, nil, nil, nil, nil, nil, 566 nil, nil, 357, -5, -7, nil, nil, nil, nil, nil, 567 366, nil, nil, nil, nil, nil, 2782, nil, nil, nil, 568 nil, nil, nil, nil, nil, nil, 18, nil, 21, 162, 569 145, nil, 548, -8, nil, nil, nil, nil, nil, nil, 570 nil, 267, 263, nil, 231, 2642, nil, 268, 139, nil, 571 1860, 2816, 428, nil, 424, 1315, nil, nil, 217, nil, 572 1375, 2344, 119, 86, nil, nil, 2572, 2554, 39, 555, 573 2484, nil, 414, 12, nil, 549, 575, nil, nil, 108, 574 nil, nil, 545, 487, nil, nil, nil, nil, nil, 554, 575 1878, nil, 2, 451, 1984, 2007, 2039, 2062, nil, nil, 576 nil, nil, nil, nil, nil, nil, 273, 322, 412, 265, 577 -2, 492, 473, 470, 468, 351, nil, nil, nil, 2085, 578 497, nil, 489, 1761, 482, nil, 480, nil, 470, nil, 579 234, nil, nil, 2502, 431, 423, 2624, nil, 235, 2694, 580 nil, nil, nil, nil, 74, nil, nil, nil, 449, 620, 581 21, nil, 546, 439, nil, 442, 441, nil, 206, 138, 582 440, 1398, 433, 409, nil, nil, nil, 51, nil, 902, 583 nil, nil, 161, 184, 356, 379, 494, 833, 934, 1476, 584 1499, 1582, 1651, 1706, 1729, 1938, 1961, 1605, -2, 21, 585 1628, -7, nil, 518, nil, 4, 545, nil, nil, nil, 586 nil, nil, nil, nil, nil, nil, nil, nil, nil, 527, 587 529, 2202, 530, 531, 500, 2149, 503, nil, 541, 515, 588 519, 2108, 521, nil, nil, 2362, 204, 2291, nil, nil, 589 188, 1855, 2432, nil, nil, nil, nil, 109, nil, nil, 590 nil, nil, 423, nil, nil, nil, nil, nil, nil, 1683, 591 nil, 122, 2140, 106, nil, 1545, 596, nil, nil, 600, 592 nil, nil, nil, 87, 252, 57, 150, 218, 222, 225, 593 273, 439, 574, 287, 590, -20, -3, 10, 25, nil, 594 1522, 84, 1444, nil, nil, nil, nil, nil, nil, nil, 595 nil, nil, nil, nil, 1421, 1338, 82, 1292, 1269, 1081, 596 138, 987, 155, nil, nil, 187, nil, nil, 218, nil, 597 205, 235, nil, 250, 957, 2271, nil, 291, nil, nil, 598 544, nil, nil, nil, 879, 184, nil, nil, 856, nil, 599 nil, nil, 283, 319, 333, 338, 306, 342, nil, 739, 600 nil, nil, nil, 352, nil, nil, nil, 355, nil, 360, 601 nil, nil, nil, nil, nil, nil, 645, 526, 333, 310, 602 317, nil, nil, nil, nil, 326, nil, 385, 355, nil, 603 216, 365, 115, nil, nil, 400, 1175, nil ] 613 nil, 732, 2528, 716, 182, 3068, 3043, 2752, 2993, nil, 614 nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 615 nil, nil, nil, 624, nil, 619, nil, 656, nil, 38, 616 nil, 40, nil, nil, nil, nil, nil, nil, nil, nil, 617 nil, 2499, nil, nil, nil, nil, nil, 510, nil, 78, 618 nil, 37, 3, 322, nil, 680, -14, nil, nil, nil, 619 nil, nil, nil, nil, nil, 20, 183, nil, 249, 3118, 620 nil, 278, 429, 421, nil, 252, 344, 664, nil, 544, 621 1392, nil, 419, 285, nil, 1473, 2701, 266, 28, nil, 622 nil, nil, 2932, 3093, 214, 193, 2819, nil, 138, 576, 623 nil, 200, 654, 22, nil, nil, 12, nil, nil, 15, 624 1, nil, nil, nil, nil, nil, 137, 1959, nil, nil, 625 55, 2035, 2061, 2086, 2111, nil, nil, nil, nil, nil, 626 nil, 568, nil, 306, 629, 495, 326, 318, 571, -20, 627 672, 673, 64, nil, nil, nil, 1235, 724, nil, 702, 628 nil, 22, 682, nil, nil, nil, nil, nil, nil, nil, 629 nil, nil, nil, 672, 2431, 669, nil, 161, nil, nil, 630 nil, nil, 702, 691, 685, 376, 635, 612, 546, 542, 631 2350, nil, nil, nil, 547, nil, 545, 281, nil, 507, 632 nil, 684, nil, nil, nil, nil, 3018, 451, 447, 2968, 633 nil, 440, 2881, nil, nil, nil, nil, 44, nil, 410, 634 2325, nil, 61, 2300, 343, 368, nil, 286, 381, nil, 635 348, 322, 147, 2173, 2249, 189, 160, 139, nil, nil, 636 nil, 2224, nil, 2148, nil, nil, 1985, nil, nil, nil, 637 nil, nil, nil, nil, nil, nil, nil, nil, 1904, 779, 638 1853, 1828, 1802, 1777, 1752, 1726, 1701, 1676, 1650, 1625, 639 1600, 1574, 1549, 1524, 1498, 1443, 1367, 223, nil, 300, 640 nil, 1341, nil, 514, 385, 659, nil, nil, 1260, 2457, 641 1210, 619, 1132, 379, nil, nil, 45, nil, nil, nil, 642 nil, 325, 2794, -1, 2604, nil, nil, 183, 1090, 2906, 643 nil, nil, nil, nil, 107, nil, nil, nil, nil, 149, 644 1065, nil, nil, nil, nil, nil, 137, nil, 82, nil, 645 nil, nil, 1034, nil, 68, 2629, 23, nil, 65, nil, 646 1009, nil, nil, 167, 186, nil, nil, nil, nil, 170, 647 131, 621, 567, 559, 557, 520, 503, 417, 423, 464, 648 334, 326, 350, 351, 14, nil, 984, 421, nil, nil, 649 754, nil, 129, 376, 256, 451, 908, 883, nil, nil, 650 nil, 510, nil, 260, 520, nil, 539, 855, 2726, nil, 651 556, nil, nil, 807, 683, nil, nil, nil, nil, 1878, 652 nil, nil, nil, 950, 180, 629, 631, 1286, nil, nil, 653 nil, nil, 634, 653, 539, 1316, 1417, 2376, 687, nil, 654 nil, nil, 689, nil, 693, nil, 649, nil, 318, nil, 655 nil, nil, 622, nil, nil, 412, 323, 281, 128, 256, 656 nil, nil, nil, nil, nil, 2406, 118, 666, 23, nil, 657 -2, nil, nil, nil, nil, nil, nil ] 604 658 605 659 racc_action_default = [ 606 -174, -241, -1, -241, -241, -70, -71, -72, -80, -81, 607 -82, -83, -84, -85, -86, -87, -88, -89, -90, -91, 608 -92, -93, -96, -241, -241, -127, -132, -133, -175, -176, 609 -241, -178, -179, -182, -183, -184, -241, -230, -231, -232, 610 -233, -234, -235, -236, -237, 398, -241, -76, -78, -241, 611 -135, -137, -241, -143, -73, -84, -86, -74, -75, -181, 612 -180, -98, -241, -101, -114, -241, -117, -241, -126, -177, 613 -105, -107, -241, -69, -241, -241, -188, -189, -134, -136, 614 -241, -241, -241, -144, -145, -94, -241, -241, -84, -85, 615 -241, -115, -241, -241, -128, -130, -241, -106, -108, -241, 616 -186, -77, -78, -2, -3, -4, -5, -6, -7, -8, 617 -241, -10, -12, -23, -241, -241, -241, -241, -29, -30, 618 -31, -32, -33, -34, -35, -37, -41, -44, -47, -52, 619 -55, -57, -59, -61, -63, -65, -68, -79, -168, -241, 620 -241, -238, -241, -241, -241, -140, -241, -142, -147, -149, 621 -153, -138, -146, -241, -84, -85, -241, -99, -241, -241, 622 -120, -119, -113, -116, -241, -121, -123, -124, -241, -241, 623 -241, -185, -241, -241, -11, -241, -241, -67, -154, -20, 624 -241, -241, -241, -241, -18, -19, -24, -241, -25, -241, 625 -27, -28, -241, -241, -241, -241, -241, -241, -241, -241, 626 -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, 627 -241, -241, -172, -241, -239, -35, -241, -190, -191, -192, 628 -193, -194, -195, -196, -197, -198, -199, -200, -201, -241, 629 -241, -241, -241, -241, -238, -241, -241, -211, -241, -241, 630 -241, -241, -241, -139, -141, -241, -156, -241, -151, -152, 631 -157, -241, -241, -104, -103, -97, -100, -241, -109, -111, 632 -112, -118, -241, -129, -131, -125, -187, -240, -9, -241, 633 -155, -156, -241, -241, -21, -20, -241, -16, -17, -241, 634 -38, -39, -40, -42, -43, -45, -46, -48, -49, -50, 635 -51, -53, -54, -56, -58, -60, -62, -64, -241, -169, 636 -241, -241, -241, -219, -220, -221, -222, -223, -224, -225, 637 -226, -227, -228, -229, -241, -241, -241, -241, -241, -241, 638 -241, -241, -241, -213, -214, -241, -216, -217, -241, -150, 639 -158, -241, -164, -241, -241, -241, -160, -241, -95, -102, 640 -241, -122, -36, -13, -241, -241, -15, -26, -241, -170, 641 -173, -171, -241, -241, -241, -241, -241, -241, -208, -241, 642 -210, -212, -215, -241, -159, -165, -162, -241, -166, -241, 643 -161, -110, -22, -14, -66, -218, -241, -241, -241, -241, 644 -241, -209, -148, -163, -167, -202, -204, -241, -241, -207, 645 -241, -241, -241, -203, -205, -241, -241, -206 ] 660 -215, -269, -1, -269, -269, -86, -88, -90, -92, -98, 661 -99, -100, -101, -102, -103, -104, -105, -106, -107, -108, 662 -109, -110, -111, -112, -113, -114, -115, -118, -121, -269, 663 -139, -269, -163, -164, -165, -166, -167, -168, -169, -216, 664 -217, -269, -219, -220, -223, -224, -225, -269, 447, -269, 665 -94, -96, -269, -171, -173, -269, -180, -87, -112, -114, 666 -89, -91, -93, -222, -221, -120, -269, -124, -138, -269, 667 -142, -269, -155, -158, -218, -130, -132, -269, -85, -269, 668 -269, -229, -269, -170, -172, -269, -269, -269, -181, -182, 669 -184, -116, -269, -269, -112, -113, -269, -140, -269, -269, 670 -159, -161, -269, -269, -129, -131, -269, -227, -95, -96, 671 -2, -3, -4, -5, -6, -7, -8, -269, -10, -12, 672 -25, -269, -269, -269, -269, -31, -32, -33, -34, -35, 673 -36, -37, -39, -43, -46, -49, -54, -57, -59, -61, 674 -63, -65, -67, -69, -97, -209, -269, -269, -265, -269, 675 -82, -269, -269, -230, -231, -232, -233, -234, -235, -236, 676 -237, -238, -239, -265, -269, -269, -243, -269, -245, -247, 677 -248, -249, -269, -269, -269, -269, -269, -269, -269, -269, 678 -269, -268, -37, -84, -269, -176, -269, -269, -179, -186, 679 -188, -192, -193, -174, -183, -185, -269, -112, -113, -269, 680 -122, -269, -269, -145, -144, -137, -141, -269, -146, -148, 681 -269, -151, -269, -269, -269, -269, -226, -269, -269, -11, 682 -269, -269, -195, -269, -269, -269, -269, -269, -19, -20, 683 -26, -269, -27, -269, -29, -30, -269, -71, -72, -73, 684 -74, -75, -76, -77, -78, -79, -80, -81, -269, -269, 685 -269, -269, -269, -269, -269, -269, -269, -269, -269, -269, 686 -269, -269, -269, -269, -269, -269, -269, -269, -213, -269, 687 -266, -269, -250, -269, -269, -269, -244, -246, -269, -269, 688 -269, -269, -269, -269, -261, -262, -269, -263, -175, -177, 689 -178, -269, -269, -197, -269, -190, -191, -198, -269, -269, 690 -128, -127, -119, -123, -269, -133, -135, -136, -143, -269, 691 -269, -149, -153, -160, -162, -152, -269, -156, -269, -228, 692 -267, -9, -269, -196, -197, -269, -269, -14, -269, -23, 693 -269, -17, -18, -269, -269, -70, -40, -41, -42, -44, 694 -45, -47, -48, -50, -51, -52, -53, -55, -56, -58, 695 -60, -62, -64, -66, -269, -210, -269, -269, -83, -240, 696 -269, -242, -269, -269, -269, -269, -269, -269, -260, -264, 697 -194, -269, -189, -199, -269, -205, -269, -269, -269, -201, 698 -269, -117, -125, -269, -269, -147, -150, -154, -157, -269, 699 -38, -13, -15, -269, -269, -28, -269, -269, -211, -214, 700 -212, -241, -269, -269, -269, -269, -269, -269, -269, -200, 701 -206, -203, -269, -207, -269, -202, -269, -134, -269, -24, 702 -16, -68, -251, -253, -254, -269, -269, -269, -269, -269, 703 -187, -204, -208, -126, -21, -269, -269, -269, -269, -256, 704 -269, -258, -22, -252, -255, -257, -259 ] 646 705 647 706 racc_goto_table = [ 648 48, 4, 144, 146, 54, 57, 58, 217, 84, 12, 649 136, 137, 78, 175, 258, 136, 273, 165, 188, 190, 650 191, 186, 72, 89, 256, 93, 176, 163, 70, 4, 651 33, 156, 249, 29, 283, 284, 302, 12, 152, 14, 652 330, 2, 71, 293, 155, 89, 215, 90, 89, 287, 653 288, 289, 290, 294, 170, 295, 97, 98, 33, 83, 654 270, 69, 70, 70, 92, 330, 296, 14, 100, 159, 655 102, 297, 88, 101, 136, 212, 71, 71, 285, 286, 656 150, 61, 274, 153, 276, 158, 92, 62, 166, 92, 657 175, 264, 175, 154, 88, 316, 163, 88, 252, 280, 658 281, 282, 70, 279, 136, 246, 291, 292, 257, 64, 659 164, 155, 345, 298, 155, 263, 71, 89, 180, 329, 660 256, 211, 28, 99, 76, 143, 1, nil, nil, nil, 661 nil, nil, nil, 271, 215, nil, nil, nil, nil, nil, 662 nil, nil, nil, nil, 325, nil, 248, nil, nil, nil, 663 nil, nil, 158, nil, 259, 158, nil, 320, 92, nil, 664 154, nil, nil, 154, nil, nil, 88, nil, 266, nil, 665 136, nil, nil, 337, nil, nil, 342, nil, 274, 70, 666 nil, nil, nil, 358, nil, 360, 136, 341, nil, nil, 667 nil, nil, nil, 71, nil, nil, 371, nil, nil, nil, 668 nil, nil, 246, nil, nil, 352, nil, nil, nil, 78, 669 155, nil, 102, nil, nil, nil, nil, 353, 354, nil, 670 356, 357, 215, 381, 215, nil, nil, 271, nil, nil, 671 nil, nil, nil, nil, nil, 136, 350, nil, nil, nil, 672 385, 386, nil, nil, 150, nil, 150, 372, nil, nil, 673 nil, 158, nil, nil, 393, nil, 367, 369, 166, 154, 674 397, nil, 215, nil, nil, nil, nil, nil, nil, 136, 675 nil, 150, nil, nil, nil, nil, nil, nil, nil, 215, 676 215, 387, 388, 374, nil, nil, nil, nil, nil, nil, 677 nil, nil, nil, 215, nil, 395, nil, nil, nil, 215, 707 51, 144, 145, 81, 183, 182, 184, 281, 186, 23, 708 267, 95, 208, 83, 206, 305, 303, 313, 328, 169, 709 25, 4, 199, 230, 57, 60, 61, 62, 75, 89, 710 40, 99, 168, 221, 198, 95, 296, 77, 95, 220, 711 373, 182, 232, 234, 235, 65, 96, 207, 23, 76, 712 304, 366, 343, 344, 345, 346, 75, 75, 90, 25, 713 4, 194, 214, 215, 66, 104, 105, 323, 145, 74, 714 202, 373, 196, 107, 68, 109, 94, 76, 76, 347, 715 348, 339, 340, 183, 182, 274, 341, 342, 98, 108, 716 195, 236, 187, 88, 209, 372, 353, 352, 75, 197, 717 94, 152, 286, 94, 169, 359, 39, 361, 351, 106, 718 350, 201, 98, 349, 2, 98, 303, 277, 167, 76, 719 206, 313, 225, 313, 394, 1, 299, nil, nil, 183, 720 182, 311, 183, 182, 314, 406, 407, nil, 198, nil, 721 nil, 198, nil, nil, 95, 326, 329, 333, 109, 334, 722 336, 337, 338, 220, nil, 220, nil, nil, 335, nil, 723 nil, nil, nil, nil, 293, nil, nil, nil, 182, 182, 724 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 725 182, 182, 182, 182, 182, 182, 152, 295, 354, nil, 726 nil, nil, 401, 358, nil, 324, nil, 306, 417, nil, 727 362, 363, 364, 197, nil, nil, 197, nil, nil, 94, 728 nil, nil, 75, 319, 75, 201, nil, nil, 201, 367, 729 380, 98, nil, 385, 390, nil, nil, nil, nil, 183, 730 182, 386, nil, 76, 422, 76, 424, nil, nil, nil, 731 nil, 198, 182, nil, nil, nil, nil, nil, nil, nil, 732 nil, nil, 329, 418, 83, nil, nil, nil, nil, 439, 733 nil, 441, nil, nil, nil, nil, nil, 293, 443, nil, 734 445, nil, 446, nil, nil, nil, nil, 399, 145, nil, 735 nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 736 nil, nil, nil, nil, nil, nil, nil, nil, 324, 412, 737 414, 152, 183, 182, 416, 209, 197, nil, nil, nil, 738 nil, 145, nil, nil, nil, 419, 421, 182, 201, nil, 739 nil, nil, nil, nil, nil, nil, nil, 425, 426, 428, 678 740 nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 679 741 nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 680 nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 681 nil, nil, nil, nil, 150, nil, 259 ] 682 683 racc_goto_check = [ 684 32, 27, 25, 55, 27, 27, 27, 68, 53, 34, 685 24, 33, 54, 6, 44, 24, 8, 49, 10, 10, 686 10, 12, 43, 35, 41, 51, 13, 47, 30, 27, 687 26, 38, 58, 62, 14, 14, 77, 34, 53, 36, 688 59, 2, 9, 18, 35, 35, 10, 46, 35, 16, 689 16, 16, 16, 19, 51, 20, 43, 43, 26, 9, 690 58, 62, 30, 30, 27, 59, 21, 36, 32, 46, 691 32, 22, 34, 31, 24, 33, 9, 9, 15, 15, 692 27, 37, 6, 39, 6, 27, 27, 40, 32, 27, 693 6, 25, 6, 34, 34, 68, 47, 34, 38, 12, 694 12, 12, 30, 13, 24, 53, 17, 17, 42, 45, 695 48, 35, 8, 6, 35, 52, 9, 35, 9, 57, 696 41, 60, 61, 65, 66, 67, 1, nil, nil, nil, 697 nil, nil, nil, 53, 10, nil, nil, nil, nil, nil, 698 nil, nil, nil, nil, 6, nil, 32, nil, nil, nil, 699 nil, nil, 27, nil, 32, 27, nil, 25, 27, nil, 700 34, nil, nil, 34, nil, nil, 34, nil, 32, nil, 701 24, nil, nil, 25, nil, nil, 12, nil, 6, 30, 702 nil, nil, nil, 68, nil, 68, 24, 49, nil, nil, 703 nil, nil, nil, 9, nil, nil, 44, nil, nil, nil, 704 nil, nil, 53, nil, nil, 6, nil, nil, nil, 54, 705 35, nil, 32, nil, nil, nil, nil, 6, 6, nil, 706 6, 6, 10, 68, 10, nil, nil, 53, nil, nil, 707 nil, nil, nil, nil, nil, 24, 33, nil, nil, nil, 708 68, 68, nil, nil, 27, nil, 27, 6, nil, nil, 709 nil, 27, nil, nil, 68, nil, 25, 55, 32, 34, 710 68, nil, 10, nil, nil, nil, nil, nil, nil, 24, 711 nil, 27, nil, nil, nil, nil, nil, nil, nil, 10, 712 10, 6, 6, 24, nil, nil, nil, nil, nil, nil, 713 nil, nil, nil, 10, nil, 6, nil, nil, nil, 10, 742 nil, nil, nil, nil, nil, 423, 399, 145, nil, nil, 714 743 nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 715 744 nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 745 306 ] 746 747 racc_goto_check = [ 748 36, 37, 12, 72, 26, 13, 28, 73, 60, 38, 749 11, 39, 55, 59, 53, 49, 46, 57, 8, 29, 750 40, 30, 43, 15, 30, 30, 30, 30, 33, 58, 751 68, 56, 84, 10, 39, 39, 65, 48, 39, 6, 752 66, 13, 13, 13, 13, 42, 52, 54, 38, 9, 753 47, 75, 18, 18, 18, 18, 33, 33, 9, 40, 754 30, 58, 56, 56, 45, 48, 48, 65, 12, 68, 755 52, 66, 44, 36, 51, 36, 38, 9, 9, 19, 756 19, 16, 16, 26, 13, 28, 17, 17, 30, 35, 757 9, 27, 61, 62, 36, 64, 24, 23, 33, 38, 758 38, 30, 6, 38, 29, 73, 67, 73, 22, 71, 759 21, 30, 30, 20, 2, 30, 46, 84, 83, 9, 760 53, 57, 9, 57, 8, 1, 43, nil, nil, 26, 761 13, 28, 26, 13, 28, 75, 75, nil, 39, nil, 762 nil, 39, nil, nil, 39, 6, 12, 10, 36, 10, 763 15, 15, 15, 6, nil, 6, nil, nil, 12, nil, 764 nil, nil, nil, nil, 58, nil, nil, nil, 13, 13, 765 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 766 13, 13, 13, 13, 13, 13, 30, 36, 6, nil, 767 nil, nil, 73, 12, nil, 58, nil, 36, 49, nil, 768 6, 6, 6, 38, nil, nil, 38, nil, nil, 38, 769 nil, nil, 33, 36, 33, 30, nil, nil, 30, 29, 770 12, 30, nil, 55, 15, nil, nil, nil, nil, 26, 771 13, 28, nil, 9, 73, 9, 73, nil, nil, nil, 772 nil, 39, 13, nil, nil, nil, nil, nil, nil, nil, 773 nil, nil, 12, 11, 59, nil, nil, nil, nil, 73, 774 nil, 73, nil, nil, nil, nil, nil, 58, 73, nil, 775 73, nil, 73, nil, nil, nil, nil, 37, 12, nil, 716 776 nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 717 nil, nil, nil, nil, 27, nil, 32 ] 777 nil, nil, nil, nil, nil, nil, nil, nil, 58, 12, 778 60, 30, 26, 13, 28, 36, 38, nil, nil, nil, 779 nil, 12, nil, nil, nil, 12, 26, 13, 30, nil, 780 nil, nil, nil, nil, nil, nil, nil, 6, 6, 6, 781 nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 782 nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 783 nil, nil, nil, nil, nil, 72, 37, 12, nil, nil, 784 nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 785 nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 786 36 ] 718 787 719 788 racc_goto_pointer = [ 720 nil, 126, 41, nil, nil, nil, -97, nil, -163, 6, 721 -97, nil, -93, -84, -161, -119, -150, -97, -162, -153, 722 -152, -142, -138, nil, -65, -78, 28, -1, nil, nil, 723 -8, -1, -4, -64, 7, -42, 37, 59, -55, -2, 724 65, -132, -50, -14, -144, 86, -18, -63, 18, -75, 725 nil, -42, -53, -45, -37, -78, nil, -126, -118, -206, 726 -18, 120, 31, nil, nil, 51, 76, 48, -136, nil, 727 nil, nil, nil, nil, nil, nil, nil, -179 ] 789 nil, 125, 114, nil, nil, nil, -78, nil, -206, 2, 790 -84, -136, -78, -80, nil, -98, -170, -167, -203, -180, 791 -148, -152, -155, -167, -169, nil, -81, -40, -79, -63, 792 19, nil, nil, -19, nil, 10, -4, -79, 7, -58, 793 18, nil, 18, -70, -19, 37, -183, -151, -10, -186, 794 nil, 45, -23, -82, -51, -86, -40, -195, -27, -39, 795 -78, 6, 37, nil, -197, -155, -253, 104, 28, nil, 796 nil, 32, -48, -168, nil, -231, nil, nil, nil, nil, 797 nil, nil, nil, 36, -50 ] 728 798 729 799 racc_goto_default = [ 730 nil, nil, nil, 112, 103, 109, 242, 113, nil, 7, 731 124, 114, 125, nil, 126, 127, 128, 129, 130, 131, 732 132, 133, 134, 135, 177, 138, 218, 216, 46, 5, 733 6, 47, 82, nil, 55, 13, 56, nil, nil, nil, 734 nil, 157, nil, 178, nil, nil, nil, 91, nil, nil, 735 24, nil, 94, 49, 50, 333, 148, 149, 331, 250, 736 nil, nil, nil, 31, 32, nil, 225, nil, nil, 219, 737 220, 221, 222, 223, 224, 226, 227, nil ] 800 nil, nil, nil, 119, 110, 116, 151, 120, nil, 7, 801 nil, nil, 150, 131, 121, 132, 133, 134, 135, 136, 802 137, 138, 139, 140, 141, 142, 143, nil, nil, 44, 803 191, 49, 5, 6, 8, 50, 87, 268, 58, 24, 804 59, 27, nil, nil, nil, nil, 200, nil, 222, nil, 805 29, nil, nil, 97, nil, nil, nil, 100, 52, 53, 806 376, nil, nil, 189, 190, 374, 297, nil, nil, 42, 807 43, nil, 154, 170, 153, 155, 156, 157, 158, 159, 808 160, 161, 162, nil, nil ] 738 809 739 810 racc_reduce_table = [ 740 811 0, 0, :racc_error, 741 1, 97, :_reduce_none, 742 1, 99, :_reduce_2, 743 1, 99, :_reduce_3, 744 1, 99, :_reduce_4, 745 1, 99, :_reduce_5, 746 1, 99, :_reduce_6, 747 1, 99, :_reduce_7, 748 1, 99, :_reduce_8, 749 3, 99, :_reduce_9, 750 1, 101, :_reduce_10, 751 2, 101, :_reduce_11, 752 1, 103, :_reduce_none, 753 4, 103, :_reduce_none, 754 5, 103, :_reduce_none, 755 4, 103, :_reduce_15, 756 3, 103, :_reduce_16, 757 3, 103, :_reduce_17, 758 2, 103, :_reduce_18, 759 2, 103, :_reduce_19, 760 0, 104, :_reduce_none, 812 1, 98, :_reduce_none, 813 1, 100, :_reduce_2, 814 1, 100, :_reduce_3, 815 1, 100, :_reduce_4, 816 1, 100, :_reduce_5, 817 1, 100, :_reduce_6, 818 1, 100, :_reduce_7, 819 1, 100, :_reduce_8, 820 3, 100, :_reduce_9, 821 1, 102, :_reduce_10, 822 2, 102, :_reduce_11, 761 823 1, 104, :_reduce_none, 824 4, 104, :_reduce_13, 762 825 3, 104, :_reduce_none, 763 1, 106, :_reduce_none, 764 2, 106, :_reduce_24, 765 2, 106, :_reduce_25, 766 4, 106, :_reduce_26, 767 2, 106, :_reduce_27, 768 2, 106, :_reduce_28, 769 1, 107, :_reduce_29, 770 1, 107, :_reduce_30, 771 1, 107, :_reduce_31, 772 1, 107, :_reduce_32, 773 1, 107, :_reduce_33, 774 1, 107, :_reduce_34, 775 1, 108, :_reduce_none, 776 4, 108, :_reduce_36, 826 4, 104, :_reduce_none, 827 5, 104, :_reduce_none, 828 3, 104, :_reduce_17, 829 3, 104, :_reduce_18, 830 2, 104, :_reduce_19, 831 2, 104, :_reduce_20, 832 6, 104, :_reduce_none, 833 7, 104, :_reduce_none, 834 1, 105, :_reduce_none, 835 3, 105, :_reduce_none, 777 836 1, 110, :_reduce_none, 778 3, 110, :_reduce_38, 779 3, 110, :_reduce_39, 780 3, 110, :_reduce_40, 781 1, 111, :_reduce_none, 782 3, 111, :_reduce_42, 783 3, 111, :_reduce_43, 837 2, 110, :_reduce_26, 838 2, 110, :_reduce_27, 839 4, 110, :_reduce_28, 840 2, 110, :_reduce_29, 841 2, 110, :_reduce_30, 842 1, 111, :_reduce_31, 843 1, 111, :_reduce_32, 844 1, 111, :_reduce_33, 845 1, 111, :_reduce_34, 846 1, 111, :_reduce_35, 847 1, 111, :_reduce_36, 784 848 1, 112, :_reduce_none, 785 3, 112, :_reduce_45, 786 3, 112, :_reduce_46, 849 4, 112, :_reduce_38, 787 850 1, 113, :_reduce_none, 788 3, 113, :_reduce_48, 789 3, 113, :_reduce_49, 790 3, 113, :_reduce_50, 791 3, 113, :_reduce_51, 851 3, 113, :_reduce_40, 852 3, 113, :_reduce_41, 853 3, 113, :_reduce_42, 792 854 1, 114, :_reduce_none, 793 3, 114, :_reduce_ 53,794 3, 114, :_reduce_ 54,855 3, 114, :_reduce_44, 856 3, 114, :_reduce_45, 795 857 1, 115, :_reduce_none, 796 3, 115, :_reduce_56, 858 3, 115, :_reduce_47, 859 3, 115, :_reduce_48, 797 860 1, 116, :_reduce_none, 798 3, 116, :_reduce_58, 861 3, 116, :_reduce_50, 862 3, 116, :_reduce_51, 863 3, 116, :_reduce_52, 864 3, 116, :_reduce_53, 799 865 1, 117, :_reduce_none, 800 3, 117, :_reduce_60, 866 3, 117, :_reduce_55, 867 3, 117, :_reduce_56, 801 868 1, 118, :_reduce_none, 802 3, 118, :_reduce_ 62,869 3, 118, :_reduce_58, 803 870 1, 119, :_reduce_none, 804 3, 119, :_reduce_6 4,871 3, 119, :_reduce_60, 805 872 1, 120, :_reduce_none, 806 5, 120, :_reduce_66,807 1, 1 02, :_reduce_67,808 1, 121, :_reduce_68,809 3, 122, :_reduce_none,810 1, 123, :_reduce_70,873 3, 120, :_reduce_62, 874 1, 121, :_reduce_none, 875 3, 121, :_reduce_64, 876 1, 122, :_reduce_none, 877 3, 122, :_reduce_66, 811 878 1, 123, :_reduce_none, 812 1, 123, :_reduce_72, 813 2, 123, :_reduce_73, 814 2, 123, :_reduce_74, 815 2, 123, :_reduce_75, 816 1, 124, :_reduce_76, 817 3, 124, :_reduce_77, 879 5, 123, :_reduce_68, 880 1, 109, :_reduce_none, 881 3, 109, :_reduce_none, 882 1, 124, :_reduce_none, 883 1, 124, :_reduce_none, 884 1, 124, :_reduce_none, 885 1, 124, :_reduce_none, 886 1, 124, :_reduce_none, 887 1, 124, :_reduce_none, 888 1, 124, :_reduce_none, 889 1, 124, :_reduce_none, 890 1, 124, :_reduce_none, 891 1, 124, :_reduce_none, 892 1, 124, :_reduce_none, 893 1, 103, :_reduce_82, 894 3, 103, :_reduce_83, 895 1, 125, :_reduce_84, 896 3, 126, :_reduce_none, 897 1, 127, :_reduce_86, 898 2, 127, :_reduce_87, 818 899 1, 127, :_reduce_none, 819 3, 127, :_reduce_79, 820 1, 126, :_reduce_80, 821 1, 126, :_reduce_81, 822 1, 126, :_reduce_82, 823 1, 126, :_reduce_83, 824 1, 126, :_reduce_84, 825 1, 126, :_reduce_85, 826 1, 126, :_reduce_86, 827 1, 126, :_reduce_87, 828 1, 126, :_reduce_88, 829 1, 126, :_reduce_89, 830 1, 126, :_reduce_90, 831 1, 126, :_reduce_91, 832 1, 126, :_reduce_92, 833 1, 126, :_reduce_93, 834 0, 135, :_reduce_94, 835 6, 130, :_reduce_95, 836 0, 136, :_reduce_96, 837 5, 130, :_reduce_97, 838 2, 130, :_reduce_98, 839 1, 134, :_reduce_none, 840 2, 134, :_reduce_none, 841 1, 133, :_reduce_101, 842 3, 137, :_reduce_102, 843 2, 137, :_reduce_none, 844 2, 137, :_reduce_none, 845 1, 139, :_reduce_none, 846 2, 139, :_reduce_106, 847 1, 139, :_reduce_107, 848 2, 139, :_reduce_108, 849 1, 138, :_reduce_109, 850 3, 138, :_reduce_110, 900 2, 127, :_reduce_89, 901 1, 127, :_reduce_90, 902 2, 127, :_reduce_91, 903 1, 127, :_reduce_none, 904 2, 127, :_reduce_none, 905 1, 128, :_reduce_94, 906 3, 128, :_reduce_95, 907 1, 132, :_reduce_none, 908 3, 132, :_reduce_97, 909 1, 129, :_reduce_none, 910 1, 129, :_reduce_none, 911 1, 129, :_reduce_none, 912 1, 129, :_reduce_none, 913 1, 130, :_reduce_102, 914 1, 130, :_reduce_103, 915 1, 130, :_reduce_104, 916 1, 130, :_reduce_105, 917 1, 130, :_reduce_106, 918 1, 130, :_reduce_107, 919 1, 130, :_reduce_108, 920 1, 130, :_reduce_109, 921 1, 130, :_reduce_110, 922 1, 130, :_reduce_111, 923 1, 130, :_reduce_112, 924 1, 130, :_reduce_113, 925 1, 130, :_reduce_114, 926 1, 130, :_reduce_115, 927 0, 141, :_reduce_116, 928 6, 135, :_reduce_117, 929 0, 142, :_reduce_118, 930 5, 135, :_reduce_119, 931 2, 135, :_reduce_120, 932 1, 138, :_reduce_121, 851 933 1, 140, :_reduce_none, 852 5, 131, :_reduce_none, 853 4, 131, :_reduce_none, 854 2, 131, :_reduce_none, 855 1, 142, :_reduce_none, 856 2, 142, :_reduce_none, 857 1, 141, :_reduce_none, 858 3, 143, :_reduce_none, 934 2, 140, :_reduce_none, 935 1, 139, :_reduce_124, 936 3, 143, :_reduce_125, 937 5, 143, :_reduce_126, 859 938 2, 143, :_reduce_none, 860 939 2, 143, :_reduce_none, 861 1, 144, :_reduce_none, 862 3, 144, :_reduce_none, 940 2, 145, :_reduce_129, 863 941 1, 145, :_reduce_none, 864 4, 132, :_reduce_none, 865 5, 132, :_reduce_none, 866 2, 132, :_reduce_none, 867 1, 146, :_reduce_127, 868 1, 147, :_reduce_none, 869 3, 147, :_reduce_none, 942 2, 145, :_reduce_131, 943 1, 145, :_reduce_132, 944 1, 144, :_reduce_133, 945 3, 144, :_reduce_134, 946 1, 146, :_reduce_none, 947 5, 136, :_reduce_none, 948 4, 136, :_reduce_none, 949 2, 136, :_reduce_none, 950 1, 147, :_reduce_139, 951 1, 149, :_reduce_none, 952 2, 149, :_reduce_none, 870 953 1, 148, :_reduce_none, 871 3, 148, :_reduce_none, 872 1, 105, :_reduce_132, 873 1, 105, :_reduce_133, 874 2, 128, :_reduce_134, 875 1, 128, :_reduce_none, 876 2, 128, :_reduce_136, 877 1, 150, :_reduce_137, 878 3, 150, :_reduce_138, 879 4, 150, :_reduce_139, 880 3, 150, :_reduce_140, 881 4, 150, :_reduce_141, 882 3, 150, :_reduce_142, 883 1, 149, :_reduce_143, 884 2, 149, :_reduce_144, 885 2, 149, :_reduce_145, 886 3, 149, :_reduce_146, 954 3, 150, :_reduce_none, 955 2, 150, :_reduce_none, 956 2, 150, :_reduce_none, 887 957 1, 151, :_reduce_none, 888 5, 151, :_reduce_none,958 3, 151, :_reduce_none, 889 959 1, 152, :_reduce_none, 960 2, 152, :_reduce_none, 890 961 3, 152, :_reduce_none, 891 2, 153, :_reduce_none, 892 2, 153, :_reduce_none, 962 4, 137, :_reduce_none, 963 5, 137, :_reduce_none, 964 5, 137, :_reduce_none, 965 6, 137, :_reduce_none, 966 2, 137, :_reduce_none, 967 5, 137, :_reduce_none, 968 6, 137, :_reduce_none, 969 2, 137, :_reduce_none, 893 970 1, 153, :_reduce_none, 894 1, 109, :_reduce_none, 895 2, 109, :_reduce_none, 971 3, 153, :_reduce_none, 896 972 1, 154, :_reduce_none, 897 1, 154, :_reduce_none, 898 2, 154, :_reduce_none, 899 3, 155, :_reduce_none, 900 2, 155, :_reduce_none, 901 3, 155, :_reduce_none, 902 3, 155, :_reduce_none, 903 4, 155, :_reduce_none, 904 2, 155, :_reduce_164, 905 3, 155, :_reduce_none, 906 3, 155, :_reduce_166, 907 4, 155, :_reduce_none, 908 1, 129, :_reduce_168, 909 3, 129, :_reduce_169, 910 4, 129, :_reduce_170, 911 4, 129, :_reduce_171, 912 1, 156, :_reduce_172, 913 3, 156, :_reduce_173, 914 0, 98, :_reduce_none, 915 2, 98, :_reduce_none, 973 3, 154, :_reduce_none, 974 1, 106, :_reduce_163, 975 1, 106, :_reduce_none, 976 1, 106, :_reduce_165, 977 1, 131, :_reduce_none, 978 1, 131, :_reduce_none, 979 1, 131, :_reduce_none, 980 1, 131, :_reduce_none, 981 2, 133, :_reduce_170, 982 1, 133, :_reduce_none, 983 2, 133, :_reduce_172, 984 1, 156, :_reduce_173, 985 3, 156, :_reduce_174, 986 4, 156, :_reduce_175, 987 3, 156, :_reduce_176, 988 4, 156, :_reduce_177, 989 4, 156, :_reduce_none, 990 3, 156, :_reduce_179, 991 1, 155, :_reduce_180, 992 2, 155, :_reduce_181, 993 2, 155, :_reduce_182, 994 3, 155, :_reduce_183, 995 1, 159, :_reduce_none, 996 2, 159, :_reduce_none, 916 997 1, 157, :_reduce_none, 917 2, 157, :_reduce_none, 998 5, 157, :_reduce_none, 999 1, 160, :_reduce_none, 1000 3, 160, :_reduce_none, 1001 2, 161, :_reduce_none, 1002 2, 161, :_reduce_none, 1003 1, 161, :_reduce_none, 918 1004 1, 158, :_reduce_none, 919 1, 158, :_reduce_none, 920 2, 158, :_reduce_none, 921 2, 158, :_reduce_none, 922 1, 158, :_reduce_none, 923 1, 158, :_reduce_none, 924 1, 158, :_reduce_none, 925 4, 159, :_reduce_185, 926 1, 161, :_reduce_186, 927 3, 161, :_reduce_187, 928 3, 160, :_reduce_none, 929 0, 163, :_reduce_none, 1005 3, 158, :_reduce_none, 1006 1, 107, :_reduce_none, 1007 2, 107, :_reduce_none, 1008 1, 162, :_reduce_none, 1009 1, 162, :_reduce_none, 1010 2, 162, :_reduce_none, 1011 3, 163, :_reduce_none, 930 1012 2, 163, :_reduce_none, 1013 3, 163, :_reduce_none, 1014 3, 163, :_reduce_none, 1015 4, 163, :_reduce_none, 1016 2, 163, :_reduce_205, 1017 3, 163, :_reduce_none, 1018 3, 163, :_reduce_207, 1019 4, 163, :_reduce_none, 1020 1, 134, :_reduce_209, 1021 3, 134, :_reduce_210, 1022 4, 134, :_reduce_211, 1023 4, 134, :_reduce_212, 1024 1, 108, :_reduce_213, 1025 3, 108, :_reduce_214, 1026 0, 99, :_reduce_none, 1027 2, 99, :_reduce_none, 931 1028 1, 164, :_reduce_none, 932 1, 164, :_reduce_none, 933 1, 164, :_reduce_none, 934 1, 164, :_reduce_none, 935 1, 164, :_reduce_none, 936 1, 164, :_reduce_none, 937 1, 164, :_reduce_none, 938 1, 164, :_reduce_none, 939 1, 164, :_reduce_none, 940 1, 164, :_reduce_none, 941 1, 164, :_reduce_none, 942 5, 165, :_reduce_none, 943 7, 165, :_reduce_none, 944 5, 166, :_reduce_none, 945 7, 167, :_reduce_none, 946 9, 168, :_reduce_none, 947 5, 169, :_reduce_none, 948 3, 170, :_reduce_none, 949 4, 170, :_reduce_none, 950 3, 170, :_reduce_none, 951 3, 162, :_reduce_none, 1029 2, 164, :_reduce_none, 1030 1, 165, :_reduce_none, 1031 1, 165, :_reduce_none, 1032 2, 165, :_reduce_none, 1033 2, 165, :_reduce_none, 1034 1, 165, :_reduce_none, 1035 1, 165, :_reduce_none, 1036 1, 165, :_reduce_none, 1037 4, 166, :_reduce_226, 1038 1, 168, :_reduce_227, 1039 3, 168, :_reduce_228, 1040 3, 167, :_reduce_none, 1041 1, 170, :_reduce_none, 1042 1, 170, :_reduce_none, 1043 1, 170, :_reduce_none, 1044 1, 170, :_reduce_none, 1045 1, 170, :_reduce_none, 1046 1, 170, :_reduce_none, 1047 1, 170, :_reduce_none, 1048 1, 170, :_reduce_none, 1049 1, 170, :_reduce_none, 1050 1, 170, :_reduce_none, 952 1051 3, 171, :_reduce_none, 953 2, 171, :_reduce_none, 954 2, 171, :_reduce_none, 1052 4, 171, :_reduce_none, 955 1053 3, 171, :_reduce_none, 956 2, 171, :_reduce_none, 1054 2, 169, :_reduce_none, 1055 3, 169, :_reduce_none, 1056 1, 180, :_reduce_none, 1057 2, 180, :_reduce_none, 1058 1, 181, :_reduce_none, 1059 1, 181, :_reduce_none, 1060 1, 172, :_reduce_none, 957 1061 2, 172, :_reduce_none, 958 4, 172, :_reduce_none, 959 1, 173, :_reduce_none, 960 1, 173, :_reduce_none, 961 1, 173, :_reduce_none, 962 1, 173, :_reduce_none, 963 1, 173, :_reduce_none, 964 1, 173, :_reduce_none, 965 1, 173, :_reduce_none, 966 1, 173, :_reduce_none, 967 1, 173, :_reduce_none, 968 1, 173, :_reduce_none, 969 1, 173, :_reduce_none, 970 1, 125, :_reduce_none, 971 1, 125, :_reduce_none, 972 1, 125, :_reduce_none, 973 1, 125, :_reduce_none, 974 1, 125, :_reduce_none, 975 1, 125, :_reduce_none, 976 1, 125, :_reduce_none, 977 1, 125, :_reduce_none, 978 1, 100, :_reduce_238, 979 2, 100, :_reduce_239, 980 3, 100, :_reduce_240 ] 981 982 racc_reduce_n = 241 983 984 racc_shift_n = 398 1062 5, 173, :_reduce_none, 1063 7, 173, :_reduce_none, 1064 5, 177, :_reduce_none, 1065 5, 174, :_reduce_none, 1066 7, 175, :_reduce_none, 1067 6, 176, :_reduce_none, 1068 7, 176, :_reduce_none, 1069 6, 176, :_reduce_none, 1070 7, 176, :_reduce_none, 1071 3, 178, :_reduce_none, 1072 2, 178, :_reduce_none, 1073 2, 178, :_reduce_none, 1074 2, 178, :_reduce_none, 1075 3, 178, :_reduce_none, 1076 1, 101, :_reduce_265, 1077 2, 101, :_reduce_266, 1078 3, 101, :_reduce_267, 1079 1, 179, :_reduce_268 ] 1080 1081 racc_reduce_n = 269 1082 1083 racc_shift_n = 447 985 1084 986 1085 racc_token_table = { … … 1002 1101 "++" => 15, 1003 1102 "--" => 16, 1004 "," => 17, 1005 :SIZEOF => 18, 1006 "&" => 19, 1007 "*" => 20, 1008 "+" => 21, 1009 "-" => 22, 1010 "~" => 23, 1011 "!" => 24, 1012 "/" => 25, 1013 "%" => 26, 1014 "<<" => 27, 1015 ">>" => 28, 1016 "<" => 29, 1017 ">" => 30, 1018 "<=" => 31, 1019 ">=" => 32, 1020 "==" => 33, 1021 "!=" => 34, 1022 "^" => 35, 1023 "|" => 36, 1024 "&&" => 37, 1025 "||" => 38, 1026 "?" => 39, 1027 ":" => 40, 1028 ";" => 41, 1029 "=" => 42, 1030 :VOID => 43, 1031 :FLOAT => 44, 1032 :DOUBLE => 45, 1033 :BOOL => 46, 1034 :TYPE_NAME => 47, 1035 :CHAR => 48, 1036 :SHORT => 49, 1037 :INT => 50, 1038 :LONG => 51, 1039 :SIGNED => 52, 1040 :UNSIGNED => 53, 1041 :STRUCT => 54, 1042 "{" => 55, 1043 "}" => 56, 1044 :UNION => 57, 1045 :ENUM => 58, 1046 :CONST => 59, 1047 :VOLATILE => 60, 1048 :C_EXP => 61, 1049 :EXTENSION => 62, 1050 :TYPEDEF => 63, 1051 :IF => 64, 1052 :ELSE => 65, 1053 :WHILE => 66, 1054 :DO => 67, 1055 :FOR => 68, 1056 :SWITCH => 69, 1057 :infunc_statment => 70, 1058 :CASE => 71, 1059 :DEFAULT => 72, 1060 :GOTO => 73, 1061 :CONTINUE => 74, 1062 :BREAK => 75, 1063 :RETURN => 76, 1064 "+=" => 77, 1065 "-=" => 78, 1066 "*=" => 79, 1067 "/=" => 80, 1068 "%=" => 81, 1069 "<<=" => 82, 1070 ">>=" => 83, 1071 "&=" => 84, 1072 "|=" => 85, 1073 "^=" => 86, 1074 :__INLINE__ => 87, 1075 :INLINE => 88, 1076 :__INLINE => 89, 1077 :CINLINE => 90, 1078 :EXTERN => 91, 1079 :STATIC => 92, 1080 :AUTO => 93, 1081 :REGISTER => 94, 1082 "::" => 95 } 1083 1084 racc_nt_base = 96 1103 "{" => 17, 1104 "}" => 18, 1105 "," => 19, 1106 :SIZEOF => 20, 1107 "&" => 21, 1108 "*" => 22, 1109 "+" => 23, 1110 "-" => 24, 1111 "~" => 25, 1112 "!" => 26, 1113 "/" => 27, 1114 "%" => 28, 1115 "<<" => 29, 1116 ">>" => 30, 1117 "<" => 31, 1118 ">" => 32, 1119 "<=" => 33, 1120 ">=" => 34, 1121 "==" => 35, 1122 "!=" => 36, 1123 "^" => 37, 1124 "|" => 38, 1125 "&&" => 39, 1126 "||" => 40, 1127 "?" => 41, 1128 ":" => 42, 1129 "=" => 43, 1130 "+=" => 44, 1131 "-=" => 45, 1132 "*=" => 46, 1133 "/=" => 47, 1134 "%=" => 48, 1135 "<<=" => 49, 1136 ">>=" => 50, 1137 "&=" => 51, 1138 "|=" => 52, 1139 "^=" => 53, 1140 ";" => 54, 1141 :EXTERN => 55, 1142 :STATIC => 56, 1143 :AUTO => 57, 1144 :REGISTER => 58, 1145 :VOID => 59, 1146 :CHAR => 60, 1147 :SHORT => 61, 1148 :INT => 62, 1149 :LONG => 63, 1150 :FLOAT => 64, 1151 :DOUBLE => 65, 1152 :SIGNED => 66, 1153 :UNSIGNED => 67, 1154 :BOOL => 68, 1155 :TYPE_NAME => 69, 1156 :STRUCT => 70, 1157 :UNION => 71, 1158 :ENUM => 72, 1159 :CONST => 73, 1160 :RESTRICT => 74, 1161 :VOLATILE => 75, 1162 :__INLINE__ => 76, 1163 :INLINE => 77, 1164 :__INLINE => 78, 1165 :CINLINE => 79, 1166 :C_EXP => 80, 1167 :EXTENSION => 81, 1168 :TYPEDEF => 82, 1169 :CASE => 83, 1170 :DEFAULT => 84, 1171 :IF => 85, 1172 :ELSE => 86, 1173 :SWITCH => 87, 1174 :WHILE => 88, 1175 :DO => 89, 1176 :FOR => 90, 1177 :GOTO => 91, 1178 :CONTINUE => 92, 1179 :BREAK => 93, 1180 :RETURN => 94, 1181 "::" => 95, 1182 :_ASM => 96 } 1183 1184 racc_nt_base = 97 1085 1185 1086 1186 racc_use_result_var = true … … 1120 1220 "\"++\"", 1121 1221 "\"--\"", 1222 "\"{\"", 1223 "\"}\"", 1122 1224 "\",\"", 1123 1225 "SIZEOF", … … 1144 1246 "\"?\"", 1145 1247 "\":\"", 1146 "\";\"",1147 1248 "\"=\"", 1148 "VOID",1149 "FLOAT",1150 "DOUBLE",1151 "BOOL",1152 "TYPE_NAME",1153 "CHAR",1154 "SHORT",1155 "INT",1156 "LONG",1157 "SIGNED",1158 "UNSIGNED",1159 "STRUCT",1160 "\"{\"",1161 "\"}\"",1162 "UNION",1163 "ENUM",1164 "CONST",1165 "VOLATILE",1166 "C_EXP",1167 "EXTENSION",1168 "TYPEDEF",1169 "IF",1170 "ELSE",1171 "WHILE",1172 "DO",1173 "FOR",1174 "SWITCH",1175 "infunc_statment",1176 "CASE",1177 "DEFAULT",1178 "GOTO",1179 "CONTINUE",1180 "BREAK",1181 "RETURN",1182 1249 "\"+=\"", 1183 1250 "\"-=\"", … … 1190 1257 "\"|=\"", 1191 1258 "\"^=\"", 1259 "\";\"", 1260 "EXTERN", 1261 "STATIC", 1262 "AUTO", 1263 "REGISTER", 1264 "VOID", 1265 "CHAR", 1266 "SHORT", 1267 "INT", 1268 "LONG", 1269 "FLOAT", 1270 "DOUBLE", 1271 "SIGNED", 1272 "UNSIGNED", 1273 "BOOL", 1274 "TYPE_NAME", 1275 "STRUCT", 1276 "UNION", 1277 "ENUM", 1278 "CONST", 1279 "RESTRICT", 1280 "VOLATILE", 1192 1281 "__INLINE__", 1193 1282 "INLINE", 1194 1283 "__INLINE", 1195 1284 "CINLINE", 1196 "EXTERN", 1197 "STATIC", 1198 "AUTO", 1199 "REGISTER", 1285 "C_EXP", 1286 "EXTENSION", 1287 "TYPEDEF", 1288 "CASE", 1289 "DEFAULT", 1290 "IF", 1291 "ELSE", 1292 "SWITCH", 1293 "WHILE", 1294 "DO", 1295 "FOR", 1296 "GOTO", 1297 "CONTINUE", 1298 "BREAK", 1299 "RETURN", 1200 1300 "\"::\"", 1301 "_ASM", 1201 1302 "$start", 1202 1303 "all", … … 1207 1308 "expression", 1208 1309 "postfix_expression", 1209 "argument_ list",1310 "argument_expression_list", 1210 1311 "type_qualifier", 1312 "type_name", 1313 "initializer_list", 1314 "assignment_expression", 1211 1315 "unary_expression", 1212 1316 "unary_operator", 1213 1317 "cast_expression", 1214 "type_name",1215 1318 "multiplicative_expression", 1216 1319 "additive_expression", … … 1224 1327 "logical_or_expression", 1225 1328 "conditional_expression", 1329 "assignment_operator", 1226 1330 "constant_expression", 1227 1331 "declaration", 1228 1332 "declaration_specifiers", 1229 1333 "init_declarator_list", 1230 "storage_class ",1334 "storage_class_specifier", 1231 1335 "type_specifier", 1336 "function_specifier", 1232 1337 "init_declarator", 1233 1338 "declarator", … … 1236 1341 "union_specifier", 1237 1342 "enum_specifier", 1343 "struct_term", 1238 1344 "struct_tag", 1239 1345 "struct_declaration_list", … … 1242 1348 "struct_declaration", 1243 1349 "struct_declarator_list", 1244 " type_specifier_qualifier_list",1350 "specifier_qualifier_list", 1245 1351 "struct_declarator", 1352 "union_term", 1246 1353 "union_tag", 1247 1354 "union_declaration_list", … … 1249 1356 "union_declarator_list", 1250 1357 "union_declarator", 1251 "enum_type",1252 1358 "enumerator_list", 1253 1359 "enumerator", … … 1255 1361 "direct_declarator", 1256 1362 "parameter_type_list", 1363 "identifier_list", 1364 "type_qualifier_list", 1257 1365 "parameter_list", 1258 1366 "parameter_declaration", 1259 1367 "abstract_declarator", 1260 1368 "direct_abstract_declarator", 1261 "initializer_list",1262 1369 "extension_statement", 1263 " statement",1370 "cdl_statement", 1264 1371 "typedef", 1265 1372 "func_def", 1266 1373 "declarator_list", 1267 "compoundstatement", 1268 "infunc_statement_list", 1269 "infunc_statement", 1374 "compound_statement", 1375 "statement", 1376 "labeled_statement", 1377 "expression_statement", 1270 1378 "ifstatement", 1271 1379 "whilestatement", … … 1273 1381 "forstatement", 1274 1382 "switchstatement", 1275 " labelstatement",1276 " gotostatement",1277 " expressionstatement",1278 " assignment_operator" ]1383 "jump_statement", 1384 "asm_statement", 1385 "block_item_list", 1386 "block_item" ] 1279 1387 1280 1388 Racc_debug_parser = false … … 1286 1394 # reduce 1 omitted 1287 1395 1288 module_eval(<<'.,.,', 'C_parser.y.rb', 5 2)1396 module_eval(<<'.,.,', 'C_parser.y.rb', 57) 1289 1397 def _reduce_2(val, _values, result) 1290 1398 result = [ :IDENTIFIER, val[0] ] … … 1293 1401 .,., 1294 1402 1295 module_eval(<<'.,.,', 'C_parser.y.rb', 6 0)1403 module_eval(<<'.,.,', 'C_parser.y.rb', 65) 1296 1404 def _reduce_3(val, _values, result) 1297 1405 result = [ :INTEGER_CONSTANT, val[0] ] … … 1300 1408 .,., 1301 1409 1302 module_eval(<<'.,.,', 'C_parser.y.rb', 6 2)1410 module_eval(<<'.,.,', 'C_parser.y.rb', 67) 1303 1411 def _reduce_4(val, _values, result) 1304 1412 result = [ :FLOATING_CONSTANT, val[0] ] … … 1307 1415 .,., 1308 1416 1309 module_eval(<<'.,.,', 'C_parser.y.rb', 6 4)1417 module_eval(<<'.,.,', 'C_parser.y.rb', 69) 1310 1418 def _reduce_5(val, _values, result) 1311 1419 result = [ :OCTAL_CONSTANT, val[0] ] … … 1314 1422 .,., 1315 1423 1316 module_eval(<<'.,.,', 'C_parser.y.rb', 66)1424 module_eval(<<'.,.,', 'C_parser.y.rb', 71) 1317 1425 def _reduce_6(val, _values, result) 1318 1426 result = [ :HEX_CONSTANT, val[0] ] … … 1321 1429 .,., 1322 1430 1323 module_eval(<<'.,.,', 'C_parser.y.rb', 68)1431 module_eval(<<'.,.,', 'C_parser.y.rb', 73) 1324 1432 def _reduce_7(val, _values, result) 1325 1433 result = [ :CHARACTER_LITERAL, val[0] ] … … 1328 1436 .,., 1329 1437 1330 module_eval(<<'.,.,', 'C_parser.y.rb', 7 0)1438 module_eval(<<'.,.,', 'C_parser.y.rb', 75) 1331 1439 def _reduce_8(val, _values, result) 1332 1440 result = [ :STRING_LITERAL_LIST, val[0] ] … … 1335 1443 .,., 1336 1444 1337 module_eval(<<'.,.,', 'C_parser.y.rb', 7 2)1445 module_eval(<<'.,.,', 'C_parser.y.rb', 77) 1338 1446 def _reduce_9(val, _values, result) 1339 1447 result = [ :PARENTHESES, val[1].get_elements ] … … 1342 1450 .,., 1343 1451 1344 module_eval(<<'.,.,', 'C_parser.y.rb', 76)1452 module_eval(<<'.,.,', 'C_parser.y.rb', 81) 1345 1453 def _reduce_10(val, _values, result) 1346 1454 result = [val[0]] … … 1349 1457 .,., 1350 1458 1351 module_eval(<<'.,.,', 'C_parser.y.rb', 78)1459 module_eval(<<'.,.,', 'C_parser.y.rb', 83) 1352 1460 def _reduce_11(val, _values, result) 1353 1461 result << val[1] … … 1358 1466 # reduce 12 omitted 1359 1467 1360 # reduce 13 omitted 1468 module_eval(<<'.,.,', 'C_parser.y.rb', 89) 1469 def _reduce_13(val, _values, result) 1470 result = [ :OP_SUBSC, val[0], val[2] ] 1471 result 1472 end 1473 .,., 1361 1474 1362 1475 # reduce 14 omitted 1363 1476 1364 module_eval(<<'.,.,', 'C_parser.y.rb', 86) 1365 def _reduce_15(val, _values, result) 1366 result = [ :OP_SUBSC, val[0], val[2] ] 1367 result 1368 end 1369 .,., 1370 1371 module_eval(<<'.,.,', 'C_parser.y.rb', 88) 1372 def _reduce_16(val, _values, result) 1477 # reduce 15 omitted 1478 1479 # reduce 16 omitted 1480 1481 module_eval(<<'.,.,', 'C_parser.y.rb', 94) 1482 def _reduce_17(val, _values, result) 1373 1483 result = [ :OP_DOT, val[0], val[2] ] 1374 1484 result … … 1376 1486 .,., 1377 1487 1378 module_eval(<<'.,.,', 'C_parser.y.rb', 9 0)1379 def _reduce_1 7(val, _values, result)1488 module_eval(<<'.,.,', 'C_parser.y.rb', 96) 1489 def _reduce_18(val, _values, result) 1380 1490 result = [ :OP_REF, val[0], val[2] ] 1381 1491 result … … 1383 1493 .,., 1384 1494 1385 module_eval(<<'.,.,', 'C_parser.y.rb', 91) 1386 def _reduce_18(val, _values, result) 1387 result = val[0] 1388 result 1389 end 1390 .,., 1391 1392 module_eval(<<'.,.,', 'C_parser.y.rb', 92) 1495 module_eval(<<'.,.,', 'C_parser.y.rb', 97) 1393 1496 def _reduce_19(val, _values, result) 1394 1497 result = val[0] … … 1397 1500 .,., 1398 1501 1399 # reduce 20 omitted 1502 module_eval(<<'.,.,', 'C_parser.y.rb', 98) 1503 def _reduce_20(val, _values, result) 1504 result = val[0] 1505 result 1506 end 1507 .,., 1400 1508 1401 1509 # reduce 21 omitted … … 1405 1513 # reduce 23 omitted 1406 1514 1407 module_eval(<<'.,.,', 'C_parser.y.rb', 104) 1408 def _reduce_24(val, _values, result) 1515 # reduce 24 omitted 1516 1517 # reduce 25 omitted 1518 1519 module_eval(<<'.,.,', 'C_parser.y.rb', 111) 1520 def _reduce_26(val, _values, result) 1409 1521 result = [ val[0], val[1] ] 1410 1522 result … … 1412 1524 .,., 1413 1525 1414 module_eval(<<'.,.,', 'C_parser.y.rb', 1 06)1415 def _reduce_2 5(val, _values, result)1526 module_eval(<<'.,.,', 'C_parser.y.rb', 113) 1527 def _reduce_27(val, _values, result) 1416 1528 result = [ :OP_SIZEOF_EXPR, val[1] ] 1417 1529 result … … 1419 1531 .,., 1420 1532 1421 module_eval(<<'.,.,', 'C_parser.y.rb', 1 08)1422 def _reduce_2 6(val, _values, result)1533 module_eval(<<'.,.,', 'C_parser.y.rb', 115) 1534 def _reduce_28(val, _values, result) 1423 1535 result = [ :OP_SIZEOF_TYPE, val[1] ] 1424 1536 result … … 1426 1538 .,., 1427 1539 1428 module_eval(<<'.,.,', 'C_parser.y.rb', 1 09)1429 def _reduce_2 7(val, _values, result)1540 module_eval(<<'.,.,', 'C_parser.y.rb', 116) 1541 def _reduce_29(val, _values, result) 1430 1542 result = val[1] 1431 1543 result … … 1433 1545 .,., 1434 1546 1435 module_eval(<<'.,.,', 'C_parser.y.rb', 11 0)1436 def _reduce_ 28(val, _values, result)1547 module_eval(<<'.,.,', 'C_parser.y.rb', 117) 1548 def _reduce_30(val, _values, result) 1437 1549 result = val[1] 1438 1550 result … … 1440 1552 .,., 1441 1553 1442 module_eval(<<'.,.,', 'C_parser.y.rb', 1 13)1443 def _reduce_ 29(val, _values, result)1554 module_eval(<<'.,.,', 'C_parser.y.rb', 120) 1555 def _reduce_31(val, _values, result) 1444 1556 result = :OP_U_AMP 1445 1557 result … … 1447 1559 .,., 1448 1560 1449 module_eval(<<'.,.,', 'C_parser.y.rb', 1 14)1450 def _reduce_3 0(val, _values, result)1561 module_eval(<<'.,.,', 'C_parser.y.rb', 121) 1562 def _reduce_32(val, _values, result) 1451 1563 result = :OP_U_ASTER 1452 1564 result … … 1454 1566 .,., 1455 1567 1456 module_eval(<<'.,.,', 'C_parser.y.rb', 1 15)1457 def _reduce_3 1(val, _values, result)1568 module_eval(<<'.,.,', 'C_parser.y.rb', 122) 1569 def _reduce_33(val, _values, result) 1458 1570 result = :OP_U_PLUS 1459 1571 result … … 1461 1573 .,., 1462 1574 1463 module_eval(<<'.,.,', 'C_parser.y.rb', 1 16)1464 def _reduce_3 2(val, _values, result)1575 module_eval(<<'.,.,', 'C_parser.y.rb', 123) 1576 def _reduce_34(val, _values, result) 1465 1577 result = :OP_U_MINUS 1466 1578 result … … 1468 1580 .,., 1469 1581 1470 module_eval(<<'.,.,', 'C_parser.y.rb', 1 17)1471 def _reduce_3 3(val, _values, result)1582 module_eval(<<'.,.,', 'C_parser.y.rb', 124) 1583 def _reduce_35(val, _values, result) 1472 1584 result = :OP_U_TILDE 1473 1585 result … … 1475 1587 .,., 1476 1588 1477 module_eval(<<'.,.,', 'C_parser.y.rb', 1 18)1478 def _reduce_3 4(val, _values, result)1589 module_eval(<<'.,.,', 'C_parser.y.rb', 125) 1590 def _reduce_36(val, _values, result) 1479 1591 result = :OP_U_EXCLAM 1480 1592 result … … 1482 1594 .,., 1483 1595 1484 # reduce 3 5omitted1485 1486 module_eval(<<'.,.,', 'C_parser.y.rb', 1 23)1487 def _reduce_3 6(val, _values, result)1596 # reduce 37 omitted 1597 1598 module_eval(<<'.,.,', 'C_parser.y.rb', 130) 1599 def _reduce_38(val, _values, result) 1488 1600 result = [ :CAST, val[1], val[3] ] 1489 1601 result … … 1491 1603 .,., 1492 1604 1493 # reduce 3 7omitted1494 1495 module_eval(<<'.,.,', 'C_parser.y.rb', 1 28)1496 def _reduce_ 38(val, _values, result)1605 # reduce 39 omitted 1606 1607 module_eval(<<'.,.,', 'C_parser.y.rb', 135) 1608 def _reduce_40(val, _values, result) 1497 1609 result = [ :OP_MULT, val[0], val[2] ] 1498 1610 result … … 1500 1612 .,., 1501 1613 1502 module_eval(<<'.,.,', 'C_parser.y.rb', 13 0)1503 def _reduce_ 39(val, _values, result)1614 module_eval(<<'.,.,', 'C_parser.y.rb', 137) 1615 def _reduce_41(val, _values, result) 1504 1616 result = [ :OP_DIV, val[0], val[2] ] 1505 1617 result … … 1507 1619 .,., 1508 1620 1509 module_eval(<<'.,.,', 'C_parser.y.rb', 13 2)1510 def _reduce_4 0(val, _values, result)1621 module_eval(<<'.,.,', 'C_parser.y.rb', 139) 1622 def _reduce_42(val, _values, result) 1511 1623 result = [ :OP_REMAIN, val[0], val[2] ] 1512 1624 result … … 1514 1626 .,., 1515 1627 1516 # reduce 4 1omitted1517 1518 module_eval(<<'.,.,', 'C_parser.y.rb', 1 37)1519 def _reduce_4 2(val, _values, result)1628 # reduce 43 omitted 1629 1630 module_eval(<<'.,.,', 'C_parser.y.rb', 144) 1631 def _reduce_44(val, _values, result) 1520 1632 result = [ :OP_ADD, val[0], val[2] ] 1521 1633 result … … 1523 1635 .,., 1524 1636 1525 module_eval(<<'.,.,', 'C_parser.y.rb', 1 39)1526 def _reduce_4 3(val, _values, result)1637 module_eval(<<'.,.,', 'C_parser.y.rb', 146) 1638 def _reduce_45(val, _values, result) 1527 1639 result = [ :OP_SUB, val[0], val[2] ] 1528 1640 result … … 1530 1642 .,., 1531 1643 1532 # reduce 4 4omitted1533 1534 module_eval(<<'.,.,', 'C_parser.y.rb', 1 44)1535 def _reduce_4 5(val, _values, result)1644 # reduce 46 omitted 1645 1646 module_eval(<<'.,.,', 'C_parser.y.rb', 151) 1647 def _reduce_47(val, _values, result) 1536 1648 result = [ :OP_LSFT, val[0], val[2] ] 1537 1649 result … … 1539 1651 .,., 1540 1652 1541 module_eval(<<'.,.,', 'C_parser.y.rb', 1 46)1542 def _reduce_4 6(val, _values, result)1653 module_eval(<<'.,.,', 'C_parser.y.rb', 153) 1654 def _reduce_48(val, _values, result) 1543 1655 result = [ :OP_RSFT, val[0], val[2] ] 1544 1656 result … … 1546 1658 .,., 1547 1659 1548 # reduce 4 7omitted1549 1550 module_eval(<<'.,.,', 'C_parser.y.rb', 15 1)1551 def _reduce_ 48(val, _values, result)1660 # reduce 49 omitted 1661 1662 module_eval(<<'.,.,', 'C_parser.y.rb', 158) 1663 def _reduce_50(val, _values, result) 1552 1664 result = [ :OP_LT, val[0], val[2] ] 1553 1665 result … … 1555 1667 .,., 1556 1668 1557 module_eval(<<'.,.,', 'C_parser.y.rb', 1 53)1558 def _reduce_ 49(val, _values, result)1669 module_eval(<<'.,.,', 'C_parser.y.rb', 160) 1670 def _reduce_51(val, _values, result) 1559 1671 result = [ :OP_GT, val[0], val[2] ] 1560 1672 result … … 1562 1674 .,., 1563 1675 1564 module_eval(<<'.,.,', 'C_parser.y.rb', 1 55)1565 def _reduce_5 0(val, _values, result)1676 module_eval(<<'.,.,', 'C_parser.y.rb', 162) 1677 def _reduce_52(val, _values, result) 1566 1678 result = [ :OP_LE, val[0], val[2] ] 1567 1679 result … … 1569 1681 .,., 1570 1682 1571 module_eval(<<'.,.,', 'C_parser.y.rb', 1 57)1572 def _reduce_5 1(val, _values, result)1683 module_eval(<<'.,.,', 'C_parser.y.rb', 164) 1684 def _reduce_53(val, _values, result) 1573 1685 result = [ :OP_GE, val[0], val[2] ] 1574 1686 result … … 1576 1688 .,., 1577 1689 1578 # reduce 5 2omitted1579 1580 module_eval(<<'.,.,', 'C_parser.y.rb', 16 2)1581 def _reduce_5 3(val, _values, result)1690 # reduce 54 omitted 1691 1692 module_eval(<<'.,.,', 'C_parser.y.rb', 169) 1693 def _reduce_55(val, _values, result) 1582 1694 result = [ :OP_EQ, val[0], val[2] ] 1583 1695 result … … 1585 1697 .,., 1586 1698 1587 module_eval(<<'.,.,', 'C_parser.y.rb', 1 64)1588 def _reduce_5 4(val, _values, result)1699 module_eval(<<'.,.,', 'C_parser.y.rb', 171) 1700 def _reduce_56(val, _values, result) 1589 1701 result = [ :OP_NE, val[0], val[2] ] 1590 1702 result … … 1592 1704 .,., 1593 1705 1594 # reduce 5 5omitted1595 1596 module_eval(<<'.,.,', 'C_parser.y.rb', 1 69)1597 def _reduce_5 6(val, _values, result)1706 # reduce 57 omitted 1707 1708 module_eval(<<'.,.,', 'C_parser.y.rb', 176) 1709 def _reduce_58(val, _values, result) 1598 1710 result = [ :OP_AND, val[0], val[2] ] 1599 1711 result … … 1601 1713 .,., 1602 1714 1603 # reduce 5 7omitted1604 1605 module_eval(<<'.,.,', 'C_parser.y.rb', 1 74)1606 def _reduce_ 58(val, _values, result)1715 # reduce 59 omitted 1716 1717 module_eval(<<'.,.,', 'C_parser.y.rb', 181) 1718 def _reduce_60(val, _values, result) 1607 1719 result = [ :OP_EOR, val[0], val[2] ] 1608 1720 result … … 1610 1722 .,., 1611 1723 1612 # reduce 59omitted1613 1614 module_eval(<<'.,.,', 'C_parser.y.rb', 1 79)1615 def _reduce_6 0(val, _values, result)1724 # reduce 61 omitted 1725 1726 module_eval(<<'.,.,', 'C_parser.y.rb', 186) 1727 def _reduce_62(val, _values, result) 1616 1728 result = [ :OP_OR, val[0], val[2] ] 1617 1729 result … … 1619 1731 .,., 1620 1732 1621 # reduce 6 1omitted1622 1623 module_eval(<<'.,.,', 'C_parser.y.rb', 1 84)1624 def _reduce_6 2(val, _values, result)1733 # reduce 63 omitted 1734 1735 module_eval(<<'.,.,', 'C_parser.y.rb', 191) 1736 def _reduce_64(val, _values, result) 1625 1737 result = [ :OP_LAND, val[0], val[2] ] 1626 1738 result … … 1628 1740 .,., 1629 1741 1630 # reduce 6 3omitted1631 1632 module_eval(<<'.,.,', 'C_parser.y.rb', 1 89)1633 def _reduce_6 4(val, _values, result)1742 # reduce 65 omitted 1743 1744 module_eval(<<'.,.,', 'C_parser.y.rb', 196) 1745 def _reduce_66(val, _values, result) 1634 1746 result = [ :OP_LOR, val[0], val[2] ] 1635 1747 result … … 1637 1749 .,., 1638 1750 1639 # reduce 6 5omitted1640 1641 module_eval(<<'.,.,', 'C_parser.y.rb', 194)1642 def _reduce_6 6(val, _values, result)1751 # reduce 67 omitted 1752 1753 module_eval(<<'.,.,', 'C_parser.y.rb', 201) 1754 def _reduce_68(val, _values, result) 1643 1755 result = [ :OP_CEX, val[0], val[2].get_elements, val[4] ] 1644 1756 result … … 1646 1758 .,., 1647 1759 1648 module_eval(<<'.,.,', 'C_parser.y.rb', 201) 1649 def _reduce_67(val, _values, result) 1760 # reduce 69 omitted 1761 1762 # reduce 70 omitted 1763 1764 # reduce 71 omitted 1765 1766 # reduce 72 omitted 1767 1768 # reduce 73 omitted 1769 1770 # reduce 74 omitted 1771 1772 # reduce 75 omitted 1773 1774 # reduce 76 omitted 1775 1776 # reduce 77 omitted 1777 1778 # reduce 78 omitted 1779 1780 # reduce 79 omitted 1781 1782 # reduce 80 omitted 1783 1784 # reduce 81 omitted 1785 1786 module_eval(<<'.,.,', 'C_parser.y.rb', 223) 1787 def _reduce_82(val, _values, result) 1650 1788 result = Expression.new( val[0] ) 1651 1789 # result.print … … 1655 1793 .,., 1656 1794 1657 module_eval(<<'.,.,', 'C_parser.y.rb', 208) 1658 def _reduce_68(val, _values, result) 1795 module_eval(<<'.,.,', 'C_parser.y.rb', 228) 1796 def _reduce_83(val, _values, result) 1797 result = Expression.new( val[2] ) # ',' の後ろを採用 1798 1799 result 1800 end 1801 .,., 1802 1803 module_eval(<<'.,.,', 'C_parser.y.rb', 234) 1804 def _reduce_84(val, _values, result) 1659 1805 result = Expression.new( val[0] ) 1660 1806 # result.print … … 1671 1817 .,., 1672 1818 1673 # reduce 69omitted1674 1675 module_eval(<<'.,.,', 'C_parser.y.rb', 2 37)1676 def _reduce_ 70(val, _values, result)1819 # reduce 85 omitted 1820 1821 module_eval(<<'.,.,', 'C_parser.y.rb', 261) 1822 def _reduce_86(val, _values, result) 1677 1823 result = CIntType.new( -3 ) # storage class は無視 1678 1824 … … 1681 1827 .,., 1682 1828 1683 # reduce 71 omitted 1684 1685 module_eval(<<'.,.,', 'C_parser.y.rb', 242) 1686 def _reduce_72(val, _values, result) 1829 module_eval(<<'.,.,', 'C_parser.y.rb', 265) 1830 def _reduce_87(val, _values, result) 1831 result = val[1] # storage class は無視 1832 1833 result 1834 end 1835 .,., 1836 1837 # reduce 88 omitted 1838 1839 module_eval(<<'.,.,', 'C_parser.y.rb', 270) 1840 def _reduce_89(val, _values, result) 1841 result = val[1].merge val[0] 1842 1843 result 1844 end 1845 .,., 1846 1847 module_eval(<<'.,.,', 'C_parser.y.rb', 274) 1848 def _reduce_90(val, _values, result) 1687 1849 result = CIntType.new( -3 ) 1688 1850 result.set_qualifier val[0] … … 1692 1854 .,., 1693 1855 1694 module_eval(<<'.,.,', 'C_parser.y.rb', 247) 1695 def _reduce_73(val, _values, result) 1696 result = val[1] # storage class は無視 1697 1698 result 1699 end 1700 .,., 1701 1702 module_eval(<<'.,.,', 'C_parser.y.rb', 251) 1703 def _reduce_74(val, _values, result) 1704 result = val[1].merge val[0] 1705 1706 result 1707 end 1708 .,., 1709 1710 module_eval(<<'.,.,', 'C_parser.y.rb', 255) 1711 def _reduce_75(val, _values, result) 1856 module_eval(<<'.,.,', 'C_parser.y.rb', 279) 1857 def _reduce_91(val, _values, result) 1712 1858 val[1].set_qualifier val[0] 1713 result = val[1] 1714 1715 result 1716 end 1717 .,., 1718 1719 module_eval(<<'.,.,', 'C_parser.y.rb', 262) 1720 def _reduce_76(val, _values, result) 1859 result = val[1] 1860 1861 result 1862 end 1863 .,., 1864 1865 # reduce 92 omitted 1866 1867 # reduce 93 omitted 1868 1869 module_eval(<<'.,.,', 'C_parser.y.rb', 287) 1870 def _reduce_94(val, _values, result) 1721 1871 result = [val[0]] 1722 1872 result … … 1724 1874 .,., 1725 1875 1726 module_eval(<<'.,.,', 'C_parser.y.rb', 2 64)1727 def _reduce_ 77(val, _values, result)1876 module_eval(<<'.,.,', 'C_parser.y.rb', 289) 1877 def _reduce_95(val, _values, result) 1728 1878 result << val[2] 1729 1879 result … … 1731 1881 .,., 1732 1882 1733 # reduce 78omitted1734 1735 module_eval(<<'.,.,', 'C_parser.y.rb', 2 69)1736 def _reduce_ 79(val, _values, result)1883 # reduce 96 omitted 1884 1885 module_eval(<<'.,.,', 'C_parser.y.rb', 294) 1886 def _reduce_97(val, _values, result) 1737 1887 val[0].set_initializer( val[2] ) 1738 1888 result … … 1740 1890 .,., 1741 1891 1742 module_eval(<<'.,.,', 'C_parser.y.rb', 272) 1743 def _reduce_80(val, _values, result) 1892 # reduce 98 omitted 1893 1894 # reduce 99 omitted 1895 1896 # reduce 100 omitted 1897 1898 # reduce 101 omitted 1899 1900 module_eval(<<'.,.,', 'C_parser.y.rb', 304) 1901 def _reduce_102(val, _values, result) 1744 1902 set_no_type_name true; result = CVoidType.new 1745 1903 result … … 1747 1905 .,., 1748 1906 1749 module_eval(<<'.,.,', 'C_parser.y.rb', 273) 1750 def _reduce_81(val, _values, result) 1907 module_eval(<<'.,.,', 'C_parser.y.rb', 306) 1908 def _reduce_103(val, _values, result) 1909 set_no_type_name true; result = CIntType.new(-11 ) 1910 result 1911 end 1912 .,., 1913 1914 module_eval(<<'.,.,', 'C_parser.y.rb', 308) 1915 def _reduce_104(val, _values, result) 1916 set_no_type_name true; result = CIntType.new( -2 ) 1917 result 1918 end 1919 .,., 1920 1921 module_eval(<<'.,.,', 'C_parser.y.rb', 310) 1922 def _reduce_105(val, _values, result) 1923 set_no_type_name true; result = CIntType.new( -3 ) 1924 result 1925 end 1926 .,., 1927 1928 module_eval(<<'.,.,', 'C_parser.y.rb', 312) 1929 def _reduce_106(val, _values, result) 1930 set_no_type_name true; result = CIntType.new( -4 ) 1931 result 1932 end 1933 .,., 1934 1935 module_eval(<<'.,.,', 'C_parser.y.rb', 314) 1936 def _reduce_107(val, _values, result) 1751 1937 set_no_type_name true; result = CFloatType.new(-32) 1752 1938 result … … 1754 1940 .,., 1755 1941 1756 module_eval(<<'.,.,', 'C_parser.y.rb', 274)1757 def _reduce_ 82(val, _values, result)1942 module_eval(<<'.,.,', 'C_parser.y.rb', 316) 1943 def _reduce_108(val, _values, result) 1758 1944 set_no_type_name true; result = CFloatType.new(-64) 1759 1945 result … … 1761 1947 .,., 1762 1948 1763 module_eval(<<'.,.,', 'C_parser.y.rb', 275) 1764 def _reduce_83(val, _values, result) 1765 set_no_type_name true; result = CBoolType.new 1766 result 1767 end 1768 .,., 1769 1770 module_eval(<<'.,.,', 'C_parser.y.rb', 276) 1771 def _reduce_84(val, _values, result) 1772 set_no_type_name true; result = val[0] 1773 result 1774 end 1775 .,., 1776 1777 module_eval(<<'.,.,', 'C_parser.y.rb', 277) 1778 def _reduce_85(val, _values, result) 1779 set_no_type_name true; result = CVoidType.new 1780 result 1781 end 1782 .,., 1783 1784 module_eval(<<'.,.,', 'C_parser.y.rb', 278) 1785 def _reduce_86(val, _values, result) 1786 set_no_type_name true; result = CVoidType.new 1787 result 1788 end 1789 .,., 1790 1791 module_eval(<<'.,.,', 'C_parser.y.rb', 279) 1792 def _reduce_87(val, _values, result) 1793 set_no_type_name true; result = CDefinedType.new( val[0].val ) 1794 result 1795 end 1796 .,., 1797 1798 module_eval(<<'.,.,', 'C_parser.y.rb', 281) 1799 def _reduce_88(val, _values, result) 1800 set_no_type_name true; result = CIntType.new(-11 ) 1801 result 1802 end 1803 .,., 1804 1805 module_eval(<<'.,.,', 'C_parser.y.rb', 282) 1806 def _reduce_89(val, _values, result) 1807 set_no_type_name true; result = CIntType.new( -2 ) 1808 result 1809 end 1810 .,., 1811 1812 module_eval(<<'.,.,', 'C_parser.y.rb', 283) 1813 def _reduce_90(val, _values, result) 1814 set_no_type_name true; result = CIntType.new( -3 ) 1815 result 1816 end 1817 .,., 1818 1819 module_eval(<<'.,.,', 'C_parser.y.rb', 284) 1820 def _reduce_91(val, _values, result) 1821 set_no_type_name true; result = CIntType.new( -4 ) 1822 result 1823 end 1824 .,., 1825 1826 module_eval(<<'.,.,', 'C_parser.y.rb', 287) 1827 def _reduce_92(val, _values, result) 1949 module_eval(<<'.,.,', 'C_parser.y.rb', 319) 1950 def _reduce_109(val, _values, result) 1828 1951 set_no_type_name true 1829 1952 result = CIntType.new( -3 ) … … 1834 1957 .,., 1835 1958 1836 module_eval(<<'.,.,', 'C_parser.y.rb', 293)1837 def _reduce_ 93(val, _values, result)1959 module_eval(<<'.,.,', 'C_parser.y.rb', 325) 1960 def _reduce_110(val, _values, result) 1838 1961 set_no_type_name true 1839 1962 result = CIntType.new( -3 ) … … 1844 1967 .,., 1845 1968 1846 module_eval(<<'.,.,', 'C_parser.y.rb', 301) 1847 def _reduce_94(val, _values, result) 1969 module_eval(<<'.,.,', 'C_parser.y.rb', 330) 1970 def _reduce_111(val, _values, result) 1971 set_no_type_name true; result = CBoolType.new 1972 result 1973 end 1974 .,., 1975 1976 module_eval(<<'.,.,', 'C_parser.y.rb', 332) 1977 def _reduce_112(val, _values, result) 1978 set_no_type_name true; result = val[0] 1979 result 1980 end 1981 .,., 1982 1983 module_eval(<<'.,.,', 'C_parser.y.rb', 334) 1984 def _reduce_113(val, _values, result) 1985 set_no_type_name true; result = CVoidType.new 1986 result 1987 end 1988 .,., 1989 1990 module_eval(<<'.,.,', 'C_parser.y.rb', 336) 1991 def _reduce_114(val, _values, result) 1992 set_no_type_name true; result = CVoidType.new 1993 result 1994 end 1995 .,., 1996 1997 module_eval(<<'.,.,', 'C_parser.y.rb', 338) 1998 def _reduce_115(val, _values, result) 1999 set_no_type_name true; result = CDefinedType.new( val[0].val ) 2000 result 2001 end 2002 .,., 2003 2004 module_eval(<<'.,.,', 'C_parser.y.rb', 344) 2005 def _reduce_116(val, _values, result) 1848 2006 StructType.set_define( true ) 1849 2007 result … … 1851 2009 .,., 1852 2010 1853 module_eval(<<'.,.,', 'C_parser.y.rb', 3 04)1854 def _reduce_ 95(val, _values, result)2011 module_eval(<<'.,.,', 'C_parser.y.rb', 347) 2012 def _reduce_117(val, _values, result) 1855 2013 StructType.end_of_parse 1856 2014 result = val[1] … … 1860 2018 .,., 1861 2019 1862 module_eval(<<'.,.,', 'C_parser.y.rb', 3 09)1863 def _reduce_ 96(val, _values, result)2020 module_eval(<<'.,.,', 'C_parser.y.rb', 353) 2021 def _reduce_118(val, _values, result) 1864 2022 result = CStructType.new() 1865 2023 StructType.set_define( true ) … … 1869 2027 .,., 1870 2028 1871 module_eval(<<'.,.,', 'C_parser.y.rb', 3 14)1872 def _reduce_ 97(val, _values, result)2029 module_eval(<<'.,.,', 'C_parser.y.rb', 358) 2030 def _reduce_119(val, _values, result) 1873 2031 StructType.end_of_parse 1874 2032 result = val[1] … … 1878 2036 .,., 1879 2037 1880 module_eval(<<'.,.,', 'C_parser.y.rb', 3 19)1881 def _reduce_ 98(val, _values, result)2038 module_eval(<<'.,.,', 'C_parser.y.rb', 364) 2039 def _reduce_120(val, _values, result) 1882 2040 StructType.set_define( false ) 1883 2041 StructType.end_of_parse … … 1888 2046 .,., 1889 2047 1890 # reduce 99 omitted 1891 1892 # reduce 100 omitted 1893 1894 module_eval(<<'.,.,', 'C_parser.y.rb', 331) 1895 def _reduce_101(val, _values, result) 2048 module_eval(<<'.,.,', 'C_parser.y.rb', 370) 2049 def _reduce_121(val, _values, result) 2050 set_no_type_name true 2051 result 2052 end 2053 .,., 2054 2055 # reduce 122 omitted 2056 2057 # reduce 123 omitted 2058 2059 module_eval(<<'.,.,', 'C_parser.y.rb', 379) 2060 def _reduce_124(val, _values, result) 1896 2061 result = CStructType.new( val[0].val ) 1897 2062 set_no_type_name true … … 1901 2066 .,., 1902 2067 1903 module_eval(<<'.,.,', 'C_parser.y.rb', 3 40)1904 def _reduce_1 02(val, _values, result)2068 module_eval(<<'.,.,', 'C_parser.y.rb', 388) 2069 def _reduce_125(val, _values, result) 1905 2070 val[1].each { |i| # i: Decl 1906 2071 i.set_type( val[0] ) … … 1915 2080 .,., 1916 2081 1917 # reduce 103 omitted 1918 1919 # reduce 104 omitted 1920 1921 # reduce 105 omitted 1922 1923 module_eval(<<'.,.,', 'C_parser.y.rb', 359) 1924 def _reduce_106(val, _values, result) 2082 module_eval(<<'.,.,', 'C_parser.y.rb', 399) 2083 def _reduce_126(val, _values, result) 2084 val[1].each { |i| # i: Decl 2085 i.set_type( val[0] ) 2086 i.set_kind( :MEMBER ) 2087 i.check 2088 CStructType.new_member( i ) 2089 } 2090 result = val[1] 2091 2092 result 2093 end 2094 .,., 2095 2096 # reduce 127 omitted 2097 2098 # reduce 128 omitted 2099 2100 module_eval(<<'.,.,', 'C_parser.y.rb', 417) 2101 def _reduce_129(val, _values, result) 1925 2102 result = val[1].merge val[0] 1926 2103 … … 1929 2106 .,., 1930 2107 1931 module_eval(<<'.,.,', 'C_parser.y.rb', 363) 1932 def _reduce_107(val, _values, result) 2108 # reduce 130 omitted 2109 2110 module_eval(<<'.,.,', 'C_parser.y.rb', 422) 2111 def _reduce_131(val, _values, result) 2112 val[1].set_qualifier val[0] 2113 result = val[1] 2114 2115 result 2116 end 2117 .,., 2118 2119 module_eval(<<'.,.,', 'C_parser.y.rb', 427) 2120 def _reduce_132(val, _values, result) 1933 2121 result = CIntType.new( -3 ) 1934 2122 result.set_qualifier val[0] … … 1938 2126 .,., 1939 2127 1940 module_eval(<<'.,.,', 'C_parser.y.rb', 368) 1941 def _reduce_108(val, _values, result) 1942 val[1].set_qualifier val[0] 1943 result = val[1] 1944 1945 result 1946 end 1947 .,., 1948 1949 module_eval(<<'.,.,', 'C_parser.y.rb', 374) 1950 def _reduce_109(val, _values, result) 2128 module_eval(<<'.,.,', 'C_parser.y.rb', 433) 2129 def _reduce_133(val, _values, result) 1951 2130 result = [ val[0] ] 1952 2131 result … … 1954 2133 .,., 1955 2134 1956 module_eval(<<'.,.,', 'C_parser.y.rb', 376)1957 def _reduce_1 10(val, _values, result)2135 module_eval(<<'.,.,', 'C_parser.y.rb', 435) 2136 def _reduce_134(val, _values, result) 1958 2137 result << val[2] 1959 2138 result … … 1961 2140 .,., 1962 2141 1963 # reduce 111 omitted 1964 1965 # reduce 112 omitted 1966 1967 # reduce 113 omitted 1968 1969 # reduce 114 omitted 1970 1971 # reduce 115 omitted 1972 1973 # reduce 116 omitted 1974 1975 # reduce 117 omitted 1976 1977 # reduce 118 omitted 1978 1979 # reduce 119 omitted 1980 1981 # reduce 120 omitted 1982 1983 # reduce 121 omitted 1984 1985 # reduce 122 omitted 1986 1987 # reduce 123 omitted 1988 1989 # reduce 124 omitted 1990 1991 # reduce 125 omitted 1992 1993 # reduce 126 omitted 1994 1995 module_eval(<<'.,.,', 'C_parser.y.rb', 418) 1996 def _reduce_127(val, _values, result) 1997 result = CEnumType.new( -1 ) 1998 result 1999 end 2000 .,., 2001 2002 # reduce 128 omitted 2003 2004 # reduce 129 omitted 2005 2006 # reduce 130 omitted 2007 2008 # reduce 131 omitted 2009 2010 module_eval(<<'.,.,', 'C_parser.y.rb', 434) 2011 def _reduce_132(val, _values, result) 2142 # reduce 135 omitted 2143 2144 # reduce 136 omitted 2145 2146 # reduce 137 omitted 2147 2148 # reduce 138 omitted 2149 2150 module_eval(<<'.,.,', 'C_parser.y.rb', 452) 2151 def _reduce_139(val, _values, result) 2152 set_no_type_name true 2153 result 2154 end 2155 .,., 2156 2157 # reduce 140 omitted 2158 2159 # reduce 141 omitted 2160 2161 # reduce 142 omitted 2162 2163 # reduce 143 omitted 2164 2165 # reduce 144 omitted 2166 2167 # reduce 145 omitted 2168 2169 # reduce 146 omitted 2170 2171 # reduce 147 omitted 2172 2173 # reduce 148 omitted 2174 2175 # reduce 149 omitted 2176 2177 # reduce 150 omitted 2178 2179 # reduce 151 omitted 2180 2181 # reduce 152 omitted 2182 2183 # reduce 153 omitted 2184 2185 # reduce 154 omitted 2186 2187 # reduce 155 omitted 2188 2189 # reduce 156 omitted 2190 2191 # reduce 157 omitted 2192 2193 # reduce 158 omitted 2194 2195 # reduce 159 omitted 2196 2197 # reduce 160 omitted 2198 2199 # reduce 161 omitted 2200 2201 # reduce 162 omitted 2202 2203 module_eval(<<'.,.,', 'C_parser.y.rb', 495) 2204 def _reduce_163(val, _values, result) 2012 2205 result = :CONST 2013 2206 result … … 2015 2208 .,., 2016 2209 2017 module_eval(<<'.,.,', 'C_parser.y.rb', 435) 2018 def _reduce_133(val, _values, result) 2210 # reduce 164 omitted 2211 2212 module_eval(<<'.,.,', 'C_parser.y.rb', 498) 2213 def _reduce_165(val, _values, result) 2019 2214 result = :VOLATILE 2020 2215 result … … 2022 2217 .,., 2023 2218 2024 module_eval(<<'.,.,', 'C_parser.y.rb', 440) 2025 def _reduce_134(val, _values, result) 2219 # reduce 166 omitted 2220 2221 # reduce 167 omitted 2222 2223 # reduce 168 omitted 2224 2225 # reduce 169 omitted 2226 2227 module_eval(<<'.,.,', 'C_parser.y.rb', 509) 2228 def _reduce_170(val, _values, result) 2026 2229 val[1].set_type( val[0] ) 2027 2230 result = val[1] … … 2031 2234 .,., 2032 2235 2033 # reduce 1 35omitted2034 2035 module_eval(<<'.,.,', 'C_parser.y.rb', 446)2036 def _reduce_1 36(val, _values, result)2236 # reduce 171 omitted 2237 2238 module_eval(<<'.,.,', 'C_parser.y.rb', 515) 2239 def _reduce_172(val, _values, result) 2037 2240 result = Decl.new( val[1].val ) 2038 2241 result.set_type( val[0] ) … … 2042 2245 .,., 2043 2246 2044 module_eval(<<'.,.,', 'C_parser.y.rb', 452)2045 def _reduce_1 37(val, _values, result)2247 module_eval(<<'.,.,', 'C_parser.y.rb', 521) 2248 def _reduce_173(val, _values, result) 2046 2249 result = Decl.new( val[0].val ) 2047 2250 result … … 2049 2252 .,., 2050 2253 2051 module_eval(<<'.,.,', 'C_parser.y.rb', 454)2052 def _reduce_1 38(val, _values, result)2254 module_eval(<<'.,.,', 'C_parser.y.rb', 523) 2255 def _reduce_174(val, _values, result) 2053 2256 result = val[1] 2054 2257 result … … 2056 2259 .,., 2057 2260 2058 module_eval(<<'.,.,', 'C_parser.y.rb', 457)2059 def _reduce_1 39(val, _values, result)2261 module_eval(<<'.,.,', 'C_parser.y.rb', 526) 2262 def _reduce_175(val, _values, result) 2060 2263 val[0].set_type( CArrayType.new( val[2] ) ) 2061 2264 result = val[0] … … 2065 2268 .,., 2066 2269 2067 module_eval(<<'.,.,', 'C_parser.y.rb', 462)2068 def _reduce_1 40(val, _values, result)2270 module_eval(<<'.,.,', 'C_parser.y.rb', 531) 2271 def _reduce_176(val, _values, result) 2069 2272 val[0].set_type( CArrayType.new ) 2070 2273 result = val[0] … … 2074 2277 .,., 2075 2278 2076 module_eval(<<'.,.,', 'C_parser.y.rb', 467)2077 def _reduce_1 41(val, _values, result)2279 module_eval(<<'.,.,', 'C_parser.y.rb', 536) 2280 def _reduce_177(val, _values, result) 2078 2281 # Generator.warning( "W6001 need 'void' for no parameter" ) 2079 2282 val[0].set_type( CFuncType.new ) … … 2084 2287 .,., 2085 2288 2086 module_eval(<<'.,.,', 'C_parser.y.rb', 475) 2087 def _reduce_142(val, _values, result) 2289 # reduce 178 omitted 2290 2291 module_eval(<<'.,.,', 'C_parser.y.rb', 543) 2292 def _reduce_179(val, _values, result) 2088 2293 # Generator.warning( "W6002 need 'void' for no parameter" ) 2089 2294 val[0].set_type( CFuncType.new ) … … 2094 2299 .,., 2095 2300 2096 module_eval(<<'.,.,', 'C_parser.y.rb', 482)2097 def _reduce_1 43(val, _values, result)2301 module_eval(<<'.,.,', 'C_parser.y.rb', 550) 2302 def _reduce_180(val, _values, result) 2098 2303 result = CPtrType.new 2099 2304 result … … 2101 2306 .,., 2102 2307 2103 module_eval(<<'.,.,', 'C_parser.y.rb', 485)2104 def _reduce_1 44(val, _values, result)2308 module_eval(<<'.,.,', 'C_parser.y.rb', 553) 2309 def _reduce_181(val, _values, result) 2105 2310 result = CPtrType.new 2106 2311 result.set_qualifier( val[1] ) … … 2110 2315 .,., 2111 2316 2112 module_eval(<<'.,.,', 'C_parser.y.rb', 490)2113 def _reduce_1 45(val, _values, result)2317 module_eval(<<'.,.,', 'C_parser.y.rb', 558) 2318 def _reduce_182(val, _values, result) 2114 2319 val[1].set_type(CPtrType.new) 2115 2320 result = val[1] … … 2119 2324 .,., 2120 2325 2121 module_eval(<<'.,.,', 'C_parser.y.rb', 495)2122 def _reduce_1 46(val, _values, result)2326 module_eval(<<'.,.,', 'C_parser.y.rb', 563) 2327 def _reduce_183(val, _values, result) 2123 2328 ptrtype = CPtrType.new 2124 2329 ptrtype.set_qualifier( val[1] ) … … 2130 2335 .,., 2131 2336 2132 # reduce 147 omitted 2133 2134 # reduce 148 omitted 2135 2136 # reduce 149 omitted 2137 2138 # reduce 150 omitted 2139 2140 # reduce 151 omitted 2141 2142 # reduce 152 omitted 2143 2144 # reduce 153 omitted 2145 2146 # reduce 154 omitted 2147 2148 # reduce 155 omitted 2149 2150 # reduce 156 omitted 2151 2152 # reduce 157 omitted 2153 2154 # reduce 158 omitted 2155 2156 # reduce 159 omitted 2157 2158 # reduce 160 omitted 2159 2160 # reduce 161 omitted 2161 2162 # reduce 162 omitted 2163 2164 # reduce 163 omitted 2165 2166 module_eval(<<'.,.,', 'C_parser.y.rb', 559) 2167 def _reduce_164(val, _values, result) 2337 # reduce 184 omitted 2338 2339 # reduce 185 omitted 2340 2341 # reduce 186 omitted 2342 2343 # reduce 187 omitted 2344 2345 # reduce 188 omitted 2346 2347 # reduce 189 omitted 2348 2349 # reduce 190 omitted 2350 2351 # reduce 191 omitted 2352 2353 # reduce 192 omitted 2354 2355 # reduce 193 omitted 2356 2357 # reduce 194 omitted 2358 2359 # reduce 195 omitted 2360 2361 # reduce 196 omitted 2362 2363 # reduce 197 omitted 2364 2365 # reduce 198 omitted 2366 2367 # reduce 199 omitted 2368 2369 # reduce 200 omitted 2370 2371 # reduce 201 omitted 2372 2373 # reduce 202 omitted 2374 2375 # reduce 203 omitted 2376 2377 # reduce 204 omitted 2378 2379 module_eval(<<'.,.,', 'C_parser.y.rb', 630) 2380 def _reduce_205(val, _values, result) 2168 2381 Generator.warning( "W6003 need 'void' for no parameter" ) 2169 2382 … … 2172 2385 .,., 2173 2386 2174 # reduce 165omitted2175 2176 module_eval(<<'.,.,', 'C_parser.y.rb', 564)2177 def _reduce_ 166(val, _values, result)2387 # reduce 206 omitted 2388 2389 module_eval(<<'.,.,', 'C_parser.y.rb', 635) 2390 def _reduce_207(val, _values, result) 2178 2391 Generator.warning( "W6004 need 'void' for no parameter" ) 2179 2392 … … 2182 2395 .,., 2183 2396 2184 # reduce 167omitted2185 2186 module_eval(<<'.,.,', 'C_parser.y.rb', 571)2187 def _reduce_ 168(val, _values, result)2397 # reduce 208 omitted 2398 2399 module_eval(<<'.,.,', 'C_parser.y.rb', 642) 2400 def _reduce_209(val, _values, result) 2188 2401 result = val[0] 2189 2402 result … … 2191 2404 .,., 2192 2405 2193 module_eval(<<'.,.,', 'C_parser.y.rb', 573)2194 def _reduce_ 169(val, _values, result)2406 module_eval(<<'.,.,', 'C_parser.y.rb', 644) 2407 def _reduce_210(val, _values, result) 2195 2408 result = val[1] 2196 2409 result … … 2198 2411 .,., 2199 2412 2200 module_eval(<<'.,.,', 'C_parser.y.rb', 575)2201 def _reduce_ 170(val, _values, result)2413 module_eval(<<'.,.,', 'C_parser.y.rb', 646) 2414 def _reduce_211(val, _values, result) 2202 2415 result = val[1] 2203 2416 result … … 2205 2418 .,., 2206 2419 2207 module_eval(<<'.,.,', 'C_parser.y.rb', 577)2208 def _reduce_ 171(val, _values, result)2420 module_eval(<<'.,.,', 'C_parser.y.rb', 648) 2421 def _reduce_212(val, _values, result) 2209 2422 result = C_EXP.new( val[2] ) 2210 2423 result … … 2212 2425 .,., 2213 2426 2214 module_eval(<<'.,.,', 'C_parser.y.rb', 582)2215 def _reduce_ 172(val, _values, result)2427 module_eval(<<'.,.,', 'C_parser.y.rb', 653) 2428 def _reduce_213(val, _values, result) 2216 2429 result = [ val[0] ] 2217 2430 … … 2220 2433 .,., 2221 2434 2222 module_eval(<<'.,.,', 'C_parser.y.rb', 586)2223 def _reduce_ 173(val, _values, result)2435 module_eval(<<'.,.,', 'C_parser.y.rb', 657) 2436 def _reduce_214(val, _values, result) 2224 2437 val[0] << val[2] 2225 2438 result = val[0] … … 2229 2442 .,., 2230 2443 2231 # reduce 174omitted2232 2233 # reduce 175omitted2234 2235 # reduce 176omitted2236 2237 # reduce 177omitted2238 2239 # reduce 178omitted2240 2241 # reduce 179omitted2242 2243 # reduce 180omitted2244 2245 # reduce 181omitted2246 2247 # reduce 182omitted2248 2249 # reduce 183omitted2250 2251 # reduce 184omitted2252 2253 module_eval(<<'.,.,', 'C_parser.y.rb', 6 14)2254 def _reduce_ 185(val, _values, result)2444 # reduce 215 omitted 2445 2446 # reduce 216 omitted 2447 2448 # reduce 217 omitted 2449 2450 # reduce 218 omitted 2451 2452 # reduce 219 omitted 2453 2454 # reduce 220 omitted 2455 2456 # reduce 221 omitted 2457 2458 # reduce 222 omitted 2459 2460 # reduce 223 omitted 2461 2462 # reduce 224 omitted 2463 2464 # reduce 225 omitted 2465 2466 module_eval(<<'.,.,', 'C_parser.y.rb', 685) 2467 def _reduce_226(val, _values, result) 2255 2468 val[2].each{ |i| 2256 2469 i.set_kind( :TYPEDEF ) … … 2263 2476 .,., 2264 2477 2265 module_eval(<<'.,.,', 'C_parser.y.rb', 6 23)2266 def _reduce_ 186(val, _values, result)2478 module_eval(<<'.,.,', 'C_parser.y.rb', 694) 2479 def _reduce_227(val, _values, result) 2267 2480 result = [ val[0] ] 2268 2481 result … … 2270 2483 .,., 2271 2484 2272 module_eval(<<'.,.,', 'C_parser.y.rb', 6 25)2273 def _reduce_ 187(val, _values, result)2485 module_eval(<<'.,.,', 'C_parser.y.rb', 696) 2486 def _reduce_228(val, _values, result) 2274 2487 result << val[2] 2275 2488 result … … 2277 2490 .,., 2278 2491 2279 # reduce 188 omitted2280 2281 # reduce 189 omitted2282 2283 # reduce 190 omitted2284 2285 # reduce 191 omitted2286 2287 # reduce 192 omitted2288 2289 # reduce 193 omitted2290 2291 # reduce 194 omitted2292 2293 # reduce 195 omitted2294 2295 # reduce 196 omitted2296 2297 # reduce 197 omitted2298 2299 # reduce 198 omitted2300 2301 # reduce 199 omitted2302 2303 # reduce 200 omitted2304 2305 # reduce 201 omitted2306 2307 # reduce 202 omitted2308 2309 # reduce 203 omitted2310 2311 # reduce 204 omitted2312 2313 # reduce 205 omitted2314 2315 # reduce 206 omitted2316 2317 # reduce 207 omitted2318 2319 # reduce 208 omitted2320 2321 # reduce 209 omitted2322 2323 # reduce 210 omitted2324 2325 # reduce 211 omitted2326 2327 # reduce 212 omitted2328 2329 # reduce 213 omitted2330 2331 # reduce 214 omitted2332 2333 # reduce 215 omitted2334 2335 # reduce 216 omitted2336 2337 # reduce 217 omitted2338 2339 # reduce 218 omitted2340 2341 # reduce 219 omitted2342 2343 # reduce 220 omitted2344 2345 # reduce 221 omitted2346 2347 # reduce 222 omitted2348 2349 # reduce 223 omitted2350 2351 # reduce 224 omitted2352 2353 # reduce 225 omitted2354 2355 # reduce 226 omitted2356 2357 # reduce 227 omitted2358 2359 # reduce 228 omitted2360 2361 2492 # reduce 229 omitted 2362 2493 … … 2377 2508 # reduce 237 omitted 2378 2509 2379 module_eval(<<'.,.,', 'C_parser.y.rb', 706) 2380 def _reduce_238(val, _values, result) 2510 # reduce 238 omitted 2511 2512 # reduce 239 omitted 2513 2514 # reduce 240 omitted 2515 2516 # reduce 241 omitted 2517 2518 # reduce 242 omitted 2519 2520 # reduce 243 omitted 2521 2522 # reduce 244 omitted 2523 2524 # reduce 245 omitted 2525 2526 # reduce 246 omitted 2527 2528 # reduce 247 omitted 2529 2530 # reduce 248 omitted 2531 2532 # reduce 249 omitted 2533 2534 # reduce 250 omitted 2535 2536 # reduce 251 omitted 2537 2538 # reduce 252 omitted 2539 2540 # reduce 253 omitted 2541 2542 # reduce 254 omitted 2543 2544 # reduce 255 omitted 2545 2546 # reduce 256 omitted 2547 2548 # reduce 257 omitted 2549 2550 # reduce 258 omitted 2551 2552 # reduce 259 omitted 2553 2554 # reduce 260 omitted 2555 2556 # reduce 261 omitted 2557 2558 # reduce 262 omitted 2559 2560 # reduce 263 omitted 2561 2562 # reduce 264 omitted 2563 2564 module_eval(<<'.,.,', 'C_parser.y.rb', 761) 2565 def _reduce_265(val, _values, result) 2381 2566 result = NamespacePath.new( val[0].val, false ) 2382 2567 result … … 2384 2569 .,., 2385 2570 2386 module_eval(<<'.,.,', 'C_parser.y.rb', 7 07)2387 def _reduce_2 39(val, _values, result)2571 module_eval(<<'.,.,', 'C_parser.y.rb', 762) 2572 def _reduce_266(val, _values, result) 2388 2573 result = NamespacePath.new( val[1].val, true ) 2389 2574 result … … 2391 2576 .,., 2392 2577 2393 module_eval(<<'.,.,', 'C_parser.y.rb', 7 09)2394 def _reduce_2 40(val, _values, result)2578 module_eval(<<'.,.,', 'C_parser.y.rb', 764) 2579 def _reduce_267(val, _values, result) 2395 2580 result = val[0].append!( val[2].val ) 2581 result 2582 end 2583 .,., 2584 2585 module_eval(<<'.,.,', 'C_parser.y.rb', 768) 2586 def _reduce_268(val, _values, result) 2587 while true 2588 # ';' が表れるまで、トークンを読み飛ばす。 2589 # gcc の構文拡張に対応すべきだが、単純な実装として、';' まで読み飛ばす。 2590 # トークン単位で読み飛ばしているので、文字列やコメント内の ';' は対象にならない。 2591 token = next_token 2592 if token[1].val == ";" 2593 break 2594 end 2595 # p "skip: #{token[1].val}" 2596 end 2597 2396 2598 result 2397 2599 end -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecslib/core/C_parser.y.rb
r321 r429 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 # 上記著作権者は,以下の(1) ~(4)の条件を満たす場合に限り,本ソフトウェ8 # 上記著作権者は,以下の(1)〜(4)の条件を満たす場合に限り,本ソフトウェ 9 9 # ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改 10 10 # 変・再配布(以下,利用と呼ぶ)することを無償で許諾する. … … 35 35 # の責任を負わない. 36 36 # 37 # $Id $37 # $Id: C_parser.y.rb 2810 2018-03-11 13:20:03Z okuma-top $ 38 38 #++ 39 39 … … 48 48 # argument_expression_list(関数引数), assignment_expression(代入)がない 49 49 # 式の result は、すべて配列で第一要素が識別シンボル、第二要素以下が引数 50 # 51 # 2019/3/28 長島 下記のC99の構文に近づくよう変更 52 #(読めないヘッダーファイルがあったため) 53 # http://www.quut.com/c/ANSI-C-grammar-y-1999.html 54 # 元々のコメントと合わなくなっています 50 55 51 56 primary_expression 52 57 : namespace_identifier 53 58 { result = [ :IDENTIFIER, val[0] ] } #1ok 54 59 # : IDENTIFIER # mikan namespace への対応 … … 58 63 # | FALSE 59 64 # { result = [ :BOOL_CONSTANT, false ] } 60 65 | INTEGER_CONSTANT 61 66 { result = [ :INTEGER_CONSTANT, val[0] ] } 62 67 | FLOATING_CONSTANT 63 68 { result = [ :FLOATING_CONSTANT, val[0] ] } 64 69 | OCTAL_CONSTANT 65 70 { result = [ :OCTAL_CONSTANT, val[0] ] } 66 71 | HEX_CONSTANT 67 72 { result = [ :HEX_CONSTANT, val[0] ] } 68 73 | CHARACTER_LITERAL 69 74 { result = [ :CHARACTER_LITERAL, val[0] ] } 70 75 | string_literal_list 71 76 { result = [ :STRING_LITERAL_LIST, val[0] ] } 72 77 | '(' expression ')' 73 78 { result = [ :PARENTHESES, val[1].get_elements ] } 74 79 75 80 string_literal_list 76 81 : STRING_LITERAL 77 82 { result = [val[0]] } 78 83 | string_literal_list STRING_LITERAL 79 84 { result << val[1] } 80 85 81 86 # 関数呼び出しと後置インクリメント、デクリメント演算子がない 82 87 postfix_expression 83 : primary_expression 84 | primary_expression '(' argument_list ')' 85 | primary_expression type_qualifier '(' argument_list ')' # intended __asm volatile ( " MNEMONIC OPERAND" ); 86 | postfix_expression '[' expression ']' 88 : primary_expression 89 | postfix_expression '[' expression ']' 87 90 { result = [ :OP_SUBSC, val[0], val[2] ] } 88 | postfix_expression '.' IDENTIFIER 91 | postfix_expression '(' ')' 92 | postfix_expression '(' argument_expression_list ')' 93 | postfix_expression type_qualifier '(' argument_expression_list ')' # intended __asm volatile ( " MNEMONIC OPERAND" ); 94 | postfix_expression '.' IDENTIFIER 89 95 { result = [ :OP_DOT, val[0], val[2] ] } 90 96 | postfix_expression '->' IDENTIFIER 91 97 { result = [ :OP_REF, val[0], val[2] ] } 92 | postfix_expression '++' { result = val[0] } # ++, -- は無視する 93 | postfix_expression '--' { result = val[0] } 94 95 argument_list 96 : 97 | expression 98 | argument_list ',' expression 98 | postfix_expression '++' { result = val[0] } # ++, -- は無視する 99 | postfix_expression '--' { result = val[0] } 100 | '(' type_name ')' '{' initializer_list '}' 101 | '(' type_name ')' '{' initializer_list ',' '}' 102 103 argument_expression_list 104 : assignment_expression 105 | argument_expression_list ',' assignment_expression 99 106 100 107 101 108 # 前置インクリメント、デクリメント演算子がない 102 109 unary_expression 103 104 110 : postfix_expression 111 | unary_operator cast_expression 105 112 { result = [ val[0], val[1] ] } 106 113 | SIZEOF unary_expression 107 114 { result = [ :OP_SIZEOF_EXPR, val[1] ] } 108 115 | SIZEOF '(' type_name ')' 109 116 { result = [ :OP_SIZEOF_TYPE, val[1] ] } 110 117 | '++' unary_expression { result = val[1] } # ++, -- は無視する … … 112 119 113 120 unary_operator 114 115 116 117 118 119 121 : '&' { result = :OP_U_AMP } 122 | '*' { result = :OP_U_ASTER } 123 | '+' { result = :OP_U_PLUS } 124 | '-' { result = :OP_U_MINUS } 125 | '~' { result = :OP_U_TILDE } 126 | '!' { result = :OP_U_EXCLAM } 120 127 121 128 cast_expression 122 123 129 : unary_expression 130 | '(' type_name ')' cast_expression 124 131 { result = [ :CAST, val[1], val[3] ] } 125 132 126 133 multiplicative_expression 127 128 134 : cast_expression 135 | multiplicative_expression '*' cast_expression 129 136 { result = [ :OP_MULT, val[0], val[2] ] } 130 137 | multiplicative_expression '/' cast_expression 131 138 { result = [ :OP_DIV, val[0], val[2] ] } 132 139 | multiplicative_expression '%' cast_expression 133 140 { result = [ :OP_REMAIN, val[0], val[2] ] } 134 141 135 142 additive_expression 136 137 143 : multiplicative_expression 144 | additive_expression '+' multiplicative_expression 138 145 { result = [ :OP_ADD, val[0], val[2] ] } 139 146 | additive_expression '-' multiplicative_expression 140 147 { result = [ :OP_SUB, val[0], val[2] ] } 141 148 142 149 shift_expression 143 144 150 : additive_expression 151 | shift_expression '<<' additive_expression 145 152 { result = [ :OP_LSFT, val[0], val[2] ] } 146 153 | shift_expression '>>' additive_expression 147 154 { result = [ :OP_RSFT, val[0], val[2] ] } 148 155 149 156 relational_expression 150 151 157 : shift_expression 158 | relational_expression '<' shift_expression 152 159 { result = [ :OP_LT, val[0], val[2] ] } 153 160 | relational_expression '>' shift_expression 154 161 { result = [ :OP_GT, val[0], val[2] ] } 155 162 | relational_expression '<=' shift_expression 156 163 { result = [ :OP_LE, val[0], val[2] ] } 157 164 | relational_expression '>=' shift_expression 158 165 { result = [ :OP_GE, val[0], val[2] ] } 159 166 160 167 equality_expression 161 162 168 : relational_expression 169 | equality_expression '==' relational_expression 163 170 { result = [ :OP_EQ, val[0], val[2] ] } 164 171 | equality_expression '!=' relational_expression 165 172 { result = [ :OP_NE, val[0], val[2] ] } 166 173 167 174 and_expression 168 169 175 : equality_expression 176 | and_expression '&' equality_expression 170 177 { result = [ :OP_AND, val[0], val[2] ] } 171 178 172 179 exclusive_or_expression 173 174 180 : and_expression 181 | exclusive_or_expression '^' and_expression 175 182 { result = [ :OP_EOR, val[0], val[2] ] } 176 183 177 184 inclusive_or_expression 178 179 185 : exclusive_or_expression 186 | inclusive_or_expression '|' exclusive_or_expression 180 187 { result = [ :OP_OR, val[0], val[2] ] } 181 188 182 189 logical_and_expression 183 184 190 : inclusive_or_expression 191 | logical_and_expression '&&' inclusive_or_expression 185 192 { result = [ :OP_LAND, val[0], val[2] ] } 186 193 187 194 logical_or_expression 188 189 195 : logical_and_expression 196 | logical_or_expression '||' logical_and_expression 190 197 { result = [ :OP_LOR, val[0], val[2] ] } 191 198 192 199 conditional_expression 193 194 200 : logical_or_expression 201 | logical_or_expression '?' expression ':' conditional_expression 195 202 { result = [ :OP_CEX, val[0], val[2].get_elements, val[4] ] } 196 203 197 198 # コンマ演算子が使えない 204 assignment_expression 205 : conditional_expression 206 | unary_expression assignment_operator assignment_expression 207 208 assignment_operator 209 : '=' 210 | '+=' 211 | '-=' 212 | '*=' 213 | '/=' 214 | '%=' 215 | '<<=' 216 | '>>=' 217 | '&=' 218 | '|=' 219 | '^=' 220 199 221 expression 200 : conditional_expression222 : assignment_expression 201 223 { 202 224 result = Expression.new( val[0] ) 203 225 # result.print 204 226 } 227 | expression ',' assignment_expression 228 { 229 result = Expression.new( val[2] ) # ',' の後ろを採用 230 } 205 231 206 232 constant_expression 207 233 : conditional_expression 208 234 { 209 235 result = Expression.new( val[0] ) … … 218 244 } 219 245 220 221 222 246 # Types 223 247 ########################## 宣言 ########################## … … 227 251 # K&Rとの違い: storage classが指定できない、型が省略できない 228 252 declaration 229 230 # : type_specifier_qualifier_list init_declarator_list ';'253 : declaration_specifiers init_declarator_list ';' 254 # : specifier_qualifier_list init_declarator_list ';' 231 255 232 256 # declaration_specifiersは関数のパラメータで使われるが、 233 # type_specifier_qualifier_listで十分かもしれない257 # specifier_qualifier_listで十分かもしれない 234 258 235 259 declaration_specifiers 236 : storage_class 260 : storage_class_specifier 237 261 { 238 262 result = CIntType.new( -3 ) # storage class は無視 239 263 } 240 | type_specifier 241 | type_qualifier 264 | storage_class_specifier declaration_specifiers 265 { 266 result = val[1] # storage class は無視 267 } 268 | type_specifier 269 | type_specifier declaration_specifiers 270 { 271 result = val[1].merge val[0] 272 } 273 | type_qualifier 242 274 { 243 275 result = CIntType.new( -3 ) 244 276 result.set_qualifier val[0] 245 277 } 246 | storage_class declaration_specifiers 247 { 248 result = val[1] # storage class は無視 249 } 250 | type_specifier declaration_specifiers 251 { 252 result = val[1].merge val[0] 253 } 254 | type_qualifier declaration_specifiers 278 | type_qualifier declaration_specifiers 255 279 { 256 280 val[1].set_qualifier val[0] 257 result = val[1] 258 } 259 281 result = val[1] 282 } 283 | function_specifier 284 | function_specifier declaration_specifiers 260 285 261 286 init_declarator_list 262 287 : init_declarator 263 288 { result = [val[0]] } 264 289 | init_declarator_list ',' init_declarator 265 290 { result << val[2] } 266 291 267 292 init_declarator 268 269 293 : declarator 294 | declarator '=' initializer 270 295 { val[0].set_initializer( val[2] ) } 271 296 297 storage_class_specifier 298 : EXTERN 299 | STATIC 300 | AUTO 301 | REGISTER 302 272 303 type_specifier 273 : VOID { set_no_type_name true; result = CVoidType.new } 274 | FLOAT { set_no_type_name true; result = CFloatType.new(-32) } 275 | DOUBLE { set_no_type_name true; result = CFloatType.new(-64) } 276 | BOOL { set_no_type_name true; result = CBoolType.new } 277 | struct_specifier { set_no_type_name true; result = val[0] } # set_no_type_name true は struct_tag でも呼ばれる 278 | union_specifier { set_no_type_name true; result = CVoidType.new } # void が宣言されたとする 279 | enum_specifier { set_no_type_name true; result = CVoidType.new } # void が宣言されたとする 280 | TYPE_NAME { set_no_type_name true; result = CDefinedType.new( val[0].val ) } 281 282 | CHAR { set_no_type_name true; result = CIntType.new(-11 ) } 283 | SHORT { set_no_type_name true; result = CIntType.new( -2 ) } 284 | INT { set_no_type_name true; result = CIntType.new( -3 ) } 285 | LONG { set_no_type_name true; result = CIntType.new( -4 ) } 286 | SIGNED 304 : VOID 305 { set_no_type_name true; result = CVoidType.new } 306 | CHAR 307 { set_no_type_name true; result = CIntType.new(-11 ) } 308 | SHORT 309 { set_no_type_name true; result = CIntType.new( -2 ) } 310 | INT 311 { set_no_type_name true; result = CIntType.new( -3 ) } 312 | LONG 313 { set_no_type_name true; result = CIntType.new( -4 ) } 314 | FLOAT 315 { set_no_type_name true; result = CFloatType.new(-32) } 316 | DOUBLE 317 { set_no_type_name true; result = CFloatType.new(-64) } 318 | SIGNED 287 319 { 288 320 set_no_type_name true … … 290 322 result.set_sign :SIGNED 291 323 } 292 324 | UNSIGNED 293 325 { 294 326 set_no_type_name true … … 296 328 result.set_sign :UNSIGNED 297 329 } 330 | BOOL 331 { set_no_type_name true; result = CBoolType.new } 332 | struct_specifier 333 { set_no_type_name true; result = val[0] } # set_no_type_name true は struct_tag でも呼ばれる 334 | union_specifier 335 { set_no_type_name true; result = CVoidType.new } # void が宣言されたとする 336 | enum_specifier 337 { set_no_type_name true; result = CVoidType.new } # void が宣言されたとする 338 | TYPE_NAME 339 { set_no_type_name true; result = CDefinedType.new( val[0].val ) } 298 340 299 341 # mikan K&Rのstruct_or_union_specifierに相当するが、unionは使えない, bit field にも対応しない 300 342 struct_specifier # mikan 301 : STRUCT struct_tag '{' 343 # : STRUCT struct_tag '{' 344 : struct_term struct_tag '{' 302 345 { StructType.set_define( true ) } 303 346 struct_declaration_list '}' 304 347 { 305 348 StructType.end_of_parse 306 349 result = val[1] 307 350 } 308 | STRUCT 351 # | STRUCT 352 | struct_term 309 353 { 310 354 result = CStructType.new() 311 355 StructType.set_define( true ) 312 356 } 313 357 '{' struct_declaration_list '}' 314 358 { 315 359 StructType.end_of_parse 316 360 result = val[1] 317 361 } 318 | STRUCT struct_tag # mikan struct_tag は namespace 対応が必要 362 # | STRUCT struct_tag # mikan struct_tag は namespace 対応が必要 363 | struct_term struct_tag # mikan struct_tag は namespace 対応が必要 319 364 { 320 365 StructType.set_define( false ) … … 323 368 } 324 369 370 struct_term 371 : STRUCT { set_no_type_name true } 372 325 373 struct_declaration_list 326 327 374 : struct_declaration 375 | struct_declaration_list struct_declaration 328 376 329 377 struct_tag: 330 378 IDENTIFIER 331 379 { 332 380 result = CStructType.new( val[0].val ) … … 336 384 # ポインタ修飾子を追加 337 385 struct_declaration 338 339 # : type_specifier_qualifier_list struct_declarator_list ';'386 : declaration_specifiers struct_declarator_list ';' 387 # : specifier_qualifier_list struct_declarator_list ';' 340 388 { 341 389 val[1].each { |i| # i: Decl … … 347 395 result = val[1] 348 396 } 349 | union_specifier ';' # 無名 350 | struct_specifier ';' # 無名 397 # ビットフィールドを読み飛ばし 398 | declaration_specifiers struct_declarator_list ':' constant_expression ';' 399 { 400 val[1].each { |i| # i: Decl 401 i.set_type( val[0] ) 402 i.set_kind( :MEMBER ) 403 i.check 404 CStructType.new_member( i ) 405 } 406 result = val[1] 407 } 408 | union_specifier ';' # 無名 409 | struct_specifier ';' # 無名 351 410 352 411 … … 354 413 # K&Rのspecifier_qualifier_listと同じ 355 414 # 名前がまぎらわしかったのでtype_を付けた 356 type_specifier_qualifier_list 357 : type_specifier 358 | type_specifier type_specifier_qualifier_list 415 specifier_qualifier_list 416 : type_specifier specifier_qualifier_list 359 417 { 360 418 result = val[1].merge val[0] 361 419 } 362 | type_qualifier 420 | type_specifier 421 | type_qualifier specifier_qualifier_list 422 { 423 val[1].set_qualifier val[0] 424 result = val[1] 425 } 426 | type_qualifier 363 427 { 364 428 result = CIntType.new( -3 ) 365 429 result.set_qualifier val[0] 366 430 } 367 | type_qualifier type_specifier_qualifier_list368 {369 val[1].set_qualifier val[0]370 result = val[1]371 }372 431 373 432 struct_declarator_list 374 433 : struct_declarator 375 434 { result = [ val[0] ] } 376 435 | struct_declarator_list ',' struct_declarator 377 436 { result << val[2] } 378 437 379 438 # ビットフィールドは使えない 380 439 struct_declarator 381 382 383 440 : declarator 441 # | ':' constant_expression 442 # | declarator ':' constant_expression 384 443 385 444 union_specifier 386 : UNION union_tag '{' union_declaration_list '}' 387 | UNION '{' union_declaration_list '}' 388 | UNION union_tag # mikan struct_tag は namespace 対応が必要 445 # : UNION union_tag '{' union_declaration_list '}' 446 # | UNION '{' union_declaration_list '}' 447 # | UNION union_tag # mikan struct_tag は namespace 対応が必要 448 : union_term union_tag '{' union_declaration_list '}' 449 | union_term '{' union_declaration_list '}' 450 | union_term union_tag # mikan struct_tag は namespace 対応が必要 451 452 union_term 453 : UNION { set_no_type_name true } 389 454 390 455 union_declaration_list 391 392 456 : union_declaration 457 | union_declaration_list union_declaration 393 458 394 459 union_tag: … … 396 461 397 462 union_declaration 398 463 : declaration_specifiers union_declarator_list ';' 399 464 | union_specifier ';' # 無名 400 465 | struct_specifier ';' # 無名 401 466 402 467 union_declarator_list 403 : union_declarator 404 | union_declarator_list ',' union_declarator 405 406 # ビットフィールドは使えない 468 : union_declarator 469 | union_declarator_list ',' union_declarator 470 407 471 union_declarator 408 : declarator 409 410 411 412 # enumの種類を追加 413 enum_specifier # mikan 414 : enum_type '{' enumerator_list '}' 415 | enum_type IDENTIFIER '{' enumerator_list '}' 416 | enum_type IDENTIFIER 417 418 enum_type 419 : ENUM { result = CEnumType.new( -1 ) } 420 # | ENUM8 { result = CEnumType.new( 8 ) } 421 # | ENUM16 { result = CEnumType.new( 16 ) } 422 # | ENUM32 { result = CEnumType.new( 32 ) } 423 # | ENUM64 { result = CEnumType.new( 64 ) } 424 # | ENUM128 { result = CEnumType.new( 128 ) } 472 : declarator 473 | ':' constant_expression 474 | declarator ':' constant_expression 475 476 enum_specifier 477 : ENUM '{' enumerator_list '}' 478 | ENUM IDENTIFIER '{' enumerator_list '}' 479 | ENUM '{' enumerator_list ',' '}' 480 | ENUM IDENTIFIER '{' enumerator_list ',' '}' 481 | ENUM IDENTIFIER 482 | ENUM TYPE_NAME '{' enumerator_list '}' 483 | ENUM TYPE_NAME '{' enumerator_list ',' '}' 484 | ENUM TYPE_NAME 425 485 426 486 enumerator_list 427 428 487 : enumerator 488 | enumerator_list ',' enumerator 429 489 430 490 enumerator 431 432 491 : IDENTIFIER 492 | IDENTIFIER '=' constant_expression 433 493 434 494 type_qualifier 435 : CONST { result = :CONST } 436 | VOLATILE { result = :VOLATILE } 495 : CONST 496 { result = :CONST } 497 | RESTRICT 498 | VOLATILE 499 { result = :VOLATILE } 500 501 function_specifier 502 : __INLINE__ 503 | INLINE 504 | __INLINE 505 | CINLINE 437 506 438 507 declarator 439 508 : pointer direct_declarator 440 509 { 441 510 val[1].set_type( val[0] ) 442 511 result = val[1] 443 512 } 444 445 513 | direct_declarator 514 | pointer TYPE_NAME # 関数ポインタの typedef が二重定義の場合 446 515 { 447 516 result = Decl.new( val[1].val ) … … 450 519 451 520 direct_declarator # mikan 452 521 : IDENTIFIER 453 522 { result = Decl.new( val[0].val ) } 454 523 | '(' declarator ')' 455 524 { result = val[1] } 456 525 | direct_declarator '[' constant_expression ']' 457 526 { 458 527 val[0].set_type( CArrayType.new( val[2] ) ) 459 528 result = val[0] 460 529 } 461 530 | direct_declarator '[' ']' 462 531 { 463 532 val[0].set_type( CArrayType.new ) 464 533 result = val[0] 465 534 } 466 535 | direct_declarator '(' parameter_type_list ')' 467 536 { 468 537 # Generator.warning( "W6001 need 'void' for no parameter" ) … … 470 539 result = val[0] 471 540 } 472 473 # | direct_declarator '(' identifier_list ')' # これは何のために必要? 060211 474 | direct_declarator '(' ')' 541 | direct_declarator '(' identifier_list ')' # これは何のために必要? 060211 542 | direct_declarator '(' ')' 475 543 { 476 544 # Generator.warning( "W6002 need 'void' for no parameter" ) … … 480 548 481 549 pointer 482 550 : '*' 483 551 { result = CPtrType.new } 484 | '*' type_qualifier 552 | '*' type_qualifier_list 485 553 { 486 554 result = CPtrType.new 487 555 result.set_qualifier( val[1] ) 488 556 } 489 557 | '*' pointer 490 558 { 491 559 val[1].set_type(CPtrType.new) 492 560 result = val[1] 493 561 } 494 | '*' type_qualifierpointer562 | '*' type_qualifier_list pointer 495 563 { 496 564 ptrtype = CPtrType.new … … 500 568 } 501 569 570 type_qualifier_list 571 : type_qualifier 572 | type_qualifier_list type_qualifier 502 573 503 574 parameter_type_list 504 505 575 : parameter_list 576 | parameter_list ',' '.' '.' '.' 506 577 # mikan 可変長パラメータ, ... の間のスペースが許される(手抜き) 507 578 508 579 parameter_list 509 580 : parameter_declaration 510 581 # { result = ParamList.new( val[0] ) } 511 582 | parameter_list ',' parameter_declaration 512 583 # { 513 584 # val[0].add_param( val[2] ) … … 518 589 # パラメータ修飾子を追加 519 590 parameter_declaration 520 591 : declaration_specifiers declarator 521 592 # { 522 593 # decl = ParamDecl.new( val[1], val[0], [] ) … … 533 604 # result = nil 534 605 # } 535 536 537 538 539 #identifier_list # 060211 不用になった540 #: IDENTIFIER541 #| identifier_list ',' IDENTIFIER606 | declaration_specifiers abstract_declarator # 仮引数なし 607 | declaration_specifiers # 仮引数なし 608 609 610 identifier_list # 060211 不用になった 611 : IDENTIFIER 612 | identifier_list ',' IDENTIFIER 542 613 543 614 type_name 544 : type_specifier_qualifier_list545 | type_specifier_qualifier_list abstract_declarator615 : specifier_qualifier_list 616 | specifier_qualifier_list abstract_declarator 546 617 547 618 abstract_declarator # mikan 548 549 550 619 : pointer 620 | direct_abstract_declarator 621 | pointer direct_abstract_declarator 551 622 552 623 direct_abstract_declarator 553 554 555 | '[' constant_expression ']'556 557 | direct_abstract_declarator '[' constant_expression ']'558 624 : '(' abstract_declarator ')' 625 | '[' ']' 626 | '[' assignment_expression ']' 627 | direct_abstract_declarator '[' ']' 628 | direct_abstract_declarator '[' assignment_expression ']' 629 | '(' ')' 559 630 { 560 631 Generator.warning( "W6003 need 'void' for no parameter" ) 561 632 } 562 563 633 | '(' parameter_type_list ')' 634 | direct_abstract_declarator '(' ')' 564 635 { 565 636 Generator.warning( "W6004 need 'void' for no parameter" ) 566 637 } 567 638 | direct_abstract_declarator '(' parameter_type_list ')' 568 639 569 640 # assignment_expressionをconstant_expressionに変更 570 641 initializer # mikan 571 : constant_expression642 : assignment_expression 572 643 { result = val[0] } 573 644 | '{' initializer_list '}' 574 645 { result = val[1] } 575 646 | '{' initializer_list ',' '}' 576 647 { result = val[1] } 577 | C_EXP '(' STRING_LITERAL ')'648 | C_EXP '(' STRING_LITERAL ')' 578 649 { result = C_EXP.new( val[2] ) } 579 650 580 651 initializer_list 581 652 : initializer 582 653 { 583 654 result = [ val[0] ] 584 655 } 585 656 | initializer_list ',' initializer 586 657 { 587 658 val[0] << val[2] … … 594 665 #トップレベルの構文規則 595 666 C_parser 596 597 667 : 668 | C_parser extension_statement 598 669 599 670 extension_statement 600 :statement601 | EXTENSIONstatement602 603 statement604 605 606 607 608 609 610 671 : cdl_statement 672 | EXTENSION cdl_statement 673 674 cdl_statement 675 : typedef 676 | func_def 677 | enum_specifier ';' 678 | struct_specifier ';' 679 | declaration 680 | ';' 681 | error # エラー回復ポイント 611 682 612 683 typedef 613 : TYPEDEF type_specifier_qualifier_list declarator_list ';'684 : TYPEDEF specifier_qualifier_list declarator_list ';' 614 685 { 615 686 val[2].each{ |i| … … 621 692 622 693 declarator_list 623 694 : declarator 624 695 { result = [ val[0] ] } 625 696 | declarator_list ',' declarator 626 697 { result << val[2] } 627 698 628 699 func_def 629 : declaration_specifiers declarator compoundstatement 630 631 infunc_statement_list 632 : 633 | infunc_statement_list infunc_statement 634 635 infunc_statement 636 : declaration 637 | ifstatement 638 | whilestatement 639 | dowhilestatement 640 | forstatement 641 | switchstatement 642 | labelstatement 643 | compoundstatement 644 | gotostatement 645 | expressionstatement 646 | ';' 700 : declaration_specifiers declarator compound_statement 701 702 statement 703 : labeled_statement 704 | compound_statement 705 | expression_statement 706 | ifstatement 707 | whilestatement 708 | dowhilestatement 709 | forstatement 710 | switchstatement 711 | jump_statement 712 | asm_statement 713 714 labeled_statement 715 : IDENTIFIER ':' statement 716 | CASE constant_expression ':' statement 717 | DEFAULT ':' statement 718 719 compound_statement 720 : '{' '}' 721 | '{' block_item_list '}' 722 723 block_item_list 724 : block_item 725 | block_item_list block_item 726 727 block_item 728 : declaration 729 | statement 730 731 expression_statement 732 : ';' 733 | expression ';' 647 734 648 735 ifstatement 649 : IF '(' expression ')' infunc_statement 650 | IF '(' expression ')' infunc_statement ELSE infunc_statement 736 : IF '(' expression ')' statement 737 | IF '(' expression ')' statement ELSE statement 738 739 switchstatement 740 : SWITCH '(' expression ')' compound_statement 651 741 652 742 whilestatement 653 : WHILE '(' expression ')' infunc_statement743 : WHILE '(' expression ')' statement 654 744 655 745 dowhilestatement 656 : DO infunc_statement WHILE '(' expression ')' ';'746 : DO statement WHILE '(' expression ')' ';' 657 747 658 748 forstatement 659 : FOR '(' expression ';' expression ';' expression ')' infunc_statement 660 661 switchstatement 662 : SWITCH '(' expression ')' infunc_statment 663 664 labelstatement 665 : IDENTIFIER ':' infunc_statement 666 | CASE constant_expression ':' infunc_statement 667 | DEFAULT ':' infunc_statement 668 669 compoundstatement 670 : '{' infunc_statement_list '}' 671 672 gotostatement 673 : GOTO IDENTIFIER ';' 674 | CONTINUE ';' 675 | BREAK ';' 676 | RETURN expression ';' 677 | RETURN ';' 678 679 expressionstatement 680 : expression ';' 681 | unary_expression assignment_operator expression ';' 682 683 assignment_operator 684 : '=' 685 | '+=' 686 | '-=' 687 | '*=' 688 | '/=' 689 | '%=' 690 | '<<=' 691 | '>>=' 692 | '&=' 693 | '|=' 694 | '^=' 695 696 storage_class 697 : __INLINE__ 698 | INLINE 699 | __INLINE 700 | CINLINE 701 | EXTERN 702 | STATIC 703 | AUTO 704 | REGISTER 749 : FOR '(' expression_statement expression_statement ')' statement 750 | FOR '(' expression_statement expression_statement expression ')' statement 751 | FOR '(' declaration expression_statement ')' statement 752 | FOR '(' declaration expression_statement expression ')' statement 753 754 jump_statement 755 : GOTO IDENTIFIER ';' 756 | CONTINUE ';' 757 | BREAK ';' 758 | RETURN ';' 759 | RETURN expression ';' 705 760 706 761 namespace_identifier 707 708 709 762 : IDENTIFIER { result = NamespacePath.new( val[0].val, false ) } 763 | '::' IDENTIFIER { result = NamespacePath.new( val[1].val, true ) } 764 | namespace_identifier '::' IDENTIFIER 710 765 { result = val[0].append!( val[2].val ) } 711 766 767 asm_statement 768 : _ASM { 769 while true 770 # ';' が表れるまで、トークンを読み飛ばす。 771 # gcc の構文拡張に対応すべきだが、単純な実装として、';' まで読み飛ばす。 772 # トークン単位で読み飛ばしているので、文字列やコメント内の ';' は対象にならない。 773 token = next_token 774 if token[1].val == ";" 775 break 776 end 777 # p "skip: #{token[1].val}" 778 end 779 } 780 712 781 end 713 782 714 783 ---- inner 715 784 716 RESERVED = { 717 # keyword 718 'typedef' => :TYPEDEF, 719 'struct' => :STRUCT, 720 'union' => :UNION, 721 'sizeof' => :SIZEOF, 722 'throw' => :THROW, 723 724 # specifier 725 # types 726 'void' => :VOID, 727 'char' => :CHAR, 728 'short' => :SHORT, 729 730 'volatile'=> :VOLATILE, 731 'const' => :CONST, 732 'extern' => :EXTERN, 733 734 'long' => :LONG, 735 'float' => :FLOAT, 736 'double' => :DOUBLE, 737 'signed' => :SIGNED, 738 'unsigned'=> :UNSIGNED, 739 740 'int' => :INT, 741 'enum' => :ENUM, 742 743 'if' => :IF, 744 'else' => :ELSE, 745 'while' => :WHILE, 746 'do' => :DO, 747 'for' => :FOR, 748 'case' => :CASE, 749 'default' => :DEFAULT, 750 'goto' => :GOTO, 751 'continue' => :CONTINUE, 752 'break' => :BREAK, 753 'return' => :RETURN, 754 '__inline__' => :__INLINE__, 755 'inline' => :INLINE, 756 '__inline' => :__INLINE, 757 'Inline' => :CINLINE, # inline starting with Capital letter 758 'static' => :STATIC, 759 'register' => :REGISTER, 760 'auto' => :AUTO, 761 '__extension__' => :EXTENSION, 762 763 } 764 765 @@generator_nest = -1 766 @@generator_stack = [] 767 @@current_locale = [] 768 769 def finalize 770 771 # mikan Namespace.pop 772 Celltype.pop 773 Cell.pop 774 CompositeCelltype.pop 775 Region.pop 776 777 end 778 779 def set_plugin( plugin ) 780 @plugin = plugin 781 end 782 783 def self.get_plugin 784 @@generator_stack[@@generator_nest].get_plugin 785 end 786 787 def get_plugin 788 @plugin 789 end 790 791 def parse(files) 792 793 # mikan Namespace.push 794 Celltype.push 795 Cell.push 796 CompositeCelltype.push 797 Region.push 798 799 @@generator_nest += 1 800 @@generator_stack[@@generator_nest] = self 801 @b_no_type_name = false 802 803 begin 804 805 @q = [] 806 comment = false 807 808 # euc のコメントを utf8 として扱うと、コメントの終わりを誤る問題の対策 809 TECS_LANG::set_kcode_binary 810 811 # 800U, 0xffLL など (整数リテラルに共通の修飾子) 812 integer_qualifier = "([Uu][Ll][Ll]|[Uu][Ll]|[Uu]|[Ll][Ll]|[Ll])?" 813 814 files.each {|file| 815 lineno = 1 816 begin 817 #2.0 IO.foreach(file) {|line| 818 TECSIO.foreach(file) {|line| 819 col = 1 820 line.rstrip! 821 822 until line.empty? 823 824 if comment 825 case line 826 # コメント終了 827 when /\A\*\// 828 comment = false 829 when /\A./ 830 ; 831 end 832 else 833 case line 834 # 空白、プリプロセスディレクティブ 835 when /\A\s+/ 836 ; 837 # 識別子 838 when /\A[a-zA-Z_]\w*/ 839 word = $& 840 @q << [RESERVED[word] || :IDENTIFIER, Token.new(word.intern, file, lineno, col)] 841 # 16 進数定数 842 when /\A0x[0-9A-Fa-f]+#{integer_qualifier}/ 843 @q << [:HEX_CONSTANT, Token.new($&, file, lineno, col)] 844 # 8 進数定数 845 when /\A0[0-7]+#{integer_qualifier}/ 846 @q << [:OCTAL_CONSTANT, Token.new($&, file, lineno, col)] 847 # 浮動小数定数 848 when /\A[0-9]+\.([0-9]*)?([Ee][+-]?[0-9]+)?/ 849 @q << [:FLOATING_CONSTANT, Token.new($&, file, lineno, col)] 850 # 整数定数 851 when /\A\d+#{integer_qualifier}/ 852 # when /\A\d+/ 853 @q << [:INTEGER_CONSTANT, Token.new($&.to_i, file, lineno, col)] 854 # 文字 855 when /\A'(?:[^'\\]|\\.)'/ 856 @q << [:CHARACTER_LITERAL, Token.new($&, file, lineno, col)] 857 # 文字列 858 # "#include #include #include \"../systask/logtask.cfg\" 最後の " 忘れ)で無限ループ 859 # when /\A"(?:[^"\\]+|\\.)*"/ 860 when /\A"(?:[^"\\]|\\.)*"/ # これはうまく行くようだ 861 @q << [:STRING_LITERAL, Token.new($&, file, lineno, col)] 862 # 行コメント 863 when /\A\/\/.*$/ 864 # 読み飛ばすだけ 865 # コメント開始 866 when /\A\/\*/ 867 comment = true 868 when /\A>>=/, /\A<<=/, /\A>>/, /\A<</ 869 @q << [$&, Token.new($&, file, lineno, col)] 870 when /\A\+=/, /\A\-=/, /\A\*=/, /\A\/=/, /\A%=/, /\A&=/, /\A\|=/, /\A\^=/ 871 @q << [$&, Token.new($&, file, lineno, col)] 872 when /\A::/, /\A==/, /\A!=/, /\A>=/, /\A<=/, /\A\->/, /\A\+\+/, /\A\-\-/ 873 @q << [$&, Token.new($&, file, lineno, col)] 874 when /\A./ 875 @q << [$&, Token.new($&, file, lineno, col)] 876 else 877 raise 878 end 879 end 880 881 line = $' 882 col += $&.length 883 end 884 885 lineno += 1 886 } 887 888 rescue => evar 889 Generator.error( "B1002 while open or reading \'$1\'" , file ) 890 print_exception( evar ) 891 end 892 } 893 894 # 終了の印 895 @q << nil 896 897 @yydebug = true 898 do_parse 899 900 ensure 901 @@generator_nest -= 1 902 TECS_LANG::reset_kcode 903 end 904 905 end 906 907 908 def next_token 909 token = @q.shift 910 911 if token then 912 @@current_locale[@@generator_nest] = token[1].locale 913 914 case token[1].val 915 when ";", ":", ",", "(", ")", "{", "}" 916 set_no_type_name false 917 when ".", "->" 918 set_no_type_name true 919 end 920 921 # TYPE_NAME トークンへ置き換え 922 if @b_no_type_name == false 923 if token[0] == :IDENTIFIER && Namespace.is_typename?( token[1].val ) then 924 token[0] = :TYPE_NAME 925 end 926 end 927 928 if $debug then # 070107 token 無効時ここを通さないようした (through 対応 -d の時に例外発生) 929 locale = @@current_locale[@@generator_nest] 930 if token then 931 print( "#{locale[0]}: line #{locale[1]} : #{token[0]} '#{token[1].val}'\n" ) 932 else 933 print( "#{locale[0]}: line #{locale[1]} : EOF\n" ) 934 end 935 end 936 end 937 938 token 939 end 940 941 def on_error(t, v, vstack) 942 if v == "$" then 943 Generator.error( "B1003 Unexpected EOF" ) 944 else 945 Generator.error( "B1004 syntax error near \'$1\'" , v.val ) 946 end 947 948 end 949 950 def self.current_locale 951 @@current_locale[ @@generator_nest ] 952 end 953 954 @@n_error = 0 955 @@n_warning = 0 956 957 # このメソッドは構文解析、意味解析からのみ呼出し可(コード生成でエラー発生は不適切) 958 def self.error( msg ) 959 @@n_error += 1 960 locale = @@current_locale[ @@generator_nest ] 961 962 if locale then 963 Console.puts "error: #{locale[0]}: line #{locale[1]} #{msg}" 964 else 965 Console.puts "error: #{msg}" 966 end 967 end 968 969 # このメソッドは構文解析、意味解析からのみ呼出し可(コード生成でウォーニング発生は不適切) 970 def self.warning( msg ) 971 @@n_warning += 1 972 locale = @@current_locale[ @@generator_nest ] 973 Console.puts "warning: #{locale[0]}: line #{locale[1]} #{msg}" 974 end 975 976 def self.get_n_error 977 @@n_error 978 end 979 980 def self.get_n_warning 981 @@n_warning 982 end 983 984 def self.get_nest 985 @@generator_nest 986 end 987 988 def set_no_type_name b_no_type_name 989 # print "b_no_type_name=#{b_no_type_name}\n" 990 @b_no_type_name = b_no_type_name 991 end 785 RESERVED = { 786 # keyword 787 'typedef' => :TYPEDEF, 788 'struct' => :STRUCT, 789 'union' => :UNION, 790 'sizeof' => :SIZEOF, 791 'throw' => :THROW, 792 793 # specifier 794 # types 795 'void' => :VOID, 796 'char' => :CHAR, 797 'short' => :SHORT, 798 799 'volatile'=> :VOLATILE, 800 'restrict'=> :RESTRICT, 801 'const' => :CONST, 802 'extern' => :EXTERN, 803 804 'long' => :LONG, 805 'float' => :FLOAT, 806 'double' => :DOUBLE, 807 'signed' => :SIGNED, 808 'unsigned'=> :UNSIGNED, 809 810 'int' => :INT, 811 'enum' => :ENUM, 812 813 'if' => :IF, 814 'else' => :ELSE, 815 'while' => :WHILE, 816 'do' => :DO, 817 'for' => :FOR, 818 'switch' => :SWITCH, 819 'case' => :CASE, 820 'default' => :DEFAULT, 821 'goto' => :GOTO, 822 'continue' => :CONTINUE, 823 'break' => :BREAK, 824 'return' => :RETURN, 825 '__inline__' => :__INLINE__, 826 'inline' => :INLINE, 827 '__inline' => :__INLINE, 828 'Inline' => :CINLINE, # inline starting with Capital letter 829 'static' => :STATIC, 830 'register' => :REGISTER, 831 'auto' => :AUTO, 832 '__extension__' => :EXTENSION, 833 '__asm__' => :_ASM, 834 'asm' => :_ASM 835 836 } 837 838 @@generator_nest = -1 839 @@generator_stack = [] 840 @@current_locale = [] 841 842 def finalize 843 844 # mikan Namespace.pop 845 Celltype.pop 846 Cell.pop 847 CompositeCelltype.pop 848 Region.pop 849 850 end 851 852 def set_plugin( plugin ) 853 @plugin = plugin 854 end 855 856 def self.get_plugin 857 @@generator_stack[@@generator_nest].get_plugin 858 end 859 860 def get_plugin 861 @plugin 862 end 863 864 def parse(files) 865 866 # mikan Namespace.push 867 Celltype.push 868 Cell.push 869 CompositeCelltype.push 870 Region.push 871 872 @@generator_nest += 1 873 @@generator_stack[@@generator_nest] = self 874 @b_no_type_name = false 875 876 begin 877 878 @q = [] 879 comment = false 880 # b_asm = false 881 882 # euc のコメントを utf8 として扱うと、コメントの終わりを誤る問題の対策 883 TECS_LANG::set_kcode_binary 884 885 # 800U, 0xffLL など (整数リテラルに共通の修飾子) 886 integer_qualifier = "([Uu][Ll][Ll]|[Uu][Ll]|[Uu]|[Ll][Ll]|[Ll])?" 887 888 files.each {|file| 889 lineno = 1 890 begin 891 #2.0 IO.foreach(file) {|line| 892 TECSIO.foreach(file) {|line| 893 col = 1 894 line.rstrip! 895 896 until line.empty? 897 898 if comment 899 case line 900 # コメント終了 901 when /\A\*\// 902 comment = false 903 when /\A./ 904 ; 905 end 906 else 907 case line 908 # 空白、プリプロセスディレクティブ 909 when /\A\s+/ 910 ; 911 # 識別子 912 when /\A[a-zA-Z_]\w*/ 913 word = $& 914 @q << [RESERVED[word] || :IDENTIFIER, Token.new(word.intern, file, lineno, col)] 915 # 16 進数定数 916 when /\A0x[0-9A-Fa-f]+#{integer_qualifier}/ 917 @q << [:HEX_CONSTANT, Token.new($&, file, lineno, col)] 918 # 8 進数定数 919 when /\A0[0-7]+#{integer_qualifier}/ 920 @q << [:OCTAL_CONSTANT, Token.new($&, file, lineno, col)] 921 # 浮動小数定数 922 when /\A[0-9]+\.([0-9]*)?([Ee][+-]?[0-9]+)?/ 923 @q << [:FLOATING_CONSTANT, Token.new($&, file, lineno, col)] 924 # 整数定数 925 when /\A\d+#{integer_qualifier}/ 926 # when /\A\d+/ 927 @q << [:INTEGER_CONSTANT, Token.new($&.to_i, file, lineno, col)] 928 # 文字 929 when /\A'(?:[^'\\]|\\.)'/ 930 @q << [:CHARACTER_LITERAL, Token.new($&, file, lineno, col)] 931 # 文字列 932 # "#include #include #include \"../systask/logtask.cfg\" 最後の " 忘れ)で無限ループ 933 # when /\A"(?:[^"\\]+|\\.)*"/ 934 when /\A"(?:[^"\\]|\\.)*"/ # これはうまく行くようだ 935 @q << [:STRING_LITERAL, Token.new($&, file, lineno, col)] 936 # 行コメント 937 when /\A\/\/.*$/ 938 # 読み飛ばすだけ 939 # コメント開始 940 when /\A\/\*/ 941 comment = true 942 when /\A>>=/, /\A<<=/, /\A>>/, /\A<</ 943 @q << [$&, Token.new($&, file, lineno, col)] 944 when /\A\+=/, /\A\-=/, /\A\*=/, /\A\/=/, /\A%=/, /\A&=/, /\A\|=/, /\A\^=/ 945 @q << [$&, Token.new($&, file, lineno, col)] 946 when /\A::/, /\A==/, /\A!=/, /\A>=/, /\A<=/, /\A\->/, /\A\+\+/, /\A\-\-/ 947 @q << [$&, Token.new($&, file, lineno, col)] 948 when /\A\|\|/, /\A\&\&/ 949 @q << [$&, Token.new($&, file, lineno, col)] 950 when /\A./ 951 @q << [$&, Token.new($&, file, lineno, col)] 952 else 953 raise 954 end 955 end 956 957 line = $' 958 col += $&.length 959 end 960 961 lineno += 1 962 } 963 964 rescue => evar 965 Generator.error( "B1002 while open or reading \'$1\'" , file ) 966 print_exception( evar ) 967 end 968 } 969 970 # 終了の印 971 @q << nil 972 973 @yydebug = true 974 do_parse 975 976 ensure 977 @@generator_nest -= 1 978 TECS_LANG::reset_kcode 979 end 980 981 end 982 983 984 def next_token 985 token = @q.shift 986 987 if token then 988 @@current_locale[@@generator_nest] = token[1].locale 989 990 case token[1].val 991 when ";", ":", ",", "(", ")", "{", "}" 992 set_no_type_name false 993 when ".", "->" 994 set_no_type_name true 995 end 996 997 # TYPE_NAME トークンへ置き換え 998 if @b_no_type_name == false 999 if token[0] == :IDENTIFIER && Namespace.is_typename?( token[1].val ) then 1000 token[0] = :TYPE_NAME 1001 locale = @@current_locale[@@generator_nest] 1002 #print( "#{locale[0]}: line #{locale[1]} : #{token[0]} '#{token[1].val}: type_name'\n" ) 1003 end 1004 end 1005 1006 if $debug then # 070107 token 無効時ここを通さないようした (through 対応 -d の時に例外発生) 1007 locale = @@current_locale[@@generator_nest] 1008 if token then 1009 print( "#{locale[0]}: line #{locale[1]} : #{token[0]} '#{token[1].val}'\n" ) 1010 else 1011 print( "#{locale[0]}: line #{locale[1]} : EOF\n" ) 1012 end 1013 end 1014 end 1015 1016 token 1017 end 1018 1019 def on_error(t, v, vstack) 1020 if v == "$" then 1021 Generator.error( "B1003 Unexpected EOF" ) 1022 else 1023 Generator.error( "B1004 syntax error near \'$1\'" , v.val ) 1024 end 1025 1026 end 1027 1028 def self.current_locale 1029 @@current_locale[ @@generator_nest ] 1030 end 1031 1032 @@n_error = 0 1033 @@n_warning = 0 1034 @@n_info = 0 1035 1036 # このメソッドは構文解析、意味解析からのみ呼出し可(コード生成でエラー発生は不適切) 1037 def self.error( msg ) 1038 @@n_error += 1 1039 locale = @@current_locale[ @@generator_nest ] 1040 1041 if locale then 1042 Console.puts "#{locale[0]}:#{locale[1]}: error: #{msg}" 1043 else 1044 Console.puts "error: #{msg}" 1045 end 1046 end 1047 1048 # このメソッドは構文解析、意味解析からのみ呼出し可(コード生成でウォーニング発生は不適切) 1049 def self.warning( msg ) 1050 @@n_warning += 1 1051 locale = @@current_locale[ @@generator_nest ] 1052 Console.puts "#{locale[0]}:#{locale[1]}: warning: #{msg}" 1053 end 1054 1055 # このメソッドは構文解析、意味解析からのみ呼出し可 1056 def self.info( msg ) 1057 @@n_info += 1 1058 locale = @@current_locale[ @@generator_nest ] 1059 Console.puts "#{locale[0]}:#{locale[1]}: info: #{msg}" 1060 end 1061 1062 def self.get_n_error 1063 @@n_error 1064 end 1065 1066 def self.get_n_warning 1067 @@n_warning 1068 end 1069 1070 def self.get_nest 1071 @@generator_nest 1072 end 1073 1074 def set_no_type_name b_no_type_name 1075 locale = @@current_locale[ @@generator_nest ] 1076 #print "b_no_type_name=#{b_no_type_name} #{locale[0]}: line #{locale[1]}\n" 1077 @b_no_type_name = b_no_type_name 1078 end 992 1079 993 1080 ---- footer -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecslib/core/bnf.tab.rb
r321 r429 1 1 # 2 2 # DO NOT MODIFY!!!! 3 # This file is automatically generated by Racc 1.4.1 23 # This file is automatically generated by Racc 1.4.14 4 4 # from Racc grammer file "". 5 5 # … … 8 8 class Generator < Racc::Parser 9 9 10 module_eval(<<'...end bnf.y.rb/module_eval...', 'bnf.y.rb', 15 04)10 module_eval(<<'...end bnf.y.rb/module_eval...', 'bnf.y.rb', 1534) 11 11 12 12 RESERVED = { … … 30 30 'import_C' => :IMPORT_C, 31 31 'generate' => :GENERATE, 32 '__tool_info__' => :TOOL_INFO, 32 33 33 34 # types … … 165 166 # すべての構文解析が完了した 166 167 @@b_end_all_parse = false 168 169 # tag なし struct 170 @@no_struct_tag_num = 0 167 171 168 172 def self.parse( file_name, plugin = nil, b_reuse = false ) … … 280 284 string += line 281 285 # この位置では error メソッドは使えない (token 読出し前) 282 puts " error: #{file} line #{lineno}: string literal has newline without escape"286 puts "#{file}:#{lineno}:#{col}: error: string literal has newline without escape" 283 287 @@n_error += 1 284 288 end … … 321 325 b_in_string = true 322 326 # この位置では error メソッドは使えない (token 読出し前) # mikan cdl_error ではない 323 puts " error: #{file} line #{lineno}: string literal has newline without escape"327 puts "#{file}:#{lineno}:#{col}: error: string literal has newline without escape" 324 328 @@n_error += 1 325 329 # 山括弧で囲まれた文字列 326 when /\A<[0-9A-Za-z_\. \/]+>/ # AB: angle bracke 330 # when /\A<[0-9A-Za-z_\. \/]+>/ # AB: angle bracke 331 when /\A<(?:[^>\\]|\\.)*>/ # これはうまく行くようだ 327 332 @q << [:AB_STRING_LITERAL, Token.new($&, file, lineno, col)] 328 333 # 行コメント … … 420 425 @@n_error = 0 421 426 @@n_warning = 0 427 @@n_info = 0 422 428 423 429 # このメソッドは構文解析、意味解析からのみ呼出し可(コード生成でエラー発生は不適切) … … 453 459 end 454 460 if locale then 455 Console.puts " error: #{locale[0]}: line #{locale[1]}#{msg}"461 Console.puts "#{locale[0]}:#{locale[1]}:#{locale[2]}: error: #{msg}" 456 462 else 457 463 Console.puts "error: #{msg}" … … 486 492 end 487 493 if locale then 488 Console.puts " warning: #{locale[0]}: line #{locale[1]}#{msg}"494 Console.puts "#{locale[0]}:#{locale[1]}:#{locale[2]}: warning: #{msg}" 489 495 else 490 496 Console.puts "warning: #{msg}" … … 493 499 end 494 500 501 # このメソッドは構文解析、意味解析からのみ呼出し可 502 def self.info( msg, *arg ) 503 locale = nil 504 self.info2( locale, msg, *arg ) 505 end 506 507 def self.info2( locale, msg, *arg ) 508 @@n_info += 1 509 510 msg = TECSMsg.get_info_message( msg ) 511 # $1, $2, ... を arg で置換 512 count = 1 513 arg.each{ |a| 514 str = TECSIO.str_code_convert( msg, a.to_s ) 515 msg.sub!( /\$#{count}/, str ) 516 count += 1 517 } 518 519 # import_C の中でのウォーニング? 520 if @@import_C then 521 C_parser.info( msg ) 522 else 523 if @@b_end_all_parse == false || locale == nil then 524 locale = @@current_locale[ @@generator_nest ] 525 end 526 if locale then 527 Console.puts "#{locale[0]}:#{locale[1]}:#{locale[2]}: info: #{msg}" 528 else 529 Console.puts "info: #{msg}" 530 end 531 end 532 end 533 495 534 def self.get_n_error 496 535 @@n_error … … 501 540 end 502 541 542 def self.get_n_info 543 @@n_info 544 end 545 503 546 def self.get_nest 504 547 @@generator_nest 548 end 549 550 def self.parsing_C? 551 @@import_C 505 552 end 506 553 … … 543 590 544 591 clist = [ 545 '65,566,323,779,733,806,77,346,347,323,77,77,77,160,194,195,196,197,198', 546 '199,200,202,174,203,664,133,860,133,99,207,208,209,210,211,212,213,663', 547 '244,831,551,394,512,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25', 548 '26,27,28,29,30,31,32,33,34,35,38,678,395,459,309,696,42,43,44,45,46', 549 '47,48,49,858,98,654,827,440,133,133,826,133,133,133,133,133,65,186,186', 550 '186,186,69,67,68,308,70,71,77,72,323,73,299,300,319,819,133,175,133', 551 '134,320,134,322,186,74,74,74,75,76,76,76,133,86,186,186,186,186,78,85', 552 '5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32', 553 '33,34,35,38,77,420,186,358,359,42,43,44,45,46,47,48,49,186,134,134,134', 554 '65,134,134,134,134,134,133,133,87,571,77,77,570,323,69,67,68,325,70', 555 '71,133,72,799,73,530,134,341,134,299,300,319,342,343,397,798,682,320', 556 '74,322,75,134,76,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26', 557 '27,28,29,30,31,32,33,34,35,38,444,48,49,352,353,42,43,44,45,46,47,48', 558 '49,328,329,509,510,65,299,300,301,186,302,303,305,306,683,606,77,134', 559 '134,69,67,68,856,70,71,272,72,607,73,77,177,134,643,299,300,319,77,77', 560 '636,203,780,320,74,322,75,684,76,5,6,7,10,13,14,15,16,17,18,19,20,21', 561 '22,23,24,25,26,27,28,29,30,31,32,33,34,35,38,795,160,610,676,855,42', 562 '43,44,45,46,47,48,49,160,637,403,470,86,160,471,633,426,781,85,793,470', 563 '87,87,471,502,705,69,67,68,758,70,71,397,72,396,73,159,625,402,194,195', 564 '196,197,198,199,200,202,614,203,74,792,75,133,76,207,208,209,210,211', 565 '212,213,299,300,301,160,302,303,305,306,194,195,196,197,198,199,200', 566 '202,160,203,624,609,283,133,626,207,208,209,210,211,212,213,867,742', 567 '809,194,195,196,197,198,199,200,202,335,203,336,159,337,133,229,207', 568 '208,209,210,211,212,213,194,195,196,197,198,199,200,202,810,203,251', 569 '160,230,133,409,207,208,209,210,211,212,213,229,649,707,666,400,837', 570 '79,134,496,277,676,251,571,704,846,570,160,539,845,393,230,848,596,408', 571 '818,229,748,147,619,630,146,706,648,684,667,401,838,134,761,495,278', 572 '675,250,705,167,230,620,229,86,847,760,86,817,86,85,177,618,85,87,85', 573 '341,87,134,87,270,342,343,230,632,177,194,195,196,197,198,199,200,202', 574 '173,203,614,744,869,133,134,207,208,209,210,211,212,213,194,195,196', 575 '197,198,199,200,202,147,203,650,146,651,133,172,207,208,209,210,211', 576 '212,213,194,195,196,197,198,199,200,202,171,203,388,389,390,133,170', 577 '207,208,209,210,211,212,213,194,195,196,197,198,199,200,202,169,203', 578 '388,389,390,133,659,207,208,209,210,211,212,213,348,349,350,351,194', 579 '195,196,197,198,199,200,202,168,203,583,330,660,133,134,207,208,209', 580 '210,211,212,213,194,195,196,197,198,199,200,202,661,203,344,345,165', 581 '133,134,207,208,209,210,211,212,213,194,195,196,197,198,199,200,202', 582 '164,203,282,283,665,133,134,207,208,209,210,211,212,213,194,195,196', 583 '197,198,199,200,202,668,203,352,353,670,133,134,207,208,209,210,211', 584 '212,213,348,349,350,351,194,195,196,197,198,199,200,202,431,203,346', 585 '347,671,133,134,207,208,209,210,211,212,213,672,448,673,376,377,378', 586 '430,432,433,434,435,431,346,347,134,371,372,373,374,375,379,229,450', 587 '451,452,449,348,349,350,351,674,430,432,433,434,435,134,341,142,143', 588 '677,230,342,343,194,195,196,197,198,199,200,202,163,203,346,347,203', 589 '133,134,207,208,209,210,211,212,213,346,347,344,345,194,195,196,197', 590 '198,199,200,202,680,203,344,345,162,133,134,207,208,209,210,211,212', 591 '213,194,195,196,197,198,199,200,202,161,203,398,330,689,133,160,207', 592 '208,209,210,211,212,213,194,195,196,197,198,199,200,202,691,203,719', 593 '510,692,133,693,207,208,209,210,211,212,213,194,195,196,197,198,199', 594 '200,202,160,203,376,377,378,133,134,207,208,209,210,211,212,213,371', 595 '372,373,374,375,379,102,103,104,105,106,107,108,109,110,111,112,695', 596 '134,697,698,699,700,703,708,229,20,21,22,23,24,25,26,27,28,29,30,31', 597 '32,33,134,711,562,74,714,230,715,716,194,195,196,197,198,199,200,202', 598 '717,203,157,744,720,133,134,207,208,209,210,211,212,213,194,195,196', 599 '197,198,199,200,202,721,203,722,599,724,133,134,207,208,209,210,211', 600 '212,213,194,195,196,197,198,199,200,202,725,203,726,728,614,133,731', 601 '207,208,209,210,211,212,213,194,195,196,197,198,199,200,202,732,203', 602 '156,153,736,133,152,207,208,209,210,211,212,213,739,743,751,752,194', 603 '195,196,197,198,199,200,202,144,203,754,576,755,133,134,207,208,209', 604 '210,211,212,213,194,195,196,197,198,199,200,202,757,203,759,762,763', 605 '133,134,207,208,209,210,211,212,213,194,195,196,197,198,199,200,202', 606 '764,203,767,768,769,133,134,207,208,209,210,211,212,213,194,195,196', 607 '197,198,199,200,202,770,203,643,232,703,133,134,207,208,209,210,211', 608 '212,213,86,86,86,229,177,775,85,85,85,86,87,87,87,776,86,85,777,778', 609 '134,87,85,141,711,230,87,786,194,195,196,197,198,199,200,202,140,203', 610 '788,138,132,133,134,207,208,209,210,211,212,213,194,195,196,197,198', 611 '199,200,202,791,203,130,796,128,133,134,207,208,209,210,211,212,213', 612 '194,195,196,197,198,199,200,202,800,203,801,-383,802,133,134,207,208', 613 '209,210,211,212,213,194,195,196,197,198,199,200,202,803,203,804,124', 614 '123,133,807,207,208,209,210,211,212,213,767,203,813,816,194,195,196', 615 '197,198,199,200,202,821,203,822,94,824,133,134,207,208,209,210,211,212', 616 '213,194,195,196,197,198,199,200,202,828,203,829,830,90,133,134,207,208', 617 '209,210,211,212,213,194,195,196,197,198,199,200,202,833,203,834,89,836', 618 '133,134,207,208,209,210,211,212,213,194,195,196,197,198,199,200,202', 619 '798,203,839,840,323,133,134,207,208,209,210,211,212,213,842,843,844', 620 '849,194,195,196,197,198,199,200,202,850,203,851,88,857,133,134,207,208', 621 '209,210,211,212,213,194,195,196,197,198,199,200,202,357,203,356,362', 622 '363,133,134,207,208,209,210,211,212,213,194,195,196,197,198,199,200', 623 '202,365,203,366,122,861,133,134,207,208,209,210,211,212,213,194,195', 624 '196,197,198,199,200,202,3,203,156,355,399,133,134,207,208,209,210,211', 625 '212,213,404,140,406,407,194,195,196,197,198,199,200,202,410,203,411', 626 '412,413,133,134,207,208,209,210,211,212,213,194,195,196,197,198,199', 627 '200,202,414,203,415,354,862,133,134,207,208,209,210,211,212,213,194', 628 '195,196,197,198,199,200,202,438,203,439,442,453,133,134,207,208,209', 629 '210,211,212,213,194,195,196,197,198,199,200,202,330,203,456,457,186', 630 '133,134,207,208,209,210,211,212,213,464,465,466,473,194,195,196,197', 631 '198,199,200,202,474,203,307,285,284,133,134,207,208,209,210,211,212', 632 '213,194,195,196,197,198,199,200,202,281,203,280,279,276,133,134,207', 633 '208,209,210,211,212,213,194,195,196,197,198,199,200,202,275,203,274', 634 '267,177,133,134,207,208,209,210,211,212,213,194,195,196,197,198,199', 635 '200,202,265,203,203,259,203,133,134,207,208,209,210,211,212,213,156', 636 '503,504,505,194,195,196,197,198,199,200,202,506,203,507,863,513,133', 637 '134,207,208,209,210,211,212,213,194,195,196,197,198,199,200,202,514', 638 '203,515,259,517,133,134,207,208,209,210,211,212,213,86,86,86,86,252', 639 '265,85,85,85,85,87,87,87,87,134,299,300,301,520,302,303,305,306,521', 640 '194,195,196,197,198,199,200,202,203,203,524,203,134,133,203,207,208', 641 '209,210,211,212,213,177,528,194,195,196,197,198,199,200,202,529,203', 642 '532,533,534,133,134,207,208,209,210,211,212,213,115,116,117,118,119', 643 '120,121,115,116,117,118,119,120,121,134,536,537,540,186,5,6,7,10,13', 644 '14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,38', 645 '265,865,550,554,160,42,43,44,45,46,47,48,49,134,194,195,196,197,198', 646 '199,200,202,556,203,866,186,560,133,562,207,208,209,210,211,212,213', 647 '323,134,565,87,242,190,578,579,354,355,356,357,580,189,188,186,185,184', 648 '183,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31', 649 '32,33,34,35,38,182,181,596,597,599,42,43,44,45,46,47,48,49,194,195,196', 650 '197,198,199,200,202,600,203,330,601,603,133,604,207,208,209,210,211', 651 '212,213,605,,134,194,195,196,197,198,199,200,339,,203,,,,133,,207,208', 652 '209,210,211,212,213,194,195,196,197,198,199,200,202,,203,,685,,133,', 653 '207,208,209,210,211,212,213,194,195,196,197,198,199,200,202,,203,,,', 654 '133,,207,208,209,210,211,212,213,,194,195,196,197,198,199,200,202,,203', 655 ',576,,133,134,207,208,209,210,211,212,213,,,,194,195,196,197,198,199', 656 '200,202,,203,,655,,133,134,207,208,209,210,211,212,213,194,195,196,197', 657 '198,199,200,202,,203,,,,133,134,207,208,209,210,211,212,213,194,195', 658 '196,197,198,199,200,202,,203,,,,133,134,207,208,209,210,211,212,213', 659 ',194,195,196,197,198,199,200,202,,203,,,,133,134,207,208,209,210,211', 660 '212,213,,,,194,195,196,197,198,199,200,202,,203,,,,133,134,207,208,209', 661 '210,211,212,213,194,195,196,197,198,199,200,202,,203,,,,133,134,207', 662 '208,209,210,211,212,213,194,195,196,197,198,199,200,202,,203,,,,133', 663 '134,207,208,209,210,211,212,213,,194,195,196,197,198,199,200,202,,203', 664 ',,,133,134,207,208,209,210,211,212,213,,,,194,195,196,197,198,199,200', 665 '202,,203,,,,133,134,207,208,209,210,211,212,213,102,103,104,105,106', 666 '107,108,109,110,111,112,,,,134,,,,,,,,,,,,,,,,,,,,,,134,,115,116,117', 667 '118,119,120,121,,,229,581,,,470,574,,573,,,,,134,,87,,,,,,230,,,,,,', 668 ',,,,,,,,,,134,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27', 669 '28,29,30,31,32,33,34,35,38,236,,77,,,42,43,44,45,46,47,48,49,,,,,,,', 670 ',,,,,,,,,,,,,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28', 671 '29,30,31,32,33,34,35,38,657,,77,,,42,43,44,45,46,47,48,49,,,,,,,,,,', 672 ',,,,,,,,,,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29', 673 '30,31,32,33,34,35,38,77,,,,,42,43,44,45,46,47,48,49,,,,,,,,,,,,,,,,', 674 ',,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31', 675 '32,33,34,35,38,77,,,,,42,43,44,45,46,47,48,49,498,,,,,,,,,,,,,,,,,,5', 592 '66,575,328,559,538,815,78,330,869,328,78,78,78,409,199,200,201,202,203', 593 '204,205,207,846,208,678,135,897,135,647,212,213,214,215,216,217,218', 594 '249,679,177,872,870,408,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24', 595 '25,26,27,28,29,30,31,32,33,34,35,38,465,189,693,333,334,42,43,44,45', 596 '46,47,48,49,896,88,644,406,666,761,711,87,135,871,135,135,135,135,189', 597 '66,189,189,70,68,69,135,71,72,328,73,78,74,304,305,324,860,901,189,407', 598 '136,325,136,327,189,75,75,75,76,77,77,77,135,874,178,189,189,189,79', 599 '875,101,80,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28', 600 '29,30,31,32,33,34,35,38,78,364,365,256,899,42,43,44,45,46,47,48,49,189', 601 '189,189,136,66,136,136,136,136,878,135,135,89,100,78,78,136,328,70,68', 602 '69,399,71,72,135,73,877,74,304,305,324,135,446,135,478,868,325,479,327', 603 '867,879,75,136,76,89,77,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24', 604 '25,26,27,28,29,30,31,32,33,34,35,38,450,48,49,314,838,42,43,44,45,46', 605 '47,48,49,135,135,839,135,66,304,305,306,135,307,308,310,311,691,838', 606 '78,136,136,70,68,69,313,71,72,275,73,880,74,78,180,136,816,304,305,324', 607 '78,881,136,136,136,325,75,327,76,690,77,5,6,7,10,13,14,15,16,17,18,19', 608 '20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,38,835,426,403,282,697', 609 '42,43,44,45,46,47,48,49,163,817,163,620,288,277,136,136,432,136,180', 610 '504,78,150,136,654,149,720,70,68,69,283,71,72,403,73,402,74,520,636', 611 '162,199,200,201,202,203,204,205,207,328,208,75,503,76,135,77,212,213', 612 '214,215,216,217,218,304,305,306,859,307,308,310,311,199,200,201,202', 613 '203,204,205,207,889,208,635,648,883,135,637,212,213,214,215,216,217', 614 '218,884,858,681,199,200,201,202,203,204,205,207,341,208,342,888,343', 615 '135,234,212,213,214,215,216,217,218,199,200,201,202,203,204,205,207', 616 '682,208,885,668,235,135,661,212,213,214,215,216,217,218,88,789,790,691', 617 '256,400,87,136,150,890,89,149,199,200,201,202,203,204,205,207,667,208', 618 '891,660,163,135,776,212,213,214,215,216,217,218,794,255,401,136,199', 619 '200,201,202,203,204,205,207,892,208,719,415,850,135,162,212,213,214', 620 '215,216,217,218,887,898,136,902,886,582,721,903,581,833,199,200,201', 621 '202,203,204,205,207,720,208,414,851,904,135,136,212,213,214,215,216', 622 '217,218,199,200,201,202,203,204,205,207,832,208,722,698,826,135,906', 623 '212,213,214,215,216,217,218,163,163,88,478,136,907,479,582,87,908,581', 624 '607,89,163,3,163,88,910,827,699,699,81,87,352,353,234,89,797,170,770', 625 '136,199,200,201,202,203,204,205,207,796,208,547,587,564,135,235,212', 626 '213,214,215,216,217,218,90,199,200,201,202,203,204,205,207,136,208,394', 627 '395,396,135,91,212,213,214,215,216,217,218,199,200,201,202,203,204,205', 628 '207,136,208,394,395,396,135,92,212,213,214,215,216,217,218,199,200,201', 629 '202,203,204,205,207,163,208,350,351,96,135,124,212,213,214,215,216,217', 630 '218,594,336,125,199,200,201,202,203,204,205,207,126,208,130,510,132', 631 '135,136,212,213,214,215,216,217,218,134,199,200,201,202,203,204,205', 632 '207,140,208,352,353,142,135,136,212,213,214,215,216,217,218,199,200', 633 '201,202,203,204,205,207,143,208,404,336,144,135,136,212,213,214,215', 634 '216,217,218,199,200,201,202,203,204,205,207,147,208,358,359,155,135', 635 '136,212,213,214,215,216,217,218,350,351,156,199,200,201,202,203,204', 636 '205,207,159,208,350,351,160,135,136,212,213,214,215,216,217,218,164', 637 '199,200,201,202,203,204,205,207,165,208,358,359,166,135,136,212,213', 638 '214,215,216,217,218,199,200,201,202,203,204,205,207,167,208,630,437', 639 '168,135,136,212,213,214,215,216,217,218,352,353,234,747,518,171,631', 640 '287,288,436,438,439,440,441,136,347,629,172,347,173,348,349,235,348', 641 '349,199,200,201,202,203,204,205,207,174,208,352,353,175,135,136,212', 642 '213,214,215,216,217,218,176,199,200,201,202,203,204,205,207,180,208', 643 '184,772,185,135,136,212,213,214,215,216,217,218,199,200,201,202,203', 644 '204,205,207,454,208,145,146,186,135,136,212,213,214,215,216,217,218', 645 '347,187,234,517,518,348,349,456,457,458,455,199,200,201,202,203,204', 646 '205,207,454,208,188,235,189,135,191,212,213,214,215,216,217,218,354', 647 '355,356,357,787,788,136,456,457,458,455,354,355,356,357,199,200,201', 648 '202,203,204,205,207,437,208,382,383,384,135,136,212,213,214,215,216', 649 '217,218,377,378,379,380,381,385,436,438,439,440,441,304,305,306,136', 650 '307,308,310,311,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27', 651 '28,29,30,31,32,33,34,35,38,136,354,355,356,357,42,43,44,45,46,47,48', 652 '49,199,200,201,202,203,204,205,207,192,208,352,353,193,135,196,212,213', 653 '214,215,216,217,218,247,89,136,199,200,201,202,203,204,205,207,257,208', 654 '159,264,208,135,270,212,213,214,215,216,217,218,199,200,201,202,203', 655 '204,205,207,180,208,272,279,280,135,281,212,213,214,215,216,217,218', 656 '234,284,285,286,289,290,199,200,201,202,203,204,205,207,312,208,335', 657 '189,336,135,235,212,213,214,215,216,217,218,360,199,200,201,202,203', 658 '204,205,207,136,208,361,670,362,135,363,212,213,214,215,216,217,218', 659 '199,200,201,202,203,204,205,207,368,208,369,136,371,135,372,212,213', 660 '214,215,216,217,218,159,199,200,201,202,203,204,205,207,405,208,136', 661 '587,410,135,142,212,213,214,215,216,217,218,412,413,199,200,201,202', 662 '203,204,205,207,416,208,417,418,419,135,136,212,213,214,215,216,217', 663 '218,420,199,200,201,202,203,204,205,207,421,208,444,445,448,135,136', 664 '212,213,214,215,216,217,218,199,200,201,202,203,204,205,207,459,208', 665 '462,772,463,135,136,212,213,214,215,216,217,218,470,88,234,88,382,383', 666 '384,87,472,87,473,89,474,89,481,136,377,378,379,380,381,385,235,482', 667 '208,199,200,201,202,203,204,205,207,511,208,512,513,514,135,136,212', 668 '213,214,215,216,217,218,515,199,200,201,202,203,204,205,207,521,208', 669 '522,523,264,135,136,212,213,214,215,216,217,218,199,200,201,202,203', 670 '204,205,207,525,208,270,528,529,135,136,212,213,214,215,216,217,218', 671 '199,200,201,202,203,204,205,207,208,208,532,208,208,135,180,212,213', 672 '214,215,216,217,218,536,537,540,199,200,201,202,203,204,205,207,541', 673 '208,542,544,545,135,136,212,213,214,215,216,217,218,737,738,740,741', 674 '548,189,270,558,562,196,739,737,738,740,741,136,565,189,743,742,196', 675 '739,234,592,569,88,88,571,88,743,742,87,87,88,87,89,89,136,89,87,328', 676 '574,235,89,196,199,200,201,202,203,204,205,207,589,208,590,700,360,135', 677 '136,212,213,214,215,216,217,218,361,362,472,199,200,201,202,203,204', 678 '205,207,363,208,472,591,607,135,136,212,213,214,215,216,217,218,199', 679 '200,201,202,203,204,205,207,608,208,611,336,612,135,614,212,213,214', 680 '215,216,217,218,199,200,201,202,203,204,205,207,615,208,616,617,618', 681 '135,208,212,213,214,215,216,217,218,621,737,738,740,741,163,625,88,88', 682 '641,196,739,785,87,87,136,643,89,89,743,742,625,662,663,669,674,199', 683 '200,201,202,203,204,205,207,675,208,676,680,683,135,136,212,213,214', 684 '215,216,217,218,199,200,201,202,203,204,205,207,685,208,686,687,688', 685 '135,136,212,213,214,215,216,217,218,472,104,105,106,107,108,109,110', 686 '111,112,113,114,689,189,136,692,208,695,704,5,6,7,10,13,14,15,16,17', 687 '18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,38,163,706,707', 688 '708,163,42,43,44,45,46,47,48,49,710,712,136,117,118,119,120,121,122', 689 '123,199,200,201,202,203,204,205,207,713,208,714,715,718,135,136,212', 690 '213,214,215,216,217,218,199,200,201,202,203,204,205,207,723,208,726', 691 '571,75,135,729,212,213,214,215,216,217,218,199,200,201,202,203,204,205', 692 '207,730,208,196,744,745,135,748,212,213,214,215,216,217,218,199,200', 693 '201,202,203,204,205,207,749,208,752,753,754,135,756,212,213,214,215', 694 '216,217,218,625,759,760,764,199,200,201,202,203,204,205,207,767,208', 695 '771,779,780,135,136,212,213,214,215,216,217,218,199,200,201,202,203', 696 '204,205,207,782,208,783,791,793,135,136,212,213,214,215,216,217,218', 697 '199,200,201,202,203,204,205,207,189,208,795,798,799,135,136,212,213', 698 '214,215,216,217,218,199,200,201,202,203,204,205,207,800,208,803,804', 699 '805,135,136,212,213,214,215,216,217,218,806,654,718,180,199,200,201', 700 '202,203,204,205,207,811,208,812,813,814,135,136,212,213,214,215,216', 701 '217,218,199,200,201,202,203,204,205,207,726,208,823,828,831,135,136', 702 '212,213,214,215,216,217,218,199,200,201,202,203,204,205,207,836,208', 703 '840,841,-386,135,136,212,213,214,215,216,217,218,199,200,201,202,203', 704 '204,205,207,842,208,843,237,844,135,136,212,213,214,215,216,217,218', 705 '848,803,208,854,199,200,201,202,203,204,205,207,857,208,862,863,865', 706 '135,136,212,213,214,215,216,217,218,199,200,201,202,203,204,205,207', 707 ',208,,,,135,136,212,213,214,215,216,217,218,199,200,201,202,203,204', 708 '205,207,,208,,,,135,136,212,213,214,215,216,217,218,199,200,201,202', 709 '203,204,205,207,,208,,,,135,136,212,213,214,215,216,217,218,88,,,,,', 710 '87,,,88,89,737,738,740,741,87,,,136,89,196,739,,,,234,,,,743,742,117', 711 '118,119,120,121,122,123,,,136,,,,,235,,,199,200,201,202,203,204,205', 712 '207,,208,,,,135,136,212,213,214,215,216,217,218,199,200,201,202,203', 713 '204,205,207,,208,472,,,135,136,212,213,214,215,216,217,218,199,200,201', 714 '202,203,204,205,345,,208,,,,135,,212,213,214,215,216,217,218,199,200', 715 '201,202,203,204,205,207,,208,,,,135,,212,213,214,215,216,217,218,,,', 716 '104,105,106,107,108,109,110,111,112,113,114,,,,,136,,,,,,,104,105,106', 717 '107,108,109,110,111,112,113,114,,,,,136,117,118,119,120,121,122,123', 718 ',,,478,585,,584,,,,,,,89,136,117,118,119,120,121,122,123,20,21,22,23', 719 '24,25,26,27,28,29,30,31,32,33,136,5,6,7,10,13,14,15,16,17,18,19,20,21', 720 '22,23,24,25,26,27,28,29,30,31,32,33,34,35,38,672,,78,,,42,43,44,45,46', 721 '47,48,49,,,,,,,,,,,,,,,,,,,,,5,6,7,10,13,14,15,16,17,18,19,20,21,22', 722 '23,24,25,26,27,28,29,30,31,32,33,34,35,38,241,,78,,,42,43,44,45,46,47', 723 '48,49,,,,,,,,,,,,,,,,,,,,,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23', 724 '24,25,26,27,28,29,30,31,32,33,34,35,38,78,,,,,42,43,44,45,46,47,48,49', 725 ',,,,,,,,,,,,,,,,,,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26', 726 '27,28,29,30,31,32,33,34,35,38,78,,,,,42,43,44,45,46,47,48,49,506,,,', 727 ',,,,,,,,,,,,,,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27', 728 '28,29,30,31,32,33,34,35,38,78,428,,,,42,43,44,45,46,47,48,49,,,,,,,', 729 ',,,,,,,,,,,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28', 730 '29,30,31,32,33,34,35,38,78,,,,,42,43,44,45,46,47,48,49,,,,,,,,,,,,,', 731 ',,,,,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30', 732 '31,32,33,34,35,38,78,,,,,42,43,44,45,46,47,48,49,,,,,,,,,,,,,,,,,,,5', 676 733 '6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33', 677 '34,35,38, 126,381,,,,42,43,44,45,46,47,48,49,,,,,,,,,,,,,,,,,,,5,6,7',678 '1 0,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34',679 '3 5,38,77,,,,,42,43,44,45,46,47,48,49,,,,,,,,,,,,,,,,,,,5,6,7,10,13,14',680 '15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,38, 77',681 ' ,,,,42,43,44,45,46,47,48,49,,,,,,,,,,,,,,,,,,,5,6,7,10,13,14,15,16,17',682 '1 8,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,38,77,,,,,42,43',683 '4 4,45,46,47,48,49,,,,,,,,,,,,,,,,,,,5,6,7,10,13,14,15,16,17,18,19,20',684 '2 1,22,23,24,25,26,27,28,29,30,31,32,33,34,35,38,77,422,,,,42,43,44,45',685 '4 6,47,48,49,,,,,,,,,,,,,,,,,,,5,6,7,10,13,14,15,16,17,18,19,20,21,22',686 '2 3,24,25,26,27,28,29,30,31,32,33,34,35,38,77,508,,,,42,43,44,45,46,47',734 '34,35,38,78,632,,,,42,43,44,45,46,47,48,49,,,,,,,,,,,,,,,,,,,5,6,7,10', 735 '13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35', 736 '38,78,638,,,,42,43,44,45,46,47,48,49,,,,,,,,,,,,,,,,,,,5,6,7,10,13,14', 737 '15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,38,128', 738 '658,,,,42,43,44,45,46,47,48,49,,,,,,,,,,,,,,,,,,,5,6,7,10,13,14,15,16', 739 '17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,38,78,,,,,42', 740 '43,44,45,46,47,48,49,,,,,,,,,,,,,,,,,,,5,6,7,10,13,14,15,16,17,18,19', 741 '20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,38,78,516,,,,42,43,44', 742 '45,46,47,48,49,,,,,,,,,,,,,,,,,,,5,6,7,10,13,14,15,16,17,18,19,20,21', 743 '22,23,24,25,26,27,28,29,30,31,32,33,34,35,38,78,,,,,42,43,44,45,46,47', 687 744 '48,49,,,,,,,,,,,,,,,,,,,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24', 688 '25,26,27,28,29,30,31,32,33,34,35,38,7 7,,,,,42,43,44,45,46,47,48,49,',689 ',,,,,,,,,,,,,,,,, 5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26',690 '27,28,29,30,31,32,33,34,35,38,7 7,,,,,42,43,44,45,46,47,48,49,,,,,,,',745 '25,26,27,28,29,30,31,32,33,34,35,38,78,387,,,,42,43,44,45,46,47,48,49', 746 ',,,,,,,,,,,,,,,,,,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26', 747 '27,28,29,30,31,32,33,34,35,38,78,,,,,42,43,44,45,46,47,48,49,,,,,,,', 691 748 ',,,,,,,,,,,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28', 692 '29,30,31,32,33,34,35,38,77,,,,,42,43,44,45,46,47,48,49,,,,,,,,,,,,,', 693 ',,,,,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30', 694 '31,32,33,34,35,38,77,621,,,,42,43,44,45,46,47,48,49,,,,,,,,,,,,,,,,', 695 ',,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31', 696 '32,33,34,35,38,77,627,,,,42,43,44,45,46,47,48,49,,,,,,,,,,,,,,,,,,,5', 697 '6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33', 698 '34,35,38,,646,,,,42,43,44,45,46,47,48,49,102,103,104,105,106,107,108', 699 '109,110,111,112,,,,,,,,,,,,,,,,,,,,,,,,,,,,115,116,117,118,119,120,121', 749 '29,30,31,32,33,34,35,38,,,,,,42,43,44,45,46,47,48,49,5,6,7,10,13,14', 750 '15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,38,,', 751 ',,,42,43,44,45,46,47,48,49,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23', 752 '24,25,26,27,28,29,30,31,32,33,34,35,38,,,,,,42,43,44,45,46,47,48,49', 700 753 '5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32', 701 754 '33,34,35,38,,,,,,42,43,44,45,46,47,48,49,5,6,7,10,13,14,15,16,17,18', … … 707 760 '23,24,25,26,27,28,29,30,31,32,33,34,35,38,,,,,,42,43,44,45,46,47,48', 708 761 '49,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31', 709 '32,33,34,35,38,,,,,,42,43,44,45,46,47,48,49,5,6,7,10,13,14,15,16,17', 710 '18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,38,,,,,,42,43', 711 '44,45,46,47,48,49,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26', 712 '27,28,29,30,31,32,33,34,35,38,,,,,,42,43,44,45,46,47' ] 713 racc_action_table = arr = ::Array.new(3597, nil) 762 '32,33,34,35,38,,,,,,42,43,44,45,46,47' ] 763 racc_action_table = arr = ::Array.new(3593, nil) 714 764 idx = 0 715 765 clist.each do |str| … … 721 771 722 772 clist = [ 723 '2,463,803,749,688,787,189,218,218,189,602,2,324,386,714,714,714,714', 724 '714,714,714,714,123,714,586,754,854,714,41,714,714,714,714,714,714,714', 725 '585,151,815,441,257,386,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2', 726 '2,2,2,2,2,2,602,257,324,187,631,2,2,2,2,2,2,2,2,854,41,567,810,303,298', 727 '550,810,90,620,328,74,320,286,749,688,787,463,2,2,2,187,2,2,286,2,555', 728 '2,189,189,189,803,799,123,504,754,189,714,189,586,602,2,324,2,602,2', 729 '324,503,83,815,441,585,151,2,83,286,286,286,286,286,286,286,286,286', 730 '286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286', 731 '286,286,184,286,631,225,225,286,286,286,286,286,286,286,286,567,303', 732 '298,550,158,90,620,328,74,320,281,706,87,469,310,158,469,310,286,286', 733 '286,191,286,286,464,286,776,286,416,799,480,504,555,555,555,480,480', 734 '614,776,614,555,286,555,286,503,286,158,158,158,158,158,158,158,158', 735 '158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158', 736 '158,158,158,310,87,87,220,220,158,158,158,158,158,158,158,158,191,191', 737 '383,383,182,184,184,184,416,184,184,184,184,615,528,182,281,706,158', 738 '158,158,852,158,158,169,158,529,158,553,169,464,553,310,310,310,289', 739 '750,552,530,750,310,158,310,158,615,158,182,182,182,182,182,182,182', 740 '182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182', 741 '182,182,182,182,772,369,535,723,852,182,182,182,182,182,182,182,182', 742 '100,553,264,334,125,536,334,552,289,750,125,765,468,334,125,468,369', 743 '772,182,182,182,723,182,182,259,182,259,182,100,545,264,705,705,705', 744 '705,705,705,705,705,540,705,182,765,182,705,182,705,705,705,705,705', 745 '705,705,289,289,289,701,289,289,289,289,761,761,761,761,761,761,761', 746 '761,564,761,545,531,531,761,545,761,761,761,761,761,761,761,865,701', 747 '794,760,760,760,760,760,760,760,760,205,760,205,564,205,760,705,760', 748 '760,760,760,760,760,760,720,720,720,720,720,720,720,720,794,720,253', 749 '428,705,720,273,720,720,720,720,720,720,720,761,559,645,588,262,825', 750 '3,705,360,173,598,154,569,642,838,569,113,428,838,253,761,839,728,273', 751 '801,760,705,145,541,549,145,642,559,645,588,262,825,761,728,360,173', 752 '598,154,642,113,760,541,720,681,839,728,510,801,283,681,124,541,510', 753 '681,283,479,510,760,283,168,479,479,720,551,168,704,704,704,704,704', 754 '704,704,704,122,704,556,704,868,704,720,704,704,704,704,704,704,704', 755 '699,699,699,699,699,699,699,699,84,699,561,84,563,699,121,699,699,699', 756 '699,699,699,699,695,695,695,695,695,695,695,695,120,695,512,512,512', 757 '695,117,695,695,695,695,695,695,695,691,691,691,691,691,691,691,691', 758 '116,691,249,249,249,691,572,691,691,691,691,691,691,691,219,219,219', 759 '219,667,667,667,667,667,667,667,667,115,667,497,497,575,667,704,667', 760 '667,667,667,667,667,667,285,285,285,285,285,285,285,285,577,285,217', 761 '217,112,285,699,285,285,285,285,285,285,285,252,252,252,252,252,252', 762 '252,252,108,252,178,178,587,252,695,252,252,252,252,252,252,252,229', 763 '229,229,229,229,229,229,229,589,229,489,489,593,229,691,229,229,229', 764 '229,229,229,229,488,488,488,488,861,861,861,861,861,861,861,861,539', 765 '861,486,486,594,861,667,861,861,861,861,861,861,861,595,313,596,241', 766 '241,241,539,539,539,539,539,292,485,485,285,241,241,241,241,241,241', 767 '229,313,313,313,313,487,487,487,487,597,292,292,292,292,292,252,216', 768 '80,80,600,229,216,216,848,848,848,848,848,848,848,848,106,848,484,484', 769 '605,848,229,848,848,848,848,848,848,848,483,483,482,482,821,821,821', 770 '821,821,821,821,821,608,821,481,481,104,821,861,821,821,821,821,821', 771 '821,821,818,818,818,818,818,818,818,818,102,818,260,260,621,818,623', 772 '818,818,818,818,818,818,818,807,807,807,807,807,807,807,807,625,807', 773 '669,669,626,807,627,807,807,807,807,807,807,807,798,798,798,798,798', 774 '798,798,798,629,798,502,502,502,798,848,798,798,798,798,798,798,798', 775 '502,502,502,502,502,502,159,159,159,159,159,159,159,159,159,159,159', 776 '630,821,632,633,635,637,640,646,807,36,36,36,36,36,36,36,36,36,36,36', 777 '36,36,36,818,650,651,652,653,807,654,656,795,795,795,795,795,795,795', 778 '795,658,795,99,795,673,795,807,795,795,795,795,795,795,795,786,786,786', 779 '786,786,786,786,786,674,786,676,677,678,786,798,786,786,786,786,786', 780 '786,786,775,775,775,775,775,775,775,775,679,775,680,682,684,775,685', 781 '775,775,775,775,775,775,775,770,770,770,770,770,770,770,770,686,770', 782 '98,93,692,770,92,770,770,770,770,770,770,770,696,703,710,712,471,471', 783 '471,471,471,471,471,471,82,471,715,471,718,471,795,471,471,471,471,471', 784 '471,471,144,144,144,144,144,144,144,144,721,144,727,732,733,144,786', 785 '144,144,144,144,144,144,144,466,466,466,466,466,466,466,466,735,466', 786 '736,738,739,466,775,466,466,466,466,466,466,466,146,146,146,146,146', 787 '146,146,146,740,146,741,146,742,146,770,146,146,146,146,146,146,146', 788 '240,86,4,144,743,744,240,86,4,591,240,86,4,745,418,591,747,748,471,591', 789 '418,78,752,144,418,753,867,867,867,867,867,867,867,867,76,867,757,75', 790 '73,867,144,867,867,867,867,867,867,867,397,397,397,397,397,397,397,397', 791 '763,397,72,774,71,397,466,397,397,397,397,397,397,397,359,359,359,359', 792 '359,359,359,359,778,359,779,780,781,359,146,359,359,359,359,359,359', 793 '359,358,358,358,358,358,358,358,358,784,358,785,69,68,358,788,358,358', 794 '358,358,358,358,358,793,796,797,800,357,357,357,357,357,357,357,357', 795 '805,357,806,38,809,357,867,357,357,357,357,357,357,357,163,163,163,163', 796 '163,163,163,163,811,163,812,814,16,163,397,163,163,163,163,163,163,163', 797 '356,356,356,356,356,356,356,356,819,356,820,9,822,356,359,356,356,356', 798 '356,356,356,356,355,355,355,355,355,355,355,355,828,355,831,832,833', 799 '355,358,355,355,355,355,355,355,355,835,836,837,840,354,354,354,354', 800 '354,354,354,354,841,354,842,8,853,354,357,354,354,354,354,354,354,354', 801 '353,353,353,353,353,353,353,353,224,353,223,230,231,353,163,353,353', 802 '353,353,353,353,353,352,352,352,352,352,352,352,352,235,352,237,67,856', 803 '352,356,352,352,352,352,352,352,352,351,351,351,351,351,351,351,351', 804 '1,351,251,222,261,351,355,351,351,351,351,351,351,351,266,267,269,271', 805 '350,350,350,350,350,350,350,350,275,350,276,277,278,350,354,350,350', 806 '350,350,350,350,350,349,349,349,349,349,349,349,349,279,349,280,221', 807 '857,349,353,349,349,349,349,349,349,349,348,348,348,348,348,348,348', 808 '348,301,348,302,304,319,348,352,348,348,348,348,348,348,348,347,347', 809 '347,347,347,347,347,347,201,347,321,322,193,347,351,347,347,347,347', 810 '347,347,347,329,331,332,336,346,346,346,346,346,346,346,346,337,346', 811 '186,181,180,346,350,346,346,346,346,346,346,346,345,345,345,345,345', 812 '345,345,345,176,345,175,174,172,345,349,345,345,345,345,345,345,345', 813 '344,344,344,344,344,344,344,344,171,344,170,166,165,344,348,344,344', 814 '344,344,344,344,344,343,343,343,343,343,343,343,343,164,343,162,161', 815 '362,343,347,343,343,343,343,343,343,343,157,374,375,376,342,342,342', 816 '342,342,342,342,342,377,342,378,860,388,342,346,342,342,342,342,342', 817 '342,342,341,341,341,341,341,341,341,341,389,341,390,395,396,341,345', 818 '341,341,341,341,341,341,341,424,367,248,143,156,401,424,367,248,143', 819 '424,367,248,143,344,538,538,538,402,538,538,538,538,403,335,335,335', 820 '335,335,335,335,335,404,335,405,406,343,335,407,335,335,335,335,335', 821 '335,335,408,410,339,339,339,339,339,339,339,339,413,339,419,420,422', 822 '339,342,339,339,339,339,339,339,339,255,255,255,255,255,255,255,167', 823 '167,167,167,167,167,167,341,425,426,431,436,339,339,339,339,339,339', 824 '339,339,339,339,339,339,339,339,339,339,339,339,339,339,339,339,339', 825 '339,339,339,339,339,437,863,440,444,446,339,339,339,339,339,339,339', 826 '339,335,202,202,202,202,202,202,202,202,448,202,864,454,455,202,456', 827 '202,202,202,202,202,202,202,457,339,459,149,148,139,472,475,490,491', 828 '492,493,494,137,136,135,134,131,129,202,202,202,202,202,202,202,202', 829 '202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202', 830 '202,202,202,127,126,517,518,520,202,202,202,202,202,202,202,202,206', 831 '206,206,206,206,206,206,206,521,206,522,523,525,206,526,206,206,206', 832 '206,206,206,206,527,,202,207,207,207,207,207,207,207,207,,207,,,,207', 833 ',207,207,207,207,207,207,207,619,619,619,619,619,619,619,619,,619,,619', 834 ',619,,619,619,619,619,619,619,619,580,580,580,580,580,580,580,580,,580', 835 ',,,580,,580,580,580,580,580,580,580,,573,573,573,573,573,573,573,573', 836 ',573,,573,,573,206,573,573,573,573,573,573,573,,,,570,570,570,570,570', 837 '570,570,570,,570,,570,,570,207,570,570,570,570,570,570,570,566,566,566', 838 '566,566,566,566,566,,566,,,,566,619,566,566,566,566,566,566,566,515', 839 '515,515,515,515,515,515,515,,515,,,,515,580,515,515,515,515,515,515', 840 '515,,514,514,514,514,514,514,514,514,,514,,,,514,573,514,514,514,514', 841 '514,514,514,,,,513,513,513,513,513,513,513,513,,513,,,,513,570,513,513', 842 '513,513,513,513,513,507,507,507,507,507,507,507,507,,507,,,,507,566', 843 '507,507,507,507,507,507,507,506,506,506,506,506,506,506,506,,506,,,', 844 '506,515,506,506,506,506,506,506,506,,505,505,505,505,505,505,505,505', 845 ',505,,,,505,514,505,505,505,505,505,505,505,,,,496,496,496,496,496,496', 846 '496,496,,496,,,,496,513,496,496,496,496,496,496,496,458,458,458,458', 847 '458,458,458,458,458,458,458,,,,507,,,,,,,,,,,,,,,,,,,,,,506,,458,458', 848 '458,458,458,458,458,,,496,496,,,470,470,,470,,,,,505,,470,,,,,,496,', 849 ',,,,,,,,,,,,,,,496,470,470,470,470,470,470,470,470,470,470,470,470,470', 850 '470,470,470,470,470,470,470,470,470,470,470,470,470,470,470,147,,147', 851 ',,470,470,470,470,470,470,470,470,,,,,,,,,,,,,,,,,,,,,147,147,147,147', 852 '147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147', 853 '147,147,147,147,147,147,147,571,,571,,,147,147,147,147,147,147,147,147', 854 ',,,,,,,,,,,,,,,,,,,,571,571,571,571,571,571,571,571,571,571,571,571', 855 '571,571,571,571,571,571,571,571,571,571,571,571,571,571,571,571,366', 856 ',,,,571,571,571,571,571,571,571,571,,,,,,,,,,,,,,,,,,,366,366,366,366', 857 '366,366,366,366,366,366,366,366,366,366,366,366,366,366,366,366,366', 858 '366,366,366,366,366,366,366,246,,,,,366,366,366,366,366,366,366,366', 859 '366,,,,,,,,,,,,,,,,,,246,246,246,246,246,246,246,246,246,246,246,246', 860 '246,246,246,246,246,246,246,246,246,246,246,246,246,246,246,246,70,246', 861 ',,,246,246,246,246,246,246,246,246,,,,,,,,,,,,,,,,,,,70,70,70,70,70', 862 '70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70', 863 '153,,,,,70,70,70,70,70,70,70,70,,,,,,,,,,,,,,,,,,,153,153,153,153,153', 864 '153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153', 865 '153,153,153,153,153,153,245,,,,,153,153,153,153,153,153,153,153,,,,', 866 ',,,,,,,,,,,,,,245,245,245,245,245,245,245,245,245,245,245,245,245,245', 867 '245,245,245,245,245,245,245,245,245,245,245,245,245,245,288,,,,,245', 868 '245,245,245,245,245,245,245,,,,,,,,,,,,,,,,,,,288,288,288,288,288,288', 869 '288,288,288,288,288,288,288,288,288,288,288,288,288,288,288,288,288', 870 '288,288,288,288,288,380,288,,,,288,288,288,288,288,288,288,288,,,,,', 871 ',,,,,,,,,,,,,380,380,380,380,380,380,380,380,380,380,380,380,380,380', 872 '380,380,380,380,380,380,380,380,380,380,380,380,380,380,438,380,,,,380', 873 '380,380,380,380,380,380,380,,,,,,,,,,,,,,,,,,,438,438,438,438,438,438', 874 '438,438,438,438,438,438,438,438,438,438,438,438,438,438,438,438,438', 875 '438,438,438,438,438,439,,,,,438,438,438,438,438,438,438,438,,,,,,,,', 876 ',,,,,,,,,,439,439,439,439,439,439,439,439,439,439,439,439,439,439,439', 877 '439,439,439,439,439,439,439,439,439,439,439,439,439,453,,,,,439,439', 878 '439,439,439,439,439,439,,,,,,,,,,,,,,,,,,,453,453,453,453,453,453,453', 879 '453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453', 880 '453,453,453,453,542,,,,,453,453,453,453,453,453,453,453,,,,,,,,,,,,', 881 ',,,,,,542,542,542,542,542,542,542,542,542,542,542,542,542,542,542,542', 882 '542,542,542,542,542,542,542,542,542,542,542,542,546,542,,,,542,542,542', 883 '542,542,542,542,542,,,,,,,,,,,,,,,,,,,546,546,546,546,546,546,546,546', 884 '546,546,546,546,546,546,546,546,546,546,546,546,546,546,546,546,546', 885 '546,546,546,557,546,,,,546,546,546,546,546,546,546,546,,,,,,,,,,,,,', 886 ',,,,,557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,557', 887 '557,557,557,557,557,557,557,557,557,557,557,557,,557,,,,557,557,557', 888 '557,557,557,557,557,53,53,53,53,53,53,53,53,53,53,53,,,,,,,,,,,,,,,', 889 ',,,,,,,,,,,,53,53,53,53,53,53,53,694,694,694,694,694,694,694,694,694', 890 '694,694,694,694,694,694,694,694,694,694,694,694,694,694,694,694,694', 891 '694,694,,,,,,694,694,694,694,694,694,694,694,690,690,690,690,690,690', 892 '690,690,690,690,690,690,690,690,690,690,690,690,690,690,690,690,690', 893 '690,690,690,690,690,,,,,,690,690,690,690,690,690,690,690,239,239,239', 894 '239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239', 895 '239,239,239,239,239,239,239,239,,,,,,239,239,239,239,239,239,239,239', 896 '40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40', 897 '40,40,40,40,40,,,,,,40,40,40,40,40,40,40,40,284,284,284,284,284,284', 898 '284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284', 899 '284,284,284,284,284,,,,,,284,284,284,284,284,284,284,284,511,511,511', 900 '511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511', 901 '511,511,511,511,511,511,511,511,,,,,,511,511,511,511,511,511,511,511', 902 '611,611,611,611,611,611,611,611,611,611,611,611,611,611,611,611,611', 903 '611,611,611,611,611,611,611,611,611,611,611,,,,,,611,611,611,611,611', 904 '611,611,611,234,234,234,234,234,234,234,234,234,234,234,234,234,234', 905 '234,234,234,234,234,234,234,234,234,234,234,234,234,234,,,,,,234,234', 906 '234,234,234,234' ] 907 racc_action_check = arr = ::Array.new(3597, nil) 773 '2,469,843,447,422,777,192,194,852,192,329,2,613,269,515,515,515,515', 774 '515,515,515,515,824,515,596,325,893,515,560,515,515,515,515,515,515', 775 '515,154,597,125,856,853,269,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2', 776 '2,2,2,2,2,2,2,2,329,422,613,194,194,2,2,2,2,2,2,2,2,893,85,560,267,576', 777 '703,642,85,721,855,631,558,528,511,447,161,777,469,2,2,2,92,2,2,563', 778 '2,161,2,192,192,192,843,895,824,267,325,192,515,192,596,329,2,613,2', 779 '329,2,613,75,860,125,856,154,597,2,861,41,2,161,161,161,161,161,161', 780 '161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161', 781 '161,161,161,161,161,187,230,230,258,895,161,161,161,161,161,161,161', 782 '161,576,703,642,721,185,631,558,528,511,866,691,303,89,41,315,185,92', 783 '315,161,161,161,258,161,161,333,161,863,161,563,563,563,286,308,782', 784 '340,851,563,340,563,851,866,161,75,161,340,161,185,185,185,185,185,185', 785 '185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185', 786 '185,185,185,185,185,315,89,89,190,869,185,185,185,185,185,185,185,185', 787 '839,470,812,692,291,187,187,187,512,187,187,187,187,609,812,291,691', 788 '303,185,185,185,190,185,185,171,185,872,185,778,171,333,778,315,315', 789 '315,294,873,286,308,782,315,185,315,185,609,185,291,291,291,291,291', 790 '291,291,291,291,291,291,291,291,291,291,291,291,291,291,291,291,291', 791 '291,291,291,291,291,291,808,291,625,176,625,291,291,291,291,291,291', 792 '291,291,392,778,573,539,539,172,839,470,294,692,172,366,561,86,512,561', 793 '86,808,291,291,291,176,291,291,264,291,264,291,392,553,573,720,720,720', 794 '720,720,720,720,720,874,720,291,366,291,720,291,720,720,720,720,720', 795 '720,720,294,294,294,841,294,294,294,294,902,902,902,902,902,902,902', 796 '902,880,902,553,561,876,902,553,902,902,902,902,902,902,902,877,841', 797 '599,889,889,889,889,889,889,889,889,210,889,210,880,210,889,720,889', 798 '889,889,889,889,889,889,521,521,521,521,521,521,521,521,599,521,878', 799 '577,720,521,568,521,521,521,521,521,521,521,430,743,743,751,157,262', 800 '430,720,148,881,430,148,522,522,522,522,522,522,522,522,577,522,882', 801 '568,102,522,720,522,522,522,522,522,522,522,751,157,262,902,523,523', 802 '523,523,523,523,523,523,883,523,653,278,834,523,102,523,523,523,523', 803 '523,523,523,879,894,889,897,879,580,653,898,580,801,234,234,234,234', 804 '234,234,234,234,653,234,278,834,901,234,521,234,234,234,234,234,234', 805 '234,166,166,166,166,166,166,166,166,801,166,657,626,784,166,904,166', 806 '166,166,166,166,166,166,115,716,518,476,522,905,476,477,518,906,477', 807 '756,518,434,1,452,127,909,784,657,626,3,127,494,494,234,127,756,115', 808 '716,523,479,479,479,479,479,479,479,479,756,479,434,479,452,479,234', 809 '479,479,479,479,479,479,479,8,358,358,358,358,358,358,358,358,234,358', 810 '520,520,520,358,9,358,358,358,358,358,358,358,363,363,363,363,363,363', 811 '363,363,166,363,254,254,254,363,16,363,363,363,363,363,363,363,360,360', 812 '360,360,360,360,360,360,375,360,222,222,38,360,68,360,360,360,360,360', 813 '360,360,505,505,69,361,361,361,361,361,361,361,361,70,361,72,375,73', 814 '361,479,361,361,361,361,361,361,361,74,682,682,682,682,682,682,682,682', 815 '76,682,223,223,77,682,358,682,682,682,682,682,682,682,862,862,862,862', 816 '862,862,862,862,79,862,265,265,80,862,363,862,862,862,862,862,862,862', 817 '362,362,362,362,362,362,362,362,84,362,225,225,94,362,360,362,362,362', 818 '362,362,362,362,489,489,95,797,797,797,797,797,797,797,797,100,797,490', 819 '490,101,797,361,797,797,797,797,797,797,797,104,811,811,811,811,811', 820 '811,811,811,106,811,497,497,108,811,682,811,811,811,811,811,811,811', 821 '838,838,838,838,838,838,838,838,110,838,549,297,114,838,862,838,838', 822 '838,838,838,838,838,491,491,797,684,684,117,549,181,181,297,297,297', 823 '297,297,362,487,549,118,221,119,487,487,797,221,221,796,796,796,796', 824 '796,796,796,796,122,796,492,492,123,796,797,796,796,796,796,796,796', 825 '796,124,835,835,835,835,835,835,835,835,126,835,128,835,129,835,811', 826 '835,835,835,835,835,835,835,514,514,514,514,514,514,514,514,318,514', 827 '82,82,131,514,838,514,514,514,514,514,514,514,488,133,796,389,389,488', 828 '488,318,318,318,318,823,823,823,823,823,823,823,823,564,823,136,796', 829 '137,823,138,823,823,823,823,823,823,823,495,495,495,495,742,742,796', 830 '564,564,564,564,224,224,224,224,207,207,207,207,207,207,207,207,547', 831 '207,510,510,510,207,835,207,207,207,207,207,207,207,510,510,510,510', 832 '510,510,547,547,547,547,547,546,546,546,514,546,546,546,546,207,207', 833 '207,207,207,207,207,207,207,207,207,207,207,207,207,207,207,207,207', 834 '207,207,207,207,207,207,207,207,207,823,496,496,496,496,207,207,207', 835 '207,207,207,207,207,748,748,748,748,748,748,748,748,139,748,493,493', 836 '141,748,144,748,748,748,748,748,748,748,151,152,207,859,859,859,859', 837 '859,859,859,859,159,859,160,164,165,859,167,859,859,859,859,859,859', 838 '859,575,575,575,575,575,575,575,575,168,575,169,173,174,575,175,575', 839 '575,575,575,575,575,575,748,177,178,179,183,184,257,257,257,257,257', 840 '257,257,257,189,257,195,198,206,257,748,257,257,257,257,257,257,257', 841 '226,581,581,581,581,581,581,581,581,748,581,227,581,228,581,229,581', 842 '581,581,581,581,581,581,729,729,729,729,729,729,729,729,235,729,236', 843 '859,240,729,242,729,729,729,729,729,729,729,256,584,584,584,584,584', 844 '584,584,584,266,584,575,584,271,584,272,584,584,584,584,584,584,584', 845 '274,276,147,147,147,147,147,147,147,147,280,147,281,282,283,147,257', 846 '147,147,147,147,147,147,147,284,591,591,591,591,591,591,591,591,285', 847 '591,306,307,309,591,581,591,591,591,591,591,591,591,719,719,719,719', 848 '719,719,719,719,324,719,326,719,327,719,729,719,719,719,719,719,719', 849 '719,334,288,147,602,246,246,246,288,335,602,337,288,338,602,342,584', 850 '246,246,246,246,246,246,147,343,368,714,714,714,714,714,714,714,714', 851 '380,714,381,382,383,714,147,714,714,714,714,714,714,714,384,710,710', 852 '710,710,710,710,710,710,394,710,395,396,401,710,591,710,710,710,710', 853 '710,710,710,706,706,706,706,706,706,706,706,402,706,407,408,409,706', 854 '719,706,706,706,706,706,706,706,504,504,504,504,504,504,504,504,410', 855 '504,411,412,413,504,414,504,504,504,504,504,504,504,416,419,425,365', 856 '365,365,365,365,365,365,365,426,365,428,431,432,365,714,365,365,365', 857 '365,365,365,365,827,827,827,827,437,442,443,446,450,827,827,783,783', 858 '783,783,710,454,460,827,827,783,783,504,504,461,4,696,462,373,783,783', 859 '4,696,146,373,4,696,706,373,146,463,465,504,146,472,630,630,630,630', 860 '630,630,630,630,480,630,483,630,498,630,504,630,630,630,630,630,630', 861 '630,499,500,827,364,364,364,364,364,364,364,364,501,364,783,502,525', 862 '364,365,364,364,364,364,364,364,364,908,908,908,908,908,908,908,908', 863 '526,908,529,530,531,908,533,908,908,908,908,908,908,908,341,341,341', 864 '341,341,341,341,341,534,341,535,536,537,341,538,341,341,341,341,341', 865 '341,341,543,739,739,739,739,544,548,88,424,557,739,739,739,88,424,630', 866 '559,88,424,739,739,565,570,572,578,583,347,347,347,347,347,347,347,347', 867 '586,347,588,598,600,347,364,347,347,347,347,347,347,347,345,345,345', 868 '345,345,345,345,345,604,345,605,606,607,345,908,345,345,345,345,345', 869 '345,345,739,162,162,162,162,162,162,162,162,162,162,162,608,610,341', 870 '611,616,619,632,345,345,345,345,345,345,345,345,345,345,345,345,345', 871 '345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,634,636', 872 '637,638,640,345,345,345,345,345,345,345,345,641,643,347,260,260,260', 873 '260,260,260,260,348,348,348,348,348,348,348,348,644,348,646,648,651', 874 '348,345,348,348,348,348,348,348,348,349,349,349,349,349,349,349,349', 875 '658,349,662,663,664,349,665,349,349,349,349,349,349,349,350,350,350', 876 '350,350,350,350,350,666,350,668,671,673,350,688,350,350,350,350,350', 877 '350,350,351,351,351,351,351,351,351,351,689,351,693,694,695,351,697', 878 '351,351,351,351,351,351,351,699,700,701,707,352,352,352,352,352,352', 879 '352,352,711,352,718,725,727,352,348,352,352,352,352,352,352,352,353', 880 '353,353,353,353,353,353,353,730,353,731,746,749,353,349,353,353,353', 881 '353,353,353,353,354,354,354,354,354,354,354,354,750,354,755,760,761', 882 '354,350,354,354,354,354,354,354,354,355,355,355,355,355,355,355,355', 883 '763,355,764,766,767,355,351,355,355,355,355,355,355,355,768,769,770', 884 '771,356,356,356,356,356,356,356,356,772,356,773,775,776,356,352,356', 885 '356,356,356,356,356,356,357,357,357,357,357,357,357,357,780,357,781', 886 '793,799,357,353,357,357,357,357,357,357,357,359,359,359,359,359,359', 887 '359,359,810,359,814,815,816,359,354,359,359,359,359,359,359,359,149', 888 '149,149,149,149,149,149,149,817,149,821,149,822,149,355,149,149,149', 889 '149,149,149,149,828,833,836,837,474,474,474,474,474,474,474,474,840', 890 '474,845,846,850,474,356,474,474,474,474,474,474,474,290,290,290,290', 891 '290,290,290,290,,290,,,,290,357,290,290,290,290,290,290,290,848,848', 892 '848,848,848,848,848,848,,848,,,,848,359,848,848,848,848,848,848,848', 893 '806,806,806,806,806,806,806,806,,806,,,,806,149,806,806,806,806,806', 894 '806,806,245,,,,,,245,,,253,245,669,669,669,669,253,,,474,253,669,669', 895 ',,,848,,,,669,669,170,170,170,170,170,170,170,,,290,,,,,848,,,403,403', 896 '403,403,403,403,403,403,,403,,,,403,848,403,403,403,403,403,403,403', 897 '513,513,513,513,513,513,513,513,,513,669,,,513,806,513,513,513,513,513', 898 '513,513,212,212,212,212,212,212,212,212,,212,,,,212,,212,212,212,212', 899 '212,212,212,211,211,211,211,211,211,211,211,,211,,,,211,,211,211,211', 900 '211,211,211,211,,,,464,464,464,464,464,464,464,464,464,464,464,,,,,403', 901 ',,,,,,54,54,54,54,54,54,54,54,54,54,54,,,,,513,464,464,464,464,464,464', 902 '464,,,,478,478,,478,,,,,,,478,212,54,54,54,54,54,54,54,36,36,36,36,36', 903 '36,36,36,36,36,36,36,36,36,211,478,478,478,478,478,478,478,478,478,478', 904 '478,478,478,478,478,478,478,478,478,478,478,478,478,478,478,478,478', 905 '478,582,,582,,,478,478,478,478,478,478,478,478,,,,,,,,,,,,,,,,,,,,,582', 906 '582,582,582,582,582,582,582,582,582,582,582,582,582,582,582,582,582', 907 '582,582,582,582,582,582,582,582,582,582,150,,150,,,582,582,582,582,582', 908 '582,582,582,,,,,,,,,,,,,,,,,,,,,150,150,150,150,150,150,150,150,150', 909 '150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150', 910 '150,150,372,,,,,150,150,150,150,150,150,150,150,,,,,,,,,,,,,,,,,,,372', 911 '372,372,372,372,372,372,372,372,372,372,372,372,372,372,372,372,372', 912 '372,372,372,372,372,372,372,372,372,372,293,,,,,372,372,372,372,372', 913 '372,372,372,372,,,,,,,,,,,,,,,,,,293,293,293,293,293,293,293,293,293', 914 '293,293,293,293,293,293,293,293,293,293,293,293,293,293,293,293,293', 915 '293,293,444,293,,,,293,293,293,293,293,293,293,293,,,,,,,,,,,,,,,,,', 916 ',444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444', 917 '444,444,444,444,444,444,444,444,444,444,444,445,,,,,444,444,444,444', 918 '444,444,444,444,,,,,,,,,,,,,,,,,,,445,445,445,445,445,445,445,445,445', 919 '445,445,445,445,445,445,445,445,445,445,445,445,445,445,445,445,445', 920 '445,445,550,,,,,445,445,445,445,445,445,445,445,,,,,,,,,,,,,,,,,,,550', 921 '550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550', 922 '550,550,550,550,550,550,550,550,550,550,554,550,,,,550,550,550,550,550', 923 '550,550,550,,,,,,,,,,,,,,,,,,,554,554,554,554,554,554,554,554,554,554', 924 '554,554,554,554,554,554,554,554,554,554,554,554,554,554,554,554,554', 925 '554,566,554,,,,554,554,554,554,554,554,554,554,,,,,,,,,,,,,,,,,,,566', 926 '566,566,566,566,566,566,566,566,566,566,566,566,566,566,566,566,566', 927 '566,566,566,566,566,566,566,566,566,566,71,566,,,,566,566,566,566,566', 928 '566,566,566,,,,,,,,,,,,,,,,,,,71,71,71,71,71,71,71,71,71,71,71,71,71', 929 '71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,386,,,,,71,71,71,71,71', 930 '71,71,71,,,,,,,,,,,,,,,,,,,386,386,386,386,386,386,386,386,386,386,386', 931 '386,386,386,386,386,386,386,386,386,386,386,386,386,386,386,386,386', 932 '459,386,,,,386,386,386,386,386,386,386,386,,,,,,,,,,,,,,,,,,,459,459', 933 '459,459,459,459,459,459,459,459,459,459,459,459,459,459,459,459,459', 934 '459,459,459,459,459,459,459,459,459,251,,,,,459,459,459,459,459,459', 935 '459,459,,,,,,,,,,,,,,,,,,,251,251,251,251,251,251,251,251,251,251,251', 936 '251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251', 937 '250,251,,,,251,251,251,251,251,251,251,251,,,,,,,,,,,,,,,,,,,250,250', 938 '250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250', 939 '250,250,250,250,250,250,250,250,250,156,,,,,250,250,250,250,250,250', 940 '250,250,,,,,,,,,,,,,,,,,,,156,156,156,156,156,156,156,156,156,156,156', 941 '156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156', 942 ',,,,,156,156,156,156,156,156,156,156,622,622,622,622,622,622,622,622', 943 '622,622,622,622,622,622,622,622,622,622,622,622,622,622,622,622,622', 944 '622,622,622,,,,,,622,622,622,622,622,622,622,622,40,40,40,40,40,40,40', 945 '40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,,,,,', 946 '40,40,40,40,40,40,40,40,705,705,705,705,705,705,705,705,705,705,705', 947 '705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,705', 948 ',,,,,705,705,705,705,705,705,705,705,244,244,244,244,244,244,244,244', 949 '244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244', 950 '244,244,244,,,,,,244,244,244,244,244,244,244,244,519,519,519,519,519', 951 '519,519,519,519,519,519,519,519,519,519,519,519,519,519,519,519,519', 952 '519,519,519,519,519,519,,,,,,519,519,519,519,519,519,519,519,709,709', 953 '709,709,709,709,709,709,709,709,709,709,709,709,709,709,709,709,709', 954 '709,709,709,709,709,709,709,709,709,,,,,,709,709,709,709,709,709,709', 955 '709,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289', 956 '289,289,289,289,289,289,289,289,289,289,289,289,,,,,,289,289,289,289', 957 '289,289,289,289,239,239,239,239,239,239,239,239,239,239,239,239,239', 958 '239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,,,,,,239', 959 '239,239,239,239,239' ] 960 racc_action_check = arr = ::Array.new(3593, nil) 908 961 idx = 0 909 962 clist.each do |str| … … 915 968 916 969 racc_action_pointer = [ 917 nil, 1429, -1, 489, 1138, nil, nil, nil, 1326, 1278,918 nil, nil, nil, nil, nil, nil, 1288, nil, nil, nil,970 nil, 613, -1, 620, 1492, nil, nil, nil, 612, 627, 971 nil, nil, nil, nil, nil, nil, 680, nil, nil, nil, 919 972 nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 920 nil, nil, nil, nil, nil, nil, 889, nil, 1259, nil, 921 3351, 13, nil, nil, nil, nil, nil, nil, nil, nil, 922 nil, nil, nil, 3134, nil, nil, nil, nil, nil, nil, 923 nil, nil, nil, nil, nil, nil, nil, 1401, 1240, 1239, 924 2552, 1190, 1188, 1168, 79, 1167, 1164, nil, 1095, nil, 925 757, nil, 1023, 122, 574, nil, 1137, 172, nil, nil, 926 76, nil, 974, 971, nil, nil, nil, nil, 1026, 904, 927 340, nil, 850, nil, 832, nil, 802, nil, 688, nil, 928 nil, nil, 670, 486, nil, 644, 618, 602, nil, nil, 929 596, 580, 550, 11, 523, 348, 1803, 1804, nil, 1775, 930 nil, 1774, nil, nil, 1829, 1735, 1827, 1770, nil, 1762, 931 nil, nil, nil, 1669, 1077, 501, 1121, 2314, 1822, 1812, 932 nil, 27, nil, 2611, 453, nil, 1637, 1612, 182, 831, 933 nil, 1601, 1604, 1283, 1598, 1580, 1465, 1622, 537, 280, 934 1578, 1576, 1558, 482, 1562, 1561, 1528, nil, 659, nil, 935 1538, 1541, 269, nil, 154, nil, 1534, 33, nil, -6, 936 nil, 128, nil, 1417, nil, nil, nil, nil, nil, nil, 937 nil, 1510, 1804, nil, nil, 435, 1886, 1911, nil, nil, 938 nil, nil, nil, nil, nil, nil, 777, 657, -19, 613, 939 224, 1462, 1398, 1352, 1349, 132, nil, nil, nil, 709, 940 1379, 1376, nil, nil, 3515, 1397, nil, 1368, nil, 3310, 941 1136, 689, nil, nil, nil, 2670, 2493, nil, 1668, 556, 942 nil, 1416, 687, 430, nil, 1615, nil, 30, nil, 365, 943 851, 1423, 477, nil, 341, nil, 1402, 1429, nil, 1404, 944 nil, 1405, nil, 465, nil, 1414, 1447, 1418, 1448, 1437, 945 1439, 174, nil, 527, 3392, 665, 95, nil, 2729, 289, 946 nil, nil, 678, nil, nil, nil, nil, nil, 73, nil, 947 nil, 1428, 1430, 72, 1431, nil, nil, nil, nil, nil, 948 181, nil, nil, 668, nil, nil, nil, nil, nil, 1432, 949 80, 1395, 1510, nil, 0, nil, nil, nil, 78, 1526, 950 nil, 1526, 1527, nil, 347, 1697, 1523, 1532, nil, 1721, 951 nil, 1651, 1629, 1603, 1581, 1559, 1537, 1511, 1489, 1467, 952 1445, 1419, 1397, 1375, 1353, 1327, 1305, 1261, 1235, 1213, 953 450, nil, 1606, nil, nil, nil, 2434, 1667, nil, 328, 954 nil, nil, nil, nil, 1619, 1620, 1621, 1630, 1632, nil, 955 2788, nil, nil, 228, nil, nil, 0, nil, 1634, 1652, 956 1654, nil, nil, nil, nil, 1649, 1650, 1191, nil, nil, 957 nil, 1665, 1622, 1683, 1696, 1638, 1699, 1702, 1706, nil, 958 1711, nil, nil, 1721, nil, nil, 166, nil, 1150, 1723, 959 1694, nil, 1695, nil, 1666, 1650, 1721, nil, 459, nil, 960 nil, 1753, nil, nil, nil, nil, 1655, 1777, 2847, 2906, 961 1752, 25, nil, nil, 1755, nil, 1783, nil, 1805, nil, 962 nil, nil, nil, 2965, 1709, 1803, 1805, 1813, 2119, 1790, 963 nil, nil, nil, -8, 188, nil, 1099, nil, 356, 183, 964 2253, 1055, 1821, nil, nil, 1825, nil, nil, nil, 524, 965 190, 819, 807, 799, 787, 745, 721, 757, 705, 689, 966 1818, 1803, 1803, 1803, 1801, nil, 2187, 645, nil, nil, 967 nil, nil, 832, 115, 102, 2162, 2139, 2117, nil, nil, 968 525, 3433, 534, 2095, 2070, 2047, nil, 1863, 1865, nil, 969 1864, 1854, 1887, 1889, nil, 1890, 1892, 1869, 270, 252, 970 293, 385, nil, nil, nil, 302, 345, nil, 1573, 653, 971 377, 499, 3024, nil, nil, 308, 3083, nil, nil, 438, 972 74, 536, 288, 282, nil, 94, 548, 3142, nil, 444, 973 nil, 571, nil, 459, 409, nil, 2025, 71, nil, 486, 974 2003, 2375, 623, 1978, nil, 647, nil, 662, nil, nil, 975 1955, nil, nil, nil, nil, 26, 14, 691, 476, 709, 976 nil, 1145, nil, 713, 739, 749, 746, 775, 452, nil, 977 728, nil, -2, nil, nil, 804, nil, nil, 827, nil, 978 nil, 3474, nil, nil, 204, 269, nil, nil, nil, 1933, 979 77, 823, nil, 852, nil, 872, 843, 847, nil, 890, 980 925, 60, 896, 897, nil, 929, nil, 899, nil, nil, 981 814, nil, 484, nil, nil, 475, 901, nil, nil, nil, 982 943, 944, 835, 920, 948, nil, 951, nil, 963, nil, 983 nil, nil, nil, nil, nil, nil, nil, 643, nil, 843, 984 nil, nil, nil, 935, 980, nil, 982, 983, 959, 1007, 985 979, 522, 1005, nil, 1006, 983, 1026, nil, -10, nil, 986 3269, 617, 972, nil, 3228, 595, 1038, nil, nil, 573, 987 nil, 396, nil, 1045, 551, 382, 175, nil, nil, nil, 988 1015, nil, 1042, nil, 12, 939, nil, nil, 1059, nil, 989 459, 1073, nil, 302, nil, nil, nil, 1049, 491, nil, 990 nil, nil, 1050, 1076, nil, 1099, 1100, nil, 1102, 1073, 991 1090, 1118, 1009, 1134, 1108, 1145, nil, 1121, 1148, -11, 992 290, nil, 1152, 1129, 10, nil, nil, 1166, nil, nil, 993 437, 412, nil, 1161, nil, 323, nil, nil, nil, nil, 994 1029, nil, 328, nil, 1163, 1007, 175, nil, 1208, 1210, 995 1098, 1187, nil, nil, 1117, 1207, 985, -9, 1209, nil, 996 nil, nil, nil, 1248, 428, 963, 1249, 1221, 893, 100, 997 1222, 495, nil, -13, nil, 1230, 1258, 871, nil, 1235, 998 75, 1280, 1285, nil, 1256, 24, nil, nil, 849, 1301, 999 1277, 827, 1309, nil, nil, 478, nil, nil, 1295, nil, 1000 nil, 1324, 1327, 1326, nil, 1341, 1281, 1313, 486, 492, 1001 1314, 1323, 1294, nil, nil, nil, nil, nil, 801, nil, 1002 nil, nil, 272, 1354, 11, nil, 1402, 1441, nil, nil, 1003 1633, 735, nil, 1778, 1806, 395, nil, 1169, 555, nil ] 973 nil, nil, nil, nil, nil, nil, 2268, nil, 694, nil, 974 3265, 123, nil, nil, nil, nil, nil, nil, nil, nil, 975 nil, nil, nil, nil, 2185, nil, nil, nil, nil, nil, 976 nil, nil, nil, nil, nil, nil, nil, nil, 702, 712, 977 721, 2888, 717, 719, 729, 115, 738, 742, nil, 704, 978 770, nil, 921, nil, 755, 75, 359, nil, 1610, 174, 979 nil, nil, 89, nil, 730, 742, nil, nil, nil, nil, 980 807, 755, 496, nil, 827, nil, 836, nil, 840, nil, 981 858, nil, nil, nil, 862, 586, nil, 877, 889, 891, 982 nil, nil, 905, 909, 917, 27, 922, 606, 866, 870, 983 nil, 892, nil, 903, nil, nil, 979, 888, 983, 1040, 984 nil, 1044, nil, nil, 1106, nil, 1500, 1268, 484, 2000, 985 2416, 1115, 1107, nil, 26, nil, 3183, 448, nil, 1094, 986 1123, 97, 1591, nil, 1124, 1129, 575, 1127, 1143, 1031, 987 2017, 282, 350, 1146, 1147, 1149, 335, 1163, 1164, 1134, 988 nil, 848, nil, 1163, 1168, 184, nil, 156, nil, 1171, 989 218, nil, -6, nil, -65, 1178, nil, nil, 1081, nil, 990 nil, nil, nil, nil, nil, nil, 1179, 1019, nil, nil, 991 437, 2228, 2206, nil, nil, nil, nil, nil, nil, nil, 992 nil, 880, 687, 729, 989, 767, 1182, 1177, 1178, 1179, 993 132, nil, nil, nil, 553, 1222, 1220, nil, nil, 3511, 994 1225, nil, 1196, nil, 3347, 2107, 1268, nil, nil, nil, 995 3124, 3065, nil, 2116, 612, nil, 1230, 1176, 130, nil, 996 1615, nil, 480, nil, 367, 767, 1244, 76, nil, -1, 997 nil, 1217, 1245, nil, 1227, nil, 1228, nil, 524, nil, 998 1237, 1270, 1241, 1271, 1252, 1261, 197, nil, 1329, 3470, 999 2048, 271, nil, 2534, 291, nil, nil, 778, nil, nil, 1000 nil, nil, nil, 177, nil, nil, 1232, 1233, 198, 1234, 1001 nil, nil, nil, nil, nil, 183, nil, nil, 867, nil, 1002 nil, nil, nil, nil, 1252, 10, 1197, 1313, nil, -2, 1003 nil, nil, nil, 190, 1328, 1274, nil, 1337, 1339, nil, 1004 206, 1588, 1336, 1345, nil, 1658, nil, 1636, 1750, 1772, 1005 1794, 1816, 1842, 1864, 1886, 1908, 1934, 1956, 651, 1978, 1006 695, 720, 787, 673, 1544, 1452, 325, nil, 1350, nil, 1007 nil, nil, 2475, 1495, nil, 692, nil, nil, nil, nil, 1008 1361, 1363, 1364, 1365, 1375, nil, 2947, nil, nil, 936, 1009 nil, nil, 342, nil, 1384, 1386, 1387, nil, nil, nil, 1010 nil, 1382, 1400, 2162, nil, nil, nil, 1402, 1347, 1404, 1011 1426, 1368, 1429, 1430, 1428, nil, 1440, nil, nil, 1442, 1012 nil, nil, -37, nil, 1611, 1443, 1422, nil, 1424, nil, 1013 476, 1355, 1426, nil, 599, nil, nil, 1471, nil, nil, 1014 nil, nil, 1373, 1467, 2593, 2652, 1441, -11, nil, nil, 1015 1444, nil, 601, nil, 1483, nil, nil, nil, nil, 3006, 1016 1385, 1485, 1488, 1501, 2163, 1477, nil, nil, nil, -8, 1017 254, nil, 1509, nil, 2026, nil, 593, 597, 2294, 628, 1018 1516, nil, nil, 1521, nil, nil, nil, 877, 954, 791, 1019 804, 855, 890, 1087, 596, 978, 1063, 815, 1515, 1509, 1020 1509, 1518, 1518, nil, 1427, 709, nil, nil, nil, nil, 1021 958, 81, 261, 2184, 949, 12, nil, nil, 592, 3388, 1022 590, 461, 495, 521, nil, 1544, 1563, nil, 80, 1536, 1023 1568, 1570, nil, 1572, 1588, 1559, 1591, 1562, 1593, 318, 1024 nil, nil, nil, 1572, 1604, nil, 937, 937, 1603, 857, 1025 2711, nil, nil, 310, 2770, nil, nil, 1547, 79, 1613, 1026 13, 355, nil, 92, 900, 1618, 2829, nil, 437, nil, 1027 1620, nil, 1507, 344, nil, 1148, 73, 433, 1597, nil, 1028 541, 1199, 2355, 1627, 1244, nil, 1636, nil, 1635, nil, 1029 nil, 1291, nil, nil, nil, nil, 14, 27, 1639, 430, 1030 1640, nil, 1331, nil, 1658, 1660, 1661, 1657, 1680, 240, 1031 1587, 1626, nil, 0, nil, nil, 1687, nil, nil, 1689, 1032 nil, nil, 3224, nil, nil, 332, 578, nil, nil, nil, 1033 1519, 78, 1660, nil, 1716, nil, 1721, 1689, 1692, nil, 1034 1720, 1733, 75, 1703, 1720, nil, 1753, nil, 1723, nil, 1035 nil, 1638, nil, 521, nil, nil, nil, 577, 1742, nil, 1036 nil, nil, 1769, 1770, 1661, 1747, 1789, nil, 1795, 2125, 1037 nil, 1794, nil, 1798, nil, nil, nil, nil, nil, nil, 1038 nil, nil, 743, nil, 844, nil, nil, nil, 1768, 1811, 1039 nil, 176, 256, 1788, 1819, 1790, 1493, 1817, nil, 1825, 1040 1801, 1829, nil, 74, nil, 3306, 1405, 1772, nil, 3429, 1041 1383, 1837, nil, nil, 1360, nil, 587, nil, 1845, 1313, 1042 384, 76, nil, nil, nil, 1815, nil, 1842, nil, 1221, 1043 1746, 1837, nil, nil, nil, nil, nil, nil, nil, 1611, 1044 nil, nil, 1006, 482, nil, nil, 1867, nil, 1101, 1864, 1045 1788, 447, nil, nil, nil, 1858, 596, nil, nil, nil, 1046 1859, 1885, nil, 1908, 1909, nil, 1911, 1882, 1891, 1918, 1047 1808, 1920, 1902, 1933, nil, 1907, 1934, -9, 284, nil, 1048 1951, 1927, 199, 1485, 576, nil, nil, nil, nil, nil, 1049 nil, nil, nil, 1954, nil, nil, 904, 812, nil, 1930, 1050 nil, 513, nil, nil, nil, nil, 2092, nil, 330, nil, 1051 1947, 835, 240, nil, 1975, 1976, 1864, 1970, nil, nil, 1052 nil, 1884, 1974, 982, 8, nil, nil, 1474, 1982, nil, 1053 nil, nil, nil, 2014, 525, 927, 2015, 1987, 857, 253, 1054 1996, 399, nil, -13, nil, 1997, 2024, nil, 2070, nil, 1055 2000, 205, -5, 30, nil, 52, 25, nil, nil, 1126, 1056 117, 97, 765, 197, nil, nil, 180, nil, nil, 217, 1057 nil, nil, 279, 291, 379, nil, 418, 367, 433, 534, 1058 412, 454, 467, 460, nil, nil, nil, nil, nil, 439, 1059 nil, nil, nil, 11, 533, 100, nil, 539, 512, nil, 1060 nil, 558, 414, nil, 576, 594, 567, nil, 1566, 606, 1061 nil ] 1004 1062 1005 1063 racc_action_default = [ 1006 -19 4, -418, -1, -418, -418, -69, -70, -71, -72, -73,1007 -74, -75, -76, -77, -78, -79, -4 18, -81, -82, -83,1064 -195, -442, -1, -442, -442, -69, -70, -71, -72, -73, 1065 -74, -75, -76, -77, -78, -79, -442, -81, -82, -83, 1008 1066 -84, -85, -86, -87, -88, -89, -90, -91, -92, -93, 1009 -94, -95, -96, -97, -98, -99, -418, -101, -104, -118, 1010 -418, -418, -126, -127, -128, -129, -130, -131, -136, -137, 1011 -192, -193, -195, -418, -197, -198, -199, -200, -201, -202, 1012 -203, -206, -207, -208, -209, -210, -234, -418, -418, -418, 1013 -418, -418, -418, -418, -418, -418, -418, -405, -418, 870, 1014 -418, -65, -67, -418, -139, -140, -418, -146, -205, -204, 1015 -418, -100, -106, -418, -109, -72, -73, -119, -418, -125, 1016 -418, -211, -418, -214, -418, -216, -418, -218, -418, -220, 1017 -221, -222, -418, -418, -386, -418, -418, -418, -394, -395, 1018 -418, -418, -418, -418, -418, -418, -418, -418, -247, -418, 1019 -254, -418, -260, -250, -418, -327, -418, -418, -350, -418, 1020 -398, -410, -62, -418, -418, -138, -418, -418, -418, -147, 1021 -148, -418, -102, -418, -418, -132, -134, -418, -418, -418, 1022 -406, -418, -418, -418, -418, -418, -418, -418, -418, -418, 1023 -418, -418, -418, -418, -418, -418, -418, -337, -418, -244, 1024 -418, -242, -418, -255, -418, -251, -418, -418, -328, -418, 1025 -399, -418, -66, -2, -3, -4, -5, -6, -7, -8, 1026 -9, -10, -418, -12, -14, -18, -418, -418, -22, -23, 1027 -24, -25, -26, -27, -28, -30, -34, -37, -40, -45, 1028 -48, -50, -52, -54, -56, -58, -61, -68, -186, -418, 1029 -418, -418, -143, -63, -418, -418, -145, -150, -152, -418, 1030 -156, -418, -141, -149, -80, -418, -418, -107, -418, -418, 1031 -123, -418, -418, -418, -196, -418, -212, -418, -224, -418, 1032 -418, -418, -418, -228, -418, -291, -418, -418, -387, -418, 1033 -389, -418, -391, -418, -404, -418, -418, -418, -418, -418, 1034 -418, -418, -240, -418, -418, -418, -418, -248, -418, -418, 1035 -261, -263, -418, -265, -266, -267, -268, -269, -418, -288, 1036 -289, -418, -418, -418, -418, -313, -314, -252, -324, -326, 1037 -418, -351, -353, -418, -355, -356, -357, -358, -365, -418, 1038 -418, -418, -418, -381, -418, -407, -408, -409, -418, -418, 1039 -13, -418, -418, -60, -172, -418, -418, -418, -19, -418, 1040 -20, -418, -418, -418, -418, -418, -418, -418, -418, -418, 1041 -418, -418, -418, -418, -418, -418, -418, -418, -418, -418, 1042 -418, -190, -418, -142, -64, -144, -418, -157, -155, -418, 1043 -159, -161, -162, -163, -418, -418, -166, -418, -418, -171, 1044 -418, -105, -108, -418, -120, -122, -418, -112, -114, -418, 1045 -418, -133, -135, -124, -213, -418, -418, -418, -215, -217, 1046 -219, -418, -418, -418, -418, -418, -418, -418, -418, -393, 1047 -418, -397, -235, -418, -237, -238, -418, -245, -418, -418, 1048 -418, -249, -418, -256, -418, -418, -418, -262, -418, -270, 1049 -272, -418, -274, -275, -276, -277, -290, -418, -418, -418, 1050 -250, -418, -315, -329, -418, -352, -418, -359, -418, -361, 1051 -362, -363, -364, -418, -372, -418, -418, -418, -418, -418, 1052 -400, -401, -402, -418, -418, -11, -418, -173, -174, -175, 1053 -418, -418, -418, -16, -17, -418, -31, -32, -33, -35, 1054 -36, -38, -39, -41, -42, -43, -44, -46, -47, -49, 1055 -51, -53, -55, -57, -418, -187, -418, -418, -151, -153, 1056 -154, -158, -418, -418, -418, -418, -418, -418, -103, -110, 1057 -418, -418, -418, -418, -418, -418, -225, -418, -418, -229, 1058 -418, -418, -338, -418, -399, -418, -418, -418, -418, -418, 1059 -418, -418, -243, -246, -253, -418, -418, -259, -418, -418, 1060 -418, -418, -418, -294, -296, -418, -418, -305, -307, -418, 1061 -418, -418, -418, -418, -349, -418, -418, -418, -367, -418, 1062 -373, -418, -382, -418, -418, -385, -418, -418, -29, -176, 1063 -418, -418, -418, -405, -182, -418, -178, -418, -15, -21, 1064 -418, -188, -191, -189, -160, -418, -418, -418, -418, -418, 1065 -121, -418, -113, -418, -418, -418, -418, -418, -418, -232, 1066 -418, -223, -418, -388, -390, -418, -396, -236, -418, -241, 1067 -257, -418, -264, -271, -418, -418, -278, -279, -284, -418, 1068 -418, -418, -295, -418, -298, -418, -418, -418, -306, -418, 1069 -418, -418, -418, -418, -316, -418, -319, -418, -330, -331, 1070 -418, -333, -418, -343, -354, -418, -418, -368, -369, -371, 1071 -418, -418, -418, -418, -418, -180, -418, -184, -418, -177, 1072 -183, -179, -59, -164, -165, -167, -168, -418, -170, -418, 1073 -115, -116, -117, -418, -418, -230, -418, -418, -418, -418, 1074 -418, -418, -418, -273, -418, -418, -418, -292, -418, -293, 1075 -418, -418, -418, -304, -418, -418, -418, -310, -312, -418, 1076 -325, -418, -335, -418, -418, -418, -418, -360, -366, -374, 1077 -418, -383, -418, -403, -418, -418, -181, -185, -418, -111, 1078 -418, -418, -233, -418, -384, -392, -239, -418, -418, -280, 1079 -281, -285, -418, -418, -297, -418, -418, -308, -418, -418, 1080 -418, -418, -418, -418, -418, -418, -348, -418, -418, -418, 1081 -418, -379, -418, -418, -418, -169, -226, -418, -231, -258, 1082 -418, -418, -286, -418, -299, -418, -302, -303, -309, -311, 1083 -418, -332, -418, -334, -418, -418, -418, -341, -418, -418, 1084 -343, -418, -375, -376, -418, -418, -418, -418, -418, -282, 1085 -283, -287, -300, -418, -418, -418, -418, -418, -418, -418, 1086 -418, -418, -370, -418, -380, -418, -418, -418, -301, -418, 1087 -418, -418, -418, -339, -418, -418, -342, -344, -418, -418, 1088 -418, -418, -418, -227, -317, -418, -320, -322, -418, -336, 1089 -340, -418, -418, -418, -378, -418, -418, -418, -418, -418, 1090 -418, -418, -418, -417, -318, -321, -323, -346, -418, -345, 1091 -377, -413, -418, -418, -418, -415, -418, -418, -411, -412, 1092 -418, -418, -347, -418, -418, -418, -416, -418, -418, -414 ] 1067 -94, -95, -96, -97, -98, -99, -442, -101, -104, -118, 1068 -442, -442, -126, -127, -128, -129, -130, -131, -136, -137, 1069 -192, -193, -194, -196, -442, -198, -199, -200, -201, -202, 1070 -203, -204, -207, -208, -209, -210, -211, -235, -442, -442, 1071 -442, -442, -442, -442, -442, -442, -442, -442, -408, -442, 1072 -442, 911, -442, -65, -67, -442, -139, -140, -442, -146, 1073 -206, -205, -442, -100, -106, -442, -109, -72, -73, -119, 1074 -442, -125, -442, -212, -442, -215, -442, -217, -442, -219, 1075 -442, -221, -222, -223, -442, -442, -389, -442, -442, -442, 1076 -397, -398, -442, -442, -442, -442, -442, -442, -442, -442, 1077 -248, -442, -255, -442, -261, -251, -442, -328, -442, -442, 1078 -351, -442, -401, -413, -442, -62, -442, -442, -138, -442, 1079 -442, -442, -147, -148, -442, -102, -442, -442, -132, -134, 1080 -442, -442, -442, -409, -442, -442, -442, -442, -442, -442, 1081 -442, -442, -442, -442, -442, -442, -442, -442, -442, -442, 1082 -338, -442, -245, -442, -243, -442, -256, -442, -252, -442, 1083 -442, -329, -442, -402, -442, -442, -435, -66, -2, -3, 1084 -4, -5, -6, -7, -8, -9, -10, -442, -12, -14, 1085 -18, -442, -442, -22, -23, -24, -25, -26, -27, -28, 1086 -30, -34, -37, -40, -45, -48, -50, -52, -54, -56, 1087 -58, -61, -68, -186, -442, -442, -442, -143, -63, -442, 1088 -442, -145, -150, -152, -442, -156, -442, -141, -149, -80, 1089 -442, -442, -107, -442, -442, -123, -442, -442, -442, -197, 1090 -442, -213, -442, -225, -442, -442, -442, -442, -229, -442, 1091 -292, -442, -442, -390, -442, -392, -442, -394, -442, -407, 1092 -442, -442, -442, -442, -442, -442, -442, -241, -442, -442, 1093 -442, -442, -249, -442, -442, -262, -264, -442, -266, -267, 1094 -268, -269, -270, -442, -289, -290, -442, -442, -442, -442, 1095 -314, -315, -253, -325, -327, -442, -352, -354, -442, -356, 1096 -357, -358, -359, -367, -442, -442, -442, -442, -384, -442, 1097 -410, -411, -412, -442, -442, -442, -13, -442, -442, -60, 1098 -172, -442, -442, -442, -19, -442, -20, -442, -442, -442, 1099 -442, -442, -442, -442, -442, -442, -442, -442, -442, -442, 1100 -442, -442, -442, -442, -442, -442, -442, -190, -442, -142, 1101 -64, -144, -442, -157, -155, -442, -159, -161, -162, -163, 1102 -442, -442, -166, -442, -442, -171, -442, -105, -108, -442, 1103 -120, -122, -442, -112, -114, -442, -442, -133, -135, -124, 1104 -214, -442, -442, -442, -216, -218, -220, -442, -442, -442, 1105 -442, -442, -442, -442, -442, -396, -442, -400, -236, -442, 1106 -238, -239, -442, -246, -442, -442, -442, -250, -442, -257, 1107 -442, -442, -442, -263, -442, -271, -273, -442, -275, -276, 1108 -277, -278, -291, -442, -442, -442, -251, -442, -316, -330, 1109 -442, -353, -442, -360, -442, -363, -364, -365, -366, -442, 1110 -374, -442, -442, -442, -442, -442, -403, -404, -405, -442, 1111 -442, -421, -442, -11, -442, -173, -174, -175, -442, -442, 1112 -442, -16, -17, -442, -31, -32, -33, -35, -36, -38, 1113 -39, -41, -42, -43, -44, -46, -47, -49, -51, -53, 1114 -55, -57, -442, -187, -442, -442, -151, -153, -154, -158, 1115 -442, -442, -442, -442, -442, -442, -103, -110, -442, -442, 1116 -442, -442, -442, -442, -226, -442, -442, -230, -442, -442, 1117 -339, -442, -402, -442, -442, -442, -442, -442, -442, -442, 1118 -244, -247, -254, -442, -442, -260, -442, -442, -442, -442, 1119 -442, -295, -297, -442, -442, -306, -308, -442, -442, -442, 1120 -442, -442, -350, -442, -442, -442, -442, -369, -442, -375, 1121 -442, -385, -442, -442, -388, -442, -442, -442, -442, -29, 1122 -176, -442, -442, -442, -408, -182, -442, -178, -442, -15, 1123 -21, -442, -188, -191, -189, -160, -442, -442, -442, -442, 1124 -442, -121, -442, -113, -442, -442, -442, -442, -442, -442, 1125 -233, -442, -224, -442, -391, -393, -442, -399, -237, -442, 1126 -242, -258, -442, -265, -272, -442, -442, -279, -280, -285, 1127 -442, -442, -442, -296, -442, -299, -442, -442, -442, -307, 1128 -442, -442, -442, -442, -442, -317, -442, -320, -442, -331, 1129 -332, -442, -334, -442, -344, -355, -361, -442, -442, -370, 1130 -371, -373, -442, -442, -442, -442, -442, -422, -442, -442, 1131 -180, -442, -184, -442, -177, -183, -179, -59, -164, -165, 1132 -167, -168, -442, -170, -442, -115, -116, -117, -442, -442, 1133 -231, -442, -442, -442, -442, -442, -442, -442, -274, -442, 1134 -442, -442, -293, -442, -294, -442, -442, -442, -305, -442, 1135 -442, -442, -311, -313, -442, -326, -442, -336, -442, -442, 1136 -442, -442, -362, -368, -376, -442, -386, -442, -406, -442, 1137 -442, -442, -423, -425, -426, -427, -428, -429, -430, -442, 1138 -436, -437, -442, -442, -181, -185, -442, -111, -442, -442, 1139 -234, -442, -387, -395, -240, -442, -442, -281, -282, -286, 1140 -442, -442, -298, -442, -442, -309, -442, -442, -442, -442, 1141 -442, -442, -442, -442, -349, -442, -442, -442, -442, -382, 1142 -442, -442, -442, -442, -442, -432, -433, -438, -439, -440, 1143 -441, -169, -227, -442, -232, -259, -442, -442, -287, -442, 1144 -300, -442, -303, -304, -310, -312, -442, -333, -442, -335, 1145 -442, -442, -442, -342, -442, -442, -344, -442, -377, -378, 1146 -379, -442, -442, -442, -442, -424, -431, -442, -442, -283, 1147 -284, -288, -301, -442, -442, -442, -442, -442, -442, -442, 1148 -442, -442, -372, -442, -383, -442, -442, -434, -442, -302, 1149 -442, -442, -442, -442, -340, -442, -442, -343, -345, -442, 1150 -442, -442, -442, -442, -228, -318, -442, -321, -323, -442, 1151 -337, -341, -442, -442, -442, -381, -442, -442, -442, -442, 1152 -442, -442, -442, -442, -420, -319, -322, -324, -347, -442, 1153 -346, -380, -416, -442, -442, -442, -418, -442, -442, -414, 1154 -415, -442, -442, -348, -442, -442, -442, -419, -442, -442, 1155 -417 ] 1093 1156 1094 1157 racc_goto_table = [ 1095 53, 135, 82, 227, 260, 176, 149, 333, 231, 233, 1096 158, 258, 100, 150, 97, 318, 235, 151, 563, 383, 1097 462, 178, 50, 166, 324, 261, 523, 461, 525, 526, 1098 387, 370, 9, 8, 338, 429, 263, 638, 561, 81, 1099 139, 598, 311, 382, 125, 467, 266, 332, 547, 269, 1100 271, 702, 290, 246, 154, 543, 745, 615, 766, 642, 1101 710, 483, 484, 485, 486, 137, 234, 487, 488, 310, 1102 558, 544, 548, 645, 644, 243, 479, 480, 481, 482, 1103 446, 447, 557, 455, 148, 559, 544, 750, 361, 709, 1104 333, 783, 268, 273, 191, 326, 364, 327, 854, 859, 1105 1, 233, 852, 2, 340, 489, 490, 491, 492, 493, 1106 80, 367, 91, 253, 392, 808, 92, 245, 93, 386, 1107 590, 391, 419, 179, 145, 499, 369, 248, 569, 360, 1108 51, 254, 256, 257, 262, 541, 318, 180, 127, 286, 1109 333, 82, 129, 288, 333, 380, 423, 811, 131, 289, 1110 612, 249, 608, 773, 428, 628, 255, 427, 234, 622, 1111 784, 729, 785, 445, 333, 437, 686, 542, 623, 476, 1112 477, 478, 472, 765, 647, 544, 334, 382, 192, 548, 1113 53, 572, 292, 546, 475, 629, 552, 313, 9, 8, 1114 544, 634, 635, 825, 136, 187, 494, 553, 723, 443, 1115 639, 701, 287, 771, 497, nil, nil, nil, 416, nil, 1116 nil, nil, 9, 8, nil, nil, nil, nil, nil, 248, 1117 248, nil, nil, nil, nil, 436, nil, 679, 233, nil, 1118 441, 405, nil, 712, 782, nil, nil, nil, 368, nil, 1119 nil, nil, nil, 249, 249, 516, 522, 454, 522, 522, 1120 nil, nil, nil, nil, nil, 463, nil, nil, 418, 518, 1121 468, nil, 424, nil, nil, nil, nil, nil, nil, nil, 1122 nil, nil, nil, 519, nil, nil, nil, nil, nil, 501, 1123 nil, 417, 613, nil, 53, 234, 425, 292, nil, 527, 1124 nil, nil, 584, 592, 568, nil, 511, nil, 462, nil, 1125 nil, nil, nil, nil, nil, 461, 421, nil, 313, nil, 1126 333, 333, 333, 334, 531, nil, 9, 8, 333, 333, 1127 333, nil, 458, 734, nil, nil, nil, 737, nil, nil, 1128 nil, nil, 233, 577, nil, nil, nil, nil, 538, 575, 1129 nil, nil, 587, 588, 589, nil, nil, nil, 713, nil, 1130 593, 594, 595, nil, 248, 582, 555, nil, 602, nil, 1131 nil, nil, 669, nil, 820, 500, nil, nil, nil, nil, 1132 nil, nil, 522, nil, nil, nil, nil, nil, 249, nil, 1133 nil, 318, nil, nil, nil, 662, nil, nil, nil, 234, 1134 nil, 567, nil, nil, 841, nil, 468, nil, nil, nil, 1158 54, 137, 232, 84, 236, 265, 263, 161, 179, 195, 1159 339, 152, 240, 572, 238, 102, 153, 99, 154, 323, 1160 169, 266, 389, 329, 531, 468, 533, 534, 467, 393, 1161 9, 181, 425, 435, 50, 376, 453, 344, 268, 570, 1162 8, 552, 556, 649, 650, 609, 141, 732, 127, 83, 1163 271, 388, 251, 274, 276, 338, 552, 475, 316, 717, 1164 773, 725, 295, 555, 157, 551, 802, 626, 491, 492, 1165 493, 494, 239, 487, 488, 495, 496, 489, 490, 248, 1166 567, 452, 566, 480, 657, 461, 568, 151, 778, 367, 1167 724, 819, 273, 339, 278, 194, 331, 332, 895, 900, 1168 893, 471, 577, 370, 1, 784, 2, 502, 238, 346, 1169 497, 498, 398, 499, 500, 501, 82, 786, 373, 93, 1170 94, 250, 95, 392, 258, 601, 182, 397, 148, 507, 1171 375, 580, 366, 253, 51, 849, 52, 259, 261, 262, 1172 267, 549, 323, 183, 339, 84, 386, 552, 339, 129, 1173 291, 556, 619, 131, 254, 293, 429, 133, 294, 260, 1174 623, 825, 434, 552, 757, 443, 239, 701, 339, 433, 1175 550, 633, 639, 484, 485, 486, 852, 821, 809, 822, 1176 634, 451, 801, 54, 340, 297, 388, 659, 554, 9, 1177 318, 197, 640, 483, 560, 583, 645, 646, 866, 8, 1178 138, 190, 561, 449, 716, 847, 807, 808, 505, 751, 1179 139, 315, 422, 9, 655, nil, nil, 292, nil, nil, 1180 nil, nil, nil, 8, nil, nil, nil, 253, 253, 442, 1181 694, nil, nil, nil, 447, nil, 238, nil, nil, nil, 1182 727, 411, nil, 524, 374, nil, nil, nil, 254, 254, 1183 530, 460, 530, 530, nil, 598, 599, 600, 526, 469, 1184 818, 820, nil, 604, 605, 606, 424, 476, nil, nil, 1185 430, nil, nil, nil, nil, nil, nil, nil, 527, nil, 1186 509, nil, 656, 624, nil, nil, nil, 423, nil, 54, 1187 nil, 431, 297, nil, 239, 603, 535, 519, nil, 595, 1188 579, nil, 762, nil, nil, nil, 765, nil, nil, 468, 1189 nil, nil, 467, 318, nil, nil, 339, 339, 339, 9, 1190 nil, nil, 340, 427, 339, 339, 339, 464, 539, 8, 1191 nil, nil, nil, nil, 588, nil, nil, 578, nil, 546, 1192 586, nil, 238, nil, nil, nil, nil, nil, nil, nil, 1193 nil, nil, nil, nil, nil, nil, nil, 563, nil, 593, 1194 728, nil, 613, 253, nil, nil, nil, nil, nil, nil, 1195 nil, 684, 508, nil, nil, nil, nil, nil, 530, nil, 1196 nil, nil, nil, nil, 254, nil, nil, nil, nil, nil, 1197 323, nil, nil, 861, 677, nil, 576, nil, nil, nil, 1198 239, nil, nil, nil, nil, 476, nil, nil, nil, nil, 1135 1199 nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 1136 nil, nil, nil, nil, nil, nil, 179, 564, 812, nil, 1137 nil, nil, 535, nil, nil, nil, nil, nil, 653, nil, 1138 585, 586, 656, 233, nil, 577, 545, 549, nil, nil, 1139 658, nil, nil, nil, nil, nil, 611, 522, nil, nil, 1140 nil, 545, nil, nil, nil, nil, nil, nil, nil, nil, 1200 nil, nil, nil, 182, 882, 573, nil, nil, nil, 543, 1201 665, nil, nil, nil, nil, nil, 671, 596, 597, 588, 1202 nil, nil, 553, 557, 673, nil, 238, nil, 763, 622, 1203 853, nil, 766, nil, 610, nil, 530, 553, nil, nil, 1141 1204 nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 1142 nil, nil, nil, nil, 652, nil, nil, 631, nil, nil, 1143 nil, 687, nil, nil, nil, 591, nil, nil, nil, nil, 1144 234, nil, nil, nil, nil, nil, 333, nil, nil, nil, 1145 333, nil, nil, nil, nil, nil, nil, nil, nil, nil, 1205 nil, nil, nil, nil, nil, nil, nil, nil, 664, nil, 1206 nil, nil, nil, nil, 642, 702, nil, nil, nil, nil, 1207 nil, nil, nil, nil, nil, nil, 602, nil, nil, nil, 1208 nil, nil, nil, nil, 239, nil, nil, nil, nil, 339, 1209 nil, nil, nil, 339, nil, nil, nil, nil, nil, nil, 1146 1210 nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 1147 nil, nil, nil, nil, nil, nil, nil, nil, 735, 718, 1148 nil, nil, 738, 690, 730, nil, nil, nil, nil, 694, 1149 545, nil, nil, nil, 549, nil, nil, 688, nil, nil, 1150 nil, 640, nil, nil, nil, 545, nil, nil, nil, nil, 1151 nil, 740, nil, nil, 747, nil, 746, nil, nil, nil, 1152 nil, nil, nil, nil, nil, nil, 753, nil, nil, 756, 1153 333, nil, nil, nil, nil, 681, nil, nil, nil, nil, 1211 nil, nil, nil, 731, nil, nil, nil, 746, nil, 705, 1212 nil, 758, nil, nil, nil, 709, nil, nil, 553, nil, 1213 nil, nil, 557, 837, nil, nil, nil, 703, nil, 651, 1214 nil, nil, nil, nil, 553, nil, nil, nil, nil, 768, 1215 nil, nil, nil, nil, 774, 775, nil, nil, nil, nil, 1216 855, nil, nil, nil, 781, nil, nil, nil, nil, nil, 1217 nil, nil, nil, nil, nil, nil, nil, nil, nil, 696, 1218 nil, 873, nil, 792, nil, nil, nil, nil, nil, nil, 1219 nil, 464, nil, nil, 339, nil, nil, 750, 610, nil, 1220 nil, 769, nil, nil, nil, nil, nil, nil, nil, nil, 1221 nil, 894, nil, nil, nil, nil, nil, nil, nil, nil, 1222 nil, 339, nil, nil, nil, nil, nil, 777, nil, nil, 1223 nil, 829, 830, 810, nil, nil, nil, nil, nil, nil, 1224 nil, 834, 339, nil, nil, nil, nil, nil, nil, nil, 1225 nil, nil, nil, nil, nil, nil, 530, nil, 845, nil, 1154 1226 nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 1155 458, nil, nil, 333, nil, nil, nil, nil, nil, nil, 1156 nil, 741, 797, nil, nil, nil, nil, nil, nil, 789, 1157 790, nil, nil, 333, 774, nil, nil, nil, nil, nil, 1158 nil, nil, 794, 749, nil, 814, nil, nil, 522, nil, 1159 nil, nil, nil, nil, nil, nil, nil, nil, 805, nil, 1160 nil, nil, nil, 333, nil, 832, nil, 746, nil, nil, 1161 nil, nil, nil, nil, nil, nil, 823, nil, nil, nil, 1162 nil, nil, nil, nil, nil, nil, nil, nil, nil, 727, 1163 nil, 787, nil, 835, nil, 853, nil, nil, nil, nil, 1227 774, nil, 339, nil, nil, 755, nil, nil, nil, nil, 1228 nil, nil, nil, 864, nil, nil, nil, nil, 824, nil, 1229 nil, nil, nil, nil, nil, nil, nil, 876, nil, nil, 1164 1230 nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 1165 1231 nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 1166 1232 nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 1167 nil, nil, nil, 864, nil, nil, 815, nil, nil, 868, 1233 nil, nil, nil, nil, nil, nil, nil, 905, nil, nil, 1234 nil, nil, nil, 909, nil, 856, nil, nil, nil, nil, 1235 nil, nil, nil, nil, nil, nil, 651 ] 1236 1237 racc_goto_check = [ 1238 45, 4, 32, 31, 23, 5, 85, 47, 83, 167, 1239 22, 29, 55, 153, 28, 68, 53, 25, 4, 101, 1240 47, 23, 44, 157, 84, 74, 84, 84, 76, 48, 1241 34, 89, 6, 106, 64, 60, 145, 10, 86, 154, 1242 33, 24, 24, 129, 130, 88, 156, 170, 25, 30, 1243 83, 43, 40, 83, 83, 11, 24, 61, 138, 133, 1244 135, 152, 98, 118, 51, 113, 116, 107, 14, 14, 1245 14, 14, 29, 12, 12, 15, 15, 13, 13, 53, 1246 113, 140, 146, 6, 107, 147, 148, 31, 149, 32, 1247 150, 151, 158, 22, 159, 161, 162, 163, 164, 165, 1248 166, 168, 169, 28, 1, 173, 2, 6, 28, 8, 1249 16, 17, 23, 18, 19, 20, 26, 170, 27, 37, 1250 39, 41, 42, 46, 51, 49, 31, 52, 54, 57, 1251 59, 62, 63, 25, 65, 116, 66, 67, 80, 81, 1252 82, 87, 101, 90, 22, 31, 40, 24, 22, 91, 1253 92, 24, 84, 93, 45, 94, 95, 96, 97, 45, 1254 99, 170, 100, 24, 108, 110, 29, 111, 22, 98, 1255 112, 113, 118, 10, 10, 10, 135, 152, 133, 152, 1256 114, 138, 115, 45, 25, 45, 43, 113, 117, 34, 1257 45, 30, 119, 11, 121, 61, 122, 123, 124, 33, 1258 125, 126, 127, 128, 131, 170, 132, 134, 5, 88, 1259 136, 137, 4, 34, 139, nil, nil, 64, nil, nil, 1260 nil, nil, nil, 33, nil, nil, nil, 25, 25, 4, 1261 84, nil, nil, nil, 4, nil, 28, nil, nil, nil, 1262 154, 156, nil, 85, 31, nil, nil, nil, 45, 45, 1263 5, 4, 5, 5, nil, 6, 6, 6, 23, 4, 1264 129, 130, nil, 6, 6, 6, 25, 53, nil, nil, 1265 25, nil, nil, nil, nil, nil, nil, nil, 86, nil, 1266 47, nil, 145, 106, nil, nil, nil, 31, nil, 45, 1267 nil, 45, 45, nil, 29, 48, 83, 47, nil, 60, 1268 10, nil, 24, nil, nil, nil, 24, nil, nil, 74, 1269 nil, nil, 76, 45, nil, nil, 22, 22, 22, 34, 1270 nil, nil, 25, 64, 22, 22, 22, 45, 89, 33, 1271 nil, nil, nil, nil, 23, nil, nil, 167, nil, 47, 1272 55, nil, 28, nil, nil, nil, nil, nil, nil, nil, 1273 nil, nil, nil, nil, nil, nil, nil, 47, nil, 32, 1274 74, nil, 157, 25, nil, nil, nil, nil, nil, nil, 1275 nil, 44, 31, nil, nil, nil, nil, nil, 5, nil, 1276 nil, nil, nil, nil, 45, nil, nil, nil, nil, nil, 1277 101, nil, nil, 153, 22, nil, 4, nil, nil, nil, 1278 29, nil, nil, nil, nil, 53, nil, nil, nil, nil, 1168 1279 nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 1169 nil, nil, nil, nil, nil, nil, nil, nil, 640 ] 1170 1171 racc_goto_check = [ 1172 45, 4, 31, 32, 5, 82, 29, 22, 23, 28, 1173 47, 84, 67, 53, 25, 100, 55, 4, 152, 44, 1174 73, 88, 64, 47, 156, 23, 83, 75, 83, 83, 1175 48, 60, 34, 33, 10, 105, 85, 128, 153, 30, 1176 155, 87, 137, 43, 25, 61, 82, 11, 117, 82, 1177 82, 132, 97, 40, 51, 112, 134, 106, 115, 133, 1178 151, 14, 14, 14, 14, 135, 29, 15, 15, 136, 1179 112, 24, 24, 106, 138, 53, 12, 12, 13, 13, 1180 139, 144, 145, 146, 31, 147, 24, 148, 32, 149, 1181 22, 150, 157, 158, 160, 161, 28, 162, 163, 164, 1182 1, 28, 165, 2, 8, 16, 17, 18, 19, 20, 1183 26, 27, 37, 51, 23, 115, 39, 41, 42, 46, 1184 49, 52, 6, 31, 54, 57, 59, 25, 62, 63, 1185 65, 66, 79, 80, 81, 86, 100, 89, 90, 91, 1186 22, 31, 92, 93, 22, 40, 94, 134, 95, 96, 1187 98, 45, 83, 132, 99, 117, 45, 97, 29, 112, 1188 151, 107, 151, 137, 22, 109, 110, 111, 113, 10, 1189 10, 10, 6, 114, 112, 24, 25, 43, 30, 24, 1190 45, 61, 45, 116, 11, 118, 120, 45, 34, 33, 1191 24, 121, 122, 123, 124, 125, 6, 126, 87, 127, 1192 129, 130, 64, 131, 5, nil, nil, nil, 4, nil, 1193 nil, nil, 34, 33, nil, nil, nil, nil, nil, 25, 1194 25, nil, nil, nil, nil, 4, nil, 83, 28, nil, 1195 4, 155, nil, 153, 128, nil, nil, nil, 31, nil, 1196 nil, nil, nil, 45, 45, 84, 5, 4, 5, 5, 1197 nil, nil, nil, nil, nil, 4, nil, nil, 25, 23, 1198 53, nil, 25, nil, nil, nil, nil, nil, nil, nil, 1199 nil, nil, nil, 85, nil, nil, nil, nil, nil, 47, 1200 nil, 31, 105, nil, 45, 29, 45, 45, nil, 82, 1201 nil, nil, 60, 48, 10, nil, 47, nil, 73, nil, 1202 nil, nil, nil, nil, nil, 75, 64, nil, 45, nil, 1203 22, 22, 22, 25, 88, nil, 34, 33, 22, 22, 1204 22, nil, 45, 24, nil, nil, nil, 24, nil, nil, 1205 nil, nil, 28, 23, nil, nil, nil, nil, 47, 55, 1206 nil, nil, 6, 6, 6, nil, nil, nil, 73, nil, 1207 6, 6, 6, nil, 25, 32, 47, nil, 156, nil, 1208 nil, nil, 44, nil, 152, 31, nil, nil, nil, nil, 1209 nil, nil, 5, nil, nil, nil, nil, nil, 45, nil, 1210 nil, 100, nil, nil, nil, 22, nil, nil, nil, 29, 1211 nil, 4, nil, nil, 152, nil, 53, nil, nil, nil, 1280 nil, nil, nil, 31, 153, 68, nil, nil, nil, 31, 1281 23, nil, nil, nil, nil, nil, 23, 4, 4, 23, 1282 nil, nil, 45, 45, 55, nil, 28, nil, 6, 47, 1283 84, nil, 6, nil, 4, nil, 5, 45, nil, nil, 1212 1284 nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 1213 nil, nil, nil, nil, nil, nil, 31, 67, 83, nil,1214 nil, nil, 31, nil, nil, nil, nil, nil, 23, nil,1215 4, 4, 23, 28, nil, 23, 45, 45, nil, nil,1216 55, nil, nil, nil, nil, nil, 47, 5, nil, nil,1217 nil, 45, nil, nil, nil, nil, nil, nil, nil, nil,1285 nil, nil, nil, nil, nil, nil, nil, nil, 47, nil, 1286 nil, nil, nil, nil, 4, 23, nil, nil, nil, nil, 1287 nil, nil, nil, nil, nil, nil, 25, nil, nil, nil, 1288 nil, nil, nil, nil, 29, nil, nil, nil, nil, 22, 1289 nil, nil, nil, 22, nil, nil, nil, nil, nil, nil, 1218 1290 nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 1219 nil, nil, nil, nil, 47, nil, nil, 4, nil, nil, 1220 nil, 23, nil, nil, nil, 25, nil, nil, nil, nil, 1221 29, nil, nil, nil, nil, nil, 22, nil, nil, nil, 1222 22, nil, nil, nil, nil, nil, nil, nil, nil, nil, 1291 nil, nil, nil, 167, nil, nil, nil, 23, nil, 47, 1292 nil, 85, nil, nil, nil, 47, nil, nil, 45, nil, 1293 nil, nil, 45, 6, nil, nil, nil, 4, nil, 45, 1294 nil, nil, nil, nil, 45, nil, nil, nil, nil, 23, 1295 nil, nil, nil, nil, 23, 32, nil, nil, nil, nil, 1296 6, nil, nil, nil, 23, nil, nil, nil, nil, nil, 1297 nil, nil, nil, nil, nil, nil, nil, nil, nil, 25, 1298 nil, 6, nil, 32, nil, nil, nil, nil, nil, nil, 1299 nil, 45, nil, nil, 22, nil, nil, 4, 4, nil, 1300 nil, 47, nil, nil, nil, nil, nil, nil, nil, nil, 1301 nil, 6, nil, nil, nil, nil, nil, nil, nil, nil, 1302 nil, 22, nil, nil, nil, nil, nil, 4, nil, nil, 1303 nil, 32, 32, 83, nil, nil, nil, nil, nil, nil, 1304 nil, 23, 22, nil, nil, nil, nil, nil, nil, nil, 1305 nil, nil, nil, nil, nil, nil, 5, nil, 23, nil, 1223 1306 nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 1224 nil, nil, nil, nil, nil, nil, nil, nil, 6, 23, 1225 nil, nil, 6, 47, 84, nil, nil, nil, nil, 47, 1226 45, nil, nil, nil, 45, nil, nil, 4, nil, nil, 1227 nil, 45, nil, nil, nil, 45, nil, nil, nil, nil, 1228 nil, 23, nil, nil, 32, nil, 23, nil, nil, nil, 1229 nil, nil, nil, nil, nil, nil, 23, nil, nil, 32, 1230 22, nil, nil, nil, nil, 25, nil, nil, nil, nil, 1231 nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 1232 45, nil, nil, 22, nil, nil, nil, nil, nil, nil, 1233 nil, 47, 6, nil, nil, nil, nil, nil, nil, 32, 1234 32, nil, nil, 22, 82, nil, nil, nil, nil, nil, 1235 nil, nil, 23, 4, nil, 6, nil, nil, 5, nil, 1236 nil, nil, nil, nil, nil, nil, nil, nil, 23, nil, 1237 nil, nil, nil, 22, nil, 6, nil, 23, nil, nil, 1238 nil, nil, nil, nil, nil, nil, 32, nil, nil, nil, 1239 nil, nil, nil, nil, nil, nil, nil, nil, nil, 31, 1240 nil, 4, nil, 23, nil, 6, nil, nil, nil, nil, 1307 23, nil, 22, nil, nil, 31, nil, nil, nil, nil, 1308 nil, nil, nil, 32, nil, nil, nil, nil, 4, nil, 1309 nil, nil, nil, nil, nil, nil, nil, 23, nil, nil, 1241 1310 nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 1242 1311 nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 1243 1312 nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 1244 nil, nil, nil, 23, nil, nil, 4, nil, nil, 23, 1313 nil, nil, nil, nil, nil, nil, nil, 23, nil, nil, 1314 nil, nil, nil, 23, nil, 4, nil, nil, nil, nil, 1315 nil, nil, nil, nil, nil, nil, 45 ] 1316 1317 racc_goto_pointer = [ 1318 nil, 104, 106, nil, -74, -160, -258, nil, -103, nil, 1319 -174, -152, -277, -275, -286, -283, -250, -250, -249, -249, 1320 -249, nil, -197, -145, -403, -23, 112, -126, -136, -78, 1321 45, -1, -145, 38, 28, nil, nil, 83, nil, 82, 1322 -104, -34, 84, -200, -231, -2, -131, -95, -225, -393, 1323 nil, -36, -129, -73, 43, -138, nil, -243, nil, -116, 1324 -211, -283, -345, -102, 32, 132, 134, -24, -39, nil, 1325 nil, nil, nil, nil, -304, nil, -301, nil, nil, nil, 1326 -24, -25, -27, -118, -386, -158, -129, -302, -483, -96, 1327 15, 77, -35, 80, -31, -137, 83, -29, -125, -386, 1328 -135, -173, nil, nil, nil, nil, -264, -481, -535, nil, 1329 -138, -463, -274, -379, -373, -582, -698, -257, -382, -365, 1330 nil, -254, -364, -363, -653, 125, 63, -247, -110, -518, 1331 -517, -447, -563, -592, -562, -659, 134, 19, -134, -349, 1332 -237, nil, nil, nil, nil, -282, -377, -240, -375, -636, 1333 -570, -687, -601, -450, -423, nil, -31, -170, -78, -79, 1334 nil, -48, -98, -97, -794, -796, -784, -135, -234, -370, 1335 -622, nil, nil, -634 ] 1336 1337 racc_goto_default = [ 1338 nil, nil, nil, 209, 198, 206, 337, 210, 219, 211, 1339 220, nil, 221, 222, 223, 224, 225, 226, 227, 228, 1340 229, 230, 231, 233, 67, 4, nil, 245, 39, 40, 1341 nil, 391, nil, 97, 98, 11, 12, 37, 36, nil, 1342 nil, nil, nil, 252, nil, 246, nil, nil, nil, 390, 1343 41, nil, 158, 85, 86, nil, 242, 243, 244, nil, 1344 nil, nil, 477, nil, nil, nil, nil, 53, nil, 55, 1345 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 1346 103, nil, nil, nil, nil, 628, nil, 269, nil, nil, 1347 nil, nil, nil, nil, nil, nil, nil, nil, nil, 296, 1348 nil, 298, 299, 300, 301, 302, nil, nil, 627, 303, 1245 1349 nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 1246 nil, nil, nil, nil, nil, nil, nil, nil, 45 ] 1247 1248 racc_goto_pointer = [ 1249 nil, 100, 103, nil, -73, -158, -163, nil, -103, nil, 1250 -172, -155, -268, -268, -287, -285, -249, -249, -249, -249, 1251 -249, nil, -195, -138, -367, -26, 106, -128, -138, -81, 1252 35, -2, -141, 31, 30, nil, nil, 76, nil, 78, 1253 -100, -35, 80, -203, -229, -2, -130, -90, -219, -390, 1254 nil, -44, -130, -74, 41, -131, nil, -241, nil, -115, 1255 -210, -289, -340, -100, 20, 128, -27, -41, nil, nil, 1256 nil, nil, nil, -304, nil, -297, nil, nil, nil, -27, 1257 -28, -30, -119, -378, -150, -128, -302, -479, -104, 11, 1258 67, -43, 70, -40, -142, 75, -35, -132, -388, -138, 1259 -174, nil, nil, nil, nil, -257, -483, -523, nil, -133, 1260 -453, -271, -383, -377, -563, -678, -256, -391, -364, nil, 1261 -256, -361, -360, -617, 120, 59, -246, -109, -516, -353, 1262 -439, -538, -589, -494, -648, -10, -120, -147, -481, -233, 1263 nil, nil, nil, nil, -232, -371, -237, -370, -622, -559, 1264 -659, -590, -439, -418, nil, -36, -166, -75, -77, nil, 1265 -47, -96, -94, -753, -755, -741 ] 1266 1267 racc_goto_default = [ 1268 nil, nil, nil, 204, 193, 201, 331, 205, 214, 206, 1269 215, nil, 216, 217, 218, 219, 220, 221, 222, 223, 1270 224, 225, 226, 228, 66, 4, nil, 240, 39, 40, 1271 nil, 385, nil, 95, 96, 11, 12, 37, 36, nil, 1272 nil, nil, nil, 247, nil, 241, nil, nil, nil, 384, 1273 41, nil, 155, 83, 84, nil, 237, 238, 239, nil, 1274 nil, nil, 469, nil, nil, nil, 52, nil, 54, 55, 1275 56, 57, 58, 59, 60, 61, 62, 63, 64, 101, 1276 nil, nil, nil, nil, 617, nil, 264, nil, nil, nil, 1277 nil, nil, nil, nil, nil, nil, nil, nil, 291, nil, 1278 293, 294, 295, 296, 297, nil, nil, 616, 298, nil, 1279 nil, nil, nil, nil, nil, nil, nil, nil, nil, 304, 1280 nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 1281 nil, 641, nil, 772, nil, nil, nil, nil, 312, nil, 1282 314, 315, 316, 317, nil, nil, nil, nil, nil, nil, 1283 nil, nil, 321, nil, 113, nil, nil, 114, nil, 460, 1284 nil, nil, nil, nil, nil, nil ] 1350 309, nil, nil, nil, nil, nil, nil, nil, nil, nil, 1351 nil, nil, 652, nil, 653, nil, nil, nil, nil, 317, 1352 nil, 319, 320, 321, 322, nil, nil, nil, nil, nil, 1353 nil, nil, nil, 326, nil, 115, nil, nil, 116, nil, 1354 466, nil, nil, nil, nil, nil, nil, 733, 735, nil, 1355 nil, 734, 736, nil ] 1285 1356 1286 1357 racc_reduce_table = [ 1287 1358 0, 0, :racc_error, 1288 1, 141, :_reduce_none, 1289 1, 143, :_reduce_2, 1290 1, 143, :_reduce_3, 1291 1, 143, :_reduce_4, 1292 1, 143, :_reduce_5, 1293 1, 143, :_reduce_6, 1294 1, 143, :_reduce_7, 1295 1, 143, :_reduce_8, 1296 1, 143, :_reduce_9, 1297 1, 143, :_reduce_10, 1298 3, 143, :_reduce_11, 1299 1, 145, :_reduce_none, 1300 2, 145, :_reduce_13, 1301 1, 147, :_reduce_none, 1302 4, 147, :_reduce_15, 1303 3, 147, :_reduce_16, 1304 3, 147, :_reduce_17, 1359 1, 142, :_reduce_none, 1360 1, 144, :_reduce_2, 1361 1, 144, :_reduce_3, 1362 1, 144, :_reduce_4, 1363 1, 144, :_reduce_5, 1364 1, 144, :_reduce_6, 1365 1, 144, :_reduce_7, 1366 1, 144, :_reduce_8, 1367 1, 144, :_reduce_9, 1368 1, 144, :_reduce_10, 1369 3, 144, :_reduce_11, 1370 1, 146, :_reduce_none, 1371 2, 146, :_reduce_13, 1305 1372 1, 148, :_reduce_none, 1306 2, 148, :_reduce_19,1307 2, 148, :_reduce_20,1308 4, 148, :_reduce_21,1309 1, 149, :_reduce_ 22,1310 1, 149, :_reduce_23,1311 1, 149, :_reduce_24,1312 1, 149, :_reduce_25,1313 1, 1 49, :_reduce_26,1314 1, 1 49, :_reduce_27,1315 1, 150, :_reduce_ none,1316 4, 150, :_reduce_29,1317 1, 15 2, :_reduce_none,1318 3, 152, :_reduce_31,1319 3, 152, :_reduce_32,1320 3, 152, :_reduce_33,1373 4, 148, :_reduce_15, 1374 3, 148, :_reduce_16, 1375 3, 148, :_reduce_17, 1376 1, 149, :_reduce_none, 1377 2, 149, :_reduce_19, 1378 2, 149, :_reduce_20, 1379 4, 149, :_reduce_21, 1380 1, 150, :_reduce_22, 1381 1, 150, :_reduce_23, 1382 1, 150, :_reduce_24, 1383 1, 150, :_reduce_25, 1384 1, 150, :_reduce_26, 1385 1, 150, :_reduce_27, 1386 1, 151, :_reduce_none, 1387 4, 151, :_reduce_29, 1321 1388 1, 153, :_reduce_none, 1322 3, 153, :_reduce_35, 1323 3, 153, :_reduce_36, 1389 3, 153, :_reduce_31, 1390 3, 153, :_reduce_32, 1391 3, 153, :_reduce_33, 1324 1392 1, 154, :_reduce_none, 1325 3, 154, :_reduce_3 8,1326 3, 154, :_reduce_3 9,1393 3, 154, :_reduce_35, 1394 3, 154, :_reduce_36, 1327 1395 1, 155, :_reduce_none, 1328 3, 155, :_reduce_41, 1329 3, 155, :_reduce_42, 1330 3, 155, :_reduce_43, 1331 3, 155, :_reduce_44, 1396 3, 155, :_reduce_38, 1397 3, 155, :_reduce_39, 1332 1398 1, 156, :_reduce_none, 1333 3, 156, :_reduce_46, 1334 3, 156, :_reduce_47, 1399 3, 156, :_reduce_41, 1400 3, 156, :_reduce_42, 1401 3, 156, :_reduce_43, 1402 3, 156, :_reduce_44, 1335 1403 1, 157, :_reduce_none, 1336 3, 157, :_reduce_49, 1404 3, 157, :_reduce_46, 1405 3, 157, :_reduce_47, 1337 1406 1, 158, :_reduce_none, 1338 3, 158, :_reduce_ 51,1407 3, 158, :_reduce_49, 1339 1408 1, 159, :_reduce_none, 1340 3, 159, :_reduce_5 3,1409 3, 159, :_reduce_51, 1341 1410 1, 160, :_reduce_none, 1342 3, 160, :_reduce_5 5,1411 3, 160, :_reduce_53, 1343 1412 1, 161, :_reduce_none, 1344 3, 161, :_reduce_5 7,1413 3, 161, :_reduce_55, 1345 1414 1, 162, :_reduce_none, 1346 5, 162, :_reduce_59, 1347 1, 146, :_reduce_60, 1348 1, 163, :_reduce_61, 1349 3, 164, :_reduce_62, 1350 1, 167, :_reduce_none, 1351 2, 167, :_reduce_64, 1352 1, 166, :_reduce_65, 1353 3, 166, :_reduce_66, 1354 1, 170, :_reduce_none, 1355 3, 170, :_reduce_68, 1356 1, 168, :_reduce_69, 1357 1, 168, :_reduce_70, 1358 1, 168, :_reduce_71, 1415 3, 162, :_reduce_57, 1416 1, 163, :_reduce_none, 1417 5, 163, :_reduce_59, 1418 1, 147, :_reduce_60, 1419 1, 164, :_reduce_61, 1420 3, 165, :_reduce_62, 1359 1421 1, 168, :_reduce_none, 1360 1, 168, :_reduce_none, 1361 1, 168, :_reduce_74, 1362 1, 168, :_reduce_none, 1363 1, 168, :_reduce_none, 1364 1, 168, :_reduce_77, 1365 1, 168, :_reduce_78, 1366 1, 168, :_reduce_79, 1367 4, 168, :_reduce_80, 1368 1, 176, :_reduce_81, 1369 1, 176, :_reduce_82, 1370 1, 176, :_reduce_83, 1371 1, 177, :_reduce_84, 1372 1, 177, :_reduce_85, 1373 1, 177, :_reduce_86, 1374 1, 177, :_reduce_87, 1375 1, 177, :_reduce_88, 1376 1, 177, :_reduce_89, 1377 1, 177, :_reduce_90, 1378 1, 177, :_reduce_91, 1379 1, 177, :_reduce_92, 1380 1, 177, :_reduce_93, 1381 1, 177, :_reduce_94, 1382 1, 177, :_reduce_95, 1383 1, 177, :_reduce_96, 1384 1, 177, :_reduce_97, 1385 1, 178, :_reduce_98, 1386 1, 178, :_reduce_99, 1387 2, 175, :_reduce_100, 1388 1, 175, :_reduce_none, 1389 0, 181, :_reduce_102, 1390 6, 173, :_reduce_103, 1391 0, 182, :_reduce_104, 1392 5, 173, :_reduce_105, 1393 2, 173, :_reduce_106, 1394 1, 180, :_reduce_none, 1395 2, 180, :_reduce_none, 1396 1, 179, :_reduce_109, 1397 3, 183, :_reduce_110, 1398 6, 183, :_reduce_111, 1399 1, 186, :_reduce_112, 1400 3, 186, :_reduce_113, 1401 1, 188, :_reduce_114, 1402 4, 188, :_reduce_115, 1403 4, 188, :_reduce_116, 1404 4, 188, :_reduce_117, 1405 1, 165, :_reduce_none, 1406 2, 165, :_reduce_119, 1407 1, 184, :_reduce_120, 1408 3, 184, :_reduce_121, 1409 1, 189, :_reduce_none, 1410 4, 174, :_reduce_none, 1411 5, 174, :_reduce_none, 1412 2, 174, :_reduce_none, 1413 1, 190, :_reduce_126, 1414 1, 190, :_reduce_127, 1415 1, 190, :_reduce_128, 1416 1, 190, :_reduce_129, 1417 1, 190, :_reduce_130, 1418 1, 190, :_reduce_131, 1419 1, 191, :_reduce_none, 1420 3, 191, :_reduce_none, 1422 2, 168, :_reduce_64, 1423 1, 167, :_reduce_65, 1424 3, 167, :_reduce_66, 1425 1, 171, :_reduce_none, 1426 3, 171, :_reduce_68, 1427 1, 169, :_reduce_69, 1428 1, 169, :_reduce_70, 1429 1, 169, :_reduce_71, 1430 1, 169, :_reduce_none, 1431 1, 169, :_reduce_none, 1432 1, 169, :_reduce_74, 1433 1, 169, :_reduce_none, 1434 1, 169, :_reduce_none, 1435 1, 169, :_reduce_77, 1436 1, 169, :_reduce_78, 1437 1, 169, :_reduce_79, 1438 4, 169, :_reduce_80, 1439 1, 177, :_reduce_81, 1440 1, 177, :_reduce_82, 1441 1, 177, :_reduce_83, 1442 1, 178, :_reduce_84, 1443 1, 178, :_reduce_85, 1444 1, 178, :_reduce_86, 1445 1, 178, :_reduce_87, 1446 1, 178, :_reduce_88, 1447 1, 178, :_reduce_89, 1448 1, 178, :_reduce_90, 1449 1, 178, :_reduce_91, 1450 1, 178, :_reduce_92, 1451 1, 178, :_reduce_93, 1452 1, 178, :_reduce_94, 1453 1, 178, :_reduce_95, 1454 1, 178, :_reduce_96, 1455 1, 178, :_reduce_97, 1456 1, 179, :_reduce_98, 1457 1, 179, :_reduce_99, 1458 2, 176, :_reduce_100, 1459 1, 176, :_reduce_none, 1460 0, 182, :_reduce_102, 1461 6, 174, :_reduce_103, 1462 0, 183, :_reduce_104, 1463 5, 174, :_reduce_105, 1464 2, 174, :_reduce_106, 1465 1, 181, :_reduce_none, 1466 2, 181, :_reduce_none, 1467 1, 180, :_reduce_109, 1468 3, 184, :_reduce_110, 1469 6, 184, :_reduce_111, 1470 1, 187, :_reduce_112, 1471 3, 187, :_reduce_113, 1472 1, 189, :_reduce_114, 1473 4, 189, :_reduce_115, 1474 4, 189, :_reduce_116, 1475 4, 189, :_reduce_117, 1476 1, 166, :_reduce_none, 1477 2, 166, :_reduce_119, 1478 1, 185, :_reduce_120, 1479 3, 185, :_reduce_121, 1480 1, 190, :_reduce_none, 1481 4, 175, :_reduce_none, 1482 5, 175, :_reduce_none, 1483 2, 175, :_reduce_none, 1484 1, 191, :_reduce_126, 1485 1, 191, :_reduce_127, 1486 1, 191, :_reduce_128, 1487 1, 191, :_reduce_129, 1488 1, 191, :_reduce_130, 1489 1, 191, :_reduce_131, 1421 1490 1, 192, :_reduce_none, 1422 1491 3, 192, :_reduce_none, 1423 1, 169, :_reduce_136, 1424 1, 169, :_reduce_137, 1425 2, 171, :_reduce_138, 1426 1, 171, :_reduce_none, 1427 1, 194, :_reduce_140, 1428 3, 194, :_reduce_141, 1429 4, 194, :_reduce_142, 1430 3, 194, :_reduce_143, 1431 4, 194, :_reduce_144, 1432 3, 194, :_reduce_145, 1433 1, 193, :_reduce_146, 1434 2, 193, :_reduce_147, 1435 2, 193, :_reduce_148, 1436 3, 193, :_reduce_149, 1437 1, 195, :_reduce_none, 1438 3, 195, :_reduce_none, 1439 1, 196, :_reduce_152, 1440 3, 196, :_reduce_153, 1441 3, 197, :_reduce_154, 1442 2, 197, :_reduce_155, 1443 1, 197, :_reduce_156, 1444 2, 197, :_reduce_157, 1445 3, 198, :_reduce_158, 1446 1, 199, :_reduce_159, 1447 3, 199, :_reduce_160, 1448 1, 200, :_reduce_161, 1449 1, 200, :_reduce_162, 1450 1, 200, :_reduce_163, 1451 4, 200, :_reduce_164, 1452 4, 200, :_reduce_165, 1453 1, 200, :_reduce_166, 1454 4, 200, :_reduce_167, 1455 4, 200, :_reduce_168, 1456 6, 200, :_reduce_169, 1457 4, 200, :_reduce_170, 1458 1, 200, :_reduce_171, 1459 1, 151, :_reduce_none, 1460 2, 151, :_reduce_173, 1461 1, 201, :_reduce_none, 1462 1, 201, :_reduce_none, 1463 2, 201, :_reduce_none, 1464 3, 202, :_reduce_177, 1465 2, 202, :_reduce_178, 1466 3, 202, :_reduce_179, 1467 3, 202, :_reduce_180, 1468 4, 202, :_reduce_181, 1469 2, 202, :_reduce_182, 1470 3, 202, :_reduce_none, 1471 3, 202, :_reduce_184, 1472 4, 202, :_reduce_185, 1473 1, 172, :_reduce_186, 1474 3, 172, :_reduce_187, 1475 4, 172, :_reduce_188, 1476 4, 172, :_reduce_189, 1477 1, 203, :_reduce_190, 1478 3, 203, :_reduce_191, 1479 2, 142, :_reduce_none, 1480 2, 142, :_reduce_none, 1481 0, 142, :_reduce_none, 1482 1, 204, :_reduce_none, 1483 4, 204, :_reduce_196, 1484 1, 206, :_reduce_none, 1485 1, 206, :_reduce_none, 1486 1, 206, :_reduce_none, 1487 1, 206, :_reduce_none, 1488 1, 206, :_reduce_none, 1489 1, 206, :_reduce_none, 1490 1, 206, :_reduce_none, 1491 2, 206, :_reduce_none, 1492 2, 206, :_reduce_none, 1493 1, 206, :_reduce_none, 1494 1, 206, :_reduce_none, 1495 1, 206, :_reduce_none, 1496 1, 206, :_reduce_none, 1497 1, 206, :_reduce_none, 1498 1, 207, :_reduce_211, 1499 3, 207, :_reduce_212, 1500 4, 219, :_reduce_213, 1501 1, 219, :_reduce_214, 1502 4, 219, :_reduce_215, 1503 1, 219, :_reduce_216, 1504 4, 219, :_reduce_217, 1505 1, 219, :_reduce_218, 1506 4, 219, :_reduce_219, 1507 1, 219, :_reduce_220, 1508 1, 219, :_reduce_221, 1509 1, 219, :_reduce_222, 1510 6, 219, :_reduce_223, 1511 1, 220, :_reduce_224, 1512 3, 220, :_reduce_225, 1513 7, 224, :_reduce_226, 1514 10, 224, :_reduce_227, 1515 1, 221, :_reduce_228, 1516 3, 221, :_reduce_229, 1517 5, 225, :_reduce_230, 1518 7, 225, :_reduce_231, 1519 1, 227, :_reduce_232, 1520 3, 227, :_reduce_233, 1521 1, 209, :_reduce_234, 1522 5, 217, :_reduce_235, 1523 7, 217, :_reduce_236, 1524 5, 216, :_reduce_237, 1525 5, 216, :_reduce_238, 1526 9, 218, :_reduce_239, 1527 4, 208, :_reduce_240, 1528 7, 208, :_reduce_241, 1529 1, 229, :_reduce_none, 1530 4, 229, :_reduce_none, 1531 1, 228, :_reduce_244, 1532 3, 228, :_reduce_245, 1533 6, 210, :_reduce_246, 1534 1, 230, :_reduce_247, 1492 1, 193, :_reduce_none, 1493 3, 193, :_reduce_none, 1494 1, 170, :_reduce_136, 1495 1, 170, :_reduce_137, 1496 2, 172, :_reduce_138, 1497 1, 172, :_reduce_none, 1498 1, 195, :_reduce_140, 1499 3, 195, :_reduce_141, 1500 4, 195, :_reduce_142, 1501 3, 195, :_reduce_143, 1502 4, 195, :_reduce_144, 1503 3, 195, :_reduce_145, 1504 1, 194, :_reduce_146, 1505 2, 194, :_reduce_147, 1506 2, 194, :_reduce_148, 1507 3, 194, :_reduce_149, 1508 1, 196, :_reduce_none, 1509 3, 196, :_reduce_none, 1510 1, 197, :_reduce_152, 1511 3, 197, :_reduce_153, 1512 3, 198, :_reduce_154, 1513 2, 198, :_reduce_155, 1514 1, 198, :_reduce_156, 1515 2, 198, :_reduce_157, 1516 3, 199, :_reduce_158, 1517 1, 200, :_reduce_159, 1518 3, 200, :_reduce_160, 1519 1, 201, :_reduce_161, 1520 1, 201, :_reduce_162, 1521 1, 201, :_reduce_163, 1522 4, 201, :_reduce_164, 1523 4, 201, :_reduce_165, 1524 1, 201, :_reduce_166, 1525 4, 201, :_reduce_167, 1526 4, 201, :_reduce_168, 1527 6, 201, :_reduce_169, 1528 4, 201, :_reduce_170, 1529 1, 201, :_reduce_171, 1530 1, 152, :_reduce_none, 1531 2, 152, :_reduce_173, 1532 1, 202, :_reduce_none, 1533 1, 202, :_reduce_none, 1534 2, 202, :_reduce_none, 1535 3, 203, :_reduce_177, 1536 2, 203, :_reduce_178, 1537 3, 203, :_reduce_179, 1538 3, 203, :_reduce_180, 1539 4, 203, :_reduce_181, 1540 2, 203, :_reduce_182, 1541 3, 203, :_reduce_none, 1542 3, 203, :_reduce_184, 1543 4, 203, :_reduce_185, 1544 1, 173, :_reduce_186, 1545 3, 173, :_reduce_187, 1546 4, 173, :_reduce_188, 1547 4, 173, :_reduce_189, 1548 1, 204, :_reduce_190, 1549 3, 204, :_reduce_191, 1550 2, 143, :_reduce_none, 1551 2, 143, :_reduce_none, 1552 2, 143, :_reduce_none, 1553 0, 143, :_reduce_none, 1554 1, 205, :_reduce_none, 1555 4, 205, :_reduce_197, 1556 1, 208, :_reduce_none, 1557 1, 208, :_reduce_none, 1558 1, 208, :_reduce_none, 1559 1, 208, :_reduce_none, 1560 1, 208, :_reduce_none, 1561 1, 208, :_reduce_none, 1562 1, 208, :_reduce_none, 1563 2, 208, :_reduce_none, 1564 2, 208, :_reduce_none, 1565 1, 208, :_reduce_none, 1566 1, 208, :_reduce_none, 1567 1, 208, :_reduce_none, 1568 1, 208, :_reduce_none, 1569 1, 208, :_reduce_none, 1570 1, 209, :_reduce_212, 1571 3, 209, :_reduce_213, 1572 4, 221, :_reduce_214, 1573 1, 221, :_reduce_215, 1574 4, 221, :_reduce_216, 1575 1, 221, :_reduce_217, 1576 4, 221, :_reduce_218, 1577 1, 221, :_reduce_219, 1578 4, 221, :_reduce_220, 1579 1, 221, :_reduce_221, 1580 1, 221, :_reduce_222, 1581 1, 221, :_reduce_223, 1582 6, 221, :_reduce_224, 1583 1, 222, :_reduce_225, 1584 3, 222, :_reduce_226, 1585 7, 226, :_reduce_227, 1586 10, 226, :_reduce_228, 1587 1, 223, :_reduce_229, 1588 3, 223, :_reduce_230, 1589 5, 227, :_reduce_231, 1590 7, 227, :_reduce_232, 1591 1, 229, :_reduce_233, 1592 3, 229, :_reduce_234, 1593 1, 211, :_reduce_235, 1594 5, 219, :_reduce_236, 1595 7, 219, :_reduce_237, 1596 5, 218, :_reduce_238, 1597 5, 218, :_reduce_239, 1598 9, 220, :_reduce_240, 1599 4, 210, :_reduce_241, 1600 7, 210, :_reduce_242, 1535 1601 1, 231, :_reduce_none, 1536 2, 231, :_reduce_none, 1537 1, 144, :_reduce_250, 1538 2, 144, :_reduce_251, 1539 3, 144, :_reduce_252, 1540 6, 211, :_reduce_253, 1541 1, 232, :_reduce_254, 1542 0, 233, :_reduce_255, 1543 2, 233, :_reduce_256, 1544 3, 234, :_reduce_257, 1545 6, 234, :_reduce_258, 1546 6, 212, :_reduce_259, 1547 1, 235, :_reduce_260, 1548 1, 236, :_reduce_none, 1549 2, 236, :_reduce_none, 1550 1, 237, :_reduce_263, 1551 4, 237, :_reduce_264, 1602 4, 231, :_reduce_none, 1603 1, 230, :_reduce_245, 1604 3, 230, :_reduce_246, 1605 6, 212, :_reduce_247, 1606 1, 232, :_reduce_248, 1607 1, 233, :_reduce_none, 1608 2, 233, :_reduce_none, 1609 1, 145, :_reduce_251, 1610 2, 145, :_reduce_252, 1611 3, 145, :_reduce_253, 1612 6, 213, :_reduce_254, 1613 1, 234, :_reduce_255, 1614 0, 235, :_reduce_256, 1615 2, 235, :_reduce_257, 1616 3, 236, :_reduce_258, 1617 6, 236, :_reduce_259, 1618 6, 214, :_reduce_260, 1619 1, 237, :_reduce_261, 1552 1620 1, 238, :_reduce_none, 1553 1, 238, :_reduce_none, 1554 1, 238, :_reduce_none, 1555 1, 238, :_reduce_none, 1556 1, 238, :_reduce_none, 1557 1, 239, :_reduce_270, 1558 3, 239, :_reduce_271, 1559 1, 245, :_reduce_272, 1560 4, 245, :_reduce_273, 1561 1, 245, :_reduce_274, 1562 1, 245, :_reduce_275, 1563 1, 245, :_reduce_276, 1564 1, 245, :_reduce_277, 1565 1, 246, :_reduce_278, 1566 1, 246, :_reduce_279, 1567 3, 246, :_reduce_280, 1568 3, 246, :_reduce_281, 1569 5, 247, :_reduce_282, 1570 5, 247, :_reduce_283, 1571 4, 240, :_reduce_284, 1572 6, 240, :_reduce_285, 1573 7, 240, :_reduce_286, 1574 8, 240, :_reduce_287, 1575 1, 248, :_reduce_288, 1576 1, 248, :_reduce_289, 1577 1, 249, :_reduce_290, 1578 1, 226, :_reduce_none, 1579 1, 250, :_reduce_none, 1580 5, 241, :_reduce_293, 1581 1, 251, :_reduce_294, 1582 2, 251, :_reduce_295, 1583 1, 252, :_reduce_296, 1584 4, 252, :_reduce_297, 1585 1, 253, :_reduce_298, 1586 4, 253, :_reduce_299, 1587 5, 253, :_reduce_300, 1588 3, 254, :_reduce_301, 1589 1, 254, :_reduce_302, 1590 1, 255, :_reduce_none, 1591 5, 242, :_reduce_304, 1592 1, 256, :_reduce_305, 1593 2, 256, :_reduce_306, 1594 1, 257, :_reduce_307, 1595 4, 257, :_reduce_308, 1596 4, 258, :_reduce_309, 1597 5, 243, :_reduce_310, 1598 7, 243, :_reduce_311, 1599 5, 244, :_reduce_none, 1600 1, 259, :_reduce_313, 1601 1, 259, :_reduce_314, 1602 0, 260, :_reduce_none, 1603 2, 260, :_reduce_none, 1604 7, 261, :_reduce_317, 1605 9, 261, :_reduce_318, 1606 1, 262, :_reduce_none, 1607 1, 263, :_reduce_320, 1608 3, 263, :_reduce_321, 1609 1, 263, :_reduce_322, 1610 3, 263, :_reduce_323, 1611 0, 267, :_reduce_324, 1612 8, 213, :_reduce_325, 1613 4, 213, :_reduce_326, 1614 1, 264, :_reduce_327, 1615 1, 265, :_reduce_328, 1616 0, 266, :_reduce_none, 1617 2, 266, :_reduce_none, 1618 2, 266, :_reduce_none, 1619 4, 268, :_reduce_332, 1620 1, 268, :_reduce_333, 1621 3, 270, :_reduce_334, 1622 1, 270, :_reduce_335, 1623 6, 272, :_reduce_336, 1624 1, 222, :_reduce_337, 1625 1, 223, :_reduce_none, 1626 6, 271, :_reduce_339, 1627 7, 271, :_reduce_340, 1628 4, 271, :_reduce_341, 1629 6, 271, :_reduce_342, 1630 1, 273, :_reduce_none, 1631 6, 269, :_reduce_344, 1632 9, 269, :_reduce_345, 1633 9, 269, :_reduce_346, 1634 12, 269, :_reduce_347, 1635 1, 274, :_reduce_none, 1636 6, 214, :_reduce_349, 1637 1, 275, :_reduce_350, 1621 2, 238, :_reduce_none, 1622 1, 239, :_reduce_264, 1623 4, 239, :_reduce_265, 1624 1, 240, :_reduce_none, 1625 1, 240, :_reduce_none, 1626 1, 240, :_reduce_none, 1627 1, 240, :_reduce_none, 1628 1, 240, :_reduce_none, 1629 1, 241, :_reduce_271, 1630 3, 241, :_reduce_272, 1631 1, 247, :_reduce_273, 1632 4, 247, :_reduce_274, 1633 1, 247, :_reduce_275, 1634 1, 247, :_reduce_276, 1635 1, 247, :_reduce_277, 1636 1, 247, :_reduce_278, 1637 1, 248, :_reduce_279, 1638 1, 248, :_reduce_280, 1639 3, 248, :_reduce_281, 1640 3, 248, :_reduce_282, 1641 5, 249, :_reduce_283, 1642 5, 249, :_reduce_284, 1643 4, 242, :_reduce_285, 1644 6, 242, :_reduce_286, 1645 7, 242, :_reduce_287, 1646 8, 242, :_reduce_288, 1647 1, 250, :_reduce_289, 1648 1, 250, :_reduce_290, 1649 1, 251, :_reduce_291, 1650 1, 228, :_reduce_none, 1651 1, 252, :_reduce_none, 1652 5, 243, :_reduce_294, 1653 1, 253, :_reduce_295, 1654 2, 253, :_reduce_296, 1655 1, 254, :_reduce_297, 1656 4, 254, :_reduce_298, 1657 1, 255, :_reduce_299, 1658 4, 255, :_reduce_300, 1659 5, 255, :_reduce_301, 1660 3, 256, :_reduce_302, 1661 1, 256, :_reduce_303, 1662 1, 257, :_reduce_none, 1663 5, 244, :_reduce_305, 1664 1, 258, :_reduce_306, 1665 2, 258, :_reduce_307, 1666 1, 259, :_reduce_308, 1667 4, 259, :_reduce_309, 1668 4, 260, :_reduce_310, 1669 5, 245, :_reduce_311, 1670 7, 245, :_reduce_312, 1671 5, 246, :_reduce_none, 1672 1, 261, :_reduce_314, 1673 1, 261, :_reduce_315, 1674 0, 262, :_reduce_none, 1675 2, 262, :_reduce_none, 1676 7, 263, :_reduce_318, 1677 9, 263, :_reduce_319, 1678 1, 264, :_reduce_none, 1679 1, 265, :_reduce_321, 1680 3, 265, :_reduce_322, 1681 1, 265, :_reduce_323, 1682 3, 265, :_reduce_324, 1683 0, 269, :_reduce_325, 1684 8, 215, :_reduce_326, 1685 4, 215, :_reduce_327, 1686 1, 266, :_reduce_328, 1687 1, 267, :_reduce_329, 1688 0, 268, :_reduce_none, 1689 2, 268, :_reduce_none, 1690 2, 268, :_reduce_none, 1691 4, 270, :_reduce_333, 1692 1, 270, :_reduce_334, 1693 3, 272, :_reduce_335, 1694 1, 272, :_reduce_336, 1695 6, 274, :_reduce_337, 1696 1, 224, :_reduce_338, 1697 1, 225, :_reduce_none, 1698 6, 273, :_reduce_340, 1699 7, 273, :_reduce_341, 1700 4, 273, :_reduce_342, 1701 6, 273, :_reduce_343, 1702 1, 275, :_reduce_none, 1703 6, 271, :_reduce_345, 1704 9, 271, :_reduce_346, 1705 9, 271, :_reduce_347, 1706 12, 271, :_reduce_348, 1638 1707 1, 276, :_reduce_none, 1639 2, 276, :_reduce_none, 1640 1, 277, :_reduce_353, 1641 4, 277, :_reduce_354, 1708 6, 216, :_reduce_350, 1709 1, 277, :_reduce_351, 1642 1710 1, 278, :_reduce_none, 1643 1, 278, :_reduce_none, 1644 1, 278, :_reduce_none, 1645 1, 278, :_reduce_none, 1646 1, 279, :_reduce_359, 1647 4, 284, :_reduce_360, 1648 1, 284, :_reduce_361, 1649 1, 284, :_reduce_362, 1650 1, 284, :_reduce_363, 1651 1, 284, :_reduce_364, 1652 1, 280, :_reduce_365, 1653 5, 281, :_reduce_366, 1654 1, 285, :_reduce_367, 1655 2, 285, :_reduce_368, 1656 0, 289, :_reduce_369, 1657 8, 282, :_reduce_370, 1658 4, 282, :_reduce_371, 1659 1, 286, :_reduce_372, 1660 1, 287, :_reduce_373, 1661 0, 288, :_reduce_none, 1662 2, 288, :_reduce_none, 1663 2, 288, :_reduce_none, 1664 6, 290, :_reduce_377, 1665 4, 290, :_reduce_378, 1666 6, 283, :_reduce_379, 1667 8, 283, :_reduce_380, 1668 1, 292, :_reduce_none, 1711 2, 278, :_reduce_none, 1712 1, 279, :_reduce_354, 1713 4, 279, :_reduce_355, 1714 1, 280, :_reduce_none, 1715 1, 280, :_reduce_none, 1716 1, 280, :_reduce_none, 1717 1, 280, :_reduce_none, 1718 1, 281, :_reduce_360, 1719 3, 281, :_reduce_361, 1720 4, 286, :_reduce_362, 1721 1, 286, :_reduce_363, 1722 1, 286, :_reduce_364, 1723 1, 286, :_reduce_365, 1724 1, 286, :_reduce_366, 1725 1, 282, :_reduce_367, 1726 5, 283, :_reduce_368, 1727 1, 287, :_reduce_369, 1728 2, 287, :_reduce_370, 1729 0, 291, :_reduce_371, 1730 8, 284, :_reduce_372, 1731 4, 284, :_reduce_373, 1732 1, 288, :_reduce_374, 1733 1, 289, :_reduce_375, 1734 0, 290, :_reduce_none, 1735 2, 290, :_reduce_none, 1736 2, 290, :_reduce_none, 1737 2, 290, :_reduce_none, 1738 6, 292, :_reduce_380, 1739 4, 292, :_reduce_381, 1740 6, 285, :_reduce_382, 1741 8, 285, :_reduce_383, 1742 1, 294, :_reduce_none, 1743 1, 295, :_reduce_none, 1669 1744 1, 293, :_reduce_none, 1670 1, 291, :_reduce_none, 1671 9, 215, :_reduce_384, 1672 6, 215, :_reduce_385, 1673 1, 294, :_reduce_none, 1674 3, 294, :_reduce_none, 1675 6, 297, :_reduce_388, 1676 3, 297, :_reduce_389, 1677 6, 297, :_reduce_390, 1678 3, 297, :_reduce_391, 1679 8, 297, :_reduce_392, 1680 4, 297, :_reduce_393, 1681 1, 297, :_reduce_394, 1682 1, 297, :_reduce_395, 1683 6, 297, :_reduce_396, 1684 4, 297, :_reduce_397, 1685 1, 295, :_reduce_398, 1686 0, 296, :_reduce_none, 1687 2, 296, :_reduce_none, 1688 2, 296, :_reduce_none, 1689 1, 299, :_reduce_none, 1690 4, 299, :_reduce_403, 1691 1, 298, :_reduce_404, 1692 1, 185, :_reduce_405, 1693 1, 187, :_reduce_406, 1694 4, 205, :_reduce_none, 1695 2, 300, :_reduce_none, 1696 2, 300, :_reduce_none, 1697 0, 300, :_reduce_none, 1698 14, 301, :_reduce_411, 1699 2, 303, :_reduce_412, 1700 0, 303, :_reduce_413, 1701 6, 304, :_reduce_414, 1702 13, 302, :_reduce_415, 1703 5, 305, :_reduce_416, 1704 0, 305, :_reduce_417 ] 1705 1706 racc_reduce_n = 418 1707 1708 racc_shift_n = 870 1745 9, 217, :_reduce_387, 1746 6, 217, :_reduce_388, 1747 1, 296, :_reduce_none, 1748 3, 296, :_reduce_none, 1749 6, 299, :_reduce_391, 1750 3, 299, :_reduce_392, 1751 6, 299, :_reduce_393, 1752 3, 299, :_reduce_394, 1753 8, 299, :_reduce_395, 1754 4, 299, :_reduce_396, 1755 1, 299, :_reduce_397, 1756 1, 299, :_reduce_398, 1757 6, 299, :_reduce_399, 1758 4, 299, :_reduce_400, 1759 1, 297, :_reduce_401, 1760 0, 298, :_reduce_none, 1761 2, 298, :_reduce_none, 1762 2, 298, :_reduce_none, 1763 1, 301, :_reduce_none, 1764 4, 301, :_reduce_406, 1765 1, 300, :_reduce_407, 1766 1, 186, :_reduce_408, 1767 1, 188, :_reduce_409, 1768 4, 206, :_reduce_none, 1769 2, 302, :_reduce_none, 1770 2, 302, :_reduce_none, 1771 0, 302, :_reduce_none, 1772 14, 303, :_reduce_414, 1773 2, 305, :_reduce_415, 1774 0, 305, :_reduce_416, 1775 6, 306, :_reduce_417, 1776 13, 304, :_reduce_418, 1777 5, 307, :_reduce_419, 1778 0, 307, :_reduce_420, 1779 5, 207, :_reduce_421, 1780 3, 309, :_reduce_422, 1781 3, 310, :_reduce_423, 1782 5, 310, :_reduce_424, 1783 1, 311, :_reduce_none, 1784 1, 311, :_reduce_none, 1785 1, 311, :_reduce_none, 1786 1, 311, :_reduce_none, 1787 1, 311, :_reduce_429, 1788 1, 311, :_reduce_430, 1789 3, 313, :_reduce_431, 1790 2, 313, :_reduce_432, 1791 1, 314, :_reduce_433, 1792 3, 314, :_reduce_434, 1793 1, 308, :_reduce_435, 1794 1, 312, :_reduce_436, 1795 1, 312, :_reduce_437, 1796 2, 312, :_reduce_438, 1797 2, 312, :_reduce_439, 1798 2, 312, :_reduce_440, 1799 2, 312, :_reduce_441 ] 1800 1801 racc_reduce_n = 442 1802 1803 racc_shift_n = 911 1709 1804 1710 1805 racc_token_table = { … … 1848 1943 :__LOCATION_INFORMATION__ => 137, 1849 1944 :__CELL__ => 138, 1850 :__JOIN__ => 139 } 1851 1852 racc_nt_base = 140 1945 :__JOIN__ => 139, 1946 :TOOL_INFO => 140 } 1947 1948 racc_nt_base = 141 1853 1949 1854 1950 racc_use_result_var = true … … 2011 2107 "__CELL__", 2012 2108 "__JOIN__", 2109 "TOOL_INFO", 2013 2110 "$start", 2014 2111 "all", … … 2077 2174 "specified_statement", 2078 2175 "location_information", 2176 "tool_info", 2079 2177 "statement", 2080 2178 "statement_specifier_list", … … 2089 2187 "import", 2090 2188 "import_C", 2091 " signature_plugin",2189 "generate_statement", 2092 2190 "statement_specifier", 2093 2191 "alloc_list", … … 2176 2274 "port_location_list", 2177 2275 "port_location", 2178 "bar_list" ] 2276 "bar_list", 2277 "JSON_string", 2278 "JSON_object", 2279 "JSON_property_list", 2280 "JSON_value", 2281 "JSON_number", 2282 "JSON_array", 2283 "JSON_array_list" ] 2179 2284 2180 2285 Racc_debug_parser = false … … 2838 2943 module_eval(<<'.,.,', 'bnf.y.rb', 379) 2839 2944 def _reduce_104(val, _values, result) 2840 result = StructType.new() 2945 # tag が無い場合、内部名を与える 2946 result = StructType.new( :"TAG__#{@@no_struct_tag_num}__" ) 2947 @@no_struct_tag_num += 1 2841 2948 StructType.set_define( true ) 2842 2949 … … 2845 2952 .,., 2846 2953 2847 module_eval(<<'.,.,', 'bnf.y.rb', 38 4)2954 module_eval(<<'.,.,', 'bnf.y.rb', 386) 2848 2955 def _reduce_105(val, _values, result) 2849 2956 StructType.end_of_parse … … 2854 2961 .,., 2855 2962 2856 module_eval(<<'.,.,', 'bnf.y.rb', 3 89)2963 module_eval(<<'.,.,', 'bnf.y.rb', 391) 2857 2964 def _reduce_106(val, _values, result) 2858 2965 StructType.set_define( false ) … … 2868 2975 # reduce 108 omitted 2869 2976 2870 module_eval(<<'.,.,', 'bnf.y.rb', 40 0)2977 module_eval(<<'.,.,', 'bnf.y.rb', 402) 2871 2978 def _reduce_109(val, _values, result) 2872 2979 result = StructType.new( val[0].val ) … … 2875 2982 .,., 2876 2983 2877 module_eval(<<'.,.,', 'bnf.y.rb', 40 6)2984 module_eval(<<'.,.,', 'bnf.y.rb', 408) 2878 2985 def _reduce_110(val, _values, result) 2879 2986 val[1].each { |i| # i: Decl … … 2889 2996 .,., 2890 2997 2891 module_eval(<<'.,.,', 'bnf.y.rb', 41 6)2998 module_eval(<<'.,.,', 'bnf.y.rb', 418) 2892 2999 def _reduce_111(val, _values, result) 2893 3000 val[4].each { |i| # i: Decl … … 2904 3011 .,., 2905 3012 2906 module_eval(<<'.,.,', 'bnf.y.rb', 42 7)3013 module_eval(<<'.,.,', 'bnf.y.rb', 429) 2907 3014 def _reduce_112(val, _values, result) 2908 3015 result = [ val[0] ] … … 2911 3018 .,., 2912 3019 2913 module_eval(<<'.,.,', 'bnf.y.rb', 4 28)3020 module_eval(<<'.,.,', 'bnf.y.rb', 430) 2914 3021 def _reduce_113(val, _values, result) 2915 3022 result << val[2] … … 2918 3025 .,., 2919 3026 2920 module_eval(<<'.,.,', 'bnf.y.rb', 43 1)3027 module_eval(<<'.,.,', 'bnf.y.rb', 433) 2921 3028 def _reduce_114(val, _values, result) 2922 3029 result = [:STRING,-1] … … 2925 3032 .,., 2926 3033 2927 module_eval(<<'.,.,', 'bnf.y.rb', 43 2)3034 module_eval(<<'.,.,', 'bnf.y.rb', 434) 2928 3035 def _reduce_115(val, _values, result) 2929 3036 result = [:STRING,val[2]] … … 2932 3039 .,., 2933 3040 2934 module_eval(<<'.,.,', 'bnf.y.rb', 43 3)3041 module_eval(<<'.,.,', 'bnf.y.rb', 435) 2935 3042 def _reduce_116(val, _values, result) 2936 3043 result = [:SIZE_IS,val[2]] … … 2939 3046 .,., 2940 3047 2941 module_eval(<<'.,.,', 'bnf.y.rb', 43 4)3048 module_eval(<<'.,.,', 'bnf.y.rb', 436) 2942 3049 def _reduce_117(val, _values, result) 2943 3050 result = [:COUNT_IS,val[2]] … … 2948 3055 # reduce 118 omitted 2949 3056 2950 module_eval(<<'.,.,', 'bnf.y.rb', 44 5)3057 module_eval(<<'.,.,', 'bnf.y.rb', 447) 2951 3058 def _reduce_119(val, _values, result) 2952 3059 val[1].set_qualifier( val[0] ) … … 2957 3064 .,., 2958 3065 2959 module_eval(<<'.,.,', 'bnf.y.rb', 45 4)3066 module_eval(<<'.,.,', 'bnf.y.rb', 456) 2960 3067 def _reduce_120(val, _values, result) 2961 3068 result = [ val[0] ] … … 2964 3071 .,., 2965 3072 2966 module_eval(<<'.,.,', 'bnf.y.rb', 45 6)3073 module_eval(<<'.,.,', 'bnf.y.rb', 458) 2967 3074 def _reduce_121(val, _values, result) 2968 3075 result << val[2] … … 2979 3086 # reduce 125 omitted 2980 3087 2981 module_eval(<<'.,.,', 'bnf.y.rb', 4 69)3088 module_eval(<<'.,.,', 'bnf.y.rb', 471) 2982 3089 def _reduce_126(val, _values, result) 2983 3090 result = EnumType.new( -1 ) … … 2986 3093 .,., 2987 3094 2988 module_eval(<<'.,.,', 'bnf.y.rb', 47 0)3095 module_eval(<<'.,.,', 'bnf.y.rb', 472) 2989 3096 def _reduce_127(val, _values, result) 2990 3097 result = EnumType.new( 8 ) … … 2993 3100 .,., 2994 3101 2995 module_eval(<<'.,.,', 'bnf.y.rb', 47 1)3102 module_eval(<<'.,.,', 'bnf.y.rb', 473) 2996 3103 def _reduce_128(val, _values, result) 2997 3104 result = EnumType.new( 16 ) … … 3000 3107 .,., 3001 3108 3002 module_eval(<<'.,.,', 'bnf.y.rb', 47 2)3109 module_eval(<<'.,.,', 'bnf.y.rb', 474) 3003 3110 def _reduce_129(val, _values, result) 3004 3111 result = EnumType.new( 32 ) … … 3007 3114 .,., 3008 3115 3009 module_eval(<<'.,.,', 'bnf.y.rb', 47 3)3116 module_eval(<<'.,.,', 'bnf.y.rb', 475) 3010 3117 def _reduce_130(val, _values, result) 3011 3118 result = EnumType.new( 64 ) … … 3014 3121 .,., 3015 3122 3016 module_eval(<<'.,.,', 'bnf.y.rb', 47 4)3123 module_eval(<<'.,.,', 'bnf.y.rb', 476) 3017 3124 def _reduce_131(val, _values, result) 3018 3125 result = EnumType.new( 128 ) … … 3029 3136 # reduce 135 omitted 3030 3137 3031 module_eval(<<'.,.,', 'bnf.y.rb', 48 5)3138 module_eval(<<'.,.,', 'bnf.y.rb', 487) 3032 3139 def _reduce_136(val, _values, result) 3033 3140 result = :CONST … … 3036 3143 .,., 3037 3144 3038 module_eval(<<'.,.,', 'bnf.y.rb', 48 6)3145 module_eval(<<'.,.,', 'bnf.y.rb', 488) 3039 3146 def _reduce_137(val, _values, result) 3040 3147 result = :VOLATILE … … 3043 3150 .,., 3044 3151 3045 module_eval(<<'.,.,', 'bnf.y.rb', 49 1)3152 module_eval(<<'.,.,', 'bnf.y.rb', 493) 3046 3153 def _reduce_138(val, _values, result) 3047 3154 val[1].set_type( val[0] ) … … 3054 3161 # reduce 139 omitted 3055 3162 3056 module_eval(<<'.,.,', 'bnf.y.rb', 498)3163 module_eval(<<'.,.,', 'bnf.y.rb', 500) 3057 3164 def _reduce_140(val, _values, result) 3058 3165 result = Decl.new( val[0].val ) … … 3061 3168 .,., 3062 3169 3063 module_eval(<<'.,.,', 'bnf.y.rb', 50 0)3170 module_eval(<<'.,.,', 'bnf.y.rb', 502) 3064 3171 def _reduce_141(val, _values, result) 3065 3172 result = val[1] … … 3068 3175 .,., 3069 3176 3070 module_eval(<<'.,.,', 'bnf.y.rb', 50 3)3177 module_eval(<<'.,.,', 'bnf.y.rb', 505) 3071 3178 def _reduce_142(val, _values, result) 3072 3179 val[0].set_type( ArrayType.new( val[2] ) ) … … 3077 3184 .,., 3078 3185 3079 module_eval(<<'.,.,', 'bnf.y.rb', 5 08)3186 module_eval(<<'.,.,', 'bnf.y.rb', 510) 3080 3187 def _reduce_143(val, _values, result) 3081 3188 val[0].set_type( ArrayType.new ) … … 3086 3193 .,., 3087 3194 3088 module_eval(<<'.,.,', 'bnf.y.rb', 51 3)3195 module_eval(<<'.,.,', 'bnf.y.rb', 515) 3089 3196 def _reduce_144(val, _values, result) 3090 3197 val[0].set_type( FuncType.new( val[2] ) ) … … 3095 3202 .,., 3096 3203 3097 module_eval(<<'.,.,', 'bnf.y.rb', 5 19)3204 module_eval(<<'.,.,', 'bnf.y.rb', 521) 3098 3205 def _reduce_145(val, _values, result) 3099 3206 Generator.warning( "W5010 need 'void' for no parameter" ) … … 3105 3212 .,., 3106 3213 3107 module_eval(<<'.,.,', 'bnf.y.rb', 52 6)3214 module_eval(<<'.,.,', 'bnf.y.rb', 528) 3108 3215 def _reduce_146(val, _values, result) 3109 3216 result = PtrType.new … … 3112 3219 .,., 3113 3220 3114 module_eval(<<'.,.,', 'bnf.y.rb', 5 29)3221 module_eval(<<'.,.,', 'bnf.y.rb', 531) 3115 3222 def _reduce_147(val, _values, result) 3116 3223 result = PtrType.new … … 3121 3228 .,., 3122 3229 3123 module_eval(<<'.,.,', 'bnf.y.rb', 53 4)3230 module_eval(<<'.,.,', 'bnf.y.rb', 536) 3124 3231 def _reduce_148(val, _values, result) 3125 3232 val[1].set_type(PtrType.new) … … 3130 3237 .,., 3131 3238 3132 module_eval(<<'.,.,', 'bnf.y.rb', 5 39)3239 module_eval(<<'.,.,', 'bnf.y.rb', 541) 3133 3240 def _reduce_149(val, _values, result) 3134 3241 ptrtype = PtrType.new … … 3145 3252 # reduce 151 omitted 3146 3253 3147 module_eval(<<'.,.,', 'bnf.y.rb', 55 3)3254 module_eval(<<'.,.,', 'bnf.y.rb', 555) 3148 3255 def _reduce_152(val, _values, result) 3149 3256 result = ParamList.new( val[0] ) … … 3152 3259 .,., 3153 3260 3154 module_eval(<<'.,.,', 'bnf.y.rb', 55 6)3261 module_eval(<<'.,.,', 'bnf.y.rb', 558) 3155 3262 def _reduce_153(val, _values, result) 3156 3263 val[0].add_param( val[2] ) … … 3161 3268 .,., 3162 3269 3163 module_eval(<<'.,.,', 'bnf.y.rb', 56 6)3270 module_eval(<<'.,.,', 'bnf.y.rb', 568) 3164 3271 def _reduce_154(val, _values, result) 3165 3272 val[2].set_kind( :PARAMETER ) … … 3172 3279 .,., 3173 3280 3174 module_eval(<<'.,.,', 'bnf.y.rb', 57 5)3281 module_eval(<<'.,.,', 'bnf.y.rb', 577) 3175 3282 def _reduce_155(val, _values, result) 3176 3283 Generator.error( "G1001 need specifier for \'$1\'" , val[1].get_name ) … … 3181 3288 .,., 3182 3289 3183 module_eval(<<'.,.,', 'bnf.y.rb', 58 0)3290 module_eval(<<'.,.,', 'bnf.y.rb', 582) 3184 3291 def _reduce_156(val, _values, result) 3185 3292 unless val[0].instance_of?( VoidType ) then … … 3192 3299 .,., 3193 3300 3194 module_eval(<<'.,.,', 'bnf.y.rb', 5 88)3301 module_eval(<<'.,.,', 'bnf.y.rb', 590) 3195 3302 def _reduce_157(val, _values, result) 3196 3303 unless val[1].instance_of?( VoidType ) then … … 3203 3310 .,., 3204 3311 3205 module_eval(<<'.,.,', 'bnf.y.rb', 59 5)3312 module_eval(<<'.,.,', 'bnf.y.rb', 597) 3206 3313 def _reduce_158(val, _values, result) 3207 3314 result = val[1] … … 3210 3317 .,., 3211 3318 3212 module_eval(<<'.,.,', 'bnf.y.rb', 599)3319 module_eval(<<'.,.,', 'bnf.y.rb', 601) 3213 3320 def _reduce_159(val, _values, result) 3214 3321 result = val[0] … … 3217 3324 .,., 3218 3325 3219 module_eval(<<'.,.,', 'bnf.y.rb', 60 1)3326 module_eval(<<'.,.,', 'bnf.y.rb', 603) 3220 3327 def _reduce_160(val, _values, result) 3221 3328 result = result + val[2] … … 3224 3331 .,., 3225 3332 3226 module_eval(<<'.,.,', 'bnf.y.rb', 60 4)3333 module_eval(<<'.,.,', 'bnf.y.rb', 606) 3227 3334 def _reduce_161(val, _values, result) 3228 3335 result = [ [:IN] ] … … 3231 3338 .,., 3232 3339 3233 module_eval(<<'.,.,', 'bnf.y.rb', 60 5)3340 module_eval(<<'.,.,', 'bnf.y.rb', 607) 3234 3341 def _reduce_162(val, _values, result) 3235 3342 result = [ [:OUT] ] … … 3238 3345 .,., 3239 3346 3240 module_eval(<<'.,.,', 'bnf.y.rb', 60 6)3347 module_eval(<<'.,.,', 'bnf.y.rb', 608) 3241 3348 def _reduce_163(val, _values, result) 3242 3349 result = [ [:INOUT] ] … … 3245 3352 .,., 3246 3353 3247 module_eval(<<'.,.,', 'bnf.y.rb', 60 7)3354 module_eval(<<'.,.,', 'bnf.y.rb', 609) 3248 3355 def _reduce_164(val, _values, result) 3249 3356 result = [ [:SEND, val[2]] ] … … 3252 3359 .,., 3253 3360 3254 module_eval(<<'.,.,', 'bnf.y.rb', 6 08)3361 module_eval(<<'.,.,', 'bnf.y.rb', 610) 3255 3362 def _reduce_165(val, _values, result) 3256 3363 result = [ [:RECEIVE,val[2]] ] … … 3259 3366 .,., 3260 3367 3261 module_eval(<<'.,.,', 'bnf.y.rb', 6 09)3368 module_eval(<<'.,.,', 'bnf.y.rb', 611) 3262 3369 def _reduce_166(val, _values, result) 3263 3370 result = [ [:STRING,nil] ] … … 3266 3373 .,., 3267 3374 3268 module_eval(<<'.,.,', 'bnf.y.rb', 61 0)3375 module_eval(<<'.,.,', 'bnf.y.rb', 612) 3269 3376 def _reduce_167(val, _values, result) 3270 3377 result = [ [:STRING, val[2]] ] … … 3273 3380 .,., 3274 3381 3275 module_eval(<<'.,.,', 'bnf.y.rb', 61 1)3382 module_eval(<<'.,.,', 'bnf.y.rb', 613) 3276 3383 def _reduce_168(val, _values, result) 3277 3384 result = [ [:SIZE_IS, val[2]] ] … … 3280 3387 .,., 3281 3388 3282 module_eval(<<'.,.,', 'bnf.y.rb', 61 4)3389 module_eval(<<'.,.,', 'bnf.y.rb', 616) 3283 3390 def _reduce_169(val, _values, result) 3284 3391 result = [ [:SIZE_IS,val[2]], [:MAX_IS, val[4]] ] … … 3288 3395 .,., 3289 3396 3290 module_eval(<<'.,.,', 'bnf.y.rb', 61 6)3397 module_eval(<<'.,.,', 'bnf.y.rb', 618) 3291 3398 def _reduce_170(val, _values, result) 3292 3399 result = [ [:COUNT_IS,val[2]] ] … … 3295 3402 .,., 3296 3403 3297 module_eval(<<'.,.,', 'bnf.y.rb', 61 7)3404 module_eval(<<'.,.,', 'bnf.y.rb', 619) 3298 3405 def _reduce_171(val, _values, result) 3299 3406 result = [ [:NULLABLE] ] … … 3304 3411 # reduce 172 omitted 3305 3412 3306 module_eval(<<'.,.,', 'bnf.y.rb', 62 3)3413 module_eval(<<'.,.,', 'bnf.y.rb', 625) 3307 3414 def _reduce_173(val, _values, result) 3308 3415 if val[1] then … … 3324 3431 # reduce 176 omitted 3325 3432 3326 module_eval(<<'.,.,', 'bnf.y.rb', 64 0)3433 module_eval(<<'.,.,', 'bnf.y.rb', 642) 3327 3434 def _reduce_177(val, _values, result) 3328 3435 result = val[1] … … 3331 3438 .,., 3332 3439 3333 module_eval(<<'.,.,', 'bnf.y.rb', 64 3)3440 module_eval(<<'.,.,', 'bnf.y.rb', 645) 3334 3441 def _reduce_178(val, _values, result) 3335 3442 Generator.error( "G1004 impossible array type" ) … … 3340 3447 .,., 3341 3448 3342 module_eval(<<'.,.,', 'bnf.y.rb', 6 48)3449 module_eval(<<'.,.,', 'bnf.y.rb', 650) 3343 3450 def _reduce_179(val, _values, result) 3344 3451 Generator.error( "G1005 impossible array type" ) … … 3349 3456 .,., 3350 3457 3351 module_eval(<<'.,.,', 'bnf.y.rb', 65 3)3458 module_eval(<<'.,.,', 'bnf.y.rb', 655) 3352 3459 def _reduce_180(val, _values, result) 3353 3460 Generator.error( "G1006 impossible array type" ) … … 3358 3465 .,., 3359 3466 3360 module_eval(<<'.,.,', 'bnf.y.rb', 6 58)3467 module_eval(<<'.,.,', 'bnf.y.rb', 660) 3361 3468 def _reduce_181(val, _values, result) 3362 3469 Generator.error( "G1007 impossible array type" ) … … 3367 3474 .,., 3368 3475 3369 module_eval(<<'.,.,', 'bnf.y.rb', 66 3)3476 module_eval(<<'.,.,', 'bnf.y.rb', 665) 3370 3477 def _reduce_182(val, _values, result) 3371 3478 Generator.error( "G1008 impossible function type" ) … … 3378 3485 # reduce 183 omitted 3379 3486 3380 module_eval(<<'.,.,', 'bnf.y.rb', 6 69)3487 module_eval(<<'.,.,', 'bnf.y.rb', 671) 3381 3488 def _reduce_184(val, _values, result) 3382 3489 Generator.warning( "W5011 need 'void' for no parameter" ) … … 3388 3495 .,., 3389 3496 3390 module_eval(<<'.,.,', 'bnf.y.rb', 67 5)3497 module_eval(<<'.,.,', 'bnf.y.rb', 677) 3391 3498 def _reduce_185(val, _values, result) 3392 3499 val[0].set_type( FuncType.new( val[2] ) ) … … 3397 3504 .,., 3398 3505 3399 module_eval(<<'.,.,', 'bnf.y.rb', 68 2)3506 module_eval(<<'.,.,', 'bnf.y.rb', 684) 3400 3507 def _reduce_186(val, _values, result) 3401 3508 result = val[0] … … 3404 3511 .,., 3405 3512 3406 module_eval(<<'.,.,', 'bnf.y.rb', 68 4)3513 module_eval(<<'.,.,', 'bnf.y.rb', 686) 3407 3514 def _reduce_187(val, _values, result) 3408 3515 result = val[1] … … 3411 3518 .,., 3412 3519 3413 module_eval(<<'.,.,', 'bnf.y.rb', 68 6)3520 module_eval(<<'.,.,', 'bnf.y.rb', 688) 3414 3521 def _reduce_188(val, _values, result) 3415 3522 result = val[1] … … 3418 3525 .,., 3419 3526 3420 module_eval(<<'.,.,', 'bnf.y.rb', 6 89)3527 module_eval(<<'.,.,', 'bnf.y.rb', 691) 3421 3528 def _reduce_189(val, _values, result) 3422 3529 result = C_EXP.new( val[2] ) … … 3425 3532 .,., 3426 3533 3427 module_eval(<<'.,.,', 'bnf.y.rb', 69 4)3534 module_eval(<<'.,.,', 'bnf.y.rb', 696) 3428 3535 def _reduce_190(val, _values, result) 3429 3536 result = [ val[0] ] … … 3433 3540 .,., 3434 3541 3435 module_eval(<<'.,.,', 'bnf.y.rb', 698)3542 module_eval(<<'.,.,', 'bnf.y.rb', 700) 3436 3543 def _reduce_191(val, _values, result) 3437 3544 val[0] << val[2] … … 3450 3557 # reduce 195 omitted 3451 3558 3452 module_eval(<<'.,.,', 'bnf.y.rb', 716) 3453 def _reduce_196(val, _values, result) 3559 # reduce 196 omitted 3560 3561 module_eval(<<'.,.,', 'bnf.y.rb', 719) 3562 def _reduce_197(val, _values, result) 3454 3563 obj = val[3] 3455 3564 if obj.kind_of?( Cell ) || obj.kind_of?( Signature ) || obj.kind_of?( Celltype ) || obj.kind_of?( CompositeCelltype )then … … 3464 3573 .,., 3465 3574 3466 # reduce 197 omitted3467 3468 3575 # reduce 198 omitted 3469 3576 … … 3492 3599 # reduce 210 omitted 3493 3600 3494 module_eval(<<'.,.,', 'bnf.y.rb', 745) 3495 def _reduce_211(val, _values, result) 3601 # reduce 211 omitted 3602 3603 module_eval(<<'.,.,', 'bnf.y.rb', 748) 3604 def _reduce_212(val, _values, result) 3496 3605 Generator.add_statement_specifier val[0] 3497 3606 result … … 3499 3608 .,., 3500 3609 3501 module_eval(<<'.,.,', 'bnf.y.rb', 7 47)3502 def _reduce_21 2(val, _values, result)3610 module_eval(<<'.,.,', 'bnf.y.rb', 750) 3611 def _reduce_213(val, _values, result) 3503 3612 Generator.add_statement_specifier val[2] 3504 3613 result … … 3506 3615 .,., 3507 3616 3508 module_eval(<<'.,.,', 'bnf.y.rb', 75 1)3509 def _reduce_21 3(val, _values, result)3617 module_eval(<<'.,.,', 'bnf.y.rb', 754) 3618 def _reduce_214(val, _values, result) 3510 3619 result = [ :ALLOCATOR, val[2] ] 3511 3620 result … … 3513 3622 .,., 3514 3623 3515 module_eval(<<'.,.,', 'bnf.y.rb', 75 3)3516 def _reduce_21 4(val, _values, result)3624 module_eval(<<'.,.,', 'bnf.y.rb', 756) 3625 def _reduce_215(val, _values, result) 3517 3626 result = [ :CALLBACK ] 3518 3627 result … … 3520 3629 .,., 3521 3630 3522 module_eval(<<'.,.,', 'bnf.y.rb', 75 5)3523 def _reduce_21 5(val, _values, result)3631 module_eval(<<'.,.,', 'bnf.y.rb', 758) 3632 def _reduce_216(val, _values, result) 3524 3633 result = [ :CONTEXT, val[2].val ] 3525 3634 result … … 3527 3636 .,., 3528 3637 3529 module_eval(<<'.,.,', 'bnf.y.rb', 7 57)3530 def _reduce_21 6(val, _values, result)3638 module_eval(<<'.,.,', 'bnf.y.rb', 760) 3639 def _reduce_217(val, _values, result) 3531 3640 result = [ :DEVIATE ] 3532 3641 result … … 3534 3643 .,., 3535 3644 3536 module_eval(<<'.,.,', 'bnf.y.rb', 7 59)3537 def _reduce_21 7(val, _values, result)3645 module_eval(<<'.,.,', 'bnf.y.rb', 762) 3646 def _reduce_218(val, _values, result) 3538 3647 result = [ :ID, val[2] ] 3539 3648 result … … 3541 3650 .,., 3542 3651 3543 module_eval(<<'.,.,', 'bnf.y.rb', 76 1)3544 def _reduce_21 8(val, _values, result)3652 module_eval(<<'.,.,', 'bnf.y.rb', 764) 3653 def _reduce_219(val, _values, result) 3545 3654 result = [ :PROTOTYPE ] 3546 3655 result … … 3548 3657 .,., 3549 3658 3550 module_eval(<<'.,.,', 'bnf.y.rb', 76 3)3551 def _reduce_2 19(val, _values, result)3659 module_eval(<<'.,.,', 'bnf.y.rb', 766) 3660 def _reduce_220(val, _values, result) 3552 3661 result = [ :RESTRICT, val[2] ] 3553 3662 result … … 3555 3664 .,., 3556 3665 3557 module_eval(<<'.,.,', 'bnf.y.rb', 76 4)3558 def _reduce_22 0(val, _values, result)3666 module_eval(<<'.,.,', 'bnf.y.rb', 767) 3667 def _reduce_221(val, _values, result) 3559 3668 result = [:SINGLETON] 3560 3669 result … … 3562 3671 .,., 3563 3672 3564 module_eval(<<'.,.,', 'bnf.y.rb', 76 5)3565 def _reduce_22 1(val, _values, result)3673 module_eval(<<'.,.,', 'bnf.y.rb', 768) 3674 def _reduce_222(val, _values, result) 3566 3675 result = [:IDX_IS_ID] 3567 3676 result … … 3569 3678 .,., 3570 3679 3571 module_eval(<<'.,.,', 'bnf.y.rb', 76 6)3572 def _reduce_22 2(val, _values, result)3680 module_eval(<<'.,.,', 'bnf.y.rb', 769) 3681 def _reduce_223(val, _values, result) 3573 3682 result = [:ACTIVE] 3574 result3575 end3576 .,.,3577 3578 module_eval(<<'.,.,', 'bnf.y.rb', 768)3579 def _reduce_223(val, _values, result)3580 result = [:GENERATE, val[2].val, val[4].val]3581 3683 result 3582 3684 end … … 3585 3687 module_eval(<<'.,.,', 'bnf.y.rb', 771) 3586 3688 def _reduce_224(val, _values, result) 3689 result = [:GENERATE, val[2].val, val[4].val] 3690 result 3691 end 3692 .,., 3693 3694 module_eval(<<'.,.,', 'bnf.y.rb', 774) 3695 def _reduce_225(val, _values, result) 3587 3696 result = [ val[0] ] 3588 3697 result … … 3590 3699 .,., 3591 3700 3592 module_eval(<<'.,.,', 'bnf.y.rb', 77 2)3593 def _reduce_22 5(val, _values, result)3701 module_eval(<<'.,.,', 'bnf.y.rb', 775) 3702 def _reduce_226(val, _values, result) 3594 3703 result << val[2] 3595 3704 result … … 3597 3706 .,., 3598 3707 3599 module_eval(<<'.,.,', 'bnf.y.rb', 77 6)3600 def _reduce_22 6(val, _values, result)3708 module_eval(<<'.,.,', 'bnf.y.rb', 779) 3709 def _reduce_227(val, _values, result) 3601 3710 result = [ :NORMAL_ALLOC, val[0], nil, val[2], val[4], val[6] ] 3602 3711 result … … 3604 3713 .,., 3605 3714 3606 module_eval(<<'.,.,', 'bnf.y.rb', 7 78)3607 def _reduce_22 7(val, _values, result)3715 module_eval(<<'.,.,', 'bnf.y.rb', 781) 3716 def _reduce_228(val, _values, result) 3608 3717 result = [ :NORMAL_ALLOC, val[0], val[2], val[5], val[7], val[9] ] 3609 3718 result … … 3611 3720 .,., 3612 3721 3613 module_eval(<<'.,.,', 'bnf.y.rb', 7 87)3614 def _reduce_22 8(val, _values, result)3722 module_eval(<<'.,.,', 'bnf.y.rb', 790) 3723 def _reduce_229(val, _values, result) 3615 3724 result = [val[0]] 3616 3725 result … … 3618 3727 .,., 3619 3728 3620 module_eval(<<'.,.,', 'bnf.y.rb', 7 89)3621 def _reduce_2 29(val, _values, result)3729 module_eval(<<'.,.,', 'bnf.y.rb', 792) 3730 def _reduce_230(val, _values, result) 3622 3731 result << val[2] 3623 3732 result … … 3625 3734 .,., 3626 3735 3627 module_eval(<<'.,.,', 'bnf.y.rb', 79 3)3628 def _reduce_23 0(val, _values, result)3736 module_eval(<<'.,.,', 'bnf.y.rb', 796) 3737 def _reduce_231(val, _values, result) 3629 3738 result = [ val[0].val, nil, val[3] ] 3630 3739 result … … 3632 3741 .,., 3633 3742 3634 module_eval(<<'.,.,', 'bnf.y.rb', 79 5)3635 def _reduce_23 1(val, _values, result)3743 module_eval(<<'.,.,', 'bnf.y.rb', 798) 3744 def _reduce_232(val, _values, result) 3636 3745 result = [ val[0].val, val[2].val, val[5] ] 3637 3746 result … … 3639 3748 .,., 3640 3749 3641 module_eval(<<'.,.,', 'bnf.y.rb', 799) 3642 def _reduce_232(val, _values, result) 3643 result = [val[0].val] 3644 result 3645 end 3646 .,., 3647 3648 module_eval(<<'.,.,', 'bnf.y.rb', 801) 3750 module_eval(<<'.,.,', 'bnf.y.rb', 802) 3649 3751 def _reduce_233(val, _values, result) 3650 result << val[2].val3651 result 3652 end 3653 .,., 3654 3655 module_eval(<<'.,.,', 'bnf.y.rb', 80 6)3752 result = [val[0]] 3753 result 3754 end 3755 .,., 3756 3757 module_eval(<<'.,.,', 'bnf.y.rb', 804) 3656 3758 def _reduce_234(val, _values, result) 3759 result << val[2] 3760 result 3761 end 3762 .,., 3763 3764 module_eval(<<'.,.,', 'bnf.y.rb', 809) 3765 def _reduce_235(val, _values, result) 3657 3766 val[0].each { |decl| 3658 3767 decl.set_kind( :CONSTANT ) … … 3665 3774 .,., 3666 3775 3667 module_eval(<<'.,.,', 'bnf.y.rb', 81 6)3668 def _reduce_23 5(val, _values, result)3776 module_eval(<<'.,.,', 'bnf.y.rb', 819) 3777 def _reduce_236(val, _values, result) 3669 3778 @@import_C = true 3670 3779 Import_C.new( val[2] ) … … 3675 3784 .,., 3676 3785 3677 module_eval(<<'.,.,', 'bnf.y.rb', 82 2)3678 def _reduce_23 6(val, _values, result)3786 module_eval(<<'.,.,', 'bnf.y.rb', 825) 3787 def _reduce_237(val, _values, result) 3679 3788 @@import_C = true 3680 3789 Import_C.new( val[2], val[4] ) … … 3685 3794 .,., 3686 3795 3687 module_eval(<<'.,.,', 'bnf.y.rb', 8 29)3688 def _reduce_23 7(val, _values, result)3796 module_eval(<<'.,.,', 'bnf.y.rb', 832) 3797 def _reduce_238(val, _values, result) 3689 3798 Import.new( val[2] ) 3690 3799 result … … 3692 3801 .,., 3693 3802 3694 module_eval(<<'.,.,', 'bnf.y.rb', 83 1)3695 def _reduce_23 8(val, _values, result)3803 module_eval(<<'.,.,', 'bnf.y.rb', 834) 3804 def _reduce_239(val, _values, result) 3696 3805 Import.new( val[2], true ) 3697 3806 result … … 3699 3808 .,., 3700 3809 3701 module_eval(<<'.,.,', 'bnf.y.rb', 83 6)3702 def _reduce_2 39(val, _values, result)3810 module_eval(<<'.,.,', 'bnf.y.rb', 839) 3811 def _reduce_240(val, _values, result) 3703 3812 Generate.new( val[2].val, val[4], val[6] ) 3704 3813 result … … 3706 3815 .,., 3707 3816 3708 module_eval(<<'.,.,', 'bnf.y.rb', 84 1)3709 def _reduce_24 0(val, _values, result)3817 module_eval(<<'.,.,', 'bnf.y.rb', 844) 3818 def _reduce_241(val, _values, result) 3710 3819 val[2].each{ |i| # i:Decl 3711 3820 i.set_kind( :TYPEDEF ) … … 3720 3829 .,., 3721 3830 3722 module_eval(<<'.,.,', 'bnf.y.rb', 85 1)3723 def _reduce_24 1(val, _values, result)3831 module_eval(<<'.,.,', 'bnf.y.rb', 854) 3832 def _reduce_242(val, _values, result) 3724 3833 val[5].each{ |i| # i:Decl 3725 3834 i.set_kind( :TYPEDEF ) … … 3734 3843 .,., 3735 3844 3736 # reduce 242 omitted3737 3738 3845 # reduce 243 omitted 3739 3846 3740 module_eval(<<'.,.,', 'bnf.y.rb', 868) 3741 def _reduce_244(val, _values, result) 3847 # reduce 244 omitted 3848 3849 module_eval(<<'.,.,', 'bnf.y.rb', 871) 3850 def _reduce_245(val, _values, result) 3742 3851 result = [ val[0] ] 3743 3852 result … … 3745 3854 .,., 3746 3855 3747 module_eval(<<'.,.,', 'bnf.y.rb', 87 0)3748 def _reduce_24 5(val, _values, result)3856 module_eval(<<'.,.,', 'bnf.y.rb', 873) 3857 def _reduce_246(val, _values, result) 3749 3858 result << val[2] 3750 3859 result … … 3752 3861 .,., 3753 3862 3754 module_eval(<<'.,.,', 'bnf.y.rb', 87 4)3755 def _reduce_24 6(val, _values, result)3863 module_eval(<<'.,.,', 'bnf.y.rb', 877) 3864 def _reduce_247(val, _values, result) 3756 3865 val[1].end_of_parse 3757 3866 result … … 3759 3868 .,., 3760 3869 3761 module_eval(<<'.,.,', 'bnf.y.rb', 8 78)3762 def _reduce_24 7(val, _values, result)3870 module_eval(<<'.,.,', 'bnf.y.rb', 881) 3871 def _reduce_248(val, _values, result) 3763 3872 result = Namespace.new(val[0].val) 3764 3873 result … … 3766 3875 .,., 3767 3876 3768 # reduce 248 omitted3769 3770 3877 # reduce 249 omitted 3771 3878 3772 module_eval(<<'.,.,', 'bnf.y.rb', 886) 3773 def _reduce_250(val, _values, result) 3879 # reduce 250 omitted 3880 3881 module_eval(<<'.,.,', 'bnf.y.rb', 889) 3882 def _reduce_251(val, _values, result) 3774 3883 result = NamespacePath.new( val[0].val, false ) 3775 3884 result … … 3777 3886 .,., 3778 3887 3779 module_eval(<<'.,.,', 'bnf.y.rb', 8 87)3780 def _reduce_25 1(val, _values, result)3888 module_eval(<<'.,.,', 'bnf.y.rb', 890) 3889 def _reduce_252(val, _values, result) 3781 3890 result = NamespacePath.new( val[1].val, true ) 3782 3891 result … … 3784 3893 .,., 3785 3894 3786 module_eval(<<'.,.,', 'bnf.y.rb', 8 89)3787 def _reduce_25 2(val, _values, result)3895 module_eval(<<'.,.,', 'bnf.y.rb', 892) 3896 def _reduce_253(val, _values, result) 3788 3897 result = val[0].append!( val[2].val ) 3789 3898 result … … 3791 3900 .,., 3792 3901 3793 module_eval(<<'.,.,', 'bnf.y.rb', 89 4)3794 def _reduce_25 3(val, _values, result)3902 module_eval(<<'.,.,', 'bnf.y.rb', 897) 3903 def _reduce_254(val, _values, result) 3795 3904 result = val[1].end_of_parse( val[3] ) 3796 3905 result … … 3798 3907 .,., 3799 3908 3800 module_eval(<<'.,.,', 'bnf.y.rb', 898)3801 def _reduce_25 4(val, _values, result)3909 module_eval(<<'.,.,', 'bnf.y.rb', 901) 3910 def _reduce_255(val, _values, result) 3802 3911 result = Signature.new( val[0].val ) 3803 3912 result … … 3805 3914 .,., 3806 3915 3807 module_eval(<<'.,.,', 'bnf.y.rb', 90 4)3808 def _reduce_25 5(val, _values, result)3916 module_eval(<<'.,.,', 'bnf.y.rb', 907) 3917 def _reduce_256(val, _values, result) 3809 3918 result = NamedList.new( nil, "function" ) 3810 3919 result … … 3812 3921 .,., 3813 3922 3814 module_eval(<<'.,.,', 'bnf.y.rb', 90 6)3815 def _reduce_25 6(val, _values, result)3923 module_eval(<<'.,.,', 'bnf.y.rb', 909) 3924 def _reduce_257(val, _values, result) 3816 3925 result = val[0].add_item( val[1] ) 3817 3926 result … … 3819 3928 .,., 3820 3929 3821 module_eval(<<'.,.,', 'bnf.y.rb', 91 1)3822 def _reduce_25 7(val, _values, result)3930 module_eval(<<'.,.,', 'bnf.y.rb', 914) 3931 def _reduce_258(val, _values, result) 3823 3932 # val[1]: Decl 3824 3933 if val[1].is_function? then … … 3836 3945 .,., 3837 3946 3838 module_eval(<<'.,.,', 'bnf.y.rb', 92 4)3839 def _reduce_25 8(val, _values, result)3947 module_eval(<<'.,.,', 'bnf.y.rb', 927) 3948 def _reduce_259(val, _values, result) 3840 3949 if val[4].is_function? then 3841 3950 result = FuncHead.new( val[4], val[3], true ) … … 3849 3958 .,., 3850 3959 3851 module_eval(<<'.,.,', 'bnf.y.rb', 9 37)3852 def _reduce_2 59(val, _values, result)3960 module_eval(<<'.,.,', 'bnf.y.rb', 940) 3961 def _reduce_260(val, _values, result) 3853 3962 val[1].end_of_parse 3854 3963 result = val[1] … … 3858 3967 .,., 3859 3968 3860 module_eval(<<'.,.,', 'bnf.y.rb', 94 3)3861 def _reduce_26 0(val, _values, result)3969 module_eval(<<'.,.,', 'bnf.y.rb', 946) 3970 def _reduce_261(val, _values, result) 3862 3971 result = Celltype.new(val[0].val) 3863 3972 result … … 3865 3974 .,., 3866 3975 3867 # reduce 261 omitted3868 3869 3976 # reduce 262 omitted 3870 3977 3871 module_eval(<<'.,.,', 'bnf.y.rb', 952) 3872 def _reduce_263(val, _values, result) 3978 # reduce 263 omitted 3979 3980 module_eval(<<'.,.,', 'bnf.y.rb', 955) 3981 def _reduce_264(val, _values, result) 3873 3982 if val[0].kind_of? Port then 3874 3983 Celltype.new_port( val[0] ) … … 3879 3988 .,., 3880 3989 3881 module_eval(<<'.,.,', 'bnf.y.rb', 9 58)3882 def _reduce_26 4(val, _values, result)3990 module_eval(<<'.,.,', 'bnf.y.rb', 961) 3991 def _reduce_265(val, _values, result) 3883 3992 if val[3].kind_of? Port then 3884 3993 val[3].set_specifier val[1] # 設定順序あり … … 3893 4002 .,., 3894 4003 3895 # reduce 265 omitted3896 3897 4004 # reduce 266 omitted 3898 4005 … … 3903 4010 # reduce 269 omitted 3904 4011 3905 module_eval(<<'.,.,', 'bnf.y.rb', 977) 3906 def _reduce_270(val, _values, result) 4012 # reduce 270 omitted 4013 4014 module_eval(<<'.,.,', 'bnf.y.rb', 980) 4015 def _reduce_271(val, _values, result) 3907 4016 result = [ val[0] ] 3908 result3909 end3910 .,.,3911 3912 module_eval(<<'.,.,', 'bnf.y.rb', 979)3913 def _reduce_271(val, _values, result)3914 result << val[2]3915 4017 result 3916 4018 end … … 3919 4021 module_eval(<<'.,.,', 'bnf.y.rb', 982) 3920 4022 def _reduce_272(val, _values, result) 4023 result << val[2] 4024 result 4025 end 4026 .,., 4027 4028 module_eval(<<'.,.,', 'bnf.y.rb', 985) 4029 def _reduce_273(val, _values, result) 3921 4030 result = [ :INLINE ] 3922 4031 result … … 3924 4033 .,., 3925 4034 3926 module_eval(<<'.,.,', 'bnf.y.rb', 98 3)3927 def _reduce_27 3(val, _values, result)4035 module_eval(<<'.,.,', 'bnf.y.rb', 986) 4036 def _reduce_274(val, _values, result) 3928 4037 result = [ :ALLOCATOR, val[2] ] 3929 4038 result … … 3931 4040 .,., 3932 4041 3933 module_eval(<<'.,.,', 'bnf.y.rb', 98 4)3934 def _reduce_27 4(val, _values, result)4042 module_eval(<<'.,.,', 'bnf.y.rb', 987) 4043 def _reduce_275(val, _values, result) 3935 4044 result = [ :OPTIONAL ] 3936 4045 result … … 3938 4047 .,., 3939 4048 3940 module_eval(<<'.,.,', 'bnf.y.rb', 98 5)3941 def _reduce_27 5(val, _values, result)4049 module_eval(<<'.,.,', 'bnf.y.rb', 988) 4050 def _reduce_276(val, _values, result) 3942 4051 result = [ :REF_DESC ] 3943 4052 result … … 3945 4054 .,., 3946 4055 3947 module_eval(<<'.,.,', 'bnf.y.rb', 98 6)3948 def _reduce_27 6(val, _values, result)4056 module_eval(<<'.,.,', 'bnf.y.rb', 989) 4057 def _reduce_277(val, _values, result) 3949 4058 result = [ :DYNAMIC ] 3950 result3951 end3952 .,.,3953 3954 module_eval(<<'.,.,', 'bnf.y.rb', 987)3955 def _reduce_277(val, _values, result)3956 result = [ :OMIT ]3957 4059 result 3958 4060 end … … 3961 4063 module_eval(<<'.,.,', 'bnf.y.rb', 990) 3962 4064 def _reduce_278(val, _values, result) 3963 result = [ val[0]]3964 result 3965 end 3966 .,., 3967 3968 module_eval(<<'.,.,', 'bnf.y.rb', 99 1)4065 result = [ :OMIT ] 4066 result 4067 end 4068 .,., 4069 4070 module_eval(<<'.,.,', 'bnf.y.rb', 993) 3969 4071 def _reduce_279(val, _values, result) 3970 4072 result = [ val[0] ] … … 3973 4075 .,., 3974 4076 3975 module_eval(<<'.,.,', 'bnf.y.rb', 99 2)4077 module_eval(<<'.,.,', 'bnf.y.rb', 994) 3976 4078 def _reduce_280(val, _values, result) 3977 result << val[2]3978 result 3979 end 3980 .,., 3981 3982 module_eval(<<'.,.,', 'bnf.y.rb', 99 3)4079 result = [ val[0] ] 4080 result 4081 end 4082 .,., 4083 4084 module_eval(<<'.,.,', 'bnf.y.rb', 995) 3983 4085 def _reduce_281(val, _values, result) 3984 4086 result << val[2] … … 3987 4089 .,., 3988 4090 3989 module_eval(<<'.,.,', 'bnf.y.rb', 99 7)4091 module_eval(<<'.,.,', 'bnf.y.rb', 996) 3990 4092 def _reduce_282(val, _values, result) 4093 result << val[2] 4094 result 4095 end 4096 .,., 4097 4098 module_eval(<<'.,.,', 'bnf.y.rb', 1000) 4099 def _reduce_283(val, _values, result) 3991 4100 result = [ :INTERNAL_ALLOC, val[0].val, val[2].val, val[4] ] 3992 4101 result … … 3994 4103 .,., 3995 4104 3996 module_eval(<<'.,.,', 'bnf.y.rb', 999)3997 def _reduce_28 3(val, _values, result)4105 module_eval(<<'.,.,', 'bnf.y.rb', 1002) 4106 def _reduce_284(val, _values, result) 3998 4107 result = [ :RELAY_ALLOC, val[0].val, val[2].val, val[4] ] 3999 4108 result … … 4001 4110 .,., 4002 4111 4003 module_eval(<<'.,.,', 'bnf.y.rb', 100 5)4004 def _reduce_28 4(val, _values, result)4112 module_eval(<<'.,.,', 'bnf.y.rb', 1008) 4113 def _reduce_285(val, _values, result) 4005 4114 result = Port.new( val[2].val, val[1], val[0] ) 4006 4115 result … … 4008 4117 .,., 4009 4118 4010 module_eval(<<'.,.,', 'bnf.y.rb', 10 07)4011 def _reduce_28 5(val, _values, result)4119 module_eval(<<'.,.,', 'bnf.y.rb', 1010) 4120 def _reduce_286(val, _values, result) 4012 4121 result = Port.new( val[2].val, val[1], val[0], "[]" ) 4013 4122 result … … 4015 4124 .,., 4016 4125 4017 module_eval(<<'.,.,', 'bnf.y.rb', 10 09)4018 def _reduce_28 6(val, _values, result)4126 module_eval(<<'.,.,', 'bnf.y.rb', 1012) 4127 def _reduce_287(val, _values, result) 4019 4128 result = Port.new(val[2].val, val[1], val[0], val[4]) 4020 result4021 end4022 .,.,4023 4024 module_eval(<<'.,.,', 'bnf.y.rb', 1011)4025 def _reduce_287(val, _values, result)4026 result = Port.new( val[2].val, val[1], val[0], nil, val[4], val[ 6 ].val )4027 4129 result 4028 4130 end … … 4031 4133 module_eval(<<'.,.,', 'bnf.y.rb', 1014) 4032 4134 def _reduce_288(val, _values, result) 4135 result = Port.new( val[2].val, val[1], val[0], nil, val[4], val[ 6 ].val ) 4136 result 4137 end 4138 .,., 4139 4140 module_eval(<<'.,.,', 'bnf.y.rb', 1017) 4141 def _reduce_289(val, _values, result) 4033 4142 result = :CALL 4034 4143 result … … 4036 4145 .,., 4037 4146 4038 module_eval(<<'.,.,', 'bnf.y.rb', 101 5)4039 def _reduce_2 89(val, _values, result)4147 module_eval(<<'.,.,', 'bnf.y.rb', 1018) 4148 def _reduce_290(val, _values, result) 4040 4149 result = :ENTRY 4041 4150 result … … 4043 4152 .,., 4044 4153 4045 module_eval(<<'.,.,', 'bnf.y.rb', 10 19)4046 def _reduce_29 0(val, _values, result)4154 module_eval(<<'.,.,', 'bnf.y.rb', 1022) 4155 def _reduce_291(val, _values, result) 4047 4156 result = val[0] 4048 4157 result … … 4050 4159 .,., 4051 4160 4052 # reduce 291 omitted4053 4054 4161 # reduce 292 omitted 4055 4162 4056 module_eval(<<'.,.,', 'bnf.y.rb', 1031) 4057 def _reduce_293(val, _values, result) 4163 # reduce 293 omitted 4164 4165 module_eval(<<'.,.,', 'bnf.y.rb', 1034) 4166 def _reduce_294(val, _values, result) 4058 4167 result = nil 4059 4168 result … … 4061 4170 .,., 4062 4171 4063 module_eval(<<'.,.,', 'bnf.y.rb', 103 5)4064 def _reduce_29 4(val, _values, result)4172 module_eval(<<'.,.,', 'bnf.y.rb', 1038) 4173 def _reduce_295(val, _values, result) 4065 4174 Celltype.new_attribute( val[0] ) 4066 4175 result … … 4068 4177 .,., 4069 4178 4070 module_eval(<<'.,.,', 'bnf.y.rb', 10 37)4071 def _reduce_29 5(val, _values, result)4179 module_eval(<<'.,.,', 'bnf.y.rb', 1040) 4180 def _reduce_296(val, _values, result) 4072 4181 Celltype.new_attribute( val[1] ) 4073 4182 result … … 4075 4184 .,., 4076 4185 4077 module_eval(<<'.,.,', 'bnf.y.rb', 104 3)4078 def _reduce_29 6(val, _values, result)4186 module_eval(<<'.,.,', 'bnf.y.rb', 1046) 4187 def _reduce_297(val, _values, result) 4079 4188 val[0].each{ |i| # i:Decl 4080 4189 i.set_kind( :ATTRIBUTE ) … … 4087 4196 .,., 4088 4197 4089 module_eval(<<'.,.,', 'bnf.y.rb', 105 1)4090 def _reduce_29 7(val, _values, result)4198 module_eval(<<'.,.,', 'bnf.y.rb', 1054) 4199 def _reduce_298(val, _values, result) 4091 4200 val[3].each{ |i| # i:Decl 4092 4201 i.set_kind( :ATTRIBUTE ) # 設定順序あり … … 4100 4209 .,., 4101 4210 4102 module_eval(<<'.,.,', 'bnf.y.rb', 106 0)4103 def _reduce_29 8(val, _values, result)4211 module_eval(<<'.,.,', 'bnf.y.rb', 1063) 4212 def _reduce_299(val, _values, result) 4104 4213 result = [:OMIT] 4105 4214 result … … 4107 4216 .,., 4108 4217 4109 module_eval(<<'.,.,', 'bnf.y.rb', 106 1)4110 def _reduce_ 299(val, _values, result)4218 module_eval(<<'.,.,', 'bnf.y.rb', 1064) 4219 def _reduce_300(val, _values, result) 4111 4220 result = [:SIZE_IS,val[2]] 4112 result4113 end4114 .,.,4115 4116 module_eval(<<'.,.,', 'bnf.y.rb', 1062)4117 def _reduce_300(val, _values, result)4118 result = [:CHOICE,val[3]]4119 4221 result 4120 4222 end … … 4123 4225 module_eval(<<'.,.,', 'bnf.y.rb', 1065) 4124 4226 def _reduce_301(val, _values, result) 4227 result = [:CHOICE,val[3]] 4228 result 4229 end 4230 .,., 4231 4232 module_eval(<<'.,.,', 'bnf.y.rb', 1068) 4233 def _reduce_302(val, _values, result) 4125 4234 result << val[2] 4126 4235 result … … 4128 4237 .,., 4129 4238 4130 module_eval(<<'.,.,', 'bnf.y.rb', 106 6)4131 def _reduce_30 2(val, _values, result)4239 module_eval(<<'.,.,', 'bnf.y.rb', 1069) 4240 def _reduce_303(val, _values, result) 4132 4241 result = [ val[0] ] 4133 4242 result … … 4135 4244 .,., 4136 4245 4137 # reduce 30 3omitted4138 4139 module_eval(<<'.,.,', 'bnf.y.rb', 107 4)4140 def _reduce_30 4(val, _values, result)4246 # reduce 304 omitted 4247 4248 module_eval(<<'.,.,', 'bnf.y.rb', 1077) 4249 def _reduce_305(val, _values, result) 4141 4250 result = nil 4142 4251 result … … 4144 4253 .,., 4145 4254 4146 module_eval(<<'.,.,', 'bnf.y.rb', 10 78)4147 def _reduce_30 5(val, _values, result)4255 module_eval(<<'.,.,', 'bnf.y.rb', 1081) 4256 def _reduce_306(val, _values, result) 4148 4257 Celltype.new_var( val[0] ) 4149 4258 result … … 4151 4260 .,., 4152 4261 4153 module_eval(<<'.,.,', 'bnf.y.rb', 108 0)4154 def _reduce_30 6(val, _values, result)4262 module_eval(<<'.,.,', 'bnf.y.rb', 1083) 4263 def _reduce_307(val, _values, result) 4155 4264 Celltype.new_var( val[1] ) 4156 4265 result … … 4158 4267 .,., 4159 4268 4160 module_eval(<<'.,.,', 'bnf.y.rb', 108 5)4161 def _reduce_30 7(val, _values, result)4269 module_eval(<<'.,.,', 'bnf.y.rb', 1088) 4270 def _reduce_308(val, _values, result) 4162 4271 val[0].each{ |i| # i:Decl 4163 4272 i.set_kind( :VAR ) … … 4169 4278 .,., 4170 4279 4171 module_eval(<<'.,.,', 'bnf.y.rb', 109 2)4172 def _reduce_30 8(val, _values, result)4280 module_eval(<<'.,.,', 'bnf.y.rb', 1095) 4281 def _reduce_309(val, _values, result) 4173 4282 val[3].each{ |i| # i:Decl 4174 4283 i.set_kind( :VAR ) # 設定順序あり … … 4182 4291 .,., 4183 4292 4184 module_eval(<<'.,.,', 'bnf.y.rb', 110 1)4185 def _reduce_3 09(val, _values, result)4293 module_eval(<<'.,.,', 'bnf.y.rb', 1104) 4294 def _reduce_310(val, _values, result) 4186 4295 result = [:SIZE_IS,val[2]] 4187 4296 result … … 4189 4298 .,., 4190 4299 4191 module_eval(<<'.,.,', 'bnf.y.rb', 11 07)4192 def _reduce_31 0(val, _values, result)4300 module_eval(<<'.,.,', 'bnf.y.rb', 1110) 4301 def _reduce_311(val, _values, result) 4193 4302 Celltype.new_require( val[1], val[3] ) 4194 4303 … … 4197 4306 .,., 4198 4307 4199 module_eval(<<'.,.,', 'bnf.y.rb', 111 1)4200 def _reduce_31 1(val, _values, result)4308 module_eval(<<'.,.,', 'bnf.y.rb', 1114) 4309 def _reduce_312(val, _values, result) 4201 4310 Celltype.new_require( val[3], val[5], val[1].val ) 4202 4311 … … 4205 4314 .,., 4206 4315 4207 # reduce 31 2omitted4208 4209 module_eval(<<'.,.,', 'bnf.y.rb', 11 19)4210 def _reduce_31 3(val, _values, result)4316 # reduce 313 omitted 4317 4318 module_eval(<<'.,.,', 'bnf.y.rb', 1122) 4319 def _reduce_314(val, _values, result) 4211 4320 Factory.set_f_celltype( false ) 4212 4321 result … … 4214 4323 .,., 4215 4324 4216 module_eval(<<'.,.,', 'bnf.y.rb', 112 0)4217 def _reduce_31 4(val, _values, result)4325 module_eval(<<'.,.,', 'bnf.y.rb', 1123) 4326 def _reduce_315(val, _values, result) 4218 4327 Factory.set_f_celltype( true ) 4219 4328 result … … 4221 4330 .,., 4222 4331 4223 # reduce 315 omitted4224 4225 4332 # reduce 316 omitted 4226 4333 4227 module_eval(<<'.,.,', 'bnf.y.rb', 1128) 4228 def _reduce_317(val, _values, result) 4334 # reduce 317 omitted 4335 4336 module_eval(<<'.,.,', 'bnf.y.rb', 1131) 4337 def _reduce_318(val, _values, result) 4229 4338 Factory.new( val[0].val, val[2], val[4], nil ) 4230 4339 result … … 4232 4341 .,., 4233 4342 4234 module_eval(<<'.,.,', 'bnf.y.rb', 113 0)4235 def _reduce_31 8(val, _values, result)4343 module_eval(<<'.,.,', 'bnf.y.rb', 1133) 4344 def _reduce_319(val, _values, result) 4236 4345 Factory.new( val[0].val, val[2], val[4], val[6] ) 4237 4346 result … … 4239 4348 .,., 4240 4349 4241 # reduce 3 19omitted4242 4243 module_eval(<<'.,.,', 'bnf.y.rb', 11 37)4244 def _reduce_32 0(val, _values, result)4350 # reduce 320 omitted 4351 4352 module_eval(<<'.,.,', 'bnf.y.rb', 1140) 4353 def _reduce_321(val, _values, result) 4245 4354 result = [ [ :IDENTIFIER, val[0].val ] ] 4246 4355 result … … 4248 4357 .,., 4249 4358 4250 module_eval(<<'.,.,', 'bnf.y.rb', 11 39)4251 def _reduce_32 1(val, _values, result)4359 module_eval(<<'.,.,', 'bnf.y.rb', 1142) 4360 def _reduce_322(val, _values, result) 4252 4361 result << [ :IDENTIFIER, val[2].val ] 4253 4362 result … … 4255 4364 .,., 4256 4365 4257 module_eval(<<'.,.,', 'bnf.y.rb', 114 1)4258 def _reduce_32 2(val, _values, result)4366 module_eval(<<'.,.,', 'bnf.y.rb', 1144) 4367 def _reduce_323(val, _values, result) 4259 4368 result = [ [ :STRING_LITERAL, val[0].val ] ] 4260 4369 result … … 4262 4371 .,., 4263 4372 4264 module_eval(<<'.,.,', 'bnf.y.rb', 114 3)4265 def _reduce_32 3(val, _values, result)4373 module_eval(<<'.,.,', 'bnf.y.rb', 1146) 4374 def _reduce_324(val, _values, result) 4266 4375 result << [ :STRING_LITERAL, val[2].val ] 4267 4376 result … … 4269 4378 .,., 4270 4379 4271 module_eval(<<'.,.,', 'bnf.y.rb', 11 48)4272 def _reduce_32 4(val, _values, result)4380 module_eval(<<'.,.,', 'bnf.y.rb', 1151) 4381 def _reduce_325(val, _values, result) 4273 4382 Cell.new_def 4274 4383 result … … 4276 4385 .,., 4277 4386 4278 module_eval(<<'.,.,', 'bnf.y.rb', 115 0)4279 def _reduce_32 5(val, _values, result)4387 module_eval(<<'.,.,', 'bnf.y.rb', 1153) 4388 def _reduce_326(val, _values, result) 4280 4389 result = Cell.end_of_parse true 4281 4390 result … … 4283 4392 .,., 4284 4393 4285 module_eval(<<'.,.,', 'bnf.y.rb', 115 2)4286 def _reduce_32 6(val, _values, result)4394 module_eval(<<'.,.,', 'bnf.y.rb', 1155) 4395 def _reduce_327(val, _values, result) 4287 4396 result = Cell.end_of_parse false 4288 4397 result … … 4290 4399 .,., 4291 4400 4292 module_eval(<<'.,.,', 'bnf.y.rb', 115 6)4293 def _reduce_32 7(val, _values, result)4401 module_eval(<<'.,.,', 'bnf.y.rb', 1159) 4402 def _reduce_328(val, _values, result) 4294 4403 result = Cell.new(val[0]) 4295 4404 result … … 4297 4406 .,., 4298 4407 4299 module_eval(<<'.,.,', 'bnf.y.rb', 116 0)4300 def _reduce_32 8(val, _values, result)4408 module_eval(<<'.,.,', 'bnf.y.rb', 1163) 4409 def _reduce_329(val, _values, result) 4301 4410 result = Cell.set_name(val[0].val) 4302 4411 result … … 4304 4413 .,., 4305 4414 4306 # reduce 329 omitted4307 4308 4415 # reduce 330 omitted 4309 4416 4310 4417 # reduce 331 omitted 4311 4418 4312 module_eval(<<'.,.,', 'bnf.y.rb', 1169) 4313 def _reduce_332(val, _values, result) 4419 # reduce 332 omitted 4420 4421 module_eval(<<'.,.,', 'bnf.y.rb', 1172) 4422 def _reduce_333(val, _values, result) 4314 4423 val[3].set_specifier_list( val[1] ) 4315 4424 result … … 4317 4426 .,., 4318 4427 4319 module_eval(<<'.,.,', 'bnf.y.rb', 117 1)4320 def _reduce_33 3(val, _values, result)4428 module_eval(<<'.,.,', 'bnf.y.rb', 1174) 4429 def _reduce_334(val, _values, result) 4321 4430 val[0].set_specifier_list( [] ) 4322 4431 result … … 4324 4433 .,., 4325 4434 4326 module_eval(<<'.,.,', 'bnf.y.rb', 117 5)4327 def _reduce_33 4(val, _values, result)4435 module_eval(<<'.,.,', 'bnf.y.rb', 1178) 4436 def _reduce_335(val, _values, result) 4328 4437 result << val[2] 4329 4438 result … … 4331 4440 .,., 4332 4441 4333 module_eval(<<'.,.,', 'bnf.y.rb', 11 77)4334 def _reduce_33 5(val, _values, result)4442 module_eval(<<'.,.,', 'bnf.y.rb', 1180) 4443 def _reduce_336(val, _values, result) 4335 4444 result = [val[0]] 4336 result4337 end4338 .,.,4339 4340 module_eval(<<'.,.,', 'bnf.y.rb', 1181)4341 def _reduce_336(val, _values, result)4342 result = [ :THROUGH, val[2], val[4] ]4343 4445 result 4344 4446 end … … 4347 4449 module_eval(<<'.,.,', 'bnf.y.rb', 1184) 4348 4450 def _reduce_337(val, _values, result) 4451 result = [ :THROUGH, val[2], val[4] ] 4452 result 4453 end 4454 .,., 4455 4456 module_eval(<<'.,.,', 'bnf.y.rb', 1187) 4457 def _reduce_338(val, _values, result) 4349 4458 result = val[0] 4350 4459 result … … 4352 4461 .,., 4353 4462 4354 # reduce 33 8omitted4355 4356 module_eval(<<'.,.,', 'bnf.y.rb', 1 198)4357 def _reduce_3 39(val, _values, result)4463 # reduce 339 omitted 4464 4465 module_eval(<<'.,.,', 'bnf.y.rb', 1201) 4466 def _reduce_340(val, _values, result) 4358 4467 result = Join.new( val[0].val, -1, val[4] ) 4359 4468 Cell.new_join( result, true ) … … 4363 4472 .,., 4364 4473 4365 module_eval(<<'.,.,', 'bnf.y.rb', 120 3)4366 def _reduce_34 0(val, _values, result)4474 module_eval(<<'.,.,', 'bnf.y.rb', 1206) 4475 def _reduce_341(val, _values, result) 4367 4476 result = Join.new( val[0].val, val[2], val[5] ) 4368 4477 Cell.new_join( result, true ) … … 4372 4481 .,., 4373 4482 4374 module_eval(<<'.,.,', 'bnf.y.rb', 12 08)4375 def _reduce_34 1(val, _values, result)4483 module_eval(<<'.,.,', 'bnf.y.rb', 1211) 4484 def _reduce_342(val, _values, result) 4376 4485 result = Join.new( val[0].val, nil, val[2] ) 4377 4486 Cell.new_join( result, true ) … … 4381 4490 .,., 4382 4491 4383 module_eval(<<'.,.,', 'bnf.y.rb', 121 3)4384 def _reduce_34 2(val, _values, result)4492 module_eval(<<'.,.,', 'bnf.y.rb', 1216) 4493 def _reduce_343(val, _values, result) 4385 4494 result = Join.new( val[0].val, nil, [ :COMPOSITE, val[4] ] ) 4386 4495 Cell.new_join( result, true ) … … 4390 4499 .,., 4391 4500 4392 # reduce 34 3omitted4393 4394 module_eval(<<'.,.,', 'bnf.y.rb', 122 4)4395 def _reduce_34 4(val, _values, result)4501 # reduce 344 omitted 4502 4503 module_eval(<<'.,.,', 'bnf.y.rb', 1227) 4504 def _reduce_345(val, _values, result) 4396 4505 rj = ReverseJoin.new( val[0].val, nil, val[2], val[4].val ) 4397 4506 Cell.new_reverse_join( rj ) … … 4401 4510 .,., 4402 4511 4403 module_eval(<<'.,.,', 'bnf.y.rb', 123 0)4404 def _reduce_34 5(val, _values, result)4512 module_eval(<<'.,.,', 'bnf.y.rb', 1233) 4513 def _reduce_346(val, _values, result) 4405 4514 rj = ReverseJoin.new( val[0].val, nil, val[2], val[4].val, val[6] ) 4406 4515 Cell.new_reverse_join( rj ) … … 4410 4519 .,., 4411 4520 4412 module_eval(<<'.,.,', 'bnf.y.rb', 123 6)4413 def _reduce_34 6(val, _values, result)4521 module_eval(<<'.,.,', 'bnf.y.rb', 1239) 4522 def _reduce_347(val, _values, result) 4414 4523 rj = ReverseJoin.new( val[0].val, val[2], val[5], val[7].val ) 4415 4524 Cell.new_reverse_join( rj ) … … 4419 4528 .,., 4420 4529 4421 module_eval(<<'.,.,', 'bnf.y.rb', 124 2)4422 def _reduce_34 7(val, _values, result)4530 module_eval(<<'.,.,', 'bnf.y.rb', 1245) 4531 def _reduce_348(val, _values, result) 4423 4532 rj = ReverseJoin.new( val[0].val, val[2], val[5], val[7].val, val[9] ) 4424 4533 Cell.new_reverse_join( rj ) … … 4428 4537 .,., 4429 4538 4430 # reduce 34 8omitted4431 4432 module_eval(<<'.,.,', 'bnf.y.rb', 125 4)4433 def _reduce_3 49(val, _values, result)4539 # reduce 349 omitted 4540 4541 module_eval(<<'.,.,', 'bnf.y.rb', 1257) 4542 def _reduce_350(val, _values, result) 4434 4543 CompositeCelltype.end_of_parse 4435 4544 result = val[1] … … 4439 4548 .,., 4440 4549 4441 module_eval(<<'.,.,', 'bnf.y.rb', 126 0)4442 def _reduce_35 0(val, _values, result)4550 module_eval(<<'.,.,', 'bnf.y.rb', 1263) 4551 def _reduce_351(val, _values, result) 4443 4552 result = CompositeCelltype.new(val[0].val) 4444 4553 result … … 4446 4555 .,., 4447 4556 4448 # reduce 351 omitted4449 4450 4557 # reduce 352 omitted 4451 4558 4452 module_eval(<<'.,.,', 'bnf.y.rb', 1269) 4453 def _reduce_353(val, _values, result) 4559 # reduce 353 omitted 4560 4561 module_eval(<<'.,.,', 'bnf.y.rb', 1272) 4562 def _reduce_354(val, _values, result) 4454 4563 if val[0].kind_of?( Port ) then 4455 4564 CompositeCelltype.new_port( val[0] ) # 遅延して登録 … … 4460 4569 .,., 4461 4570 4462 module_eval(<<'.,.,', 'bnf.y.rb', 127 5)4463 def _reduce_35 4(val, _values, result)4571 module_eval(<<'.,.,', 'bnf.y.rb', 1278) 4572 def _reduce_355(val, _values, result) 4464 4573 if val[3].kind_of?( Port ) then 4465 4574 # port 以外 val[3] に有効な値が入っていないので、以下のメソッドを適用できない … … 4479 4588 .,., 4480 4589 4481 # reduce 355 omitted4482 4483 4590 # reduce 356 omitted 4484 4591 … … 4487 4594 # reduce 358 omitted 4488 4595 4489 module_eval(<<'.,.,', 'bnf.y.rb', 1299) 4490 def _reduce_359(val, _values, result) 4596 # reduce 359 omitted 4597 4598 module_eval(<<'.,.,', 'bnf.y.rb', 1302) 4599 def _reduce_360(val, _values, result) 4491 4600 Generator.add_statement_specifier val[0] 4492 4601 result = [ val[0] ] … … 4496 4605 .,., 4497 4606 4498 module_eval(<<'.,.,', 'bnf.y.rb', 1304) 4499 def _reduce_360(val, _values, result) 4607 module_eval(<<'.,.,', 'bnf.y.rb', 1307) 4608 def _reduce_361(val, _values, result) 4609 Generator.add_statement_specifier val[2] 4610 result = val[0] << val[2] 4611 4612 result 4613 end 4614 .,., 4615 4616 module_eval(<<'.,.,', 'bnf.y.rb', 1312) 4617 def _reduce_362(val, _values, result) 4500 4618 result = [ :ALLOCATOR, val[2] ] 4501 4619 result … … 4503 4621 .,., 4504 4622 4505 module_eval(<<'.,.,', 'bnf.y.rb', 13 05)4506 def _reduce_36 1(val, _values, result)4623 module_eval(<<'.,.,', 'bnf.y.rb', 1313) 4624 def _reduce_363(val, _values, result) 4507 4625 result = [ :OMIT ] 4508 4626 result … … 4510 4628 .,., 4511 4629 4512 module_eval(<<'.,.,', 'bnf.y.rb', 13 06)4513 def _reduce_36 2(val, _values, result)4630 module_eval(<<'.,.,', 'bnf.y.rb', 1314) 4631 def _reduce_364(val, _values, result) 4514 4632 result = [ :OPTIONAL ] 4515 4633 result … … 4517 4635 .,., 4518 4636 4519 module_eval(<<'.,.,', 'bnf.y.rb', 13 07)4520 def _reduce_36 3(val, _values, result)4637 module_eval(<<'.,.,', 'bnf.y.rb', 1315) 4638 def _reduce_365(val, _values, result) 4521 4639 result = [ :REF_DESC ] 4522 4640 result … … 4524 4642 .,., 4525 4643 4526 module_eval(<<'.,.,', 'bnf.y.rb', 13 08)4527 def _reduce_36 4(val, _values, result)4644 module_eval(<<'.,.,', 'bnf.y.rb', 1316) 4645 def _reduce_366(val, _values, result) 4528 4646 result = [ :DYNAMIC ] 4529 4647 result … … 4531 4649 .,., 4532 4650 4533 module_eval(<<'.,.,', 'bnf.y.rb', 13 13)4534 def _reduce_36 5(val, _values, result)4651 module_eval(<<'.,.,', 'bnf.y.rb', 1321) 4652 def _reduce_367(val, _values, result) 4535 4653 # CompositeCelltype.new_port( val[0] ) 4536 4654 result = val[0] … … 4540 4658 .,., 4541 4659 4542 module_eval(<<'.,.,', 'bnf.y.rb', 132 0)4543 def _reduce_36 6(val, _values, result)4660 module_eval(<<'.,.,', 'bnf.y.rb', 1328) 4661 def _reduce_368(val, _values, result) 4544 4662 result = nil 4545 4663 result … … 4547 4665 .,., 4548 4666 4549 module_eval(<<'.,.,', 'bnf.y.rb', 13 24)4550 def _reduce_36 7(val, _values, result)4667 module_eval(<<'.,.,', 'bnf.y.rb', 1332) 4668 def _reduce_369(val, _values, result) 4551 4669 CompositeCelltype.new_attribute( val[0] ) 4552 4670 result … … 4554 4672 .,., 4555 4673 4556 module_eval(<<'.,.,', 'bnf.y.rb', 13 26)4557 def _reduce_3 68(val, _values, result)4674 module_eval(<<'.,.,', 'bnf.y.rb', 1334) 4675 def _reduce_370(val, _values, result) 4558 4676 CompositeCelltype.new_attribute( val[1] ) 4559 4677 result … … 4561 4679 .,., 4562 4680 4563 module_eval(<<'.,.,', 'bnf.y.rb', 133 1)4564 def _reduce_3 69(val, _values, result)4681 module_eval(<<'.,.,', 'bnf.y.rb', 1339) 4682 def _reduce_371(val, _values, result) 4565 4683 Cell.new_def 4566 4684 result … … 4568 4686 .,., 4569 4687 4570 module_eval(<<'.,.,', 'bnf.y.rb', 13 33)4571 def _reduce_37 0(val, _values, result)4688 module_eval(<<'.,.,', 'bnf.y.rb', 1341) 4689 def _reduce_372(val, _values, result) 4572 4690 result = Cell.end_of_parse true 4573 4691 result … … 4575 4693 .,., 4576 4694 4577 module_eval(<<'.,.,', 'bnf.y.rb', 13 35)4578 def _reduce_37 1(val, _values, result)4695 module_eval(<<'.,.,', 'bnf.y.rb', 1343) 4696 def _reduce_373(val, _values, result) 4579 4697 result = Cell.end_of_parse false 4580 4698 result … … 4582 4700 .,., 4583 4701 4584 module_eval(<<'.,.,', 'bnf.y.rb', 134 0)4585 def _reduce_37 2(val, _values, result)4702 module_eval(<<'.,.,', 'bnf.y.rb', 1348) 4703 def _reduce_374(val, _values, result) 4586 4704 Cell.new(val[0],true) 4587 4705 result … … 4589 4707 .,., 4590 4708 4591 module_eval(<<'.,.,', 'bnf.y.rb', 13 44)4592 def _reduce_37 3(val, _values, result)4709 module_eval(<<'.,.,', 'bnf.y.rb', 1352) 4710 def _reduce_375(val, _values, result) 4593 4711 Cell.set_name(val[0].val) 4594 4712 result … … 4596 4714 .,., 4597 4715 4598 # reduce 374 omitted4599 4600 # reduce 375 omitted4601 4602 4716 # reduce 376 omitted 4603 4717 4604 module_eval(<<'.,.,', 'bnf.y.rb', 1354) 4605 def _reduce_377(val, _values, result) 4718 # reduce 377 omitted 4719 4720 # reduce 378 omitted 4721 4722 # reduce 379 omitted 4723 4724 module_eval(<<'.,.,', 'bnf.y.rb', 1363) 4725 def _reduce_380(val, _values, result) 4606 4726 Cell.external_join( val[0].val, val[4].val, true ) 4607 4727 result … … 4609 4729 .,., 4610 4730 4611 module_eval(<<'.,.,', 'bnf.y.rb', 13 56)4612 def _reduce_3 78(val, _values, result)4731 module_eval(<<'.,.,', 'bnf.y.rb', 1365) 4732 def _reduce_381(val, _values, result) 4613 4733 Cell.external_join( val[0].val, val[2].val, false ) 4614 4734 result … … 4616 4736 .,., 4617 4737 4618 module_eval(<<'.,.,', 'bnf.y.rb', 13 63)4619 def _reduce_3 79(val, _values, result)4738 module_eval(<<'.,.,', 'bnf.y.rb', 1372) 4739 def _reduce_382(val, _values, result) 4620 4740 CompositeCelltype.new_join( val[0].val, 4621 4741 val[2].val, val[4].val, :ENTRY ) … … 4625 4745 .,., 4626 4746 4627 module_eval(<<'.,.,', 'bnf.y.rb', 13 68)4628 def _reduce_38 0(val, _values, result)4747 module_eval(<<'.,.,', 'bnf.y.rb', 1377) 4748 def _reduce_383(val, _values, result) 4629 4749 CompositeCelltype.new_join( val[2].val, 4630 4750 val[4].val, val[6].val, :ENTRY ) … … 4634 4754 .,., 4635 4755 4636 # reduce 38 1omitted4637 4638 # reduce 38 2omitted4639 4640 # reduce 38 3omitted4641 4642 module_eval(<<'.,.,', 'bnf.y.rb', 13 84)4643 def _reduce_38 4(val, _values, result)4756 # reduce 384 omitted 4757 4758 # reduce 385 omitted 4759 4760 # reduce 386 omitted 4761 4762 module_eval(<<'.,.,', 'bnf.y.rb', 1393) 4763 def _reduce_387(val, _values, result) 4644 4764 Region.end_of_parse 4645 4765 result 4646 4766 end 4647 4767 .,., 4648 4649 module_eval(<<'.,.,', 'bnf.y.rb', 1386)4650 def _reduce_385(val, _values, result)4651 Region.end_of_parse4652 result4653 end4654 .,.,4655 4656 # reduce 386 omitted4657 4658 # reduce 387 omitted4659 4768 4660 4769 module_eval(<<'.,.,', 'bnf.y.rb', 1395) 4661 4770 def _reduce_388(val, _values, result) 4771 Region.end_of_parse 4772 result 4773 end 4774 .,., 4775 4776 # reduce 389 omitted 4777 4778 # reduce 390 omitted 4779 4780 module_eval(<<'.,.,', 'bnf.y.rb', 1404) 4781 def _reduce_391(val, _values, result) 4662 4782 Region.new_in_through( val[2].val, val[4].val ) 4663 4783 result … … 4665 4785 .,., 4666 4786 4667 module_eval(<<'.,.,', 'bnf.y.rb', 1 397)4668 def _reduce_3 89(val, _values, result)4787 module_eval(<<'.,.,', 'bnf.y.rb', 1406) 4788 def _reduce_392(val, _values, result) 4669 4789 Region.new_in_through 4670 4790 result … … 4672 4792 .,., 4673 4793 4674 module_eval(<<'.,.,', 'bnf.y.rb', 1 399)4675 def _reduce_39 0(val, _values, result)4794 module_eval(<<'.,.,', 'bnf.y.rb', 1408) 4795 def _reduce_393(val, _values, result) 4676 4796 Region.new_out_through( val[2].val, val[4].val ) 4677 4797 result … … 4679 4799 .,., 4680 4800 4681 module_eval(<<'.,.,', 'bnf.y.rb', 14 01)4682 def _reduce_39 1(val, _values, result)4801 module_eval(<<'.,.,', 'bnf.y.rb', 1410) 4802 def _reduce_394(val, _values, result) 4683 4803 Region.new_out_through() 4684 4804 result … … 4686 4806 .,., 4687 4807 4688 module_eval(<<'.,.,', 'bnf.y.rb', 14 03)4689 def _reduce_39 2(val, _values, result)4808 module_eval(<<'.,.,', 'bnf.y.rb', 1412) 4809 def _reduce_395(val, _values, result) 4690 4810 Region.new_to_through( val[2], val[4].val, val[6].val ) 4691 4811 result … … 4693 4813 .,., 4694 4814 4695 module_eval(<<'.,.,', 'bnf.y.rb', 14 05)4696 def _reduce_39 3(val, _values, result)4815 module_eval(<<'.,.,', 'bnf.y.rb', 1414) 4816 def _reduce_396(val, _values, result) 4697 4817 Region.new_to_through( val[2], nil, nil ) 4698 4818 result … … 4700 4820 .,., 4701 4821 4702 module_eval(<<'.,.,', 'bnf.y.rb', 14 07)4703 def _reduce_39 4(val, _values, result)4822 module_eval(<<'.,.,', 'bnf.y.rb', 1416) 4823 def _reduce_397(val, _values, result) 4704 4824 Region.set_type( :NODE ) 4705 4825 result … … 4707 4827 .,., 4708 4828 4709 module_eval(<<'.,.,', 'bnf.y.rb', 14 09)4710 def _reduce_39 5(val, _values, result)4829 module_eval(<<'.,.,', 'bnf.y.rb', 1418) 4830 def _reduce_398(val, _values, result) 4711 4831 Region.set_type( :LINKUNIT ) 4712 4832 result … … 4714 4834 .,., 4715 4835 4716 module_eval(<<'.,.,', 'bnf.y.rb', 14 11)4717 def _reduce_39 6(val, _values, result)4836 module_eval(<<'.,.,', 'bnf.y.rb', 1420) 4837 def _reduce_399(val, _values, result) 4718 4838 Region.set_domain( val[2].val, val[4] ) 4719 4839 result … … 4721 4841 .,., 4722 4842 4723 module_eval(<<'.,.,', 'bnf.y.rb', 14 13)4724 def _reduce_ 397(val, _values, result)4843 module_eval(<<'.,.,', 'bnf.y.rb', 1422) 4844 def _reduce_400(val, _values, result) 4725 4845 Region.set_type( :CLASS, val[2].val ) 4726 4846 result … … 4728 4848 .,., 4729 4849 4730 module_eval(<<'.,.,', 'bnf.y.rb', 14 17)4731 def _reduce_ 398(val, _values, result)4850 module_eval(<<'.,.,', 'bnf.y.rb', 1426) 4851 def _reduce_401(val, _values, result) 4732 4852 result = Region.new( val[0].val ) 4733 4853 result … … 4735 4855 .,., 4736 4856 4737 # reduce 399 omitted4738 4739 # reduce 400 omitted4740 4741 # reduce 401 omitted4742 4743 4857 # reduce 402 omitted 4744 4858 4745 module_eval(<<'.,.,', 'bnf.y.rb', 1428) 4746 def _reduce_403(val, _values, result) 4859 # reduce 403 omitted 4860 4861 # reduce 404 omitted 4862 4863 # reduce 405 omitted 4864 4865 module_eval(<<'.,.,', 'bnf.y.rb', 1437) 4866 def _reduce_406(val, _values, result) 4747 4867 obj = val[3] 4748 4868 if obj.kind_of?( Cell ) then … … 4756 4876 .,., 4757 4877 4758 module_eval(<<'.,.,', 'bnf.y.rb', 145 0)4759 def _reduce_40 4(val, _values, result)4878 module_eval(<<'.,.,', 'bnf.y.rb', 1459) 4879 def _reduce_407(val, _values, result) 4760 4880 result = [ val[0].val ] 4761 4881 result … … 4763 4883 .,., 4764 4884 4765 module_eval(<<'.,.,', 'bnf.y.rb', 14 55)4766 def _reduce_40 5(val, _values, result)4885 module_eval(<<'.,.,', 'bnf.y.rb', 1464) 4886 def _reduce_408(val, _values, result) 4767 4887 set_in_specifier 4768 4888 result … … 4770 4890 .,., 4771 4891 4772 module_eval(<<'.,.,', 'bnf.y.rb', 14 57)4773 def _reduce_40 6(val, _values, result)4892 module_eval(<<'.,.,', 'bnf.y.rb', 1466) 4893 def _reduce_409(val, _values, result) 4774 4894 unset_in_specifier 4775 4895 result … … 4777 4897 .,., 4778 4898 4779 # reduce 407 omitted4780 4781 # reduce 408 omitted4782 4783 # reduce 409 omitted4784 4785 4899 # reduce 410 omitted 4786 4900 4787 module_eval(<<'.,.,', 'bnf.y.rb', 1471) 4788 def _reduce_411(val, _values, result) 4901 # reduce 411 omitted 4902 4903 # reduce 412 omitted 4904 4905 # reduce 413 omitted 4906 4907 module_eval(<<'.,.,', 'bnf.y.rb', 1480) 4908 def _reduce_414(val, _values, result) 4789 4909 TECSGEN::Cell_location.new( val[1], val[3], val[5], val[7], val[9], val[12] ) 4790 4910 … … 4793 4913 .,., 4794 4914 4795 module_eval(<<'.,.,', 'bnf.y.rb', 14 77)4796 def _reduce_41 2(val, _values, result)4915 module_eval(<<'.,.,', 'bnf.y.rb', 1486) 4916 def _reduce_415(val, _values, result) 4797 4917 result = val[0] << val[1] 4798 4918 … … 4801 4921 .,., 4802 4922 4803 module_eval(<<'.,.,', 'bnf.y.rb', 148 0)4804 def _reduce_41 3(val, _values, result)4923 module_eval(<<'.,.,', 'bnf.y.rb', 1489) 4924 def _reduce_416(val, _values, result) 4805 4925 result = [] 4806 4926 result … … 4808 4928 .,., 4809 4929 4810 module_eval(<<'.,.,', 'bnf.y.rb', 14 84)4811 def _reduce_41 4(val, _values, result)4930 module_eval(<<'.,.,', 'bnf.y.rb', 1493) 4931 def _reduce_417(val, _values, result) 4812 4932 result = [ val[0], val[2], val[3] ] 4813 4933 result … … 4815 4935 .,., 4816 4936 4817 module_eval(<<'.,.,', 'bnf.y.rb', 14 89)4818 def _reduce_41 5(val, _values, result)4937 module_eval(<<'.,.,', 'bnf.y.rb', 1498) 4938 def _reduce_418(val, _values, result) 4819 4939 TECSGEN::Join_location.new( val[2], val[4], val[6], val[8], val[11] ) 4820 4940 … … 4823 4943 .,., 4824 4944 4825 module_eval(<<'.,.,', 'bnf.y.rb', 1 495)4826 def _reduce_41 6(val, _values, result)4945 module_eval(<<'.,.,', 'bnf.y.rb', 1504) 4946 def _reduce_419(val, _values, result) 4827 4947 result = val[0] << [ val[1], val[3] ] 4828 4948 … … 4831 4951 .,., 4832 4952 4833 module_eval(<<'.,.,', 'bnf.y.rb', 1 497)4834 def _reduce_4 17(val, _values, result)4953 module_eval(<<'.,.,', 'bnf.y.rb', 1506) 4954 def _reduce_420(val, _values, result) 4835 4955 result = [] 4956 result 4957 end 4958 .,., 4959 4960 module_eval(<<'.,.,', 'bnf.y.rb', 1510) 4961 def _reduce_421(val, _values, result) 4962 TOOL_INFO.new( val[2].to_sym, val[4] ) 4963 result 4964 end 4965 .,., 4966 4967 module_eval(<<'.,.,', 'bnf.y.rb', 1511) 4968 def _reduce_422(val, _values, result) 4969 result = val[1] 4970 result 4971 end 4972 .,., 4973 4974 module_eval(<<'.,.,', 'bnf.y.rb', 1512) 4975 def _reduce_423(val, _values, result) 4976 result = { val[0].to_sym => val[2] } 4977 result 4978 end 4979 .,., 4980 4981 module_eval(<<'.,.,', 'bnf.y.rb', 1514) 4982 def _reduce_424(val, _values, result) 4983 val[0][ val[2].to_sym ] = val[4] 4984 result 4985 end 4986 .,., 4987 4988 # reduce 425 omitted 4989 4990 # reduce 426 omitted 4991 4992 # reduce 427 omitted 4993 4994 # reduce 428 omitted 4995 4996 module_eval(<<'.,.,', 'bnf.y.rb', 1516) 4997 def _reduce_429(val, _values, result) 4998 result=val[0].val 4999 result 5000 end 5001 .,., 5002 5003 module_eval(<<'.,.,', 'bnf.y.rb', 1516) 5004 def _reduce_430(val, _values, result) 5005 result=val[0].val 5006 result 5007 end 5008 .,., 5009 5010 module_eval(<<'.,.,', 'bnf.y.rb', 1517) 5011 def _reduce_431(val, _values, result) 5012 result = val[1] 5013 result 5014 end 5015 .,., 5016 5017 module_eval(<<'.,.,', 'bnf.y.rb', 1518) 5018 def _reduce_432(val, _values, result) 5019 result = [] 5020 result 5021 end 5022 .,., 5023 5024 module_eval(<<'.,.,', 'bnf.y.rb', 1519) 5025 def _reduce_433(val, _values, result) 5026 result = [ val[0] ] 5027 result 5028 end 5029 .,., 5030 5031 module_eval(<<'.,.,', 'bnf.y.rb', 1520) 5032 def _reduce_434(val, _values, result) 5033 val[0] << val[2] 5034 result 5035 end 5036 .,., 5037 5038 module_eval(<<'.,.,', 'bnf.y.rb', 1521) 5039 def _reduce_435(val, _values, result) 5040 result = val[0].val.gsub!( /\"(.*)\"/, "\\1" ) 5041 result 5042 end 5043 .,., 5044 5045 module_eval(<<'.,.,', 'bnf.y.rb', 1522) 5046 def _reduce_436(val, _values, result) 5047 result = val[0].val.to_i 5048 result 5049 end 5050 .,., 5051 5052 module_eval(<<'.,.,', 'bnf.y.rb', 1523) 5053 def _reduce_437(val, _values, result) 5054 result = val[0].val.to_f 5055 result 5056 end 5057 .,., 5058 5059 module_eval(<<'.,.,', 'bnf.y.rb', 1524) 5060 def _reduce_438(val, _values, result) 5061 result = - val[0].val.to_i 5062 result 5063 end 5064 .,., 5065 5066 module_eval(<<'.,.,', 'bnf.y.rb', 1525) 5067 def _reduce_439(val, _values, result) 5068 result = - val[0].val.to_f 5069 result 5070 end 5071 .,., 5072 5073 module_eval(<<'.,.,', 'bnf.y.rb', 1526) 5074 def _reduce_440(val, _values, result) 5075 result = val[0].val.to_i 5076 result 5077 end 5078 .,., 5079 5080 module_eval(<<'.,.,', 'bnf.y.rb', 1527) 5081 def _reduce_441(val, _values, result) 5082 result = val[0].val.to_f 4836 5083 result 4837 5084 end -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecslib/core/bnf.y.rb
r321 r429 4 4 # Generator for TOPPERS Embedded Component System 5 5 # 6 # Copyright (C) 2008-201 6by TOPPERS Project6 # Copyright (C) 2008-2018 by TOPPERS Project 7 7 #-- 8 8 # 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ … … 378 378 | STRUCT 379 379 { 380 result = StructType.new() 380 # tag が無い場合、内部名を与える 381 result = StructType.new( :"TAG__#{@@no_struct_tag_num}__" ) 382 @@no_struct_tag_num += 1 381 383 StructType.set_define( true ) 382 384 } … … 709 711 : component_description specified_statement 710 712 | component_description location_information 713 | component_description tool_info 711 714 | 712 715 … … 738 741 | import 739 742 | import_C 740 | signature_plugin743 | generate_statement 741 744 | error # エラー回復ポイント 742 745 … … 797 800 798 801 region_name_list 799 : IDENTIFIER800 { result = [val[0] .val] }801 | region_name_list ',' IDENTIFIER802 { result << val[2] .val}802 : namespace_identifier 803 { result = [val[0]] } 804 | region_name_list ',' namespace_identifier 805 { result << val[2] } 803 806 804 807 const_statement … … 832 835 { Import.new( val[2], true ) } 833 836 834 signature_plugin 837 generate_statement 835 838 # : GENERATE '(' plugin_name ',' namespace_identifier ',' STRING_LITERAL ')' ';' #1ok signature plugin 836 839 : GENERATE '(' plugin_name ',' namespace_identifier ',' plugin_arg ')' ';' #1ok signature plugin … … 1301 1304 result = [ val[0] ] 1302 1305 } 1306 | composite_celltype_statement_specifier_list ',' composite_celltype_statement_specifier 1307 { 1308 Generator.add_statement_specifier val[2] 1309 result = val[0] << val[2] 1310 } 1303 1311 1304 1312 composite_celltype_statement_specifier … … 1350 1358 | internal_join_list specified_join 1351 1359 | internal_join_list external_join 1360 | internal_join_list reverse_join 1352 1361 1353 1362 external_join # cell 内に記述する呼び口の外部結合 … … 1499 1508 1500 1509 1510 # JSON object 1511 tool_info : TOOL_INFO '(' JSON_string ')' JSON_object { TOOL_INFO.new( val[2].to_sym, val[4] ) } 1512 JSON_object : '{' JSON_property_list '}' { result = val[1] } 1513 JSON_property_list : JSON_string ':' JSON_value { result = { val[0].to_sym => val[2] } } 1514 | JSON_property_list ',' JSON_string ':' JSON_value 1515 { val[0][ val[2].to_sym ] = val[4] } 1516 JSON_value : JSON_string | JSON_number | JSON_object | JSON_array 1517 | TRUE { result=val[0].val } | FALSE { result=val[0].val } # JSON_NULL # null not suppoted 1518 JSON_array : '[' JSON_array_list ']' { result = val[1] } 1519 | '[' ']' { result = [] } 1520 JSON_array_list : JSON_value { result = [ val[0] ] } 1521 | JSON_array_list ',' JSON_value { val[0] << val[2] } 1522 JSON_string : STRING_LITERAL { result = val[0].val.gsub!( /\"(.*)\"/, "\\1" ) } 1523 JSON_number : INTEGER_CONSTANT { result = val[0].val.to_i } 1524 | FLOATING_CONSTANT { result = val[0].val.to_f } 1525 | '-' INTEGER_CONSTANT { result = - val[0].val.to_i } 1526 | '-' FLOATING_CONSTANT { result = - val[0].val.to_f } 1527 | '+' INTEGER_CONSTANT { result = val[0].val.to_i } 1528 | '+' FLOATING_CONSTANT { result = val[0].val.to_f } 1529 1530 1501 1531 end 1502 1532 … … 1523 1553 'import_C' => :IMPORT_C, 1524 1554 'generate' => :GENERATE, 1555 '__tool_info__' => :TOOL_INFO, 1525 1556 1526 1557 # types … … 1658 1689 # すべての構文解析が完了した 1659 1690 @@b_end_all_parse = false 1691 1692 # tag なし struct 1693 @@no_struct_tag_num = 0 1660 1694 1661 1695 def self.parse( file_name, plugin = nil, b_reuse = false ) … … 1773 1807 string += line 1774 1808 # この位置では error メソッドは使えない (token 読出し前) 1775 puts " error: #{file} line #{lineno}: string literal has newline without escape"1809 puts "#{file}:#{lineno}:#{col}: error: string literal has newline without escape" 1776 1810 @@n_error += 1 1777 1811 end … … 1814 1848 b_in_string = true 1815 1849 # この位置では error メソッドは使えない (token 読出し前) # mikan cdl_error ではない 1816 puts " error: #{file} line #{lineno}: string literal has newline without escape"1850 puts "#{file}:#{lineno}:#{col}: error: string literal has newline without escape" 1817 1851 @@n_error += 1 1818 1852 # 山括弧で囲まれた文字列 1819 when /\A<[0-9A-Za-z_\. \/]+>/ # AB: angle bracke 1853 # when /\A<[0-9A-Za-z_\. \/]+>/ # AB: angle bracke 1854 when /\A<(?:[^>\\]|\\.)*>/ # これはうまく行くようだ 1820 1855 @q << [:AB_STRING_LITERAL, Token.new($&, file, lineno, col)] 1821 1856 # 行コメント … … 1913 1948 @@n_error = 0 1914 1949 @@n_warning = 0 1950 @@n_info = 0 1915 1951 1916 1952 # このメソッドは構文解析、意味解析からのみ呼出し可(コード生成でエラー発生は不適切) … … 1946 1982 end 1947 1983 if locale then 1948 Console.puts " error: #{locale[0]}: line #{locale[1]}#{msg}"1984 Console.puts "#{locale[0]}:#{locale[1]}:#{locale[2]}: error: #{msg}" 1949 1985 else 1950 1986 Console.puts "error: #{msg}" … … 1979 2015 end 1980 2016 if locale then 1981 Console.puts " warning: #{locale[0]}: line #{locale[1]}#{msg}"2017 Console.puts "#{locale[0]}:#{locale[1]}:#{locale[2]}: warning: #{msg}" 1982 2018 else 1983 2019 Console.puts "warning: #{msg}" … … 1986 2022 end 1987 2023 2024 # このメソッドは構文解析、意味解析からのみ呼出し可 2025 def self.info( msg, *arg ) 2026 locale = nil 2027 self.info2( locale, msg, *arg ) 2028 end 2029 2030 def self.info2( locale, msg, *arg ) 2031 @@n_info += 1 2032 2033 msg = TECSMsg.get_info_message( msg ) 2034 # $1, $2, ... を arg で置換 2035 count = 1 2036 arg.each{ |a| 2037 str = TECSIO.str_code_convert( msg, a.to_s ) 2038 msg.sub!( /\$#{count}/, str ) 2039 count += 1 2040 } 2041 2042 # import_C の中でのウォーニング? 2043 if @@import_C then 2044 C_parser.info( msg ) 2045 else 2046 if @@b_end_all_parse == false || locale == nil then 2047 locale = @@current_locale[ @@generator_nest ] 2048 end 2049 if locale then 2050 Console.puts "#{locale[0]}:#{locale[1]}:#{locale[2]}: info: #{msg}" 2051 else 2052 Console.puts "info: #{msg}" 2053 end 2054 end 2055 end 2056 1988 2057 def self.get_n_error 1989 2058 @@n_error … … 1994 2063 end 1995 2064 2065 def self.get_n_info 2066 @@n_info 2067 end 2068 1996 2069 def self.get_nest 1997 2070 @@generator_nest 2071 end 2072 2073 def self.parsing_C? 2074 @@import_C 1998 2075 end 1999 2076 -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecslib/core/componentobj.rb
r321 r429 4 4 # Generator for TOPPERS Embedded Component System 5 5 # 6 # Copyright (C) 2008-201 6by TOPPERS Project6 # Copyright (C) 2008-2019 by TOPPERS Project 7 7 #-- 8 8 # 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ … … 79 79 # @b_checked_as_allocator_signature:: bool: アロケータシグニチャとしてチェック済み 80 80 # @b_empty:: Bool: 空(関数が一つもない状態) 81 # @descriptor_list:: nil | { Signature => ParamDecl } 最後の ParamDecl しか記憶しないことに注意 82 # @generate:: [ Symbol, String, Plugin ] = [ PluginName, option, Plugin ] Plugin は生成後に追加される 83 84 include PluginModule 81 85 82 86 @@nest_stack_index = -1 … … 123 127 @b_empty = false 124 128 @b_checked_as_allocator_signature = false 129 @descriptor_list = nil 130 @generate = nil 125 131 @@current_object = self 126 132 set_specifier_list( Generator.get_statement_specifier ) … … 136 142 function_head_list.get_items.each{ |f| 137 143 @func_name_to_id[ f.get_name ] = id 144 f.set_owner self 138 145 id += 1 139 146 } … … 142 149 end 143 150 151 # set_descriptor_list ## 152 153 if @generate then 154 signature_plugin 155 end 156 144 157 @@current_object = nil 158 145 159 return self 146 160 end … … 170 184 when :DEVIATE 171 185 @b_deviate = true 186 when :GENERATE 187 if @generate then 188 cdl_error( "S9999 generate specifier duplicate" ) 189 end 190 @generate = [ s[1], s[2] ] # [ PluginName, "option" ] 172 191 else 173 192 cdl_error( "S1002 \'$1\': unknown specifier for signature" , s[0] ) … … 309 328 end 310 329 311 #== Signature# 引数で参照されている Descriptor 型のリストを作成する 330 #=== Signature# シグニチャプラグイン (generate 指定子) 331 def signature_plugin 332 plugin_name = @generate[0] 333 option = @generate[1] 334 apply_plugin( plugin_name, option ) 335 end 336 337 #== Signature#apply_plugin 338 def apply_plugin plugin_name, option 339 if is_empty? then 340 cdl_warning( "S9999 $1 is empty. cannot apply signature plugin. ignored" , @name ) 341 return 342 end 343 344 plClass = load_plugin( plugin_name, SignaturePlugin ) 345 return if plClass == nil 346 if $verbose then 347 print "new through: plugin_object = #{plClass.class.name}.new( #{@name}, #{option} )\n" 348 end 349 350 begin 351 plugin_object = plClass.new( self, option ) 352 plugin_object.set_locale @locale 353 rescue Exception => evar 354 cdl_error( "S1150 $1: fail to new" , plugin_name ) 355 print_exception( evar ) 356 end 357 generate_and_parse plugin_object 358 end 359 360 #== Signature# 引数で参照されている Descriptor 型のリストを 312 361 #RETURN:: Hash { Signature => ParamDecl }: 複数の ParamDecl から参照されている場合、最後のものしか返さない 313 362 def get_descriptor_list 363 @descriptor_list 364 end 365 366 @@set_descriptor_list = {} 367 def self.set_descriptor_list 368 Namespace.get_root.travers_all_signature{ |sig| 369 if @@set_descriptor_list[ sig ] == nil then 370 @@set_descriptor_list[ sig ] = true 371 sig.set_descriptor_list 372 end 373 } 374 end 375 376 #== Signature# 引数で参照されている Descriptor 型のリストを作成する 377 def set_descriptor_list 314 378 desc_list = { } 315 379 # p "has_desc #{@name}" 316 380 fha = get_function_head_array # 呼び口または受け口のシグニチャの関数配列 317 381 if fha == nil then # nil の場合、自己参照によるケースと仮定 382 @descriptor_list = desc_list 318 383 return desc_list 319 384 end … … 330 395 # p "has_desc #{param.get_name} #{t}" 331 396 if t.kind_of? DescriptorType then 332 desc_list[t] = param 397 desc_list[ t.get_signature ] = param 398 # p self.get_name, t.get_signature.get_name 399 if t.get_signature == self then 400 # cdl_error( "S9999 Descriptor argument '$1' is the same signature as this parameter '$2' included", @name, param.get_name ) 401 end 402 dir = param.get_direction 403 if dir != :IN && dir != :OUT && dir != :INOUT then 404 cdl_error( "S9999 Descriptor argument '$1' cannot be specified for $2 parameter", param.get_name, dir.to_s.downcase ) 405 end 333 406 end 334 407 } … … 336 409 end 337 410 } 338 returndesc_list411 @descriptor_list = desc_list 339 412 end 340 413 341 414 #=== Signature# 引数に Descriptor があるか? 342 415 def has_descriptor? 343 # p "has_desc #{@name}" 344 fha = get_function_head_array # 呼び口または受け口のシグニチャの関数配列 345 if fha == nil then # nil の場合、自己参照によるケースと仮定 416 if get_descriptor_list == nil then 417 # end_of_parse が呼び出される前に has_descriptor? が呼び出された 418 # 呼び出し元は DescriptorType#initialize 419 # この場合、同じシグニチャ内の引数が Descriptor 型である 346 420 return true 347 end 348 fha.each{ |fh| 349 fd = fh.get_declarator # fd: Decl (関数頭部からDeclarotorを得る) 350 if fd.is_function? then # fd が関数でなければ、すでにエラー 351 params = fd.get_type.get_paramlist.get_items 352 if params then 353 params.each{ |param| 354 t = param.get_type.get_original_type 355 while( t.kind_of? PtrType ) 356 t = t.get_referto 357 end 358 # p "has_desc #{param.get_name} #{t}" 359 if t.kind_of? DescriptorType then 360 return true 361 end 362 } 363 end 364 end 365 } 366 return false 421 elsif get_descriptor_list.length > 0 then 422 return true 423 else 424 return false 425 end 367 426 end 368 427 … … 411 470 412 471 end 472 473 module CelltypePluginModule 474 #=== Celltype# セルタイププラグイン (generate 指定子) 475 def celltype_plugin 476 plugin_name = @generate[0] 477 option = @generate[1] 478 @generate[2] = apply_plugin( plugin_name, option ) 479 end 480 481 #=== Celltype# セルタイププラグインをこのセルタイプに適用 482 def apply_plugin( plugin_name, option ) 483 484 # plClass = load_plugin( plugin_name, CelltypePlugin ) 485 if kind_of? Celltype then 486 plugin_class = CelltypePlugin 487 elsif kind_of? CompositeCelltype then 488 plugin_class = CompositePlugin 489 else 490 raise "unknown class #{self.class.name}" 491 end 492 493 plClass = load_plugin( plugin_name, plugin_class ) 494 return if plClass == nil 495 if $verbose then 496 print "new celltype plugin: plugin_object = #{plClass.class.name}.new( #{@name}, #{option} )\n" 497 end 498 499 begin 500 plugin_object = plClass.new( self, option ) 501 @generate_list << [ plugin_name, option, plugin_object ] 502 plugin_object.set_locale @locale 503 generate_and_parse plugin_object 504 rescue Exception => evar 505 cdl_error( "S1023 $1: fail to new" , plugin_name ) 506 print_exception( evar ) 507 end 508 509 # 既に存在するセルに new_cell を適用 510 @cell_list.each{ |cell| 511 apply_plugin_cell plugin_object, cell 512 } 513 514 return plugin_object 515 end 516 517 def apply_plugin_cell plugin, cell 518 begin 519 plugin.new_cell cell 520 rescue Exception => evar 521 cdl_error( "S1037 $1: celltype plugin fail to new_cell" , plugin.class.name ) 522 print_exception( evar ) 523 end 524 end 525 526 def celltype_plugin_new_cell cell 527 @generate_list.each{ |generate| 528 celltype_plugin = generate[2] 529 begin 530 celltype_plugin.new_cell cell 531 rescue Exception => evar 532 cdl_error( "S1037 $1: celltype plugin fail to new_cell" , celltype_plugin.class.name ) 533 print_exception( evar ) 534 end 535 } 536 end 537 end #CelltypePluginModule 413 538 414 539 class Celltype < NSBDNode # < Nestable … … 423 548 # @ct_factory_list:: Factory[] : celltype factory 424 549 # @cell_list:: Cell[] : 定義のみ (V1.0.0.2 以降) 550 # @ordered_cell_list:: Cell[] : ID 順に順序付けされたセルリスト、最適化以降有効 (リンク単位ごとに生成されなおす) 425 551 # @singleton:: bool 426 552 # @idx_is_id:: bool 427 553 # @idx_is_id_act:: bool: actual value 554 # @b_need_ptab:: bool: true if having cells in multi-domain 428 555 # @active:: bool 429 556 # @b_reuse:: bool : reuse 指定されて import された(template 不要) 430 557 # @generate:: [ Symbol, String, Plugin ] = [ PluginName, option, Plugin ] Plugin は生成後に追加される 558 # @generate_list:: [ [ Symbol, String, Plugin ], ... ] generate 文で追加された generate 431 559 # 432 560 # @n_attribute_ro:: int >= 0 none specified … … 437 565 # @n_var_omit:: int >= 0 # of [omit] specified vars # mikan var の omit は有? 438 566 # @n_var_init:: int >= 0 # of vars with initializer 439 # @n_call_port:: int >= 0 440 # @n_call_port_array:: int >= 0 567 # @n_call_port:: int >= 0 # dynamic ports are included 568 # @n_call_port_array:: int >= 0 # dynamic ports are included 441 569 # @n_call_port_omitted_in_CB:: int >= 0 最適化で省略される呼び口 570 # @n_call_port_dynamic:: int >= 0 # 571 # @n_call_port_array_dynamic:: int >= 0 572 # @n_call_port_ref_desc:: int >= 0 # 573 # @n_call_port_array_ref_desc:: int >= 0 442 574 # @n_entry_port:: int >= 0 443 575 # @n_entry_port_array:: int >= 0 … … 455 587 456 588 include PluginModule 457 589 include CelltypePluginModule 590 458 591 @@nest_stack_index = -1 459 592 @@nest_stack = [] … … 496 629 @active = false 497 630 @generate = nil 631 @generate_list = [] 498 632 499 633 @n_attribute_ro = 0 … … 507 641 @n_call_port_array = 0 508 642 @n_call_port_omitted_in_CB = 0 643 @n_call_port_dynamic = 0 644 @n_call_port_array_dynamic = 0 645 @n_call_port_ref_desc = 0 646 @n_call_port_array_ref_desc = 0 509 647 @n_entry_port = 0 510 648 @n_entry_port_array = 0 … … 528 666 if $idx_is_id then 529 667 @idx_is_id = true 668 @idx_is_id_act = true 669 @b_need_ptab = true 530 670 else 531 671 @idx_is_id = false 532 end 533 @idx_is_id_act = @idx_is_id 672 @idx_is_id_act = false 673 @b_need_ptab = false 674 end 534 675 535 676 Namespace.new_celltype( self ) 536 677 set_namespace_path # @NamespacePath の設定 537 678 set_specifier_list( Generator.get_statement_specifier ) 538 539 if @singleton then540 @idx_is_id_act = false541 end542 679 543 680 @included_header = {} … … 577 714 celltype_plugin 578 715 end 716 717 # check_dynamic_join ## 579 718 580 719 @@current_object = nil … … 592 731 @n_call_port += 1 593 732 @n_call_port_array += 1 if port.get_array_size != nil 733 if port.is_dynamic? then 734 @n_call_port_dynamic += 1 735 @n_call_port_array_dynamic += 1 if port.get_array_size != nil 736 end 737 if port.is_ref_desc? then 738 @n_call_port_ref_desc += 1 739 @n_call_port_array_ref_desc += 1 if port.get_array_size != nil 740 end 594 741 else 595 742 @n_entry_port += 1 … … 753 900 when :IDX_IS_ID 754 901 @idx_is_id = true 902 @idx_is_id_act = true 903 @b_need_ptab = true 755 904 when :ACTIVE 756 905 @active = true … … 764 913 end 765 914 } 915 if @singleton then 916 @idx_is_id_act = false 917 @b_need_ptab = false 918 end 766 919 end 767 920 … … 863 1016 end 864 1017 865 #=== Celltype# セルタイププラグイン (generate 指定子) 866 def celltype_plugin 867 868 load_plugin( @generate[0], CelltypePlugin ) 869 870 plugin_name = @generate[0] 871 option = @generate[1] 872 plugin_object = nil 873 eval_str = "plugin_object = #{plugin_name}.new( self, option )" 874 if $verbose then 875 print "new celltype : #{eval_str}\n" 876 end 877 878 begin 879 eval( eval_str ) # plugin を生成 880 plugin_object.set_locale @locale 881 @generate[ 2 ] = plugin_object 882 generate_and_parse plugin_object 883 rescue Exception => evar 884 cdl_error( "S1023 $1: fail to new" , plugin_name ) 885 print "eval( #{eval_str} )\n" 886 887 print_exception( evar ) 888 end 1018 @@dynamic_join_checked_list = {} 1019 def self.check_dynamic_join 1020 Namespace.get_root.travers_all_celltype{ |ct| 1021 if @@dynamic_join_checked_list[ ct ] == nil then 1022 @@dynamic_join_checked_list[ ct ] = true 1023 ct.check_dynamic_join 1024 end 1025 } 1026 end 1027 1028 #=== Celltype#dynamic の適合性チェック 1029 def check_dynamic_join 1030 return if ! $verbose 1031 @port.each{ |port| 1032 signature = port.get_signature 1033 next if signature == nil # すでにエラー 1034 if port.is_dynamic? then 1035 dbgPrint( "[DYNAMIC] checking dynamic port: #{@global_name}.#{port.get_name}\n" ) 1036 # print( "[DYNAMIC] checking dynamic port: #{@global_name}.#{port.get_name}\n" ) 1037 next if find_ref_desc_port signature 1038 next if find_descriptor_param signature, :DYNAMIC 1039 cdl_warning( 'W9999 $1 cannot get information for dynamic port $2', @name, port.get_name ) 1040 elsif port.is_ref_desc? then 1041 dbgPrint( "[DYNAMIC] checking ref_desc port: #{@global_name}.#{port.get_name}\n" ) 1042 # print( "[DYNAMIC] checking ref_desc port: #{@global_name}.#{port.get_name}\n" ) 1043 next if find_dynamic_port signature 1044 next if find_descriptor_param signature, :REF_DESC 1045 cdl_warning( 'W9999 $1 cannot put information from ref_desc port $2', @name, port.get_name ) 1046 elsif port.get_signature then 1047 if port.get_signature.has_descriptor? then 1048 port.get_signature.get_descriptor_list.each{ |signature, param| 1049 dbgPrint( "[DYNAMIC] checking Descriptor parameter: #{@global_name}.#{port.get_name} ... #{param.get_name}\n" ) 1050 # print( "[DYNAMIC] checking Descriptor parameter: #{@global_name}.#{port.get_name} ... #{param.get_name}\n" ) 1051 if port.get_port_type == :CALL then 1052 if param.get_direction == :IN 1053 next if find_ref_desc_port signature 1054 next if find_descriptor_param signature, :DYNAMIC 1055 elsif param.get_direction == :OUT 1056 next if find_dynamic_port signature 1057 next if find_descriptor_param signature, :REF_DESC 1058 end 1059 else # :ENTRY 1060 if param.get_direction == :IN 1061 next if find_dynamic_port signature 1062 next if find_descriptor_param signature, :REF_DESC 1063 elsif param.get_direction == :OUT 1064 next if find_ref_desc_port signature 1065 next if find_descriptor_param signature, :DYNAMIC 1066 end 1067 end 1068 cdl_warning( 'W9999 "$1" cannot handle Descriptor "$2" information for port "$3"', @name, param.get_name, port.get_name ) 1069 } 1070 end 1071 end 1072 } 1073 end 1074 1075 def find_dynamic_port signature 1076 dbgPrint "[DYNAMIC] find_dynamic_port signature=#{signature.get_name}" 1077 @port.each{ |port| 1078 dbgPrint "[DYNAMIC] port=#{port.get_name} signature=#{port.get_signature.get_name} dynamic=#{port.is_dynamic?}" 1079 return port if port.is_dynamic? && port.get_signature == signature 1080 } 1081 return nil 1082 end 1083 def find_ref_desc_port signature 1084 if signature == nil then # すでにエラー 1085 return nil 1086 end 1087 dbgPrint "[DYNAMIC] find_ref_desc_port signature=#{signature.get_name}" 1088 @port.each{ |port| 1089 dbgPrint "[DYNAMIC] port=#{port.get_name} signature=#{port.get_signature.get_name} ref_desc=#{port.is_ref_desc?}" 1090 return port if port.is_ref_desc? && port.get_signature == signature 1091 } 1092 return nil 1093 end 1094 #=== Celltype#ディスクリプタ型でシグニチャが一致し dyn_ref に対応づく引数を探す 1095 #dyn_ref::Symbol: :DYNAMIC=ディスクリプタを得る手段となる引数を探す.:REF_DESC=渡す手段となる引数を探す 1096 def find_descriptor_param signature, dyn_ref 1097 param_list = [] 1098 @port.each{ |port| 1099 port.each_param{ |port, func, param| 1100 type = param.get_type 1101 while type.kind_of? PtrType 1102 type = type.get_type 1103 end 1104 dbgPrint( "[DYNAMIC] dyn_ref=#{dyn_ref} port_type=#{port.get_port_type} dir=#{param.get_direction} paramName=#{param.get_name} paramType=#{type.class}\n" ) 1105 # print( "[DYNAMIC] dyn_ref=#{dyn_ref} port_type=#{port.get_port_type} dir=#{param.get_direction} paramName=#{param.get_name} paramType=#{type.class}\n" ) 1106 if type.kind_of? DescriptorType then 1107 if type.get_signature == signature then 1108 dir = param.get_direction 1109 if dir == :INOUT then 1110 dbgPrint( "[DYNAMIC] found INOUT Descriptor parameter: #{@global_name}.#{port.get_name} ... #{param.get_name}\n" ) 1111 # print( "[DYNAMIC] found INOUT Descriptor parameter: #{@global_name}.#{port.get_name} ... #{param.get_name}\n" ) 1112 return param 1113 elsif dyn_ref == :DYNAMIC then 1114 if dir == :IN && port.get_port_type == :ENTRY || 1115 dir == :OUT && port.get_port_type == :CALL then 1116 dbgPrint( "[DYNAMIC] found INBOUND Descriptor parameter: #{@global_name}.#{port.get_name} ... #{param.get_name}\n" ) 1117 # print( "[DYNAMIC] found INBOUND Descriptor parameter: #{@global_name}.#{port.get_name} ... #{param.get_name}\n" ) 1118 return param 1119 end 1120 elsif dyn_ref == :REF_DESC 1121 if dir == :IN && port.get_port_type == :CALL || 1122 dir == :OUT && port.get_port_type == :ENTRY then 1123 dbgPrint( "[DYNAMIC] found OUTBOUND Descriptor parameter: #{@global_name}.#{port.get_name} ... #{param.get_name}\n" ) 1124 # print( "[DYNAMIC] found OUTBOUND Descriptor parameter: #{@global_name}.#{port.get_name} ... #{param.get_name}\n" ) 1125 return param 1126 end 1127 else 1128 raise "unknown ref_desc" 1129 end 1130 end 1131 end 1132 } 1133 } 1134 return nil 889 1135 end 890 1136 … … 895 1141 # シングルトンセルが同じ linkunit に複数ないかチェック 896 1142 def new_cell( cell ) 1143 dbgPrint "Celltype#new_cell( #{cell.get_name} )\n" 897 1144 # Celltype では Cell の set_owner しない 898 1145 # シングルトンで、プロトタイプ宣言でない場合、コード生成対象リージョンの場合 … … 905 1152 end 906 1153 @cell_list << cell 1154 1155 # プラグインにより生成されたセルタイプか ? 907 1156 if @plugin then 908 1157 @plugin.new_cell cell 909 1158 end 1159 1160 # セルタイププラグインの適用 1161 celltype_plugin_new_cell cell 910 1162 end 911 1163 … … 919 1171 # 呼び口(ただし、最適化で不要となるものは除く) 920 1172 def has_INIB? 921 # print "name=#{@name} @n_attribute_ro=#{@n_attribute_ro} @n_var_size_is=#{@n_var_size_is} @n_call_port=#{@n_call_port} @n_call_port_omitted_in_CB=#{@n_call_port_omitted_in_CB} @n_entry_port_array_ns=#{@n_entry_port_array_ns}\n" 922 return $rom && (@n_attribute_ro > 0 || @n_var_size_is > 0 || ( @n_call_port - @n_call_port_omitted_in_CB ) > 0 || @n_entry_port_array_ns > 0) 923 # return $rom && (@n_attribute_ro > 0 || ( @n_call_port - @n_call_port_omitted_in_CB ) > 0) 1173 1174 result = $rom && 1175 (@n_attribute_ro > 0 || 1176 @n_var_size_is > 0 || 1177 ( @n_call_port - @n_call_port_omitted_in_CB - (@n_call_port_dynamic-@n_call_port_array_dynamic) ) > 0 || 1178 $ram_initializer && @n_call_port_dynamic > 0 || 1179 @n_entry_port_array_ns > 0) 1180 # print "name=#{@name} n_attribute_ro=#{@n_attribute_ro} n_var_size_is=#{@n_var_size_is} n_call_port=#{@n_call_port} n_call_port_omitted_in_CB=#{@n_call_port_omitted_in_CB} n_call_port_dynamic=#{@n_call_port_dynamic} n_call_port_array_dynamic=#{@n_call_port_array_dynamic} n_entry_port_array_ns=#{@n_entry_port_array_ns} has_INIB?=#{result}\n" 1181 1182 return result 924 1183 end 925 1184 … … 934 1193 def has_CB? 935 1194 if $rom then 936 return @n_attribute_rw > 0 || (@n_var-@n_var_size_is) > 0 1195 return @n_attribute_rw > 0 || (@n_var-@n_var_size_is) > 0 || (@n_call_port_dynamic - @n_call_port_array_dynamic) > 0 937 1196 # return @n_attribute_rw > 0 || @n_var > 0 938 1197 else … … 943 1202 #=== Celltype# SET_CB_INIB_POINTER, INITIALIZE_CB が必要か 944 1203 def need_CB_initializer? 945 @n_var_init > 0 || has_CB? 1204 @n_var_init > 0 || has_CB? || ( @n_call_port_dynamic && $ram_initializer ) 946 1205 end 947 1206 … … 998 1257 def is_active? 999 1258 @active 1259 end 1260 1261 def idx_is_id_act? 1262 @idx_is_id_act 1263 end 1264 1265 def multi_domain? 1266 @b_need_ptab 1000 1267 end 1001 1268 … … 1120 1387 # 逆require ポートに対して複数の結合がないかチェックする 1121 1388 # @generate:: [ Symbol, String, Plugin ] = [ PluginName, option, Plugin ] Plugin は生成後に追加される 1389 # @b_post_code_generated:: Bool: true if generated in tmp_plugin_post_code.cdl 1122 1390 # 1123 1391 # composite のためインスタンス変数 … … 1142 1410 # @id:: Integer : コード生成直前に設定 (プロトタイプ宣言の場合は -1 のまま放置) 1143 1411 # @id_specified::Integer : 指定された id 1144 # @restrict_list::{ entry_name => { func_name, [ region_name, ... ] } } 1412 # @restrict_list::{ entry_name => { func_name, [ region_path_str, ... ] } } 1413 # @restrict_list2::{ entry_name => { func_name, [ domain_root_region, ... ] } } 1414 # @b_restrict_referenced::Bool: restrict_list が参照れた 1145 1415 1146 1416 =begin … … 1187 1457 end 1188 1458 1189 1190 # composite で clone されたもの(子孫まで含む)1191 # Join.change_rhs_port にて CompoisteCelltype 内の Join の結合先を変更する際に使用1192 @@cloned_cell_list = {}1193 ### mikan BUG @@cloned_cell_list は composite の階層ごとに記憶していないため、同じ名前が内部に現れると、うまく動作しない1194 # change_rhs_port の実装は、こんな回りくどいことをする必要はなかった。右辺に現れるセル名には、composite のセル名を前につなげるだけでよかった1195 1196 1459 def initialize( ct_path, in_composite = false ) 1197 1460 super() … … 1233 1496 @referenced_port_list = {} 1234 1497 @restrict_list = {} 1498 @restrict_list2 = {} 1499 @b_restrict_referenced = false 1500 @b_post_code_generated = false 1235 1501 1236 1502 @cell_list = {} … … 1258 1524 cell_prev = CompositeCelltype.find( name ) 1259 1525 if cell_prev == nil then 1260 CompositeCelltype.new_cell ( self )1526 CompositeCelltype.new_cell_in_composite( self ) 1261 1527 end 1262 1528 else … … 1437 1703 1438 1704 else 1705 dbgPrint "new_join: cell=#{@name} add_item=#{join.get_name}\n" 1439 1706 # join 1440 1707 @join_list.add_item( join ) … … 1500 1767 1501 1768 # 呼び口側のセルと、そのセルタイプ 1502 cell = Namespace.find cp_cell_nsp 1769 if ! @in_composite then 1770 cell = Namespace.find cp_cell_nsp 1771 else 1772 cell = CompositeCelltype.find cp_cell_nsp.to_s.to_sym 1773 end 1774 1503 1775 if ! cell.instance_of? Cell then 1504 1776 cdl_error( "S9999 '$1': not cell for reverse join", cp_cell_nsp.get_path_str ) … … 1510 1782 end 1511 1783 1512 ep_cell_nsp = get_namespace_path 1784 if ! @in_composite then 1785 ep_cell_nsp = get_namespace_path 1786 ep_cell_nsp_str = ep_cell_nsp.get_path_str 1787 else 1788 ep_cell_nsp = NamespacePath.new @name, false 1789 ep_cell_nsp_str = @name 1790 end 1513 1791 ep_subscript_val = ep_subscript ? ep_subscript.eval_const( nil ) : nil 1514 1792 rhs = Expression.create_cell_join_expression( ep_cell_nsp, ep_subscript_val, ep_name, rj.get_locale ) … … 1521 1799 ss_str = "" 1522 1800 end 1523 dbgPrint "create_reverse_join: #{cell.get_name}.#{cp_name}#{ss_str} => #{ep_cell_nsp .get_path_str}.ep_name\n"1801 dbgPrint "create_reverse_join: #{cell.get_name}.#{cp_name}#{ss_str} => #{ep_cell_nsp_str}.#{ep_name}\n" 1524 1802 } 1525 1803 end … … 1565 1843 set_specifier_list( Generator.get_statement_specifier ) 1566 1844 end 1845 if TECSGEN.post_coded? 1846 @b_post_code_generated = true 1847 end 1567 1848 set_f_def f_def 1568 1849 … … 1581 1862 1582 1863 if ! @in_composite then 1583 if @celltype.instance_of? Celltype then 1864 # if @celltype.instance_of? Celltype then 1865 if @celltype then # composite でも呼びだす, エラー時 nil 1584 1866 @celltype.new_cell self 1585 1867 end … … 1702 1984 end 1703 1985 1704 #=== Cell# セル タイププラグイン (generate 指定子)1986 #=== Cell# セルプラグイン (generate 指定子) 1705 1987 def cell_plugin 1706 1707 load_plugin( @generate[0], CellPlugin )1708 1709 1988 plugin_name = @generate[0] 1710 1989 option = @generate[1] 1711 plugin_object = nil 1712 eval_str = "plugin_object = #{plugin_name}.new( self, option )" 1990 @generate[2] = apply_plugin plugin_name, option 1991 end 1992 1993 def apply_plugin plugin_name, option 1994 if ! @b_defined then 1995 cdl_error( "S9999 plugin cannot apply to prototype cell '$1'", @name ) 1996 end 1997 1998 plClass = load_plugin( plugin_name, CellPlugin ) 1999 # return if plClass == nil # 従来と仕様が変わるので、継続する 1713 2000 if $verbose then 1714 print "new cell : #{eval_str}\n"2001 print "new cell plugin: plugin_object = #{plClass.class.name}.new( #{@name}, #{option} )\n" 1715 2002 end 1716 2003 1717 2004 begin 1718 eval( eval_str ) # plugin を生成2005 plugin_object = plClass.new( self, option ) 1719 2006 plugin_object.set_locale @locale 1720 @generate[ 2 ] = plugin_object1721 2007 generate_and_parse plugin_object 1722 2008 rescue Exception => evar 1723 2009 cdl_error( "S1166 $1: fail to new", plugin_name ) 1724 print "eval( #{eval_str} )\n"1725 1726 2010 print_exception( evar ) 1727 2011 end 2012 return plugin_object 1728 2013 end 1729 2014 … … 1742 2027 1743 2028 # debug 1744 dbgPrint "Cell#clone_for_composite : cloning: #{@name} #{global_name} b_defined=#{@b_defined}\n" 2029 dbgPrint " CLONING Cell#clone_for_composite : cloning: #{@name} #{global_name} b_defined=#{@b_defined} #{self}=>#{@my_clone} \n" 2030 dbgPrint " my_name=#{@name} name=#{name} owner class=#{@owner.class.name}\n" 1745 2031 1746 2032 @my_clone = self.clone 1747 @@cloned_cell_list[ self ] = @my_clone1748 2033 1749 2034 # clone したセルの内部に持つ名前情報を調整する 1750 1751 2035 @my_clone.set_cloned( name, global_name, namespacePath, join_array, ct_name, region, plugin, locale ) 1752 2036 … … 1772 2056 # debug 1773 2057 dbgPrint "cell.set_cloned : global_name: #{global_name} name: #{name} @name: #{@name}\n" 1774 2058 dbgPrint "set_cloned: entry_array_max_subscript.len=#{@entry_array_max_subscript.length}\n" 1775 2059 @global_name = :"#{global_name}_#{@name}" 1776 2060 @name = :"#{name}_#{@name}" … … 1796 2080 @alloc_list = [] 1797 2081 @require_joined_list = {} 1798 @entry_array_max_subscript = {}2082 @entry_array_max_subscript = @entry_array_max_subscript.dup 1799 2083 @cell_list = {} 1800 2084 @cell_list2 = [] … … 1805 2089 @join_list.change_item j 1806 2090 } 2091 end 2092 2093 #=== clone されたセルが composite の場合、内部セルを展開する 2094 #self:: clone されたセルでなければならない 2095 def expand_inner 2096 if ! @f_cloned then 2097 raise "expnad_inner: not cloned cell" 2098 end 1807 2099 1808 2100 # clone しようとするセルが composit セルタイプ? … … 1811 2103 @cell_list, @cell_list2 = @celltype.expand( @name, @global_name, @NamespacePath, @join_list, @region, @plugin, @locale ) 1812 2104 end 1813 1814 2105 end 1815 2106 1816 2107 #=== Cell# clone された cell の join_list の右辺の変更 1817 2108 # 呼び口の右辺の cell を他の clone された cell に置換え 1818 def change_rhs_port 2109 def change_rhs_port cloned_cell_list 1819 2110 1820 2111 # debug 1821 dbgPrint " Cell change_rhs_port: global_name: #{@global_name}\n"2112 dbgPrint "===== Cell#change_rhs_port: name=#{@name} =====\n" 1822 2113 1823 2114 @join_list.get_items.each { |j| 1824 j.change_rhs_port( @@cloned_cell_list, @celltype ) 1825 } 1826 1827 if @celltype.instance_of?( CompositeCelltype ) then 1828 1829 # 入れ子のセルについても変更 1830 @cell_list.each{ |name,c| 1831 c.change_rhs_port 1832 } 1833 end 2115 j.change_rhs_port( cloned_cell_list, @celltype ) 2116 } 1834 2117 end 1835 2118 … … 1891 2174 def is_in_composite? 1892 2175 @in_composite 2176 end 2177 2178 #=== Cell# composite のセルか? 2179 def is_of_composite? 2180 if @celltype.kind_of? CompositeCelltype 2181 return true 2182 else 2183 return false 2184 end 2185 end 2186 2187 #=== Cell# tmp_plugin_post_code.cdl で生成されたセルか? 2188 def post_code_generated? 2189 @b_post_code_generated 1893 2190 end 1894 2191 … … 1980 2277 1981 2278 # セルタイプ内で port_name の CompositeCelltypeJoin を探す(コード生成段階では必ず見つかる) 2279 # print "get_real_cell: cell=#{@name} port=#{port_name}\n" 2280 # pp @cell_list 1982 2281 cj = @celltype.find_export( port_name ) 1983 2282 … … 1991 2290 end 1992 2291 2292 #=== Cell#get_real_celltype 2293 # 2294 def get_real_celltype( port_name ) 2295 if @celltype.instance_of?( CompositeCelltype ) then 2296 return @celltype.get_real_celltype port_name 2297 else 2298 return @celltype 2299 end 2300 end 1993 2301 1994 2302 #=== Cell# 受け口のport の参照カウントをアップする … … 2033 2341 end 2034 2342 2343 #Cell#属性の初期値を得る 2344 #attr_name::Symbol 必ず初期化されていないと Ruby 例外となる 2345 def get_attr_initializer attr_name 2346 val = @join_list.get_item( attr_name ) 2347 if val == nil then 2348 val = (@celltype.find attr_name).get_initializer 2349 else 2350 val = val.get_rhs 2351 end 2352 return val 2353 end 2354 2035 2355 def get_celltype 2036 2356 @celltype … … 2075 2395 #=== Cell# composite の内側セルの受け口配列の添数の最大値を設定 2076 2396 def set_entry_inner_port_max_subscript( port, num ) 2077 if @cell_list == nil then # mikan これって問題ない?2078 return # プロトタイプ宣言しかされていなくて、内側セルが展開されていない 2397 if @cell_list == nil then 2398 return # プロトタイプ宣言しかされていなくて、内側セルが展開されていない or composite 展開前 2079 2399 end 2080 2400 2081 2401 # composite の内側のセルに伝播 2082 2402 if @celltype.instance_of? CompositeCelltype then 2403 dbgPrint "set_entry_inner_port_max_subscript #{@name} #{@port} #{num} cell_list.len=#{@cell_list.length}\n" 2404 # @cell_list.each{ |c, p| print c, p, '\n' } 2405 2083 2406 cj = @celltype.find_export port.get_name 2084 2407 if cj && @cell_list[ cj.get_cell_name.to_s ] then … … 2278 2601 else 2279 2602 cell = j.get_rhs_cell2 2280 next if cell == nil # 右辺が見つからなかった.既にエラー2603 next if cell == nil || cell.get_celltype == nil # 右辺が見つからなかった.既にエラー 2281 2604 port = cell.get_celltype.find( j.get_rhs_port2 ) 2605 if port == nil then 2606 dbgPrint "set_port_ref: #{@name}.#{j.get_name} = #{cell.get_name}.#{j.get_rhs_port2}\n" 2607 # through プラグインで生成されたセルの受け口が見つからないケース (のハズ) 2608 cdl_error( "entry '$1' not found in '$2' refered from $3.$4", j.get_rhs_port2, cell.get_name, @name, j.get_name ) 2609 next 2610 end 2282 2611 dbgPrint( "set_port_reference_count: #{@name}.#{j.get_name} => #{cell.get_name}.#{port.get_name}\n") 2283 2612 cell.port_referenced port … … 2672 3001 } 2673 3002 else 3003 dbgPrint "set_definition_join: #{@name}.#{join.get_name} celltype=#{@celltype.get_name}\n" 2674 3004 join.set_definition( @celltype.find(join.get_name) ) 2675 3005 end … … 2687 3017 expand 2688 3018 end 2689 2690 # celltype に generate が指定されされているか2691 celltype_plugin = @celltype.get_celltype_plugin2692 if celltype_plugin then2693 begin2694 celltype_plugin.new_cell self2695 rescue Exception => evar2696 cdl_error( "S1037 $1: celltype plugin fail to new_cell" , celltype_plugin.class.name )2697 print_exception( evar )2698 end2699 end2700 3019 end 2701 3020 … … 2705 3024 2706 3025 #debug 2707 dbgPrint "expanding #{@name} #{@celltype.get_name}\n" 2708 2709 # 展開されたセルのリスト 2710 @@cloned_cell_list = {} 3026 dbgPrint "===== expanding #{@name} =====\n" 2711 3027 2712 3028 # composite celltype の cell を展開 … … 2718 3034 set_f_ref 2719 3035 end 2720 2721 # 呼び口の右辺のセルを clone したものに変更 2722 self.change_rhs_port 3036 end 3037 3038 #=== Cell#内部セルの受け口添数最大値を設定 3039 def set_max_entry_port_inner_cell 3040 if @cell_list == nil then 3041 return 3042 end 3043 3044 dbgPrint "set_max_entry_port_inner_cell name=#{@name} entry_array_max_subscript.len=#{@entry_array_max_subscript.length}\n" 2723 3045 2724 3046 # プロトタイプ宣言で設定されていたものを反映する 2725 3047 @entry_array_max_subscript.each{ |port,name| 3048 dbgPrint "set_entry_inner_port_max_subscript( #{port}, #{name} )\n" 2726 3049 set_entry_inner_port_max_subscript( port, name ) 2727 3050 } … … 2730 3053 #=== Cell#restrict を追加 2731 3054 def add_restrict( entry_name, func_name, region_name_list ) 2732 if @restrict_list[ entry_name ] then 2733 if @restrict_list[ entry_name ][ func_name ] then 2734 @restrict_list[ entry_name ][ func_name ].each{ |rn| 2735 if region_name_list.include? rn then 2736 # p func_name 2737 name = func_name ? entry_name : entry_name+"."+func_name 2738 cdl_warning( "W9999 $1 restrict region duplicate $2", name, rn ) 3055 if @restrict_list[ entry_name ] == nil then 3056 @restrict_list[ entry_name ] = {} 3057 @restrict_list2[ entry_name ] = {} 3058 end 3059 if @restrict_list[ entry_name ][ func_name ] == nil then 3060 @restrict_list[ entry_name ][ func_name ] = [] 3061 @restrict_list2[ entry_name ][ func_name ] = [] 3062 end 3063 region_name_list.each { |rp| 3064 @restrict_list[ entry_name ][ func_name ] << rp 3065 # p "Class: " + rp.to_s 3066 obj = Namespace.find rp 3067 if ( obj.kind_of? Region ) then 3068 @restrict_list2[ entry_name ][ func_name ] << obj.get_domain_root 3069 else 3070 cdl_error( "S9999 $1 not found or not region", rp.to_s ) 3071 end 3072 } 3073 end 3074 3075 #=== Cell#check_restrict_list 3076 def check_restrict_list 3077 # p "check_restrict_list" 3078 @restrict_list.each{ |entry_name, func_hash| 3079 func_hash.each{ |func_name, region_list| 3080 region_list.each{ |rp| 3081 obj = Namespace.find rp 3082 if ( obj.kind_of? Region ) then 3083 if obj.get_domain_root != @region.get_domain_root then 3084 else 3085 cdl_info( "I9999 $1: restrict calling domain to $2, which is same domain as the cell locates", @name, rp.to_s ) 3086 # restrict を同じドメインを指定してもよいこととする (HRP3) 3087 # KernelDoamin 内のセルに対し、KernelDomain に restrict している場合、 3088 # 無所属経由で結合されているが、KernelDomain から呼出すことを想定した許可 3089 end 3090 else 3091 cdl_error( "S9999 $1 not region", rp.to_s ) 3092 end 3093 } 3094 } 3095 } 3096 end 3097 3098 #=== Cell#callable? 3099 def callable?( callee_cell, entry_name, func_name ) 3100 # p "callable? #{@name}" 3101 res = callee_cell.callable_from?( entry_name, func_name, self ) 3102 dbgPrint "callable? #{callee_cell.get_namespace_path}.#{entry_name}.#{func_name} from #{@NamespacePath} is #{res}\n" 3103 return res 3104 end 3105 3106 #=== Cell#callable_from? (private) 3107 def callable_from?( entry_name, func_name, caller_cell ) 3108 @b_restrict_referenced = true 3109 if @restrict_list.length == 0 then 3110 return true 3111 end 3112 3113 dr = caller_cell.get_region.get_domain_root 3114 if @restrict_list[entry_name] then 3115 if @restrict_list[entry_name][func_name] then 3116 @restrict_list2[entry_name][func_name].each{ |region| 3117 if dr == region then 3118 return true 3119 end 3120 } 3121 elsif @restrict_list[entry_name][nil] then 3122 @restrict_list2[entry_name][nil].each{ |region| 3123 if dr == region then 3124 return true 2739 3125 end 2740 3126 } 2741 3127 else 2742 @restrict_list[ entry_name ][ func_name ] = region_name_list 2743 end 2744 else 2745 func_list = { } 2746 func_list[ func_name ] = region_name_list 2747 @restrict_list[ entry_name ] = func_list 2748 end 2749 # pp @restrict_list 2750 end 2751 2752 #=== Cell#check_restrict_list 2753 def check_restrict_list 2754 @restrict_list.each{ |entry_name, func_hash| 2755 func_hash.each{ |func_name, region_list| 2756 region_list.each{ |rn| 2757 obj = Namespace.find [ rn ] 2758 if ( obj.kind_of? Region ) then 2759 if obj.get_domain_root != @region.get_domain_root then 2760 else 2761 cdl_warning( "W9999 $1 in same domain", rn ) 2762 end 2763 else 2764 cdl_error( "S9999 $1 not region", region ) 2765 end 2766 } 2767 } 2768 } 2769 end 2770 2771 #=== Cell#callable? 2772 def callable?( callee_cell, entry_name, func_name ) 2773 res = callee_cell.callable_from?( entry_name, func_name, self ) 2774 dbgPrint "callable? #{callee_cell.get_namespace_path}.#{entry_name}.#{func_name} from #{@NamespacePath} is #{res}\n" 2775 return res 2776 end 2777 2778 #=== Cell#callable_from? (private) 2779 def callable_from?( entry_name, func_name, caller_cell ) 2780 if @restrict_list.length == 0 then 3128 return false 3129 end 3130 else 3131 return false 3132 end 3133 end 3134 3135 #=== Cell#get_callable_regions( entry_name, func_name ) 3136 # func_name=nil の場合、entry_name の可否をチェック数る 3137 # nil が返る場合、制限されていないことを意味する 3138 def get_restricted_regions( entry_name, func_name ) 3139 # p "get_restricted_regions #{@name}" 3140 @b_restrict_referenced = true 3141 if @restrict_list[entry_name] then 3142 if @restrict_list[entry_name][func_name] then 3143 return @restrict_list2[entry_name][func_name] 3144 else 3145 return @restrict_list2[entry_name][nil] 3146 end 3147 end 3148 return nil 3149 end 3150 3151 #=== Cell#has_ineffective_restrict_specifier 3152 # restrict 指定子が指定されていて、参照されていない場合 true 3153 # 参照は、HRPSVCPlugin のみ 3154 def has_ineffective_restrict_specifier 3155 if @restrict_list.length != 0 && @b_restrict_referenced == false then 2781 3156 return true 2782 end 2783 2784 if @restrict_list[entry_name] then 2785 if @restrict_list[entry_name][nil] && 2786 @restrict_list[entry_name][nil].include?( caller_cell.get_region.get_domain_root.get_name )then 2787 return true 2788 end 2789 if @restrict_list[entry_name][func_name] && 2790 @restrict_list[entry_name][func_name].include?( caller_cell.get_region.get_domain_root.get_name )then 2791 return true 2792 else 2793 return false 2794 end 2795 else 2796 return true 2797 end 2798 end 2799 3157 else 3158 return false 3159 end 3160 end 3161 2800 3162 def show_tree( indent ) 2801 3163 indent.times { print " " } … … 2857 3219 # @name:: str 2858 3220 # @global_name:: str 2859 # @cell_list:: NamedList Cell 3221 # @cell_list_in_composite:: NamedList Cell 3222 # @cell_list::Array :: [ Cell ] : cell of CompositeCelltype's cell 2860 3223 # @export_name_list:: NamedList : CompositeCelltypeJoin 2861 3224 # @port_list:: CompositeCelltypeJoin[] … … 2867 3230 # @name_list:: NamedList item: Decl (attribute), Port エクスポート定義 2868 3231 # @internal_allocator_list:: [ [cell, internal_cp_name, port_name, func_name, param_name, ext_alloc_ent], ... ] 3232 # @generate:: [ Symbol, String, Plugin ] = [ PluginName, option, Plugin ] Plugin は生成後に追加される 3233 # @generate_list:: [ [ Symbol, String, Plugin ], ... ] generate 文で追加された generate 2869 3234 2870 3235 @@nest_stack_index = -1 2871 3236 @@nest_stack = [] 2872 3237 @@current_object = nil 3238 3239 include CelltypePluginModule 3240 include PluginModule 2873 3241 2874 3242 def self.push … … 2889 3257 super() 2890 3258 @name = name 2891 @cell_list = NamedList.new( nil, "in composite celltype #{name}" ) 3259 @cell_list_in_composite = NamedList.new( nil, "in composite celltype #{name}" ) 3260 @cell_list = [] 2892 3261 @export_name_list = NamedList.new( nil, "export in composite celltype #{name}" ) 2893 3262 @name_list = NamedList.new( nil, "in composite celltype #{name}" ) … … 2910 3279 @attr_list = [] 2911 3280 @internal_allocator_list = [] 3281 @generate_list = [] 2912 3282 set_specifier_list( Generator.get_statement_specifier ) 2913 3283 end … … 2920 3290 # CompositeCelltype#end_of_parse 2921 3291 def end_of_parse 2922 2923 3292 # singleton に関するチェック 2924 3293 if @b_singleton && @real_singleton == nil then … … 2960 3329 # mikan relay が正しく抜けているかチェックされていない 2961 3330 3331 # callback 結合 3332 @cell_list_in_composite.get_items.each{ |c| 3333 ct = c.get_celltype 3334 if ct then 3335 c.create_reverse_join 3336 end 3337 } 3338 2962 3339 # 意味解析 2963 @cell_list .get_items.each{ |c|3340 @cell_list_in_composite.get_items.each{ |c| 2964 3341 c.set_definition_join 2965 3342 } 2966 3343 2967 3344 # cell の未結合の呼び口がないかチェック 2968 @cell_list .get_items.each{ |c|3345 @cell_list_in_composite.get_items.each{ |c| 2969 3346 c.check_join 2970 3347 c.check_reverse_require … … 3004 3381 } 3005 3382 } 3006 end 3007 3008 ### cell (CompositeCelltype) 3009 def self.new_cell( cell ) 3010 @@current_object.new_cell( cell ) 3011 3012 end 3013 3014 def new_cell( cell ) 3383 3384 # composite プラグイン 3385 if @generate then 3386 celltype_plugin 3387 end 3388 end 3389 3390 ### CompositeCelltype#new_cell_in_composite 3391 def self.new_cell_in_composite( cell ) 3392 @@current_object.new_cell_in_composite( cell ) 3393 3394 end 3395 3396 def new_cell_in_composite( cell ) 3015 3397 cell.set_owner self # Cell (in_omposite) 3016 @cell_list .add_item( cell )3398 @cell_list_in_composite.add_item( cell ) 3017 3399 if cell.get_celltype then # nil ならば、すでにセルタイプなしエラー 3018 3400 if cell.get_celltype.is_singleton? then … … 3031 3413 internal_cell_elem_name, type ) 3032 3414 3415 end 3416 3417 ### CompositeCelltype#new_cell 3418 def new_cell cell 3419 @cell_list << cell 3420 3421 # セルタイププラグインの適用 3422 celltype_plugin_new_cell cell 3033 3423 end 3034 3424 … … 3050 3440 dbgPrint "new_join: #{export_name} #{internal_cell_name} #{internal_cell_elem_name}\n" 3051 3441 3052 cell = @cell_list .get_item( internal_cell_name )3442 cell = @cell_list_in_composite.get_item( internal_cell_name ) 3053 3443 if cell == nil then 3054 3444 cdl_error( "S1057 $1 not found in $2" , internal_cell_name, @name ) … … 3107 3497 elsif obj.is_omit? != obj2.is_omit? then 3108 3498 cdl_error( "S9999 $1 : omit specifier mismatch with previous definition" , export_name ) 3499 elsif obj.is_dynamic? != obj2.is_dynamic? then 3500 cdl_error( "S9999 $1 : dynamic specifier mismatch with previous definition" , export_name ) 3501 elsif obj.is_ref_desc? != obj2.is_ref_desc? then 3502 cdl_error( "S9999 $1 : ref_desc specifier mismatch with previous definition" , export_name ) 3109 3503 end 3110 3504 else … … 3292 3686 def find name 3293 3687 dbgPrint "CompositeCelltype: find in composite: #{name}\n" 3294 cell = @cell_list .get_item( name )3688 cell = @cell_list_in_composite.get_item( name ) 3295 3689 return cell if cell 3296 3690 … … 3333 3727 clone_cell_list = {} 3334 3728 clone_cell_list2 = [] 3729 clone_cell_list3 = {} 3335 3730 3336 3731 # composite 内部のすべての cell について 3337 @cell_list .get_items.each { |c|3732 @cell_list_in_composite.get_items.each { |c| 3338 3733 3339 3734 # debug … … 3359 3754 # debug 3360 3755 if j then 3361 dbgPrint " expand : parent cell: #{name} child cell: #{c.get_name}: parent's export port: #{cj.get_name} join: #{j.get_name} #{j}\n"3756 dbgPrint " REWRITE_EX parent cell: #{name} child cell: #{c.get_name}: parent's export port: #{cj.get_name} join: #{j.get_name}=>#{j.get_rhs.to_s}\n" 3362 3757 else 3363 3758 dbgPrint "expand : parent cell: #{name} child cell: #{c.get_name}: parent's export port: #{cj.get_name} join: nil\n" … … 3394 3789 clone_cell_list[ "#{c.get_local_name}" ] = c2 3395 3790 clone_cell_list2 << c2 3791 clone_cell_list3[ c ] = c2 3396 3792 3397 3793 } … … 3403 3799 j.set_cloned( clone_cell_list[ "#{c.get_local_name}" ] ) 3404 3800 } 3801 dbgPrint "change_rhs_port: inner cell #{c.get_name}\n" 3802 c.change_rhs_port clone_cell_list3 3803 } 3804 clone_cell_list2.each { |c| 3805 c.expand_inner 3405 3806 } 3406 3807 return [ clone_cell_list, clone_cell_list2 ] … … 3419 3820 when :ACTIVE 3420 3821 @b_active = true 3822 when :GENERATE 3823 if @generate then 3824 cdl_error( "S9999 generate specifier duplicate" ) 3825 end 3826 @generate = [ s[1], s[2] ] # [ PluginName, "option" ] 3421 3827 else 3422 3828 cdl_error( "S1071 $1 cannot be specified for composite" , s[0] ) … … 3429 3835 end 3430 3836 3837 def get_global_name 3838 @global_name 3839 end 3840 3431 3841 def get_port_list 3432 3842 @port_list … … 3443 3853 def get_internal_allocator_list 3444 3854 @internal_allocator_list 3855 end 3856 3857 #== CompositeCelltype#get_real_celltype 3858 # port_name に接続されている内部のセルタイプを得る 3859 def get_real_celltype( port_name ) 3860 cj = find_export port_name 3861 inner_celltype = cj.get_cell.get_celltype 3862 if inner_celltype.instance_of? CompositeCelltype then 3863 return inner_celltype.get_real_celltype 3864 else 3865 return inner_celltype 3866 end 3445 3867 end 3446 3868 … … 3465 3887 def is_inactive? 3466 3888 if @b_active == false then 3467 @cell_list .get_items.each{ |c|3889 @cell_list_in_composite.get_items.each{ |c| 3468 3890 if c.get_celltype && c.get_celltype.is_inactive? == false then 3469 3891 # c.get_celltype == nil の場合はセルタイプ未定義ですでにエラー … … 3486 3908 (indent+1).times { print " " } 3487 3909 puts "active: #{@b_active}, singleton: #{@b_singleton}" 3488 @cell_list .show_tree( indent + 1 )3910 @cell_list_in_composite.show_tree( indent + 1 ) 3489 3911 (indent+1).times { print " " } 3490 3912 puts "name_list" … … 3532 3954 # @b_omit:: bool : omit 指定子が指定された (call port のみ) 3533 3955 # @b_optional:: bool : call port のみ 3534 # @b_ref_des :: bool : ref_desc キーワードが指定された3956 # @b_ref_desc:: bool : ref_desc キーワードが指定された 3535 3957 # @b_dynamic:: bool : dynamic キーワードが指定された (呼び口のみ) 3536 3958 # … … 3638 4060 @b_inline = false 3639 4061 @b_optional = false 4062 @b_omit = false 3640 4063 @b_ref_desc = false 3641 4064 @b_dynamic = false … … 3655 4078 else 3656 4079 # entry port optimize 3657 if $unopt then4080 if $unopt || $unopt_entry then 3658 4081 # 最適化なし 3659 4082 @b_VMT_useless = false # VMT 不要 (true の時 VMT を介することなく呼出す) … … 3786 4209 @b_optional = true 3787 4210 when :REF_DESC 4211 if @port_type == :ENTRY then 4212 cdl_error( "S9999 ref_desc: cannnot be specified for entry port" ) 4213 next 4214 end 3788 4215 @b_ref_desc = true 3789 4216 when :DYNAMIC … … 3806 4233 end 3807 4234 } 4235 if ( @b_dynamic || @b_ref_desc ) then 4236 if @b_dynamic then 4237 dyn_ref = "dynamic" 4238 else 4239 dyn_ref = "ref_desc" 4240 end 4241 if @b_omit then # is_omit? は is_empty? も含んでいるので使えない 4242 cdl_error( "S9999 omit cannot be specified with $1", dyn_ref ) 4243 elsif @signature && @signature.is_empty? then 4244 cdl_error( "S9999 $1 cannot be specified for empty signature", dyn_ref ) 4245 elsif @signature && @signature.has_descriptor? then 4246 # cdl_error( "S9999 $1 port '$2' cannot have Descriptor in its signature", dyn_ref, @name ) 4247 end 4248 4249 elsif @b_dynamic && @b_ref_desc then 4250 cdl_error( "S9999 both dynamic & ref_desc cannot be specified simultaneously" ) 4251 end 3808 4252 end 3809 4253 … … 3958 4402 3959 4403 def is_VMT_useless? # VMT 関数テーブルを使用しない 3960 @b_VMT_useless 4404 if @port_type == :ENTRY && $unopt_entry == true then 4405 # プラグインから $unopt_entry を設定するケースのため 4406 # ここで読み出すときに、false を返す (reset_optimize での設定変更は速すぎる) 4407 return false 4408 else 4409 return @b_VMT_useless 4410 end 3961 4411 end 3962 4412 3963 4413 def is_skelton_useless? # スケルトン関数不要 (true の時、受け口関数を呼出す) 3964 @b_skelton_useless 4414 if @port_type == :ENTRY && $unopt_entry == true then 4415 # プラグインから $unopt_entry を設定するケースのため 4416 # ここで読み出すときに、false を返す (reset_optimize での設定変更は速すぎる) 4417 return false 4418 else 4419 return @b_skelton_useless 4420 end 3965 4421 end 3966 4422 … … 4078 4534 def is_reverse_required? 4079 4535 @reverse_require_cell_path != nil 4536 end 4537 4538 #=== Port# is_dynamic? 4539 def is_dynamic? 4540 @b_dynamic 4541 end 4542 4543 #=== Port# is_ref_desc? 4544 def is_ref_desc? 4545 @b_ref_desc 4080 4546 end 4081 4547 … … 4489 4955 if ! c.get_f_def then # Namespace の @cell_list にはプロトタイプが含まれるケースあり 4490 4956 if c.get_f_ref then 4491 c dl_error( "S1093 $1 : undefined cell" , c.get_namespace_path.get_path_str )4957 c.cdl_error( "S1093 $1 : undefined cell" , c.get_namespace_path.get_path_str ) 4492 4958 elsif $verbose then 4493 c dl_warning( "W1006 $1 : only prototype, unused and undefined cell" , c.get_namespace_path.get_path_str )4959 c.cdl_warning( "W1006 $1 : only prototype, unused and undefined cell" , c.get_namespace_path.get_path_str ) 4494 4960 end 4495 4961 else … … 4498 4964 # if c.get_f_ref == false && c.is_generate? && ct && ct.is_inactive? then 4499 4965 if c.get_f_ref == false && ct && ct.is_inactive? then 4500 cdl_warning( "W1007 $1 : non-active cell has no entry join and no factory" , c.get_namespace_path.get_path_str ) 4966 c.cdl_warning( "W1007 $1 : non-active cell has no entry join and no factory" , c.get_namespace_path.get_path_str ) 4967 end 4968 if c.has_ineffective_restrict_specifier then 4969 c.cdl_warning( "W9999: $1 has ineffective restrict specifier", c.get_namespace_path.get_path_str ) 4501 4970 end 4502 4971 end … … 4657 5126 end 4658 5127 5128 #=== Namespace# set_max_entry_port_inner_cell 5129 # セルタイプに属するすべてのセルに対して実施 5130 def set_max_entry_port_inner_cell 5131 # celltype のコードを生成 5132 @cell_list.each { |c| 5133 c.set_max_entry_port_inner_cell 5134 } 5135 @namespace_list.each{ |ns| 5136 ns.set_max_entry_port_inner_cell 5137 } 5138 end 5139 4659 5140 #=== Namespace# セルの結合をチェックする 4660 5141 def check_join … … 4681 5162 end 4682 5163 5164 #== Namespace (Region) に属するセルのリスト 5165 def get_cell_list 5166 @cell_list 5167 end 5168 5169 #== Namespace (Region)# 子リージョンのリスト 5170 # 5171 # リージョンは Namespace クラスで namespace として記憶されている 5172 def get_region_list 5173 @namespace_list 5174 end 5175 4683 5176 def show_tree( indent ) 4684 5177 indent.times { print " " } … … 4904 5397 4905 5398 if object == nil then # (2) 4906 cdl_error( "S1109 \'$1\' not found" , @cell_name)5399 cdl_error( "S1109 \'$1\' not found" , nsp.to_s ) 4907 5400 elsif ! object.instance_of?( Cell ) then # (3) 4908 cdl_error( "S1110 \'$1\' not cell" , @cell_name)5401 cdl_error( "S1110 \'$1\' not cell" , nsp.to_s ) 4909 5402 else 4910 5403 dbgPrint "set_definition: set_f_ref #{@owner.get_name}.#{@name} => #{object.get_name}\n" … … 5277 5770 next_cell_nsp = @through_generated_list[ i + 1 ].get_cell_namespace_path 5278 5771 next_port_name = @through_generated_list[ i + 1 ].get_through_entry_port_name 5772 next_port_subscript = @through_generated_list[ i + 1 ].get_through_entry_port_subscript 5279 5773 rescue Exception => evar 5280 5774 cdl_error( "S1124 $1: plugin function failed: \'get_through_entry_port_name\'" , plugin_name ) … … 5295 5789 next_cell = @cell 5296 5790 next_port_name = @port_name 5791 next_port_subscript = @rhs_subscript 5297 5792 5298 5793 if next_cell == nil then … … 5306 5801 # region から @cell_name.@port_name への through がないか探す 5307 5802 # rp = @through_list[i][3].find_cell_port_through_plugin( @cell_name, @port_name ) #762 5308 rp = @through_list[i][3].find_cell_port_through_plugin( @cell.get_global_name, @port_name )5803 rp = @through_list[i][3].find_cell_port_through_plugin( @cell.get_global_name, @port_name, @rhs_subscript ) 5309 5804 # @through_list[i] と @region_through_list[i-cp_len] は同じ 5310 5805 # 共用しないようにするには、見つからなかったことにすればよい … … 5317 5812 5318 5813 if rp == nil then 5319 if( load_plugin( plugin_name, ThroughPlugin ) ) then 5320 gen_through_cell_code_and_parse( plugin_name, i, next_cell, next_port_name ) 5814 plClass = load_plugin( plugin_name, ThroughPlugin ) 5815 if( plClass ) then 5816 gen_through_cell_code_and_parse( plugin_name, i, next_cell, next_port_name, next_port_subscript, plClass ) 5321 5817 end 5322 5818 else … … 5331 5827 # 生成したものを region(@through_list[i][3]) のリストに追加 5332 5828 # @through_list[i][3].add_cell_port_through_plugin( @cell_name, @port_name, @through_generated_list[i] ) #762 5333 @through_list[i][3].add_cell_port_through_plugin( @cell.get_global_name, @port_name, @ through_generated_list[i] )5829 @through_list[i][3].add_cell_port_through_plugin( @cell.get_global_name, @port_name, @rhs_subscript, @through_generated_list[i] ) 5334 5830 end 5335 5831 end … … 5365 5861 5366 5862 #=== Join# through プラグインを呼び出して CDL 生成させるとともに、import する 5367 def gen_through_cell_code_and_parse( plugin_name, i, next_cell, next_port_name )5863 def gen_through_cell_code_and_parse( plugin_name, i, next_cell, next_port_name, next_port_subscript, plClass ) 5368 5864 5369 5865 through = @through_list[ i ] … … 5389 5885 end 5390 5886 @@plugin_creating_join = self 5391 5392 5887 caller_cell = @owner 5393 5888 5394 plugin_object = nil5395 eval_str = "plugin_object = #{plugin_name}.new( '#{generating_cell_name}'.to_sym, plugin_arg.to_s, next_cell, '#{next_port_name}'.to_sym, @definition.get_signature, @celltype, caller_cell )"5396 if $verbose then5397 print "new through: #{eval_str}\n"5398 end5399 5400 5889 begin 5401 eval( eval_str ) # plugin を生成 5890 plugin_object = plClass.new( generating_cell_name.to_sym, plugin_arg.to_s, 5891 next_cell, next_port_name.to_sym, next_port_subscript, 5892 @definition.get_signature, @celltype, caller_cell ) 5402 5893 plugin_object.set_locale @locale 5403 5894 rescue Exception => evar … … 5406 5897 print "signature: #{@definition.get_signature.get_name} from: #{caller_cell.get_name} to: #{next_cell.get_name} of celltype: #{@celltype.get_name}\n" 5407 5898 end 5408 print "eval( #{eval_str} )\n"5409 5410 5899 print_exception( evar ) 5411 5900 return … … 5596 6085 end 5597 6086 5598 def get_rhs_subscript 6087 # 末尾数字1 : CDL で指定された、右辺のセルを返す 6088 def get_rhs_cell1 # get_cell と同じ 6089 @cell 6090 end 6091 def get_rhs_port1 # get_port_name 同じ 6092 @port_name 6093 end 6094 def get_rhs_subscript1 5599 6095 @rhs_subscript 5600 6096 end … … 5606 6102 # through 指定あり? 5607 6103 if @through_list[0] then 5608 # mikan through で生成したものが root namespace 限定5609 6104 # through で生成されたセルを探す 5610 # cell = Namespace.find( [ "::", @through_generated_list[0].get_cell_name.to_sym ] ) #15611 6105 cell = Namespace.find( @through_generated_list[0].get_cell_namespace_path ) #1 5612 6106 # cell のプラグインで生成されたポート名のポートを探す (composite なら内部の繋がるポート) … … 5615 6109 # ポートを返す(composite なら内部の繋がるポートを返す) 5616 6110 return @cell.get_real_port( @port_name ) 6111 end 6112 end 6113 6114 #=== Join# 右辺の配列添数を得る 6115 # 右辺が through の場合は挿入されたセルの添数 6116 # 右辺が composite の場合は、内部の繋がるセルのポートの添数 (composite では変わらない) 6117 # このメソッドは get_rhs_cell, と対になっている 6118 def get_rhs_subscript 6119 if @through_list[0] then 6120 return @through_generated_list[0].get_through_entry_port_subscript 6121 else 6122 return @rhs_subscript 5617 6123 end 5618 6124 end … … 5718 6224 # composite cell を展開したセルの結合を clone したセルの名前に変更 5719 6225 def change_rhs_port( clone_cell_list, celltype ) 6226 dbgPrint "change_rhs_port: name=#{@name}\n" 5720 6227 5721 6228 # debug 5722 6229 if $debug then 5723 dbgPrint "change_rhs name: #{@name} cell_name: #{@cell_name} #{@cell} #{self}\n" 6230 # if @name == :cCallB then 6231 # dbgPrint "change_rhs name: #{@name} cell_name: #{@cell_name} #{@cell} #{self}\n" 6232 print "============\n" 6233 print "CHANGE_RHS change_rhs name: #{@owner.get_name}.#{@name} rhs cell_name: #{@cell_name} #{@cell} #{self}\n" 5724 6234 5725 6235 clone_cell_list.each{ |cell, ce| 5726 dbgPrint "change_rhs: #{cell.get_name}=#{cell} : #{ce.get_name}\n" 6236 # dbgPrint "=== change_rhs: #{cell.get_name}=#{cell} : #{ce.get_name}\n" 6237 print " CHANGE_RHS change_rhs: #{cell.get_name}=#{cell} : #{ce.get_name}\n" 5727 6238 } 6239 print "============\n" 5728 6240 end 5729 6241 … … 5732 6244 5733 6245 # debug 5734 dbgPrint " cell_name:#{@cell_name} => #{c.get_global_name}, #{c.get_name}\n"6246 dbgPrint " REWRITE cell_name: #{@owner.get_name} #{@cell_name} => #{c.get_global_name}, #{c.get_name}\n" 5735 6247 5736 6248 # @rhs の内容を調整しておく(この内容は、subscript を除いて、後から使われていない) … … 5756 6268 5757 6269 # debug 5758 # p "array_member2.len : #{@array_member.length}"6270 dbgPrint "array_member2.len : #{@array_member.length}\n" 5759 6271 5760 6272 i = 0 … … 5764 6276 # 無駄に設定されているものについては、再帰的に呼び出す必要はない(clone_for_composite では対策している) 5765 6277 if @array_member2[i] != self && @array_member[i] != nil then 6278 dbgPrint "change_rhs array_member #{i}: #{@name} #{@cell_name}\n" 5766 6279 @array_member2[i].change_rhs_port( clone_cell_list, celltype ) 5767 6280 end … … 5779 6292 # @through_list などもコピーされるので、これが呼び出される前に確定する必要がある 5780 6293 def clone_for_composite( ct_name, cell_name, locale, b_need_recursive = true ) 5781 5782 6294 # debug 5783 dbgPrint " join.clone_for_composite : #{@name} #{@cell_name} #{self}\n"6295 dbgPrint "===== clone_for_composite: #{@name} #{@cell_name} #{self} =====\n" 5784 6296 cl = self.clone 5785 6297 5786 6298 if @array_member2 && b_need_recursive then 5787 cl.clone_array_member( @array_member, @array_member2,ct_name, cell_name, self, locale )6299 cl.clone_array_member( ct_name, cell_name, self, locale ) 5788 6300 end 5789 6301 … … 5796 6308 end 5797 6309 5798 def clone_array_member( array_member, array_member2,ct_name, cell_name, prev, locale )6310 def clone_array_member( ct_name, cell_name, prev, locale ) 5799 6311 # 配列のコピーを作る 5800 am = array_member.clone5801 am2 = array_member2.clone6312 am = @array_member.clone 6313 am2 = @array_member2.clone 5802 6314 5803 6315 # 配列要素のコピーを作る 5804 6316 i = 0 5805 6317 while i < am2.length 5806 if array_member2[i] == prev then6318 if @array_member2[i] == prev then 5807 6319 # 自分自身である(ので、呼出すと無限再帰呼出しとなる) 5808 6320 am2[i] = self 5809 elsif array_member2[i] then 5810 am2[i] = array_member2[i].clone_for_composite( ct_name, cell_name, locale, false ) 6321 am[i] = am2[i].get_rhs 6322 elsif @array_member2[i] then 6323 # am2[i] = @array_member2[i].clone_for_composite( ct_name, cell_name, locale, false ) 6324 am2[i] = @array_member2[i].clone_for_composite( ct_name, cell_name, locale, true ) 6325 am[i] = am2[i].get_rhs 5811 6326 else 5812 6327 # 以前のエラーで array_member2[i] は nil になっている … … 5814 6329 5815 6330 # debug 5816 dbgPrint "clone_array_member: #{@name} #{am2[i]} #{array_member2[i]}\n"6331 dbgPrint "clone_array_member: #{@name} subsript=#{i} #{am2[i]} #{@array_member2[i]}\n" 5817 6332 5818 6333 i += 1 … … 5840 6355 dbgPrint "Join#set_cloned: #{@name} prev owner: #{@owner.get_name} new owner: #{owner.get_name}\n" 5841 6356 @owner = owner 6357 if @array_member2 then 6358 @array_member2.each{ |join| 6359 dbgPrint "Joinarray#set_cloned: #{@name} prev owner: #{join.get_owner.get_name} new owner: #{owner.get_name}\n" 6360 join.set_owner owner 6361 } 6362 end 5842 6363 end 5843 6364 … … 5905 6426 if j then 5906 6427 (indent+2).times { print " " } 5907 puts "[#{i}]: #{j.get_name} id: #{j} "6428 puts "[#{i}]: #{j.get_name} id: #{j} owner=#{j.get_owner.get_name}" 5908 6429 j.get_rhs.show_tree(indent+3) 5909 (indent+3).times { print " " } 5910 puts "cell global name: #{j.get_cell_global_name}" 5911 (indent+3).times { print " " } 5912 puts "port global name: #{j.get_port_global_name}" 6430 # (indent+3).times { print " " } 6431 # puts "cell global name: #{j.get_cell_global_name}" 6432 # puts "cell global name: #{j.get_rhs_cell.get_global_name}" 6433 # (indent+3).times { print " " } 6434 # puts "port global name: #{j.get_port_global_name}" 6435 # puts "port global name: #{j.get_rhs_port.get_name}" 5913 6436 else 5914 6437 (indent+2).times { print " " } … … 6235 6758 end 6236 6759 6237 #== Domain 6760 #== DomainType 6238 6761 # 6239 6762 # region の domain を記憶するクラス … … 6256 6779 @name = name 6257 6780 @plugin_name = (name.to_s + "Plugin").to_sym 6258 load_plugin( @plugin_name, DomainPlugin )6781 plClass = load_plugin( @plugin_name, DomainPlugin ) 6259 6782 @region = region 6260 6783 @option = option … … 6272 6795 if ! @plugin then 6273 6796 pluginClass = Object.const_get @plugin_name 6797 return if pluginClass == nil 6274 6798 @plugin = pluginClass.new( @region, @name, @option ) 6799 @plugin.set_locale @locale 6275 6800 end 6276 6801 end … … 6290 6815 end 6291 6816 6292 #== Domain リージョンの Hash を得る6817 #== DomainType リージョンの Hash を得る 6293 6818 # @@domain_regions の説明参照 6294 6819 def self.get_domain_regions … … 6302 6827 def get_option 6303 6828 @option 6829 end 6830 6831 #== DomainType#ドメイン種別を得る 6832 #return::Symbol :kernel, :user, :OutOfDomain 6833 def get_kind 6834 @plugin.get_kind 6304 6835 end 6305 6836 … … 6363 6894 6364 6895 if @@domain_name then 6896 dbgPrint "Region=#{name} domain_type=#{@@domain_name} option=#{@@domain_option}\n" 6365 6897 domain_option = CDLString.remove_dquote @@domain_option.to_s 6366 6898 @domain_type = DomainType.new( self, @@domain_name, domain_option ) … … 6401 6933 6402 6934 # 再出現時に specifier が指定されているか? 6403 if( @in_through_list.length != 0 || @out_through_list.length != 0 || @to_through_list.length != 0 || @region_type != nil )then 6935 if( @in_through_list.length != 0 || @out_through_list.length != 0 || @to_through_list.length != 0 || 6936 @region_type != nil || @domain_type != nil )then 6404 6937 cdl_error( "S1140 $1: region specifier must place at first appearence" , name ) 6405 6938 end … … 6610 7143 end 6611 7144 7145 #== Region# ルートリージョン 7146 # ルートリージョンは、namespace のルートと同じインスタンス 7147 def selfget_root 7148 Namespace.get_root 7149 end 7150 6612 7151 def next_in_through_count 6613 7152 @in_through_count += 1 … … 6643 7182 #=== Region# through プラグインで、この region から cell_name.port_name へのプラグインオブジェクトを登録 6644 7183 # mikan namesppace 対応 (cell_name) 6645 def add_cell_port_through_plugin( cell_name, port_name, through_plugin_object ) 6646 @cell_port_throug_plugin_list[ "#{cell_name}.#{port_name}" ] = through_plugin_object 6647 end 6648 6649 def find_cell_port_through_plugin( cell_name, port_name ) 6650 return @cell_port_throug_plugin_list[ "#{cell_name}.#{port_name}" ] 7184 def add_cell_port_through_plugin( cell_name, port_name, subscript, through_plugin_object ) 7185 if subscript then 7186 subscript = '[' + subscript.to_s + ']' 7187 end 7188 @cell_port_throug_plugin_list[ "#{cell_name}.#{port_name}#{subscript}" ] = through_plugin_object 7189 end 7190 7191 def find_cell_port_through_plugin( cell_name, port_name, subscript ) 7192 if subscript then 7193 subscript = '[' + subscript.to_s + ']' 7194 end 7195 return @cell_port_throug_plugin_list[ "#{cell_name}.#{port_name}#{subscript}" ] 6651 7196 end 6652 7197 … … 6779 7324 end 6780 7325 7326 #== Importable class 7327 # this module is included by Import_C and Import 7328 module Importable 7329 #@last_base_dir::String 7330 7331 #=== Importable#find_file 7332 #file::String : file name to find 7333 #return::String | Nil: path to file or nil if not found 7334 #find file in 7335 def find_file file 7336 $import_path.each{ |path| 7337 if path == "." 7338 pt = file 7339 else 7340 pt = "#{path}/#{file}" 7341 end 7342 if File.exist?( pt ) 7343 if ! $base_dir[ Dir.pwd ] 7344 $base_dir[ Dir.pwd ] = true 7345 end 7346 if $verbose then 7347 print "#{file} is found in #{path}\n" 7348 end 7349 @last_base_dir = nil 7350 dbgPrint "base_dir=. while searching #{file}\n" 7351 return pt 7352 end 7353 } 7354 7355 $base_dir.each_key{ |bd| 7356 $import_path.each{ |path| 7357 # if path =~ /\A\// || path =~ /\A[a-zA-Z]:/ 7358 pt = "#{path}/#{file}" 7359 # else 7360 # pt = "#{bd}/#{path}/#{file}" 7361 # end 7362 begin 7363 Dir.chdir $run_dir 7364 Dir.chdir bd 7365 if File.exist?( pt ) 7366 if $verbose then 7367 print "#{file} is found in #{bd}/#{path}\n" 7368 end 7369 @last_base_dir = bd 7370 dbgPrint "base_dir=#{bd} while searching #{file}\n" 7371 $base_dir[ bd ] = true 7372 return pt 7373 end 7374 rescue 7375 end 7376 } 7377 } 7378 @last_base_dir = nil 7379 dbgPrint "base_dir=. while searching #{file}\n" 7380 return nil 7381 end 7382 7383 def get_base_dir 7384 return @last_base_dir 7385 $base_dir.each{ |bd, flag| 7386 if flag == true 7387 return bd 7388 end 7389 } 7390 return nil 7391 end 7392 end 7393 6781 7394 class Import_C < Node 6782 7395 … … 6785 7398 @@header_list2 = [] 6786 7399 @@define_list = {} 7400 7401 include Importable 6787 7402 6788 7403 #=== Import_C# import_C の生成(ヘッダファイルを取込む) … … 6823 7438 } 6824 7439 7440 header_path = find_file header 7441 7442 =begin 6825 7443 include_opt = "" 6826 7444 found = false … … 6844 7462 6845 7463 if found == false then 7464 =end 7465 if header_path == nil then 6846 7466 cdl_error( "S1142 $1 not found in search path" , header ) 6847 7467 return 6848 7468 end 7469 7470 include_opt = "" 7471 if get_base_dir then 7472 base = get_base_dir + "/" 7473 else 7474 base = "" 7475 end 7476 $import_path.each{ |path| 7477 include_opt = "#{include_opt} -I #{base}#{path}" 7478 } 6849 7479 6850 7480 # 読込み済み? … … 6862 7492 @@header_list2 << header 6863 7493 @@define_list[ header ] = define 7494 7495 if $verbose then 7496 print "import_C header=#{header_path}, define=#{define}\n" 7497 end 6864 7498 6865 7499 begin … … 6940 7574 * --no-gcc-extension-support for tecsgen. 6941 7575 */ 7576 #ifdef __GNUC__ 7577 6942 7578 #ifndef __attribute__ 6943 7579 #define __attribute__(x) … … 6956 7592 #endif 6957 7593 7594 #ifndef restrict 7595 #define restrict 7596 #endif 7597 7598 #endif /* ifdef __GNUC__ */ 6958 7599 #endif /* TECS_NO_GCC_EXTENSION_SUPPORT */ 6959 7600 EOT … … 6983 7624 # @cdl_path:: string: CDL のパス 6984 7625 # @b_imported:: bool: import された(コマンドライン指定されていない) 7626 7627 include Importable 6985 7628 6986 7629 # ヘッダの名前文字列のリスト 添字:expand したパス、値:Import … … 7023 7666 @b_reuse_real = @b_reuse || Generator.is_reuse? 7024 7667 7025 if Generator.get_plugin then 7026 # plugin から import されている場合 gen をサーチパスの先頭に加える 7027 search_path = [ $gen ] + $import_path 7028 else 7029 search_path = $import_path 7030 end 7031 7032 search_path.each{ |path| 7033 dbgPrint "import: searching #{path}/#{@cdl}" 7034 begin 7035 if path == "." 7036 cdl_path = @cdl 7037 else 7038 cdl_path = "#{path}/#{@cdl}" 7039 end 7040 7041 # ファイルの stat を取ってみる(なければ例外発生) 7042 File.stat( cdl_path ) 7043 7044 # cdl を見つかったファイルパスに再設定 7045 @cdl_path = cdl_path 7668 if( Generator.get_plugin ) &&( File.exist? "#{$gen}/#{@cdl}" ) then 7669 @cdl_path = "#{$gen}/#{@cdl}" 7670 found = true 7671 else 7672 path = find_file @cdl 7673 if path then 7046 7674 found = true 7047 dbgPrint ": found\n" 7048 break 7049 rescue => evar 7050 found = false 7051 dbgPrint ": not found\n" 7052 # print_exception( evar ) 7053 end 7054 } 7675 @cdl_path = path 7676 end 7677 end 7055 7678 7056 7679 if found == false then … … 7118 7741 end 7119 7742 7120 #== generate: signature プラグインのロードと実行7743 #== generate: signature, celltype, cell へのプラグインのロードと適用 7121 7744 class Generate < Node 7122 7745 #@plugin_name:: Symbol 7123 #@ signature_nsp:: NamespacePath7746 #@object_nsp:: NamespacePath 7124 7747 #@option:: String '"', '"' で囲まれている 7748 #@plugin_object:: Plugin 7125 7749 7126 7750 include PluginModule 7127 7751 7128 def initialize( plugin_name, signature_nsp, option )7752 def initialize( plugin_name, object_nsp, option ) 7129 7753 super() 7130 7754 @plugin_name = plugin_name 7131 @ signature_nsp = signature_nsp7755 @object_nsp = object_nsp 7132 7756 option = option.to_s # option は Token 7133 7757 @option = option 7134 7135 signature = Namespace.find( signature_nsp ) #mikan Namespace #1 7136 if ! signature.instance_of? Signature then 7137 cdl_error( "S1149 $1 not signature" , signature_nsp ) 7758 @plugin_object = nil 7759 7760 dbgPrint "generate: #{plugin_name} #{object_nsp.to_s} option=#{option}\n" 7761 7762 object = Namespace.find( object_nsp ) 7763 if object.kind_of?( Signature ) || 7764 object.kind_of?( Celltype ) || 7765 object.kind_of?( CompositeCelltype ) || 7766 object.kind_of?( Cell )then 7767 @plugin_object = object.apply_plugin( @plugin_name, @option ) 7768 elsif object then 7769 # V1.5.0 以前の仕様では、signature のみ可能だった 7770 # cdl_error( "S1149 $1 not signature" , signature_nsp ) 7771 cdl_error( "S9999 generate: '$1' neither signature, celltype nor cell", object_nsp ) 7138 7772 return 7139 elsif signature.is_empty? then 7140 cdl_warning( "S9999 $1 is empty. cannot apply signature plugin. ignored" , signature_nsp ) 7141 return 7142 end 7143 7144 load_plugin( plugin_name, SignaturePlugin ) 7145 7146 plugin_object = nil 7147 eval_str = "plugin_object = #{plugin_name}.new( signature, option )" 7148 if $verbose then 7149 print "new through: #{eval_str}\n" 7150 end 7151 7152 begin 7153 eval( eval_str ) # plugin を生成 7154 plugin_object.set_locale @locale 7155 rescue Exception => evar 7156 cdl_error( "S1150 $1: fail to new" , plugin_name ) 7157 print "eval( #{eval_str} )\n" 7158 7159 print_exception( evar ) 7160 end 7161 generate_and_parse plugin_object 7773 else 7774 cdl_error( "S9999 generate: '$1' not found", object_nsp ) 7775 end 7162 7776 end 7163 7777 end -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecslib/core/ctypes.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)の条件を満たす場合に限り,本ソフトウェ … … 118 118 end 119 119 return self 120 els e120 elsif self.instance_of?( CFloatType ) then 121 121 # mikan long double 122 122 # TECS には long double を表現する手段がない (double80_t を定義すればよいか?) 123 123 # cdl_warning( "C1003 $1 & $2 incompatible (\'long double\' is not supported.). Treated as $3." , self.class, another.class, self.class ) 124 cdl_warning( "W9999 $1 & $2 incompatible (\'long double\' is not supported.). Treated as $3." , self.get_type_str, another.get_type_str, self.get_type_str ) 125 return self 124 # cdl_warning( "W9999 $1 & $2 incompatible (\'long double\' is not supported.). Treated as $3." , self.get_type_str, another.get_type_str, self.get_type_str ) 125 self.to_long 126 return self 127 else 128 raise "merge: unknown type" 126 129 end 127 130 end … … 183 186 end 184 187 188 def to_long 189 if @bit_size != -64 then 190 cdl_warning( "W9999 long specified for $1" , get_type_str ) 191 else 192 @bit_size = -128 # @bit_size = -128 : long double 193 end 194 end 185 195 end 186 196 -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecslib/core/expression.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)の条件を満たす場合に限り,本ソフトウェ … … 151 151 when :IDENTIFIER 152 152 nsp = elements[1] 153 # if nsp.is_name_only? && name_list && name_list.get_item( nsp.get_name ) then 153 154 if nsp.is_name_only? && name_list && name_list.get_item( nsp.get_name ) then 154 155 return "#{pre}#{nsp.get_name}#{post}" … … 229 230 end 230 231 232 #=== Expression# 逆ポーランド文字列化 233 #param_list:: ParamlList 関数の引数リスト 234 def get_rpn( param_list = nil, name_list2 = nil ) 235 return elements_rpn( @elements, param_list, name_list2 ) 236 end 237 238 #=== Expression# 逆ポーランド文字列化 (private) 239 #name_list:: ParamlList 関数の引数リスト 240 def elements_rpn( elements, name_list = nil, name_list2 = nil ) 241 if elements.instance_of? Token then 242 print "rpn: #{elements.to_s}\n" 243 return elements.to_s # OP_DOT, OP_REF の右辺 244 end 245 246 case elements[0] 247 when :IDENTIFIER 248 nsp = elements[1] 249 #if nsp.is_name_only? && name_list && name_list.find( nsp.get_name ) then 250 if nsp.is_name_only? then 251 count = 0 252 # p "search: #{nsp.get_name}" 253 name_list.get_items.each{ |nm,val| 254 # p " : #{nm.get_name} #{nsp.get_name.class} #{nm.get_name.class}" 255 if nsp.get_name == nm.get_name then 256 return " $#{count}" 257 end 258 count += 1 259 } 260 raise "not found parameter" 261 else 262 # return elements[1].get_global_name 263 raise "not unexpected parameter" 264 end 265 when :INTEGER_CONSTANT, :FLOATING_CONSTANT, :OCTAL_CONSTANT, :HEX_CONSTANT, :CHARACTER_LITERAL, :STRING_LITERAL_LIST, :BOOL_CONSTANT 266 return elements[1].to_s 267 when :PARENTHESES 268 return elements_rpn( elements[1], name_list, name_list2 ) 269 when :OP_SUBSC 270 return elements_rpn( elements[1], name_list, name_list2 ) + " " + elements_rpn( elements[1], "", name_list, name_list2 ) + " []" 271 when :OP_DOT 272 return elements_rpn( elements[1], name_list, name_list2 ) + " ." 273 when :OP_REF 274 return elements_rpn( elements[1], name_list, name_list2 ) + " ->" 275 when :OP_SIZEOF_EXPR 276 return elements_rpn( elements[1], name_list, name_list2 ) + " #s" 277 when :OP_SIZEOF_TYPE 278 return elements_rpn( elements[1], name_list, name_list2 ) + " #S" 279 when :OP_U_AMP 280 return elements_rpn( elements[1], name_list, name_list2 ) + " #&" 281 when :OP_U_ASTER 282 return elements_rpn( elements[1], name_list, name_list2 ) + " #*" 283 when :OP_U_PLUS 284 return elements_rpn( elements[1], name_list, name_list2 ) + " #+" 285 when :OP_U_MINUS 286 return elements_rpn( elements[1], name_list, name_list2 ) + " #-" 287 when :OP_U_TILDE 288 return elements_rpn( elements[1], name_list, name_list2 ) + " #~" 289 when :OP_U_EXCLAM 290 return elements_rpn( elements[1], name_list, name_list2 ) + " #!" 291 when :CAST 292 return elements_rpn( elements[1], name_list, name_list2 ) + " #(" + elements_rpn( elements[2], "", name_list, name_list2 ) + ")" 293 when :OP_MULT 294 return elements_rpn( elements[1], name_list, name_list2 ) + " " + elements_rpn( elements[2], "", name_list, name_list2 ) + " *" 295 when :OP_DIV 296 return elements_rpn( elements[1], name_list, name_list2 ) + " " + elements_rpn( elements[2], "", name_list, name_list2 ) + " /" 297 when :OP_REMAIN 298 return elements_rpn( elements[1], name_list, name_list2 ) + " " + elements_rpn( elements[2], "", name_list, name_list2 ) + " %" 299 when :OP_ADD 300 return elements_rpn( elements[1], name_list, name_list2 ) + " " + elements_rpn( elements[2], "", name_list, name_list2 ) + " +" 301 when :OP_SUB 302 return elements_rpn( elements[1], name_list, name_list2 ) + " " + elements_rpn( elements[2], "", name_list, name_list2 ) + " -" 303 when :OP_LSFT 304 return elements_rpn( elements[1], name_list, name_list2 ) + " " + elements_rpn( elements[2], "", name_list, name_list2 ) + " <<" 305 when :OP_RSFT 306 return elements_rpn( elements[1], name_list, name_list2 ) + " " + elements_rpn( elements[2], "", name_list, name_list2 ) + " >>" 307 when :OP_LT 308 return elements_rpn( elements[1], name_list, name_list2 ) + " " + elements_rpn( elements[2], "", name_list, name_list2 ) + " <" 309 when :OP_GT 310 return elements_rpn( elements[1], name_list, name_list2 ) + " " + elements_rpn( elements[2], "", name_list, name_list2 ) + " >" 311 when :OP_LE 312 return elements_rpn( elements[1], name_list, name_list2 ) + " " + elements_rpn( elements[2], "", name_list, name_list2 ) + " <=" 313 when :OP_GE 314 return elements_rpn( elements[1], name_list, name_list2 ) + " " + elements_rpn( elements[2], "", name_list, name_list2 ) + " >=" 315 when :OP_EQ 316 return elements_rpn( elements[1], name_list, name_list2 ) + " " + elements_rpn( elements[2], "", name_list, name_list2 ) + " ==" 317 when :OP_NE 318 return elements_rpn( elements[1], name_list, name_list2 ) + " " + elements_rpn( elements[2], "", name_list, name_list2 ) + " !=" 319 when :OP_AND 320 return elements_rpn( elements[1], name_list, name_list2 ) + " " + elements_rpn( elements[2], "", name_list, name_list2 ) + " &" 321 when :OP_EOR 322 return elements_rpn( elements[1], name_list, name_list2 ) + " " + elements_rpn( elements[2], "", name_list, name_list2 ) + " ^" 323 when :OP_OR 324 return elements_rpn( elements[1], name_list, name_list2 ) + " " + elements_rpn( elements[2], "", name_list, name_list2 ) + " |" 325 when :OP_LAND 326 return elements_rpn( elements[1], name_list, name_list2 ) + " " + elements_rpn( elements[2], "", name_list, name_list2 ) + " &&" 327 when :OP_LOR 328 return elements_rpn( elements[1], name_list, name_list2 ) + " " + elements_rpn( elements[2], "", name_list, name_list2 ) + " ||" 329 when :OP_CEX 330 return elements_rpn( elements[1], name_list, name_list2 ) + " " + 331 elements_rpn( elements[2], name_list, name_list2 ) + " " + 332 elements_rpn( elements[3], name_list, name_list2 ) + " ?:" 333 else 334 raise "Unknown expression element: #{elemets[0]}. try -t and please report" 335 end 336 return "" 337 end 338 231 339 # 定数式(elements)を評価する 232 340 # … … 382 490 return nil 383 491 when :OP_SIZEOF_EXPR 384 cdl_error( "E1007 cannot evaluate \'sizeof\' operator" ) 492 if Generator.parsing_C? then 493 cdl_info( "I9999 cannot evaluate \'sizeof\' operator. this might causes later error." ) 494 else 495 cdl_error( "E1007 cannot evaluate \'sizeof\' operator" ) 496 end 385 497 return nil 386 498 when :OP_SIZEOF_TYPE 387 cdl_error( "E1008 cannot evaluate \'sizeof\' operator" ) 499 if Generator.parsing_C? then 500 cdl_info( "I9999 cannot evaluate \'sizeof\' operator. this might causes later error." ) 501 else 502 cdl_error( "E1008 cannot evaluate \'sizeof\' operator" ) 503 end 388 504 return nil 389 505 when :OP_U_AMP -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecslib/core/generate.rb
r321 r429 4 4 # Generator for TOPPERS Embedded Component System 5 5 # 6 # Copyright (C) 2008-201 6by TOPPERS Project6 # Copyright (C) 2008-2019 by TOPPERS Project 7 7 #-- 8 8 # 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ … … 122 122 123 123 class Namespace 124 @@domain_gen_factory_list = nil 124 125 def generate 125 126 … … 135 136 return 136 137 end 138 if instance_of? Region then 139 @@domain_gen_factory_list = {} # create hash 140 end 137 141 end 138 142 … … 141 145 gen_global_header 142 146 147 if ( instance_of? Region ) && get_domain_type != nil then 148 # p "******************* domain_type: #{get_domain_type.get_name} ****************" 149 domain_type = get_domain_type 150 if @@domain_gen_factory_list[ domain_type ] == nil then 151 @@domain_gen_factory_list[ domain_type ] = self 152 domain_type.gen_factory 153 end 154 end 155 143 156 # signature のコードを生成 144 157 @signature_list.each { |s| … … 262 275 263 276 f.print( "/* Descriptor for dynamic join */\n" ) 264 f.print( "#define Descriptor( signature_global_name ) DynDesc__ ## signature_global_name\n\n" ) 277 f.print( "#define Descriptor( signature_global_name ) DynDesc__ ## signature_global_name\n" ) 278 f.print( "#define is_descriptor_unjoined( desc ) ((desc).vdes==NULL)\n\n" ) 265 279 endif_macro_only f 266 280 end … … 454 468 } 455 469 end 456 f.print " rm -f $(CELLTYPE_COBJS) $(TECSGEN_COBJS) $(PLUGIN_COBJS) $(OTHER_OBJS) $(TARGET) #{timestamp}\n"470 f.print " rm -f $(CELLTYPE_COBJS) $(TECSGEN_COBJS) $(PLUGIN_COBJS) $(OTHER_OBJS) $(TARGET) #{timestamp}\n" 457 471 if $generating_region == @@root_namespace then 458 472 f.print " rm -rf $(GEN_DIR)\n" … … 464 478 f.print "tecs : $(PRE_TECSGEN_TARGET) $(TIMESTAMP) $(POST_TECSGEN_TARGET)\n\n" 465 479 f.print "$(TIMESTAMP) : $(TECS_IMPORTS)\n" 466 f.print " $(TECSGEN) #{TECSGEN.subst_tecspath( $arguments, true )}\n "480 f.print " $(TECSGEN) #{TECSGEN.subst_tecspath( $arguments, true )}\n\n" 467 481 # f.print " touch $(TIMESTAMP)\n\n" 468 469 482 else 470 483 f.print "tecs:\n" … … 472 485 end 473 486 487 # tecsflow:, tcflow ターゲット 488 if $generating_region.get_n_cells != 0 || $generating_region == @@root_namespace then 489 f.print "##### TECSFlow targets #####\n" 490 end 491 492 if Region.get_link_roots.length > 1 && $generating_region == @@root_namespace then 493 tecsflow_target = "tecsflow_sub" 494 if $generating_region.get_n_cells > 0 then 495 f.print "tecsflow: tecs tecsflow_sub\n" 496 else 497 f.print "tecsflow:\n" 498 end 499 Region.get_link_roots.each {|region| 500 if region.get_n_cells > 0 then 501 f.print "\tcd #{region.get_global_name}; make tecsflow\n" 502 end 503 } 504 f.print "\n" 505 else 506 tecsflow_target = "tecsflow" 507 end 508 509 if $generating_region.get_n_cells != 0 then 510 f.print "#{tecsflow_target} : $(GEN_DIR)/tecsgen.rbdmp tcflow\n" 511 f.print "\ttecsflow -g $(GEN_DIR)\n\n" 512 f.print "tecsflow_u : $(GEN_DIR)/tecsgen.rbdmp tcflow\n" 513 f.print "\ttecsflow -g $(GEN_DIR) -U\n\n" 514 f.print "$(GEN_DIR)/tecsgen.rbdmp : tecs\n\n" 515 f.print "tcflow : tecs\n" 516 f.print "\tmake tcflow_exec\n\n" 517 f.print "tcflow_exec : $(GEN_DIR)/tcflow.rbdmp\n" 518 f.print "$(GEN_DIR)/tcflow.rbdmp : $(CELLTYPE_SRCS) $(PLUGIN_CELLTYPE_SRCS)\n" 519 f.print "\ttcflow -g $(GEN_DIR) -c '$(CC) -E -DTECSFLOW -DTECSGEN $(CFLAGS) -I ./' $^\n" 520 end 521 522 if $generating_region.get_n_cells != 0 || $generating_region == @@root_namespace then 523 f.print "##### end TECSFlow targets #####\n\n" 524 end 525 526 # generic %.o : %.c 474 527 f.print "# generic target for objs\n" 475 528 f.print "$(_TECS_OBJ_DIR)%.o : %.#{$c_suffix}\n" … … 491 544 ### Makefile.tecsgen の生成 492 545 f = AppFile.open( "#{$gen}/Makefile.tecsgen" ) 546 547 f.print <<EOT 548 # generated automatically by tecsgen. 549 # This file is not intended to modify. 550 # 551 # Makefile variables below are defined. 552 # TECS_IMPORT_CDLS .cdl files improted by import statement 553 # SIGNATURE_HEADERS .h files of signature 554 # CELLTYPE_TECSGEN_HEADERS .h files of celltype 555 # CELLTYPE_FACTORY_HEADERS .h files of celltype's factory 556 # TECS_HEADERS summary of .h files above 557 # TECS_INLINE_HEADERS .h files of celltype inline header 558 # PLUGIN_INLINE_HEADERS .h files of plugin generated inline header 559 # 560 # TECS_COBJS .o files of TECS 561 # = $(TECSGEN_COBJS)+$(PLUGIN_COBJS)+$(CELLTYPE_COBJS) 562 # = $(TECS_KERNEL_COBJS)+$(TECS_KERNEL_COBJS)+$(TECS_OUTOFDOMAIN_COBJS) 563 # = $(TECSGEN_domain_COBJS)+$(PLUGIN_domain_COBJS)+$(CELLTYPE_domain_COBJS) for each domain 564 # 565 # TECSGEN_COBJS .o files of celltype_tecsgen.c 566 # CELLTYPE_COBJS .o files of celltype.c (celltype code) 567 # PLUGIN_COBJS .o files of plugin generated .c files 568 # 569 # TECSGEN_SRCS .c files of celltype_tecsgen.c 570 # CELLTYPE_SRCS .c files of celltype.c (celltype code) 571 # PLUGIN_SRCS .c files of plugin generated 572 # PLUGIN_CELLTYPE_SRCS .c files of plugin generated celltype.c (celltype code) 573 # PLUGIN_TECSGEN_SRCS .c files of plugin generated celltype_tecsgen.c 574 # 575 # Variables for domain 576 # TECS_DOMAINS domain names 577 # TECS_KERNEL_COBJS .o files of kernel domain (tecsgen, celltype, plugin) 578 # TECS_USER_COBJS .o files of user domain (tecsgen, celltype, plugin) 579 # TECS_OUTOFDOMAIN_COBJS .o files of OutOfDomain (tecsgen, celltype, plugin) 580 # TECSGEN_domain_COBJS .o files of celltype_tecsgen.c files for each domain 581 # PLUGIN_domain_COBJS .o files of plugin generated .c files for each domain 582 # CELLTYPE_domain_COBJS .o files of celltype.c files for each domain 583 # TECSGEN_domain_SRCS .c files of celltype_domain_tecsgen.c 584 # PLUGIN_domain_SRCS .c files of plugin generated .c files for each domain 585 # CELLTYPE_domain_SRCS .c files of celltype.c files for each domain 586 587 EOT 493 588 494 589 f.print( "TECS_IMPORT_CDLS =" ) … … 545 640 DomainType.get_domain_regions.each{ |dt, regions| 546 641 # domain_type は一つのノードには、一つしかないので、このループは、必ず一回しか回らない 642 ### mikan 複数のノードがあり、異なる domain_type が指定される可能性はある 547 643 domain_regions = regions 548 644 domain_type = dt … … 587 683 f.print( "\n\n" ) 588 684 589 f.print( "# TECS_COBJS: objects from sources which are automatically generated by tecsgen\n" ) 685 f.print( "# TECS_KERNEL_COBJS: objects belong to kernel domain\n" ) 686 f.print( "TECS_KERNEL_COBJS = \\\n" ) 687 domain_regions.each{ |r| 688 if r.get_domain_type.get_kind == :kernel then 689 f.print( " $(TECSGEN#{decideDomainNameProc.call r}_COBJS) \\\n" ) 690 f.print( " $(PLUGIN#{decideDomainNameProc.call r}_COBJS) \\\n" ) 691 f.print( " $(CELLTYPE#{decideDomainNameProc.call r}_COBJS) \\\n" ) 692 end 693 } 694 f.print( "# TECS_KERNEL_COBJS terminator\n\n" ) 695 696 f.print( "# TECS_USER_COBJS: objects belong to user domain\n" ) 697 f.print( "TECS_USER_COBJS = \\\n" ) 698 domain_regions.each{ |r| 699 if r.get_domain_type.get_kind == :user then 700 f.print( " $(TECSGEN#{decideDomainNameProc.call r}_COBJS) \\\n" ) 701 f.print( " $(PLUGIN#{decideDomainNameProc.call r}_COBJS) \\\n" ) 702 f.print( " $(CELLTYPE#{decideDomainNameProc.call r}_COBJS) \\\n" ) 703 end 704 } 705 f.print( "# TECS_USER_COBJS terminator\n\n" ) 706 707 f.print( "# TECS_OUTOFDOMAIN_COBJS: objects belong to OutOfDomain\n" ) 708 f.print( "TECS_OUTOFDOMAIN_COBJS = \\\n" ) 709 domain_regions.each{ |r| 710 if r.get_domain_type.get_kind == :OutOfDomain then 711 f.print( " $(TECSGEN#{decideDomainNameProc.call r}_COBJS) \\\n" ) 712 f.print( " $(PLUGIN#{decideDomainNameProc.call r}_COBJS) \\\n" ) 713 f.print( " $(CELLTYPE#{decideDomainNameProc.call r}_COBJS) \\\n" ) 714 end 715 } 716 f.print( "# TECS_OUTOFDOMAIN_COBJS terminator\n\n" ) 717 718 f.print( "# TECSGEN_COBJS: objects from sources which are automatically generated by tecsgen\n" ) 590 719 f.print( "TECSGEN_COBJS = \\\n" ) 591 720 domain_regions.each{ |r| … … 621 750 622 751 ### 623 f.print( "# TECS _COBJS: objects from sources which are automatically generated by tecsgen\n" )752 f.print( "# TECSGEN_COBJS: objects from sources which are automatically generated by tecsgen\n" ) 624 753 domain_regions.each{ |r| 625 754 nsp = decideDomainNameProc.call( r ) … … 655 784 656 785 f.print( "# PLUGIN_SRCS: sources automatically generated by plugin\n" ) 786 f.print( "PLUGIN_CELLTYPE_SRCS = \\\n" ) 657 787 domain_regions.each{ |r| 658 788 nsp = decideDomainNameProc.call( r ) 659 f.print( "PLUGIN#{nsp}_SRCS = \\\n" ) 660 gen_celltype_names_domain( f, " $(GEN_DIR)/", "_tecsgen.#{$c_suffix} \\\n", domain_type, r, true ) 661 gen_celltype_names_domain2( f, " $(GEN_DIR)/", ".#{$c_suffix} \\\n", domain_type, r, true, false ) 662 f.print( "# PLUGIN#{nsp}_SRCS terminator\n\n" ) 663 } 664 789 f.print( " $(PLUGIN#{nsp}_CELLTYPE_SRCS)\\\n" ) 790 } 791 f.print( "# PLUGIN_CELLTYPE_SRCS terminator\n\n" ) 792 f.print( "PLUGIN_TECSGEN_SRCS = \\\n" ) 793 domain_regions.each{ |r| 794 nsp = decideDomainNameProc.call( r ) 795 f.print( " $(PLUGIN#{nsp}_TECSGEN_SRCS)\\\n" ) 796 } 797 f.print( "# PLUGIN_TECSGEN_SRCS terminator\n\n" ) 798 domain_regions.each{ |r| 799 nsp = decideDomainNameProc.call( r ) 800 f.print( "PLUGIN#{nsp}_SRCS = $(PLUGIN#{nsp}_CELLTYPE_SRCS) $(PLUGIN#{nsp}_TECSGEN_SRCS)\n\n" ) 801 f.print( "PLUGIN#{nsp}_CELLTYPE_SRCS = \\\n" ) 802 gen_celltype_names_domain2( f, "", ".#{$c_suffix} \\\n", domain_type, r, true, false ) 803 f.print( "# PLUGIN#{nsp}_CELLTYPE_SRCS terminator\n\n" ) 804 nsp = decideDomainNameProc.call( r ) 805 f.print( "PLUGIN#{nsp}_TECSGEN_SRCS = \\\n" ) 806 gen_celltype_names_domain( f, "", "_tecsgen.#{$c_suffix} \\\n", domain_type, r, true ) 807 f.print( "# PLUGIN#{nsp}_TECSGEN_SRCS terminator\n\n" ) 808 } 809 810 f.print( "# CELLTYPE_SRCS: sources of celltype code written by user\n" ) 811 f.print( "CELLTYPE_SRCS = \\\n" ) 812 gen_celltype_names( f, " ", ".#{$c_suffix} \\\n", false, false ) 813 f.print( "# CELLTYPE_SRCS terminator\n\n" ) 665 814 f.close 666 815 … … 762 911 end 763 912 913 #=== Namespace#すべてのシグニチャをたどる 914 def travers_all_signature # ブロック引数 { |signature| } 915 proc = Proc.new # このメソッドのブロック引数 916 @signature_list.each{ |sig| 917 proc.call sig 918 } 919 @namespace_list.each{ |ns| 920 ns.travers_all_signature_proc proc 921 } 922 end 923 def travers_all_signature_proc proc 924 @signature_list.each{ |sig| 925 proc.call sig 926 } 927 @namespace_list.each{ |ns| 928 ns.travers_all_signature_proc proc 929 } 930 end 931 932 #=== Namespace#すべてのセルタイプをたどる 933 def travers_all_celltype # ブロック引数 { |celltype| } 934 proc = Proc.new # このメソッドのブロック引数 935 @celltype_list.each{ |ct| 936 proc.call ct 937 } 938 @namespace_list.each{ |ns| 939 ns.travers_all_celltype_proc proc 940 } 941 end 942 def travers_all_celltype_proc proc 943 @celltype_list.each{ |ct| 944 proc.call ct 945 } 946 @namespace_list.each{ |ns| 947 ns.travers_all_celltype_proc proc 948 } 949 end 764 950 end 765 951 … … 854 1040 f.printf TECSMsg.get(:SDI_comment), "#_SDI_#" 855 1041 dl.each{ |dt,param| 856 f.print "#include \"#{dt.get_signature.get_global_name}_tecsgen.#{$h_suffix}\"\n" 1042 f.print <<EOT 1043 /* pre-typedef incomplete-type to avoid error in case of mutual or cyclic reference */ 1044 #ifndef Descriptor_of_#{dt.get_global_name}_Defined 1045 #define Descriptor_of_#{dt.get_global_name}_Defined 1046 typedef struct { struct tag_#{dt.get_global_name}_VDES *vdes; } Descriptor( #{dt.get_global_name} ); 1047 #endif 1048 EOT 1049 # f.print "#include \"#{dt.get_global_name}_tecsgen.#{$h_suffix}\"\n" 857 1050 } 858 1051 f.print "\n" … … 904 1097 end 905 1098 906 f.print "};\n" 907 f.printf "\n" 1099 f.print "};\n\n" 908 1100 f.printf TECSMsg.get(:SDES_comment), "#_SDES_#" 909 f.print( "typedef struct { struct tag_#{@global_name}_VDES *vdes; } Descriptor( #{@global_name} );\n" ) 1101 f.print <<EOT 1102 #ifndef Descriptor_of_#{@global_name}_Defined 1103 #define Descriptor_of_#{@global_name}_Defined 1104 typedef struct { struct tag_#{@global_name}_VDES *vdes; } Descriptor( #{@global_name} ); 1105 #endif 1106 EOT 910 1107 end 911 1108 … … 993 1190 gen_ph_get_cellcb f 994 1191 gen_ph_attr_access f if @n_attribute_rw > 0 || @n_attribute_ro > 0 || @n_var > 0 995 gen_ph_cp_fun_macro f if @n_call_port > 0 1192 f.print "#ifndef TECSFLOW\n" 1193 gen_ph_cp_fun_macro f, false if @n_call_port > 0 1194 f.print "#else /* TECSFLOW */\n" 1195 gen_ph_cp_fun_macro f, true if @n_call_port > 0 1196 f.print "#endif /* TECSFLOW */\n" 996 1197 # gen_ph_abstract_ep_des_type f 997 1198 … … 1008 1209 # gen_ph_ep_fun_prototype f 1009 1210 gen_ph_ep_skel_prototype f 1211 1212 #--- CB_TYPE_ONLY の場合、ref_desc, set_desc 関数は含めない (マクロ参照するため) 1213 if @n_entry_port_inline == 0 then 1214 ifndef_cb_type_only f 1215 end 1216 gen_ph_ref_desc_func f 1217 gen_ph_set_desc_func f 1218 if @n_entry_port_inline == 0 then 1219 endif_cb_type_only f 1220 end 1010 1221 end_extern_C f 1011 1222 endif_macro_only f … … 1019 1230 gen_ph_attr_access_abbrev f if @n_attribute_rw > 0 || @n_attribute_ro > 0 || @n_var > 0 1020 1231 gen_ph_cp_fun_macro_abbrev f if @n_call_port > 0 1232 gen_ph_ref_desc_macro_abbrev f 1233 gen_ph_set_desc_macro_abbrev f 1021 1234 gen_ph_test_optional_call_port_abbrev f 1022 1235 gen_ph_ep_fun_macro f if @n_entry_port > 0 … … 1084 1297 end 1085 1298 } 1299 if p.is_dynamic? then 1300 f.print( "#undef #{p.get_name}_set_descriptor\n" ) 1301 if p.is_optional? then 1302 f.print( "#undef #{p.get_name}_unjoin\n" ) 1303 end 1304 elsif p.is_ref_desc? then 1305 f.print( "#undef #{p.get_name}_refer_to_descriptor\n" ) 1306 f.print( "#undef #{p.get_name}_ref_desc\n" ) 1307 end 1086 1308 } 1087 1309 @port.each { |p| … … 1196 1418 def gen_ph_info f 1197 1419 1420 yn_multi_domain = "no" 1421 yn_multi_domain = "yes" if multi_domain? 1198 1422 yn_idx_is_id = "no" 1199 1423 yn_idx_is_id = "yes" if @idx_is_id … … 1204 1428 yn_rom = "no" 1205 1429 yn_rom = "yes" if $rom 1430 yn_has_CB = "no" 1431 yn_has_CB = "yes" if has_CB? 1432 yn_has_INIB = "no" 1433 yn_has_INIB = "yes" if has_INIB? 1206 1434 yn_cb_init = "no" 1207 1435 yn_cb_init = "yes" if need_CB_initializer? … … 1212 1440 * celltype : #{@name} 1213 1441 * global name : #{@global_name} 1442 * multi-domain : #{yn_multi_domain} 1214 1443 * idx_is_id(actual) : #{yn_idx_is_id}(#{yn_idx_is_id_act}) 1215 1444 * singleton : #{yn_singleton} 1216 * has_CB : #{ has_CB?}1217 * has_INIB : #{ has_INIB?}1445 * has_CB : #{yn_has_CB} 1446 * has_INIB : #{yn_has_INIB} 1218 1447 * rom : #{yn_rom} 1219 1448 * CB initializer : #{yn_cb_init} … … 1438 1667 end 1439 1668 1440 if p.get_array_size == nil then 1441 f.print( "#define #{@global_name}_is_#{p.get_name}_joined(p_that) \\\n" ) 1442 else 1443 f.print( "#define #{@global_name}_is_#{p.get_name}_joined(p_that,subscript) \\\n" ) 1444 end 1669 if @singleton then 1670 param = "" 1671 delim = "" 1672 else 1673 param = "p_that" 1674 delim = "," 1675 end 1676 if p.get_array_size != nil then 1677 param = param + delim + "subscript" 1678 end 1679 f.print( "#define #{@global_name}_is_#{p.get_name}_joined(#{param}) \\\n" ) 1445 1680 1446 1681 if p.is_omit? then … … 1452 1687 # mikan 全部つながっているかどうかで (1) を判定する 1453 1688 if ! p.is_VMT_useless? then 1689 if p.is_dynamic? then 1690 if @singleton then 1691 inib_tmp = "CB" 1692 else 1693 inib_tmp = "" 1694 end 1695 else 1696 inib_tmp = inib 1697 end 1698 1454 1699 # 標準コード 1455 1700 if p.get_array_size == nil then 1456 1701 if @singleton then 1457 f.print( "\t (#{@global_name}_SINGLE_CELL_#{inib }.#{p.get_name}!=0)\n" )1702 f.print( "\t (#{@global_name}_SINGLE_CELL_#{inib_tmp}.#{p.get_name}!=0)\n" ) 1458 1703 else 1459 f.print( "\t ((p_that)#{inib }->#{p.get_name}!=0)\n" )1704 f.print( "\t ((p_that)#{inib_tmp}->#{p.get_name}!=0)\n" ) 1460 1705 end 1461 1706 else 1462 1707 # 配列の場合 1463 1708 if @singleton then 1464 f.print( "\t ((#{@global_name}_SINGLE_CELL_#{inib }.#{p.get_name}!=0) \\\n" )1465 f.print( "\t &&(#{@global_name}_SINGLE_CELL_#{inib }.#{p.get_name}[subscript]!=0))\n" )1709 f.print( "\t ((#{@global_name}_SINGLE_CELL_#{inib_tmp}.#{p.get_name}!=0) \\\n" ) 1710 f.print( "\t &&(#{@global_name}_SINGLE_CELL_#{inib_tmp}.#{p.get_name}[subscript]!=0))\n" ) 1466 1711 else 1467 f.print( "\t (((p_that)#{inib }->#{p.get_name}!=0)\\\n" )1468 f.print( "\t &&((p_that)#{inib }->#{p.get_name}[subscript]!=0))\n" )1712 f.print( "\t (((p_that)#{inib_tmp}->#{p.get_name}!=0)\\\n" ) 1713 f.print( "\t &&((p_that)#{inib_tmp}->#{p.get_name}[subscript]!=0))\n" ) 1469 1714 end 1470 1715 end … … 1503 1748 end 1504 1749 1750 if @singleton then 1751 param = "" 1752 delim = "" 1753 else 1754 param = "p_cellcb" 1755 delim = "," 1756 end 1757 1505 1758 if p.get_array_size == nil then 1506 f.print( "#define is_#{p.get_name}_joined()\\\n\t\t#{@global_name}_is_#{p.get_name}_joined(p_cellcb)\n" ) 1507 else 1508 f.print( "#define is_#{p.get_name}_joined(subscript)\\\n" ) 1509 f.print( "\t\t#{@global_name}_is_#{p.get_name}_joined(p_cellcb,subscript)\n" ) 1510 end 1759 subscript = "" 1760 else 1761 subscript = "subscript" 1762 param = param + delim + subscript 1763 end 1764 f.print( "#define is_#{p.get_name}_joined(#{subscript})\\\n\t\t#{@global_name}_is_#{p.get_name}_joined(#{param})\n" ) 1511 1765 } 1512 1766 end … … 1519 1773 f.print( "#define #{@global_name}_GET_CELLCB(idx) ((void *)0)\n" ) 1520 1774 elsif @idx_is_id_act then # mikan 単一のセルの場合の最適化, idx_is_id でない場合 1521 f.print( "#define #{@global_name}_GET_CELLCB(idx) (#{@global_name}_CB_ tab[(idx) - #{@global_name}_ID_BASE])\n" )1775 f.print( "#define #{@global_name}_GET_CELLCB(idx) (#{@global_name}_CB_ptab[(idx) - #{@global_name}_ID_BASE])\n" ) 1522 1776 else 1523 1777 f.print( "#define #{@global_name}_GET_CELLCB(idx) (idx)\n" ) … … 1723 1977 end 1724 1978 1725 def gen_ph_cp_fun_macro f 1726 if @n_call_port >0 then1979 def gen_ph_cp_fun_macro f, b_flow 1980 if @n_call_port >0 && b_flow == false then 1727 1981 f.printf( TECSMsg.get( :CPM_comment ) , "#_CPM_#" ) 1728 end1729 1730 if @singleton then1731 if has_INIB? then1732 inib = "INIB"1733 else1734 inib = "CB"1735 end1736 else1737 if has_CB? && has_INIB? then1738 inib = "->_inib"1739 else1740 inib = ""1741 end1742 1982 end 1743 1983 … … 1747 1987 1748 1988 p.get_signature.get_function_head_array.each{ |fun| 1989 if @singleton then 1990 if has_INIB? then 1991 inib = "INIB" 1992 else 1993 inib = "CB" 1994 end 1995 if p.is_dynamic? && p.get_array_size == nil then 1996 # dynamic call port (not array) 1997 inib = "CB" 1998 end 1999 else 2000 if has_CB? && has_INIB? then 2001 inib = "->_inib" 2002 else 2003 inib = "" 2004 end 2005 if p.is_dynamic? && p.get_array_size == nil then 2006 # dynamic call port (not array) 2007 inib = "" 2008 end 2009 end 2010 1749 2011 f.print( "#define #{@global_name}_#{p.get_name}_#{fun.get_name}(" ) 1750 2012 ft = fun.get_declarator.get_type … … 1772 2034 1773 2035 # 関数名の出力(標準:受け口ディスクリプタから VMT の関数名、最適化:受け口関数 or 受け口ディスクリプタ) 1774 if ! p.is_VMT_useless? then 2036 if b_flow then 2037 f.print( "\t (p_that)->#{p.get_name}#{subsc}.#{fun.get_name}__T( \\\n" ) 2038 elsif ! p.is_VMT_useless? then 1775 2039 # 標準コード 1776 2040 if @singleton then … … 1807 2071 1808 2072 # 受け口情報の出力(標準:受け口ディスクリプタ、最適化:IDX など) 1809 if ! p.is_skelton_useless? && ! p.is_cell_unique? then 2073 if b_flow then 2074 elsif ! p.is_skelton_useless? && ! p.is_cell_unique? then 1810 2075 # 標準コード 1811 2076 if @singleton then … … 1857 2122 end 1858 2123 2124 #=== ref_desc 指定された呼び口に対するディスクリプタ参照関数の生成 2125 def gen_ph_ref_desc_func f 2126 if @n_call_port_ref_desc >0 then 2127 f.printf( TECSMsg.get( :CRD_comment ), "#_CRD_#" ) 2128 end 2129 2130 if has_CB? && has_INIB? then 2131 inib = "->_inib" 2132 else 2133 inib = "" 2134 end 2135 @port.each { |p| 2136 next if p.get_port_type != :CALL 2137 next if ! p.is_ref_desc? 2138 2139 if @singleton then 2140 p_that = "" 2141 p_cellcb = "" 2142 delim = "" 2143 if has_INIB? then 2144 cb = "#{@global_name}_SINGLE_CELL_INIB." 2145 else 2146 cb = "#{@global_name}_SINGLE_CELL_CB." 2147 end 2148 else 2149 p_that = "#{@global_name}_CB *p_that" 2150 p_cellcb = " #{@global_name}_CB *p_cellcb = p_that;\n" 2151 delim = ", " 2152 cb = "p_cellcb#{inib}->" 2153 end 2154 2155 if p.get_array_size 2156 array = "#{delim}int_t i " 2157 array2 = "[ i ]" 2158 assert = " assert( 0 <= i && i < NCP_#{p.get_name} );\n" 2159 else 2160 array = "" 2161 array2 = "" 2162 assert = "" 2163 end 2164 f.print <<EOT 2165 /* [ref_desc] #{p.get_name} */ 2166 Inline Descriptor( #{p.get_signature.get_global_name} ) 2167 #{@global_name}_#{p.get_name}_refer_to_descriptor( #{p_that}#{array} ) 2168 { 2169 Descriptor( #{p.get_signature.get_global_name} ) des; 2170 #{p_cellcb} /* cast is ncecessary for removing 'const' */ 2171 #{assert} des.vdes = (struct tag_#{p.get_signature.get_global_name}_VDES *)#{cb}#{p.get_name}#{array2}; 2172 return des; 2173 } 2174 2175 EOT 2176 } 2177 end 2178 2179 #=== dynamic 指定された呼び口に対するディスクリプタ設定関数の生成 2180 def gen_ph_set_desc_func f 2181 if @n_call_port_dynamic >0 then 2182 f.printf( TECSMsg.get( :SDF_comment ), "#_SDF_#" ) 2183 end 2184 2185 @port.each { |p| 2186 next if p.get_port_type != :CALL 2187 next if ! p.is_dynamic? 2188 if has_CB? && has_INIB? && p.get_array_size then 2189 inib = "->_inib" 2190 else 2191 inib = "" 2192 end 2193 if @singleton then 2194 # p "main== #{@global_name} #{p.get_name} #{p.get_array_size}" 2195 p_that = "" 2196 p_that2 = "" 2197 p_cellcb = "" 2198 if p.get_array_size && $rom then 2199 cb = "#{@global_name}_SINGLE_CELL_INIB." 2200 else 2201 cb = "#{@global_name}_SINGLE_CELL_CB." 2202 end 2203 else 2204 p_that = "#{@global_name}_CB *p_that, " 2205 p_that2 = "#{@global_name}_CB *p_that " 2206 p_cellcb = " #{@global_name}_CB *p_cellcb = p_that;\n" 2207 cb = "(p_cellcb)->#{inib}" 2208 end 2209 2210 if p.get_array_size then 2211 array = "int_t i, " 2212 array2 = "[ i ]" 2213 array3 = " int_t i " 2214 assert2 = " assert( 0 <= i && i < NCP_#{p.get_name} );\n" 2215 else 2216 array = "" 2217 array2 = "" 2218 array3 = "" 2219 assert2 = "" 2220 end 2221 f.print <<EOT 2222 /* [dynamic] #{p.get_name} */ 2223 Inline void 2224 #{@global_name}_#{p.get_name}_set_descriptor( #{p_that}#{array}Descriptor( #{p.get_signature.get_global_name} ) des ) 2225 { 2226 #{p_cellcb} assert( des.vdes != NULL ); 2227 #{assert2} #{cb}#{p.get_name}#{array2} = des.vdes; 2228 } 2229 2230 EOT 2231 2232 if p.is_optional? then 2233 if p_that2 != "" && array3 != "" then 2234 delim = ", " 2235 else 2236 delim = "" 2237 end 2238 f.print <<EOT 2239 /* [dynamic,optional] #{p.get_name} */ 2240 Inline void 2241 #{@global_name}_#{p.get_name}_unjoin( #{p_that2}#{delim}#{array3} ) 2242 { 2243 #{p_cellcb} #{cb}#{p.get_name}#{array2} = NULL; 2244 } 2245 2246 EOT 2247 end 2248 } 2249 end 2250 1859 2251 #=== send/receive で受け取ったメモリ領域を dealloc するマクロコード 1860 2252 #f:: File … … 1958 2350 1959 2351 if p.is_omit? then 1960 f.print( " 1961 else 1962 f.print( " 2352 f.print( " #{dummy_p_cell_access_pre}omitted #{p.get_name}_#{fun.get_name}(" ) 2353 else 2354 f.print( " #{dummy_p_cell_access_pre}#{@global_name}_#{p.get_name}_#{fun.get_name}(" ) 1963 2355 end 1964 2356 ft = fun.get_declarator.get_type … … 1981 2373 f.print( " )#{dummy_p_cell_access_post}\n" ) 1982 2374 } 2375 } 2376 f.print( "\n" ) 2377 end 2378 2379 def gen_ph_ref_desc_macro_abbrev f 2380 if @n_call_port_ref_desc >0 then 2381 f.printf( TECSMsg.get( :CRDA_comment ), "#_CRDA_#" ) 2382 end 2383 2384 @port.each { |p| 2385 next if p.get_port_type != :CALL 2386 next if ! p.is_ref_desc? 2387 2388 if @singleton then 2389 p_cellcb = "" 2390 delim = "" 2391 else 2392 p_cellcb = "p_cellcb" 2393 delim = ", " 2394 end 2395 2396 if p.get_array_size then 2397 array = " i " 2398 array2 = "#{delim}i" 2399 else 2400 array = "" 2401 array2 = "" 2402 end 2403 2404 f.printf( "#define %s_refer_to_descriptor(#{array})\\\n %s_refer_to_descriptor( #{p_cellcb}#{array2} )\n", 2405 "#{p.get_name}", 2406 "#{@global_name}_#{p.get_name}" ) 2407 f.printf( "#define %s_ref_desc(#{array})\\\n %s_refer_to_descriptor(#{array})\n", 2408 "#{p.get_name}", 2409 "#{p.get_name}" ) 2410 } 2411 f.print( "\n" ) 2412 end 2413 2414 def gen_ph_set_desc_macro_abbrev f 2415 if @n_call_port_dynamic >0 then 2416 f.printf( TECSMsg.get( :SDMA_comment ), "#_SDMA_#" ) 2417 end 2418 2419 if @singleton then 2420 p_cellcb = "" 2421 delim = "" 2422 else 2423 p_cellcb = "p_cellcb" 2424 delim = ", " 2425 end 2426 @port.each { |p| 2427 next if p.get_port_type != :CALL 2428 next if ! p.is_dynamic? 2429 2430 if p.get_array_size then 2431 subsc = "i, " 2432 subsc2 = "i" 2433 subsc3 = delim + subsc2 2434 else 2435 subsc = "" 2436 subsc2 = "" 2437 subsc3 = "" 2438 end 2439 f.printf( "#define %s_set_descriptor( #{subsc}desc )\\\n %s_set_descriptor( #{p_cellcb}#{delim}#{subsc}desc )\n", 2440 "#{p.get_name}", 2441 "#{@global_name}_#{p.get_name}" ) 2442 f.printf( "#define %s_unjoin( #{subsc2} )\\\n %s_unjoin( #{p_cellcb}#{subsc3} )\n", 2443 "#{p.get_name}", 2444 "#{@global_name}_#{p.get_name}" ) 1983 2445 } 1984 2446 f.print( "\n" ) … … 2149 2611 f.print( "typedef const struct tag_#{@global_name}_INIB {\n" ) 2150 2612 2151 gen_cell_cb_type_port f2613 gen_cell_cb_type_port( f, :INIB ) 2152 2614 gen_cell_cb_type_attribute( f, :INIB ) 2153 2615 … … 2162 2624 f.print " #{@global_name}_INIB *_inib;\n" 2163 2625 end 2626 gen_cell_cb_type_port( f, :CB_DYNAMIC ) 2164 2627 gen_cell_cb_type_attribute( f, :CB ) 2165 2628 gen_cell_cb_type_var f … … 2180 2643 f.print( "typedef struct tag_#{@global_name}_CB {\n" ) 2181 2644 2182 gen_cell_cb_type_port f2645 gen_cell_cb_type_port( f, :CB ) 2183 2646 gen_cell_cb_type_attribute( f, :CB ) 2184 2647 gen_cell_cb_type_var f … … 2248 2711 end 2249 2712 2250 def gen_cell_cb_type_port f2251 gen_cell_cb_type_call_port f2252 gen_cell_cb_type_entry_port f2253 end 2254 2255 def gen_cell_cb_type_call_port f2713 def gen_cell_cb_type_port( f, inib_cb ) 2714 gen_cell_cb_type_call_port( f, inib_cb ) 2715 gen_cell_cb_type_entry_port( f, inib_cb ) 2716 end 2717 2718 def gen_cell_cb_type_call_port( f, inib_cb ) 2256 2719 # 呼び口 2257 2720 if @n_call_port >0 then 2258 f.print " /* call port #_TCP_# */ 2721 f.print " /* call port #_TCP_# */\n" 2259 2722 end 2260 2723 … … 2262 2725 next if p.get_port_type != :CALL 2263 2726 next if p.is_omit? 2264 ptr = '' 2265 ptr = '*' if p.get_array_size 2727 next if inib_cb == :INIB && p.is_dynamic? && p.get_array_size == nil && ! $ram_initializer 2728 next if inib_cb == :CB_DYNAMIC && ( ! p.is_dynamic? || p.get_array_size != nil ) 2729 # bprint "cb_type #{inib_cb} #{p.get_name} dynamic=#{p.is_dynamic?}\n" 2730 2731 ptr = p.get_array_size ? '*' : '' 2266 2732 2267 2733 if ! p.is_cell_unique? then 2734 const = p.is_dynamic? ? '' : 'const' 2735 if inib_cb == :INIB && p.is_dynamic? && p.get_array_size == nil && $ram_initializer then 2736 init = '_init_' 2737 const2 = 'const' 2738 else 2739 init = '' 2740 const2 = 'const' 2741 end 2742 2268 2743 if ! p.is_skelton_useless? then 2269 2744 # 標準形 2270 f.print( " struct tag_#{p.get_signature.get_global_name}_VDES #{ptr}const*#{p.get_name;};\n" ) 2745 if inib_cb == :INIB && p.is_dynamic? && p.get_array_size != nil && $ram_initializer then 2746 f.print( " struct tag_#{p.get_signature.get_global_name}_VDES #{ptr}#{const2}*#{p.get_name;}_init_;\n" ) 2747 end 2748 f.print( " struct tag_#{p.get_signature.get_global_name}_VDES #{ptr}#{const}*#{p.get_name;}#{init};\n" ) 2749 # f.print( " struct tag_#{p.get_signature.get_global_name}_VDES #{ptr}*#{p.get_name;};\n" ) 2271 2750 if p.get_array_size == "[]" then 2272 2751 f.print( " int_t n_#{p.get_name};\n" ) … … 2295 2774 2296 2775 #=== Celltype#受け口配列添数を記憶する変数の定義 2297 def gen_cell_cb_type_entry_port f2776 def gen_cell_cb_type_entry_port( f, inib_cb ) 2298 2777 # 呼び口 2299 2778 if @n_entry_port >0 then … … 2318 2797 f.print "extern #{@global_name}_INIB #{@global_name}_SINGLE_CELL_INIB;\n" 2319 2798 end 2320 2321 # @ordered_cell_list.each{ |c|2322 # f.print "extern #{@global_name}_CB #{@global_name}_#{c.get_name}_CB;\n"2323 # }2324 2325 2799 f.print "\n" 2326 elsif @idx_is_id_act then 2327 f.print "extern #{@global_name}_CB *#{@global_name}_CB_tab[];\n" 2800 elsif @b_need_ptab then 2801 f.printf( TECSMsg.get( :SCP_comment ), "#_MCPP_#" ) 2802 if has_CB? then 2803 f.print "extern #{@global_name}_CB *const #{@global_name}_CB_ptab[];\n" 2804 @ordered_cell_list.each{ |c| 2805 if c.is_generate? then # 生成対象か? 2806 name_array = get_name_array c 2807 f.print "extern #{@global_name}_CB #{name_array[4]};\n" 2808 end 2809 } 2810 elsif has_INIB? 2811 f.print "extern #{@global_name}_INIB *const #{@global_name}_INIB_ptab[];\n" 2812 @ordered_cell_list.each{ |c| 2813 if c.is_generate? then # 生成対象か? 2814 name_array = get_name_array c 2815 f.print "extern #{@global_name}_INIB #{name_array[11]};\n" 2816 end 2817 } 2818 end 2328 2819 else 2329 f.print "extern #{@global_name}_CB #{@global_name}_CB_tab[];\n" 2820 f.printf( TECSMsg.get( :SCP_comment ), "#_MCPB_#" ) 2821 if has_CB? then 2822 f.print "extern #{@global_name}_CB #{@global_name}_CB_tab[];\n" 2823 elsif has_INIB? 2824 f.print "extern #{@global_name}_INIB #{@global_name}_INIB_tab[];\n" 2825 end 2330 2826 end 2331 2827 end 2332 2828 2333 2829 def gen_ph_INIB_as_CB f 2334 2830 # ここは、手抜きである。本来なら INIB を出力すべき 2335 2831 if ! has_CB? && has_INIB? then 2336 2832 f.printf( TECSMsg.get( :DCI_comment ), "#_DCI_#" ) 2337 f.print "#define #{@global_name}_CB_tab #{@global_name}_INIB_tab\n" 2338 f.print "#define #{@global_name}_SINGLE_CELL_CB #{@global_name}_SINGLE_CELL_INIB\n" 2833 if @singleton then 2834 f.print "#define #{@global_name}_SINGLE_CELL_CB #{@global_name}_SINGLE_CELL_INIB\n" 2835 elsif @b_need_ptab then 2836 f.print "#define #{@global_name}_CB_ptab #{@global_name}_INIB_ptab\n" 2837 else 2838 f.print "#define #{@global_name}_CB_tab #{@global_name}_INIB_tab\n" 2839 end 2339 2840 f.print "#define #{@global_name}_CB #{@global_name}_INIB\n" 2340 2841 f.print "#define tag_#{@global_name}_CB tag_#{@global_name}_INIB\n" … … 2360 2861 f.printf( TECSMsg.get( :FEC_comment ), "#_FEC_#" ) 2361 2862 2362 if @ idx_is_id_actthen2863 if @b_need_ptab then 2363 2864 amp = '' 2865 tab = 'ptab' 2364 2866 else 2365 2867 amp = '&' 2868 tab = 'tab' 2366 2869 end 2367 2870 f.print <<EOT 2368 2871 #define FOREACH_CELL(i,p_cb) \\ 2369 2872 for( (i) = 0; (i) < #{@global_name}_N_CELL; (i)++ ){ \\ 2370 #{necessity}(p_cb) = #{amp}#{@global_name}_CB_ tab[i];2873 #{necessity}(p_cb) = #{amp}#{@global_name}_CB_#{tab}[i]; 2371 2874 2372 2875 #define END_FOREACH_CELL } … … 2418 2921 2419 2922 if @n_cell_gen > 0 && need_CB_initializer? then 2923 b_var_init = false 2420 2924 f.print "#define INITIALIZE_CB#{arg}" 2421 2925 @var.each { |v| … … 2423 2927 next if init == nil 2424 2928 2929 b_var_init = true 2425 2930 type = v.get_type.get_original_type 2426 2931 f.print "\\\n" … … 2438 2943 # post = "" 2439 2944 end 2440 f.print "\tmemcpy((void*)#{pre}#{@global_name}_VAR_#{v.get_name}#{p_that}#{post}, (void*)#{pre}#{@global_name}_#{v.get_name}_VAR_INIT#{post}, sizeof(#{@global_name}_#{v.get_name}_VAR_INIT));" 2945 f.print "\tmemcpy((void*)#{pre}#{@global_name}_VAR_#{v.get_name}#{p_that}#{post}, " 2946 f.print "(void*)#{pre}#{@global_name}_#{v.get_name}_VAR_INIT#{post}, sizeof(#{@global_name}_#{v.get_name}_VAR_INIT));" 2441 2947 elsif init.instance_of? C_EXP then 2442 2948 f.print "\t#{that}#{v.get_name} = #{init.get_c_exp_string};" … … 2451 2957 end 2452 2958 } 2959 2960 # dynamic call port の初期化コード 2961 b_dyn_port = false 2962 @port.each{ |p| 2963 next if p.get_port_type != :CALL 2964 if p.is_dynamic? && $ram_initializer then 2965 if p.get_array_size == nil then 2966 f.print "\\\n\t#{that}#{p.get_name} = #{that}_inib->#{p.get_name}_init_;" 2967 else 2968 if @singleton || p.get_array_size != "[]" then 2969 p_that = "" 2970 else 2971 p_that = "(p_that)" 2972 end 2973 if @singleton then 2974 that = "#{@global_name}_SINGLE_CELL_INIB." 2975 else 2976 that = "(p_that)->" 2977 end 2978 if has_CB? then 2979 init = '_init->' 2980 else 2981 init = '' 2982 end 2983 f.printf( "\\\n%-80s\\\n", ' {' ) 2984 f.printf( "%-80s\\\n", ' int_t j;' ) 2985 f.printf( "%-80s\\\n", " for( j = 0; j < N_CP_#{p.get_name}#{p_that}; j++ ){" ) 2986 f.printf( "%-80s\\\n", " #{that}#{p.get_name}[j] = #{that}#{init}#{p.get_name}_init_[j];" ) 2987 f.printf( "%-80s\\\n", ' }' ) 2988 f.printf( "%-80s", ' }' ) 2989 end 2990 b_dyn_port = true 2991 end 2992 } 2993 if b_dyn_port then 2994 f.print( "\n" ) 2995 end 2996 2997 if b_var_init == false && b_dyn_port == false && ! @singleton then 2998 f.print "\t(void)(p_that);" 2999 end 2453 3000 f.print "\n" 2454 3001 … … 2457 3004 if @singleton then 2458 3005 f.print "\t#{that}_inib = &#{@global_name}_SINGLE_CELL_INIB;\n\n" 2459 elsif @ idx_is_id_act2460 f.print "\t#{that}_inib = #{@global_name}_INIB_ tab[(i)];\n\n"3006 elsif @b_need_ptab then 3007 f.print "\t#{that}_inib = #{@global_name}_INIB_ptab[(i)];\n\n" 2461 3008 else 2462 3009 f.print "\t#{that}_inib = &#{@global_name}_INIB_tab[(i)];\n\n" … … 2697 3244 j = am[i] 2698 3245 if j then 2699 if am[i].get_ cell.get_celltype == self then3246 if am[i].get_rhs_cell.get_celltype == self then 2700 3247 # 同じセルタイプへ結合している場合(VDES では type conflict になる) 2701 3248 p = am[i].get_rhs_port … … 2726 3273 end 2727 3274 else 2728 if j.get_cell.get_celltype == self then 3275 dbgPrint "me=#{@name} callee=#{j.get_rhs_cell.get_celltype.get_name} #{j.get_cell.get_celltype.get_name} \n" 3276 if j.get_rhs_cell.get_celltype == self then 2729 3277 # 同じセルタイプへ結合している場合(VDES では type conflict になる) 2730 3278 p = j.get_rhs_port … … 2765 3313 2766 3314 jl = c.get_join_list 2767 jl.get_items.each{ |j| 2768 definition = j.get_definition 2769 next unless definition.instance_of? Port 3315 # ループを回す変数を jl から @port に変更 3316 # dynamic, optional 3317 # jl.get_items.each{ |j| 3318 @port.each { |port| 3319 next if port.get_port_type != :CALL 3320 dbgPrint( "gen_cell_ep_vdes_array: #{c.get_name}.#{port.get_name}\n" ) 3321 3322 # definition = j.get_definition 3323 # next unless definition.instance_of? Port 3324 j = jl.get_item( port.get_name ) 3325 2770 3326 # port = definition # definition は composite の Port が得られることがある 2771 port = find j.get_name # celltype の Port (こちらに最適化情報がある)3327 # port = find j.get_name # celltype の Port (こちらに最適化情報がある) 2772 3328 next if port.is_cell_unique? 2773 3329 next if port.is_omit? 2774 3330 2775 am = j.get_array_member2 2776 if am then 3331 b_array = false 3332 am = nil 3333 if j then 3334 am = j.get_array_member2 3335 if am then 3336 b_array = true 3337 end 3338 else 3339 if port.get_array_size == "[]" then 3340 # this case is dynamic optional and nothing joined 3341 next 3342 elsif port.get_array_size then 3343 b_array = true 3344 end 3345 end 3346 if b_array then 3347 # if am then 2777 3348 # 左辺は配列 3349 const = ( port.is_dynamic? && ! $ram_initializer ) ? '' : 'const ' 3350 init = ( port.is_dynamic? && $ram_initializer ) ? '_init_' : '' 2778 3351 2779 3352 if ! port.is_skelton_useless? then 2780 f.printf( "struct %s * const%s_%s[] = {\n",3353 f.printf( "struct %s * #{const}%s_%s[] = {\n", 2781 3354 "tag_#{port.get_signature.get_global_name}_VDES", 2782 3355 "#{c.get_global_name}", 2783 "#{ j.get_name}")3356 "#{port.get_name}" + init ) 2784 3357 else 2785 3358 2786 3359 # スケルトン関数不要最適化の場合、この配列は参照されない 2787 3360 # mikan このケースがテストされていない 2788 f.printf( " const%s_IDX %s_%s[] = {\n",3361 f.printf( "#{const}%s_IDX %s_%s[] = {\n", 2789 3362 # "#{j.get_celltype.get_global_name}", # 右辺 composite に対応できない 2790 3363 "#{j.get_rhs_cell.get_celltype.get_global_name}", … … 2800 3373 i = 0 2801 3374 while i < length 3375 if am == nil then 3376 f.print( " 0,\n" ) 3377 i += 1 3378 next 3379 end 2802 3380 j = am[i] 2803 3381 i += 1 … … 2841 3419 # mikan cell の namespace 未対応、Join で Cell オブジェクトを引当ておく必要あり 2842 3420 f.print "};\n" 3421 # dynamic の呼び口配列 3422 if port.is_dynamic? && $ram_initializer then 3423 f.printf( "struct %s * %s_%s[ #{length} ];\n", 3424 "tag_#{port.get_signature.get_global_name}_VDES", 3425 "#{c.get_global_name}", 3426 "#{port.get_name}" ) 3427 end 2843 3428 end 2844 3429 } … … 2967 3552 init = v.get_initializer 2968 3553 if init && init.instance_of?( Array ) then 2969 type = v.get_type.get_original_type 2970 2971 if( type.kind_of? PtrType )then 3554 type = v.get_type 3555 org_type = v.get_type.get_original_type 3556 3557 if( org_type.kind_of? PtrType )then 2972 3558 # PtrType は ArrayType にすり替える 2973 3559 … … 2976 3562 t2.set_type( type.get_type ) 2977 3563 type = t2 3564 org_type = t2 2978 3565 end 2979 3566 … … 2982 3569 # f.print "const #{type0.get_type_str}\t#{@global_name}_#{v.get_name}_VAR_INIT#{type0.get_type_str_post} = " 2983 3570 f.print "const #{type.get_type_str}\t#{@global_name}_#{v.get_name}_VAR_INIT#{type.get_type_str_post} = " 2984 if type.kind_of? StructType then3571 if org_type.kind_of? StructType then 2985 3572 # celltype の default の初期値あり 2986 3573 str = gen_cell_cb_init( f, c, name_array, type, init, v.get_identifier, 1, true ) 2987 elsif( type.kind_of?( PtrType ) ||type.kind_of?( ArrayType ) ) then3574 elsif( org_type.kind_of?( PtrType ) || org_type.kind_of?( ArrayType ) ) then 2988 3575 str = "{ " 2989 type = type.get_type3576 type = org_type.get_type 2990 3577 # mikan ポインタではなく、配列型としないと、ポインタ変数の領域の分、損する 2991 3578 init.each { |i| … … 3015 3602 fs.each{ |r, f| f.print "#{@global_name}_INIB #{@global_name}_SINGLE_CELL_INIB = \n" } 3016 3603 indent = 0 3017 elsif ! @ idx_is_id_actthen3604 elsif ! @b_need_ptab then 3018 3605 fs.each{ |r, f| f.print "#{@global_name}_INIB #{@global_name}_INIB_tab[] = {\n" } 3019 3606 indent = 1 … … 3036 3623 3037 3624 print_indent( f, indent ) 3038 if @ idx_is_id_actthen3625 if @b_need_ptab then 3039 3626 f.print "const #{@global_name}_INIB #{name_array[5]} = " 3040 3627 end 3041 3628 f.print "{\n" 3042 3629 3043 gen_cell_cb_port( c, indent, f, name_array )3630 gen_cell_cb_port( c, indent, f, name_array, :INIB ) 3044 3631 gen_cell_cb_attribute( c, indent, f, name_array, :INIB ) 3045 3632 3046 3633 unless @singleton then 3047 3634 # 1 つの cell INIB の終わり 3048 if @ idx_is_id_actthen3635 if @b_need_ptab then 3049 3636 f.print( "};\n\n" ) 3050 3637 else … … 3053 3640 end 3054 3641 } 3055 if ! @ idx_is_id_actthen3642 if ! @b_need_ptab then 3056 3643 fs.each{ |r, f| f.print( "};\n\n" ) } 3057 3644 end … … 3068 3655 fs.each{ |r, f| f.print "struct tag_#{@global_name}_CB #{@global_name}_SINGLE_CELL_CB = \n" } 3069 3656 indent = 0 3070 elsif ! @ idx_is_id_actthen3657 elsif ! @b_need_ptab then 3071 3658 fs.each{ |r, f| f.print "struct tag_#{@global_name}_CB #{@global_name}_CB_tab[] = {\n" } 3072 3659 indent = 1 3660 else 3661 indent = 0 3073 3662 end 3074 3663 … … 3087 3676 3088 3677 print_indent( f, indent ) 3089 if @ idx_is_id_actthen3678 if @b_need_ptab then 3090 3679 f.print "#{@global_name}_CB #{name_array[2]} = " 3091 3680 end … … 3097 3686 end 3098 3687 3099 if ! has_INIB? then 3100 gen_cell_cb_port( c, indent, f, name_array ) 3688 #if ! has_INIB? then 3689 if $rom == false then 3690 gen_cell_cb_port( c, indent, f, name_array, :CB_ALL ) 3691 else 3692 gen_cell_cb_port( c, indent, f, name_array, :CB_DYNAMIC ) 3101 3693 end 3102 3694 … … 3106 3698 unless @singleton then 3107 3699 # 1 つの cell CB の終わり 3108 if @ idx_is_id_actthen3700 if @b_need_ptab then 3109 3701 f.print( "};\n\n" ) 3110 3702 else … … 3113 3705 end 3114 3706 } 3115 if ! @ idx_is_id_actthen3707 if ! @b_need_ptab then 3116 3708 fs.each{ |r, f| f.print( "};\n\n" ) } 3117 3709 end … … 3120 3712 fs.each{ |r, f| f.print "struct tag_#{@global_name}_CB #{@global_name}_SINGLE_CELL_CB;\n" } 3121 3713 indent = 0 3122 elsif @ idx_is_id_actthen3714 elsif @b_need_ptab then 3123 3715 @ordered_cell_list.each{ |c| 3124 3716 next if ! c.is_generate? … … 3139 3731 def gen_cell_cb_tab f 3140 3732 indent = 0 3141 if @ idx_is_id_actthen3733 if @b_need_ptab then 3142 3734 if has_INIB? && ( $ram_initializer || ! has_CB? ) then 3143 3735 f.print "/* ID to INIB table #_INTAB_# */\n" … … 3150 3742 } 3151 3743 3152 f.print "#{@global_name}_INIB * #{@global_name}_INIB_tab[] ={\n"3744 f.print "#{@global_name}_INIB *const #{@global_name}_INIB_ptab[] ={\n" 3153 3745 @ordered_cell_list.each{ |c| 3154 3746 if c.is_generate? then # 生成対象か? … … 3170 3762 } 3171 3763 3172 f.print "#{@global_name}_CB * #{@global_name}_CB_tab[] ={\n"3764 f.print "#{@global_name}_CB *const #{@global_name}_CB_ptab[] ={\n" 3173 3765 @ordered_cell_list.each{ |c| 3174 3766 if c.is_generate? then # 生成対象か? … … 3199 3791 # name_array[9] = @global_name # celltype global name 3200 3792 # name_array[10] = cell.get_global_name # cell global name 3793 # name_array[11] = cell_INIB_proto #INIB name for proto type 3201 3794 3202 3795 def get_name_array( cell ) … … 3207 3800 cell_CB_proto = "#{@global_name}_SINGLE_CELL_CB" 3208 3801 cell_INIB_name = "#{@global_name}_SINGLE_CELL_INIB" 3802 cell_INIB_proto = cell_INIB_name 3209 3803 cell_ID = 0 3210 3804 else 3211 if ! @ idx_is_id_actthen3805 if ! @b_need_ptab then 3212 3806 index = cell.get_id - cell.get_celltype.get_id_base 3213 3807 cell_CB_name = "#{@global_name}_CB_tab[#{index}]" … … 3215 3809 cell_CB_proto = "#{@global_name}_CB_tab[]" 3216 3810 cell_INIB_name = "#{@global_name}_INIB_tab[#{index}]" 3811 cell_INIB_proto = "#{@global_name}_INIB_tab[]" 3217 3812 else 3218 3813 cell_CB_name = "#{cell.get_global_name}_CB" … … 3220 3815 cell_CB_proto = cell_CB_name 3221 3816 cell_INIB_name = "#{cell.get_global_name}_INIB" 3817 cell_INIB_proto = cell_INIB_name 3222 3818 end 3223 3819 cell_ID = cell.get_id 3224 3820 end 3821 3822 if has_CB? then 3823 cell_CBP = "&#{cell_CB_name}" 3824 elsif has_INIB? then 3825 cell_CBP = "&#{cell_INIB_name}" 3826 else 3827 cell_CBP = "NULL" # CB も INIB もなければ NULL に置換 3828 end 3829 3225 3830 if @idx_is_id_act then 3226 3831 cell_IDX = cell_ID 3227 3832 else 3228 cell_IDX = "&#{cell_CB_name}" 3229 end 3230 3231 if ! has_CB? && ! has_INIB? then 3232 cell_CBP = "NULL" # CB も INIB もなければ NULL に置換 3233 else 3234 cell_CBP = "&#{cell_CB_name}" 3833 cell_IDX = cell_CBP 3235 3834 end 3236 3835 … … 3247 3846 name_array[9] = @global_name # celltype global name 3248 3847 name_array[10] = cell.get_global_name # cell global name 3848 name_array[11] = cell_INIB_proto # INIB name for prototype 3249 3849 3250 3850 return name_array … … 3331 3931 end 3332 3932 3333 def gen_cell_cb_port( cell, indent, f, name_array ) 3334 gen_cell_cb_call_port( cell, indent, f, name_array ) 3933 #inib_cb::Symbol: :INIB, :CB_ALL, :CB_DYNAMIC 3934 def gen_cell_cb_port( cell, indent, f, name_array, inib_cb = :INIB ) 3935 gen_cell_cb_call_port( cell, indent, f, name_array, inib_cb ) 3335 3936 gen_cell_cb_entry_port( cell, indent, f, name_array ) 3336 3937 end 3337 3938 3338 3939 #=== 呼び口の初期化コードの生成 3339 def gen_cell_cb_call_port( cell, indent, f, name_array )3940 def gen_cell_cb_call_port( cell, indent, f, name_array, inib_cb ) 3340 3941 jl = cell.get_join_list 3341 3942 3342 3943 port = get_port_list 3343 if @n_call_port != 0 then 3944 if inib_cb == :INIB && ( @n_call_port - @n_call_port_omitted_in_CB - 3945 ( $ram_initializer ? 0 : (@n_call_port_dynamic-@n_call_port_array_dynamic) ) > 0 ) || 3946 inib_cb == :CB_ALL && @n_call_port > 0 || 3947 inib_cb == :CB_DYNAMIC && (@n_call_port_dynamic - @n_call_port_array_dynamic) > 0 then 3344 3948 print_indent( f, indent + 1 ) 3345 f.print "/* call port #_CP_# */ \n"3949 f.print "/* call port (#{inib_cb}) #_CP_# */ \n" 3346 3950 port.each{ |p| 3347 3951 next if p.get_port_type != :CALL 3348 3952 next if p.is_omit? 3349 3953 next if p.is_cell_unique? # 最適化(単一セルで呼び口マクロに埋め込まれる) 3954 next if inib_cb == :INIB && p.is_dynamic? && p.get_array_size == nil && ! $ram_initializer 3955 next if inib_cb == :CB_DYNAMIC && ( ! p.is_dynamic? || p.get_array_size != nil ) 3350 3956 3351 3957 j = jl.get_item( p.get_name ) … … 3354 3960 # debug 3355 3961 if j == nil then 3962 dbgPrint "cell_cb_call_port: #{p.get_name} array size=#{p.get_array_size}\n" 3356 3963 # optional 呼び口 3357 3964 # cdl_error( "H1003 internal error: cell \'$1\' port \'$2\': initializer not found\n" , cell.get_name, p.get_name ) 3358 3965 # exit( 1 ) 3359 f.printf( "%-40s /* #_CCP5_# */\n", "0," ) 3360 if p.get_array_size == "[]" then 3361 # 添数省略の呼び口配列 3362 print_indent( f, indent + 1 ) 3363 f.printf( "%-40s /* %s #_CCP6_# */\n", "0,", "length of #{p.get_name} (n_#{p.get_name})" ) 3966 if p.get_array_size then 3967 if p.is_dynamic? then 3968 if inib_cb == :INIB then 3969 if $ram_initializer then 3970 f.printf( "%-40s /* #_CCP7_# _init_ */\n", "#{cell.get_global_name}_#{p.get_name}_init_," ) 3971 print_indent( f, indent + 1 ) 3972 end 3973 f.printf( "%-40s /* #_CCP7B_# */\n", "#{cell.get_global_name}_#{p.get_name}," ) 3974 elsif $rom == false then 3975 f.printf( "%-40s /* #_CCP8_# */\n", "#{cell.get_global_name}_#{p.get_name}," ) 3976 end 3977 else 3978 f.printf( "%-40s /* #_CCP9_# */\n", "0," ) 3979 end 3980 if p.get_array_size == "[]" then 3981 # 添数省略の呼び口配列 3982 print_indent( f, indent + 1 ) 3983 f.printf( "%-40s /* %s #_CCP6_# */\n", "0,", "length of #{p.get_name} (n_#{p.get_name})" ) 3984 end 3985 else 3986 f.printf( "%-40s /* #_CCP5_# */\n", "0," ) 3364 3987 end 3365 3988 next … … 3369 3992 if am then 3370 3993 # 呼び口配列の場合 3371 f.printf( "%-40s /* #_CCP3_# */\n", "#{cell.get_global_name}_#{j.get_name}," ) 3994 if inib_cb == :INIB && p.is_dynamic? && p.get_array_size != nil && $ram_initializer then 3995 f.printf( "%-40s /* #_CCP3_# _init_ */\n", "#{cell.get_global_name}_#{j.get_name}_init_," ) 3996 print_indent( f, indent + 1 ) 3997 end 3998 f.printf( "%-40s /* #_CCP3B_# */\n", "#{cell.get_global_name}_#{j.get_name}," ) 3372 3999 if p.get_array_size == "[]" then 3373 4000 # 添数省略の呼び口配列 … … 3385 4012 end 3386 4013 4014 init = ( p.is_dynamic? && inib_cb == :INIB ) ? "_init_" : "" 4015 3387 4016 if j.get_rhs_subscript then 3388 4017 # 受け口配列の場合 … … 3391 4020 # "&#{j.get_cell_global_name}_#{j.get_port_name}_des#{subscript},", 3392 4021 "#{des_type_cast}&#{j.get_port_global_name}_des#{subscript},", 3393 p.get_name )4022 p.get_name.to_s + init ) 3394 4023 else 3395 4024 # 呼び口配列でも、受け口配列でもない … … 3397 4026 f.printf( "%-40s /* %s #_CCP1_# */\n", 3398 4027 "#{des_type_cast}&#{j.get_port_global_name}_des,", 3399 p.get_name )4028 p.get_name.to_s + init ) 3400 4029 else 3401 4030 # スケルトン不要最適化(CB (INIB) へのポインタを埋め込む) 3402 4031 c = j.get_rhs_cell # 呼び先セル 3403 4032 ct = c.get_celltype # 呼び先セルタイプ 4033 name_array = ct.get_name_array( c ) # 呼び先セルタイプで name_array を得る 3404 4034 if ct.has_INIB? || ct.has_CB? then 3405 name_array = ct.get_name_array( c ) # 呼び先セルタイプで name_array を得る3406 4035 f.printf( "%-40s /* %s #_CCP2_# */\n", "#{name_array[7]},", p.get_name ) 3407 4036 else 3408 4037 # 呼び先は CB も INIB も持たない(NULL に初期化) 3409 f.printf( "%-40s /* %s #_CCP2 _# */\n", "0,", p.get_name )4038 f.printf( "%-40s /* %s #_CCP2B_# */\n", "0,", p.get_name ) 3410 4039 end 3411 4040 end … … 3689 4318 f = fs[ c.get_region.get_domain_root ] 3690 4319 3691 ct = c.get_celltype 4320 ct = c.get_celltype # ct = self でも同じ 3692 4321 jl = c.get_join_list 4322 name_array = get_name_array( c ) 3693 4323 3694 4324 port = ct.get_port_list … … 3725 4355 else 3726 4356 if has_CB? then 3727 if @singleton then 3728 f.print " &#{@global_name}_SINGLE_CELL_CB, /* CB */\n" 3729 else 3730 # f.print " &#{@global_name}_#{c.get_name}_CB,\n" 3731 f.print " &#{@global_name}_CB_tab[#{index}], /* CB */\n" 3732 end 4357 # if @singleton then 4358 # f.print " &#{@global_name}_SINGLE_CELL_CB, /* CB 1 */\n" 4359 # else 4360 # # f.print " &#{@global_name}_#{c.get_name}_CB,\n" 4361 # f.print " &#{@global_name}_CB_tab[#{index}], /* CB 2 */\n" 4362 # end 4363 f.print " #{name_array[8]}, /* CB 1 */\n" 3733 4364 elsif has_INIB? then 3734 if @singleton then 3735 f.print " &#{@global_name}_SINGLE_CELL_INIB, /* INIB */\n" 3736 else 3737 f.print " &#{@global_name}_INIB_tab[#{index}], /* INIB */\n" 3738 end 4365 # if @singleton then 4366 # f.print " &#{@global_name}_SINGLE_CELL_INIB, /* INIB 1 */\n" 4367 # else 4368 # f.print " &#{@global_name}_INIB_tab[#{index}], /* INIB 2 */\n" 4369 # end 4370 f.print " &#{name_array[5]}, /* INIB 1 */\n" 3739 4371 else 3740 4372 f.print " 0,\n" … … 3760 4392 else 3761 4393 if has_CB? then 3762 if @singleton then 3763 f.print " &#{@global_name}_SINGLE_CELL_CB, /* CB */\n" 3764 else 3765 f.print " &#{@global_name}_CB_tab[#{index}], /* CB */\n" 3766 # f.print " &#{@global_name}_#{c.get_name}_CB,\n" 3767 end 4394 # if @singleton then 4395 # f.print " &#{@global_name}_SINGLE_CELL_CB, /* CB 3 */\n" 4396 # else 4397 # f.print " &#{@global_name}_CB_tab[#{index}], /* CB 4 */\n" 4398 # # f.print " &#{@global_name}_#{c.get_name}_CB,\n" 4399 # end 4400 f.print " #{name_array[8]}, /* CB 3 */\n" 3768 4401 elsif has_INIB? then 3769 if @singleton then 3770 f.print " &#{@global_name}_SINGLE_CELL_INIB, /* INIB */\n" 3771 else 3772 f.print " &#{@global_name}_INIB_tab[#{index}], /* INIB */\n" 3773 end 4402 # if @singleton then 4403 # f.print " &#{@global_name}_SINGLE_CELL_INIB, /* INIB 3 */\n" 4404 # else 4405 # # f.print " &#{@global_name}_INIB_tab[#{index}], /* INIB 4 */\n" 4406 # end 4407 f.print " &#{name_array[5]}, /* INIB 3 */\n" 3774 4408 else 3775 4409 f.print " 0,\n" … … 3940 4574 3941 4575 ft.get_paramlist.get_items.each{ |param| 4576 # p "type_str: #{param.get_type.get_type_str}" 3942 4577 f.print( "#{delim} #{param.get_type.get_type_str}" ) 3943 4578 f.print( " #{param.get_name}#{param.get_type.get_type_str_post}" ) … … 3967 4602 end 3968 4603 4604 if p.is_ref_desc? then 4605 subsc = p.get_array_size ? ' int_t subscript ' : '' 4606 f.print " * [ref_desc]\n" 4607 f.printf( " * %-14s %s;\n", 4608 "Descriptor( #{p.get_signature.get_global_name} )", 4609 "#{p.get_name}_refer_to_descriptor(#{subsc})" ) 4610 f.printf( " * %-14s %s;\n", 4611 "Descriptor( #{p.get_signature.get_global_name} )", 4612 "#{p.get_name}_ref_desc(#{subsc}) (same as above; abbreviated version)" ) 4613 end 4614 if p.is_dynamic? then 4615 subsc = p.get_array_size ? 'int_t subscript, ' : '' 4616 subsc2 = p.get_array_size ? ' int_t subscript' : '' 4617 if p.is_optional? then 4618 f.print " * [dynamic, optional]\n" 4619 else 4620 f.print " * [dynamic]\n" 4621 end 4622 f.printf( " * %-14s %s;\n", 4623 "void", 4624 "#{p.get_name}_set_descriptor( #{subsc}Descriptor( #{p.get_signature.get_global_name} ) desc )" ) 4625 if p.is_optional? then 4626 f.printf( " * %-14s %s;\n", 4627 "void", 4628 "#{p.get_name}_unjoin( #{subsc2} )" ) 4629 end 4630 end 3969 4631 } 3970 4632 … … 4048 4710 delim = ", " 4049 4711 f.print param.get_type.get_type_str 4712 # p "type_str2: #{param.get_type.get_type_str}" 4050 4713 f.print " " 4051 4714 f.print param.get_name … … 4103 4766 def generate_inline_template_code 4104 4767 return if @n_entry_port_inline == 0 4768 return if @b_reuse && ! $generate_all_template 4105 4769 if ! ( @plugin && @plugin.gen_ep_func? ) then 4106 4770 return if @b_reuse && ! $generate_all_template … … 4480 5144 # str に以下の置換を行う 4481 5145 #- $ct$ ⇒ セルタイプ名(ct) 4482 #- $cell$ ⇒ セル名(cell) cell が nil ならば 3つの置換は行われない5146 #- $cell$ ⇒ セル名(cell) cell が nil ならば以下の置換は行われない 4483 5147 #- $cb$ ⇒ CB の C 言語名(cb) 4484 5148 #- $cbp$ ⇒ CB へのポインタ(cbp) 4485 5149 #- $cb_proto$ ⇒ CB の C 言語名プロトタイプ宣言用(cb_proto) 4486 #- $id$ ⇒ ct_cell5150 #- $id$ ⇒ $ct$_$cell_global$ # ct_cell before or same V1.5.2 4487 5151 #- $idx$ ⇒ idx 4488 5152 #- $ID$ ⇒ id (整数の番号) 4489 5153 #- $ct_global$ ⇒ セルタイプ名(ct) 4490 #- $cell_global$ ⇒ セル名(cell) cell が nil ならば3つの置換は行われない5154 #- $cell_global$ ⇒ セル名(cell) 4491 5155 #- $$ ⇒ $ 4492 5156 def subst_name( str, name_array ) … … 4503 5167 4504 5168 str = str.gsub( /(^|[^\$])\$ct\$/, "\\1#{ct}" ) 5169 str = str.gsub( /(^|[^\$])\$ct_global\$/, "\\1#{ct_global}" ) 4505 5170 if cell then 4506 5171 str = str.gsub( /(^|[^\$])\$cell\$/, "\\1#{cell}" ) 4507 5172 str = str.gsub( /(^|[^\$])\$cb\$/, "\\1#{cb}" ) 4508 str = str.gsub( /(^|[^\$])\$id\$/, "\\1#{ct}_#{cell}" ) 5173 # str = str.gsub( /(^|[^\$])\$id\$/, "\\1#{ct}_#{cell}" ) 5174 str = str.gsub( /(^|[^\$])\$id\$/, "\\1#{ct}_#{cell_global}" ) 4509 5175 str = str.gsub( /(^|[^\$])\$cb_proto\$/, "\\1#{cb_proto}" ) 4510 5176 str = str.gsub( /(^|[^\$])\$ID\$/, "\\1#{id}" ) 4511 5177 str = str.gsub( /(^|[^\$])\$idx\$/, "\\1#{idx}" ) 4512 5178 str = str.gsub( /(^|[^\$])\$cbp\$/, "\\1#{cbp}" ) 4513 str = str.gsub( /(^|[^\$])\$ct_global\$/, "\\1#{ct_global}" )4514 5179 str = str.gsub( /(^|[^\$])\$cell_global\$/, "\\1#{cell_global}" ) 4515 5180 end … … 4631 5296 end 4632 5297 end 5298 5299 class DomainType < Node 5300 def gen_factory 5301 # p "DomainType: gen_factory" 5302 @plugin.gen_factory 5303 end 5304 end -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecslib/core/location.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)の条件を満たす場合に限り,本ソフトウェ -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecslib/core/messages.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)の条件を満たす場合に限り,本ソフトウェ … … 89 89 end 90 90 91 #=== TECSMsg#ローカライズされた情報メッセージを得る 92 # Generator.info2 から呼び出される 93 def self.get_info_message( body ) 94 body =~ /^[A-Z0-9]+/ # 情報番号を取り出す 95 num = $& 96 msg = @@info_message[ num.to_sym ] 97 if msg == nil then 98 m = body 99 else 100 m = num + " " + msg 101 end 102 return m 103 end 104 91 105 end -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecslib/core/optimize.rb
r321 r429 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)の条件を満たす場合に限り,本ソフトウェ … … 178 178 179 179 def set_domain 180 domain_cells = {} 180 181 @cell_list.each{ |c| 181 182 if c.is_generate? then … … 191 192 @domain_roots[ dn ] = [ dr ] 192 193 end 194 if domain_cells[ dr ] then 195 domain_cells[ dr ] << c 196 else 197 domain_cells[ dr ] = [ c ] 198 end 193 199 end 194 200 } … … 196 202 @domain_roots.each{ |dn, drs| 197 203 drs.uniq! 198 if ! $debug then 199 dbgPrint "domains celltype:#{@name} domain=#{dn} " 204 if $verbose && dn then 205 print "[domain] celltype=#{@name} domainType=#{dn} domainRootRegions={" 206 delim = "" 200 207 drs.each{ |r| 201 dbgPrint " region=#{r.get_name}" 208 print delim, r.get_name 209 delim = ", " 202 210 } 203 dbgPrint "\n" 211 print "}\n" 212 drs.each{ |r| 213 print "[domain] celltype=#{@name} domainRootRegion=#{r.get_name} domainType=#{dn} domainKind=#{r.get_domain_root.get_domain_type.get_kind} domainCells={" 214 delim = "" 215 domain_cells[r].each{ |c| 216 print delim, c.get_name 217 delim = ", " 218 } 219 print "}\n" 220 } 204 221 end 205 222 } … … 212 229 # domain_type は一つのノードに一つしかないので、一つの要素を無条件で取り出す 213 230 if regions.length > 1 then 214 cdl_info( "celltype:#{@name} has cells in multi domain.\n" ) 215 if @idx_is_id == false then 216 cdl_info( "celltype:#{@name} forcely set idx_is_id\n" ) 217 end 218 @idx_is_id_act = true 231 if $verbose then 232 cdl_info( "I9999 celltype '$1' has cells in multi-domain.\n", @name ) 233 end 234 # if @idx_is_id == false then 235 # cdl_info( "I9999 celltype '$1' forcely set idx_is_id\n", @name ) 236 # end 237 @b_need_ptab = true 238 # @idx_is_id_act = true 219 239 end 220 240 } … … 228 248 end 229 249 250 optimize_call 251 if $unopt_entry == false then 252 optimize_entry 253 end 254 end 255 256 #=== Celltype#呼び口最適化 257 def optimize_call 230 258 @port.each{ |port| 231 259 next if port.get_port_type != :CALL … … 238 266 if $verbose then 239 267 print "optimized by omit: port: #{port.get_name} : o\n" 268 end 269 next 270 elsif port.is_dynamic? then 271 if $verbose then 272 print "unoptimized by dynamic: port: #{port.get_name}\n" 273 end 274 next 275 elsif port.is_ref_desc? then 276 if $verbose then 277 print "unoptimized by ref_desc: port: #{port.get_name}\n" 240 278 end 241 279 next … … 351 389 dbgPrint "#{port.get_name} : # of cells : #{port_cells.length} # of ports : #{port_ports.length}\n" 352 390 } 353 391 end 392 393 #=== Celltype#受け口最適化 394 # optimize_entry は、呼び口最適化の結果を使用している 395 def optimize_entry 354 396 # 受け口最適化の設定 355 397 @port.each{ |port| -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecslib/core/plugin.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)の条件を満たす場合に限り,本ソフトウェ … … 38 38 #++ 39 39 40 #== class モジュール40 #== Plugin クラス 41 41 # ThroughPlugin, SignaturePlugin, CelltypePlugin に include する 42 42 class Plugin < Node … … 75 75 end 76 76 77 ### 意味解析段階で呼び出されるメソッド ### 77 ### 構文解釈 または 意味解析段階で呼び出されるメソッド ### 78 # generate 指定子の場合、構文解釈次第(end_of_parseで)呼び出される 79 # generate 文の場合、出現次第呼び出される 80 ### 意味解析段階で呼び出されるメソッド ### <<< コメント誤り (V1.4.2) 78 81 #=== CDL ファイルの生成 79 82 # typedef, signature, celltype, cell のコードを生成 … … 157 160 # 識別子取得 158 161 if arg =~ /\A[a-zA-Z_]\w*/ then 159 ident = $~ 162 ident = $~.to_s # 160 163 arg = $' 161 164 else … … 285 288 end 286 289 287 #== 出力文字列を EUCから出力ファイルに convert する288 # tecsgen のソースコードは EUCで記述されている290 #== 出力文字列を utf-8 から出力ファイルに convert する 291 # tecsgen のソースコードは utf-8 で記述されている 289 292 # これを、出力ファイルの文字コードに変換して出力する 290 293 # -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecslib/core/pluginModule.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)の条件を満たす場合に限り,本ソフトウェ … … 45 45 46 46 #=== プラグインをロードする 47 #return:: true : 成功、 false : 失敗 47 # return:: PluginClass 48 # V1.4.1 まで return:: true : 成功、 false : 失敗 49 # 50 # #{plugin_name}.rb をロードし、plugin_name クラスのオブジェクトを生成する. 51 # plugin_name が MultiPlugin の場合、get_plugin により、superClass のプラグインオブジェクトをロードする. 48 52 # 49 53 # すでにロードされているものは、重複してロードしない … … 59 63 end 60 64 # "#{plugin_name}.rb" をロード(システム用ではないので、fatal エラーにしない) 61 if require_tecsgen_lib( "#{plugin_name}.rb", false ) == false 65 if require_tecsgen_lib( "#{plugin_name}.rb", false ) == false then 62 66 cdl_error( "P2001 $1.rb : fail to load plugin" , plugin_name ) 63 return false67 return nil 64 68 end 65 69 end 66 70 67 plSuper = nil 68 # eval( "plSuper = #{plugin_name}.superclass" ) 69 eval( "plSuper = #{plugin_name}" ) 70 while plSuper != superClass && plSuper != nil 71 plSuper = plSuper.superclass 72 end 73 if plSuper == nil then 71 plClass = Object.const_get plugin_name 72 if ( plClass <= superClass ) then # plClass inherits superClass 73 return plClass 74 elsif (plClass <= MultiPlugin) then # plClass inherits MultiPlugin 75 dbgPrint "pluginClass=#{plClass}\n" 76 plugin_object = plClass.get_plugin superClass 77 dbgPrint "pluginClass=#{plugin_object}\n" 78 if plugin_object == nil then 79 cdl_error( "P9999 '$1': MultiPlugin not support '$2'", plugin_name, superClass.name ) 80 end 81 @@loaded_plugin_list[ plugin_name.to_sym ] = :MultiPlugin 82 return plugin_object 83 else 74 84 cdl_error( "P2002 $1: not kind of $2" , plugin_name, superClass.name ) 75 return false85 return nil 76 86 end 77 87 rescue Exception => evar … … 81 91 end 82 92 cdl_error( "P2003 $1: load failed" , plugin_name ) 83 return false93 return nil 84 94 end 85 return true 95 # ここへは来ない 96 return nil 86 97 end 87 98 … … 92 103 end 93 104 plugin_name = plugin_object.class.name.to_sym 94 if @@loaded_plugin_list[ plugin_name ] == nil 95 raise "#{plugin_name} might have different name " 96 # プラグインのファイル名と、プラグインのクラス名が相違する場合 105 if @@loaded_plugin_list[ plugin_name ] == :MultiPlugin then 106 p "#{plugin_name}: MultiPlugin" 107 return 108 elsif @@loaded_plugin_list[ plugin_name ] == nil then 109 #raise "#{plugin_name} might have different name " 110 ## プラグインのファイル名と、プラグインのクラス名が相違する場合 111 #MultiPlugin の get_plugin で返されたケースでは nil になっている 112 @@loaded_plugin_list[ plugin_name ] = 0 97 113 end 98 114 count = @@loaded_plugin_list[ plugin_name ] … … 131 147 dbgPrint "PluginModule #{@@loaded_plugin_list}\n" 132 148 @@loaded_plugin_list.each{ |plugin_name,count| 149 if count == :MultiPlugin then 150 next 151 end 133 152 dbgPrint "PluginModule: #{plugin_name}\n" 134 153 eval_str = "#{plugin_name}.gen_post_code( file )" -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecslib/core/syntaxobj.rb
r321 r429 4 4 # Generator for TOPPERS Embedded Component System 5 5 # 6 # Copyright (C) 2008-201 6by TOPPERS Project6 # Copyright (C) 2008-2017 by TOPPERS Project 7 7 #-- 8 8 # 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ … … 86 86 87 87 #=== 情報を表示する 88 def cdl_info( message ) 89 Console.puts "info: #{message}" 88 def cdl_info( message, *arg ) 89 Generator.info2( @locale, message, *arg ) 90 end 91 92 #=== 情報を表示する 93 def cdl_info2( locale, message, *arg ) 94 Generator.info2( locale, message, *arg ) 90 95 end 91 96 … … 680 685 end 681 686 687 #=== Decl# print_flowinfo 688 def print_flowinfo file 689 if @kind == :VAR then 690 file.write "#{@identifier} " 691 end 692 end 693 682 694 def show_tree( indent ) 683 695 indent.times { print " " } -
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 -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecslib/core/types.rb
r321 r429 4 4 # Generator for TOPPERS Embedded Component System 5 5 # 6 # Copyright (C) 2008-201 5by TOPPERS Project6 # Copyright (C) 2008-2017 by TOPPERS Project 7 7 #-- 8 8 # 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ … … 629 629 630 630 class FloatType < Type 631 # @bit_size:: 32, 64, (80), -32, -64 631 # @bit_size:: 32, 64, (80), -32, -64, -128 632 632 633 633 def initialize( bit_size ) … … 684 684 when -64 685 685 str = "#{str}double" 686 when -128 687 str = "#{str}long double" 686 688 end 687 689 return str … … 734 736 # @b_has_sized_pointer_member:: bool : メンバにポインタ型がある 735 737 # @b_has_unsized_string_member:: bool : メンバにポインタ型がある 738 # @b_hasTag:: bool : タグがある 736 739 # @member_types_symbol:: Symbol : tag が無い時のみ設定 (それ以外では nil) 737 740 … … 746 749 super() 747 750 @tag = tag 751 if tag then 752 @b_hasTag = true 753 else 754 @b_hasTag = false 755 end 748 756 @@structtype_current_sp += 1 749 757 @@structtype_current_stack[@@structtype_current_sp] = self … … 918 926 str = super 919 927 920 if @ tag then928 if @b_hasTag then 921 929 # typedef struct tag StructType; の形式の場合 922 930 # struct の本体は、別に生成される 923 return "#{str}struct #{@tag} 931 return "#{str}struct #{@tag}" 924 932 925 933 else 926 934 # typedef struct { int a; } StructType; の形式の場合 927 str += "struct { \n"935 str += "struct {" 928 936 @members_decl.get_items.each{ |i| 929 str += sprintf( " %-8s %s%s;\n", "#{i.get_type.get_type_str}", "#{i.get_name}", "#{i.get_type.get_type_str_post}" )937 str += sprintf( "%s %s%s;", "#{i.get_type.get_type_str}", "#{i.get_name}", "#{i.get_type.get_type_str_post}" ) 930 938 } 931 939 str += "} " … … 1267 1275 def check_init( locale, ident, initializer, kind, attribute = nil ) 1268 1276 if ( initializer.instance_of?( Array ) ) then 1277 # 要素数が指定されている場合、初期化要素数をチェック 1278 if @subscript then 1279 n_sub = @subscript.eval_const( nil ) 1280 if n_sub then 1281 if initializer.length > n_sub then 1282 cdl_error2( locale, "T9999 $1: too many initializer, $2 for $3" , ident, initializer.length, n_sub ) 1283 end 1284 end 1285 end 1269 1286 index = 0 1270 1287 initializer.each{ |i| … … 1543 1560 # 動的結合で渡すデスクリプタ型 1544 1561 class DescriptorType < Type 1545 # @sinagure_nsp::NamespacePath 1562 # @sinagure_nsp::NamespacePath 1563 1564 @@descriptors = {} 1546 1565 1547 1566 def initialize( signature_nsp ) 1548 1567 @signature_nsp = signature_nsp 1549 obj = Namespace.find signature_nsp 1550 if ! obj.kind_of? Signature then 1551 cdl_error( "T9999 '$1': not signature or not found", signature_nsp.to_s ) 1552 else 1553 if obj.has_descriptor? then 1554 cdl_error( "T9999 '$1': has Desicrptor in function parameter", signature_nsp.to_s ) 1555 end 1556 end 1568 # check_signature ## 1569 @@descriptors[ self ] = false 1557 1570 end 1558 1571 1559 1572 def get_type_str 1560 "Descriptor( #{@signature_nsp. to_s} )"1573 "Descriptor( #{@signature_nsp.get_global_name} )" 1561 1574 end 1562 1575 … … 1581 1594 end 1582 1595 1596 def self.check_signature 1597 @@descriptors.each{ |desc, val| 1598 if val != true then 1599 desc.check_signature 1600 @@descriptors[ desc ] = true 1601 end 1602 } 1603 end 1604 1605 def check_signature 1606 # p "Desc #{@signature_nsp.to_s}" 1607 obj = Namespace.find @signature_nsp 1608 if ! obj.kind_of? Signature then 1609 cdl_error( "T9999 '$1': not signature or not found", @signature_nsp.to_s ) 1610 else 1611 if obj.has_descriptor? then 1612 # cdl_error( "T9999 '$1': has Descriptor in function parameter", @signature_nsp.to_s ) 1613 end 1614 # @signature_nsp = obj.get_namespace_path 1615 end 1616 end 1617 1583 1618 #== DescriptorType# 1584 # 意味解析段階では nil が返される可能性に注意1585 1619 def get_signature 1586 1620 Namespace.find @signature_nsp -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecslib/messages/messages_console_en_US.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)の条件を満たす場合に限り,本ソフトウェ … … 1168 1168 @@warning_message[ :"W6004" ] = "need 'void' for no parameter" 1169 1169 1170 ### 1171 # info メッセージ 1172 @@info_message = {} 1173 1170 1174 end -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecslib/messages/messages_console_ja_JP.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)の条件を満たす場合に限り,本ソフトウェ … … 1168 1168 @@warning_message[ :"W6004" ] = "パラメータが存在しない場合 'void' が必要です" 1169 1169 1170 ### 1171 # info メッセージ 1172 @@info_message = {} 1173 1170 1174 end -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecslib/messages/messages_file_en_US.rb
r321 r429 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)の条件を満たす場合に限り,本ソフトウェ … … 76 76 # * このファイルを編集して使用することが意図されていますが 77 77 # * tecsgen の再実行により上書きされてしまうため、通常 78 # * gen/%s_templ ate.c => src/%s.c78 # * gen/%s_templ.c => src/%s.c 79 79 # * のように名前, フォルダを変更してから修正します 80 80 # */ … … 83 83 * This file was automatically generated by tecsgen. 84 84 * Move and rename like below before editing, 85 * gen/%s_templ ate.c => src/%s.c85 * gen/%s_templ.c => src/%s.c 86 86 * to avoid to be overwritten by tecsgen. 87 87 */ … … 227 227 @@comment[ :EPM_comment ] = "\n/* entry port function macro (abbrev) %s */\n" 228 228 229 # @@comment[ :CRD_comment ] = "\n/* ディスクリプタ参照関数 %s */\n" 230 @@comment[ :CRD_comment ] = "/* refer to descriptor function %s */\n" 231 232 # @@comment[ :CRDA_comment ] = "\n/* ディスクリプタ参照マクロ(短縮形) %s */\n" 233 @@comment[ :CRDA_comment ] = "\n/* refer to descriptor macro (abbrev) %s */\n" 234 235 # @@comment[ :SDF_comment ] = "/* ディスクリプタ設定関数 %s */\n" 236 @@comment[ :SDF_comment ] = "/* set descriptor function %s */\n" 237 238 # @@comment[ :SDMA_comment ] = "\n/* ディスクリプタ設定マクロ(短縮形) %s */\n" 239 @@comment[ :SDMA_comment ] = "\n/* set descriptor macro (abbrev) %s */\n" 240 229 241 # @@comment[ :CTIX_comment ] = "\n/* セルタイプのIDX型 %s */\n" 230 242 @@comment[ :CTIX_comment ] = "\n/* celltype IDX type %s */\n" … … 323 335 @@comment[ :TEFB_comment ] = "\t/* Put statements here %s */\n" 324 336 337 # @@comment[ :MCPP_comment ] = "/* セル CB プロトタイプ宣言 %s */\n" 338 @@comment[ :MCPP_comment ] = "/* cell CB prototype declaration %s */\n" 339 340 # @@comment[ :MCPB_comment ] = "/* セル CB プロトタイプ宣言 %s */\n" 341 @@comment[ :MCPB_comment ] = "/* cell CB prototype declaration %s */\n" 325 342 end -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecslib/messages/messages_file_ja_JP.rb
r321 r429 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)の条件を満たす場合に限り,本ソフトウェ … … 65 65 * このファイルを編集して使用することが意図されていますが 66 66 * tecsgen の再実行により上書きされてしまうため、通常 67 * gen/%s_templ ate.c => src/%s.c67 * gen/%s_templ.c => src/%s.c 68 68 * のように名前, フォルダを変更してから修正します 69 69 */ … … 127 127 @@comment[ :CPMA_comment ] = "/* 呼び口関数マクロ(短縮形)%s */\n" 128 128 @@comment[ :EPM_comment ] = "\n/* 受け口関数マクロ(短縮形) %s */\n" 129 @@comment[ :CRD_comment ] = "/* ディスクリプタ参照関数 %s */\n" 130 @@comment[ :CRDA_comment ] = "\n/* ディスクリプタ参照マクロ(短縮形) %s */\n" 131 @@comment[ :SDF_comment ] = "/* ディスクリプタ設定関数 %s */\n" 132 @@comment[ :SDMA_comment ] = "\n/* ディスクリプタ設定マクロ(短縮形) %s */\n" 129 133 @@comment[ :CTIX_comment ] = "\n/* セルタイプのIDX型 %s */\n" 130 134 @@comment[ :EPP_comment ] = "\n/* 受け口関数プロトタイプ宣言 %s */\n" … … 159 163 @@comment[ :TEPF_comment ] = "/* 受け口関数 %s */\n" 160 164 @@comment[ :TEFB_comment ] = "\t/* ここに処理本体を記述します %s */\n" 165 @@comment[ :MCPP_comment ] = "/* CB プロトタイプ宣言 %s */\n" 166 @@comment[ :MCPB_comment ] = "/* CB プロトタイプ宣言 %s */\n" 161 167 162 168 end -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecslib/plugin/DomainPlugin.rb
r321 r429 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 -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2AlarmHandlerPlugin.rb
r321 r429 34 34 # アの利用により直接的または間接的に生じたいかなる損害に関しても,そ 35 35 # の責任を負わない. 36 # 37 # $Id: HRP2AlarmHandlerPlugin.rb 2640 2017-06-03 11:27:12Z okuma-top $ 36 38 # 37 39 #++ … … 50 52 def print_cfg_cre(file, cell, val, tab) 51 53 val[:id] = val[:id].gsub( /(^|[^\$])\$id\$/, "\\1#{@celltype.get_name.to_s}_#{cell.get_name.to_s}" ) 52 # $cbp$ の代わり53 index = cell.get_id - @celltype.get_id_base54 cell_CB _name = "#{@celltype.get_global_name}_CB_tab[#{index}]"54 # $cbp$ #983 55 name_array = @celltype.get_name_array cell 56 cell_CBP = name_array[8] # CBP 55 57 # CRE_XXXの生成 56 58 if (cell.get_region.get_region_type != :DOMAIN) || (cell.get_region.get_param != :KERNEL_DOMAIN) … … 59 61 else 60 62 file.print <<EOT 61 #{tab}CRE_ALM(#{val[:id]}, { #{val[:attribute]}, &#{cell_CB_name}, tAlarmHandler_start });63 #{tab}CRE_ALM(#{val[:id]}, { #{val[:attribute]}, #{cell_CBP}, tAlarmHandler_start }); 62 64 EOT 63 65 end -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2CyclicHandlerPlugin.rb
r321 r429 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 … … 51 52 def print_cfg_cre(file, cell, val, tab) 52 53 val[:id] = val[:id].gsub( /(^|[^\$])\$id\$/, "\\1#{@celltype.get_name.to_s}_#{cell.get_name.to_s}" ) 53 # $cbp$ の代わり54 index = cell.get_id - @celltype.get_id_base55 cell_CB _name = "#{@celltype.get_global_name}_CB_tab[#{index}]"54 # $cbp$ #983 55 name_array = @celltype.get_name_array cell 56 cell_CBP = name_array[8] # CBP 56 57 # CRE_XXXの生成 57 58 if (cell.get_region.get_region_type != :DOMAIN) || (cell.get_region.get_param != :KERNEL_DOMAIN) … … 60 61 else 61 62 file.print <<EOT 62 #{tab}CRE_CYC(#{val[:id]}, { #{val[:attribute]}, &#{cell_CB_name}, tCyclicHandler_start, #{val[:cyclicTime]}, #{val[:cyclicPhase]} });63 #{tab}CRE_CYC(#{val[:id]}, { #{val[:attribute]}, #{cell_CBP}, tCyclicHandler_start, #{val[:cyclicTime]}, #{val[:cyclicPhase]} }); 63 64 EOT 64 65 end -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2DataqueuePlugin.rb
r321 r429 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 -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2EventflagPlugin.rb
r321 r429 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 -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2FixedSizeMemoryPoolPlugin.rb
r321 r429 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 -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2HandlerPlugin.rb
r321 r429 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)の条件を満たす場合に限り,本ソフトウェ … … 35 35 # の責任を負わない. 36 36 # 37 # $Id$ 37 38 #++ 38 39 39 40 #require "HRP2KernelObjectPlugin" 40 41 require_tecsgen_lib "HRP2KernelObjectPlugin.rb" 41 42 42 43 43 #== celltype プラグインの共通の親クラス … … 51 51 # tab : 52 52 def print_cfg_cre(file, cell, val, tab) 53 val[:id] = val[:id].gsub( /(^|[^\$])\$id\$/, "\\1#{@celltype.get_name.to_s}_#{cell.get_name.to_s}" ) 54 # $cbp$の代わり 55 index = cell.get_id - @celltype.get_id_base 56 cell_CB_name = "#{@celltype.get_global_name}_CB_tab[#{index}]" 53 if !val[:id].nil? 54 val[:id] = val[:id].gsub( /(^|[^\$])\$id\$/, "\\1#{@celltype.get_name.to_s}_#{cell.get_name.to_s}" ) 55 end 56 # $cbp$ #983 57 name_array = @celltype.get_name_array cell 58 cell_CBP = name_array[8] # CBP 57 59 # CRE_XXXの生成 58 60 domainOption = cell.get_region.get_domain_root.get_domain_type.get_option … … 63 65 elsif @plugin_arg_str == "ALARM" 64 66 file.print <<EOT 65 #{tab}CRE_ALM(#{val[:id]}, { #{val[:attribute]}, &#{cell_CB_name}, tAlarmHandler_start });67 #{tab}CRE_ALM(#{val[:id]}, { #{val[:attribute]}, #{cell_CBP}, tAlarmHandler_start }); 66 68 EOT 67 69 elsif @plugin_arg_str == "CYCLIC" 68 70 file.print <<EOT 69 #{tab}CRE_CYC(#{val[:id]}, { #{val[:attribute]}, &#{cell_CB_name}, tCyclicHandler_start, #{val[:cyclicTime]}, #{val[:cyclicPhase]} }); 71 #{tab}CRE_CYC(#{val[:id]}, { #{val[:attribute]}, #{cell_CBP}, tCyclicHandler_start, #{val[:cyclicTime]}, #{val[:cyclicPhase]} }); 72 EOT 73 elsif @plugin_arg_str == "CONFIG_INT" 74 file.print <<EOT 75 #{tab}CFG_INT( #{val[:interruptNumber]}, { #{val[:attribute]}, #{val[:interruptPriority]} }); 76 EOT 77 elsif @plugin_arg_str == "ISR" 78 file.print <<EOT 79 #{tab}ATT_ISR({ #{val[:attribute]}, #{cell_CBP}, #{val[:interruptNumber]}, tISR_start, #{val[:priority]} }); 80 EOT 81 elsif @plugin_arg_str == "INIT_ROUTINE" 82 file.print <<EOT 83 #{tab}ATT_INI({ #{val[:attribute]}, #{cell_CBP}, tInitializeRoutine_start }); 84 EOT 85 elsif @plugin_arg_str == "TERM_ROUTINE" 86 file.print <<EOT 87 #{tab}ATT_TER({ #{val[:attribute]}, #{cell_CBP}, tTerminateRoutine_start }); 70 88 EOT 71 89 else … … 79 97 elsif @plugin_arg_str == "CYCLIC" 80 98 file.puts "SAC_CYC(#{val[:id]}, { #{acv[0]}, #{acv[1]}, #{acv[2]}, #{acv[3]} });" 99 elsif @plugin_arg_str == "CONFIG_INT" 100 # nothing to do 101 elsif @plugin_arg_str == "ISR" 102 # nothing to do 103 elsif @plugin_arg_str == "INIT_ROUTINE" 104 # nothing to do 105 elsif @plugin_arg_str == "TERM_ROUTINE" 106 # nothing to do 81 107 else 82 108 raise "#{@plugin_arg_str} is unknown option" -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2KernelObjectPlugin.rb
r321 r429 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 … … 185 186 val = {} 186 187 @celltype.get_attribute_list.each{ |a| 187 p a.get_name188 # p a.get_name 188 189 if a.get_type.kind_of?( ArrayType ) 189 190 val[a.get_name] = [] … … 217 218 if val[:id].nil? != true 218 219 puts val[:id] 219 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 ) ) 220 222 end 221 223 # $cbp$の代わり … … 243 245 file2.puts "}\n" 244 246 else 245 print "~~~~~ #{cell.get_region.get_name.to_s} is included in"246 p @@region_list247 dbgPrint "~~~~~ #{cell.get_region.get_name.to_s} is included in" 248 # p @@region_list 247 249 end 248 250 file3 = AppFile.open( "#{$gen}/tecsgen_#{cell_domain_root.get_name.to_s}.cfg" ) … … 257 259 puts "===== end check my domain #{cell.get_name} =====" 258 260 # SAC_XXXの生成 259 puts "===== begin check regions #{cell.get_name} =====" 260 p val[:accessPattern] 261 p val[:accessPattern].class 262 263 #ep = [ :eTaskActivate, :eTaskControl, :eTaskManage, :eTaskRefer ] 264 #各カーネルオブジェクトの受け口名を取得 265 # ep = get_entry_ports_name_list() 266 i = 0 267 acv = [] 268 # アクセス許可ベクタの生成 269 val[:accessPattern].each { |acptnx| 270 # アクセス許可パターンの生成 271 if acptnx != "OMIT" 272 acv << acptnx 273 p acv[i] 274 elsif cell_domain_type.get_option.to_s == "trusted" 275 acv << "TACP_KERNEL" 276 p acv[i] 277 elsif cell_domain_type.get_option.to_s != "OutOfDomain" 278 acv << "TACP(#{cell_domain_root.get_name.to_s})" 261 if !val[:accessPattern].nil? 262 puts "===== begin check regions #{cell.get_name} =====" 263 # p val[:accessPattern] 264 # p val[:accessPattern].class 265 266 #ep = [ :eTaskActivate, :eTaskControl, :eTaskManage, :eTaskRefer ] 267 #各カーネルオブジェクトの受け口名を取得 268 # ep = get_entry_ports_name_list() 269 i = 0 270 acv = [] 271 # アクセス許可ベクタの生成 272 val[:accessPattern].each { |acptnx| 273 # アクセス許可パターンの生成 274 if acptnx != "OMIT" 275 acv << acptnx 276 # p acv[i] 277 elsif cell_domain_type.get_option.to_s == "trusted" 278 acv << "TACP_KERNEL" 279 # p acv[i] 280 elsif cell_domain_type.get_option.to_s != "OutOfDomain" 281 acv << "TACP(#{cell_domain_root.get_name.to_s})" 282 else 283 acv << "TACP_SHARED" 284 end 285 286 i += 1 287 } 288 289 dbgPrint "acv = " 290 p acv 291 292 #各種SACの生成 293 domainOption = cell_domain_type.get_option 294 # if cell.get_region.get_region_type == :DOMAIN 295 if domainOption != "OutOfDomain" 296 # 保護ドメインに属する場合 297 file3 = AppFile.open( "#{$gen}/tecsgen_#{cell.get_region.get_name.to_s}.cfg" ) 298 print_cfg_sac(file3, val, acv) 299 file3.close 279 300 else 280 acv << "TACP_SHARED" 301 # 無所属の場合 302 print_cfg_sac(file2, val, acv) 281 303 end 282 304 283 i += 1 284 } 285 286 print "acv = " 287 p acv 288 289 #各種SACの生成 290 domainOption = cell_domain_type.get_option 291 # if cell.get_region.get_region_type == :DOMAIN 292 if domainOption != "OutOfDomain" 293 # 保護ドメインに属する場合 294 file3 = AppFile.open( "#{$gen}/tecsgen_#{cell.get_region.get_name.to_s}.cfg" ) 295 print_cfg_sac(file3, val, acv) 296 file3.close 297 else 298 # 無所属の場合 299 print_cfg_sac(file2, val, acv) 305 puts "===== end check regions #{cell.get_name} =====" 300 306 end 301 302 puts "===== end check regions #{cell.get_name} ====="303 307 end 304 308 } … … 319 323 320 324 def self.check_referenced_cells() 321 puts "===== begin check registered celltype ====="325 dbgPrint "===== begin check registered celltype =====\n" 322 326 self.get_celltype_list.each { |ct| 323 p ct.get_name.to_s327 dbgPrint( ct.get_name.to_s + "\n" ) 324 328 } 325 puts "===== end check registered celltype ====="329 dbgPrint "===== end check registered celltype =====\n" 326 330 327 331 =begin … … 331 335 j = cell.get_join_list.get_item(p.get_name) 332 336 printf "===== check call port : " 333 p p.get_name.to_s337 # p p.get_name.to_s 334 338 next if j.nil? # 未結合の場合 335 339 if @@celltype_list.include?(j.get_celltype) … … 338 342 j.get_cell.set_referenced_cell(cell, j.get_port_name) 339 343 printf "===== check joined rhs cell : " 340 p j.get_cell.get_name.to_s344 # p j.get_cell.get_name.to_s 341 345 printf "===== check joined rhs port_name : " 342 p j.get_port_name346 # p j.get_port_name 343 347 end 344 348 } -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2ObjectPlugin.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)の条件を満たす場合に限り,本ソフトウェ … … 35 35 # の責任を負わない. 36 36 # 37 # $Id$ 37 38 #++ 38 39 -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2Plugin.rb
r321 r429 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)の条件を満たす場合に限り,本ソフトウェ … … 35 35 # の責任を負わない. 36 36 # 37 # $Id$ 37 38 #++ 38 39 … … 43 44 44 45 def initialize( region, name, option ) 45 print "MyDomainPlugin: initialize: region=#{region.get_name}, domainName=#{name}, option=#{option}\n" 46 super 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 46 59 end 47 60 … … 54 67 # get_rhs_subscript:Integer or nil 受け口配列の添数 (Join::@rhs_subscript の説明参照) 55 68 # return [] 56 print " MyDomainPlugin: add_through_plugin: #{current_region.get_name}=>#{next_region.get_name}, #{join.get_owner.get_name}.#{join.get_definition.get_name}=>#{join.get_cell.get_name}.#{join.get_port_name}, #{through_type}\n"69 print "HRP2Plugin: add_through_plugin: #{current_region.get_name}=>#{next_region.get_name}, #{join.get_owner.get_name}.#{join.get_definition.get_name}=>#{join.get_cell.get_name}.#{join.get_port_name}, #{through_type}\n" 57 70 58 71 puts "=====Join Check Start=====" … … 107 120 end 108 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 109 135 def joinable?(current_region, next_region, through_type ) 110 print " MyDomainPlugin: joinable? from #{current_region.get_name} to #{next_region.get_name} (#{through_type})\n"136 print "HRP2Plugin: joinable? from #{current_region.get_name} to #{next_region.get_name} (#{through_type})\n" 111 137 return true 112 138 end -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2PostHook.rb
r321 r429 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 -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2RPCPlugin.rb
r321 r429 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; -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2SVCPlugin.rb
r321 r429 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 -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2TaskPlugin.rb
r321 r429 35 35 # の責任を負わない. 36 36 # 37 # $Id$ 37 38 #++ 38 39 … … 52 53 # tab : 53 54 def print_cfg_cre(file, cell, val, tab) 54 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 ) ) 55 57 # $cbp$の代わり 56 58 index = cell.get_id - @celltype.get_id_base … … 58 60 cell_CB_name = "#{index}" 59 61 # CRE_XXX/DEF_XXXの生成 60 print "assign task plugin\n"62 dbgPrint "assign task plugin\n" 61 63 domainOption = cell.get_region.get_domain_root.get_domain_type.get_option 62 64 # if cell.get_region.get_region_type == :DOMAIN 65 # cell.show_tree 1 63 66 if domainOption != "OutOfDomain" 64 67 # 保護ドメインに属する場合 … … 68 71 raise "system task cannot have user stack." 69 72 end 73 p "CRE_TSK 0 user=#{val[:userStackSize]} system=#{val[:systemStackSize]}" 70 74 file.print <<EOT 71 75 #{tab}CRE_TSK(#{val[:id]}, { #{val[:taskAttribute]}, #{cell_CB_name}, tTask_start_task, #{val[:priority]}, #{val[:systemStackSize]}, NULL }); … … 76 80 raise "user task must have user stack." 77 81 end 82 p "CRE_TSK 1" 78 83 if val[:systemStackSize] == "OMIT" 79 84 file.print <<EOT … … 81 86 EOT 82 87 else 88 p "CRE_TSK 2" 83 89 file.print <<EOT 84 90 #{tab}CRE_TSK(#{val[:id]}, { #{val[:taskAttribute]}, #{cell_CB_name}, tTask_start_task, #{val[:priority]}, #{val[:userStackSize]}, NULL, #{val[:systemStackSize]}, NULL }); … … 121 127 ct = cell.get_celltype 122 128 if ct.class == Celltype && check_celltype_list.include?( ct ) == false 129 # チェック済みセルタイプに登録 130 check_celltype_list << ct 131 123 132 # 未チェックのセルタイプだった場合 124 133 # puts "check for ATT_MOD : #{ct.classget_global_name}" … … 134 143 regions = ct.get_domain_roots 135 144 regions_hrp2 = regions[ :HRP2 ] 136 print "HRP2 domain in #{ct.get_name}: "145 dbgPrint "HRP2 domain in #{ct.get_name}: " 137 146 regions_hrp2.each { |reg| 138 print reg.get_name147 dbgPrint reg.get_name 139 148 } 140 149 puts "" … … 179 188 file.print "ATT_MOD(\"#{ct.get_global_name}.o\");\n" 180 189 file.close 181 182 check_celltype_list << ct183 190 else 184 191 # 何もしない -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecslib/plugin/MrubyBridgePlugin.rb
r321 r429 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)の条件を満たす場合に限り,本ソフトウェ … … 37 37 # 38 38 39 # Todo: 40 # 生成するもの 41 # gen_cdl_file 42 # ブリッジ初期化セルタイプ (シグニチャごと) 43 # @@init_celltypes に記録 44 # ブリッジセルタイプ (シグニチャごと) 45 # @@celltypes に記録 46 # 構造体セルタイプ 47 # @@struct_list に記録 48 # new_cell 49 # TECS 初期化セル(プロトタイプ宣言) 50 # @@VM_init_cells に記録 51 # @@VM_struct_list に記録 52 # @@VM_ptr_list に記録 53 # gen_post_code 54 # 構造体初期化セル 55 # ポインタ初期化セル 56 # TECS 初期化セル 57 # 58 # ep_func の作成 59 # signature, ポインタ、構造体 … 初期化受け口=mruby VM への登録 60 # ポインタ 61 # preamble の作成 62 # ポインタ、構造体 … アクセス用コードの生成 63 # signature … ブリッジ関数のプロトタイプ宣言 64 # postamble の作成 65 # signature … ブリッジ関数の定義 66 67 class MrubyBridgePlugin < SignaturePlugin 68 69 # プラグイン引数名 => Proc 70 MrubyBridgePluginArgProc = { 71 "ignoreUnsigned" => Proc.new { |obj,rhs| obj.set_ignoreUnsigned rhs }, 72 "include" => Proc.new { |obj,rhs| obj.set_include rhs }, 73 "exclude" => Proc.new { |obj,rhs| obj.set_exclude rhs }, 74 } 75 76 @@celltypes = { } # {celltype_name => [ BridgePlugin のインスタンスの配列 } 77 @@init_celltypes = { } # {celltype_name => [ BridgePlugin のインスタンスの配列 } 78 @@struct_list = { } # {struct_name=>StructType} 79 @@ptr_list = { } # {ptr_celltype_name=> @@TYPE_MAP の対応するもの} 80 @@VM_list = { } # VM_name => true 81 @@VM_celltypes = { } # VM_name => { @celltype_name => セルの配列 } 82 @@VM_struct_list = { } # {name=>StructType} 83 @@VM_ptr_list = { } # { VM_name => {name=> @@TYPE_MAP の対応するもの} } 84 @@TYPE_MAP = { # type_str class GET_SET 85 :char_t => [:char_t, "Char", :Char, :INT ], 86 :uchar_t => [:uchar_t, "UChar", :Char, :INT ], 87 :schar_t => [:schar_t, "SChar", :Char, :INT ], 88 89 :bool_t => [:bool_t, "Bool", :Bool, :BOOL ], 90 :int8_t => [:int8_t, "Int8", :Int, :INT ], 91 :int16_t => [:int16_t, "Int16", :Int, :INT ], 92 :int32_t => [:int32_t, "Int32", :Int, :INT ], 93 :int64_t => [:int64_t, "Int64", :Int, :INT ], 94 :uint8_t => [:uint8_t, "UInt8", :Int, :INT ], 95 :uint16_t => [:uint16_t, "UInt16", :Int, :INT ], 96 :uint32_t => [:uint32_t, "UInt32", :Int, :INT ], 97 :uint64_t => [:uint64_t, "UInt64", :Int, :INT ], 98 99 :int => [:int, "Int", :Int, :INT ], 100 :char => [:char, "Char", :Char, :INT ], # char は char_t として扱う 101 :short => [:short, "Short", :Int, :INT ], 102 :long => [:long, "Long", :Int, :INT ], 103 104 :"unsigned char" => [:uchar_t, "UChar", :Char, :INT ], 105 :"unsigned int" => [:"unsigned int", "UInt", :Int, :INT ], 106 :"unsigned short" => [:"unsigned short", "UShort", :Int, :INT ], 107 :"unsigned long" => [:"unsigned long", "ULong", :Int, :INT ], 108 :"signed char" => [:schar_t, "SChar", :Char, :INT ], 109 :"signed int" => [:int, "Int", :Int, :INT ], 110 :"signed short" => [:short, "Short", :Int, :INT ], 111 :"signed long" => [:long, "Long", :Int, :INT ], 112 113 :float32_t => [:float32_t, "Float32", :Float, :FLOAT ], 114 :double64_t => [:double64_t,"Double64", :Float, :FLOAT ], 115 116 :float => [:float, "Float32", :Float, :FLOAT ], 117 :double => [:double, "Double64", :Float, :FLOAT ] 118 } 119 120 # included or excluded functions 121 122 ### ロードされた時点で実行される ### 123 124 # -I に $(TECSPATH)/mruby を追加 125 # TECSGEN::Makefile.add_obj "$(MRUBY_MAIN_OBJ)" 126 TECSGEN::Makefile.add_ldflag "-lmruby -L$(MRUBYPATH)/lib -lm" 127 TECSGEN::Makefile.add_search_path "$(MRUBYPATH)/include" 128 TECSGEN::Makefile.add_var "MRUBYPATH", "..", "CHANGE this to suitable path" 129 # TECSGEN::Makefile.add_var "MRUBY_MAIN_OBJ", "$(_TECS_OBJ_DIR)tecs_mruby.o", "CHANGE this if your have your main" 130 131 132 #=== プラグインインスタンスの初期化 133 # 戻り値、引数の型が使用可能なものかチェックする 134 # 135 def initialize( signature, option ) 136 super 137 138 if ! $no_banner 139 STDERR << "MrubyBridgePlugin: version 1.2.0 (Suitable for mruby ver 1.2.0. Has backward compatibility with ver 1.1.0)\n" 140 end 141 142 @b_ignoreUnsigned = false 143 @includes = [] 144 @excludes = [] 145 @struct_list = { } 146 @ptr_list = { } 147 148 @plugin_arg_check_proc_tab = MrubyBridgePluginArgProc 149 parse_plugin_arg 150 151 @celltype_name = :"t#{@signature.get_global_name}" 152 @init_celltype_name = :"#{@celltype_name}_Initializer" 153 # this variable is sometimes not used. rhs coded directry. 154 @class_name = :"T#{@signature.get_global_name}" 155 156 @func_head_array = [] 157 if @includes.length > 0 && @excludes.length > 0 then 158 cdl_error( "MRB1011 both include && exclude are specified" ) 159 end 160 161 if signature.get_function_head_array == nil then 162 return # 以前に文法エラー発生 163 end 164 165 signature.get_function_head_array.each{ |func_head| 166 if @includes.length > 0 then 167 if @includes.index func_head.get_name then 168 dbgPrint "MrubyBridgePlugin: #{func_head.get_name} INCLUDED\n" 169 @func_head_array << func_head 170 else 171 dbgPrint "MrubyBridgePlugin: #{func_head.get_name} NOT included\n" 172 end 173 elsif @excludes.length > 0 then 174 if @excludes.index( func_head.get_name ) == nil then 175 dbgPrint "MrubyBridgePlugin: #{func_head.get_name} NOT excluded\n" 176 @func_head_array << func_head 177 else 178 dbgPrint "MrubyBridgePlugin: #{func_head.get_name} EXCLUDED\n" 179 end 180 else 181 @func_head_array << func_head 182 end 183 } 184 185 if @func_head_array.length == 0 then 186 cdl_error( "MRB1012 '$1' no function remained by exclude", @signature.get_name ) 187 end 188 189 check_name_and_return_type @func_head_array 190 check_parameter_type @func_head_array 191 192 end 193 194 #=== check function name & return type 195 def check_name_and_return_type func_head_array 196 b_init = false; b_init_cell = false 197 func_head_array.each{ |func_head| 198 if( func_head.get_name == :initialize )then 199 cdl_warning( "MRW2001 initialize: internally defined. change to initialize_cell in ruby" ) 200 b_init = true 201 elsif( func_head.get_name == :initialize_cell )then 202 b_init_cell = true 203 end 204 rtype = func_head.get_return_type.get_original_type 205 case rtype 206 when BoolType, IntType, FloatType, VoidType 207 else 208 cdl_error( "MRB1001 cannot return type $1", rtype.get_type_str ) 209 end 210 } 211 if( b_init && b_init_cell )then 212 cdl_warning( "MRB1002 initialize: internally defined. change to initialize_cell in ruby" ) 39 #== MrubyBridgePlugin クラス 40 class MrubyBridgePlugin < MultiPlugin 41 def self.get_plugin superClass 42 # case when (つまりは ===) では、期待したように一致しない模様 43 if superClass == SignaturePlugin then 44 dbgPrint "MrubyBridgePlugin: SignaturePlugin" 45 require_tecsgen_lib 'tecslib/plugin/MrubyBridgeSignaturePlugin.rb' 46 return MrubyBridgeSignaturePlugin 47 elsif superClass == CelltypePlugin 48 dbgPrint "MrubyBridgePlugin: CelltypePlugin" 49 require_tecsgen_lib 'tecslib/plugin/MrubyBridgeCelltypePlugin.rb' 50 return MrubyBridgeCelltypePlugin 51 elsif superClass == CompositePlugin 52 dbgPrint "MrubyBridgePlugin: CompositePlugin" 53 require_tecsgen_lib 'tecslib/plugin/MrubyBridgeCompositePlugin.rb' 54 return MrubyBridgeCompositePlugin 55 elsif superClass == CellPlugin 56 dbgPrint "MrubyBridgePlugin: CellPlugin" 57 require_tecsgen_lib 'tecslib/plugin/MrubyBridgeCellPlugin.rb' 58 return MrubyBridgeCellPlugin 59 #elsif superClass == ThroughPlugin 60 # return ThroughPlugin 61 #elsif superClass == DomainPlugin 62 # return DomainPlugin 63 else 64 dbgPrint "MrubyBridgePlugin: unsupported" 65 return nil 213 66 end 214 67 end 215 216 #=== check paramter type217 def check_parameter_type func_head_array218 # check type of parameters219 func_head_array.each{ |fh|220 fh.get_paramlist.get_items.each{ |param_decl|221 case param_decl.get_direction222 when :SEND, :RECEIVE223 cdl_error( "MRB1003 $1: $2 parameter cannot be used in mruby Bridge", param_decl.get_name, param_decl.get_direction.to_s.downcase )224 end225 type = param_decl.get_type226 type_org = type.get_original_type227 type_str = type.get_type_str + type.get_type_str_post228 229 b_ng = false230 case type_org231 when IntType232 case type_org.get_bit_size233 when 8, 16, 32, 64234 when -1, -2, -3, -4, -11235 else236 b_ng = true237 end238 when BoolType239 when FloatType240 when PtrType241 ttype_org = type_org.get_type # ポインタの指している先の型242 ttype = ttype_org.get_original_type # 上記の typedef されている場合、元の型243 register_ptr_type ttype_org244 245 if( type_org.get_string.to_s == "-1" ) then246 case param_decl.get_direction247 when :OUT, :INOUT248 cdl_error( "MRB9999 string specifier without length cannot be used for out & inout parameter")249 end250 end251 252 case ttype253 when IntType254 bit_size = ttype.get_bit_size255 # if bit_size < 0 && bit_size != -1 then256 # b_ng = true257 # end258 when FloatType259 when BoolType260 when StructType261 if( type_org.get_size || type_org.get_string || type_org.get_count ) then262 cdl_error( "MRB1004 $1: size_is, count_is, string cannot be specified for struct pointer", param_decl.get_name )263 end264 check_struct_member ttype_org265 else266 b_ng = true267 end268 when StructType269 check_struct_member type_org270 else # ArrayType, FuncType, EnumType, VoidType271 b_ng = true272 end273 if b_ng then274 cdl_error( "MRB1005 $1: type $2 cannot be used in mruby Bridge", param_decl.get_name, type_str )275 end276 }277 }278 end279 280 #=== 構造体のメンバーの型のチェック281 def check_struct_member struct_type282 #p "tag name:#{struct_type.get_name}"283 # sttype = Namespace.find_tag( struct_type.get_name )284 sttype = struct_type.get_original_type285 if sttype.get_name == nil then286 cdl_error( "MRB10007 tagless-struct cannot be handled")287 end288 sttype.get_members_decl.get_items.each { |d|289 t = d.get_type.get_original_type290 case t291 when IntType, FloatType, BoolType292 else293 cdl_error( "MRB1006 $1: type $2 not allowed for struct member", d.get_name, d.get_type.get_type_str + d.get_type.get_type_str_post )294 end295 }296 st_name = :"t{}"297 if @struct_list[ sttype.get_name ] == nil then298 # print_msg " MrubyBridgePlugin: [struct] #{struct_type.get_type_str} => class TECS::Struct#{sttype.get_name}\n"299 print " MrubyBridgePlugin: [struct] #{struct_type.get_type_str} => class TECS::Struct#{sttype.get_name}\n"300 @struct_list[ sttype.get_name ] = sttype301 end302 end303 304 def register_ptr_type ttype305 t_org = ttype.get_original_type306 tment = get_type_map_ent t_org307 if tment == nil then308 return309 cdl_error( "MRB1008 unknown pointer type '$1'", ttype.get_type_str )310 end311 ptr_celltype_name = :"t#{tment[1]}Pointer"312 if @@ptr_list[ ptr_celltype_name ] == nil then313 # print_msg " MrubyBridgePlugin: [pointer] #{ttype.get_type_str}* => class TECS::#{tment[1]}Pointer\n"314 print " MrubyBridgePlugin: [pointer] #{ttype.get_type_str}* => class TECS::#{tment[1]}Pointer\n"315 @@ptr_list[ ptr_celltype_name ] = tment316 end317 if @ptr_list[ ptr_celltype_name ] == nil then318 @ptr_list[ ptr_celltype_name ] = tment319 end320 end321 322 def get_type_map_ent ttype323 # structure type is registerd in check_struct_member324 if ttype.kind_of? StructType325 return326 end327 tstr = ttype.get_type_str.sub( /const /, "" ) # const は無視328 tstr = tstr.sub( /volatile /, "" ) # volatile も無視329 if @b_ignoreUnsigned then330 tstr = tstr.sub( /unsigned /, "" ) # volatile も無視331 tstr = tstr.sub( /uint/, "int" ) # volatile も無視332 tstr = tstr.sub( /[cs]char/, "char" ) # volatile も無視333 end334 return @@TYPE_MAP[ tstr.to_sym ]335 end336 337 #=== CDL ファイルの生成338 # typedef, signature, celltype, cell コードを生成339 #file:: FILE 生成するファイル340 def gen_cdl_file(file)341 342 # ブリッジセルタイプの生成343 if @@celltypes[ @celltype_name ] == nil then344 @@celltypes[ @celltype_name ] = [ self ]345 @@init_celltypes[ @init_celltype_name ] = true346 print_msg <<EOT347 MrubyBridgePlugin: [signature] #{@signature.get_namespace_path} => [celltype] nMruby::#{@celltype_name} => [class] TECS::#{@class_name}348 EOT349 350 file.print <<EOT351 import( <mruby.cdl> );352 353 /**** Ruby => TECS Bridge Celltype (MBP500) ****/354 namespace nMruby{355 // bridge celltype356 [idx_is_id,active] // not actually active, to avoid warning W1002, W1007357 celltype #{@celltype_name} {358 call #{@signature.get_namespace_path.to_s} cTECS;359 attr {360 [omit]361 char_t *VMname = "VM";362 };363 };364 // bridge initializer celltype365 celltype #{@init_celltype_name} {366 entry sInitializeTECSBridge eInitialize;367 };368 };369 EOT370 371 # 構造体セルタイプの生成372 @struct_list.each{ |name, sttype|373 if @@struct_list[ name ] == nil then374 file.print <<EOT375 namespace nMruby{376 [singleton]377 celltype #{name} {378 entry sInitializeTECSBridge eInitialize;379 };380 };381 EOT382 @@struct_list[ name ] = sttype383 end384 }385 386 else387 cdl_warning( "MRBW001 MrubyBridgePlugin: signature '$1' duplicate. ignored current one", @signature.get_namespace_path )388 @@celltypes[ @celltype_name ] << self389 end390 end391 392 #=== gen_cdl_file で定義したセルタイプに 新しいセルが定義された393 # cell のセルタイプの名前は @celltype_name394 def new_cell cell395 if cell.get_celltype.get_name != @celltype_name then396 return397 end398 399 join = cell.get_join_list.get_item :VMname400 if join then401 vm_name = CDLString.remove_dquote(join.get_rhs.to_s).to_sym402 else403 vm_name = :"VM"404 end405 406 if @@VM_list[ vm_name ] == nil then407 @@VM_list[ vm_name ] = true408 409 initializer_celltype_cdl = "#{$gen}/#{cell.get_name}Initializer.cdl"410 file = CFile.open( initializer_celltype_cdl, "w" )411 412 # TECS 初期化セル(プロトタイプ宣言)413 print_msg " MrubyBridgePlugin: join your VM's cInitialize to #{vm_name}_TECSInitializer.eInitialize\n"414 415 file.print <<EOT416 417 // prototype of TECSInitializer (MBP510)418 cell nMruby::tTECSInitializer #{vm_name}_TECSInitializer;419 EOT420 file.close421 422 Generator.parse( initializer_celltype_cdl, self )423 end424 425 if @@VM_celltypes[ vm_name ] then426 vma = @@VM_celltypes[ vm_name ]427 428 if vma[ @celltype_name ] then429 vma[ @celltype_name ] << cell430 else431 vma[ @celltype_name ] = [cell]432 @@VM_celltypes[ vm_name ] = vma433 end434 else435 vma = { }436 vma[ @celltype_name ] = [cell]437 @@VM_celltypes[ vm_name ] = vma438 end439 440 @struct_list.each{ |stname, sttype|441 if @@VM_struct_list[ vm_name ] then442 @@VM_struct_list[ vm_name ][ sttype.get_name ] = sttype443 else444 @@VM_struct_list[ vm_name ] = { sttype.get_name => sttype }445 end446 }447 @ptr_list.each{ |ptr_celltype_name, tment|448 if @@VM_ptr_list[ vm_name ] then449 @@VM_ptr_list[ vm_name ][ ptr_celltype_name ] = tment450 else451 @@VM_ptr_list[ vm_name ] = { ptr_celltype_name => tment }452 end453 }454 455 end456 457 #=== プラグインが CDL の POST コードを生成458 # tmp_plugin_post_code.cdl への出力459 def self.gen_post_code file460 461 # file.print <<EOT462 # namespace nMruby {463 # EOT464 #465 # @@ptr_list.each{ |name,tment|466 # file.print <<EOT467 #468 # // MBP600469 # [singleton]470 # celltype #{name} {471 # entry sInitializeTECSBridge eInitialize;472 # };473 # EOT474 # }475 #476 # file.print <<EOT477 # };478 # EOT479 480 # gen_post_code で生成した celltype は gen_ep_func が呼び出されない #847481 # @@struct_list.each{ |name,sttype|482 # file.print <<EOT483 #484 # [singleton]485 # celltype #{name} {486 # entry sInitializeTECSBridge eInitialize;487 # };488 #EOT489 # }490 491 file.print " // MBP601\n"492 @@VM_celltypes.each{ |vm_name, instance_list|493 instance_list.each { |celltype_name, array|494 cell = array[0]495 if cell.get_celltype then496 ct_name = cell.get_celltype.get_name497 file.print <<EOT498 cell nMruby::#{ct_name}_Initializer #{vm_name}_#{ct_name}_Initializer{ };499 EOT500 end501 }502 }503 504 file.print " // MBP602\n"505 @@ptr_list.each{ |name,tment|506 file.print <<EOT507 cell nMruby::#{name} C#{name} { };508 EOT509 }510 511 file.print " // MBP603\n"512 @@struct_list.each{ |name,sttype|513 file.print <<EOT514 cell nMruby::#{name} C#{name} { };515 EOT516 }517 518 if @@VM_celltypes == nil519 raise "are0"520 end521 @@VM_celltypes.each{ |vm_name, instance_list|522 file.print " /* === VM #{vm_name} === (MBP610) */\n"523 init_cell_name = "#{vm_name}_TECSInitializer"524 525 file.print " cell nMruby::tTECSInitializer #{init_cell_name} {\n"526 527 instance_list.each { |celltype_name, array|528 array.each{ |cell|529 ct_name = cell.get_celltype.get_name530 file.print " cInitialize[] = #{vm_name}_#{ct_name}_Initializer.eInitialize;\n"531 }532 }533 if @@VM_ptr_list[vm_name] then534 @@VM_ptr_list[vm_name].each{ |name, tment|535 file.print " cInitialize[] = C#{name}.eInitialize;\n"536 }537 end538 if @@VM_struct_list[vm_name] then539 @@VM_struct_list[vm_name].each{ |name, sttype|540 file.print " cInitialize[] = C#{name}.eInitialize;\n"541 }542 end543 file.print " };"544 }545 546 end547 548 ####### 以下コード生成段階 ######549 550 #=== 受け口関数の本体コードを生成(頭部と末尾は別途出力)551 #ct_name:: Symbol (プラグインで生成された) セルタイプ名 .Symbol として送られてくる552 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 )553 if @@celltypes[ ct_name ] then554 gen_ep_func_body_bridge( file, b_singleton, ct_name, global_ct_name, sig_name, ep_name, func_name, func_global_name, func_type, params )555 elsif @@init_celltypes[ ct_name ] then556 gen_ep_func_body_bridge_init( file, b_singleton, ct_name, global_ct_name, sig_name, ep_name, func_name, func_global_name, func_type, params )557 elsif @@ptr_list[ ct_name ] then558 gen_ep_func_body_ptr( file, b_singleton, ct_name, global_ct_name, sig_name, ep_name, func_name, func_global_name, func_type, params )559 elsif @@struct_list[ ct_name ] then560 gen_ep_func_body_struct( file, b_singleton, ct_name, global_ct_name, sig_name, ep_name, func_name, func_global_name, func_type, params )561 else562 raise "Unknown #{ct_name}"563 end564 end565 566 def gen_ep_func_body_bridge( file, b_singleton, ct_name, global_ct_name, sig_name, ep_name, func_name, func_global_name, func_type, params )567 raise "unexpected "568 end569 570 def gen_ep_func_body_bridge_init( file, b_singleton, ct_name, global_ct_name, sig_name, ep_name, func_name, func_global_name, func_type, params )571 file.print <<EOT572 CELLCB *p_cellcb = GET_CELLCB( idx ); /* no error check */ /* MBP700 */573 struct RClass *rc;574 575 rc = mrb_define_class_under( mrb, TECS, \"#{@class_name}\", mrb->object_class );576 mrb_define_method( mrb, rc, "initialize", MrubyBridge_#{@celltype_name}_initialize, MRB_ARGS_REQ(1) );577 MRB_SET_INSTANCE_TT(rc, MRB_TT_DATA);578 EOT579 580 @func_head_array.each{ |f|581 if ! f.is_function? then582 next583 end584 if f.get_name != :initialize then585 func_name = f.get_name586 else587 func_name = :initialize_cell588 end589 590 ret_type = f.get_return_type591 n_param = 0592 f.get_paramlist.get_items.each{ |param|593 case param.get_direction594 when :IN, :INOUT, :OUT595 n_param += 1596 when :SEND, :RECEIVE597 raise "send, receive"598 end599 }600 if n_param > 0 then601 p_str = "MRB_ARGS_REQ( #{n_param} )"602 else603 p_str = "MRB_ARGS_NONE()"604 end605 file.print <<EOT606 mrb_define_method( mrb, rc, "#{func_name}", MrubyBridge_#{@celltype_name}_#{func_name}, #{p_str} );607 EOT608 }609 end610 611 def gen_ep_func_body_ptr( file, b_singleton, ct_name, global_ct_name, sig_name, ep_name, func_name, func_global_name, func_type, params )612 613 t = @@ptr_list[ct_name]614 type = t[1]615 file.print <<EOT616 struct RClass *a; /* MBP710 */617 618 a = mrb_define_class_under(mrb, TECS, "#{type}Pointer", mrb->object_class);619 MRB_SET_INSTANCE_TT(a, MRB_TT_DATA);620 621 mrb_define_method(mrb, a, "initialize", #{type}Pointer_initialize, MRB_ARGS_REQ(1));622 mrb_define_method(mrb, a, "[]", #{type}Pointer_aget, MRB_ARGS_REQ(1));623 mrb_define_method(mrb, a, "value", #{type}Pointer_get_val, MRB_ARGS_NONE());624 mrb_define_method(mrb, a, "[]=", #{type}Pointer_aset, MRB_ARGS_REQ(2));625 mrb_define_method(mrb, a, "value=", #{type}Pointer_set_val, MRB_ARGS_REQ(1));626 mrb_define_method(mrb, a, "size", #{type}Pointer_size, MRB_ARGS_NONE());627 mrb_define_method(mrb, a, "length", #{type}Pointer_size, MRB_ARGS_NONE());628 EOT629 630 if t[2] == :Char then631 file.print <<EOT632 mrb_define_method(mrb, a, "to_s", CharPointer_to_s, MRB_ARGS_NONE());633 mrb_define_method(mrb, a, "from_s", CharPointer_from_s, MRB_ARGS_REQ(1));634 EOT635 end636 end637 638 def gen_ep_func_body_struct( file, b_singleton, ct_name, global_ct_name, sig_name, ep_name, func_name, func_global_name, func_type, params )639 tag = ct_name640 structType = @@struct_list[ tag ]641 file.print <<EOT642 struct RClass *a; /* MBP720 */643 644 a = mrb_define_class_under(mrb, TECS, "Struct#{tag}", mrb->object_class);645 MRB_SET_INSTANCE_TT(a, MRB_TT_DATA);646 647 mrb_define_method(mrb, a, "initialize", Struct_#{tag}_initialize, MRB_ARGS_NONE());648 EOT649 650 structType.get_members_decl.get_items.each{ |d|651 file.print " STRUCT_INIT_MEMBER( #{tag}, #{d.get_name} )\n"652 }653 end654 655 #=== 受け口関数の preamble (C言語)を生成する656 # 必要なら preamble 部に出力する657 #file:: FILE 出力先ファイル658 #b_singleton:: bool true if singleton659 #ct_name:: Symbol660 #global_ct_name:: string661 def gen_preamble( file, b_singleton, ct_name, global_ct_name )662 if @@celltypes[ ct_name ] then663 gen_preamble_mruby( file, b_singleton, ct_name, global_ct_name )664 gen_preamble_instance( file, b_singleton, ct_name, global_ct_name )665 gen_preamble_instance_initialize( file, b_singleton, ct_name, global_ct_name )666 gen_preamble_bridge_func( file, b_singleton, ct_name, global_ct_name )667 elsif @@init_celltypes[ ct_name ] then668 gen_preamble_mruby( file, b_singleton, ct_name, global_ct_name )669 gen_preamble_instance_proto( file, b_singleton, ct_name, global_ct_name )670 elsif @@ptr_list[ ct_name ] then671 gen_preamble_ptr( file, b_singleton, ct_name, global_ct_name )672 elsif @@struct_list[ ct_name ] then673 gen_preamble_struct( file, b_singleton, ct_name, global_ct_name )674 else675 raise "Unknown #{ct_name}"676 end677 end678 679 def gen_preamble_mruby( file, b_singleton, ct_name, global_ct_name )680 file.print <<EOT681 /* MBP: MrubyBridgePlugin: MBP000 */682 #include "mruby.h"683 #include "mruby/class.h"684 #include "mruby/data.h"685 #include "mruby/string.h"686 #include "TECSPointer.h"687 #include "TECSStruct.h"688 689 #if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)690 #define DLLEXPORT __declspec(dllexport)691 #else692 #define DLLEXPORT693 #endif694 695 #ifndef NULL696 #define NULL 0697 #endif698 EOT699 end700 701 def gen_preamble_instance( file, b_singleton, ct_name, global_ct_name )702 file.print <<EOT703 704 /* RData MBP001 */705 static void706 #{@celltype_name}_free( mrb_state *mrb, void *p )707 {708 if( p )709 (void)mrb_free( mrb, p );710 }711 712 /* RData MBP002 */713 struct mrb_data_type data_type_#{@celltype_name} =714 {715 "#{@celltype_name}",716 #{@celltype_name}_free717 };718 719 /* RData MBP003 */720 struct tecs_#{@celltype_name} {721 CELLCB *cbp;722 };723 724 /* name_to_cbp MBP010 */725 const struct name_to_cbp_#{@celltype_name} {726 char *name; /* Cell Name */727 CELLCB *cbp;728 } Name_to_cbp_#{@celltype_name}[] = {729 EOT730 731 # mikan namespace732 nsp = NamespacePath.new( :nMruby, true )733 nsp.append! ct_name734 ct = Namespace.find nsp735 736 ct.get_cell_list.each{ |cell|737 if cell.is_generate? then738 name_array = ct.get_name_array( cell )739 file.print "\t{ \"#{cell.get_name}\", #{name_array[8]} },\n"740 end741 }742 743 file.print <<EOT744 \t{ 0, 0 },745 };746 747 EOT748 749 end750 751 def gen_preamble_ptr( file, b_singleton, ct_name, global_ct_name )752 tment = @@ptr_list[ ct_name ]753 file.print <<EOT754 755 GET_SET_#{tment[3]}( #{tment[1]}, #{tment[0]} )756 POINTER_CLASS( #{tment[1]}, #{tment[0]} )757 EOT758 end759 760 def gen_preamble_struct( file, b_singleton, ct_name, global_ct_name )761 tag = ct_name762 structType = @@struct_list[ tag ]763 file.print <<EOT764 /* struct #{tag} */765 STRUCT_CLASS( #{tag} )766 EOT767 768 structType.get_members_decl.get_items.each{ |d|769 type = d.get_type.get_original_type770 case type771 when IntType, CIntType772 bit_size = type.get_bit_size773 case bit_size774 when -11, -1775 tType = "Char"776 ttype = "char"777 when -2778 tType = "Short"779 ttype = "short"780 when -3781 tType = "Int"782 ttype = "int"783 when -4784 tType = "Long"785 ttype = "long"786 when -5787 tType = "IntPtr"788 ttype = "intptr"789 when 8, 16, 32, 64790 tType = "Int#{bit_size}"791 ttype = "int#{bit_size}"792 else793 raise "cannot handle bit_size #{bit_size}"794 end795 file.print "MEMBER_GET_SET_INT( #{tag}, #{d.get_name}, #{tType}, #{ttype} )\n"796 when FloatType, CFloatType797 file.print "MEMBER_GET_SET_FLOAT( #{tag}, #{d.get_name} )\n"798 else799 raise "cannot handle type"800 end801 }802 803 end804 805 def gen_preamble_instance_proto( file, b_singleton, ct_name, global_ct_name )806 file.print <<EOT807 // Prototype MBP400808 mrb_value MrubyBridge_#{@celltype_name}_initialize( mrb_state *mrb, mrb_value self);809 EOT810 811 @func_head_array.each{ |f|812 if ! f.is_function? then813 next814 end815 if f.get_name != :initialize then816 func_name = f.get_name817 else818 func_name = :initialize_cell819 end820 821 ret_type = f.get_return_type822 ret_type0 = f.get_return_type.get_original_type823 b_void = ret_type0.is_void?824 plist = f.get_paramlist.get_items825 826 file.print <<EOT827 mrb_value MrubyBridge_#{@celltype_name}_#{func_name}( mrb_state *mrb, mrb_value self );828 EOT829 }830 end831 832 def gen_preamble_instance_initialize( file, b_singleton, ct_name, global_ct_name )833 file.print <<EOT834 835 /* MBP100 */836 mrb_value837 MrubyBridge_#{@celltype_name}_initialize( mrb_state *mrb, mrb_value self)838 {839 mrb_value name;840 struct tecs_#{@celltype_name} *tecs_cb;841 const struct name_to_cbp_#{@celltype_name} *ntc;842 843 /* set DATA_TYPE earlier to avoid SEGV */844 DATA_TYPE( self ) = &data_type_#{@celltype_name};845 846 mrb_get_args(mrb, "o", &name );847 if( mrb_type( name ) != MRB_TT_STRING ){848 mrb_raise(mrb, E_NAME_ERROR, "cell name not string");849 }850 for( ntc = &Name_to_cbp_#{@celltype_name}[0]; ntc->name != NULL; ntc++ ){851 if( strcmp( ntc->name, RSTRING_PTR( name ) ) == 0 )852 break;853 }854 if( ntc->name == 0 ){855 mrb_raise(mrb, E_ARGUMENT_ERROR, "cell not found");856 }857 tecs_cb = (struct tecs_#{@celltype_name} *)mrb_malloc(mrb, sizeof(struct tecs_#{@celltype_name}) );858 tecs_cb->cbp = ntc->cbp;859 DATA_PTR( self ) = (void *)tecs_cb;860 861 return self;862 }863 EOT864 end865 866 def gen_preamble_bridge_func( file, b_singleton, ct_name, global_ct_name )867 868 @func_head_array.each{ |f|869 if ! f.is_function? then870 next871 end872 if f.get_name != :initialize then873 func_name = f.get_name874 else875 func_name = :initialize_cell876 end877 878 ret_type = f.get_return_type879 ret_type0 = f.get_return_type.get_original_type880 b_void = ret_type0.is_void?881 plist = f.get_paramlist.get_items882 883 file.print <<EOT884 885 /* bridge function (MBP101) */886 mrb_value887 MrubyBridge_#{ct_name}_#{func_name}( mrb_state *mrb, mrb_value self )888 {889 /* cellcbp (MBP105) */890 CELLCB *p_cellcb = ((struct tecs_#{@celltype_name} *)DATA_PTR(self))->cbp;891 EOT892 893 file.print " /* variables for return & parameter (MBP110) */\n"894 if ! b_void then895 file.print " ", ret_type.get_type_str, "\tret_val", ret_type.get_type_str_post, ";\n"896 end897 arg_str = ""898 n_param = 0899 n_scalar = 0900 n_ptr = 0901 n_struct = 0902 plist.each{ |param|903 case param.get_direction904 when :IN, :INOUT, :OUT905 type = param.get_type.get_original_type906 case type907 when IntType908 file.print " mrb_int mrb_", param.get_name, ";\n"909 file.print " #{param.get_type.get_type_str} #{param.get_name}#{param.get_type.get_type_str_post};\n"910 arg_str += "i"911 n_param += 1912 n_scalar += 1913 when FloatType914 file.print " mrb_float mrb_", param.get_name, ";\n"915 file.print " #{param.get_type.get_type_str} #{param.get_name}#{param.get_type.get_type_str_post};\n"916 arg_str += "f"917 n_param += 1918 n_scalar += 1919 when BoolType920 file.print " mrb_value mrb_", param.get_name, ";\n"921 file.print " #{param.get_type.get_type_str} #{param.get_name}#{param.get_type.get_type_str_post};\n"922 arg_str += "o"923 n_param += 1924 n_scalar += 1925 when PtrType926 file.print " mrb_value mrb_", param.get_name, ";\n"927 file.print " #{param.get_type.get_type_str} #{param.get_name}#{param.get_type.get_type_str_post};\n"928 arg_str += "o"929 n_param += 1930 n_ptr += 1931 when StructType932 file.print " mrb_value mrb_", param.get_name, ";\n"933 file.print " #{param.get_type.get_type_str} *#{param.get_name}#{param.get_type.get_type_str_post};\n"934 arg_str += "o"935 n_param += 1936 n_struct += 1937 else938 raise "Unkown type"939 end940 end941 }942 943 if n_param > 0 then944 file.print " /* retrieve arguments (MBP111) */\n"945 file.print " mrb_get_args(mrb, \"#{arg_str}\""946 plist.each{ |param|947 case param.get_direction948 when :IN, :INOUT, :OUT949 type = param.get_type.get_original_type950 case type951 when IntType952 file.print ", &mrb_", param.get_name953 when FloatType954 file.print ", &mrb_", param.get_name955 when BoolType956 file.print ", &mrb_", param.get_name957 when PtrType958 file.print ", &mrb_", param.get_name959 when StructType960 file.print ", &mrb_", param.get_name961 else962 raise "Unkown type"963 end964 end965 }966 file.print " );\n"967 968 if n_scalar > 0 || n_struct > 0 then969 file.print " /* convert mrb to C (MBP112) */\n"970 end971 plist.each{ |param|972 case param.get_direction973 when :IN, :INOUT, :OUT974 type = param.get_type.get_original_type975 case type976 when IntType977 ttype = type.get_original_type978 tment = get_type_map_ent ttype979 file.print " VALCHECK_#{tment[1]}( mrb, mrb_#{param.get_name} );\n"980 file.print " #{param.get_name} = (#{param.get_type.get_type_str})mrb_#{param.get_name};\n"981 when FloatType982 file.print " #{param.get_name} = (#{param.get_type.get_type_str})mrb_#{param.get_name};\n"983 when BoolType984 file.print " #{param.get_name} = mrb_test( mrb_#{param.get_name} );\n"985 when PtrType986 ttype = type.get_type.get_original_type987 case ttype988 when StructType989 file.print " CHECK_STRUCT( #{ttype.get_name}, mrb_#{param.get_name} );\n"990 file.print " #{param.get_name} = (struct #{ttype.get_name}*)DATA_PTR(mrb_#{param.get_name});\n"991 when IntType992 when FloatType993 when BoolType994 else995 raise "cannot handle type"996 end997 when StructType998 file.print " CHECK_STRUCT( #{type.get_name}, mrb_#{param.get_name} );\n"999 file.print " #{param.get_name} = (struct #{type.get_name}*)DATA_PTR(mrb_#{param.get_name});\n"1000 else1001 raise( "canot treat class" )1002 end1003 end1004 }1005 1006 if n_ptr > 0 then1007 file.print " /* convert mrb to C for pointer types (MBP113) */\n"1008 end1009 plist.each{ |param|1010 case param.get_direction1011 when :IN, :INOUT, :OUT1012 type = param.get_type.get_original_type1013 case type1014 when IntType1015 when FloatType1016 when BoolType1017 when PtrType1018 case type.get_type.get_original_type1019 when StructType1020 when IntType1021 ptrMrb2C file, type, param1022 when FloatType1023 ptrMrb2C file, type, param1024 when BoolType1025 ptrMrb2C file, type, param1026 else1027 raise "cannot handle type"1028 end1029 when StructType1030 else1031 raise( "canot treat class" )1032 end1033 end1034 }1035 1036 end1037 1038 file.print " /* calling target (MBP120) */\n"1039 if ! b_void then1040 file.print " ret_val = "1041 else1042 file.print " "1043 end1044 delim = ""1045 file.print "cTECS_", f.get_name, "( "1046 plist.each{ |param|1047 if param.get_type.get_original_type.kind_of? StructType then1048 aster = "*"1049 else1050 aster = ""1051 end1052 file.print delim, aster, param.get_name1053 delim = ", "1054 }1055 file.print " );\n"1056 1057 file.print " /* return (MBP130) */\n"1058 case ret_type01059 when BoolType1060 file.print " return ret_val ? mrb_true_value() : mrb_false_value();\n"1061 when IntType1062 file.print " return mrb_fixnum_value( ret_val );\n"1063 when FloatType1064 file.print " return mrb_float_value( mrb, ret_val );\n"1065 when VoidType1066 file.print " return mrb_nil_value();\n"1067 else1068 raise "unknown type"1069 end1070 1071 file.print "}\n"1072 }1073 end1074 1075 def ptrMrb2C file, type, param1076 ttype = type.get_type.get_original_type1077 tment = get_type_map_ent ttype1078 tstr = tment[1]1079 =begin1080 case ttype1081 when IntType1082 bit_size = ttype.get_bit_size1083 case bit_size1084 when -1, -111085 tstr = "Char"1086 when 8, 16, 32, 641087 tstr = "Int#{bit_size}"1088 when -21089 tstr = "Short"1090 when -31091 tstr = "Int"1092 when -41093 tstr = "Long"1094 when -51095 tstr = "IntPtr"1096 else1097 raise "not handle type"1098 end1099 when FloatType1100 if ttype.get_bit_size == 32 then1101 tstr = "Float32"1102 else1103 tstr = "Double64"1104 end1105 when BoolType1106 tstr = "Bool"1107 when StructType1108 raise "not handle type 2 #{ttype}"1109 else1110 raise "not handle type 2 #{ttype}"1111 end1112 =end1113 if( param.get_size ) then1114 sz_str = param.get_size.to_s1115 elsif param.get_string then # mikan とりあえず size_is と string の同時指定 (二重ポインタ) はなし1116 sz_str = param.get_string.to_s1117 else1118 sz_str = "1"1119 end1120 # unsigned 型の場合には cast が必要1121 if ttype.get_original_type.get_type_str != param.get_type.get_type.get_type_str then1122 cast_str = "(#{param.get_type.get_type_str})"1123 else1124 cast_str = ""1125 end1126 1127 modify = ""1128 case param.get_direction1129 when :OUT, :INOUT1130 case tstr1131 when "Char", "SChar", "UChar"1132 modify = "Mod"1133 end1134 end1135 if param.is_nullable? then1136 nullable = "Nullable"1137 else1138 nullable = ""1139 end1140 1141 # file.print " CHECK_POINTER( #{tstr}, mrb_#{param.get_name}, #{sz_str} );\n"1142 # file.print " #{param.get_name} = #{cast_str}((struct #{tstr}PointerBody*)(DATA_PTR(mrb_#{param.get_name})))->buf;\n"1143 file.print " #{param.get_name} = CheckAndGet#{tstr}Pointer#{modify}#{nullable}( mrb, mrb_#{param.get_name}, #{sz_str} );\n"1144 end1145 1146 def get_celltype_name1147 @celltype_name1148 end1149 1150 #=== プラグイン引数 ignoreUnsigned1151 def set_ignoreUnsigned rhs1152 if rhs == "true" || rhs == nil then1153 @b_ignoreUnsigned = true1154 end1155 end1156 #=== プラグイン引数 include1157 def set_include rhs1158 funcs = rhs.split ','1159 funcs.each{ |rhs_func|1160 found = false1161 rhs_func.gsub!( /\s/, "" )1162 @signature.get_function_head_array.each{ |a|1163 if rhs_func.to_sym == a.get_name then1164 found = true1165 end1166 }1167 if found == false then1168 cdl_error( "MRB1009 include function '$1' not found in signagture '$2'", rhs, @signature.get_name )1169 else1170 @includes << rhs_func.to_sym1171 end1172 }1173 end1174 #=== プラグイン引数 exclude1175 def set_exclude rhs1176 funcs = rhs.split ','1177 funcs.each{ |rhs_func|1178 found = false1179 rhs_func.gsub!( /\s/, "" )1180 @signature.get_function_head_array.each{ |a|1181 if rhs_func.to_sym == a.get_name then1182 found = true1183 end1184 }1185 if found == false then1186 cdl_error( "MRB1010 exclude function '$1' not found in signagture '$2", rhs, @signature.get_name )1187 else1188 @excludes << rhs_func.to_sym1189 end1190 }1191 end1192 68 end 1193 -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecslib/plugin/NotifierPlugin.rb
r321 r429 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 = { … … 31 67 # - 受け口関数 - 一般化を行うと,実行時コストが大きく増大してしまうことが 32 68 # 確認されている.このため,一般化は行わない.EntryPropertyにも含めない. 33 # - セルインデックス - CELLIDX型で,型の規定はないが," ポインタ値であったり34 # 整数値 であったりする。" (TECS 5.3.6) より,インデックスかポインタある69 # - セルインデックス - CELLIDX型で,型の規定はないが,"ホ゜インタ値て゛あったり 70 # 整数値て゛あったりする。" (TECS 5.3.6) より,インデックスかポインタある 35 71 # ことが分かる.インデックスだとすると,この値はセルCBのアドレッシングに 36 72 # 使用されるので,intptr_tに収まる筈である.ポインタの場合,当然intptr_t … … 58 94 # - アダプタ関数へののポインタ 59 95 # - アダプタ関数の引数 96 # 97 # $Id$ 60 98 61 99 # @private … … 126 164 # @param [Cell, Symbol] cell セル.セルについて一般化する場合は `:generic` 127 165 # @param [Integer, Symbol, nil] subscript 添字.添字について一般化する場合は `:generic` 166 # @param [Celltype] 呼び先のセルタイプ、cell==:generic の場合のみ有効 128 167 # @private 129 def generate_inner(context, fn_name, cell, subscript )168 def generate_inner(context, fn_name, cell, subscript, callee_ct=nil) 130 169 source_file = context.source_file 131 170 header_file = context.header_file … … 139 178 unless ct.is_singleton? 140 179 if cell == :generic 141 params << "(CELLIDX)extinf" 180 params << "(#{callee_ct.get_global_name}_IDX)extinf" 181 # params << "(CELLIDX)extinf" 142 182 else 143 183 # セルのCELLIDXを得る … … 231 271 232 272 generate_inner context, fn_name, 233 :generic, subscript 273 :generic, subscript, ct 234 274 235 275 props.each { |prop| … … 443 483 # join:: Join : 結合 (declarationがPortであるもの) 444 484 def validate_join(handler, cell, join) 445 485 return !generate_attr_map(handler, cell).nil? 446 486 end 447 487 … … 870 910 parse_plugin_arg 871 911 unless @factory 872 cdl_error(" ASP1003 celltype $1: option factory is not specified",912 cdl_error("NTF1003 celltype $1: option factory is not specified", 873 913 celltype.get_name) 874 914 end 875 915 unless @output_file 876 cdl_error(" ASP1003 celltype $1: option output_file is not specified",916 cdl_error("NTF1003 celltype $1: option output_file is not specified", 877 917 celltype.get_name) 878 918 end … … 881 921 def set_factory(template_string) 882 922 unless @factory.nil? 883 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", 884 924 celltype.get_name) 885 925 end … … 889 929 def set_factory_output_file(output_file) 890 930 unless @output_file.nil? 891 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", 892 932 celltype.get_name) 893 933 end … … 896 936 897 937 def gen_factory file 898 puts "===== begin #{@celltype.get_name.to_s} plugin ====="938 # puts "===== begin #{@celltype.get_name.to_s} plugin =====" 899 939 900 940 kernelCfg = AppFile.open( "#{$gen}/#{@output_file}" ) … … 920 960 subst_attr = @celltype.find(name) 921 961 unless subst_attr 922 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.", 923 963 @celltype.get_name, name) 924 964 end … … 933 973 934 974 kernelCfg.close 935 puts "===== end #{@celltype.get_name.to_s} plugin ====="975 # puts "===== end #{@celltype.get_name.to_s} plugin =====" 936 976 end 937 977 938 978 def gen_factory_for_cell(kernelCfg, cell) 979 # print "########## gen_factory_for_cell cell=#{cell.get_name}\n" 939 980 handler_flags = [] 940 981 handler_args = [] … … 957 998 when 'false' then ignoreErrors = false 958 999 else 959 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", 960 1001 cell.get_name, ignoreErrors ) 961 1002 ignoreErrors = false 962 1003 end 963 1004 1005 # ドメイン指定用文字列 1006 pre_text = "" 1007 post_text = "\n" 1008 indent = "" 1009 964 1010 [EVENT_HANDLER, ERROR_HANDLER].each { |handler| 965 1011 # 呼び口の結合を取得 966 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 967 1024 968 1025 # ハンドラタイプを判別する … … 972 1029 973 1030 if matches.length == 0 974 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 ) 975 1032 next 976 1033 end 977 1034 978 1035 # 最初に見つかった有効なハンドラタイプを使用 979 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 980 1086 981 1087 # 通知ハンドラで「エラーが発生するはずがない」のに「エラーハンドラが指定されている」 … … 984 1090 # なため、検出は行わない。) 985 1091 if handler == ERROR_HANDLER && !ht.is_a?(NullHandlerType) && !event_handler_might_fail 986 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.", 987 1093 cell.get_name, handler_flag) 988 1094 end 989 1095 if handler == ERROR_HANDLER && ht.is_a?(NullHandlerType) && event_handler_might_fail && !ignoreErrors 990 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.", 991 1097 cell.get_name, handler_flag) 992 1098 end … … 1055 1161 # $id$等の置換 1056 1162 cell.get_celltype.subst_name(subst, name_array) 1057 } 1058 1059 # 出力 1060 kernelCfg.puts text 1061 1062 end 1063 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 1064 1192 1065 1193 end -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecslib/plugin/OpaqueRPCPlugin.rb
r321 r429 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 -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecslib/plugin/RPCPlugin.rb
r321 r429 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; -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecslib/plugin/SharedOpaqueRPCPlugin.rb
r321 r429 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 -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecslib/plugin/SharedRPCPlugin.rb
r321 r429 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; -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecslib/plugin/ThroughPlugin.rb
r321 r429 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 -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecslib/plugin/TracePlugin.rb
r321 r429 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 -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecslib/plugin/lib/GenOpaqueMarshaler.rb
r321 r429 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 -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecslib/plugin/lib/GenTransparentMarshaler.rb
r321 r429 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 -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecslib/version.rb
r321 r429 1 1 $package = "tecsgen" 2 $version = "1. 3.1.5"2 $version = "1.6.4" -
EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecsmerge.rb
r321 r429 6 6 # Merger for TECS generated templates 7 7 # 8 # Copyright (C) 2008-201 5by TOPPERS Project8 # Copyright (C) 2008-2017 by TOPPERS Project 9 9 #-- 10 10 # 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ … … 37 37 # の責任を負わない. 38 38 # 39 # $Id $39 # $Id: tecsmerge.rb 2633 2017-04-02 06:02:05Z okuma-top $ 40 40 #++ 41 41 … … 44 44 #Authors:: 大山 博司 45 45 #Version:: 46 #Copyright:: Copyright (C) TOPPERS Project, 2008-201 5. All rights reserved.46 #Copyright:: Copyright (C) TOPPERS Project, 2008-2017. All rights reserved. 47 47 #License:: TOPPERS ライセンスに準拠 48 48 … … 285 285 286 286 next if next_stat == :HEAD || ( next_stat == :EOF && line != nil ) 287 # #1002 tecsmerge の非受け口関数 (POSTAMBLE部) の行頭に '{' があるとエラーになる 288 if (! $old_mode) && ( /^\{/ =~ line ) && ( stat == :PREAMBLE_BODY || stat == :POSTAMBLE_BODY ) 289 p line + " next_stat=" + next_stat.to_s + "stat=" + stat.to_s 290 next 291 end 287 292 288 293 # p "R: #{stat_info[0]}" -
EcnlProtoTool/trunk/asp3_dcre/tinet/Makefile.tinet
r331 r429 93 93 in_subr.o route_cfg.o 94 94 TINET_CFG_COBJS := $(TINET_CFG_COBJS) tinet_cfg.o 95 TINET_CFG2_OUT_SRCS := $(TINET_CFG2_OUT_SRCS) tinet_cfg.h tinet_cfg.c 95 96 96 97 # IPv6 … … 328 329 329 330 CFG_COBJS := $(CFG_COBJS) $(TINET_CFG_COBJS) 331 CFG2_OUT_SRCS := $(CFG2_OUT_SRCS) $(TINET_CFG2_OUT_SRCS) 330 332 331 333 CLEAN_FILES := $(CLEAN_FILES) $(TINET_CFG_OUT) $(MAKE_TINET_LIB) -
EcnlProtoTool/trunk/asp3_dcre/tinet/net/ethernet.c
r331 r429 195 195 196 196 /** 197 * Called by a driver when its link goes up 198 */ 199 void ether_set_link_up(T_IFNET *ether) 200 { 201 if (!(ether->flags & IF_FLAG_LINK_UP)) { 202 ether->flags |= IF_FLAG_LINK_UP; 203 204 if (ether->flags & IF_FLAG_UP) { 205 #if LWIP_ARP 206 /* For Ethernet network interfaces, we would like to send a "gratuitous ARP" */ 207 if (ether->flags & IF_FLAG_ETHARP) { 208 etharp_gratuitous(ether); 209 } 210 #endif /* LWIP_ARP */ 211 212 #if LWIP_IGMP 213 /* resend IGMP memberships */ 214 if (ether->_flags & IF_FLAG_IGMP) { 215 igmp_report_groups(ether); 216 } 217 #endif /* LWIP_IGMP */ 218 } 219 if (ether->link_callback) { 220 (ether->link_callback)(ether); 221 } 222 } 223 } 197 * ether_set_link_up -- リンクしたときにNICから呼び出される 198 */ 199 void 200 ether_set_link_up() 201 { 202 if (!(ether_ifnet.flags & IF_FLAG_LINK_UP)) { 203 ether_ifnet.flags |= IF_FLAG_LINK_UP; 204 205 if (ether_ifnet.flags & IF_FLAG_UP) { 206 #if defined(_IP4_CFG) && defined(SUPPORT_ETHER) 207 /* ARP再構築? */ 208 #endif /* #if defined(_IP4_CFG) && defined(SUPPORT_ETHER) */ 209 210 #ifdef SUPPORT_IGMP 211 /* IGMP参加 */ 212 #endif /* #ifdef SUPPORT_IGMP */ 213 } 214 if (ether_ifnet.link_callback) { 215 (ether_ifnet.link_callback)(ðer_ifnet); 216 } 217 } 218 } 224 219 225 220 /** 226 * Called by a driver when its link goes down 227 */ 228 void ether_set_link_down(T_IFNET *ether) 229 { 230 if (ether->flags & IF_FLAG_LINK_UP) { 231 ether->flags &= ~IF_FLAG_LINK_UP; 232 if (ether->link_callback) { 233 (ether->link_callback)(ether); 234 } 235 } 236 } 237 238 /** 239 * Set callback to be called when link is brought up/down 240 */ 241 void ether_set_link_callback(ether_status_callback_fn link_callback) 221 * ether_set_link_up -- リンクが切断したときにNICから呼び出される 222 */ 223 void 224 ether_set_link_down() 225 { 226 if (ether_ifnet.flags & IF_FLAG_LINK_UP) { 227 ether_ifnet.flags &= ~IF_FLAG_LINK_UP; 228 if (ether_ifnet.link_callback) { 229 (ether_ifnet.link_callback)(ðer_ifnet); 230 } 231 } 232 } 233 234 /* 235 * ether_set_up -- DHCPでアドレスが設定されたとき呼び出される 236 */ 237 238 void 239 ether_set_up() 240 { 241 if (!(ether_ifnet.flags & IF_FLAG_UP)) { 242 ether_ifnet.flags |= IF_FLAG_UP; 243 if (ether_ifnet.link_callback) { 244 (ether_ifnet.link_callback)(ðer_ifnet); 245 } 246 } 247 } 248 249 /* 250 * ether_set_down -- DHCPでアドレスが解放されたとき呼び出される 251 */ 252 253 void 254 ether_set_down() 255 { 256 if (ether_ifnet.flags & IF_FLAG_UP) { 257 ether_ifnet.flags &= ~IF_FLAG_UP; 258 if (ether_ifnet.link_callback) { 259 (ether_ifnet.link_callback)(ðer_ifnet); 260 } 261 } 262 } 263 264 /* 265 * ether_set_link_callback -- リンク状態変化時のコールバック登録 266 */ 267 268 void 269 ether_set_link_callback(ether_status_callback_fn link_callback) 242 270 { 243 271 ether_ifnet.link_callback = link_callback; 244 } 272 if (ether_ifnet.link_callback) { 273 (ether_ifnet.link_callback)(ðer_ifnet); 274 } 275 } 245 276 246 277 /* -
EcnlProtoTool/trunk/asp3_dcre/tinet/net/ethernet.h
r331 r429 99 99 100 100 #if defined(__RX) 101 102 101 #pragma pack 102 #elif defined(_MSC_VER) 103 #pragma pack(push, 1) 104 #endif 105 106 #if defined(__RX) || defined(_MSC_VER) 107 103 108 typedef struct t_ether_header { 104 109 … … 113 118 uint16_t type; 114 119 } T_ETHER_HDR; 115 #pragma packoption116 120 117 121 #elif defined(TOPPERS_S810_CLG3_85) /* of #if defined(__RX) */ … … 143 147 uint8_t shost[ETHER_ADDR_LEN]; 144 148 uint16_t type; 145 } __attribute__((packed, aligned(2))) T_ETHER_HDR;149 } __attribute__((packed, aligned(2))) T_ETHER_HDR; 146 150 147 151 #endif /* of #if defined(__RX) */ … … 158 162 typedef struct t_ether_addr { 159 163 uint8_t lladdr[ETHER_ADDR_LEN]; 160 } __attribute__((packed, aligned(2)))T_ETHER_ADDR; 164 } __attribute__((packed, aligned(2))) T_ETHER_ADDR; 165 166 #if defined(__RX) 167 #pragma packoption 168 #elif defined(_MSC_VER) 169 #pragma pack(pop) 170 #endif 161 171 162 172 /* … … 208 218 /* インタフェースのマルチキャストアドレスへの変換 */ 209 219 220 #define IF_FLAG_UP 0x01U 221 #define IF_FLAG_LINK_UP 0x10U 222 210 223 /* 211 224 * 前方参照 … … 266 279 #endif /* of #ifdef T_IF_ETHER_NIC_SOFTC */ 267 280 268 #define IF_FLAG_UP 0x01U269 #define IF_FLAG_LINK_UP 0x10U270 271 281 /* 272 282 * 変数 … … 304 314 extern uint32_t ether_srand (void); 305 315 306 /** Function prototype for netif status- or link-callback functions. */307 316 typedef void (*ether_status_callback_fn)(T_IFNET *ether); 308 317 extern void ether_set_link_callback(ether_status_callback_fn link_callback); 309 extern void ether_set_link_up(T_IFNET *ether); 310 extern void ether_set_link_down(T_IFNET *ether); 318 extern void ether_set_link_up(); 319 extern void ether_set_link_down(); 320 extern void ether_set_up(); 321 extern void ether_set_down(); 311 322 312 323 #endif /* of #ifdef SUPPORT_ETHER */ -
EcnlProtoTool/trunk/asp3_dcre/tinet/net/if_arp.h
r331 r429 91 91 uint8_t proto_len; /* プロトコル長 */ 92 92 uint16_t opcode; /* 命令コード */ 93 } __attribute__((packed, aligned(2))) T_ARP_HDR;93 } __attribute__((packed, aligned(2))) T_ARP_HDR; 94 94 95 95 #define ARP_HDR_SIZE (sizeof(T_ARP_HDR)) … … 119 119 typedef struct arpcom { 120 120 uint8_t mac_addr[ETHER_ADDR_LEN]; 121 } __attribute__((packed, aligned(2))) T_ARPCOM;121 } __attribute__((packed, aligned(2))) T_ARPCOM; 122 122 123 123 /* -
EcnlProtoTool/trunk/asp3_dcre/tinet/net/net_asp.cfg
r331 r429 41 41 42 42 INCLUDE("net/net.cfg"); 43 44 #ifndef NOUSE_MPF_NET_BUF 43 45 44 46 /* … … 169 171 }); 170 172 #endif /* of #if defined(NUM_MPF_NET_BUF6_65536) && NUM_MPF_NET_BUF6_65536 > 0 */ 173 174 #endif -
EcnlProtoTool/trunk/asp3_dcre/tinet/net/net_buf.c
r331 r429 68 68 #include <netinet/tcp_var.h> 69 69 70 #ifndef NOUSE_MPF_NET_BUF 71 70 72 /* 71 73 * 関数 … … 226 228 #endif /* of #if defined(NUM_MPF_NET_BUF_128) && NUM_MPF_NET_BUF_128 > 0 */ 227 229 228 #if defined(_IP4_CFG) 230 #if defined(_IP6_CFG) 231 232 #if defined(NUM_MPF_NET_BUF_CSEG) && NUM_MPF_NET_BUF_CSEG > 0 233 { 234 MPF_NET_BUF_CSEG, 235 IF_HDR_SIZE + IP_HDR_SIZE + TCP_HDR_SIZE, 236 237 #if NET_COUNT_ENABLE & PROTO_FLG_NET_BUF 238 239 NUM_MPF_NET_BUF_CSEG, 240 241 #endif /* of #if NET_COUNT_ENABLE & PROTO_FLG_NET_BUF */ 242 243 }, 244 #endif /* of #if defined(NUM_MPF_NET_BUF_CSEG) && NUM_MPF_NET_BUF_CSEG > 0 */ 245 246 #endif /* of #if defined(_IP6_CFG) */ 229 247 230 248 #if defined(NUM_MPF_NET_BUF_64) && NUM_MPF_NET_BUF_64 > 0 … … 242 260 #endif /* of #if defined(NUM_MPF_NET_BUF_64) && NUM_MPF_NET_BUF_64 > 0 */ 243 261 244 # endif /* of #if defined(_IP4_CFG) */262 #if defined(_IP4_CFG) && !defined(_IP6_CFG) 245 263 246 264 #if defined(NUM_MPF_NET_BUF_CSEG) && NUM_MPF_NET_BUF_CSEG > 0 … … 257 275 }, 258 276 #endif /* of #if defined(NUM_MPF_NET_BUF_CSEG) && NUM_MPF_NET_BUF_CSEG > 0 */ 277 278 #endif /* of #if defined(_IP4_CFG) && !defined(_IP6_CFG) */ 259 279 260 280 }; … … 307 327 308 328 while (1) { 309 if ((error = tget_mpf((ID)net_buf_table[ix].index, (void *)buf, ix == 0 ? tmout : TMO_POL)) == E_OK) {329 if ((error = tget_mpf((ID)net_buf_table[ix].index, (void **)buf, ix == 0 ? tmout : TMO_POL)) == E_OK) { 310 330 (*buf)->idix = (uint8_t)ix; 311 331 (*buf)->len = (uint16_t)minlen; 312 332 (*buf)->flags = 0; 313 333 #ifdef IF_ETHER_MULTI_NIC 334 (*buf)->conn_pos = 0; 335 #endif 314 336 #if NET_COUNT_ENABLE & PROTO_FLG_NET_BUF 315 337 NET_COUNT_NET_BUF(net_buf_table[ix].allocs, 1); … … 318 340 return error; 319 341 } 320 else if (ix == 0 || net_buf_table[ix].size > maxlen) 342 ix --; 343 if (ix < 0 || net_buf_table[ix].size > maxlen) 321 344 break; 322 ix --;323 345 } 324 346 … … 349 371 350 372 while (1) { 351 if ((error = tget_mpf((ID)net_buf_table[ix].index, (void *)buf,373 if ((error = tget_mpf((ID)net_buf_table[ix].index, (void **)buf, 352 374 ix == sizeof(net_buf_table) / sizeof(T_NET_BUF_ENTRY) - 1 ? tmout : TMO_POL)) == E_OK) { 353 375 (*buf)->idix = (uint8_t)ix; 354 376 (*buf)->len = net_buf_table[ix].size; 355 377 (*buf)->flags = 0; 378 #ifdef IF_ETHER_MULTI_NIC 379 (*buf)->conn_pos = 0; 380 #endif 356 381 357 382 #if NET_COUNT_ENABLE & PROTO_FLG_NET_BUF … … 450 475 /* 固定メモリプールに返す。*/ 451 476 452 #if NET_COUNT_ENABLE & PROTO_FLG_NET_BUF 453 net_buf_table[buf->idix].busies --; 454 #endif 455 if ((error = rel_mpf((ID)net_buf_table[buf->idix].index, buf)) != E_OK) { 456 syslog(LOG_WARNING, "[NET BUF] %s, ID=%d.", itron_strerror(error), buf->idix); 477 int idix = buf->idix; 478 #if NET_COUNT_ENABLE & PROTO_FLG_NET_BUF 479 net_buf_table[idix].busies --; 480 #endif 481 if ((error = rel_mpf((ID)net_buf_table[idix].index, buf)) != E_OK) { 482 syslog(LOG_WARNING, "[NET BUF] %s, ID=%d.", itron_strerror(error), idix); 457 483 } 458 484 } … … 505 531 return (uint_t)net_buf_table[0].size; 506 532 } 533 534 #else 535 #include <stdlib.h> 536 537 /* 538 * tget_net_buf_ex -- ネットワークバッファを獲得する(拡張機能)。 539 */ 540 541 ER 542 tget_net_buf_ex (T_NET_BUF **buf, uint_t minlen, uint_t maxlen, ATR nbatr, TMO tmout) 543 { 544 uint_t len = (minlen > maxlen) ? minlen : maxlen; 545 *buf = (T_NET_BUF *)malloc(sizeof(T_NET_BUF) - sizeof(((T_NET_BUF *)0)->buf) + len); 546 if (*buf == NULL) 547 return E_NOMEM; 548 549 (*buf)->idix = 0; 550 (*buf)->len = (uint16_t)len; 551 (*buf)->flags = 0; 552 #ifdef IF_ETHER_MULTI_NIC 553 (*buf)->conn_pos = 0; 554 #endif 555 556 return E_OK; 557 } 558 559 /* 560 * tget_net_buf -- ネットワークバッファを獲得する(互換)。 561 */ 562 563 ER 564 tget_net_buf (T_NET_BUF **buf, uint_t len, TMO tmout) 565 { 566 return tget_net_buf_ex(buf, len, len, NBA_SEARCH_ASCENT, tmout); 567 } 568 569 570 /* 571 * rel_net_buf -- ネットワークバッファを返却する。 572 */ 573 574 ER 575 rel_net_buf (T_NET_BUF *buf) 576 { 577 free(buf); 578 579 return E_OK; 580 } 581 582 583 /* 584 * net_buf_max_siz -- ネットワークバッファの最大サイズを返す。 585 */ 586 587 uint_t 588 net_buf_max_siz (void) 589 { 590 return (uint_t)IF_PDU_SIZE; 591 } 592 593 #endif -
EcnlProtoTool/trunk/asp3_dcre/tinet/net/net_buf.h
r331 r429 55 55 uint8_t idix; /* mpfid のインデックス */ 56 56 uint8_t flags; /* フラグ */ 57 #ifdef IF_ETHER_MULTI_NIC 58 uint8_t conn_pos; 59 #endif 57 60 #ifdef IF_ETHER_NIC_NET_BUF_ALIGN 58 61 uint8_t nalign[IF_ETHER_NIC_NET_BUF_ALIGN]; … … 80 83 uint8_t idix; /* mpfid のインデックス */ 81 84 uint8_t flags; /* フラグ */ 85 #ifdef IF_ETHER_MULTI_NIC 86 uint8_t conn_pos; 87 #endif 82 88 #ifdef IF_ETHER_NIC_NET_BUF_ALIGN 83 89 uint8_t nalign[IF_ETHER_NIC_NET_BUF_ALIGN]; … … 97 103 uint8_t idix; /* mpfid のインデックス */ 98 104 uint8_t flags; /* フラグ */ 105 #ifdef IF_ETHER_MULTI_NIC 106 uint8_t conn_pos; 107 #endif 99 108 #ifdef IF_ETHER_NIC_NET_BUF_ALIGN 100 109 uint8_t nalign[IF_ETHER_NIC_NET_BUF_ALIGN]; … … 114 123 uint8_t idix; /* mpfid のインデックス */ 115 124 uint8_t flags; /* フラグ */ 125 #ifdef IF_ETHER_MULTI_NIC 126 uint8_t conn_pos; 127 #endif 116 128 #ifdef IF_ETHER_NIC_NET_BUF_ALIGN 117 129 uint8_t nalign[IF_ETHER_NIC_NET_BUF_ALIGN]; … … 131 143 uint8_t idix; /* mpfid のインデックス */ 132 144 uint8_t flags; /* フラグ */ 145 #ifdef IF_ETHER_MULTI_NIC 146 uint8_t conn_pos; 147 #endif 133 148 #ifdef IF_ETHER_NIC_NET_BUF_ALIGN 134 149 uint8_t nalign[IF_ETHER_NIC_NET_BUF_ALIGN]; … … 148 163 uint8_t idix; /* mpfid のインデックス */ 149 164 uint8_t flags; /* フラグ */ 165 #ifdef IF_ETHER_MULTI_NIC 166 uint8_t conn_pos; 167 #endif 150 168 #ifdef IF_ETHER_NIC_NET_BUF_ALIGN 151 169 uint8_t nalign[IF_ETHER_NIC_NET_BUF_ALIGN]; … … 167 185 uint8_t idix; /* mpfid のインデックス */ 168 186 uint8_t flags; /* フラグ */ 187 #ifdef IF_ETHER_MULTI_NIC 188 uint8_t conn_pos; 189 #endif 169 190 #ifdef IF_ETHER_NIC_NET_BUF_ALIGN 170 191 uint8_t nalign[IF_ETHER_NIC_NET_BUF_ALIGN]; -
EcnlProtoTool/trunk/asp3_dcre/tinet/net/net_count.c
r331 r429 222 222 T_NET_COUNT net_count_igmp; 223 223 224 #endif /* of #if NET_COUNT_ENABLE & PROTO_FLG_I CMP4*/224 #endif /* of #if NET_COUNT_ENABLE & PROTO_FLG_IGMP */ 225 225 226 226 #endif /* of #if defined(_IP4_CFG) */ -
EcnlProtoTool/trunk/asp3_dcre/tinet/net/net_rename.h
r331 r429 71 71 #define tget_net_buf_ex _tinet_tget_net_buf_ex 72 72 #define tget_net_buf _tinet_tget_net_buf 73 #define rel_net_buf _tinet_rel_net_buf74 #define rus_net_buf _tinet_rus_net_buf75 #define net_buf_siz _tinet_net_buf_siz73 #define rel_net_buf _tinet_rel_net_buf 74 #define rus_net_buf _tinet_rus_net_buf 75 #define net_buf_siz _tinet_net_buf_siz 76 76 #define net_buf_max_siz _tinet_net_buf_max_siz 77 77 #define nbuf_get_tbl _tinet_nbuf_get_tbl -
EcnlProtoTool/trunk/asp3_dcre/tinet/netapp/Makefile.netapp
r331 r429 183 183 NETAPP_COBJS := $(NETAPP_COBJS) udp6_echo_cli.o 184 184 NETAPP_KERNEL_CFG := $(NETAPP_KERNEL_CFG) $(NETAPP_DIRS)/udp6_echo_cli.cfg 185 185 186 186 ifeq ($(SUPPORT_INET4),true) 187 187 ifeq ($(USE_UDP4_ECHO_CLI),true) … … 191 191 endif 192 192 endif 193 193 else 194 194 ifeq ($(SUPPORT_INET4),true) 195 195 SUPPORT_UDP = true … … 364 364 ifeq ($(TARGET_KERNEL),ASP) 365 365 366 APPLDIR := $(APPLDIR) $(NETAPP_DIRS)366 APPLDIRS := $(APPLDIRS) $(NETAPP_DIRS) 367 367 APPL_COBJS := $(APPL_COBJS) $(NETAPP_COBJS) 368 368 APPL_CFLAGS := $(APPL_CFLAGS) -fno-strict-aliasing … … 382 382 ifeq ($(TARGET_KERNEL),ASP) 383 383 384 APPLDIR := $(APPLDIR) $(SRCDIR)/pdic/sc1602384 APPLDIRS := $(APPLDIRS) $(SRCDIR)/pdic/sc1602 385 385 386 386 endif -
EcnlProtoTool/trunk/asp3_dcre/tinet/netapp/dbg_cons.c
r331 r429 666 666 "IX Expire State MAC Address IP Address\n"); 667 667 668 /* expire の単位は [ ms]。*/668 /* expire の単位は [us]。*/ 669 669 get_tim(&now); 670 670 cache = nd6_get_cache(); … … 705 705 "IX Expire MAC Address IP Address\n"); 706 706 707 /* expire の単位は [ ms]。*/707 /* expire の単位は [us]。*/ 708 708 cache = arp_get_cache(); 709 709 for (ix = 0; ix < NUM_ARP_ENTRY; ix ++) { … … 753 753 WAI_NET_CONS_PRINTF(); 754 754 get_tim(&now); 755 cons_printf(portid, "ネットワーク統計情報\t経過時間[ ms]\t%lu\t", now);755 cons_printf(portid, "ネットワーク統計情報\t経過時間[us]\t%lu\t", now); 756 756 if (now > (1000 * 3600 * 24)) 757 757 cons_printf(portid, "%3lu日 %2lu時間 %2lu分 %2lu秒\n", … … 938 938 } 939 939 940 cons_printf(portid, "\nネットワーク統計情報\t経過時間[ ms]\t%lu\t", now);940 cons_printf(portid, "\nネットワーク統計情報\t経過時間[us]\t%lu\t", now); 941 941 if (now > (1000 * 3600 * 24)) 942 942 cons_printf(portid, "%3lu日 %2lu時間 %2lu分 %2lu秒\n", … … 1065 1065 WAI_NET_CONS_PRINTF(); 1066 1066 get_tim(&now); 1067 cons_printf(portid, "ネットワークバッファ情報\t経過時間[ ms]\t%u\n", now);1067 cons_printf(portid, "ネットワークバッファ情報\t経過時間[us]\t%u\n", now); 1068 1068 1069 1069 #if NET_COUNT_ENABLE … … 1577 1577 cons_printf(portid, " IP Address\n"); 1578 1578 1579 /* expire の単位は [ ms]。*/1579 /* expire の単位は [us]。*/ 1580 1580 get_tim(&now); 1581 1581 dr = nd6_get_drl(&count); … … 2298 2298 2299 2299 cons_printf(portid, "ND:\n"); 2300 cons_printf(portid, " TMO_ND6_RTR_SOL_DELAY: %5d[ ms]\n", TMO_ND6_RTR_SOL_DELAY);2301 cons_printf(portid, " TMO_ND6_RTR_SOL_INTERVAL: %5d[ ms]\n", TMO_ND6_RTR_SOL_INTERVAL);2300 cons_printf(portid, " TMO_ND6_RTR_SOL_DELAY: %5d[us]\n", TMO_ND6_RTR_SOL_DELAY); 2301 cons_printf(portid, " TMO_ND6_RTR_SOL_INTERVAL: %5d[us]\n", TMO_ND6_RTR_SOL_INTERVAL); 2302 2302 cons_printf(portid, " NUM_IP6_DAD_COUNT: %5d\n", NUM_IP6_DAD_COUNT); 2303 2303 cons_printf(portid, " NUM_ND6_CACHE_ENTRY: %5d\n", NUM_ND6_CACHE_ENTRY); -
EcnlProtoTool/trunk/asp3_dcre/tinet/netapp/dhcp4.h
r331 r429 93 93 uint8_t file [DHCP4_FILE_LEN]; /* boot file name */ 94 94 uint8_t options[DHCP4_DFLT_OPT_LEN]; /* optional parameters field */ 95 } T_DHCP4_MSG;95 } __attribute__((packed)) T_DHCP4_MSG; 96 96 97 97 /* packet type ã®å®ç¾© */ -
EcnlProtoTool/trunk/asp3_dcre/tinet/netapp/dhcp4_cli.c
r331 r429 206 206 #endif 207 207 208 #ifdef SEM_DHCP4_CLI_TIMER 209 #define DHCP4_CLI_TIMER_LOCK() do { syscall(wai_sem(SEM_DHCP4_CLI_TIMER)); } while(0) 210 #define DHCP4_CLI_TIMER_UNLOCK() do { syscall(sig_sem(SEM_DHCP4_CLI_TIMER)); } while(0) 211 #else 212 #define DHCP4_CLI_TIMER_LOCK() do { } while(0) 213 #define DHCP4_CLI_TIMER_UNLOCK() do { } while(0) 214 #endif 215 216 #ifdef SEM_DHCP4_CLI_READY 217 #define DHCP4_CLI_READY_WAIT(ct) do { syscall(wai_sem(SEM_DHCP4_CLI_READY)); } while(0) 218 #define DHCP4_CLI_READY_SIGNAL(ct) do { syscall(sig_sem(SEM_DHCP4_CLI_READY)); } while(0) 219 #else 220 #define DHCP4_CLI_READY_WAIT(ct) do { } while(0) 221 #define DHCP4_CLI_READY_SIGNAL(ct) do { ct->sig = 1; syscall(wup_tsk(ct->tskid)); } while(0) 222 #endif 223 208 224 /* 209 225 * dhcp4_cksum -- ãã§ãã¯ãµã ã®è¨ç®é¢æ° … … 381 397 #endif /* of #ifdef USE_LCD */ 382 398 #endif 383 399 ether_set_down(); 384 400 } 385 401 } … … 508 524 lcd_putc(LCD_PORTID, '\n'); 509 525 #endif /* of #ifdef USE_LCD */ 510 if (ct->set_addr_callback != NULL) 511 ct->set_addr_callback(); 512 526 ether_set_up(); 513 527 } 514 528 } … … 951 965 int ix; 952 966 953 syscall(wai_sem(SEM_DHCP4_CLI_TIMER));967 DHCP4_CLI_TIMER_LOCK(); 954 968 for (ix = NUM_DHCP4C_TIMERS; ix -- > 0; ) 955 969 ct->timers[ix] = 0; 956 syscall(sig_sem(SEM_DHCP4_CLI_TIMER));970 DHCP4_CLI_TIMER_UNLOCK(); 957 971 } 958 972 … … 970 984 971 985 /* OFFER ã¡ãã»ã¼ã¸åä¿¡ã¿ã¤ã ã¢ã¦ããè¨å®ããã*/ 972 syscall(wai_sem(SEM_DHCP4_CLI_TIMER));986 DHCP4_CLI_TIMER_LOCK(); 973 987 ct->timers[DHCP4C_TIMER_RCV_OFFER] = SYSTIM2TIMER(TMO_DHCP4C_OFFER); 974 syscall(sig_sem(SEM_DHCP4_CLI_TIMER));988 DHCP4_CLI_TIMER_UNLOCK(); 975 989 976 990 /* éä¿¡å … … 987 1001 /* DISCOVER ã¡ãã»ã¼ã¸ãéä¿¡ããã*/ 988 1002 ct->flags |= DHCP4C_FLAG_TMOUT_SND_DISC; 989 syscall(sig_sem(SEM_DHCP4_CLI_READY));1003 DHCP4_CLI_READY_SIGNAL(ct); 990 1004 } 991 1005 … … 1018 1032 1019 1033 /* EXPIREãRENEWãREBIND ã¿ã¤ãã¼ãè¨å®ããã*/ 1020 syscall(wai_sem(SEM_DHCP4_CLI_TIMER));1034 DHCP4_CLI_TIMER_LOCK(); 1021 1035 ct->timers[DHCP4C_TIMER_EXPIRE] = SYSTIM2TIMER(ct->expire); /* EXPIRE ã¾ã§ã®æé */ 1022 1036 ct->timers[DHCP4C_TIMER_REBIND] = SYSTIM2TIMER(ct->rebind); /* REBINDï¼T2ï¼ã¾ã§ã®æé */ 1023 1037 ct->timers[DHCP4C_TIMER_RENEW] = SYSTIM2TIMER(ct->renew); /* RENEW ï¼T1ï¼ã¾ã§ã®æé */ 1024 syscall(sig_sem(SEM_DHCP4_CLI_TIMER));1038 DHCP4_CLI_TIMER_UNLOCK(); 1025 1039 1026 1040 /* BOUND ç¶æ … … 1048 1062 ã RENEW 以å¤ã§ã¯ ACK/NAK ã¡ãã»ã¼ã¸åä¿¡ã¿ã¤ã ã¢ã¦ããè¨å®ããã*/ 1049 1063 if (fsm != DHCP4_FSM_RENEW) { 1050 syscall(wai_sem(SEM_DHCP4_CLI_TIMER));1064 DHCP4_CLI_TIMER_LOCK(); 1051 1065 ct->timers[DHCP4C_TIMER_RCV_ACK] = SYSTIM2TIMER(TMO_DHCP4C_ACK); 1052 syscall(sig_sem(SEM_DHCP4_CLI_TIMER));1066 DHCP4_CLI_TIMER_UNLOCK(); 1053 1067 } 1054 1068 … … 1073 1087 /* REQUEST ã¡ãã»ã¼ã¸ãéä¿¡ããã*/ 1074 1088 ct->flags |= DHCP4C_FLAG_TMOUT_SND_REQ; 1075 syscall(sig_sem(SEM_DHCP4_CLI_READY));1089 DHCP4_CLI_READY_SIGNAL(ct); 1076 1090 } 1077 1091 … … 1103 1117 /* RELEASE ã¡ãã»ã¼ã¸ãéä¿¡ããã*/ 1104 1118 ct->flags |= DHCP4C_FLAG_TMOUT_SND_REL; 1105 syscall(sig_sem(SEM_DHCP4_CLI_READY));1119 DHCP4_CLI_READY_SIGNAL(ct); 1106 1120 } 1107 1121 … … 1116 1130 uint8_t *option; 1117 1131 1118 memset((void*)&ct->snd_msg->msg, sizeof(ct->snd_msg->msg), 0);1132 memset((void*)&ct->snd_msg->msg, 0, sizeof(ct->snd_msg->msg)); 1119 1133 ct->snd_msg->len = sizeof(ct->snd_msg->msg); 1120 1134 … … 1410 1424 1411 1425 /* REQUEST ã¡ãã»ã¼ã¸éä¿¡ã¿ã¤ãã¼ãåæ¢ããã*/ 1412 syscall(wai_sem(SEM_DHCP4_CLI_TIMER));1426 DHCP4_CLI_TIMER_LOCK(); 1413 1427 ct->timers[DHCP4C_TIMER_SND_REQ] = 0; 1414 syscall(sig_sem(SEM_DHCP4_CLI_TIMER));1428 DHCP4_CLI_TIMER_UNLOCK(); 1415 1429 1416 1430 /* … … 1464 1478 1465 1479 /* ACK/NAK ã¡ãã»ã¼ã¸åä¿¡ã¿ã¤ãã¼ãåæ¢ããã*/ 1466 syscall(wai_sem(SEM_DHCP4_CLI_TIMER));1480 DHCP4_CLI_TIMER_LOCK(); 1467 1481 ct->timers[DHCP4C_TIMER_RCV_ACK] = 0; 1468 syscall(sig_sem(SEM_DHCP4_CLI_TIMER));1482 DHCP4_CLI_TIMER_UNLOCK(); 1469 1483 1470 1484 /* … … 1544 1558 1545 1559 /* åéä¿¡ã¿ã¤ã ã¢ã¦ããè¨å®ããã*/ 1546 syscall(wai_sem(SEM_DHCP4_CLI_TIMER));1560 DHCP4_CLI_TIMER_LOCK(); 1547 1561 ct->timers[DHCP4C_TIMER_SND_REQ] = SYSTIM2TIMER(ct->interval); 1548 syscall(sig_sem(SEM_DHCP4_CLI_TIMER));1562 DHCP4_CLI_TIMER_UNLOCK(); 1549 1563 } 1550 1564 … … 1582 1596 /* ã¡ãã»ã¼ã¸éä¿¡å¾ 1583 1597 ã¡ãè¡ãã*/ 1584 syscall(wai_sem(SEM_DHCP4_CLI_READY));1598 DHCP4_CLI_READY_WAIT(ct); 1585 1599 1586 1600 /* SLEEP ç¶æ … … 1602 1616 1603 1617 /* DISCOVER ã¡ãã»ã¼ã¸éä¿¡ã¿ã¤ãã¼ãåæ¢ããã*/ 1604 syscall(wai_sem(SEM_DHCP4_CLI_TIMER));1618 DHCP4_CLI_TIMER_LOCK(); 1605 1619 ct->timers[DHCP4C_TIMER_SND_DISC] = 0; 1606 syscall(sig_sem(SEM_DHCP4_CLI_TIMER));1620 DHCP4_CLI_TIMER_UNLOCK(); 1607 1621 1608 1622 /* REQUEST ã¡ãã»ã¼ã¸ãéä¿¡ã㦠REQUEST ç¶æ … … 1634 1648 1635 1649 /* OFFER ã¡ãã»ã¼ã¸åä¿¡ã¿ã¤ãã¼ãåæ¢ããã*/ 1636 syscall(wai_sem(SEM_DHCP4_CLI_TIMER));1650 DHCP4_CLI_TIMER_LOCK(); 1637 1651 ct->timers[DHCP4C_TIMER_RCV_OFFER] = 0; 1638 syscall(sig_sem(SEM_DHCP4_CLI_TIMER));1652 DHCP4_CLI_TIMER_UNLOCK(); 1639 1653 1640 1654 /* REQUEST ã¡ãã»ã¼ã¸ãéä¿¡ã㦠REQUEST ç¶æ … … 1692 1706 1693 1707 /* åéä¿¡ã¿ã¤ã ã¢ã¦ããè¨å®ããã*/ 1694 syscall(wai_sem(SEM_DHCP4_CLI_TIMER));1708 DHCP4_CLI_TIMER_LOCK(); 1695 1709 ct->timers[DHCP4C_TIMER_SND_DISC] = SYSTIM2TIMER(ct->interval); 1696 syscall(sig_sem(SEM_DHCP4_CLI_TIMER)); 1697 } 1710 DHCP4_CLI_TIMER_UNLOCK(); 1711 } 1712 1713 #ifdef DHCP4_CLI_TASK 1698 1714 1699 1715 /* … … 1706 1722 int ix; 1707 1723 1708 syscall(wai_sem(SEM_DHCP4_CLI_TIMER));1724 DHCP4_CLI_TIMER_LOCK(); 1709 1725 for (ix = NUM_DHCP4C_TIMERS; ix -- > 0; ) { 1710 1726 if (ct->timers[ix] != 0) { … … 1712 1728 if (ct->timers[ix] == 0) { 1713 1729 ct->flags = (ct->flags & ~DHCP4C_FLAG_TMOUT_MASK) | DHCP4C_FLAG_TMOUT_TIMER | ix; 1714 syscall(sig_sem(SEM_DHCP4_CLI_READY));1730 DHCP4_CLI_READY_SIGNAL(ct); 1715 1731 } 1716 1732 } 1717 1733 } 1718 syscall(sig_sem(SEM_DHCP4_CLI_TIMER));1734 DHCP4_CLI_TIMER_UNLOCK(); 1719 1735 1720 1736 /* 1ç§æ¯ã«ã¿ã¤ã ã¢ã¦ãããã*/ 1721 1737 timeout((callout_func)dhcpc_timer, ct, NET_TIMER_HZ); 1722 1738 } 1739 1740 #endif 1723 1741 1724 1742 /* … … 1832 1850 } 1833 1851 1852 #ifdef DHCP4_CLI_TASK 1853 1834 1854 /* 1835 1855 * dispatch_event -- ã¤ãã³ãæ¯ã®å¦ç … … 1845 1865 /* ã¡ãã»ã¼ã¸ã®åä¿¡ã¨ã¿ã¤ã ã¢ã¦ããå¾ 1846 1866 ã¤ã*/ 1847 syscall(wai_sem(SEM_DHCP4_CLI_READY));1867 DHCP4_CLI_READY_WAIT(ct); 1848 1868 1849 1869 if (ct->flags & DHCP4C_FLAG_RCV_MSG) { … … 1863 1883 } 1864 1884 1885 #endif 1886 1865 1887 /* 1866 1888 * init_context -- DHCP ã¯ã©ã¤ã¢ã³ãã³ã³ããã¹ãæ§é ä½ãåæåããã … … 1868 1890 1869 1891 static void 1870 init_context (T_DHCP4_CLI_CONTEXT *ct, ID cepid)1892 init_context (T_DHCP4_CLI_CONTEXT *ct, ID tskid, ID cepid) 1871 1893 { 1872 1894 memset(ct, 0, sizeof(*ct)); 1895 ct->tskid = tskid; 1873 1896 ct->cepid = cepid; 1874 1897 ct->sc = IF_ETHER_NIC_GET_SOFTC(); 1875 1898 ct->dst.portno = DHCP4_SRV_CFG_PORTNO; 1876 1899 ct->dst.ipaddr = IPV4_ADDRANY; 1877 ct->set_addr_callback = DHCP4_CLI_SET_ADDR_CALLBACK;1878 1900 } 1879 1901 … … 1968 1990 1969 1991 /* SLEEP ã解é¤ããã*/ 1970 wup_tsk(DHCP4_CLI_TASK); 1992 context.req = 1; 1993 wup_tsk(context.tskid); 1971 1994 return E_OK; 1972 1995 } … … 2061 2084 } 2062 2085 } 2063 syscall(sig_sem(SEM_DHCP4_CLI_READY));2086 DHCP4_CLI_READY_SIGNAL((&context)); 2064 2087 } 2065 2088 return E_OK; 2066 2089 } 2090 2091 #ifdef DHCP4_CLI_TASK 2067 2092 2068 2093 /* … … 2075 2100 T_DHCP4_CLI_CONTEXT *ct; 2076 2101 ID tskid; 2077 ER error ;2102 ER error = E_OK; 2078 2103 2079 2104 dly_tsk(1000); … … 2084 2109 2085 2110 /* DHCP ã¯ã©ã¤ã¢ã³ãã³ã³ããã¹ãæ§é ä½ãåæåããã*/ 2086 init_context(ct, (ID)exinf); 2111 init_context(ct, tskid, (ID)exinf); 2112 ct->fsm = DHCP4_FSM_SLEEP; 2087 2113 2088 2114 while (true) { 2089 2090 /* 1ç§æ¯ã«ã¿ã¤ã ã¢ã¦ãããããã«ã¿ã¤ãã¼ãè¨å®ããã*/2091 timeout((callout_func)dhcpc_timer, ct, NET_TIMER_HZ / DHCP4C_TIMER_HZ);2092 2093 /* ã¡ãã»ã¼ã¸æ§é ä½ãåæåããã*/2094 if ((error = init_cli_msg(ct)) == E_OK) {2095 2096 /* SELECT ç¶æ2097 ã«é·ç§»ããã*/2098 start_select(ct);2099 2100 /* ã¡ã¤ã³ã«ã¼ã */2101 error = dispatch_event(ct);2102 }2103 2104 /* å2105 ¨ã¦ã® TIMER ããã£ã³ã»ã«ããã*/2106 cancel_all_timers(ct);2107 2108 /* ã¿ã¤ãã¼ãåæ¢ããã*/2109 untimeout((callout_func)dhcpc_timer, ct);2110 2111 /* ã¡ãã»ã¼ã¸æ§é ä½ã解æ¾ããã*/2112 rel_cli_msg (ct);2113 2115 2114 2116 /* ãªã¼ã¹ã解æ¾å¾ãååå¾ãæå®ããã¦ããªããã°ä¼æ¢ããã*/ … … 2116 2118 2117 2119 /* ä¼æ¢ããã*/ 2118 if (error == E_OK) 2119 syslog(LOG_NOTICE, "[DHCP4C] lease released, go to sleep."); 2120 if (error == E_OK) { 2121 if (ct->fsm != DHCP4_FSM_SLEEP) 2122 syslog(LOG_NOTICE, "[DHCP4C] lease released, go to sleep."); 2123 } 2120 2124 else { 2121 2125 syslog(LOG_NOTICE, "[DHCP4C] server not available, go to sleep, error: %s.", itron_strerror(error)); … … 2126 2130 ct->flags = 0; 2127 2131 ct->error = E_OK; 2128 } 2129 } 2130 2132 2133 /* 1ç§æ¯ã«ã¿ã¤ã ã¢ã¦ãããããã«ã¿ã¤ãã¼ãè¨å®ããã*/ 2134 timeout((callout_func)dhcpc_timer, ct, NET_TIMER_HZ / DHCP4C_TIMER_HZ); 2135 2136 /* ã¡ãã»ã¼ã¸æ§é ä½ãåæåããã*/ 2137 if ((error = init_cli_msg(ct)) == E_OK) { 2138 2139 /* SELECT ç¶æ 2140 ã«é·ç§»ããã*/ 2141 start_select(ct); 2142 2143 /* ã¡ã¤ã³ã«ã¼ã */ 2144 error = dispatch_event(ct); 2145 } 2146 2147 /* å 2148 ¨ã¦ã® TIMER ããã£ã³ã»ã«ããã*/ 2149 cancel_all_timers(ct); 2150 2151 /* ã¿ã¤ãã¼ãåæ¢ããã*/ 2152 untimeout((callout_func)dhcpc_timer, ct); 2153 2154 /* ã¡ãã»ã¼ã¸æ§é ä½ã解æ¾ããã*/ 2155 rel_cli_msg (ct); 2156 } 2157 } 2158 2159 #else 2160 2161 T_DHCP4_CLI_CONTEXT * 2162 dhcp4_cli_initialize(ID tskid, ID cepid) 2163 { 2164 T_DHCP4_CLI_CONTEXT *ct = &context; 2165 /* DHCP ã¯ã©ã¤ã¢ã³ãã³ã³ããã¹ãæ§é ä½ãåæåããã*/ 2166 init_context(ct, tskid, cepid); 2167 ct->fsm = DHCP4_FSM_SLEEP; 2168 ct->timer = TMO_FEVR; 2169 return ct; 2170 } 2171 2172 int 2173 dhcp4_cli_get_timer(T_DHCP4_CLI_CONTEXT *ct) 2174 { 2175 if (ct->fsm == DHCP4_FSM_SLEEP) 2176 return TMO_FEVR; 2177 2178 return ct->timer; 2179 } 2180 2181 void 2182 dhcp4_cli_progress(T_DHCP4_CLI_CONTEXT *ct, int elapse) 2183 { 2184 int ix; 2185 2186 if ((ct->fsm == DHCP4_FSM_SLEEP) || (ct->timer == TMO_FEVR)) 2187 return; 2188 2189 ct->timer -= elapse; 2190 if (ct->timer > 0) 2191 return; 2192 2193 /* 1ç§æ¯ã«ã¿ã¤ã ã¢ã¦ãããããã«ã¿ã¤ãã¼ãè¨å®ããã*/ 2194 ct->timer = 1000 * 1000; 2195 2196 for (ix = NUM_DHCP4C_TIMERS; ix-- > 0; ) { 2197 if (ct->timers[ix] != 0) { 2198 ct->timers[ix] --; 2199 if (ct->timers[ix] <= 0) { 2200 ct->timers[ix] = 0; 2201 ct->flags = (ct->flags & ~DHCP4C_FLAG_TMOUT_MASK) | DHCP4C_FLAG_TMOUT_TIMER | ix; 2202 DHCP4_CLI_READY_SIGNAL(ct); 2203 } 2204 } 2205 } 2206 } 2207 2208 void 2209 dhcp4_cli_wakeup(T_DHCP4_CLI_CONTEXT *ct) 2210 { 2211 if (ct->req) { 2212 ct->req = 0; 2213 if (ct->snd_msg == NULL) { 2214 ct->flags = 0; 2215 ct->error = E_OK; 2216 2217 /* ã¡ãã»ã¼ã¸æ§é ä½ãåæåããã*/ 2218 if ((ct->error = init_cli_msg(ct)) != E_OK) 2219 return; 2220 2221 ct->timer = 1000 * 1000; 2222 2223 /* SELECT ç¶æ 2224 ã«é·ç§»ããã*/ 2225 start_select(ct); 2226 } 2227 } 2228 2229 if (!ct->sig) 2230 return; 2231 ct->sig = 0; 2232 2233 if (ct->flags & DHCP4C_FLAG_RCV_MSG) { 2234 while (ct->val_lst != NULL) { 2235 ct->error = eval_rcv_msg(ct); 2236 } 2237 ct->flags &= ~DHCP4C_FLAG_RCV_MSG; 2238 } 2239 } 2240 2241 void 2242 dhcp4_cli_timeout(T_DHCP4_CLI_CONTEXT *ct) 2243 { 2244 if (ct->flags & DHCP4C_FLAG_TMOUT_MASK) 2245 ct->error = dispatch_timeout(ct); 2246 2247 if (ct->error != E_OK || ct->fsm == DHCP4_FSM_SLEEP) { 2248 /* å 2249 ¨ã¦ã® TIMER ããã£ã³ã»ã«ããã*/ 2250 cancel_all_timers(ct); 2251 ct->timer = TMO_FEVR; 2252 2253 /* ã¡ãã»ã¼ã¸æ§é ä½ã解æ¾ããã*/ 2254 rel_cli_msg(ct); 2255 2256 /* ãªã¼ã¹ã解æ¾å¾ãååå¾ãæå®ããã¦ããªããã°ä¼æ¢ããã*/ 2257 if (!(ct->flags & DHCP4C_FLAG_RENEW)) { 2258 2259 /* ä¼æ¢ããã*/ 2260 if (ct->error == E_OK) { 2261 if (ct->fsm != DHCP4_FSM_SLEEP) 2262 syslog(LOG_NOTICE, "[DHCP4C] lease released, go to sleep."); 2263 } 2264 else { 2265 syslog(LOG_NOTICE, "[DHCP4C] server not available, go to sleep, error: %s.", itron_strerror(ct->error)); 2266 ct->error = E_OK; 2267 ct->fsm = DHCP4_FSM_SLEEP; 2268 } 2269 } 2270 } 2271 } 2272 2273 #endif /* DHCP4_CLI_TASK */ 2131 2274 #endif /* of #ifdef DHCP4_CLI_CFG */ -
EcnlProtoTool/trunk/asp3_dcre/tinet/netapp/dhcp4_cli.h
r331 r429 206 206 207 207 /* åä¿¡ã¿ã¤ã ã¢ã¦ã */ 208 #define TMO_DHCP4C_OFFER ULONG_C(120*1000) /* OFFER ã¡ãã»ã¼ã¸ */209 #define TMO_DHCP4C_ACK ULONG_C(60*1000) /* ACK/NAK ã¡ãã»ã¼ã¸ */208 #define TMO_DHCP4C_OFFER (ULONG_C(120)*SYSTIM_HZ) /* OFFER ã¡ãã»ã¼ã¸ */ 209 #define TMO_DHCP4C_ACK (ULONG_C(60)*SYSTIM_HZ) /* ACK/NAK ã¡ãã»ã¼ã¸ */ 210 210 211 211 /* ãªã¼ã¹æéã®æ¢å®å¤ */ 212 #define TMO_DHCP4C_DEF_LEASE ULONG_C(12*60*60*1000) /* æ¨æºæé */213 #define TMO_DHCP4C_MIN_LEASE ULONG_C(60*1000) /* æå°æé */212 #define TMO_DHCP4C_DEF_LEASE (ULONG_C(12*60*60)*SYSTIM_HZ) /* æ¨æºæé */ 213 #define TMO_DHCP4C_MIN_LEASE (ULONG_C(60)*SYSTIM_HZ) /* æå°æé */ 214 214 215 215 /* ã¡ãã»ã¼ã¸ã®éä¿¡å¨æ */ 216 #define TMO_DHCP4C_INIT_INTVL ULONG_C(3*1000) /* åæå¤ */217 #define TMO_DHCP4C_MAX_BACKOFF ULONG_C(15*1000) /* å¶éå¤ */216 #define TMO_DHCP4C_INIT_INTVL (ULONG_C(3)*SYSTIM_HZ) /* åæå¤ */ 217 #define TMO_DHCP4C_MAX_BACKOFF (ULONG_C(15)*SYSTIM_HZ) /* å¶éå¤ */ 218 218 219 219 /* DHCP ãµã¼ãã¸ã® UDP éä¿¡ã¿ã¤ã ã¢ã¦ã */ … … 230 230 ã¡æé */ 231 231 #define TMO_DHCP4C_SND_REL_WAIT ULONG_C(1000000) /* [us] */ 232 233 /* DHCP ã§ã¢ãã¬ã¹ãæ´æ°ãããæã«å¼ã³åºãã³ã¼ã«ããã¯é¢æ° */234 #ifndef DHCP4_CLI_SET_ADDR_CALLBACK235 #define DHCP4_CLI_SET_ADDR_CALLBACK NULL236 #endif237 232 238 233 #ifndef _MACRO_ONLY -
EcnlProtoTool/trunk/asp3_dcre/tinet/netapp/dhcp4_cli_var.h
r331 r429 181 181 RELTIM interval; /* éä¿¡éé */ 182 182 ER_UINT error; /* ã¨ã©ã¼ã»ãã¼ã¿é· */ 183 ID cepid; /* CEP ID */ 183 ID tskid; /* ã¿ã¹ã¯ID */ 184 ID cepid; /* CEP ID */ 184 185 uint32_t xid; /* ãã©ã³ã¶ã¯ã·ã§ã³ ID */ 185 186 uint16_t flags; /* å種ãã©ã° */ … … 188 189 uint8_t fsm; /* ç¾å¨ã®ç¶æ 189 190 */ 190 void (* set_addr_callback)(); /* ã¢ãã¬ã¹è¨å®æã®ã³ã¼ã«ãã㯠*/ 191 uint8_t req; 192 uint8_t sig; 193 int timer; 191 194 } T_DHCP4_CLI_CONTEXT; 192 195 -
EcnlProtoTool/trunk/asp3_dcre/tinet/netapp/netapp_subr.c
r331 r429 44 44 #include <sil.h> 45 45 #include <syssvc/serial.h> 46 #include <syssvc/logtask.h> 46 #include <target_syssvc.h> 47 #define LOGTASK_PORTID SIO_PORTID 47 48 #include <t_syslog.h> 48 49 #include "kernel_cfg.h" -
EcnlProtoTool/trunk/asp3_dcre/tinet/netapp/resolver.c
r331 r429 59 59 #include <kernel.h> 60 60 #include <t_syslog.h> 61 #include <syssvc/logtask.h> 61 #include <target_syssvc.h> 62 #define LOGTASK_PORTID SIO_PORTID 62 63 #include "kernel_cfg.h" 63 64 #include "tinet_cfg.h" … … 253 254 { 254 255 uint_t label_len; 255 uint8_t*tail;256 char *tail; 256 257 257 258 while (*name != '\0') { … … 265 266 266 267 /* ã©ãã«é·ãè¨å®ããã*/ 267 label_len = tail - (uint8_t*)name;268 label_len = tail - name; 268 269 if (label_len > DNS_LABEL_LENGTH) { /* 63 ãªã¯ããããè¶ 269 270 ããã¨ã¨ã©ã¼ */ … … 421 422 422 423 /* ãã¡ã¤ã³åã追å ããã*/ 423 if ((offset = add_name(msg, msg_size, offset, dns_domain_name)) < 0)424 if ((offset = add_name(msg, msg_size, offset, (char *)dns_domain_name)) < 0) 424 425 return offset; 425 426 … … 1075 1076 1076 1077 if (new == NULL) 1077 strcpy( dns_domain_name, RSLV_CFG_DNS_DOMAIN_NAME_STR);1078 strcpy((char *)dns_domain_name, RSLV_CFG_DNS_DOMAIN_NAME_STR); 1078 1079 else { 1079 1080 dst = dns_domain_name; -
EcnlProtoTool/trunk/asp3_dcre/tinet/netapp/resolver.h
r331 r429 70 70 */ 71 71 72 #define TMO_DNS_UDP_SND ULONG_C(1*1000 ) /* [ms]ãDNS ãµã¼ãã¸ã® UDP éä¿¡ã¿ã¤ã ã¢ã¦ã */73 #define TMO_DNS_UDP_RCV ULONG_C(5*1000 ) /* [ms]ãDNS ãµã¼ãããã® UDP åä¿¡ã¿ã¤ã ã¢ã¦ã */72 #define TMO_DNS_UDP_SND ULONG_C(1*1000*1000) /* [us]ãDNS ãµã¼ãã¸ã® UDP éä¿¡ã¿ã¤ã ã¢ã¦ã */ 73 #define TMO_DNS_UDP_RCV ULONG_C(5*1000*1000) /* [us]ãDNS ãµã¼ãããã® UDP åä¿¡ã¿ã¤ã ã¢ã¦ã */ 74 74 #define NUM_DNS_UDP_RETRY 1 /* ãªãã©ã¤åæ° */ 75 75 -
EcnlProtoTool/trunk/asp3_dcre/tinet/netapp/wwws.c
r331 r429 708 708 len += put_str(cepid, srbuf, response); 709 709 get_tim(&finish); 710 syslog(LOG_NOTICE, "[WWWn:%02u SND] send: index.html, len: %4u, time: %lu [ ms]",710 syslog(LOG_NOTICE, "[WWWn:%02u SND] send: index.html, len: %4u, time: %lu [us]", 711 711 cepid, len, (finish - start) * 1000 / SYSTIM_HZ); 712 712 return E_OK; … … 1609 1609 1610 1610 get_tim(&finish); 1611 syslog(LOG_NOTICE, "[WWWn:%02u SND]send: stat.html, len: %4u, time: %lu [ ms]",1611 syslog(LOG_NOTICE, "[WWWn:%02u SND]send: stat.html, len: %4u, time: %lu [us]", 1612 1612 cepid, len, (finish - start) * 1000 / SYSTIM_HZ); 1613 1613 return E_OK; -
EcnlProtoTool/trunk/asp3_dcre/tinet/netdev/if_mbed/if_mbed.c
r331 r429 4 4 * Copyright (C) 2001-2009 by Dep. of Computer Science and Engineering 5 5 * Tomakomai National College of Technology, JAPAN 6 * Copyright (C) 2014 Cores Co., Ltd. Japan6 * Copyright (C) 2014-2019 Cores Co., Ltd. Japan 7 7 * 8 8 * 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ … … 64 64 * SUCH DAMAGE. 65 65 * 66 * $FreeBSD: src/sys/i386/isa/if_ mbed.c,v 1.148.2.4 1999/09/25 13:08:18 nyan Exp $66 * $FreeBSD: src/sys/i386/isa/if_ed.c,v 1.148.2.4 1999/09/25 13:08:18 nyan Exp $ 67 67 */ 68 68 … … 200 200 if_mbed_setrcr(T_IF_SOFTC *ic) 201 201 { 202 T_MBED_SOFTC *sc = ic->sc;203 202 } 204 203 … … 318 317 if_mbed_init(T_IF_SOFTC *ic) 319 318 { 320 T_MBED_SOFTC *sc = ic->sc;321 322 319 /* mbed_init 本体を呼び出す。*/ 323 320 if_mbed_init_sub(ic); … … 347 344 } 348 345 if (link_mode_new != NEGO_FAIL) { 349 ethernetext_set_link_mode(link_mode_new );346 ethernetext_set_link_mode(link_mode_new | PROMISCUOUS_MODE); 350 347 ETHER.EESIPR0 |= EDMAC_EESIPR_INI_TRANS; 351 348 ether_set_link_up(ether); … … 373 370 if_mbed_read(T_IF_SOFTC *ic) 374 371 { 375 T_MBED_SOFTC *sc = ic->sc;376 372 T_NET_BUF *input = NULL; 377 373 uint_t align; … … 406 402 if_mbed_start(T_IF_SOFTC *ic, T_NET_BUF *output) 407 403 { 408 T_MBED_SOFTC *sc = ic->sc;409 404 int32_t len, res, pos; 410 405 … … 429 424 if_mbed_eth_handler(void) 430 425 { 431 uint32_t stat_edmac; 432 uint32_t stat_etherc; 433 434 /* Clear the interrupt request flag */ 435 stat_edmac = (ETHER.EESR0 & ETHER.EESIPR0); /* Targets are restricted to allowed interrupts */ 436 ETHER.EESR0 = stat_edmac; 437 /* Reception-related */ 438 if (stat_edmac & EDMAC_EESIPR_INI_RECV) { 439 isig_sem(if_softc.semid_rxb_ready); 440 } 426 uint32_t stat_edmac; 427 uint32_t stat_etherc; 428 ER ret; 429 430 /* Clear the interrupt request flag */ 431 stat_edmac = (ETHER.EESR0 & ETHER.EESIPR0); /* Targets are restricted to allowed interrupts */ 432 ETHER.EESR0 = stat_edmac; 433 /* Reception-related */ 434 if (stat_edmac & EDMAC_EESIPR_INI_RECV) { 435 ret = isig_sem(if_softc.semid_rxb_ready); 436 if (ret != E_OK) 437 syslog(LOG_INFO, "semid_rxb_ready %d %x", ret, stat_edmac & EDMAC_EESIPR_INI_RECV); 438 } 441 439 if (stat_edmac & EDMAC_EESIPR_INI_TRANS) { 442 isig_sem(if_softc.semid_txb_ready); 443 } 444 /* E-MAC-related */ 445 if (stat_edmac & EDMAC_EESIPR_INI_EtherC) { 446 /* Clear the interrupt request flag */ 447 stat_etherc = (ETHER.ECSR0 & ETHER.ECSIPR0); /* Targets are restricted to allowed interrupts */ 448 ETHER.ECSR0 = stat_etherc; 449 } 450 } 440 ret = isig_sem(if_softc.semid_txb_ready); 441 if (ret != E_OK) 442 syslog(LOG_INFO, "semid_txb_ready %d %x", ret, stat_edmac & EDMAC_EESIPR_INI_TRANS); 443 } 444 /* E-MAC-related */ 445 if (stat_edmac & EDMAC_EESIPR_INI_EtherC) { 446 /* Clear the interrupt request flag */ 447 stat_etherc = (ETHER.ECSR0 & ETHER.ECSIPR0); /* Targets are restricted to allowed interrupts */ 448 ETHER.ECSR0 = stat_etherc; 449 } 450 } -
EcnlProtoTool/trunk/asp3_dcre/tinet/netdev/if_mbed/if_mbed.cfg
r321 r429 4 4 * Copyright (C) 2001-2009 by Dep. of Computer Science and Engineering 5 5 * Tomakomai National College of Technology, JAPAN 6 * Copyright (C) 2014 Cores Co., Ltd. Japan6 * Copyright (C) 2014-2019 Cores Co., Ltd. Japan 7 7 * 8 8 * 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ -
EcnlProtoTool/trunk/asp3_dcre/tinet/netdev/if_mbed/if_mbed.h
r321 r429 4 4 * Copyright (C) 2001-2009 by Dep. of Computer Science and Engineering 5 5 * Tomakomai National College of Technology, JAPAN 6 * Copyright (C) 2014 Cores Co., Ltd. Japan6 * Copyright (C) 2014-2019 Cores Co., Ltd. Japan 7 7 * 8 8 * 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ -
EcnlProtoTool/trunk/asp3_dcre/tinet/netdev/if_mbed/nic.cfg
r321 r429 4 4 * Copyright (C) 2001-2009 by Dep. of Computer Science and Engineering 5 5 * Tomakomai National College of Technology, JAPAN 6 * Copyright (C) 2014 Cores Co., Ltd. Japan6 * Copyright (C) 2014-2019 Cores Co., Ltd. Japan 7 7 * 8 8 * 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ -
EcnlProtoTool/trunk/asp3_dcre/tinet/netdev/if_mbed/nic_asp.cfg
r321 r429 4 4 * Copyright (C) 2001-2009 by Dep. of Computer Science and Engineering 5 5 * Tomakomai National College of Technology, JAPAN 6 * Copyright (C) 2014 Cores Co., Ltd. Japan6 * Copyright (C) 2014-2019 Cores Co., Ltd. Japan 7 7 * 8 8 * 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ -
EcnlProtoTool/trunk/asp3_dcre/tinet/netdev/if_mbed/nic_rename.h
r321 r429 4 4 * Copyright (C) 2001-2009 by Dep. of Computer Science and Engineering 5 5 * Tomakomai National College of Technology, JAPAN 6 * Copyright (C) 2014 Cores Co., Ltd. Japan6 * Copyright (C) 2014-2019 Cores Co., Ltd. Japan 7 7 * 8 8 * 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ -
EcnlProtoTool/trunk/asp3_dcre/tinet/netdev/if_mbed/tinet_nic_config.h
r321 r429 4 4 * Copyright (C) 2001-2009 by Dep. of Computer Science and Engineering 5 5 * Tomakomai National College of Technology, JAPAN 6 * Copyright (C) 2014 Cores Co., Ltd. Japan6 * Copyright (C) 2014-2019 Cores Co., Ltd. Japan 7 7 * 8 8 * 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ -
EcnlProtoTool/trunk/asp3_dcre/tinet/netdev/if_mbed/tinet_nic_defs.h
r321 r429 4 4 * Copyright (C) 2001-2009 by Dep. of Computer Science and Engineering 5 5 * Tomakomai National College of Technology, JAPAN 6 * Copyright (C) 2014 Cores Co., Ltd. Japan6 * Copyright (C) 2014-2019 Cores Co., Ltd. Japan 7 7 * 8 8 * 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ -
EcnlProtoTool/trunk/asp3_dcre/tinet/netinet/icmp6.h
r331 r429 291 291 typedef struct t_router_advert_hdr { 292 292 T_ICMP6_HDR hdr; 293 uint32_t reachable; /* [ ms] 到達可能時間 */294 uint32_t retransmit; /* [ ms] 近隣要請送信間隔 */293 uint32_t reachable; /* [us] 到達可能時間 */ 294 uint32_t retransmit; /* [us] 近隣要請送信間隔 */ 295 295 /* この後にオプションが続く */ 296 296 } __attribute__((packed, aligned(2))) T_ROUTER_ADVERT_HDR; -
EcnlProtoTool/trunk/asp3_dcre/tinet/netinet/in4_subr.c
r331 r429 115 115 #include <net/if_var.h> 116 116 117 #ifdef SUPPORT_IGMP 118 #include <netinet/udp_var.h> 119 #include <netinet/ip_igmp.h> 120 #endif /* of #ifdef SUPPORT_IGMP */ 121 117 122 #if defined(_IP4_CFG) 118 123 … … 294 299 295 300 /* IP ããããè¨å®ããã*/ 296 if ((error = in4_set_header(*nbuf, len, dstaddr, srcaddr, proto, ttl)) != E_OK) 301 if ((error = in4_set_header(*nbuf, len, dstaddr, srcaddr, proto, ttl)) != E_OK) { 302 syscall(rel_net_buf(*nbuf)); 303 *nbuf = NULL; 297 304 return error; 305 } 298 306 299 307 /* 4 ãªã¯ãããå¢çã¾ã§ããã£ã³ã°ã§åããã*/ -
EcnlProtoTool/trunk/asp3_dcre/tinet/netinet/in_itron.h
r331 r429 62 62 #define TFN_TCP_ALL (0) 63 63 64 #define TEV_TCP_RCV_OOB ( -0x201)64 #define TEV_TCP_RCV_OOB (0x201) 65 65 66 66 /* UDP 関係 */ … … 75 75 #define TFN_UDP_ALL (0) 76 76 77 #define TEV_UDP_RCV_DAT ( -0x221)77 #define TEV_UDP_RCV_DAT (0x221) 78 78 79 79 /* 一般 */ … … 139 139 extern ER udp_cre_cep (ID cepid, T_UDP_CCEP *pk_ccep); 140 140 141 extern ER udp6_del_cep(ID cepid); 142 extern ER udp6_set_opt(ID cepid, int_t optname, void *optval, int_t optlen); 143 extern ER udp6_get_opt(ID cepid, int_t optname, void *optval, int_t optlen); 141 144 extern ER udp6_cre_cep (ID cepid, T_UDP6_CCEP *pk_ccep); 142 145 -
EcnlProtoTool/trunk/asp3_dcre/tinet/netinet/in_rename.h
r331 r429 242 242 #define arp_get_cache _tinet_arp_get_cache 243 243 244 #define ether_map_ipv4_multicast _tinet_ether_map_ipv4_multicast 244 #define ether_map_ipv4_multicast \ 245 _tinet_ether_map_ipv4_multicast 245 246 246 247 /* netinet6/icmp6.c */ -
EcnlProtoTool/trunk/asp3_dcre/tinet/netinet/in_var.h
r331 r429 141 141 inn_get_datagram(nbuf,len,maxlen,dst,src,next,hlim,nbatr,tmout) 142 142 #define IN_IS_ADDR_MULTICAST(addr) inn_is_addr_multicast(addr) 143 #define IN_IS_NET_ADDR_MULTICAST(nbuf) IN_IS_ADDR_MULTICAST(&GET_IP6_HDR(nbuf)->dst) 143 #define IN_IS_NET_ADDR_MULTICAST(nbuf) (GET_IP_VER(input)==IPV6_VERSION \ 144 ?IN_IS_ADDR_MULTICAST(&GET_IP6_HDR(input)->dst) \ 145 :IN4_IS_ADDR_MULTICAST(ntohl(GET_IP4_HDR(input)->dst))) 144 146 #define IN_ADDRWITHIFP(ifp,src,dst) inn_addrwithifp(ifp,src,dst) 145 147 #define IN_IS_ADDR_ANY(addr) IN6_IS_ADDR_UNSPECIFIED(addr) -
EcnlProtoTool/trunk/asp3_dcre/tinet/netinet/ip4_var.h
r331 r429 106 106 uint8_t idix; /* mpfid ã®ã¤ã³ããã¯ã¹ */ 107 107 uint8_t flags; /* ãã©ã° */ 108 #ifdef IF_ETHER_MULTI_NIC 109 uint8_t conn_pos; 110 #endif 108 111 #ifdef IF_ETHER_NIC_NET_BUF_ALIGN 109 112 uint8_t nalign[IF_ETHER_NIC_NET_BUF_ALIGN]; … … 124 127 uint8_t idix; /* mpfid ã®ã¤ã³ããã¯ã¹ */ 125 128 uint8_t flags; /* ãã©ã° */ 129 #ifdef IF_ETHER_MULTI_NIC 130 uint8_t conn_pos; 131 #endif 126 132 #ifdef IF_ETHER_NIC_NET_BUF_ALIGN 127 133 uint8_t nalign[IF_ETHER_NIC_NET_BUF_ALIGN]; … … 178 184 uint8_t idix; /* mpfid ã®ã¤ã³ããã¯ã¹ */ 179 185 uint8_t flags; /* ãã©ã° */ 186 #ifdef IF_ETHER_MULTI_NIC 187 uint8_t conn_pos; 188 #endif 180 189 #ifdef IF_ETHER_NIC_NET_BUF_ALIGN 181 190 uint8_t nalign[IF_ETHER_NIC_NET_BUF_ALIGN]; -
EcnlProtoTool/trunk/asp3_dcre/tinet/netinet/ip_igmp.c
r331 r429 5 5 * Tomakomai National College of Technology, JAPAN 6 6 * 7 * ãLì ÒÍCÈºÌ (1)`(4) Ìð©CFree Software Foundation 8 * ÉæÁÄö\³êÄ¢é GNU General Public License Ì Version 2 ÉL 9 * q³êÄ¢éðð½·êÉÀèC{\tgEFAi{\tgEFA 10 * ðüϵ½àÌðÜÞDȺ¯¶jðgpE¡»EüÏEÄzziȺC 11 * pÆÄÔj·é±Æð³Åø·éD 12 * (1) {\tgEFAð\[XR[hÌ`Åp·éêÉÍCãLÌì 13 * \¦C±Ìpð¨æѺL̳ÛØKèªC»ÌÜÜÌ`Å\[ 14 * XR[hÉÜÜêÄ¢é±ÆD 15 * (2) {\tgEFAðCCu`®ÈÇC¼Ì\tgEFAJÉg 16 * pÅ«é`ÅÄzz·éêÉÍCÄzzɺ¤hL 17 gip 18 * Ò}j 19 AÈÇjÉCãLÌì \¦C±Ìpð¨æѺL 20 * ̳ÛØKèðfÚ·é±ÆD 21 * (3) {\tgEFAðC@íÉgÝÞÈÇC¼Ì\tgEFAJÉg 22 * pÅ«È¢`ÅÄzz·éêÉÍCÌðð½·±ÆD 23 * (a) Äzzɺ¤hL 24 gipÒ}j 25 AÈÇjÉCãLÌ 26 * ì \¦C±Ìpð¨æѺL̳ÛØKèðfÚ·é±ÆD 27 * (4) {\tgEFAÌpÉæè¼ÚIܽÍÔÚIɶ¶é¢©Èé¹ 28 * Q©çàCãLì Ò¨æÑTOPPERSvWFNgðÆÓ·é±ÆD 7 * ä¸è¨èä½æ¨©è 8 ã¯ï¼ä»¥ä¸ã® (1)ï½(4) ã®æ¡ä»¶ãï¼Free Software Foundation 9 * ã«ãã£ã¦å 10 ¬è¡¨ããã¦ãã GNU General Public License ã® Version 2 ã«è¨ 11 * è¿°ããã¦ããæ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§ã¢ï¼æ¬ã½ããã¦ã§ã¢ 12 * ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ã使ç¨ã»è¤è£½ã»æ¹å¤ã»åé 13 å¸ï¼ä»¥ä¸ï¼ 14 * å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼ 15 * (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½ 16 * 権表示ï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼ 17 * ã¹ã³ã¼ãä¸ã«å«ã¾ãã¦ãããã¨ï¼ 18 * (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿ 19 * ç¨ã§ããå½¢ã§åé 20 å¸ããå ´åã«ã¯ï¼åé 21 å¸ã«ä¼´ãããã¥ã¡ã³ãï¼å©ç¨ 22 * è 23 ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ 24 * ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼ 25 * (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿ 26 * ç¨ã§ããªãå½¢ã§åé 27 å¸ããå ´åã«ã¯ï¼æ¬¡ã®æ¡ä»¶ãæºãããã¨ï¼ 28 * (a) åé 29 å¸ã«ä¼´ãããã¥ã¡ã³ãï¼å©ç¨è 30 ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è 31 * ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼ 32 * (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ 33 * 害ãããï¼ä¸è¨èä½æ¨©è 34 ããã³TOPPERSããã¸ã§ã¯ããå 35 責ãããã¨ï¼ 29 36 * 30 * {\tgEFAÍC³ÛØÅñ³êÄ¢éàÌÅ éDãLì Ò¨ 31 * æÑTOPPERSvWFNgÍC{\tgEFAÉÖµÄC»ÌKpÂ\«à 32 * ÜßÄC¢©ÈéÛØàsíÈ¢DܽC{\tgEFAÌpÉæè¼ 33 * ÚIܽÍÔÚIɶ¶½¢©Èé¹QÉÖµÄàC»ÌÓCðíÈ¢D 37 * æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è 38 ã 39 * ãã³TOPPERSããã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ãã®é©ç¨å¯è½æ§ã 40 * å«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´ 41 * æ¥çã¾ãã¯éæ¥çã«çãããããªãæ害ã«é¢ãã¦ãï¼ãã®è²¬ä»»ãè² ããªãï¼ 34 42 * 35 43 * @(#) $Id$ … … 88 96 89 97 static bool_t igmp_send_report_v2(T_IN4_ADDR dst); 90 static uint16_t igmp_get_timer(T_IGMP_ENTRY *entry);98 static int16_t igmp_get_timer(T_IGMP_ENTRY *entry); 91 99 92 100 ER igmp_set_loop(T_UDP_CEP *cep, uint8_t optval) … … 155 163 T_IGMP_ENTRY *entry = NULL; 156 164 int i; 157 uint16_t min;158 165 T_IFNET *ifp = IF_GET_IFNET(); 159 166 ER ret = E_NOMEM; … … 168 175 entry = &igmp_groups[i]; 169 176 if (entry->timer == -1) { 170 entry->timer = igmp_get_timer(entry);177 entry->timer = 0; 171 178 entry->ip_addr = optval->imr_multiaddr; 172 179 ret = E_OK; … … 184 191 T_IGMP_ENTRY *entry = NULL; 185 192 int i; 186 uint16_t min;187 193 ER ret = E_PAR; 188 194 T_IFNET *ifp = IF_GET_IFNET(); … … 223 229 T_NET_BUF *input = *inputp; 224 230 T_IGMPV2_HDR *igmph; 225 T_IN4_ADDR addr;226 231 uint_t len, align; 227 232 T_IP4_HDR *ip4h; … … 234 239 NET_COUNT_IGMP(net_count_igmp.in_packets, 1); 235 240 236 /* ICMP wb_Ì·³ð`FbN·éB*/241 /* ICMP ãããã®é·ãããã§ãã¯ããã*/ 237 242 if (input->len < IF_IP4_IGMP_HDR_SIZE) { 238 243 NET_COUNT_IGMP(net_count_igmp.in_err_packets, 1); … … 243 248 igmph = (T_IGMPV2_HDR *)(input->buf + *offp); 244 249 245 /* 4 INebg«EÌf[^· */250 /* 4 ãªã¯ãããå¢çã®ãã¼ã¿é· */ 246 251 len = input->len - *offp; 247 252 align = (len + 3) >> 2 << 2; 248 253 249 /* 4 INebg«EÜÅpfBOÅßéB*/254 /* 4 ãªã¯ãããå¢çã¾ã§ããã£ã³ã°ã§åããã*/ 250 255 if (align > len) 251 256 memset((uint8_t*)input->buf + input->len, 0, (size_t)(align - len)); 252 257 253 /* `FbNTðvZ·éB*/258 /* ãã§ãã¯ãµã ãè¨ç®ããã*/ 254 259 if (in_cksum(igmph, align) != 0) { 255 260 NET_COUNT_IGMP(net_count_igmp.in_err_packets, 1); … … 257 262 } 258 263 259 /* bZ[WÌ^Éæèªò·éB*/264 /* ã¡ãã»ã¼ã¸ã®åã«ããåå²ããã*/ 260 265 switch (igmph->type) { 261 266 case IGMP_MEMBERSHIP_QUERY: … … 263 268 ret = false; 264 269 265 /* QÁÌO[vAhX©çÌNG[Ìê*/270 /* åå ä¸ã®ã°ã«ã¼ãã¢ãã¬ã¹ããã®ã¯ã¨ãªã¼ã®å ´å */ 266 271 syscall(wai_sem(SEM_IGMP_GROUP_LOCK)); 267 272 268 273 for (i = 0; i < NUM_IGMP_ENTRY; i++) { 269 274 entry = &igmp_groups[i]; 270 if ((entry->timer >= 0) && (entry->ip_addr == addr)) {275 if ((entry->timer >= 0) && (entry->ip_addr == igmph->addr)) { 271 276 entry->resptime = igmph->time; 272 277 ret = true; … … 278 283 279 284 if (ret) { 280 /* o[Vbv|[gðM*/285 /* ã¡ã³ãã¼ã·ãããªãã¼ããéä¿¡ */ 281 286 igmp_send_report_v2(ip4h->src); 282 287 } … … 293 298 T_IGMPV2_HDR *igmph; 294 299 T_NET_BUF *output; 295 uint_t len , align;300 uint_t len = 0, align; 296 301 297 302 if (in4_get_datagram(&output, (uint_t)(IF_IP4_IGMP_HDR_SIZE + len), 0, … … 300 305 return false; 301 306 302 /* IGMP wb_ðÝè·éB*/307 /* IGMP ããããè¨å®ããã*/ 303 308 igmph = GET_IGMPV2_HDR(output, IF_IP4_IGMP_HDR_OFFSET); 304 309 igmph->type = IGMP_MEMBERSHIP_REPORT_V2; 305 310 igmph->time = 0; 306 igmph->addr = dst;307 308 /* 4 INebg«EÌf[^· */311 igmph->addr = htonl(dst); 312 313 /* 4 ãªã¯ãããå¢çã®ãã¼ã¿é· */ 309 314 align = (len + 3) >> 2 << 2; 310 315 311 /* 4 INebg«EÜÅpfBOÅßéB*/316 /* 4 ãªã¯ãããå¢çã¾ã§ããã£ã³ã°ã§åããã*/ 312 317 if (align > len) 313 memset((uint8_t*)GET_IGMP_SDU(output, IF_IP4_IGMP_HDR_OFFSET) + IP4_HDR_SIZE +len,318 memset((uint8_t*)GET_IGMP_SDU(output, IF_IP4_IGMP_HDR_OFFSET) + len, 314 319 0, (size_t)(align - len)); 315 320 316 /* `FbNTðvZ·éB*/321 /* ãã§ãã¯ãµã ãè¨ç®ããã*/ 317 322 igmph->sum = 0; 318 igmph->sum = in_cksum(igmph, (uint_t)(I F_IP4_IGMP_HDR_SIZE + align));319 320 /* M·éB*/323 igmph->sum = in_cksum(igmph, (uint_t)(IGMP_HDR_SIZE + align)); 324 325 /* éä¿¡ããã*/ 321 326 NET_COUNT_IGMP(net_count_igmp.out_octets, 322 327 output->len - GET_IF_IP4_HDR_SIZE(output)); … … 330 335 331 336 /* 332 * igmp_timer -- IGMP ¤Ê^C}[ 337 * igmp_timer -- IGMP å 338 ±éã¿ã¤ãã¼ 333 339 */ 334 340 static void igmp_timer(void *ignore) … … 361 367 362 368 /* 363 * igmp_init -- IGMP @\ðú»·éB369 * igmp_init -- IGMP æ©è½ãåæåããã 364 370 */ 365 371 366 372 void igmp_init(void) 367 373 { 368 T_IGMP_ENTRY *entry = NULL;369 374 int i; 370 375 … … 397 402 } 398 403 399 uint16_t igmp_get_timer(T_IGMP_ENTRY *entry)400 { 401 uint16_t time = entry->resptime;404 int16_t igmp_get_timer(T_IGMP_ENTRY *entry) 405 { 406 int16_t time = entry->resptime; 402 407 403 408 if (time == 0) 404 time = 10;405 406 return net_rand() / (0x7fffffff / time);409 time = 590; 410 411 return (int16_t)(net_rand() % time) + 10; 407 412 } 408 413 -
EcnlProtoTool/trunk/asp3_dcre/tinet/netinet/ip_igmp.cfg
r331 r429 5 5 * Tomakomai National College of Technology, JAPAN 6 6 * 7 * ãLì ÒÍCÈºÌ (1)`(4) Ìð©CFree Software Foundation 8 * ÉæÁÄö\³êÄ¢é GNU General Public License Ì Version 2 ÉL 9 * q³êÄ¢éðð½·êÉÀèC{\tgEFAi{\tgEFA 10 * ðüϵ½àÌðÜÞDȺ¯¶jðgpE¡»EüÏEÄzziȺC 11 * pÆÄÔj·é±Æð³Åø·éD 12 * (1) {\tgEFAð\[XR[hÌ`Åp·éêÉÍCãLÌì 13 * \¦C±Ìpð¨æѺL̳ÛØKèªC»ÌÜÜÌ`Å\[ 14 * XR[hÉÜÜêÄ¢é±ÆD 15 * (2) {\tgEFAðCCu`®ÈÇC¼Ì\tgEFAJÉg 16 * pÅ«é`ÅÄzz·éêÉÍCÄzzɺ¤hL 17 gip 18 * Ò}j 19 AÈÇjÉCãLÌì \¦C±Ìpð¨æѺL 20 * ̳ÛØKèðfÚ·é±ÆD 21 * (3) {\tgEFAðC@íÉgÝÞÈÇC¼Ì\tgEFAJÉg 22 * pÅ«È¢`ÅÄzz·éêÉÍCÌðð½·±ÆD 23 * (a) Äzzɺ¤hL 24 gipÒ}j 25 AÈÇjÉCãLÌ 26 * ì \¦C±Ìpð¨æѺL̳ÛØKèðfÚ·é±ÆD 27 * (4) {\tgEFAÌpÉæè¼ÚIܽÍÔÚIɶ¶é¢©Èé¹ 28 * Q©çàCãLì Ò¨æÑTOPPERSvWFNgðÆÓ·é±ÆD 7 * ä¸è¨èä½æ¨©è 8 ã¯ï¼ä»¥ä¸ã® (1)ï½(4) ã®æ¡ä»¶ãï¼Free Software Foundation 9 * ã«ãã£ã¦å 10 ¬è¡¨ããã¦ãã GNU General Public License ã® Version 2 ã«è¨ 11 * è¿°ããã¦ããæ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§ã¢ï¼æ¬ã½ããã¦ã§ã¢ 12 * ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ã使ç¨ã»è¤è£½ã»æ¹å¤ã»åé 13 å¸ï¼ä»¥ä¸ï¼ 14 * å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼ 15 * (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½ 16 * 権表示ï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼ 17 * ã¹ã³ã¼ãä¸ã«å«ã¾ãã¦ãããã¨ï¼ 18 * (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿ 19 * ç¨ã§ããå½¢ã§åé 20 å¸ããå ´åã«ã¯ï¼åé 21 å¸ã«ä¼´ãããã¥ã¡ã³ãï¼å©ç¨ 22 * è 23 ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ 24 * ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼ 25 * (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿ 26 * ç¨ã§ããªãå½¢ã§åé 27 å¸ããå ´åã«ã¯ï¼æ¬¡ã®æ¡ä»¶ãæºãããã¨ï¼ 28 * (a) åé 29 å¸ã«ä¼´ãããã¥ã¡ã³ãï¼å©ç¨è 30 ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è 31 * ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼ 32 * (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ 33 * 害ãããï¼ä¸è¨èä½æ¨©è 34 ããã³TOPPERSããã¸ã§ã¯ããå 35 責ãããã¨ï¼ 29 36 * 30 * {\tgEFAÍC³ÛØÅñ³êÄ¢éàÌÅ éDãLì Ò¨ 31 * æÑTOPPERSvWFNgÍC{\tgEFAÉÖµÄC»ÌKpÂ\«à 32 * ÜßÄC¢©ÈéÛØàsíÈ¢DܽC{\tgEFAÌpÉæè¼ 33 * ÚIܽÍÔÚIɶ¶½¢©Èé¹QÉÖµÄàC»ÌÓCðíÈ¢D 37 * æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è 38 ã 39 * ãã³TOPPERSããã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ãã®é©ç¨å¯è½æ§ã 40 * å«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´ 41 * æ¥çã¾ãã¯éæ¥çã«çãããããªãæ害ã«é¢ãã¦ãï¼ãã®è²¬ä»»ãè² ããªãï¼ 34 42 * 35 43 * @(#) $Id$ … … 37 45 38 46 /* 39 * IGMP RtBM 40 [Vt@C 47 * IGMP ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã« 41 48 */ 42 49 43 50 #if defined(_IP4_CFG) && defined(SUPPORT_IGMP) 44 51 45 /* IGMP O[vXVpZ}tH*/52 /* IGMP ã°ã«ã¼ãæ´æ°ç¨ã»ããã© */ 46 53 47 54 CRE_SEM(SEM_IGMP_GROUP_LOCK, { TA_TPRI, 1, 1 }); -
EcnlProtoTool/trunk/asp3_dcre/tinet/netinet/ip_igmp.h
r331 r429 5 5 * Tomakomai National College of Technology, JAPAN 6 6 * 7 * ãLì ÒÍCÈºÌ (1)`(4) Ìð©CFree Software Foundation 8 * ÉæÁÄö\³êÄ¢é GNU General Public License Ì Version 2 ÉL 9 * q³êÄ¢éðð½·êÉÀèC{\tgEFAi{\tgEFA 10 * ðüϵ½àÌðÜÞDȺ¯¶jðgpE¡»EüÏEÄzziȺC 11 * pÆÄÔj·é±Æð³Åø·éD 12 * (1) {\tgEFAð\[XR[hÌ`Åp·éêÉÍCãLÌì 13 * \¦C±Ìpð¨æѺL̳ÛØKèªC»ÌÜÜÌ`Å\[ 14 * XR[hÉÜÜêÄ¢é±ÆD 15 * (2) {\tgEFAðCCu`®ÈÇC¼Ì\tgEFAJÉg 16 * pÅ«é`ÅÄzz·éêÉÍCÄzzɺ¤hL 17 gip 18 * Ò}j 19 AÈÇjÉCãLÌì \¦C±Ìpð¨æѺL 20 * ̳ÛØKèðfÚ·é±ÆD 21 * (3) {\tgEFAðC@íÉgÝÞÈÇC¼Ì\tgEFAJÉg 22 * pÅ«È¢`ÅÄzz·éêÉÍCÌðð½·±ÆD 23 * (a) Äzzɺ¤hL 24 gipÒ}j 25 AÈÇjÉCãLÌ 26 * ì \¦C±Ìpð¨æѺL̳ÛØKèðfÚ·é±ÆD 27 * (4) {\tgEFAÌpÉæè¼ÚIܽÍÔÚIɶ¶é¢©Èé¹ 28 * Q©çàCãLì Ò¨æÑTOPPERSvWFNgðÆÓ·é±ÆD 7 * ä¸è¨èä½æ¨©è 8 ã¯ï¼ä»¥ä¸ã® (1)ï½(4) ã®æ¡ä»¶ãï¼Free Software Foundation 9 * ã«ãã£ã¦å 10 ¬è¡¨ããã¦ãã GNU General Public License ã® Version 2 ã«è¨ 11 * è¿°ããã¦ããæ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§ã¢ï¼æ¬ã½ããã¦ã§ã¢ 12 * ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ã使ç¨ã»è¤è£½ã»æ¹å¤ã»åé 13 å¸ï¼ä»¥ä¸ï¼ 14 * å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼ 15 * (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½ 16 * 権表示ï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼ 17 * ã¹ã³ã¼ãä¸ã«å«ã¾ãã¦ãããã¨ï¼ 18 * (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿ 19 * ç¨ã§ããå½¢ã§åé 20 å¸ããå ´åã«ã¯ï¼åé 21 å¸ã«ä¼´ãããã¥ã¡ã³ãï¼å©ç¨ 22 * è 23 ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ 24 * ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼ 25 * (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿ 26 * ç¨ã§ããªãå½¢ã§åé 27 å¸ããå ´åã«ã¯ï¼æ¬¡ã®æ¡ä»¶ãæºãããã¨ï¼ 28 * (a) åé 29 å¸ã«ä¼´ãããã¥ã¡ã³ãï¼å©ç¨è 30 ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è 31 * ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼ 32 * (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ 33 * 害ãããï¼ä¸è¨èä½æ¨©è 34 ããã³TOPPERSããã¸ã§ã¯ããå 35 責ãããã¨ï¼ 29 36 * 30 * {\tgEFAÍC³ÛØÅñ³êÄ¢éàÌÅ éDãLì Ò¨ 31 * æÑTOPPERSvWFNgÍC{\tgEFAÉÖµÄC»ÌKpÂ\«à 32 * ÜßÄC¢©ÈéÛØàsíÈ¢DܽC{\tgEFAÌpÉæè¼ 33 * ÚIܽÍÔÚIɶ¶½¢©Èé¹QÉÖµÄàC»ÌÓCðíÈ¢D 37 * æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è 38 ã 39 * ãã³TOPPERSããã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ãã®é©ç¨å¯è½æ§ã 40 * å«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´ 41 * æ¥çã¾ãã¯éæ¥çã«çãããããªãæ害ã«é¢ãã¦ãï¼ãã®è²¬ä»»ãè² ããªãï¼ 34 42 * 35 43 * @(#) $Id$ … … 39 47 #define _IP_IGMP_H_ 40 48 41 #define NUM_IGMP_ENTRY 5 /* }`LXgO[vÌGg */ 42 43 #ifdef __CA850__ 44 #pragma pack(1) 45 #elif __RX 46 #pragma pack 47 #elif _MSC_VER 48 #pragma pack(push, 1) 49 #endif 49 #define NUM_IGMP_ENTRY 5 /* ãã«ããã£ã¹ãã°ã«ã¼ãã®ã¨ã³ããªæ° */ 50 50 51 51 /* 52 * IGMPv1 wb_Ìè`ARFC 111252 * IGMPv1 ãããã®å®ç¾©ãRFC 1112 53 53 */ 54 54 55 55 typedef struct t_igmpv1_hdr 56 56 { 57 uint8_t type; /* bZ[WÌ^*/58 uint8_t unused; /* ¢gp*/59 uint16_t sum; /* `FbNT*/60 T_IN4_ADDR addr; /* O[vAhX*/61 } T_IGMPV1_HDR;57 uint8_t type; /* ã¡ãã»ã¼ã¸ã®å */ 58 uint8_t unused; /* æªä½¿ç¨ */ 59 uint16_t sum; /* ãã§ãã¯ãµã */ 60 T_IN4_ADDR addr; /* ã°ã«ã¼ãã¢ãã¬ã¹ */ 61 } __attribute__((packed)) T_IGMPV1_HDR; 62 62 63 63 /* 64 * IGMPv2 wb_Ìè`ARFC 223664 * IGMPv2 ãããã®å®ç¾©ãRFC 2236 65 65 */ 66 66 67 67 typedef struct t_igmpv2_hdr 68 68 { 69 uint8_t type; /* bZ[WÌ^*/70 uint8_t time; /* ÅåÔ*/71 uint16_t sum; /* `FbNT*/72 T_IN4_ADDR addr; /* O[vAhX*/73 } T_IGMPV2_HDR;69 uint8_t type; /* ã¡ãã»ã¼ã¸ã®å */ 70 uint8_t time; /* æ大å¿çæé */ 71 uint16_t sum; /* ãã§ãã¯ãµã */ 72 T_IN4_ADDR addr; /* ã°ã«ã¼ãã¢ãã¬ã¹ */ 73 } __attribute__((packed)) T_IGMPV2_HDR; 74 74 75 75 typedef struct t_igmpv3_query_hdr 76 76 { 77 uint8_t type; /* bZ[WÌ^*/78 uint8_t time; /* ÅåÔ*/79 uint16_t sum; /* `FbNT*/80 T_IN4_ADDR grpaddr; /* O[vAhX*/81 uint8_t sqrv; /* S tOAQuerier Robustness Value */77 uint8_t type; /* ã¡ãã»ã¼ã¸ã®å */ 78 uint8_t time; /* æ大å¿çæé */ 79 uint16_t sum; /* ãã§ãã¯ãµã */ 80 T_IN4_ADDR grpaddr; /* ã°ã«ã¼ãã¢ãã¬ã¹ */ 81 uint8_t sqrv; /* Sãã©ã°ãQuerier Robustness Value */ 82 82 uint8_t qqic; /* Qurier's Query Interval Code */ 83 uint16_t num; /* M³Ì */ 84 T_IN4_ADDR sdraddr; /* M³AhX */ 85 } T_IGMPV3Q_HDR; 83 uint16_t num; /* éä¿¡å 84 ã®æ° */ 85 T_IN4_ADDR sdraddr; /* éä¿¡å 86 ã¢ãã¬ã¹ */ 87 } __attribute__((packed)) T_IGMPV3Q_HDR; 86 88 87 89 typedef struct t_igmp_group_record 88 90 { 89 uint8_t type; /* bZ[WÌ^ */ 90 uint8_t len; /* âf[^· */ 91 uint16_t num; /* M³Ì */ 92 T_IN4_ADDR grpaddr; /* O[vAhX */ 93 T_IN4_ADDR sdraddr; /* M³AhX */ 94 /* âf[^ */ 95 } T_IGMP_GROUP_RECORD; 91 uint8_t type; /* ã¡ãã»ã¼ã¸ã®å */ 92 uint8_t len; /* è£å©ãã¼ã¿é· */ 93 uint16_t num; /* éä¿¡å 94 ã®æ° */ 95 T_IN4_ADDR grpaddr; /* ã°ã«ã¼ãã¢ãã¬ã¹ */ 96 T_IN4_ADDR sdraddr; /* éä¿¡å 97 ã¢ãã¬ã¹ */ 98 /* è£å©ãã¼ã¿ */ 99 } __attribute__((packed)) T_IGMP_GROUP_RECORD; 96 100 97 101 typedef struct t_igmpv3_report_hdr 98 102 { 99 uint8_t type; /* bZ[WÌ^ */ 100 uint8_t rsv1; /* \ñ */ 101 uint16_t sum; /* `FbNT */ 102 uint16_t rsv2; /* \ñ */ 103 uint16_t num; /* O[vR[hÌ */ 104 T_IGMP_GROUP_RECORD record; /* O[vR[h */ 105 } T_IGMPV3R_HDR; 106 107 #ifdef __CA850__ 108 #pragma pack(8) 109 #elif __RX 110 #pragma unpack 111 #elif _MSC_VER 112 #pragma pack(pop) 113 #endif 103 uint8_t type; /* ã¡ãã»ã¼ã¸ã®å */ 104 uint8_t rsv1; /* äºç´ */ 105 uint16_t sum; /* ãã§ãã¯ãµã */ 106 uint16_t rsv2; /* äºç´ */ 107 uint16_t num; /* ã°ã«ã¼ãã¬ã³ã¼ãã®æ° */ 108 T_IGMP_GROUP_RECORD record; /* ã°ã«ã¼ãã¬ã³ã¼ã */ 109 } __attribute__((packed)) T_IGMPV3R_HDR; 114 110 115 111 #define IGMP_HDR_SIZE (sizeof(T_IGMPV1_HDR)) … … 125 121 126 122 /* 127 * bZ[WÌ^123 * ã¡ãã»ã¼ã¸ã®å 128 124 */ 129 125 130 #define IGMP_MEMBERSHIP_QUERY 0x11 /* o[VbvNG[*/131 #define IGMP_MEMBERSHIP_REPORT 0x12 /* o[Vbv|[g*/132 #define IGMP_MEMBERSHIP_REPORT_V2 0x16 /* o[Vbv|[g*/133 #define IGMP_LEAVE_GROUP 0x17 /* [uO[v*/134 #define IGMP_MEMBERSHIP_REPORT_V3 0x22 /* o[Vbv|[g*/126 #define IGMP_MEMBERSHIP_QUERY 0x11 /* ã¡ã³ãã¼ã·ããã¯ã¨ãªã¼ */ 127 #define IGMP_MEMBERSHIP_REPORT 0x12 /* ã¡ã³ãã¼ã·ããã¬ãã¼ã */ 128 #define IGMP_MEMBERSHIP_REPORT_V2 0x16 /* ã¡ã³ãã¼ã·ããã¬ãã¼ã */ 129 #define IGMP_LEAVE_GROUP 0x17 /* ãªã¼ãã°ã«ã¼ã */ 130 #define IGMP_MEMBERSHIP_REPORT_V3 0x22 /* ã¡ã³ãã¼ã·ããã¬ãã¼ã */ 135 131 136 132 /* 137 * UDP ÊM[_IvV133 * UDPé信端ç¹ãªãã·ã§ã³ 138 134 */ 139 135 … … 168 164 169 165 /* 170 * IGMP O[vGg166 * IGMP ã°ã«ã¼ãã¨ã³ã㪠171 167 */ 172 168 173 169 typedef struct igmp_entry 174 170 { 175 uint16_t timer; /* MÜÅÌÔ[b] */176 uint16_t resptime; /* ÅåÔ[b] */177 T_IN4_ADDR ip_addr; /* IP AhX*/171 int16_t timer; /* éä¿¡ã¾ã§ã®æé[ç§] */ 172 int16_t resptime; /* æ大å¿çæé[ç§] */ 173 T_IN4_ADDR ip_addr; /* IP ã¢ãã¬ã¹ */ 178 174 } T_IGMP_ENTRY; 179 175 -
EcnlProtoTool/trunk/asp3_dcre/tinet/netinet/tcp_input.c
r331 r429 521 521 522 522 /* 相手のアドレスをコピーする。*/ 523 524 #if defined(_IP6_CFG) && defined(_IP4_CFG) 525 526 if (cep->flags & TCP_CEP_FLG_IPV4) { 527 (*cep->p_dstaddr4).ipaddr = ntohl(cep->dstaddr.ipaddr.s6_addr32[3]); 528 (*cep->p_dstaddr4).portno = cep->dstaddr.portno; 529 } 530 else 531 *cep->p_dstaddr = cep->dstaddr; 532 533 #else /* of #if defined(_IP6_CFG) && defined(_IP4_CFG) */ 534 523 535 *cep->p_dstaddr = cep->dstaddr; 536 537 #endif /* of #if defined(_IP6_CFG) && defined(_IP4_CFG) */ 524 538 525 539 if (IS_PTR_DEFINED(cep->callback)) { … … 847 861 848 862 /* 相手のアドレスをコピーする。*/ 863 864 #if defined(_IP6_CFG) && defined(_IP4_CFG) 865 866 if (cep->flags & TCP_CEP_FLG_IPV4) { 867 (*cep->p_dstaddr4).ipaddr = ntohl(cep->dstaddr.ipaddr.s6_addr32[3]); 868 (*cep->p_dstaddr4).portno = cep->dstaddr.portno; 869 } 870 else 871 *cep->p_dstaddr = cep->dstaddr; 872 873 #else /* of #if defined(_IP6_CFG) && defined(_IP4_CFG) */ 874 849 875 *cep->p_dstaddr = cep->dstaddr; 876 877 #endif /* of #if defined(_IP6_CFG) && defined(_IP4_CFG) */ 850 878 851 879 if (IS_PTR_DEFINED(cep->callback)) { … … 1363 1391 NTOHS(tcph->sport); 1364 1392 NTOHS(tcph->dport); 1393 1394 /* SDU 長 より 緊急ポインタが大きい場合 */ 1395 if (tcph->urp > tcph->sum) 1396 goto drop; 1365 1397 1366 1398 find_cep: -
EcnlProtoTool/trunk/asp3_dcre/tinet/netinet/tcp_output.c
r331 r429 369 369 tcph->flags |= TCP_FLG_URG; 370 370 } 371 else 371 else { 372 tcph->urp = 0; 372 373 cep->snd_up = cep->snd_una; 374 } 373 375 374 376 #endif /* of #ifdef TCP_CFG_EXTENTIONS */ -
EcnlProtoTool/trunk/asp3_dcre/tinet/netinet/tcp_subr.c
r331 r429 805 805 806 806 T_TCP_CEP * 807 tcp_drop (T_TCP_CEP *cep, ER err no)807 tcp_drop (T_TCP_CEP *cep, ER err) 808 808 { 809 809 #ifdef SUPPORT_MIB … … 815 815 #endif /* of #ifdef SUPPORT_MIB */ 816 816 817 cep->error = err no;817 cep->error = err; 818 818 if (TCP_FSM_HAVE_RCVD_SYN(cep->fsm_state)) { 819 819 cep->fsm_state = TCP_FSM_CLOSED; -
EcnlProtoTool/trunk/asp3_dcre/tinet/netinet/tcp_timer.h
r331 r429 86 86 */ 87 87 88 #define TCP_SLOW_TMO (ULONG_C(500 )/NET_TIMER_CYCLE) /* 500 [ms] */89 #define TCP_FAST_TMO (ULONG_C(200 )/NET_TIMER_CYCLE) /* 200 [ms] */88 #define TCP_SLOW_TMO (ULONG_C(500000)/NET_TIMER_CYCLE) /* 500,000 [us] */ 89 #define TCP_FAST_TMO (ULONG_C(200000)/NET_TIMER_CYCLE) /* 200,000 [us] */ 90 90 91 #define TCP_SLOW_HZ (ULONG_C(1000 )/TCP_SLOW_TMO/NET_TIMER_CYCLE) /* Hz */91 #define TCP_SLOW_HZ (ULONG_C(1000000)/TCP_SLOW_TMO/NET_TIMER_CYCLE) /* Hz */ 92 92 93 93 /* TCP タイマ値 */ -
EcnlProtoTool/trunk/asp3_dcre/tinet/netinet/tcp_usrreq.c
r331 r429 897 897 898 898 /* tcp_rcv_buf の割当て長をリセットする。*/ 899 cep->rcv_buf_len = 0;899 cep->rcv_buf_len -= len; 900 900 901 901 /* 通信端点のロックを解除する。*/ -
EcnlProtoTool/trunk/asp3_dcre/tinet/netinet/tcp_var.h
r331 r429 505 505 uint8_t idix; /* mpfid のインデックス */ 506 506 uint8_t flags; /* フラグ */ 507 #ifdef IF_ETHER_MULTI_NIC 508 uint8_t conn_pos; 509 #endif 507 510 #ifdef IF_ETHER_NIC_NET_BUF_ALIGN 508 511 uint8_t nalign[IF_ETHER_NIC_NET_BUF_ALIGN]; … … 817 820 extern void tcp_init_iss (void); 818 821 extern T_TCP_CEP *tcp_close (T_TCP_CEP *cep); 819 extern T_TCP_CEP *tcp_drop (T_TCP_CEP *cep, ER err no);822 extern T_TCP_CEP *tcp_drop (T_TCP_CEP *cep, ER err); 820 823 extern void tcp_respond (T_NET_BUF *nbuf, T_TCP_CEP *cep, 821 824 T_TCP_SEQ ack, T_TCP_SEQ seq, uint_t rbfree, uint8_t flags); -
EcnlProtoTool/trunk/asp3_dcre/tinet/netinet/tcpn_usrreq.c
r331 r429 689 689 cep->p_myaddr4 = p_myaddr; 690 690 cep->p_dstaddr = NULL; 691 cep->p_myaddr = N ULL;691 cep->p_myaddr = NADR; 692 692 693 693 #else /* of #if API_PROTO == API_PROTO_IPV4 */ 694 694 695 695 cep->p_dstaddr4 = NULL; 696 cep->p_myaddr4 = N ULL;696 cep->p_myaddr4 = NADR; 697 697 cep->p_dstaddr = p_dstaddr; 698 698 cep->p_myaddr = p_myaddr; -
EcnlProtoTool/trunk/asp3_dcre/tinet/netinet/udp_output.c
r331 r429 182 182 #if defined(_IP6_CFG) && TNUM_UDP6_CEPID > 0 183 183 184 for (ix = tmax_udp6_cepid; ix -- > 0; ) {184 for (ix = TNUM_UDP6_CEPID - 1; ix -- > 0; ) { 185 185 186 186 if (udp6_cep[ix].flags & UDP_CEP_FLG_POST_OUTPUT) { … … 194 194 #if defined(_IP4_CFG) && TNUM_UDP4_CEPID > 0 195 195 196 for (ix = tmax_udp4_cepid; ix -- > 0; ) {196 for (ix = TNUM_UDP4_CEPID - 1; ix -- > 0; ) { 197 197 198 198 if (udp4_cep[ix].flags & UDP_CEP_FLG_POST_OUTPUT) { -
EcnlProtoTool/trunk/asp3_dcre/tinet/netinet/udp_subr.c
r331 r429 146 146 #define UDP_FIND_CEP udp6_find_cep 147 147 #define UDP_NOTIFY udp6_notify 148 #define TMAX_UDP_CEPID tmax_udp6_cepid148 #define TMAX_UDP_CEPID (TNUM_UDP6_CEPID - 1) 149 149 #define UDP_CEP udp6_cep 150 150 #define T_UDP_CEP T_UDP6_CEP … … 183 183 #define UDP_FIND_CEP udp4_find_cep 184 184 #define UDP_NOTIFY udp4_notify 185 #define TMAX_UDP_CEPID tmax_udp4_cepid185 #define TMAX_UDP_CEPID (TNUM_UDP4_CEPID - 1) 186 186 #define T_UDP_CEP T_UDP4_CEP 187 187 #define UDP_CEP udp4_cep -
EcnlProtoTool/trunk/asp3_dcre/tinet/netinet/udp_var.h
r331 r429 101 101 typedef ER (*t_udp_callback)(ID cepid, FN fncd, void *p_parblk); 102 102 103 typedef struct t_udp_rcv_dat_para { 104 uint_t len; 105 T_NET_BUF *input; 106 uint_t off; 107 union { 108 T_IPV4EP rep4; 109 T_IPV6EP rep6; 110 }; 111 } T_UDP_RCV_DAT_PARA; 112 103 113 /* 104 114 * UDP 通信端点 … … 141 151 #endif 142 152 153 #ifdef SUPPORT_IGMP 154 bool_t igmp_loopback; 155 uint8_t igmp_ttl; 156 T_IN4_ADDR igmp_mcaddr; /* */ 157 #endif 158 143 159 } T_UDP6_CEP; 144 160 … … 178 194 ER error; /* 待ち中に発生したエラー */ 179 195 #endif 196 180 197 #ifdef SUPPORT_IGMP 181 198 bool_t igmp_loopback; … … 183 200 T_IN4_ADDR igmp_mcaddr; /* */ 184 201 #endif 202 185 203 } T_UDP4_CEP; 186 204 -
EcnlProtoTool/trunk/asp3_dcre/tinet/netinet/udpn_input.c
r331 r429 88 88 { 89 89 T_UDP_HDR *udph; 90 uint_t len;90 T_UDP_RCV_DAT_PARA para; 91 91 92 92 udph = (T_UDP_HDR *)(input->buf + off); 93 len = (uint_t)(ntohs(udph->ulen) - UDP_HDR_SIZE);93 para.len = (uint_t)(ntohs(udph->ulen) - UDP_HDR_SIZE); 94 94 95 95 if (cep->rcv_tskid != TA_NULL) { /* éãã³ããããã³ã°ã³ã¼ã«ã§ãã³ãã£ã³ã°ä¸ */ … … 111 111 /* ãã¼ã¿ããããã¡ã«ç§»ãã*/ 112 112 memcpy(cep->rcv_data, GET_UDP_SDU(input, off), 113 (size_t)( len < cep->rcv_len ?len : cep->rcv_len));113 (size_t)(para.len < cep->rcv_len ? para.len : cep->rcv_len)); 114 114 syscall(rel_net_buf(input)); 115 115 … … 117 117 118 118 #ifdef TCP_CFG_NON_BLOCKING_COMPAT14 119 (*cep->callback)(GET_UDP_CEPID(cep), TFN_UDP_RCV_DAT, (void*)(uint32_t) len);119 (*cep->callback)(GET_UDP_CEPID(cep), TFN_UDP_RCV_DAT, (void*)(uint32_t)para.len); 120 120 #else 121 (*cep->callback)(GET_UDP_CEPID(cep), TFN_UDP_RCV_DAT, (void*)& len);121 (*cep->callback)(GET_UDP_CEPID(cep), TFN_UDP_RCV_DAT, (void*)¶.len); 122 122 #endif 123 123 else … … 134 134 135 135 #ifdef TCP_CFG_NON_BLOCKING_COMPAT14 136 (*cep->callback)(GET_UDP_CEPID(cep), TEV_UDP_RCV_DAT, (void*)(uint32_t) len);136 (*cep->callback)(GET_UDP_CEPID(cep), TEV_UDP_RCV_DAT, (void*)(uint32_t)para.len); 137 137 #else 138 (*cep->callback)(GET_UDP_CEPID(cep), TEV_UDP_RCV_DAT, (void*)&len); 138 para.input = input; 139 para.off = off; 140 #if API_PROTO == API_PROTO_IPV4 141 para.rep4.portno = ntohs(udph->sport); 142 IN_COPY_TO_HOST(¶.rep4.ipaddr, input); 143 #else 144 para.rep6.portno = ntohs(udph->sport); 145 IN_COPY_TO_HOST(¶.rep6.ipaddr, input); 146 #endif 147 (*cep->callback)(GET_UDP_CEPID(cep), TEV_UDP_RCV_DAT, (void*)¶.len); 139 148 #endif 140 149 /* … … 143 152 * ãã¼ã¿ãèªã¿åºããªãã£ããã¨ã«ãªãã®ã§ãæ¨ã¦ãã 144 153 */ 145 if (cep->cb_netbuf != NULL) 146 syscall(rel_net_buf(cep->cb_netbuf)); 154 if (cep->cb_netbuf != NULL) { 155 if ((input->flags & NB_FLG_NOREL_IFOUT) == 0) 156 syscall(rel_net_buf(cep->cb_netbuf)); 157 cep->cb_netbuf = NULL; 158 } 147 159 } 148 160 else { -
EcnlProtoTool/trunk/asp3_dcre/tinet/netinet/udpn_usrreq.c
r331 r429 322 322 else 323 323 error = UDP_ALLOC_PORT(cep, pk_ccep->myaddr.portno); 324 325 if (error == E_OK) { 326 327 /* UDP é信端ç¹çææ 324 325 if (error == E_OK) { 326 /* UDP é信端ç¹çææ 328 327 å ±ãã³ãã¼ããã*/ 329 cep->cepatr = pk_ccep->cepatr; /* é信端ç¹å±æ§ */330 cep->myaddr.ipaddr = pk_ccep->myaddr.ipaddr; /* èªåã®ã¢ãã¬ã¹ */331 cep->callback = (void*)pk_ccep->callback; /* ã³ã¼ã«ãã㯠*/332 333 /* UDP é信端ç¹ãçææ¸ã¿ã«ããã*/334 cep->flags |= UDP_CEP_FLG_VALID;335 }336 }328 cep->cepatr = pk_ccep->cepatr; /* é信端ç¹å±æ§ */ 329 cep->myaddr.ipaddr = pk_ccep->myaddr.ipaddr; /* èªåã®ã¢ãã¬ã¹ */ 330 cep->callback = (void*)pk_ccep->callback; /* ã³ã¼ã«ãã㯠*/ 331 332 /* UDP é信端ç¹ãçææ¸ã¿ã«ããã*/ 333 cep->flags |= UDP_CEP_FLG_VALID; 334 } 335 } 337 336 338 337 /* é信端ç¹ã®ããã¯ã解é¤ããã*/ … … 426 425 return E_NOEXS; 427 426 #if defined(SUPPORT_INET6) 428 #endif 429 #if defined(SUPPORT_INET4) && defined(SUPPORT_IGMP) && TNUM_UDP4_CEPID > 0 427 #elif defined(SUPPORT_INET4) && defined(SUPPORT_IGMP) && TNUM_UDP4_CEPID > 0 430 428 switch (optname) { 431 429 case IP_MULTICAST_LOOP: … … 503 501 return E_NOEXS; 504 502 #if defined(SUPPORT_INET6) 505 #endif 506 #if defined(SUPPORT_INET4) && defined(SUPPORT_IGMP) && TNUM_UDP4_CEPID > 0 503 #elif defined(SUPPORT_INET4) && defined(SUPPORT_IGMP) && TNUM_UDP4_CEPID > 0 507 504 switch (optname) { 508 505 case IP_MULTICAST_LOOP: -
EcnlProtoTool/trunk/asp3_dcre/tinet/netinet/udpn_usrreq_nblk.c
r331 r429 136 136 137 137 #ifdef TCP_CFG_NON_BLOCKING_COMPAT14 138 (*cep->callback)(GET_UDP_CEPID(cep), TFN_UDP_ RCV_DAT, (void*)error);138 (*cep->callback)(GET_UDP_CEPID(cep), TFN_UDP_CAN_CEP, (void*)error); 139 139 #else 140 (*cep->callback)(GET_UDP_CEPID(cep), TFN_UDP_ RCV_DAT, (void*)&error);140 (*cep->callback)(GET_UDP_CEPID(cep), TFN_UDP_CAN_CEP, (void*)&error); 141 141 #endif 142 142 else -
EcnlProtoTool/trunk/asp3_dcre/tinet/netinet6/in6_subr.c
r331 r429 369 369 370 370 /* IPv6 ヘッダを設定する。*/ 371 if ((error = in6_set_header(*nbuf, len, dstaddr, srcaddr, next, hlim)) != E_OK) 371 if ((error = in6_set_header(*nbuf, len, dstaddr, srcaddr, next, hlim)) != E_OK) { 372 syscall(rel_net_buf(*nbuf)); 373 *nbuf = NULL; 372 374 return error; 375 } 373 376 374 377 /* 4 オクテット境界までパディングで埋める。*/ … … 662 665 * in6_rtredirect -- ルーティング表にエントリを登録する。 663 666 * 664 * 注意: 引数 tmo の単位は [ ms]。667 * 注意: 引数 tmo の単位は [us]。 665 668 */ 666 669 -
EcnlProtoTool/trunk/asp3_dcre/tinet/netinet6/in6_var.h
r331 r429 184 184 * vltime と pltime は、追加/変更してからの相対時間 185 185 */ 186 uint32_t vltime; /* 有効時間 [ ms] */187 uint32_t pltime; /* 推奨有効時間 [ ms] */186 uint32_t vltime; /* 有効時間 [us] */ 187 uint32_t pltime; /* 推奨有効時間 [us] */ 188 188 } __attribute__((packed, aligned(2)))T_IN6_ADDR_LIFETIME; 189 189 -
EcnlProtoTool/trunk/asp3_dcre/tinet/netinet6/ip6_var.h
r331 r429 152 152 uint8_t idix; /* mpfid のインデックス */ 153 153 uint8_t unit; /* インタフェース番号 */ 154 #ifdef IF_ETHER_MULTI_NIC 155 uint8_t conn_pos; 156 #endif 154 157 #ifdef IF_ETHER_NIC_NET_BUF_ALIGN 155 158 uint8_t nalign[IF_ETHER_NIC_NET_BUF_ALIGN]; … … 172 175 uint8_t idix; /* mpfid のインデックス */ 173 176 uint8_t flags; /* フラグ */ 177 #ifdef IF_ETHER_MULTI_NIC 178 uint8_t conn_pos; 179 #endif 174 180 #ifdef IF_ETHER_NIC_NET_BUF_ALIGN 175 181 uint8_t nalign[IF_ETHER_NIC_NET_BUF_ALIGN]; … … 224 230 uint8_t idix; /* mpfid のインデックス */ 225 231 uint8_t flags; /* フラグ */ 232 #ifdef IF_ETHER_MULTI_NIC 233 uint8_t conn_pos; 234 #endif 226 235 #ifdef IF_ETHER_NIC_NET_BUF_ALIGN 227 236 uint8_t nalign[IF_ETHER_NIC_NET_BUF_ALIGN]; -
EcnlProtoTool/trunk/asp3_dcre/tinet/netinet6/nd6.c
r331 r429 353 353 if (nd6_cache[mix].hold != NULL) { 354 354 syscall(rel_net_buf(nd6_cache[mix].hold)); 355 nd6_cache[mix].hold = NULL; 355 356 } 356 357 fix = mix; … … 562 563 if (ln->hold != NULL) { 563 564 syscall(rel_net_buf(ln->hold)); 565 ln->hold = NULL; 564 566 } 565 567 -
EcnlProtoTool/trunk/asp3_dcre/tinet/netinet6/nd6.h
r331 r429 81 81 T_NET_BUF *hold; 82 82 TMO tmout; 83 SYSTIM expire; /* [ ms] 有効時間が切れる時刻 */83 SYSTIM expire; /* [us] 有効時間が切れる時刻 */ 84 84 T_IF_ADDR ifaddr; 85 85 uint8_t state; … … 183 183 typedef struct t_def_router { 184 184 T_IN6_ADDR addr; 185 SYSTIM expire; /* [ ms] 有効時間が切れる時刻 */186 uint32_t lifetime; /* [ ms] 有効時間 */185 SYSTIM expire; /* [us] 有効時間が切れる時刻 */ 186 uint32_t lifetime; /* [us] 有効時間 */ 187 187 uint16_t plistmap; /* プレフィックスマップ */ 188 188 uint8_t flags; /* ルータ通知のフラグ */ -
EcnlProtoTool/trunk/asp3_dcre/tinet/netinet6/nd6_rtr.c
r331 r429 999 999 return; 1000 1000 1001 1002 1003 1004 1005 1001 /* ルータ要請ヘッダを設定する。*/ 1002 rsh = GET_ROUTER_SOLICIT_HDR(output, IF_IP6_ROUTER_SOLICIT_HDR_OFFSET); 1003 rsh->hdr.type = ND_ROUTER_SOLICIT; 1004 rsh->hdr.code = 0; 1005 rsh->nd_rs_reserved = 0; 1006 1006 1007 1007 /* チェックサムを計算する。*/ -
EcnlProtoTool/trunk/asp3_dcre/tinet/tcpip_sym.def
r331 r429 15 15 TMO_UDP_OUTPUT 16 16 TMO_ICMP_OUTPUT 17 TMO_IGMP_OUTPUT 17 18 TMO_ND6_NS_OUTPUT 18 19 TMO_ND6_NA_OUTPUT -
EcnlProtoTool/trunk/asp3_dcre/tinet/tinet.trb
r331 r429 124 124 #include <net/ethernet.h> 125 125 #include <net/net.h> 126 #include <net/net_endian.h> 126 127 #include <net/net_buf.h> 127 128 #include <netinet/in.h> … … 142 143 $tinetCfgC.add(" */") 143 144 $tinetCfgC.add() 144 $includeFiles.each do |file| 145 $tinetCfgC.add("#include #{file}") 146 end 145 GenerateIncludes($tinetCfgC) 147 146 148 147 $tinetCfgC.add() -
EcnlProtoTool/trunk/asp3_dcre/tinet/tinet_asp.cfg
r331 r429 73 73 INCLUDE("netinet/if_ether.cfg"); 74 74 INCLUDE("netinet/ip.cfg"); 75 INCLUDE("netinet/ip_igmp.cfg"); 75 76 INCLUDE("netinet/tcp.cfg"); 76 77 INCLUDE("netinet/udp.cfg"); -
EcnlProtoTool/trunk/asp3_dcre/utils/applyrename.rb
r321 r429 7 7 # Copyright (C) 2003 by Embedded and Real-Time Systems Laboratory 8 8 # Toyohashi Univ. of Technology, JAPAN 9 # Copyright (C) 2004-201 6by Embedded and Real-Time Systems Laboratory9 # Copyright (C) 2004-2017 by Embedded and Real-Time Systems Laboratory 10 10 # Graduate School of Information Science, Nagoya Univ., JAPAN 11 11 # … … 39 39 # の責任を負わない. 40 40 # 41 # $Id $41 # $Id: applyrename.rb 852 2017-11-04 16:19:49Z ertl-hiro $ 42 42 # 43 43 44 Encoding.default_external = 'utf-8' 44 45 require "fileutils" 45 46 -
EcnlProtoTool/trunk/asp3_dcre/utils/genrename.rb
r321 r429 7 7 # Copyright (C) 2003 by Embedded and Real-Time Systems Laboratory 8 8 # Toyohashi Univ. of Technology, JAPAN 9 # Copyright (C) 2005-201 6by Embedded and Real-Time Systems Laboratory9 # Copyright (C) 2005-2017 by Embedded and Real-Time Systems Laboratory 10 10 # Graduate School of Information Science, Nagoya Univ., JAPAN 11 11 # … … 39 39 # の責任を負わない. 40 40 # 41 # $Id $41 # $Id: genrename.rb 852 2017-11-04 16:19:49Z ertl-hiro $ 42 42 # 43 44 Encoding.default_external = 'utf-8' 43 45 44 46 # … … 132 134 fileName = $1.sub(/([>"])$/, "_rename.h\\1") 133 135 includes += "#include #{fileName}\n" 136 elsif /^(_+)(.*)$/ =~ sym 137 generateDefine(outFile, $2, $1) 134 138 elsif sym != "" 135 139 generateDefine(outFile, sym, "") -
EcnlProtoTool/trunk/asp3_dcre/utils/gentest.rb
r331 r429 5 5 # Toyohashi Open Platform for Embedded Real-Time Systems 6 6 # 7 # Copyright (C) 2007-201 6by Embedded and Real-Time Systems Laboratory7 # Copyright (C) 2007-2019 by Embedded and Real-Time Systems Laboratory 8 8 # Graduate School of Information Science, Nagoya Univ., JAPAN 9 9 # … … 44 44 # 45 45 46 Encoding.default_external = 'utf-8' 47 require "pp" 48 require "fileutils" 49 46 50 # 47 51 # 生成動作を決めるための設定 … … 67 71 "ref_mtx" => { 2 => "T_RMTX" }, 68 72 "ref_mbf" => { 2 => "T_RMBF" }, 73 "ref_spn" => { 2 => "T_RSPN" }, 69 74 "get_mpf" => { 2 => "void *" }, 70 75 "pget_mpf" => { 2 => "void *" }, … … 77 82 "get_tid" => { 1 => "ID" }, 78 83 "get_did" => { 1 => "ID" }, 84 "get_pid" => { 1 => "ID" }, 79 85 "get_lod" => { 2 => "uint_t" }, 80 86 "mget_lod" => { 3 => "uint_t" }, 81 87 "get_nth" => { 3 => "ID" }, 82 88 "mget_nth" => { 4 => "ID" }, 89 "ref_mem" => { 2 => "T_RMEM" }, 83 90 "get_ipm" => { 1 => "PRI" }, 84 91 "get_som" => { 1 => "ID" } … … 86 93 87 94 $functionParameters = { 88 "target_hrt_set_event" => "HRTCNT hrtcnt" 95 "target_hrt_set_event" => "HRTCNT hrtcnt", 96 "hook_hrt_set_event" => "HRTCNT hrtcnt" 89 97 } 90 98 … … 98 106 99 107 $functionCheckParameter = { 100 "target_hrt_set_event" => "hrtcnt" 108 "target_hrt_set_event" => "hrtcnt", 109 "hook_hrt_set_event" => "hrtcnt" 101 110 } 102 111 … … 154 163 lines.each do |line| 155 164 @code[@currentCount].push(line) 156 165 end 157 166 end 158 167 … … 174 183 # 処理カウント変数の生成 175 184 if @countFlag 176 print("\nstatic uint_t\t#{@count_var} = 0;\n")185 $outFile.print("\nstatic uint_t\t#{@count_var} = 0;\n") 177 186 end 178 187 … … 180 189 case @puName 181 190 when /^TASK([0-9]*)$/ 182 print("\nvoid\n")183 print("task#{$1}(intptr_t exinf)\n")191 $outFile.print("\nvoid\n") 192 $outFile.print("task#{$1}(intptr_t exinf)\n") 184 193 when /^CYC([0-9]*)$/ 185 print("\nvoid\n")186 print("cyclic#{$1}_handler(intptr_t exinf)\n")194 $outFile.print("\nvoid\n") 195 $outFile.print("cyclic#{$1}_handler(intptr_t exinf)\n") 187 196 when /^ALM([0-9]*)$/ 188 print("\nvoid\n")189 print("alarm#{$1}_handler(intptr_t exinf)\n")197 $outFile.print("\nvoid\n") 198 $outFile.print("alarm#{$1}_handler(intptr_t exinf)\n") 190 199 when /^OVR$/ 191 print("\nvoid\n")192 print("overrun_handler(ID tskid, intptr_t exinf)\n")200 $outFile.print("\nvoid\n") 201 $outFile.print("overrun_handler(ID tskid, intptr_t exinf)\n") 193 202 when /^ISR([0-9]*)$/ 194 print("\nvoid\n")195 print("isr#{$1}(intptr_t exinf)\n")203 $outFile.print("\nvoid\n") 204 $outFile.print("isr#{$1}(intptr_t exinf)\n") 196 205 when /^INTHDR([0-9]*)$/ 197 print("\nvoid\n")198 print("inthdr#{$1}_handler(void)\n")206 $outFile.print("\nvoid\n") 207 $outFile.print("inthdr#{$1}_handler(void)\n") 199 208 when /^CPUEXC([0-9]*)$/ 200 print("\nvoid\n")201 print("cpuexc#{$1}_handler(void *p_excinf)\n")209 $outFile.print("\nvoid\n") 210 $outFile.print("cpuexc#{$1}_handler(void *p_excinf)\n") 202 211 when /^EXTSVC([0-9]*)$/ 203 print("\nER_UINT\n")204 print("extsvc#{$1}_routine")205 print("(intptr_t par1, intptr_t par2, intptr_t par3,\n")206 print("\t\t\t\t\t\t\t\tintptr_t par4, intptr_t par5, ID cdmid)\n")212 $outFile.print("\nER_UINT\n") 213 $outFile.print("extsvc#{$1}_routine") 214 $outFile.print("(intptr_t par1, intptr_t par2, intptr_t par3,\n") 215 $outFile.print("\t\t\t\t\t\t\t\tintptr_t par4, intptr_t par5, ID cdmid)\n") 207 216 else 208 217 if $functionValue[@puName] 209 print("\n#{$functionValue[@puName]}\n")218 $outFile.print("\n#{$functionValue[@puName]}\n") 210 219 else 211 print("\nvoid\n")212 end 213 print(@puName)220 $outFile.print("\nvoid\n") 221 end 222 $outFile.print(@puName) 214 223 if $functionParameters[@puName] 215 print("(#{$functionParameters[@puName]})\n")224 $outFile.print("(#{$functionParameters[@puName]})\n") 216 225 else 217 print("(void)\n")218 end 219 end 220 221 print("{\n")226 $outFile.print("(void)\n") 227 end 228 end 229 230 $outFile.print("{\n") 222 231 223 232 @variableList.each do |varName, varType| 224 233 if /^(.+)\w*\*$/ =~ varType 225 234 varBaseType = $1 226 print("\t#{varBaseType}")227 print(varBaseType.length < 4 ? "\t\t*" : "\t*")235 $outFile.print("\t#{varBaseType}") 236 $outFile.print(varBaseType.length < 4 ? "\t\t*" : "\t*") 228 237 else 229 print("\t#{varType}")230 print(varType.length < 4 ? "\t\t" : "\t")231 end 232 print("#{varName};\n")238 $outFile.print("\t#{varType}") 239 $outFile.print(varType.length < 4 ? "\t\t" : "\t") 240 end 241 $outFile.print("#{varName};\n") 233 242 end 234 243 if @silFlag 235 print("\tSIL_PRE_LOC;\n")236 end 237 print("\n")244 $outFile.print("\tSIL_PRE_LOC;\n") 245 end 246 $outFile.print("\n") 238 247 239 248 if @countFlag 240 print("\tswitch (++#{@count_var}) {\n")249 $outFile.print("\tswitch (++#{@count_var}) {\n") 241 250 @code.keys.sort_by { |c| c.to_i }.each do |count| 242 print("\tcase #{count}:\n")251 $outFile.print("\tcase #{count}:\n") 243 252 @code[count].each do |line| 244 print("\t",line) if line != ""245 print("\n")253 $outFile.print("\t",line) if line != "" 254 $outFile.print("\n") 246 255 end 247 print("\t\tcheck_point(0);\n\n")248 end 249 print("\tdefault:\n")250 print("\t\tcheck_point(0);\n")251 print("\t}\n")256 $outFile.print("\t\tcheck_assert(false);\n\n") 257 end 258 $outFile.print("\tdefault:\n") 259 $outFile.print("\t\tcheck_assert(false);\n") 260 $outFile.print("\t}\n") 252 261 else 253 262 @code[""].each do |line| 254 print(line,"\n")255 end 256 end 257 258 print("\tcheck_point(0);\n")263 $outFile.print(line,"\n") 264 end 265 end 266 267 $outFile.print("\tcheck_assert(false);\n") 259 268 if /^EXTSVC([0-9]*)$/ =~ @puName 260 print("\treturn(E_SYS);\n")269 $outFile.print("\treturn(E_SYS);\n") 261 270 elsif $functionReturn[@pu_nama] 262 print("\treturn(#{$functionReturn[@puName]});\n")263 end 264 print("}\n")271 $outFile.print("\treturn(#{$functionReturn[@puName]});\n") 272 end 273 $outFile.print("}\n") 265 274 end 266 275 end … … 303 312 def testStartCode(pu) 304 313 # テスト開始コードは一度のみ出力する 305 if $startFlag == 0314 if !$startFlag 306 315 pu.append("\ttest_start(__FILE__);", "") 307 $startFlag = 1316 $startFlag = true 308 317 end 309 318 end … … 312 321 # ターゲット依存部関数の振る舞いの読み込み 313 322 # 314 def targetFunction(line, checkNum )323 def targetFunction(line, checkNum, prcid) 315 324 if /^([a-zA-Z_]+)\s*(.*)$/ =~ line 316 325 functionName = $1 … … 333 342 end 334 343 335 pu.append("\tcheck_point (#{checkNum});");344 pu.append("\tcheck_point#{$cpSuffix[prcid]}(#{checkNum});"); 336 345 if param && $functionCheckParameter[functionName] 337 346 pu.append(sprintf("\tcheck_assert(%s == %s);", … … 347 356 348 357 # 358 # チェックポイント番号の処理 359 # 360 def procCheckPoint(prcid, originalCheckNum, oline_list) 361 checkNum = ($lastCheckPoint[prcid] += 1).to_s 362 oline_list.each do |oline| 363 oline.sub!(/#{originalCheckNum}/, "#{checkNum}:") 364 end 365 return(checkNum) 366 end 367 368 # 349 369 # テストスクリプトの読み込み 350 370 # 351 def parseLine(line) 352 if /^==\s*(([a-zA-Z_]+)[0-9]*)(.*)$/ =~ line 371 def parseLine(line, prcid, oline_list) 372 if /^==\s*START(_[a-zA-Z0-9]+)?(.*)$/ =~ line 373 $procFlag = true unless $procFlagEnd 374 $cpSuffix[prcid] = $1 375 elsif /^==\s*(([a-zA-Z_]+)[0-9]*)(.*)$/ =~ line 353 376 # 処理単位の開始 354 $procFlag = 1377 $procFlag = true unless $procFlagEnd 355 378 puName = $1 356 379 line2 = $3 … … 359 382 pu = $puList[puName] = PUCode.new(puName) 360 383 end 361 $currentPu = pu384 $currentPu[prcid] = pu 362 385 363 386 case line2 … … 369 392 pu.setCount("") 370 393 end 371 testStartCode(pu) if /^START/ !~ puName372 elsif $procFlag != 0373 pu = $currentPu 394 testStartCode(pu) 395 elsif $procFlag 396 pu = $currentPu[prcid] 374 397 if /^([0-9]+\:)\s*(.*)$/ =~ line 375 398 # チェックポイント番号の処理 376 originalCheckNum = $1377 399 line = $2 378 checkNum = ($lastCheckPoint += 1).to_s 379 $outputLine.sub!(/#{originalCheckNum}/, "#{checkNum}:") 400 checkNum = procCheckPoint(prcid, $1, oline_list) 380 401 381 402 case line 382 403 when /^END$/ 383 pu.append("\tcheck_finish (#{checkNum});")384 $procFlag = 0404 pu.append("\tcheck_finish#{$cpSuffix[prcid]}(#{checkNum});") 405 $procFlagEnd = true 385 406 return 386 407 when /^HOOK\((.*)\)$/ … … 388 409 return 389 410 when /^\[(.*)\]$/ 390 targetFunction($1, checkNum )411 targetFunction($1, checkNum, prcid) 391 412 return 392 413 else 393 pu.append("\tcheck_point (#{checkNum});")414 pu.append("\tcheck_point#{$cpSuffix[prcid]}(#{checkNum});") 394 415 end 395 416 end … … 402 423 pu.append("\t#{call_string};", "") 403 424 pu.useSil() if /^SIL_..._INT\(\)$/ =~ call_string 425 when /^VAR\(\s*(.*)\s+(.*)\s*\)$/ 426 pu.addVariable($2, $1) 404 427 when /^RETURN((\(.*\))?)$/ 405 428 pu.append("\treturn#{$1};", "") … … 409 432 when /^LABEL\((.*)\)$/ 410 433 pu.append("#{$1}:", "") 434 when /^BARRIER\((.*)\)$/ 435 pu.append("\ttest_barrier(#{$1});", "") 436 when /^((SET|RESET|WAIT|WAIT_WO_RESET|WAIT_RESET)\(.*\))$/ 437 pu.append("\t#{$1};", "") 411 438 when /^([a-z_]+\(.*\))\s*(\-\>\s*([A-Za-z0-9_]*))?\s*$/ 412 439 genServiceCall(pu, $1, $3) … … 428 455 # 429 456 inFileName = ARGV.shift 457 outFileName = inFileName + ".new" 430 458 431 459 # 432 460 # スクリプトファイル読み込み処理 433 461 # 434 $lastCheckPoint = 0 # 最後のチェックポイント番号 435 $procFlag = 0 # スクリプト処理中フラグ 436 $startFlag = 0 # テスト開始コードの出力フラグ 437 $currentPu = nil # 読み込み中の処理単位 438 $puList = {} # 処理単位のリスト 462 $procFlag = false # スクリプト処理中フラグ 463 $procFlagEnd = false # スクリプト処理終了フラグ 464 $startFlag = false # テスト開始コードの出力フラグ 465 $currentPu = {} # 読み込み中の処理単位 466 $puList = {} # 処理単位のリスト 467 $outputLines = [] # 出力すべき行のリストのリスト 468 $cpSuffix = Hash.new("") # チェックポイント関数のサフィックス 469 $lastCheckPoint = Hash.new(0) # 最後のチェックポイント番号 439 470 440 471 begin 441 472 inFile = File.open(inFileName) 473 $outFile = File.open(outFileName, "w") 442 474 rescue Errno::ENOENT, Errno::EACCES => ex 443 475 abort(ex.message) 444 476 end 445 477 478 statements = Hash.new("") 479 oline_lists = Hash.new([]) 446 480 while line = inFile.gets do 447 $outputLine = line.dup 448 line.chomp! 449 line.sub!(/^\s*\*\s*/, "") 450 line.sub!(/\s*\/\/.*$/, "") 451 line.sub!(/\s*\.\.\..*$/, "") 452 453 while line.sub!(/\\$/, "") do 454 line1 = inFile.gets 455 $outputLine += line1.dup 456 line1.chomp! 457 line1.sub!(/^\s*\*\s*/, "") 458 line1.sub!(/\s*\/\/.*$/, "") 459 line1.sub!(/\s*\.\.\..*$/, "") 460 line += line1 461 end 462 parseLine(line) if line != "" 463 print($outputLine) 464 break if /DO NOT DELETE THIS LINE/ =~ $outputLine 481 line.chomp! # 末尾の改行の削除 482 if /DO NOT DELETE THIS LINE/ =~ line 483 $outputLines.push([ line ]) 484 break 485 elsif line =~ /^(\s*\*)(.*)$/ # 行頭のスペースと "*" の削除 486 outputLine = [ $1.dup ] 487 $2.split(/|/, -1).each_with_index do |sline, index| 488 outLine = sline.dup 489 outputLine.push(outLine) 490 sline.sub!(/^\s*/, "") # 先頭のスペースの削除 491 sline.sub!(/\/\/.*$/, "") # // コメントの削除 492 sline.sub!(/\.\.\..*$/, "") # ... コメントの削除 493 494 prcid = index + 1 495 statements[prcid] += sline 496 oline_lists[prcid].push(outLine) 497 next if statements[prcid].sub!(/\\\s*$/, "") # 継続行の場合 498 499 statements[prcid].sub!(/\s*$/, "") # 末尾のスペースの削除 500 if sline !~ /^\s*$/ 501 parseLine(statements[prcid], prcid, oline_lists[prcid]) 502 end 503 statements[prcid] = "" 504 oline_lists[prcid] = [] 505 end 506 $outputLines.push(outputLine) 507 $procFlag = false if $procFlagEnd 508 else 509 $outputLines.push([ line ]) 510 end 511 end 512 $outputLines.each do |outputLine| 513 outputLine.each_with_index do |sline, index| 514 $outFile.print("|") if index > 1 515 $outFile.print(sline); 516 end 517 $outFile.print("\n"); 465 518 end 466 519 … … 471 524 $puList[puName].generateCode() 472 525 end 526 527 # 528 # ファイルの置き換え 529 # 530 FileUtils.move(inFileName, inFileName + ".bak") 531 FileUtils.move(outFileName, inFileName) -
EcnlProtoTool/trunk/asp3_dcre/utils/makerelease.rb
r321 r429 5 5 # Toyohashi Open Platform for Embedded Real-Time Systems 6 6 # 7 # Copyright (C) 2006-201 6by Embedded and Real-Time Systems Laboratory7 # Copyright (C) 2006-2019 by Embedded and Real-Time Systems Laboratory 8 8 # Graduate School of Information Science, Nagoya Univ., JAPAN 9 9 # … … 40 40 # 41 41 42 require "optparse" 43 require "fileutils" 42 44 require "shell" 45 46 # 47 # オプションの定義 48 # 49 # -e <dirname> アーカイブファイルを展開して削除する.dirname 50 # は展開するディレクトリ名(省略可能). 51 52 # 53 # オプションの処理 54 # 55 OptionParser.new("Usage: makerelease.rb [options] MANIFEST-FILE") do |opt| 56 opt.on("-e [dirname]", "expand archive file and delete") do |val| 57 $expandDirname = val 58 end 59 opt.parse!(ARGV) 60 end 43 61 44 62 # … … 108 126 else 109 127 fileName = $prefix + "/" + canonicalPath(baseDirectory + line) 110 if !File.file?("../" + fileName) 111 abort("#{fileName} is not a file .")128 if !File.file?("../" + fileName) && !File.directory?("../" + fileName) 129 abort("#{fileName} is not a file or a directory.") 112 130 elsif $fileList.index(fileName) 113 131 abort("#{fileName} is duplicated.") … … 167 185 archiveName = $package + "-" + $version + ".tar.gz" 168 186 fileListStr = $fileList.join(" ") 169 command = "tar cvfz RELEASE/#{archiveName} -C .. #{fileListStr} \n";187 command = "tar cvfz RELEASE/#{archiveName} -C .. #{fileListStr}"; 170 188 system(command) 171 puts("== RELEASE/#{archiveName} is generated. ==\n") 189 puts("== RELEASE/#{archiveName} is generated. ==") 190 191 # 192 # アーカイブファイルの展開と削除 193 # 194 if defined?($expandDirname) 195 command = "tar xf RELEASE/#{archiveName}; rm RELEASE/#{archiveName}"; 196 system(command) 197 198 dirname = $expandDirname || $prefix 199 if File.exist?(dirname) 200 File.rename(dirname, dirname + ".bak") 201 puts("== '#{dirname}' is renamed to '#{dirname}.bak'. ==") 202 end 203 if !$expandDirname.nil? 204 File.rename($prefix, $expandDirname) 205 end 206 puts("== RELEASE/#{archiveName} is expanded to '#{dirname}'. ==") 207 puts("== RELEASE/#{archiveName} is deleted. ==") 208 end -
EcnlProtoTool/trunk/mbed_api/.cproject
r426 r429 22 22 <option id="toolchain.id" value="gcc-arm-embedded"/> 23 23 <option id="toolchain.version" value="6.3.1.20170620"/> 24 <option id="toolchain.enable" value="false"/> 24 25 </storageModule> 25 26 <storageModule moduleId="cdtBuildSystem" version="4.0.0"> … … 68 69 <listOptionValue builtIn="false" value=""${ProjDirPath}/src""/> 69 70 <listOptionValue builtIn="false" value=""${workspace_loc:/musl-1.1.18/include}""/> 71 <listOptionValue builtIn="false" value=""${workspace_loc:/asp3_dcre/mbed}""/> 70 72 <listOptionValue builtIn="false" value=""${workspace_loc:/asp3_dcre/mbed/common}""/> 71 <listOptionValue builtIn="false" value=""${workspace_loc:/asp3_dcre/mbed/ api}""/>73 <listOptionValue builtIn="false" value=""${workspace_loc:/asp3_dcre/mbed/platform}""/> 72 74 <listOptionValue builtIn="false" value=""${workspace_loc:/asp3_dcre/mbed/hal}""/> 73 75 <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/include}""/> … … 142 144 </configuration> 143 145 </storageModule> 146 <storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/> 144 147 </cproject> -
EcnlProtoTool/trunk/mbed_api/src/mbed_api.c
r331 r429 310 310 } 311 311 312 #include "assert.c" 313 #include "board.c" 314 #include "error.c" 315 #include "gpio.c" 316 #include "lp_ticker_api.c" 312 void hal_critical_section_enter(void) 313 { 314 } 315 316 void hal_critical_section_exit(void) 317 { 318 } 319 320 void us_ticker_fire_interrupt(void) 321 { 322 } 323 324 void us_ticker_free(void) 325 { 326 } 327 328 //#include <pinmap.h> 329 #define LED1 109 330 #include "mbed_assert.c" 331 #include "mbed_board.c" 332 #include "mbed_critical.c" 333 #include "mbed_error.c" 334 #include "mbed_gpio.c" 335 #include "mbed_lp_ticker_api.c" 317 336 #include "mbed_interface.c" 318 #include "pinmap_common.c" 319 //#include "rtc_time.c" 320 #include "semihost_api.c" 321 #include "ticker_api.c" 322 #include "us_ticker_api.c" 323 #include "wait_api.c" 337 #include "mbed_pinmap_common.c" 338 //#include "mbed_rtc_time.c" 339 #include "mbed_semihost_api.c" 340 #include "mbed_ticker_api.c" 341 #include "mbed_us_ticker_api.c" 342 #include "mbed_wait_api_no_rtos.c" 343 344 const ticker_info_t *us_ticker_get_info(void) 345 { 346 return NULL; 347 } -
EcnlProtoTool/trunk/ntshell/Debug/Makefile
r427 r429 6 6 # Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory 7 7 # Toyohashi Univ. of Technology, JAPAN 8 # Copyright (C) 2006-201 6by Embedded and Real-Time Systems Laboratory8 # Copyright (C) 2006-2019 by Embedded and Real-Time Systems Laboratory 9 9 # Graduate School of Information Science, Nagoya Univ., JAPAN 10 10 # … … 96 96 97 97 # 98 # ã·ã¹ãã ãµã¼ãã¹ã³ã¼ã«ã©ã¤ãã©ãªï¼libsyssvc.aï¼ã®ãã£ã¬ã¯ããªå 99 # ï¼ã·ã¹ãã ãµã¼ãã¹ã³ã¼ã«ã©ã¤ãã©ãªãmake対象ã«ããæã¯ï¼ç©ºã«å®ç¾©ããï¼ 100 # 101 SYSSVC_LIB = ../../asp3_dcre/Debug 102 103 # 98 104 # ã«ã¼ãã«ãé¢æ°åä½ã§ã³ã³ãã¤ã«ãããã©ããã®å®ç¾© 99 105 # … … 104 110 # 105 111 OMIT_TECS = 112 113 # 114 # TECSé¢ä¿ãã¡ã¤ã«ã®ãã£ã¬ã¯ããªã®å®ç¾© 115 # 116 TECSDIR = 106 117 107 118 # … … 134 145 135 146 # 136 # ä¾åé¢ä¿ãã¡ã¤ã«ãç½®ããã£ã¬ã¯ããªã®å®ç¾© 137 # 138 DEPDIR = deps 147 # ä¸éãªãã¸ã§ã¯ããã¡ã¤ã«ã¨ä¾åé¢ä¿ãã¡ã¤ã«ãç½®ããã£ã¬ã¯ããªã®å®ç¾© 148 # 149 OBJDIR = obj 150 DEPDIR = obj 139 151 140 152 # … … 165 177 endif 166 178 179 TINETDIR = tinet 180 167 181 # 168 182 # mbedãµã¼ãã¹ã®å®ç¾© … … 175 189 ±éã³ã³ãã¤ã«ãªãã·ã§ã³ã®å®ç¾© 176 190 # 177 COPTS := -g -std=gnu99 $(COPTS)191 COPTS := -g -std=gnu99 -ffunction-sections -fdata-sections $(COPTS) 178 192 ifndef OMIT_WARNING_ALL 179 193 COPTS := -Wall $(COPTS) … … 207 221 APPL_COBJS := main.o fdtable.o io_stub.o socket_stub.o ffarch.o fftime.o tlsf.o diskio.o ff.o sdfs.o ccsbcs.o base64.o http-strings.o http_parser.o httpd.o httpd-fs.o sha1.o websocket.o websocket_fbs.o ntshell.o text_editor.o text_history.o usrcmd.o vtrecv.o vtsend.o ntlibc.o ntstdio.o ntopt.o syscall.o mbedcall.o 208 222 endif 209 APPL_COBJS := $(APPL_COBJS) log_output.o vasyslog.o t_perror.o strerror.o 223 APPL_COBJS := $(APPL_COBJS) log_output.o vasyslog.o t_perror.o strerror.o mbed_stub.o 210 224 APPL_BINOBJS := httpd_fs.o 211 225 APPL_CFLAGS := $(APPL_CFLAGS) … … 214 228 endif 215 229 216 TINETDIR = tinet217 230 ifdef TINETDIR 218 231 # … … 250 263 # ã·ã¹ãã ãµã¼ãã¹ã«é¢ããå®ç¾© 251 264 # 265 ifdef TCINSTALL 266 GCC_PATH = $(TCINSTALL) 267 else 268 GCC_PATH = $(shell which $(CC))/../../ 269 endif 270 MALLOC_LIB = "${GCC_PATH}arm-none-eabi/lib/thumb/v7-ar/fpv3/hard/libc.a" 271 MALLOC_OBJS = lib_a-reent.o lib_a-impure.o lib_a-malloc.o lib_a-mallocr.o lib_a-calloc.o lib_a-callocr.o lib_a-realloc.o lib_a-reallocr.o lib_a-sbrkr.o lib_a-freer.o 272 252 273 SYSSVC_DIRS := $(TECSGENDIR) $(SRCDIR)/tecs_kernel \ 253 274 $(SYSSVC_DIRS) $(SRCDIR)/syssvc 254 275 SYSSVC_ASMOBJS := $(SYSSVC_ASMOBJS) 255 SYSSVC_COBJS := $( INIT_TECS_COBJ) $(TECS_COBJS) $(SYSSVC_COBJS) \256 $(CXXRTS)276 SYSSVC_COBJS := $(SYSSVC_COBJS) $(TECS_COBJS) \ 277 $(INIT_TECS_COBJ) $(CXXRTS) 257 278 SYSSVC_CFLAGS := $(SYSSVC_CFLAGS) 258 INCLUDES := $(INCLUDES) -I$(TECSGENDIR) -I$(SRCDIR)/tecs_kernel 279 INCLUDES := $(INCLUDES) -I$(TECSGENDIR) -I$(SRCDIR)/tecs_kernel -I../../musl-1.1.18/include 280 281 # 282 # ãã¬ã¼ã¹ãã°è¨é²ã®ãµã³ãã«ã³ã¼ãã«é¢ããå®ç¾© 283 # 284 ifdef ENABLE_TRACE 285 COPTS := $(COPTS) -DTOPPERS_ENABLE_TRACE 286 SYSSVC_DIRS := $(SYSSVC_DIRS) $(SRCDIR)/arch/tracelog 287 endif 259 288 260 289 # … … 263 292 .PHONY: all 264 293 ifndef OMIT_TECS 265 all: tecs 294 all: tecs | $(DEPDIR) 266 295 # @$(MAKE) check 267 296 @$(MAKE) check $(OBJNAME).bin … … 279 308 # ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã«é¢ããå®ç¾© 280 309 # 310 CFG_KERNEL := --kernel asp 281 311 ifndef TINETDIR 282 312 CFG_TRB := -T $(TARGETDIR)/target_kernel.trb … … 287 317 CFG_TABS := --api-table $(TINET_ROOT)/tcpip_api.def:tcpip \ 288 318 --api-table $(SRCDIR)/kernel/kernel_api.def:kernel \ 289 --symval-table $( SRCDIR)/tinet/tcpip_sym.def \319 --symval-table $(TINET_ROOT)/tcpip_sym.def \ 290 320 --symval-table $(SRCDIR)/kernel/kernel_sym.def $(CFG_TABS) 291 321 endif 292 322 CFG_ASMOBJS := $(CFG_ASMOBJS) 293 323 CFG_COBJS := kernel_cfg.o $(CFG_COBJS) 294 CFG_OBJS := $(CFG_ASMOBJS) $(CFG_COBJS) 324 CFG_CFLAGS := -DTOPPERS_CB_TYPE_ONLY $(CFG_CFLAGS) 325 295 326 CFG2_OUT_SRCS := kernel_cfg.h kernel_cfg.c $(CFG2_OUT_SRCS) 296 CFG_CFLAGS := -DTOPPERS_CB_TYPE_ONLY $(CFG_CFLAGS)297 327 298 328 # … … 325 355 $(foreach file,$(KERNEL_FCSRCS),$(file:.c=.o)) 326 356 endif 327 ifdef OMIT_OFFSET_H 328 OFFSET_H = 329 else 357 ifdef TARGET_OFFSET_TRB 330 358 OFFSET_H = offset.h 331 359 endif … … 343 371 endif 344 372 ifndef TARGET_TCPIP_TRB 345 TARGET_TCPIP_TRB := $(SRCDIR)/ tinet/tinet.trb373 TARGET_TCPIP_TRB := $(SRCDIR)/$(TINETDIR)/tinet.trb 346 374 endif 347 375 … … 356 384 357 385 # 386 # ä¸éãªãã¸ã§ã¯ããã¡ã¤ã«ãç½®ããã£ã¬ã¯ããªã®å¦ç 387 # 388 APPL_ASMOBJS := $(addprefix $(OBJDIR)/, $(APPL_ASMOBJS)) 389 APPL_CXXOBJS := $(addprefix $(OBJDIR)/, $(APPL_CXXOBJS)) 390 APPL_COBJS := $(addprefix $(OBJDIR)/, $(APPL_COBJS)) 391 APPL_BINOBJS := $(addprefix $(OBJDIR)/, $(APPL_BINOBJS)) 392 SYSSVC_ASMOBJS := $(addprefix $(OBJDIR)/, $(SYSSVC_ASMOBJS)) 393 SYSSVC_COBJS := $(addprefix $(OBJDIR)/, $(SYSSVC_COBJS)) 394 KERNEL_ASMOBJS := $(addprefix $(OBJDIR)/, $(KERNEL_ASMOBJS)) 395 KERNEL_COBJS := $(addprefix $(OBJDIR)/, $(KERNEL_COBJS)) 396 KERNEL_LCOBJS := $(addprefix $(OBJDIR)/, $(KERNEL_LCOBJS)) 397 CFG_ASMOBJS := $(addprefix $(OBJDIR)/, $(CFG_ASMOBJS)) 398 CFG_COBJS := $(addprefix $(OBJDIR)/, $(CFG_COBJS)) 399 CFG_DMY := $(addprefix $(OBJDIR)/, $(CFG_DMY)) 400 MALLOC_OBJS := $(addprefix $(OBJDIR)/, $(MALLOC_OBJS)) 401 402 # 358 403 # ã³ã³ãã¤ã«ã®ããã®å¤æ°ã®å®ç¾© 359 404 # 360 KERNEL_LIB_OBJS = $(KERNEL_ASMOBJS) $(KERNEL_COBJS) $(KERNEL_LCOBJS)405 APPL_OBJS = $(APPL_ASMOBJS) $(APPL_COBJS) $(APPL_CXXOBJS) $(APPL_BINOBJS) 361 406 SYSSVC_OBJS = $(SYSSVC_ASMOBJS) $(SYSSVC_COBJS) $(HIDDEN_OBJS) 362 APPL_OBJS = $(APPL_ASMOBJS) $(APPL_COBJS) $(APPL_CXXOBJS) $(APPL_BINOBJS) 407 KERNEL_LIB_OBJS = $(KERNEL_ASMOBJS) $(KERNEL_COBJS) $(KERNEL_LCOBJS) $(MALLOC_OBJS) 408 CFG_OBJS = $(CFG_ASMOBJS) $(CFG_COBJS) 363 409 ALL_OBJS = $(START_OBJS) $(APPL_OBJS) $(SYSSVC_OBJS) $(CFG_OBJS) \ 364 410 $(END_OBJS) $(HIDDEN_OBJS) … … 372 418 OBJ_LDFLAGS := $(OBJ_LDFLAGS) -L. 373 419 endif 420 ifdef SYSSVC_LIB 421 LIBS_DEP := $(LIBS_DEP) $(SYSSVC_LIB)/libsyssvc.a 422 OBJ_LDFLAGS := $(OBJ_LDFLAGS) -L$(SYSSVC_LIB) 423 REALCLEAN_FILES := $(REALCLEAN_FILES) libsyssvc.a 424 else 425 LIBS_DEP := $(LIBS_DEP) libsyssvc.a 426 OBJ_LDFLAGS := $(OBJ_LDFLAGS) -L. 427 endif 374 428 375 429 ifdef TEXT_START_ADDRESS … … 394 448 tecs $(TECSGEN_SRCS) $(TECS_HEADERS): $(TECSGEN_TIMESTAMP) ; 395 449 $(TECSGEN_TIMESTAMP): $(APPL_CDL) $(TECS_IMPORTS) 396 $(TECSGEN) $< -R $(INCLUDES) --cpp "$( TECS_CPP)" -g $(TECSGENDIR)450 $(TECSGEN) $< -R $(INCLUDES) --cpp "$(subst ", \", $(TECS_CPP))" -g $(TECSGENDIR) 397 451 398 452 # … … 401 455 cfg1_out.c cfg1_out.db: cfg1_out.timestamp ; 402 456 cfg1_out.timestamp: $(APPL_CFG) $(TECSGEN_TIMESTAMP) 403 echo $(CFG_TABS) 404 $(CFG) --pass 1 --kernel asp $(INCLUDES) $(CFG_TABS) \ 457 $(CFG) --pass 1 $(CFG_KERNEL) $(INCLUDES) $(CFG_TABS) \ 405 458 -M $(DEPDIR)/cfg1_out_c.d $(TARGET_KERNEL_CFG) $< 406 459 407 $(CFG1_OUT): $(START_OBJS) cfg1_out.o $(CFG_DMY) $(END_OBJS) $(HIDDEN_OBJS)460 $(CFG1_OUT): $(START_OBJS) $(OBJDIR)/cfg1_out.o $(CFG_DMY) $(END_OBJS) $(HIDDEN_OBJS) 408 461 $(LINK) $(CFLAGS) $(LDFLAGS) $(CFG1_OUT_LDFLAGS) -o $(CFG1_OUT) \ 409 $(START_OBJS) cfg1_out.o $(CFG_DMY) $(END_OBJS)462 $(START_OBJS) $(OBJDIR)/cfg1_out.o $(CFG_DMY) $(LIBS) $(END_OBJS) $(HIDDEN_OBJS) 410 463 411 464 cfg1_out.syms: $(CFG1_OUT) … … 417 470 $(CFG2_OUT_SRCS) cfg2_out.db: kernel_cfg.timestamp ; 418 471 kernel_cfg.timestamp: cfg1_out.db cfg1_out.syms cfg1_out.srec 419 $(CFG) --pass 2 --kernel asp$(INCLUDES) $(CFG_TRB)472 $(CFG) --pass 2 $(CFG_KERNEL) $(INCLUDES) $(CFG_TRB) 420 473 421 474 # … … 424 477 $(OFFSET_H): offset.timestamp ; 425 478 offset.timestamp: cfg1_out.db cfg1_out.syms cfg1_out.srec 426 $(CFG) --pass 2 -O --kernel asp$(INCLUDES) -T $(TARGET_OFFSET_TRB) \479 $(CFG) --pass 2 -O $(CFG_KERNEL) $(INCLUDES) -T $(TARGET_OFFSET_TRB) \ 427 480 --rom-symbol cfg1_out.syms --rom-image cfg1_out.srec 428 481 … … 436 489 437 490 # 491 # ã·ã¹ãã ãµã¼ãã¹ã³ã¼ã«ã©ã¤ãã©ãªãã¡ã¤ã«ã®çæ 492 # 493 libsyssvc.a: $(filter-out $(OBJDIR)/tBannerMain.o, $(SYSSVC_OBJS)) 494 rm -f libsyssvc.a 495 $(AR) -rcs libsyssvc.a $(filter-out $(OBJDIR)/tBannerMain.o, $(SYSSVC_OBJS)) 496 $(RANLIB) libsyssvc.a 497 498 # 499 # 並åmakeã®ããã®ä¾åé¢ä¿ã®å®ç¾© 500 # 501 $(APPL_OBJS) $(filter-out $(CFG_DMY), $(SYSSVC_OBJS)): | kernel_cfg.timestamp 502 $(APPL_ASMOBJS) $(filter-out $(CFG_DMY), $(SYSSVC_ASMOBJS)) $(KERNEL_ASMOBJS) $(CFG_ASMOBJS): \ 503 | offset.timestamp 504 505 # 438 506 # ç¹å¥ãªä¾åé¢ä¿ã®å®ç¾© 439 507 # 440 tBannerMain.o: $(filter-out tBannerMain.o,$(ALL_OBJS)) $(LIBS_DEP) 508 $(OBJDIR)/tBannerMain.o: $(filter-out $(OBJDIR)/tBannerMain.o,$(ALL_OBJS)) \ 509 $(LIBS_DEP) 441 510 442 511 # … … 448 517 -Wl,-Map=$(OBJNAME).map,--cref -Wl,--gc-sections -Wl,-e_kernel__start,--gc-keep-exported=_kernel_istk \ 449 518 $(START_OBJS) $(APPL_OBJS) $(SYSSVC_OBJS) $(CFG_OBJS) \ 450 $(ALL_LIBS) $(END_OBJS) 519 -Wl,--start-group $(ALL_LIBS) -Wl,--end-group $(END_OBJS) 520 521 # 522 # ä¾åé¢ä¿ãã©ã«ãã®ä½æ 523 # 524 $(DEPDIR): 525 mkdir $@ 451 526 452 527 # … … 476 551 check: check.timestamp ; 477 552 check.timestamp: cfg2_out.db $(OBJNAME).syms $(OBJNAME).srec 478 $(CFG) --pass 3 --kernel asp-O $(INCLUDES) -T $(TARGET_CHECK_TRB) \553 $(CFG) --pass 3 $(CFG_KERNEL) -O $(INCLUDES) -T $(TARGET_CHECK_TRB) \ 479 554 --rom-symbol $(OBJNAME).syms --rom-image $(OBJNAME).srec 480 555 @echo "configuration check passed" … … 485 560 .PHONY: clean 486 561 clean: 487 rm -f \#* *~ *.o $(DEPDIR)/*.d $(CLEAN_FILES) check.timestamp562 rm -f \#* *~ $(OBJDIR)/*.o $(DEPDIR)/*.d $(CLEAN_FILES) check.timestamp 488 563 rm -f $(OBJFILE) $(OBJNAME).syms $(OBJNAME).srec $(OBJNAME).bin 489 564 rm -f kernel_cfg.timestamp $(CFG2_OUT_SRCS) cfg2_out.db … … 495 570 rm -f libkernel.a 496 571 endif 572 ifndef SYSSVC_LIB 573 rm -f libsyssvc.a 574 endif 575 rm -f $(MALLOC_OBJS) 497 576 498 577 .PHONY: cleankernel 499 578 cleankernel: 500 579 rm -f $(OFFSET_H) $(KERNEL_LIB_OBJS) 501 rm -f $(KERNEL_LIB_OBJS:%.o=$(DEPDIR)/%.d) 580 rm -f $(KERNEL_LIB_OBJS:$(OBJDIR)/%.o=$(DEPDIR)/%.d) 581 582 .PHONY: cleansyssvc 583 cleansyssvc: 584 rm -f $(SYSSVC_OBJS) 585 rm -f $(SYSSVC_OBJS:$(OBJDIR)/%.o=$(DEPDIR)/%.d) 502 586 503 587 .PHONY: realclean … … 512 596 # ã®ã¿ãä»ãã¦ã³ã³ãã¤ã«ããï¼ 513 597 # 514 ALL_CFG_COBJS = $(CFG_COBJS) cfg1_out.o598 ALL_CFG_COBJS = $(CFG_COBJS) $(OBJDIR)/cfg1_out.o 515 599 ALL_CFG_ASMOBJS = $(CFG_ASMOBJS) 516 600 517 $(ALL_CFG_COBJS): %.o: %.c518 $(CC) -c - MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(CFG_CFLAGS) $<519 520 $(ALL_CFG_COBJS: .o=.s): %.s: %.c521 $(CC) -S $(CFLAGS) $(CFG_CFLAGS) $<522 523 $(ALL_CFG_ASMOBJS): %.o: %.S524 $(CC) -c - MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(CFG_CFLAGS) $<601 $(ALL_CFG_COBJS): $(OBJDIR)/%.o: %.c 602 $(CC) -c -o $@ -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(CFG_CFLAGS) $< 603 604 $(ALL_CFG_COBJS:$(OBJDIR)/%.o=%.s): %.s: %.c 605 $(CC) -S -o $@ $(CFLAGS) $(CFG_CFLAGS) $< 606 607 $(ALL_CFG_ASMOBJS): $(OBJDIR)/%.o: %.S 608 $(CC) -c -o $@ -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(CFG_CFLAGS) $< 525 609 526 610 # … … 574 658 # ã³ã³ãã¤ã«ã«ã¼ã«ã®å®ç¾© 575 659 # 576 $(KERNEL_COBJS): %.o: %.c577 $(CC) -c - MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(KERNEL_CFLAGS) $<578 579 $(KERNEL_COBJS: .o=.s): %.s: %.c580 $(CC) -S $(CFLAGS) $(KERNEL_CFLAGS) $<581 582 $(KERNEL_LCOBJS): %.o:583 $(CC) - DTOPPERS_$(*F) -o $@ -c-MD -MP -MF $(DEPDIR)/$*.d \660 $(KERNEL_COBJS): $(OBJDIR)/%.o: %.c 661 $(CC) -c -o $@ -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(KERNEL_CFLAGS) $< 662 663 $(KERNEL_COBJS:$(OBJDIR)/%.o=%.s): %.s: %.c 664 $(CC) -S -o $@ $(CFLAGS) $(KERNEL_CFLAGS) $< 665 666 $(KERNEL_LCOBJS): $(OBJDIR)/%.o: 667 $(CC) -c -o $@ -DTOPPERS_$(*F) -MD -MP -MF $(DEPDIR)/$*.d \ 584 668 $(CFLAGS) $(KERNEL_CFLAGS) $< 585 669 586 $(KERNEL_LCOBJS:.o=.s): %.s: 587 $(CC) -DTOPPERS_$(*F) -o $@ -S $(CFLAGS) $(KERNEL_CFLAGS) $< 588 589 $(KERNEL_ASMOBJS): %.o: %.S 590 $(CC) -c -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(KERNEL_CFLAGS) $< 591 592 $(SYSSVC_COBJS): %.o: %.c 593 $(CC) -c -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(SYSSVC_CFLAGS) $< 594 595 $(SYSSVC_COBJS:.o=.s): %.s: %.c 596 $(CC) -S $(CFLAGS) $(SYSSVC_CFLAGS) $< 597 598 $(SYSSVC_ASMOBJS): %.o: %.S 599 $(CC) -c -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(SYSSVC_CFLAGS) $< 600 601 $(APPL_COBJS): %.o: %.c 602 $(CC) -c -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(APPL_CFLAGS) $< 603 604 $(APPL_COBJS:.o=.s): %.s: %.c 605 $(CC) -S $(CFLAGS) $(APPL_CFLAGS) $< 606 607 $(APPL_CXXOBJS): %.o: %.cpp 608 $(CXX) -c -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(APPL_CFLAGS) $< 609 610 $(APPL_CXXOBJS:.o=.s): %.s: %.cpp 611 $(CXX) -S $(CFLAGS) $(APPL_CFLAGS) $< 612 613 $(APPL_ASMOBJS): %.o: %.S 614 $(CC) -c -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(APPL_CFLAGS) $< 615 616 $(APPL_BINOBJS): %.o: %.bin 617 $(OBJCOPY) -B arm -I binary -O elf32-littlearm --rename-section .data=.rodata $< $*.o 670 $(KERNEL_LCOBJS:$(OBJDIR)/%.o=%.s): %.s: 671 $(CC) -S -o $@ -DTOPPERS_$(*F) $(CFLAGS) $(KERNEL_CFLAGS) $< 672 673 $(KERNEL_ASMOBJS): $(OBJDIR)/%.o: %.S 674 $(CC) -c -o $@ -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(KERNEL_CFLAGS) $< 675 676 $(SYSSVC_COBJS): $(OBJDIR)/%.o: %.c 677 $(CC) -c -o $@ -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(SYSSVC_CFLAGS) $< 678 679 $(SYSSVC_COBJS:$(OBJDIR)/%.o=%.s): %.s: %.c 680 $(CC) -S -o $@ $(CFLAGS) $(SYSSVC_CFLAGS) $< 681 682 $(SYSSVC_ASMOBJS): $(OBJDIR)/%.o: %.S 683 $(CC) -c -o $@ -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(SYSSVC_CFLAGS) $< 684 685 $(APPL_COBJS): $(OBJDIR)/%.o: %.c 686 $(CC) -c -o $@ -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(APPL_CFLAGS) $< 687 688 $(APPL_COBJS:$(OBJDIR)/%.o=%.s): %.s: %.c 689 $(CC) -S -o $@ $(CFLAGS) $(APPL_CFLAGS) $< 690 691 $(APPL_CXXOBJS): $(OBJDIR)/%.o: %.cpp 692 $(CXX) -c -o $@ -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(APPL_CFLAGS) $< 693 694 $(APPL_CXXOBJS:$(OBJDIR)/%.o=%.s): %.s: %.cpp 695 $(CXX) -S -o $@ $(CFLAGS) $(APPL_CFLAGS) $< 696 697 $(APPL_ASMOBJS): $(OBJDIR)/%.o: %.S 698 $(CC) -c -o $@ -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(APPL_CFLAGS) $< 699 700 $(APPL_BINOBJS): $(OBJDIR)/%.o: %.bin 701 $(OBJCOPY) -B arm -I binary -O elf32-littlearm --rename-section .data=.rodata $< $(OBJDIR)/$*.o 702 703 $(MALLOC_OBJS): $(OBJDIR)/%.o: 704 $(AR) x $(MALLOC_LIB) $(notdir $@) 705 mv $(notdir $@) $@ 618 706 619 707 # 620 708 # ããã©ã«ãã³ã³ãã¤ã«ã«ã¼ã«ãä¸æ¸ã 621 709 # 622 %.o: %.c710 $(OBJDIR)/%.o: %.c 623 711 @echo "*** Default compile rules should not be used." 624 $(CC) -c - MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $<712 $(CC) -c -o $@ -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $< 625 713 626 714 %.s: %.c 627 715 @echo "*** Default compile rules should not be used." 628 $(CC) -S $(CFLAGS) $<629 630 %.o: %.cpp716 $(CC) -S -o $@ $(CFLAGS) $< 717 718 $(OBJDIR)/%.o: %.cpp 631 719 @echo "*** Default compile rules should not be used." 632 $(CXX) -c - MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $<720 $(CXX) -c -o $@ -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $< 633 721 634 722 %.s: %.cpp 635 723 @echo "*** Default compile rules should not be used." 636 $(CXX) -S $(CFLAGS) $<637 638 %.o: %.S724 $(CXX) -S -o $@ $(CFLAGS) $< 725 726 $(OBJDIR)/%.o: %.S 639 727 @echo "*** Default compile rules should not be used." 640 $(CC) -c - MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $<728 $(CC) -c -o $@ -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $< -
EcnlProtoTool/trunk/ntshell/fatfs/sdfs.c
r321 r429 116 116 #include "sdfs.h" 117 117 //#include "mbed_debug.h" 118 #include " wait_api.h"118 #include "mbed_wait_api.h" 119 119 120 120 #define debug(str, ...) -
EcnlProtoTool/trunk/ntshell/src/mbedcall.c
r331 r429 59 59 #include "serial_api.h" 60 60 #include "us_ticker_api.h" 61 #include " wait_api.h"61 #include "mbed_wait_api.h" 62 62 #include "../../mbed_api/src/mbedcall.h" 63 63 -
EcnlProtoTool/trunk/ntshell/src/syscall.c
r331 r429 61 61 // https://os.mbed.com/users/dkato/code/FlashAccess/#652a093cf264 62 62 void flash_access_cache_control(void) { 63 unsigned int assoc; 64 65 /* ==== Cleaning and invalidation of the L1 data cache ==== */ 66 __v7_all_cache(2); 67 __DSB(); 68 69 /* ==== Cleaning and invalidation of the L2 cache ==== */ 70 if (PL310->AUX_CNT & (1<<16)) { 71 assoc = 16; 72 } else { 73 assoc = 8; 74 } 75 PL310->INV_WAY = (1 << assoc) - 1; 76 while(PL310->INV_WAY & ((1 << assoc) - 1)); // poll invalidate 77 PL310->CACHE_SYNC = 0x0; 78 79 /* ==== Invalidate all TLB entries ==== */ 80 __ca9u_inv_tlb_all(); 81 82 /* ==== Invalidate the L1 instruction cache ==== */ 83 __v7_inv_icache_all(); 84 __DSB(); 85 __ISB(); 63 unsigned int assoc; 64 65 /* ==== Cleaning and invalidation of the L1 data cache ==== */ 66 L1C_CleanInvalidateDCacheAll(); 67 __DSB(); 68 69 /* ==== Cleaning and invalidation of the L2 cache ==== */ 70 if (L2C_310->AUX_CNT & (1 << 16)) { 71 assoc = 16; 72 } 73 else { 74 assoc = 8; 75 } 76 L2C_310->INV_WAY = (1 << assoc) - 1; 77 while (L2C_310->INV_WAY & ((1 << assoc) - 1)); // poll invalidate 78 L2C_310->CACHE_SYNC = 0x0; 79 80 /* ==== Invalidate all TLB entries ==== */ 81 MMU_InvalidateTLB(); 82 83 /* ==== Invalidate the L1 instruction cache ==== */ 84 L1C_InvalidateICacheAll(); 85 __DSB(); 86 __ISB(); 86 87 } 87 88 -
EcnlProtoTool/trunk/ntshell/src/tinet_main.cfg
r331 r429 43 43 #include "main.h" 44 44 45 INCLUDE("netinet/ip_igmp.cfg");46 47 45 /* DHCP クライアント */ 48 46 /*INCLUDE("netapp/tinet_dhcp4_cli.cfg");*/
Note:
See TracChangeset
for help on using the changeset viewer.