00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00610 #ifdef DEFINE_ENUM
00611
00614 enum NodeOp_t {
00618
00619
00620
00621
00622
00623 eERROR,
00627
00628
00629
00630
00631
00632
00633 eVCONSTANT,
00637
00638
00639
00640
00641
00642
00643 eRCONSTANT,
00647
00648
00649
00650
00651
00652
00653 eCOMMENT,
00657
00658
00659
00660
00661
00662
00663 eVRQ,
00667
00668
00669
00670
00671
00672
00673 ePRAGMA,
00677
00678
00679
00680
00681
00682
00683
00684 eELIST,
00688
00689
00690
00691
00692
00693
00694
00695 eWIDTH,
00699
00700
00701
00702
00703
00704 eNOP,
00708
00709
00710
00711
00712
00713
00714
00715 eSUB,
00719
00720
00721
00722
00723
00724
00725
00726 eMUL,
00730
00731
00732
00733
00734
00735
00736
00737 eDIV,
00741
00742
00743
00744
00745
00746
00747
00748 ePOW,
00752
00753
00754
00755
00756
00757
00758
00759 eADD,
00763
00764
00765
00766
00767
00768
00769
00770 eLSH,
00774
00775
00776
00777
00778
00779
00780
00781 eRSH,
00785
00786
00787
00788
00789
00790
00791
00792 eLSHA,
00796
00797
00798
00799
00800
00801
00802
00803 eRSHA,
00807
00808
00809
00810
00811
00812
00813
00814 eMOD,
00818
00819
00820
00821
00822
00823
00824
00825 eOR,
00829
00830
00831
00832
00833
00834
00835
00836 eAND,
00840
00841
00842
00843
00844
00845
00846
00847 eANDANDAND,
00851
00852
00853
00854
00855
00856
00857
00858 eXOR,
00862
00863
00864
00865
00866
00867
00868
00869 eXNOR,
00873
00874
00875
00876
00877
00878
00879 eINSTANCE_REF,
00883
00884
00885
00886
00887
00888
00889 eGATE_REF,
00893
00894
00895
00896
00897
00898
00899
00900 eTASK_ENABLE,
00904
00905
00906
00907
00908
00909
00910
00911 eSYSTASK_CALL,
00915
00916
00917
00918
00919
00920
00921
00922 eTIMING_CALL,
00926
00927
00928
00929
00930
00931
00932
00933
00934 eFUNCTION_CALL,
00938
00939
00940
00941
00942
00943
00944
00945 eARRAY,
00949
00950
00951
00952
00953
00954
00955 eNET_REF,
00959
00960
00961
00962
00963
00964
00965 eVAR_REF,
00969
00970
00971
00972
00973
00974
00975 ePARAM_REF,
00979
00980
00981
00982
00983
00984
00985 ePORT_REF,
00989
00990
00991
00992
00993
00994
00995 eFWD_REF,
00999
01000
01001
01002
01003
01004
01005 eGENVAR_REF,
01009
01010
01011
01012
01013
01014
01015 eENUM_REF,
01019
01020
01021
01022
01023
01024
01025 eTYPE_REF,
01029
01030
01031
01032
01033
01034
01035
01036 eNET_DECL,
01040
01041
01042
01043
01044
01045
01046
01047 eVAR_DECL,
01051
01052
01053
01054
01055
01056
01057 ePARAM_DECL,
01061
01062
01063
01064
01065
01066
01067 eSPECPARAM_DECL,
01071
01072
01073
01074
01075
01076
01077 ePORT_DECL,
01081
01082
01083
01084
01085
01086
01087 eGENVAR_DECL,
01091
01092
01093
01094
01095
01096
01097 eTYPEDEF_DECL,
01101
01102
01103
01104
01105
01106
01107
01108 eLIST,
01112
01113
01114
01115
01116
01117
01118
01119 eRANGE,
01123
01124
01125
01126
01127
01128
01129
01130 eSLICE,
01134
01135
01136
01137
01138
01139
01140
01141 ePSLICE,
01145
01146
01147
01148
01149
01150
01151
01152 eMSLICE,
01156
01157
01158
01159
01160
01161
01162 eCVRI,
01166
01167
01168
01169
01170
01171
01172 eCVIR,
01176
01177
01178
01179
01180
01181
01182
01183 eREP,
01187
01188
01189
01190
01191
01192
01193
01194 eCAT,
01198
01199
01200
01201
01202
01203
01204 eUCAT,
01208
01209
01210
01211
01212
01213
01214 eCOM,
01218
01219
01220
01221
01222
01223
01224 eNEG,
01228
01229
01230
01231
01232
01233
01234 ePLUS,
01238
01239
01240
01241
01242
01243
01244 eNOT,
01248
01249
01250
01251
01252
01253
01254
01255 eGT,
01259
01260
01261
01262
01263
01264
01265
01266 eGE,
01270
01271
01272
01273
01274
01275
01276
01277 eLT,
01281
01282
01283
01284
01285
01286
01287
01288 eLE,
01292
01293
01294
01295
01296
01297
01298
01299 eLAND,
01303
01304
01305
01306
01307
01308
01309
01310 eLOR,
01314
01315
01316
01317
01318
01319
01320
01321 eCEQ,
01325
01326
01327
01328
01329
01330
01331
01332 eCNE,
01336
01337
01338
01339
01340
01341
01342
01343 eEQ,
01347
01348
01349
01350
01351
01352
01353
01354 eNE,
01358
01359
01360
01361
01362
01363
01364 eRAND,
01368
01369
01370
01371
01372
01373
01374 eRNAND,
01378
01379
01380
01381
01382
01383
01384 eROR,
01388
01389
01390
01391
01392
01393
01394 eRNOR,
01398
01399
01400
01401
01402
01403
01404 eRXOR,
01408
01409
01410
01411
01412
01413
01414 eRXNOR,
01418
01419
01420
01421
01422
01423
01424
01425
01426 eHOOK,
01430
01431
01432
01433
01434
01435
01436 eINIT,
01440
01441
01442
01443
01444
01445
01446 eALWAYS,
01450
01451
01452
01453
01454
01455
01456 eALWAYS_LATCH,
01460
01461
01462
01463
01464
01465
01466 eALWAYS_FF,
01470
01471
01472
01473
01474
01475
01476 eALWAYS_COMB,
01480
01481
01482
01483
01484
01485
01486
01487 eEVENT,
01491
01492
01493
01494
01495
01496
01497
01498 eBLOCK_REF,
01502
01503
01504
01505
01506
01507
01508
01509 eSPECIFY_REF,
01513
01514
01515
01516
01517
01518
01519
01520
01521 eASSIGN,
01525
01526
01527
01528
01529
01530
01531
01532
01533 eADD_ASSIGN,
01537
01538
01539
01540
01541
01542
01543
01544
01545 eSUB_ASSIGN,
01549
01550
01551
01552
01553
01554
01555
01556
01557 eMUL_ASSIGN,
01561
01562
01563
01564
01565
01566
01567
01568
01569 eDIV_ASSIGN,
01573
01574
01575
01576
01577
01578
01579
01580
01581 eMOD_ASSIGN,
01585
01586
01587
01588
01589
01590
01591
01592
01593 eAND_ASSIGN,
01597
01598
01599
01600
01601
01602
01603
01604
01605 eOR_ASSIGN,
01609
01610
01611
01612
01613
01614
01615
01616
01617 eXOR_ASSIGN,
01621
01622
01623
01624
01625
01626
01627
01628
01629 eLSH_ASSIGN,
01633
01634
01635
01636
01637
01638
01639
01640
01641 eRSH_ASSIGN,
01645
01646
01647
01648
01649
01650
01651
01652
01653 eLSHA_ASSIGN,
01657
01658
01659
01660
01661
01662
01663
01664
01665 eRSHA_ASSIGN,
01669
01670
01671
01672
01673
01674
01675
01676 eFORCE,
01680
01681
01682
01683
01684
01685
01686 eRELEASE,
01690
01691
01692
01693
01694
01695
01696
01697
01698 eNBASSIGN,
01702
01703
01704
01705
01706
01707
01708 ePOSEDGE,
01712
01713
01714
01715
01716
01717
01718 eNEGEDGE,
01722
01723
01724
01725
01726
01727
01728
01729 eEDGE,
01733
01734
01735
01736
01737
01738
01739
01740 eEVOR,
01744
01745
01746
01747
01748
01749
01750
01751 eDELAY,
01755
01756
01757
01758
01759
01760
01761
01762
01763 eMTM,
01767
01768
01769
01770
01771
01772
01773
01774
01775 eIF,
01779
01780
01781
01782
01783
01784
01785 eFOREVER,
01789
01790
01791
01792
01793
01794
01795
01796 eREPEAT,
01800
01801
01802
01803
01804
01805
01806
01807 eWHILE,
01811
01812
01813
01814
01815
01816
01817
01818 eWAIT,
01822
01823
01824
01825
01826
01827
01828
01829
01830
01831 eFOR,
01835
01836
01837
01838
01839
01840
01841
01842 eCASE,
01846
01847
01848
01849
01850
01851
01852
01853 eCASEX,
01857
01858
01859
01860
01861
01862
01863
01864 eCASEZ,
01868
01869
01870
01871
01872
01873
01874
01875 eCASEITEM,
01879
01880
01881
01882
01883
01884
01885
01886
01887
01888 eCASSIGN,
01892
01893
01894
01895
01896
01897
01898
01899 eARG,
01903
01904
01905
01906
01907
01908
01909 eFUNCTION_DEF,
01913
01914
01915
01916
01917
01918
01919 eMODULE_DEF,
01923
01924
01925
01926
01927
01928
01929
01930 eREPEAT_CONTROL,
01934
01935
01936
01937
01938
01939
01940 eDELAY_CONTROL,
01944
01945
01946
01947
01948
01949
01950 eEVENT_CONTROL,
01954
01955
01956
01957
01958
01959
01960 eEXTERNAL_REF,
01964
01965
01966
01967
01968
01969
01970 ePORT_DEF,
01974
01975
01976
01977
01978
01979
01980
01981 eDEFPARAM,
01985
01986
01987
01988
01989
01990
01991
01992
01993
01994
01995
01996
01997 ePATH,
02001
02002
02003
02004
02005
02006
02007
02008
02009 ePATH_ASSIGN,
02013
02014
02015
02016
02017
02018
02019
02020 eIFNONE_PATH_ASSIGN,
02024
02025
02026
02027
02028
02029
02030 eTRIGGER,
02034
02035
02036
02037
02038
02039
02040
02041 ePASSIGN,
02045
02046
02047
02048
02049
02050
02051 eDEASSIGN,
02055
02056
02057
02058
02059
02060
02061 eDISABLE,
02065
02066
02067
02068
02069
02070
02071 eATTRIBUTE,
02075
02076
02077
02078
02079
02080
02081
02082
02083 eGIF,
02087
02088
02089
02090
02091
02092
02093
02094
02095
02096 eGFOR,
02100
02101
02102
02103
02104
02105
02106
02107 eGCASE,
02111
02112
02113
02114
02115
02116
02117 eTABLE,
02121
02122
02123
02124
02125
02126
02127 eTABLE_ENTRY,
02131
02132
02133
02134
02135
02136
02137 eTABLE_SYMBOL,
02141
02142
02143
02144
02145
02146 ePORTLIST_END,
02150
02151
02152
02153
02154
02155
02156
02157 eMACRO_EXPR,
02161
02162
02163
02164
02165
02166
02167
02168
02169 eENUM_SPEC,
02173
02174
02175
02176
02177
02178
02179
02180 eMEMBER,
02184
02185
02186
02187
02188
02189
02190 eRETURN,
02194
02195
02196
02197
02198
02199
02200 ePREINC,
02204
02205
02206
02207
02208
02209
02210 ePOSTINC,
02214
02215
02216
02217
02218
02219
02220 ePREDEC,
02224
02225
02226
02227
02228
02229
02230 ePOSTDEC,
02234
02235
02236
02237
02238
02239
02240
02241 eCAST
02242 };
02243 extern const char* nodeOpName[];
02244 extern const char* nodeOpDescription[];
02245 #endif // DEFINE_ENUM
02246 #ifdef DEFINE_METHODS
02247 const char* nodeOpName[] = {
02248 "ERROR",
02249 "VCONSTANT",
02250 "RCONSTANT",
02251 "COMMENT",
02252 "VRQ",
02253 "PRAGMA",
02254 "ELIST",
02255 "WIDTH",
02256 "NOP",
02257 "SUB",
02258 "MUL",
02259 "DIV",
02260 "POW",
02261 "ADD",
02262 "LSH",
02263 "RSH",
02264 "LSHA",
02265 "RSHA",
02266 "MOD",
02267 "OR",
02268 "AND",
02269 "ANDANDAND",
02270 "XOR",
02271 "XNOR",
02272 "INSTANCE_REF",
02273 "GATE_REF",
02274 "TASK_ENABLE",
02275 "SYSTASK_CALL",
02276 "TIMING_CALL",
02277 "FUNCTION_CALL",
02278 "ARRAY",
02279 "NET_REF",
02280 "VAR_REF",
02281 "PARAM_REF",
02282 "PORT_REF",
02283 "FWD_REF",
02284 "GENVAR_REF",
02285 "ENUM_REF",
02286 "TYPE_REF",
02287 "NET_DECL",
02288 "VAR_DECL",
02289 "PARAM_DECL",
02290 "SPECPARAM_DECL",
02291 "PORT_DECL",
02292 "GENVAR_DECL",
02293 "TYPEDEF_DECL",
02294 "LIST",
02295 "RANGE",
02296 "SLICE",
02297 "PSLICE",
02298 "MSLICE",
02299 "CVRI",
02300 "CVIR",
02301 "REP",
02302 "CAT",
02303 "UCAT",
02304 "COM",
02305 "NEG",
02306 "PLUS",
02307 "NOT",
02308 "GT",
02309 "GE",
02310 "LT",
02311 "LE",
02312 "LAND",
02313 "LOR",
02314 "CEQ",
02315 "CNE",
02316 "EQ",
02317 "NE",
02318 "RAND",
02319 "RNAND",
02320 "ROR",
02321 "RNOR",
02322 "RXOR",
02323 "RXNOR",
02324 "HOOK",
02325 "INIT",
02326 "ALWAYS",
02327 "ALWAYS_LATCH",
02328 "ALWAYS_FF",
02329 "ALWAYS_COMB",
02330 "EVENT",
02331 "BLOCK_REF",
02332 "SPECIFY_REF",
02333 "ASSIGN",
02334 "ADD_ASSIGN",
02335 "SUB_ASSIGN",
02336 "MUL_ASSIGN",
02337 "DIV_ASSIGN",
02338 "MOD_ASSIGN",
02339 "AND_ASSIGN",
02340 "OR_ASSIGN",
02341 "XOR_ASSIGN",
02342 "LSH_ASSIGN",
02343 "RSH_ASSIGN",
02344 "LSHA_ASSIGN",
02345 "RSHA_ASSIGN",
02346 "FORCE",
02347 "RELEASE",
02348 "NBASSIGN",
02349 "POSEDGE",
02350 "NEGEDGE",
02351 "EDGE",
02352 "EVOR",
02353 "DELAY",
02354 "MTM",
02355 "IF",
02356 "FOREVER",
02357 "REPEAT",
02358 "WHILE",
02359 "WAIT",
02360 "FOR",
02361 "CASE",
02362 "CASEX",
02363 "CASEZ",
02364 "CASEITEM",
02365 "CASSIGN",
02366 "ARG",
02367 "FUNCTION_DEF",
02368 "MODULE_DEF",
02369 "REPEAT_CONTROL",
02370 "DELAY_CONTROL",
02371 "EVENT_CONTROL",
02372 "EXTERNAL_REF",
02373 "PORT_DEF",
02374 "DEFPARAM",
02375 "PATH",
02376 "PATH_ASSIGN",
02377 "IFNONE_PATH_ASSIGN",
02378 "TRIGGER",
02379 "PASSIGN",
02380 "DEASSIGN",
02381 "DISABLE",
02382 "ATTRIBUTE",
02383 "GIF",
02384 "GFOR",
02385 "GCASE",
02386 "TABLE",
02387 "TABLE_ENTRY",
02388 "TABLE_SYMBOL",
02389 "PORTLIST_END",
02390 "MACRO_EXPR",
02391 "ENUM_SPEC",
02392 "MEMBER",
02393 "RETURN",
02394 "PREINC",
02395 "POSTINC",
02396 "PREDEC",
02397 "POSTDEC",
02398 "CAST",
02399 NULL
02400 };
02401 const char* nodeOpDescription[] = {
02402 "error node",
02403 "vector constant",
02404 "real constant",
02405 "comment",
02406 "vrq comment",
02407 "program pragma",
02408 "expression list",
02409 "expression width change",
02410 "no operation",
02411 "subtract",
02412 "multiply",
02413 "divide",
02414 "exponent",
02415 "addition",
02416 "logical left shift",
02417 "logical right shift",
02418 "arithmetic left shift",
02419 "arithmetic right shift",
02420 "modulus",
02421 "bitwise or",
02422 "bitwise and",
02423 "triple and",
02424 "bitwise xor",
02425 "bitwise xnor",
02426 "instance reference",
02427 "gate instance",
02428 "call to a task",
02429 "call to enable a systask",
02430 "call to a timing task",
02431 "call to a function",
02432 "dimensioned reference (array/bit select)",
02433 "reference to net",
02434 "reference to variable",
02435 "reference to parameter",
02436 "reference to port",
02437 "reference to a forward declared variable",
02438 "reference to a genvar",
02439 "reference to a enum",
02440 "reference to a type",
02441 "net declaration",
02442 "variable declaration",
02443 "parameter declaration",
02444 "specify parameter declaration",
02445 "port declaration",
02446 "genvar declaration",
02447 "type declaration",
02448 "list of nodes",
02449 "vector decl range specification",
02450 "vector subrange",
02451 "vector subrange with ascending index select",
02452 "vector subrange with descending index select",
02453 "convert real to integer",
02454 "convert integer to real",
02455 "replication operator",
02456 "concatenation operator",
02457 "unary concat",
02458 "bitwise complement",
02459 "negation",
02460 "unary plus",
02461 "logical complement",
02462 "greater than",
02463 "greater than or equal",
02464 "less than",
02465 "less than or equal",
02466 "logical and",
02467 "logical or",
02468 "case equal",
02469 "case not equal",
02470 "equal",
02471 "not equal",
02472 "reduction and",
02473 "reduction nand",
02474 "reduction or",
02475 "reduction nor",
02476 "reduction xor",
02477 "reduction xnor",
02478 "condition expression operator",
02479 "initial block",
02480 "always block",
02481 "always latch block",
02482 "always flip-flop block",
02483 "always combinational logic block",
02484 "event statement",
02485 "statement block",
02486 "specify block",
02487 "procedural assignment",
02488 "procedural assignment with add",
02489 "procedural assignment with subtract",
02490 "procedural assignment with mul",
02491 "procedural assignment with div",
02492 "procedural assignment with mod",
02493 "procedural assignment with bitwise and",
02494 "procedural assignment with bitwise or",
02495 "procedural assignment with bitwise xor",
02496 "procedural assignment with left shift",
02497 "procedural assignment with right shift",
02498 "procedural assignment with left arithmetic shift",
02499 "procedural assignment with right arithmetic shift",
02500 "force statement",
02501 "release statement",
02502 "nonblocking assignment",
02503 "positive event qualifier",
02504 "negative event qualifier",
02505 "edge qualifier",
02506 "event or",
02507 "delay statement",
02508 "min/typ/max expression",
02509 "if statement",
02510 "forever statement",
02511 "repeat statement",
02512 "while statement",
02513 "wait statement",
02514 "for statement",
02515 "case statement",
02516 "casex statement",
02517 "casez statement",
02518 "case item",
02519 "continious assignment",
02520 "port connection",
02521 "function definition",
02522 "module definition",
02523 "repeat control",
02524 "delay control",
02525 "event control",
02526 "external reference",
02527 "port definition",
02528 "defparam statement",
02529 "path statement",
02530 "path assignment statement",
02531 "ifnone path assignment statement",
02532 "event trigger",
02533 "procedural assignment",
02534 "deassign statement",
02535 "disable statement",
02536 "attribute specification",
02537 "structural if statement",
02538 "structural for statement",
02539 "structural case statement",
02540 "udp table",
02541 "udp table entry",
02542 "udp table symbol",
02543 "sentinal at end of port list",
02544 "expression represented by a macro",
02545 "enum specification",
02546 "member reference (structure, class or external",
02547 "return",
02548 "preincrement",
02549 "postincrement",
02550 "predecrement",
02551 "postdecrement",
02552 "data type change",
02553 NULL
02554 };
02555 #endif // DEFINE_METHODS
02556
02557
02558 #ifdef DEFINE_CONSTRUCTOR
02559
02567 inline CNode* cERROR( Coord_t* loc=NULL )
02568 {
02569 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eERROR );
02570 return n;
02571 }
02580 inline CNode* cERROR( CObstack* heap, Coord_t* loc=NULL )
02581 {
02582 CNode* n = new(heap) CNode( loc, eERROR );
02583 return n;
02584 }
02593 inline CNode* cVCONSTANT( CVector* a0, Coord_t* loc=NULL )
02594 {
02595 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eVCONSTANT );
02596 n->Arg<CVector*>(0) = a0;
02597 return n;
02598 }
02608 inline CNode* cVCONSTANT( CObstack* heap, CVector* a0, Coord_t* loc=NULL )
02609 {
02610 CNode* n = new(heap) CNode( loc, eVCONSTANT );
02611 n->Arg<CVector*>(0) = a0;
02612 return n;
02613 }
02622 inline CNode* cRCONSTANT( char* a0, Coord_t* loc=NULL )
02623 {
02624 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eRCONSTANT );
02625 n->Arg<char*>(0) = a0;
02626 return n;
02627 }
02637 inline CNode* cRCONSTANT( CObstack* heap, char* a0, Coord_t* loc=NULL )
02638 {
02639 CNode* n = new(heap) CNode( loc, eRCONSTANT );
02640 n->Arg<char*>(0) = a0;
02641 return n;
02642 }
02651 inline CNode* cCOMMENT( const char* a0, Coord_t* loc=NULL )
02652 {
02653 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eCOMMENT );
02654 n->Arg<const char*>(0) = a0;
02655 return n;
02656 }
02666 inline CNode* cCOMMENT( CObstack* heap, const char* a0, Coord_t* loc=NULL )
02667 {
02668 CNode* n = new(heap) CNode( loc, eCOMMENT );
02669 n->Arg<const char*>(0) = a0;
02670 return n;
02671 }
02680 inline CNode* cVRQ( const char* a0, Coord_t* loc=NULL )
02681 {
02682 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eVRQ );
02683 n->Arg<const char*>(0) = a0;
02684 return n;
02685 }
02695 inline CNode* cVRQ( CObstack* heap, const char* a0, Coord_t* loc=NULL )
02696 {
02697 CNode* n = new(heap) CNode( loc, eVRQ );
02698 n->Arg<const char*>(0) = a0;
02699 return n;
02700 }
02709 inline CNode* cPRAGMA( const char* a0, Coord_t* loc=NULL )
02710 {
02711 CNode* n = new(CNode::CurrentHeap()) CNode( loc, ePRAGMA );
02712 n->Arg<const char*>(0) = a0;
02713 return n;
02714 }
02724 inline CNode* cPRAGMA( CObstack* heap, const char* a0, Coord_t* loc=NULL )
02725 {
02726 CNode* n = new(heap) CNode( loc, ePRAGMA );
02727 n->Arg<const char*>(0) = a0;
02728 return n;
02729 }
02739 inline CNode* cELIST( CNode* a0, CNode* a1, Coord_t* loc=NULL )
02740 {
02741 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eELIST );
02742 n->Arg<CNode*>(0) = a0;
02743 n->Arg<CNode*>(1) = a1;
02744 return n;
02745 }
02756 inline CNode* cELIST( CObstack* heap, CNode* a0, CNode* a1, Coord_t* loc=NULL )
02757 {
02758 CNode* n = new(heap) CNode( loc, eELIST );
02759 n->Arg<CNode*>(0) = a0;
02760 n->Arg<CNode*>(1) = a1;
02761 return n;
02762 }
02772 inline CNode* cWIDTH( CNode* a0, CNode* a1, Coord_t* loc=NULL )
02773 {
02774 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eWIDTH );
02775 n->Arg<CNode*>(0) = a0;
02776 n->Arg<CNode*>(1) = a1;
02777 return n;
02778 }
02789 inline CNode* cWIDTH( CObstack* heap, CNode* a0, CNode* a1, Coord_t* loc=NULL )
02790 {
02791 CNode* n = new(heap) CNode( loc, eWIDTH );
02792 n->Arg<CNode*>(0) = a0;
02793 n->Arg<CNode*>(1) = a1;
02794 return n;
02795 }
02803 inline CNode* cNOP( Coord_t* loc=NULL )
02804 {
02805 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eNOP );
02806 return n;
02807 }
02816 inline CNode* cNOP( CObstack* heap, Coord_t* loc=NULL )
02817 {
02818 CNode* n = new(heap) CNode( loc, eNOP );
02819 return n;
02820 }
02830 inline CNode* cSUB( CNode* a0, CNode* a1, Coord_t* loc=NULL )
02831 {
02832 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eSUB );
02833 n->Arg<CNode*>(0) = a0;
02834 n->Arg<CNode*>(1) = a1;
02835 return n;
02836 }
02847 inline CNode* cSUB( CObstack* heap, CNode* a0, CNode* a1, Coord_t* loc=NULL )
02848 {
02849 CNode* n = new(heap) CNode( loc, eSUB );
02850 n->Arg<CNode*>(0) = a0;
02851 n->Arg<CNode*>(1) = a1;
02852 return n;
02853 }
02863 inline CNode* cMUL( CNode* a0, CNode* a1, Coord_t* loc=NULL )
02864 {
02865 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eMUL );
02866 n->Arg<CNode*>(0) = a0;
02867 n->Arg<CNode*>(1) = a1;
02868 return n;
02869 }
02880 inline CNode* cMUL( CObstack* heap, CNode* a0, CNode* a1, Coord_t* loc=NULL )
02881 {
02882 CNode* n = new(heap) CNode( loc, eMUL );
02883 n->Arg<CNode*>(0) = a0;
02884 n->Arg<CNode*>(1) = a1;
02885 return n;
02886 }
02896 inline CNode* cDIV( CNode* a0, CNode* a1, Coord_t* loc=NULL )
02897 {
02898 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eDIV );
02899 n->Arg<CNode*>(0) = a0;
02900 n->Arg<CNode*>(1) = a1;
02901 return n;
02902 }
02913 inline CNode* cDIV( CObstack* heap, CNode* a0, CNode* a1, Coord_t* loc=NULL )
02914 {
02915 CNode* n = new(heap) CNode( loc, eDIV );
02916 n->Arg<CNode*>(0) = a0;
02917 n->Arg<CNode*>(1) = a1;
02918 return n;
02919 }
02929 inline CNode* cPOW( CNode* a0, CNode* a1, Coord_t* loc=NULL )
02930 {
02931 CNode* n = new(CNode::CurrentHeap()) CNode( loc, ePOW );
02932 n->Arg<CNode*>(0) = a0;
02933 n->Arg<CNode*>(1) = a1;
02934 return n;
02935 }
02946 inline CNode* cPOW( CObstack* heap, CNode* a0, CNode* a1, Coord_t* loc=NULL )
02947 {
02948 CNode* n = new(heap) CNode( loc, ePOW );
02949 n->Arg<CNode*>(0) = a0;
02950 n->Arg<CNode*>(1) = a1;
02951 return n;
02952 }
02962 inline CNode* cADD( CNode* a0, CNode* a1, Coord_t* loc=NULL )
02963 {
02964 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eADD );
02965 n->Arg<CNode*>(0) = a0;
02966 n->Arg<CNode*>(1) = a1;
02967 return n;
02968 }
02979 inline CNode* cADD( CObstack* heap, CNode* a0, CNode* a1, Coord_t* loc=NULL )
02980 {
02981 CNode* n = new(heap) CNode( loc, eADD );
02982 n->Arg<CNode*>(0) = a0;
02983 n->Arg<CNode*>(1) = a1;
02984 return n;
02985 }
02995 inline CNode* cLSH( CNode* a0, CNode* a1, Coord_t* loc=NULL )
02996 {
02997 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eLSH );
02998 n->Arg<CNode*>(0) = a0;
02999 n->Arg<CNode*>(1) = a1;
03000 return n;
03001 }
03012 inline CNode* cLSH( CObstack* heap, CNode* a0, CNode* a1, Coord_t* loc=NULL )
03013 {
03014 CNode* n = new(heap) CNode( loc, eLSH );
03015 n->Arg<CNode*>(0) = a0;
03016 n->Arg<CNode*>(1) = a1;
03017 return n;
03018 }
03028 inline CNode* cRSH( CNode* a0, CNode* a1, Coord_t* loc=NULL )
03029 {
03030 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eRSH );
03031 n->Arg<CNode*>(0) = a0;
03032 n->Arg<CNode*>(1) = a1;
03033 return n;
03034 }
03045 inline CNode* cRSH( CObstack* heap, CNode* a0, CNode* a1, Coord_t* loc=NULL )
03046 {
03047 CNode* n = new(heap) CNode( loc, eRSH );
03048 n->Arg<CNode*>(0) = a0;
03049 n->Arg<CNode*>(1) = a1;
03050 return n;
03051 }
03061 inline CNode* cLSHA( CNode* a0, CNode* a1, Coord_t* loc=NULL )
03062 {
03063 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eLSHA );
03064 n->Arg<CNode*>(0) = a0;
03065 n->Arg<CNode*>(1) = a1;
03066 return n;
03067 }
03078 inline CNode* cLSHA( CObstack* heap, CNode* a0, CNode* a1, Coord_t* loc=NULL )
03079 {
03080 CNode* n = new(heap) CNode( loc, eLSHA );
03081 n->Arg<CNode*>(0) = a0;
03082 n->Arg<CNode*>(1) = a1;
03083 return n;
03084 }
03094 inline CNode* cRSHA( CNode* a0, CNode* a1, Coord_t* loc=NULL )
03095 {
03096 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eRSHA );
03097 n->Arg<CNode*>(0) = a0;
03098 n->Arg<CNode*>(1) = a1;
03099 return n;
03100 }
03111 inline CNode* cRSHA( CObstack* heap, CNode* a0, CNode* a1, Coord_t* loc=NULL )
03112 {
03113 CNode* n = new(heap) CNode( loc, eRSHA );
03114 n->Arg<CNode*>(0) = a0;
03115 n->Arg<CNode*>(1) = a1;
03116 return n;
03117 }
03127 inline CNode* cMOD( CNode* a0, CNode* a1, Coord_t* loc=NULL )
03128 {
03129 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eMOD );
03130 n->Arg<CNode*>(0) = a0;
03131 n->Arg<CNode*>(1) = a1;
03132 return n;
03133 }
03144 inline CNode* cMOD( CObstack* heap, CNode* a0, CNode* a1, Coord_t* loc=NULL )
03145 {
03146 CNode* n = new(heap) CNode( loc, eMOD );
03147 n->Arg<CNode*>(0) = a0;
03148 n->Arg<CNode*>(1) = a1;
03149 return n;
03150 }
03160 inline CNode* cOR( CNode* a0, CNode* a1, Coord_t* loc=NULL )
03161 {
03162 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eOR );
03163 n->Arg<CNode*>(0) = a0;
03164 n->Arg<CNode*>(1) = a1;
03165 return n;
03166 }
03177 inline CNode* cOR( CObstack* heap, CNode* a0, CNode* a1, Coord_t* loc=NULL )
03178 {
03179 CNode* n = new(heap) CNode( loc, eOR );
03180 n->Arg<CNode*>(0) = a0;
03181 n->Arg<CNode*>(1) = a1;
03182 return n;
03183 }
03193 inline CNode* cAND( CNode* a0, CNode* a1, Coord_t* loc=NULL )
03194 {
03195 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eAND );
03196 n->Arg<CNode*>(0) = a0;
03197 n->Arg<CNode*>(1) = a1;
03198 return n;
03199 }
03210 inline CNode* cAND( CObstack* heap, CNode* a0, CNode* a1, Coord_t* loc=NULL )
03211 {
03212 CNode* n = new(heap) CNode( loc, eAND );
03213 n->Arg<CNode*>(0) = a0;
03214 n->Arg<CNode*>(1) = a1;
03215 return n;
03216 }
03226 inline CNode* cANDANDAND( CNode* a0, CNode* a1, Coord_t* loc=NULL )
03227 {
03228 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eANDANDAND );
03229 n->Arg<CNode*>(0) = a0;
03230 n->Arg<CNode*>(1) = a1;
03231 return n;
03232 }
03243 inline CNode* cANDANDAND( CObstack* heap, CNode* a0, CNode* a1, Coord_t* loc=NULL )
03244 {
03245 CNode* n = new(heap) CNode( loc, eANDANDAND );
03246 n->Arg<CNode*>(0) = a0;
03247 n->Arg<CNode*>(1) = a1;
03248 return n;
03249 }
03259 inline CNode* cXOR( CNode* a0, CNode* a1, Coord_t* loc=NULL )
03260 {
03261 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eXOR );
03262 n->Arg<CNode*>(0) = a0;
03263 n->Arg<CNode*>(1) = a1;
03264 return n;
03265 }
03276 inline CNode* cXOR( CObstack* heap, CNode* a0, CNode* a1, Coord_t* loc=NULL )
03277 {
03278 CNode* n = new(heap) CNode( loc, eXOR );
03279 n->Arg<CNode*>(0) = a0;
03280 n->Arg<CNode*>(1) = a1;
03281 return n;
03282 }
03292 inline CNode* cXNOR( CNode* a0, CNode* a1, Coord_t* loc=NULL )
03293 {
03294 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eXNOR );
03295 n->Arg<CNode*>(0) = a0;
03296 n->Arg<CNode*>(1) = a1;
03297 return n;
03298 }
03309 inline CNode* cXNOR( CObstack* heap, CNode* a0, CNode* a1, Coord_t* loc=NULL )
03310 {
03311 CNode* n = new(heap) CNode( loc, eXNOR );
03312 n->Arg<CNode*>(0) = a0;
03313 n->Arg<CNode*>(1) = a1;
03314 return n;
03315 }
03324 inline CNode* cINSTANCE_REF( CInstance* a0, Coord_t* loc=NULL )
03325 {
03326 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eINSTANCE_REF );
03327 n->Arg<CInstance*>(0) = a0;
03328 return n;
03329 }
03339 inline CNode* cINSTANCE_REF( CObstack* heap, CInstance* a0, Coord_t* loc=NULL )
03340 {
03341 CNode* n = new(heap) CNode( loc, eINSTANCE_REF );
03342 n->Arg<CInstance*>(0) = a0;
03343 return n;
03344 }
03353 inline CNode* cGATE_REF( CGate* a0, Coord_t* loc=NULL )
03354 {
03355 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eGATE_REF );
03356 n->Arg<CGate*>(0) = a0;
03357 return n;
03358 }
03368 inline CNode* cGATE_REF( CObstack* heap, CGate* a0, Coord_t* loc=NULL )
03369 {
03370 CNode* n = new(heap) CNode( loc, eGATE_REF );
03371 n->Arg<CGate*>(0) = a0;
03372 return n;
03373 }
03383 inline CNode* cTASK_ENABLE( CSymbol* a0, CNode* a1, Coord_t* loc=NULL )
03384 {
03385 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eTASK_ENABLE );
03386 n->Arg<CSymbol*>(0) = a0;
03387 n->Arg<CNode*>(1) = a1;
03388 return n;
03389 }
03400 inline CNode* cTASK_ENABLE( CObstack* heap, CSymbol* a0, CNode* a1, Coord_t* loc=NULL )
03401 {
03402 CNode* n = new(heap) CNode( loc, eTASK_ENABLE );
03403 n->Arg<CSymbol*>(0) = a0;
03404 n->Arg<CNode*>(1) = a1;
03405 return n;
03406 }
03416 inline CNode* cSYSTASK_CALL( CSymbol* a0, CNode* a1, Coord_t* loc=NULL )
03417 {
03418 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eSYSTASK_CALL );
03419 n->Arg<CSymbol*>(0) = a0;
03420 n->Arg<CNode*>(1) = a1;
03421 return n;
03422 }
03433 inline CNode* cSYSTASK_CALL( CObstack* heap, CSymbol* a0, CNode* a1, Coord_t* loc=NULL )
03434 {
03435 CNode* n = new(heap) CNode( loc, eSYSTASK_CALL );
03436 n->Arg<CSymbol*>(0) = a0;
03437 n->Arg<CNode*>(1) = a1;
03438 return n;
03439 }
03449 inline CNode* cTIMING_CALL( CSymbol* a0, CNode* a1, Coord_t* loc=NULL )
03450 {
03451 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eTIMING_CALL );
03452 n->Arg<CSymbol*>(0) = a0;
03453 n->Arg<CNode*>(1) = a1;
03454 return n;
03455 }
03466 inline CNode* cTIMING_CALL( CObstack* heap, CSymbol* a0, CNode* a1, Coord_t* loc=NULL )
03467 {
03468 CNode* n = new(heap) CNode( loc, eTIMING_CALL );
03469 n->Arg<CSymbol*>(0) = a0;
03470 n->Arg<CNode*>(1) = a1;
03471 return n;
03472 }
03483 inline CNode* cFUNCTION_CALL( CSymbol* a0, CNode* a1, CScope* a2, Coord_t* loc=NULL )
03484 {
03485 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eFUNCTION_CALL );
03486 n->Arg<CSymbol*>(0) = a0;
03487 n->Arg<CNode*>(1) = a1;
03488 n->Arg<CScope*>(2) = a2;
03489 return n;
03490 }
03502 inline CNode* cFUNCTION_CALL( CObstack* heap, CSymbol* a0, CNode* a1, CScope* a2, Coord_t* loc=NULL )
03503 {
03504 CNode* n = new(heap) CNode( loc, eFUNCTION_CALL );
03505 n->Arg<CSymbol*>(0) = a0;
03506 n->Arg<CNode*>(1) = a1;
03507 n->Arg<CScope*>(2) = a2;
03508 return n;
03509 }
03519 inline CNode* cARRAY( CNode* a0, CNode* a1, Coord_t* loc=NULL )
03520 {
03521 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eARRAY );
03522 n->Arg<CNode*>(0) = a0;
03523 n->Arg<CNode*>(1) = a1;
03524 return n;
03525 }
03536 inline CNode* cARRAY( CObstack* heap, CNode* a0, CNode* a1, Coord_t* loc=NULL )
03537 {
03538 CNode* n = new(heap) CNode( loc, eARRAY );
03539 n->Arg<CNode*>(0) = a0;
03540 n->Arg<CNode*>(1) = a1;
03541 return n;
03542 }
03551 inline CNode* cNET_REF( CNet* a0, Coord_t* loc=NULL )
03552 {
03553 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eNET_REF );
03554 n->Arg<CNet*>(0) = a0;
03555 return n;
03556 }
03566 inline CNode* cNET_REF( CObstack* heap, CNet* a0, Coord_t* loc=NULL )
03567 {
03568 CNode* n = new(heap) CNode( loc, eNET_REF );
03569 n->Arg<CNet*>(0) = a0;
03570 return n;
03571 }
03580 inline CNode* cVAR_REF( CVar* a0, Coord_t* loc=NULL )
03581 {
03582 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eVAR_REF );
03583 n->Arg<CVar*>(0) = a0;
03584 return n;
03585 }
03595 inline CNode* cVAR_REF( CObstack* heap, CVar* a0, Coord_t* loc=NULL )
03596 {
03597 CNode* n = new(heap) CNode( loc, eVAR_REF );
03598 n->Arg<CVar*>(0) = a0;
03599 return n;
03600 }
03609 inline CNode* cPARAM_REF( CParam* a0, Coord_t* loc=NULL )
03610 {
03611 CNode* n = new(CNode::CurrentHeap()) CNode( loc, ePARAM_REF );
03612 n->Arg<CParam*>(0) = a0;
03613 return n;
03614 }
03624 inline CNode* cPARAM_REF( CObstack* heap, CParam* a0, Coord_t* loc=NULL )
03625 {
03626 CNode* n = new(heap) CNode( loc, ePARAM_REF );
03627 n->Arg<CParam*>(0) = a0;
03628 return n;
03629 }
03638 inline CNode* cPORT_REF( CPortDir* a0, Coord_t* loc=NULL )
03639 {
03640 CNode* n = new(CNode::CurrentHeap()) CNode( loc, ePORT_REF );
03641 n->Arg<CPortDir*>(0) = a0;
03642 return n;
03643 }
03653 inline CNode* cPORT_REF( CObstack* heap, CPortDir* a0, Coord_t* loc=NULL )
03654 {
03655 CNode* n = new(heap) CNode( loc, ePORT_REF );
03656 n->Arg<CPortDir*>(0) = a0;
03657 return n;
03658 }
03667 inline CNode* cFWD_REF( CFref* a0, Coord_t* loc=NULL )
03668 {
03669 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eFWD_REF );
03670 n->Arg<CFref*>(0) = a0;
03671 return n;
03672 }
03682 inline CNode* cFWD_REF( CObstack* heap, CFref* a0, Coord_t* loc=NULL )
03683 {
03684 CNode* n = new(heap) CNode( loc, eFWD_REF );
03685 n->Arg<CFref*>(0) = a0;
03686 return n;
03687 }
03696 inline CNode* cGENVAR_REF( CGenvar* a0, Coord_t* loc=NULL )
03697 {
03698 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eGENVAR_REF );
03699 n->Arg<CGenvar*>(0) = a0;
03700 return n;
03701 }
03711 inline CNode* cGENVAR_REF( CObstack* heap, CGenvar* a0, Coord_t* loc=NULL )
03712 {
03713 CNode* n = new(heap) CNode( loc, eGENVAR_REF );
03714 n->Arg<CGenvar*>(0) = a0;
03715 return n;
03716 }
03725 inline CNode* cENUM_REF( CEnum* a0, Coord_t* loc=NULL )
03726 {
03727 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eENUM_REF );
03728 n->Arg<CEnum*>(0) = a0;
03729 return n;
03730 }
03740 inline CNode* cENUM_REF( CObstack* heap, CEnum* a0, Coord_t* loc=NULL )
03741 {
03742 CNode* n = new(heap) CNode( loc, eENUM_REF );
03743 n->Arg<CEnum*>(0) = a0;
03744 return n;
03745 }
03754 inline CNode* cTYPE_REF( CTypedef* a0, Coord_t* loc=NULL )
03755 {
03756 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eTYPE_REF );
03757 n->Arg<CTypedef*>(0) = a0;
03758 return n;
03759 }
03769 inline CNode* cTYPE_REF( CObstack* heap, CTypedef* a0, Coord_t* loc=NULL )
03770 {
03771 CNode* n = new(heap) CNode( loc, eTYPE_REF );
03772 n->Arg<CTypedef*>(0) = a0;
03773 return n;
03774 }
03784 inline CNode* cNET_DECL( CNet* a0, CNode* a1, Coord_t* loc=NULL )
03785 {
03786 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eNET_DECL );
03787 n->Arg<CNet*>(0) = a0;
03788 n->Arg<CNode*>(1) = a1;
03789 return n;
03790 }
03801 inline CNode* cNET_DECL( CObstack* heap, CNet* a0, CNode* a1, Coord_t* loc=NULL )
03802 {
03803 CNode* n = new(heap) CNode( loc, eNET_DECL );
03804 n->Arg<CNet*>(0) = a0;
03805 n->Arg<CNode*>(1) = a1;
03806 return n;
03807 }
03817 inline CNode* cVAR_DECL( CVar* a0, CNode* a1, Coord_t* loc=NULL )
03818 {
03819 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eVAR_DECL );
03820 n->Arg<CVar*>(0) = a0;
03821 n->Arg<CNode*>(1) = a1;
03822 return n;
03823 }
03834 inline CNode* cVAR_DECL( CObstack* heap, CVar* a0, CNode* a1, Coord_t* loc=NULL )
03835 {
03836 CNode* n = new(heap) CNode( loc, eVAR_DECL );
03837 n->Arg<CVar*>(0) = a0;
03838 n->Arg<CNode*>(1) = a1;
03839 return n;
03840 }
03849 inline CNode* cPARAM_DECL( CParam* a0, Coord_t* loc=NULL )
03850 {
03851 CNode* n = new(CNode::CurrentHeap()) CNode( loc, ePARAM_DECL );
03852 n->Arg<CParam*>(0) = a0;
03853 return n;
03854 }
03864 inline CNode* cPARAM_DECL( CObstack* heap, CParam* a0, Coord_t* loc=NULL )
03865 {
03866 CNode* n = new(heap) CNode( loc, ePARAM_DECL );
03867 n->Arg<CParam*>(0) = a0;
03868 return n;
03869 }
03878 inline CNode* cSPECPARAM_DECL( CParam* a0, Coord_t* loc=NULL )
03879 {
03880 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eSPECPARAM_DECL );
03881 n->Arg<CParam*>(0) = a0;
03882 return n;
03883 }
03893 inline CNode* cSPECPARAM_DECL( CObstack* heap, CParam* a0, Coord_t* loc=NULL )
03894 {
03895 CNode* n = new(heap) CNode( loc, eSPECPARAM_DECL );
03896 n->Arg<CParam*>(0) = a0;
03897 return n;
03898 }
03907 inline CNode* cPORT_DECL( CPortDir* a0, Coord_t* loc=NULL )
03908 {
03909 CNode* n = new(CNode::CurrentHeap()) CNode( loc, ePORT_DECL );
03910 n->Arg<CPortDir*>(0) = a0;
03911 return n;
03912 }
03922 inline CNode* cPORT_DECL( CObstack* heap, CPortDir* a0, Coord_t* loc=NULL )
03923 {
03924 CNode* n = new(heap) CNode( loc, ePORT_DECL );
03925 n->Arg<CPortDir*>(0) = a0;
03926 return n;
03927 }
03936 inline CNode* cGENVAR_DECL( CGenvar* a0, Coord_t* loc=NULL )
03937 {
03938 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eGENVAR_DECL );
03939 n->Arg<CGenvar*>(0) = a0;
03940 return n;
03941 }
03951 inline CNode* cGENVAR_DECL( CObstack* heap, CGenvar* a0, Coord_t* loc=NULL )
03952 {
03953 CNode* n = new(heap) CNode( loc, eGENVAR_DECL );
03954 n->Arg<CGenvar*>(0) = a0;
03955 return n;
03956 }
03965 inline CNode* cTYPEDEF_DECL( CTypedef* a0, Coord_t* loc=NULL )
03966 {
03967 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eTYPEDEF_DECL );
03968 n->Arg<CTypedef*>(0) = a0;
03969 return n;
03970 }
03980 inline CNode* cTYPEDEF_DECL( CObstack* heap, CTypedef* a0, Coord_t* loc=NULL )
03981 {
03982 CNode* n = new(heap) CNode( loc, eTYPEDEF_DECL );
03983 n->Arg<CTypedef*>(0) = a0;
03984 return n;
03985 }
03995 inline CNode* cLIST( CNode* a0, CNode* a1, Coord_t* loc=NULL )
03996 {
03997 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eLIST );
03998 n->Arg<CNode*>(0) = a0;
03999 n->Arg<CNode*>(1) = a1;
04000 return n;
04001 }
04012 inline CNode* cLIST( CObstack* heap, CNode* a0, CNode* a1, Coord_t* loc=NULL )
04013 {
04014 CNode* n = new(heap) CNode( loc, eLIST );
04015 n->Arg<CNode*>(0) = a0;
04016 n->Arg<CNode*>(1) = a1;
04017 return n;
04018 }
04028 inline CNode* cRANGE( CNode* a0, CNode* a1, Coord_t* loc=NULL )
04029 {
04030 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eRANGE );
04031 n->Arg<CNode*>(0) = a0;
04032 n->Arg<CNode*>(1) = a1;
04033 return n;
04034 }
04045 inline CNode* cRANGE( CObstack* heap, CNode* a0, CNode* a1, Coord_t* loc=NULL )
04046 {
04047 CNode* n = new(heap) CNode( loc, eRANGE );
04048 n->Arg<CNode*>(0) = a0;
04049 n->Arg<CNode*>(1) = a1;
04050 return n;
04051 }
04061 inline CNode* cSLICE( CNode* a0, CNode* a1, Coord_t* loc=NULL )
04062 {
04063 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eSLICE );
04064 n->Arg<CNode*>(0) = a0;
04065 n->Arg<CNode*>(1) = a1;
04066 return n;
04067 }
04078 inline CNode* cSLICE( CObstack* heap, CNode* a0, CNode* a1, Coord_t* loc=NULL )
04079 {
04080 CNode* n = new(heap) CNode( loc, eSLICE );
04081 n->Arg<CNode*>(0) = a0;
04082 n->Arg<CNode*>(1) = a1;
04083 return n;
04084 }
04094 inline CNode* cPSLICE( CNode* a0, CNode* a1, Coord_t* loc=NULL )
04095 {
04096 CNode* n = new(CNode::CurrentHeap()) CNode( loc, ePSLICE );
04097 n->Arg<CNode*>(0) = a0;
04098 n->Arg<CNode*>(1) = a1;
04099 return n;
04100 }
04111 inline CNode* cPSLICE( CObstack* heap, CNode* a0, CNode* a1, Coord_t* loc=NULL )
04112 {
04113 CNode* n = new(heap) CNode( loc, ePSLICE );
04114 n->Arg<CNode*>(0) = a0;
04115 n->Arg<CNode*>(1) = a1;
04116 return n;
04117 }
04127 inline CNode* cMSLICE( CNode* a0, CNode* a1, Coord_t* loc=NULL )
04128 {
04129 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eMSLICE );
04130 n->Arg<CNode*>(0) = a0;
04131 n->Arg<CNode*>(1) = a1;
04132 return n;
04133 }
04144 inline CNode* cMSLICE( CObstack* heap, CNode* a0, CNode* a1, Coord_t* loc=NULL )
04145 {
04146 CNode* n = new(heap) CNode( loc, eMSLICE );
04147 n->Arg<CNode*>(0) = a0;
04148 n->Arg<CNode*>(1) = a1;
04149 return n;
04150 }
04159 inline CNode* cCVRI( CNode* a0, Coord_t* loc=NULL )
04160 {
04161 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eCVRI );
04162 n->Arg<CNode*>(0) = a0;
04163 return n;
04164 }
04174 inline CNode* cCVRI( CObstack* heap, CNode* a0, Coord_t* loc=NULL )
04175 {
04176 CNode* n = new(heap) CNode( loc, eCVRI );
04177 n->Arg<CNode*>(0) = a0;
04178 return n;
04179 }
04188 inline CNode* cCVIR( CNode* a0, Coord_t* loc=NULL )
04189 {
04190 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eCVIR );
04191 n->Arg<CNode*>(0) = a0;
04192 return n;
04193 }
04203 inline CNode* cCVIR( CObstack* heap, CNode* a0, Coord_t* loc=NULL )
04204 {
04205 CNode* n = new(heap) CNode( loc, eCVIR );
04206 n->Arg<CNode*>(0) = a0;
04207 return n;
04208 }
04218 inline CNode* cREP( CNode* a0, CNode* a1, Coord_t* loc=NULL )
04219 {
04220 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eREP );
04221 n->Arg<CNode*>(0) = a0;
04222 n->Arg<CNode*>(1) = a1;
04223 return n;
04224 }
04235 inline CNode* cREP( CObstack* heap, CNode* a0, CNode* a1, Coord_t* loc=NULL )
04236 {
04237 CNode* n = new(heap) CNode( loc, eREP );
04238 n->Arg<CNode*>(0) = a0;
04239 n->Arg<CNode*>(1) = a1;
04240 return n;
04241 }
04251 inline CNode* cCAT( CNode* a0, CNode* a1, Coord_t* loc=NULL )
04252 {
04253 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eCAT );
04254 n->Arg<CNode*>(0) = a0;
04255 n->Arg<CNode*>(1) = a1;
04256 return n;
04257 }
04268 inline CNode* cCAT( CObstack* heap, CNode* a0, CNode* a1, Coord_t* loc=NULL )
04269 {
04270 CNode* n = new(heap) CNode( loc, eCAT );
04271 n->Arg<CNode*>(0) = a0;
04272 n->Arg<CNode*>(1) = a1;
04273 return n;
04274 }
04283 inline CNode* cUCAT( CNode* a0, Coord_t* loc=NULL )
04284 {
04285 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eUCAT );
04286 n->Arg<CNode*>(0) = a0;
04287 return n;
04288 }
04298 inline CNode* cUCAT( CObstack* heap, CNode* a0, Coord_t* loc=NULL )
04299 {
04300 CNode* n = new(heap) CNode( loc, eUCAT );
04301 n->Arg<CNode*>(0) = a0;
04302 return n;
04303 }
04312 inline CNode* cCOM( CNode* a0, Coord_t* loc=NULL )
04313 {
04314 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eCOM );
04315 n->Arg<CNode*>(0) = a0;
04316 return n;
04317 }
04327 inline CNode* cCOM( CObstack* heap, CNode* a0, Coord_t* loc=NULL )
04328 {
04329 CNode* n = new(heap) CNode( loc, eCOM );
04330 n->Arg<CNode*>(0) = a0;
04331 return n;
04332 }
04341 inline CNode* cNEG( CNode* a0, Coord_t* loc=NULL )
04342 {
04343 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eNEG );
04344 n->Arg<CNode*>(0) = a0;
04345 return n;
04346 }
04356 inline CNode* cNEG( CObstack* heap, CNode* a0, Coord_t* loc=NULL )
04357 {
04358 CNode* n = new(heap) CNode( loc, eNEG );
04359 n->Arg<CNode*>(0) = a0;
04360 return n;
04361 }
04370 inline CNode* cPLUS( CNode* a0, Coord_t* loc=NULL )
04371 {
04372 CNode* n = new(CNode::CurrentHeap()) CNode( loc, ePLUS );
04373 n->Arg<CNode*>(0) = a0;
04374 return n;
04375 }
04385 inline CNode* cPLUS( CObstack* heap, CNode* a0, Coord_t* loc=NULL )
04386 {
04387 CNode* n = new(heap) CNode( loc, ePLUS );
04388 n->Arg<CNode*>(0) = a0;
04389 return n;
04390 }
04399 inline CNode* cNOT( CNode* a0, Coord_t* loc=NULL )
04400 {
04401 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eNOT );
04402 n->Arg<CNode*>(0) = a0;
04403 return n;
04404 }
04414 inline CNode* cNOT( CObstack* heap, CNode* a0, Coord_t* loc=NULL )
04415 {
04416 CNode* n = new(heap) CNode( loc, eNOT );
04417 n->Arg<CNode*>(0) = a0;
04418 return n;
04419 }
04429 inline CNode* cGT( CNode* a0, CNode* a1, Coord_t* loc=NULL )
04430 {
04431 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eGT );
04432 n->Arg<CNode*>(0) = a0;
04433 n->Arg<CNode*>(1) = a1;
04434 return n;
04435 }
04446 inline CNode* cGT( CObstack* heap, CNode* a0, CNode* a1, Coord_t* loc=NULL )
04447 {
04448 CNode* n = new(heap) CNode( loc, eGT );
04449 n->Arg<CNode*>(0) = a0;
04450 n->Arg<CNode*>(1) = a1;
04451 return n;
04452 }
04462 inline CNode* cGE( CNode* a0, CNode* a1, Coord_t* loc=NULL )
04463 {
04464 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eGE );
04465 n->Arg<CNode*>(0) = a0;
04466 n->Arg<CNode*>(1) = a1;
04467 return n;
04468 }
04479 inline CNode* cGE( CObstack* heap, CNode* a0, CNode* a1, Coord_t* loc=NULL )
04480 {
04481 CNode* n = new(heap) CNode( loc, eGE );
04482 n->Arg<CNode*>(0) = a0;
04483 n->Arg<CNode*>(1) = a1;
04484 return n;
04485 }
04495 inline CNode* cLT( CNode* a0, CNode* a1, Coord_t* loc=NULL )
04496 {
04497 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eLT );
04498 n->Arg<CNode*>(0) = a0;
04499 n->Arg<CNode*>(1) = a1;
04500 return n;
04501 }
04512 inline CNode* cLT( CObstack* heap, CNode* a0, CNode* a1, Coord_t* loc=NULL )
04513 {
04514 CNode* n = new(heap) CNode( loc, eLT );
04515 n->Arg<CNode*>(0) = a0;
04516 n->Arg<CNode*>(1) = a1;
04517 return n;
04518 }
04528 inline CNode* cLE( CNode* a0, CNode* a1, Coord_t* loc=NULL )
04529 {
04530 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eLE );
04531 n->Arg<CNode*>(0) = a0;
04532 n->Arg<CNode*>(1) = a1;
04533 return n;
04534 }
04545 inline CNode* cLE( CObstack* heap, CNode* a0, CNode* a1, Coord_t* loc=NULL )
04546 {
04547 CNode* n = new(heap) CNode( loc, eLE );
04548 n->Arg<CNode*>(0) = a0;
04549 n->Arg<CNode*>(1) = a1;
04550 return n;
04551 }
04561 inline CNode* cLAND( CNode* a0, CNode* a1, Coord_t* loc=NULL )
04562 {
04563 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eLAND );
04564 n->Arg<CNode*>(0) = a0;
04565 n->Arg<CNode*>(1) = a1;
04566 return n;
04567 }
04578 inline CNode* cLAND( CObstack* heap, CNode* a0, CNode* a1, Coord_t* loc=NULL )
04579 {
04580 CNode* n = new(heap) CNode( loc, eLAND );
04581 n->Arg<CNode*>(0) = a0;
04582 n->Arg<CNode*>(1) = a1;
04583 return n;
04584 }
04594 inline CNode* cLOR( CNode* a0, CNode* a1, Coord_t* loc=NULL )
04595 {
04596 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eLOR );
04597 n->Arg<CNode*>(0) = a0;
04598 n->Arg<CNode*>(1) = a1;
04599 return n;
04600 }
04611 inline CNode* cLOR( CObstack* heap, CNode* a0, CNode* a1, Coord_t* loc=NULL )
04612 {
04613 CNode* n = new(heap) CNode( loc, eLOR );
04614 n->Arg<CNode*>(0) = a0;
04615 n->Arg<CNode*>(1) = a1;
04616 return n;
04617 }
04627 inline CNode* cCEQ( CNode* a0, CNode* a1, Coord_t* loc=NULL )
04628 {
04629 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eCEQ );
04630 n->Arg<CNode*>(0) = a0;
04631 n->Arg<CNode*>(1) = a1;
04632 return n;
04633 }
04644 inline CNode* cCEQ( CObstack* heap, CNode* a0, CNode* a1, Coord_t* loc=NULL )
04645 {
04646 CNode* n = new(heap) CNode( loc, eCEQ );
04647 n->Arg<CNode*>(0) = a0;
04648 n->Arg<CNode*>(1) = a1;
04649 return n;
04650 }
04660 inline CNode* cCNE( CNode* a0, CNode* a1, Coord_t* loc=NULL )
04661 {
04662 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eCNE );
04663 n->Arg<CNode*>(0) = a0;
04664 n->Arg<CNode*>(1) = a1;
04665 return n;
04666 }
04677 inline CNode* cCNE( CObstack* heap, CNode* a0, CNode* a1, Coord_t* loc=NULL )
04678 {
04679 CNode* n = new(heap) CNode( loc, eCNE );
04680 n->Arg<CNode*>(0) = a0;
04681 n->Arg<CNode*>(1) = a1;
04682 return n;
04683 }
04693 inline CNode* cEQ( CNode* a0, CNode* a1, Coord_t* loc=NULL )
04694 {
04695 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eEQ );
04696 n->Arg<CNode*>(0) = a0;
04697 n->Arg<CNode*>(1) = a1;
04698 return n;
04699 }
04710 inline CNode* cEQ( CObstack* heap, CNode* a0, CNode* a1, Coord_t* loc=NULL )
04711 {
04712 CNode* n = new(heap) CNode( loc, eEQ );
04713 n->Arg<CNode*>(0) = a0;
04714 n->Arg<CNode*>(1) = a1;
04715 return n;
04716 }
04726 inline CNode* cNE( CNode* a0, CNode* a1, Coord_t* loc=NULL )
04727 {
04728 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eNE );
04729 n->Arg<CNode*>(0) = a0;
04730 n->Arg<CNode*>(1) = a1;
04731 return n;
04732 }
04743 inline CNode* cNE( CObstack* heap, CNode* a0, CNode* a1, Coord_t* loc=NULL )
04744 {
04745 CNode* n = new(heap) CNode( loc, eNE );
04746 n->Arg<CNode*>(0) = a0;
04747 n->Arg<CNode*>(1) = a1;
04748 return n;
04749 }
04758 inline CNode* cRAND( CNode* a0, Coord_t* loc=NULL )
04759 {
04760 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eRAND );
04761 n->Arg<CNode*>(0) = a0;
04762 return n;
04763 }
04773 inline CNode* cRAND( CObstack* heap, CNode* a0, Coord_t* loc=NULL )
04774 {
04775 CNode* n = new(heap) CNode( loc, eRAND );
04776 n->Arg<CNode*>(0) = a0;
04777 return n;
04778 }
04787 inline CNode* cRNAND( CNode* a0, Coord_t* loc=NULL )
04788 {
04789 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eRNAND );
04790 n->Arg<CNode*>(0) = a0;
04791 return n;
04792 }
04802 inline CNode* cRNAND( CObstack* heap, CNode* a0, Coord_t* loc=NULL )
04803 {
04804 CNode* n = new(heap) CNode( loc, eRNAND );
04805 n->Arg<CNode*>(0) = a0;
04806 return n;
04807 }
04816 inline CNode* cROR( CNode* a0, Coord_t* loc=NULL )
04817 {
04818 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eROR );
04819 n->Arg<CNode*>(0) = a0;
04820 return n;
04821 }
04831 inline CNode* cROR( CObstack* heap, CNode* a0, Coord_t* loc=NULL )
04832 {
04833 CNode* n = new(heap) CNode( loc, eROR );
04834 n->Arg<CNode*>(0) = a0;
04835 return n;
04836 }
04845 inline CNode* cRNOR( CNode* a0, Coord_t* loc=NULL )
04846 {
04847 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eRNOR );
04848 n->Arg<CNode*>(0) = a0;
04849 return n;
04850 }
04860 inline CNode* cRNOR( CObstack* heap, CNode* a0, Coord_t* loc=NULL )
04861 {
04862 CNode* n = new(heap) CNode( loc, eRNOR );
04863 n->Arg<CNode*>(0) = a0;
04864 return n;
04865 }
04874 inline CNode* cRXOR( CNode* a0, Coord_t* loc=NULL )
04875 {
04876 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eRXOR );
04877 n->Arg<CNode*>(0) = a0;
04878 return n;
04879 }
04889 inline CNode* cRXOR( CObstack* heap, CNode* a0, Coord_t* loc=NULL )
04890 {
04891 CNode* n = new(heap) CNode( loc, eRXOR );
04892 n->Arg<CNode*>(0) = a0;
04893 return n;
04894 }
04903 inline CNode* cRXNOR( CNode* a0, Coord_t* loc=NULL )
04904 {
04905 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eRXNOR );
04906 n->Arg<CNode*>(0) = a0;
04907 return n;
04908 }
04918 inline CNode* cRXNOR( CObstack* heap, CNode* a0, Coord_t* loc=NULL )
04919 {
04920 CNode* n = new(heap) CNode( loc, eRXNOR );
04921 n->Arg<CNode*>(0) = a0;
04922 return n;
04923 }
04934 inline CNode* cHOOK( CNode* a0, CNode* a1, CNode* a2, Coord_t* loc=NULL )
04935 {
04936 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eHOOK );
04937 n->Arg<CNode*>(0) = a0;
04938 n->Arg<CNode*>(1) = a1;
04939 n->Arg<CNode*>(2) = a2;
04940 return n;
04941 }
04953 inline CNode* cHOOK( CObstack* heap, CNode* a0, CNode* a1, CNode* a2, Coord_t* loc=NULL )
04954 {
04955 CNode* n = new(heap) CNode( loc, eHOOK );
04956 n->Arg<CNode*>(0) = a0;
04957 n->Arg<CNode*>(1) = a1;
04958 n->Arg<CNode*>(2) = a2;
04959 return n;
04960 }
04969 inline CNode* cINIT( CNode* a0, Coord_t* loc=NULL )
04970 {
04971 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eINIT );
04972 n->Arg<CNode*>(0) = a0;
04973 return n;
04974 }
04984 inline CNode* cINIT( CObstack* heap, CNode* a0, Coord_t* loc=NULL )
04985 {
04986 CNode* n = new(heap) CNode( loc, eINIT );
04987 n->Arg<CNode*>(0) = a0;
04988 return n;
04989 }
04998 inline CNode* cALWAYS( CNode* a0, Coord_t* loc=NULL )
04999 {
05000 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eALWAYS );
05001 n->Arg<CNode*>(0) = a0;
05002 return n;
05003 }
05013 inline CNode* cALWAYS( CObstack* heap, CNode* a0, Coord_t* loc=NULL )
05014 {
05015 CNode* n = new(heap) CNode( loc, eALWAYS );
05016 n->Arg<CNode*>(0) = a0;
05017 return n;
05018 }
05027 inline CNode* cALWAYS_LATCH( CNode* a0, Coord_t* loc=NULL )
05028 {
05029 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eALWAYS_LATCH );
05030 n->Arg<CNode*>(0) = a0;
05031 return n;
05032 }
05042 inline CNode* cALWAYS_LATCH( CObstack* heap, CNode* a0, Coord_t* loc=NULL )
05043 {
05044 CNode* n = new(heap) CNode( loc, eALWAYS_LATCH );
05045 n->Arg<CNode*>(0) = a0;
05046 return n;
05047 }
05056 inline CNode* cALWAYS_FF( CNode* a0, Coord_t* loc=NULL )
05057 {
05058 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eALWAYS_FF );
05059 n->Arg<CNode*>(0) = a0;
05060 return n;
05061 }
05071 inline CNode* cALWAYS_FF( CObstack* heap, CNode* a0, Coord_t* loc=NULL )
05072 {
05073 CNode* n = new(heap) CNode( loc, eALWAYS_FF );
05074 n->Arg<CNode*>(0) = a0;
05075 return n;
05076 }
05085 inline CNode* cALWAYS_COMB( CNode* a0, Coord_t* loc=NULL )
05086 {
05087 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eALWAYS_COMB );
05088 n->Arg<CNode*>(0) = a0;
05089 return n;
05090 }
05100 inline CNode* cALWAYS_COMB( CObstack* heap, CNode* a0, Coord_t* loc=NULL )
05101 {
05102 CNode* n = new(heap) CNode( loc, eALWAYS_COMB );
05103 n->Arg<CNode*>(0) = a0;
05104 return n;
05105 }
05115 inline CNode* cEVENT( CNode* a0, CNode* a1, Coord_t* loc=NULL )
05116 {
05117 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eEVENT );
05118 n->Arg<CNode*>(0) = a0;
05119 n->Arg<CNode*>(1) = a1;
05120 return n;
05121 }
05132 inline CNode* cEVENT( CObstack* heap, CNode* a0, CNode* a1, Coord_t* loc=NULL )
05133 {
05134 CNode* n = new(heap) CNode( loc, eEVENT );
05135 n->Arg<CNode*>(0) = a0;
05136 n->Arg<CNode*>(1) = a1;
05137 return n;
05138 }
05148 inline CNode* cBLOCK_REF( CBlock* a0, CNode* a1, Coord_t* loc=NULL )
05149 {
05150 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eBLOCK_REF );
05151 n->Arg<CBlock*>(0) = a0;
05152 n->Arg<CNode*>(1) = a1;
05153 return n;
05154 }
05165 inline CNode* cBLOCK_REF( CObstack* heap, CBlock* a0, CNode* a1, Coord_t* loc=NULL )
05166 {
05167 CNode* n = new(heap) CNode( loc, eBLOCK_REF );
05168 n->Arg<CBlock*>(0) = a0;
05169 n->Arg<CNode*>(1) = a1;
05170 return n;
05171 }
05181 inline CNode* cSPECIFY_REF( CSpecify* a0, CNode* a1, Coord_t* loc=NULL )
05182 {
05183 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eSPECIFY_REF );
05184 n->Arg<CSpecify*>(0) = a0;
05185 n->Arg<CNode*>(1) = a1;
05186 return n;
05187 }
05198 inline CNode* cSPECIFY_REF( CObstack* heap, CSpecify* a0, CNode* a1, Coord_t* loc=NULL )
05199 {
05200 CNode* n = new(heap) CNode( loc, eSPECIFY_REF );
05201 n->Arg<CSpecify*>(0) = a0;
05202 n->Arg<CNode*>(1) = a1;
05203 return n;
05204 }
05215 inline CNode* cASSIGN( CNode* a0, CNode* a1, CNode* a2, Coord_t* loc=NULL )
05216 {
05217 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eASSIGN );
05218 n->Arg<CNode*>(0) = a0;
05219 n->Arg<CNode*>(1) = a1;
05220 n->Arg<CNode*>(2) = a2;
05221 return n;
05222 }
05234 inline CNode* cASSIGN( CObstack* heap, CNode* a0, CNode* a1, CNode* a2, Coord_t* loc=NULL )
05235 {
05236 CNode* n = new(heap) CNode( loc, eASSIGN );
05237 n->Arg<CNode*>(0) = a0;
05238 n->Arg<CNode*>(1) = a1;
05239 n->Arg<CNode*>(2) = a2;
05240 return n;
05241 }
05252 inline CNode* cADD_ASSIGN( CNode* a0, CNode* a1, CNode* a2, Coord_t* loc=NULL )
05253 {
05254 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eADD_ASSIGN );
05255 n->Arg<CNode*>(0) = a0;
05256 n->Arg<CNode*>(1) = a1;
05257 n->Arg<CNode*>(2) = a2;
05258 return n;
05259 }
05271 inline CNode* cADD_ASSIGN( CObstack* heap, CNode* a0, CNode* a1, CNode* a2, Coord_t* loc=NULL )
05272 {
05273 CNode* n = new(heap) CNode( loc, eADD_ASSIGN );
05274 n->Arg<CNode*>(0) = a0;
05275 n->Arg<CNode*>(1) = a1;
05276 n->Arg<CNode*>(2) = a2;
05277 return n;
05278 }
05289 inline CNode* cSUB_ASSIGN( CNode* a0, CNode* a1, CNode* a2, Coord_t* loc=NULL )
05290 {
05291 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eSUB_ASSIGN );
05292 n->Arg<CNode*>(0) = a0;
05293 n->Arg<CNode*>(1) = a1;
05294 n->Arg<CNode*>(2) = a2;
05295 return n;
05296 }
05308 inline CNode* cSUB_ASSIGN( CObstack* heap, CNode* a0, CNode* a1, CNode* a2, Coord_t* loc=NULL )
05309 {
05310 CNode* n = new(heap) CNode( loc, eSUB_ASSIGN );
05311 n->Arg<CNode*>(0) = a0;
05312 n->Arg<CNode*>(1) = a1;
05313 n->Arg<CNode*>(2) = a2;
05314 return n;
05315 }
05326 inline CNode* cMUL_ASSIGN( CNode* a0, CNode* a1, CNode* a2, Coord_t* loc=NULL )
05327 {
05328 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eMUL_ASSIGN );
05329 n->Arg<CNode*>(0) = a0;
05330 n->Arg<CNode*>(1) = a1;
05331 n->Arg<CNode*>(2) = a2;
05332 return n;
05333 }
05345 inline CNode* cMUL_ASSIGN( CObstack* heap, CNode* a0, CNode* a1, CNode* a2, Coord_t* loc=NULL )
05346 {
05347 CNode* n = new(heap) CNode( loc, eMUL_ASSIGN );
05348 n->Arg<CNode*>(0) = a0;
05349 n->Arg<CNode*>(1) = a1;
05350 n->Arg<CNode*>(2) = a2;
05351 return n;
05352 }
05363 inline CNode* cDIV_ASSIGN( CNode* a0, CNode* a1, CNode* a2, Coord_t* loc=NULL )
05364 {
05365 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eDIV_ASSIGN );
05366 n->Arg<CNode*>(0) = a0;
05367 n->Arg<CNode*>(1) = a1;
05368 n->Arg<CNode*>(2) = a2;
05369 return n;
05370 }
05382 inline CNode* cDIV_ASSIGN( CObstack* heap, CNode* a0, CNode* a1, CNode* a2, Coord_t* loc=NULL )
05383 {
05384 CNode* n = new(heap) CNode( loc, eDIV_ASSIGN );
05385 n->Arg<CNode*>(0) = a0;
05386 n->Arg<CNode*>(1) = a1;
05387 n->Arg<CNode*>(2) = a2;
05388 return n;
05389 }
05400 inline CNode* cMOD_ASSIGN( CNode* a0, CNode* a1, CNode* a2, Coord_t* loc=NULL )
05401 {
05402 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eMOD_ASSIGN );
05403 n->Arg<CNode*>(0) = a0;
05404 n->Arg<CNode*>(1) = a1;
05405 n->Arg<CNode*>(2) = a2;
05406 return n;
05407 }
05419 inline CNode* cMOD_ASSIGN( CObstack* heap, CNode* a0, CNode* a1, CNode* a2, Coord_t* loc=NULL )
05420 {
05421 CNode* n = new(heap) CNode( loc, eMOD_ASSIGN );
05422 n->Arg<CNode*>(0) = a0;
05423 n->Arg<CNode*>(1) = a1;
05424 n->Arg<CNode*>(2) = a2;
05425 return n;
05426 }
05437 inline CNode* cAND_ASSIGN( CNode* a0, CNode* a1, CNode* a2, Coord_t* loc=NULL )
05438 {
05439 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eAND_ASSIGN );
05440 n->Arg<CNode*>(0) = a0;
05441 n->Arg<CNode*>(1) = a1;
05442 n->Arg<CNode*>(2) = a2;
05443 return n;
05444 }
05456 inline CNode* cAND_ASSIGN( CObstack* heap, CNode* a0, CNode* a1, CNode* a2, Coord_t* loc=NULL )
05457 {
05458 CNode* n = new(heap) CNode( loc, eAND_ASSIGN );
05459 n->Arg<CNode*>(0) = a0;
05460 n->Arg<CNode*>(1) = a1;
05461 n->Arg<CNode*>(2) = a2;
05462 return n;
05463 }
05474 inline CNode* cOR_ASSIGN( CNode* a0, CNode* a1, CNode* a2, Coord_t* loc=NULL )
05475 {
05476 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eOR_ASSIGN );
05477 n->Arg<CNode*>(0) = a0;
05478 n->Arg<CNode*>(1) = a1;
05479 n->Arg<CNode*>(2) = a2;
05480 return n;
05481 }
05493 inline CNode* cOR_ASSIGN( CObstack* heap, CNode* a0, CNode* a1, CNode* a2, Coord_t* loc=NULL )
05494 {
05495 CNode* n = new(heap) CNode( loc, eOR_ASSIGN );
05496 n->Arg<CNode*>(0) = a0;
05497 n->Arg<CNode*>(1) = a1;
05498 n->Arg<CNode*>(2) = a2;
05499 return n;
05500 }
05511 inline CNode* cXOR_ASSIGN( CNode* a0, CNode* a1, CNode* a2, Coord_t* loc=NULL )
05512 {
05513 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eXOR_ASSIGN );
05514 n->Arg<CNode*>(0) = a0;
05515 n->Arg<CNode*>(1) = a1;
05516 n->Arg<CNode*>(2) = a2;
05517 return n;
05518 }
05530 inline CNode* cXOR_ASSIGN( CObstack* heap, CNode* a0, CNode* a1, CNode* a2, Coord_t* loc=NULL )
05531 {
05532 CNode* n = new(heap) CNode( loc, eXOR_ASSIGN );
05533 n->Arg<CNode*>(0) = a0;
05534 n->Arg<CNode*>(1) = a1;
05535 n->Arg<CNode*>(2) = a2;
05536 return n;
05537 }
05548 inline CNode* cLSH_ASSIGN( CNode* a0, CNode* a1, CNode* a2, Coord_t* loc=NULL )
05549 {
05550 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eLSH_ASSIGN );
05551 n->Arg<CNode*>(0) = a0;
05552 n->Arg<CNode*>(1) = a1;
05553 n->Arg<CNode*>(2) = a2;
05554 return n;
05555 }
05567 inline CNode* cLSH_ASSIGN( CObstack* heap, CNode* a0, CNode* a1, CNode* a2, Coord_t* loc=NULL )
05568 {
05569 CNode* n = new(heap) CNode( loc, eLSH_ASSIGN );
05570 n->Arg<CNode*>(0) = a0;
05571 n->Arg<CNode*>(1) = a1;
05572 n->Arg<CNode*>(2) = a2;
05573 return n;
05574 }
05585 inline CNode* cRSH_ASSIGN( CNode* a0, CNode* a1, CNode* a2, Coord_t* loc=NULL )
05586 {
05587 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eRSH_ASSIGN );
05588 n->Arg<CNode*>(0) = a0;
05589 n->Arg<CNode*>(1) = a1;
05590 n->Arg<CNode*>(2) = a2;
05591 return n;
05592 }
05604 inline CNode* cRSH_ASSIGN( CObstack* heap, CNode* a0, CNode* a1, CNode* a2, Coord_t* loc=NULL )
05605 {
05606 CNode* n = new(heap) CNode( loc, eRSH_ASSIGN );
05607 n->Arg<CNode*>(0) = a0;
05608 n->Arg<CNode*>(1) = a1;
05609 n->Arg<CNode*>(2) = a2;
05610 return n;
05611 }
05622 inline CNode* cLSHA_ASSIGN( CNode* a0, CNode* a1, CNode* a2, Coord_t* loc=NULL )
05623 {
05624 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eLSHA_ASSIGN );
05625 n->Arg<CNode*>(0) = a0;
05626 n->Arg<CNode*>(1) = a1;
05627 n->Arg<CNode*>(2) = a2;
05628 return n;
05629 }
05641 inline CNode* cLSHA_ASSIGN( CObstack* heap, CNode* a0, CNode* a1, CNode* a2, Coord_t* loc=NULL )
05642 {
05643 CNode* n = new(heap) CNode( loc, eLSHA_ASSIGN );
05644 n->Arg<CNode*>(0) = a0;
05645 n->Arg<CNode*>(1) = a1;
05646 n->Arg<CNode*>(2) = a2;
05647 return n;
05648 }
05659 inline CNode* cRSHA_ASSIGN( CNode* a0, CNode* a1, CNode* a2, Coord_t* loc=NULL )
05660 {
05661 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eRSHA_ASSIGN );
05662 n->Arg<CNode*>(0) = a0;
05663 n->Arg<CNode*>(1) = a1;
05664 n->Arg<CNode*>(2) = a2;
05665 return n;
05666 }
05678 inline CNode* cRSHA_ASSIGN( CObstack* heap, CNode* a0, CNode* a1, CNode* a2, Coord_t* loc=NULL )
05679 {
05680 CNode* n = new(heap) CNode( loc, eRSHA_ASSIGN );
05681 n->Arg<CNode*>(0) = a0;
05682 n->Arg<CNode*>(1) = a1;
05683 n->Arg<CNode*>(2) = a2;
05684 return n;
05685 }
05695 inline CNode* cFORCE( CNode* a0, CNode* a1, Coord_t* loc=NULL )
05696 {
05697 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eFORCE );
05698 n->Arg<CNode*>(0) = a0;
05699 n->Arg<CNode*>(1) = a1;
05700 return n;
05701 }
05712 inline CNode* cFORCE( CObstack* heap, CNode* a0, CNode* a1, Coord_t* loc=NULL )
05713 {
05714 CNode* n = new(heap) CNode( loc, eFORCE );
05715 n->Arg<CNode*>(0) = a0;
05716 n->Arg<CNode*>(1) = a1;
05717 return n;
05718 }
05727 inline CNode* cRELEASE( CNode* a0, Coord_t* loc=NULL )
05728 {
05729 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eRELEASE );
05730 n->Arg<CNode*>(0) = a0;
05731 return n;
05732 }
05742 inline CNode* cRELEASE( CObstack* heap, CNode* a0, Coord_t* loc=NULL )
05743 {
05744 CNode* n = new(heap) CNode( loc, eRELEASE );
05745 n->Arg<CNode*>(0) = a0;
05746 return n;
05747 }
05758 inline CNode* cNBASSIGN( CNode* a0, CNode* a1, CNode* a2, Coord_t* loc=NULL )
05759 {
05760 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eNBASSIGN );
05761 n->Arg<CNode*>(0) = a0;
05762 n->Arg<CNode*>(1) = a1;
05763 n->Arg<CNode*>(2) = a2;
05764 return n;
05765 }
05777 inline CNode* cNBASSIGN( CObstack* heap, CNode* a0, CNode* a1, CNode* a2, Coord_t* loc=NULL )
05778 {
05779 CNode* n = new(heap) CNode( loc, eNBASSIGN );
05780 n->Arg<CNode*>(0) = a0;
05781 n->Arg<CNode*>(1) = a1;
05782 n->Arg<CNode*>(2) = a2;
05783 return n;
05784 }
05793 inline CNode* cPOSEDGE( CNode* a0, Coord_t* loc=NULL )
05794 {
05795 CNode* n = new(CNode::CurrentHeap()) CNode( loc, ePOSEDGE );
05796 n->Arg<CNode*>(0) = a0;
05797 return n;
05798 }
05808 inline CNode* cPOSEDGE( CObstack* heap, CNode* a0, Coord_t* loc=NULL )
05809 {
05810 CNode* n = new(heap) CNode( loc, ePOSEDGE );
05811 n->Arg<CNode*>(0) = a0;
05812 return n;
05813 }
05822 inline CNode* cNEGEDGE( CNode* a0, Coord_t* loc=NULL )
05823 {
05824 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eNEGEDGE );
05825 n->Arg<CNode*>(0) = a0;
05826 return n;
05827 }
05837 inline CNode* cNEGEDGE( CObstack* heap, CNode* a0, Coord_t* loc=NULL )
05838 {
05839 CNode* n = new(heap) CNode( loc, eNEGEDGE );
05840 n->Arg<CNode*>(0) = a0;
05841 return n;
05842 }
05852 inline CNode* cEDGE( CNode* a0, Edge_t a1, Coord_t* loc=NULL )
05853 {
05854 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eEDGE );
05855 n->Arg<CNode*>(0) = a0;
05856 n->Arg<Edge_t>(1) = a1;
05857 return n;
05858 }
05869 inline CNode* cEDGE( CObstack* heap, CNode* a0, Edge_t a1, Coord_t* loc=NULL )
05870 {
05871 CNode* n = new(heap) CNode( loc, eEDGE );
05872 n->Arg<CNode*>(0) = a0;
05873 n->Arg<Edge_t>(1) = a1;
05874 return n;
05875 }
05885 inline CNode* cEVOR( CNode* a0, CNode* a1, Coord_t* loc=NULL )
05886 {
05887 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eEVOR );
05888 n->Arg<CNode*>(0) = a0;
05889 n->Arg<CNode*>(1) = a1;
05890 return n;
05891 }
05902 inline CNode* cEVOR( CObstack* heap, CNode* a0, CNode* a1, Coord_t* loc=NULL )
05903 {
05904 CNode* n = new(heap) CNode( loc, eEVOR );
05905 n->Arg<CNode*>(0) = a0;
05906 n->Arg<CNode*>(1) = a1;
05907 return n;
05908 }
05918 inline CNode* cDELAY( CNode* a0, CNode* a1, Coord_t* loc=NULL )
05919 {
05920 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eDELAY );
05921 n->Arg<CNode*>(0) = a0;
05922 n->Arg<CNode*>(1) = a1;
05923 return n;
05924 }
05935 inline CNode* cDELAY( CObstack* heap, CNode* a0, CNode* a1, Coord_t* loc=NULL )
05936 {
05937 CNode* n = new(heap) CNode( loc, eDELAY );
05938 n->Arg<CNode*>(0) = a0;
05939 n->Arg<CNode*>(1) = a1;
05940 return n;
05941 }
05952 inline CNode* cMTM( CNode* a0, CNode* a1, CNode* a2, Coord_t* loc=NULL )
05953 {
05954 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eMTM );
05955 n->Arg<CNode*>(0) = a0;
05956 n->Arg<CNode*>(1) = a1;
05957 n->Arg<CNode*>(2) = a2;
05958 return n;
05959 }
05971 inline CNode* cMTM( CObstack* heap, CNode* a0, CNode* a1, CNode* a2, Coord_t* loc=NULL )
05972 {
05973 CNode* n = new(heap) CNode( loc, eMTM );
05974 n->Arg<CNode*>(0) = a0;
05975 n->Arg<CNode*>(1) = a1;
05976 n->Arg<CNode*>(2) = a2;
05977 return n;
05978 }
05989 inline CNode* cIF( CNode* a0, CNode* a1, CNode* a2, Coord_t* loc=NULL )
05990 {
05991 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eIF );
05992 n->Arg<CNode*>(0) = a0;
05993 n->Arg<CNode*>(1) = a1;
05994 n->Arg<CNode*>(2) = a2;
05995 return n;
05996 }
06008 inline CNode* cIF( CObstack* heap, CNode* a0, CNode* a1, CNode* a2, Coord_t* loc=NULL )
06009 {
06010 CNode* n = new(heap) CNode( loc, eIF );
06011 n->Arg<CNode*>(0) = a0;
06012 n->Arg<CNode*>(1) = a1;
06013 n->Arg<CNode*>(2) = a2;
06014 return n;
06015 }
06024 inline CNode* cFOREVER( CNode* a0, Coord_t* loc=NULL )
06025 {
06026 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eFOREVER );
06027 n->Arg<CNode*>(0) = a0;
06028 return n;
06029 }
06039 inline CNode* cFOREVER( CObstack* heap, CNode* a0, Coord_t* loc=NULL )
06040 {
06041 CNode* n = new(heap) CNode( loc, eFOREVER );
06042 n->Arg<CNode*>(0) = a0;
06043 return n;
06044 }
06054 inline CNode* cREPEAT( CNode* a0, CNode* a1, Coord_t* loc=NULL )
06055 {
06056 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eREPEAT );
06057 n->Arg<CNode*>(0) = a0;
06058 n->Arg<CNode*>(1) = a1;
06059 return n;
06060 }
06071 inline CNode* cREPEAT( CObstack* heap, CNode* a0, CNode* a1, Coord_t* loc=NULL )
06072 {
06073 CNode* n = new(heap) CNode( loc, eREPEAT );
06074 n->Arg<CNode*>(0) = a0;
06075 n->Arg<CNode*>(1) = a1;
06076 return n;
06077 }
06087 inline CNode* cWHILE( CNode* a0, CNode* a1, Coord_t* loc=NULL )
06088 {
06089 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eWHILE );
06090 n->Arg<CNode*>(0) = a0;
06091 n->Arg<CNode*>(1) = a1;
06092 return n;
06093 }
06104 inline CNode* cWHILE( CObstack* heap, CNode* a0, CNode* a1, Coord_t* loc=NULL )
06105 {
06106 CNode* n = new(heap) CNode( loc, eWHILE );
06107 n->Arg<CNode*>(0) = a0;
06108 n->Arg<CNode*>(1) = a1;
06109 return n;
06110 }
06120 inline CNode* cWAIT( CNode* a0, CNode* a1, Coord_t* loc=NULL )
06121 {
06122 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eWAIT );
06123 n->Arg<CNode*>(0) = a0;
06124 n->Arg<CNode*>(1) = a1;
06125 return n;
06126 }
06137 inline CNode* cWAIT( CObstack* heap, CNode* a0, CNode* a1, Coord_t* loc=NULL )
06138 {
06139 CNode* n = new(heap) CNode( loc, eWAIT );
06140 n->Arg<CNode*>(0) = a0;
06141 n->Arg<CNode*>(1) = a1;
06142 return n;
06143 }
06155 inline CNode* cFOR( CNode* a0, CNode* a1, CNode* a2, CNode* a3, Coord_t* loc=NULL )
06156 {
06157 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eFOR );
06158 n->Arg<CNode*>(0) = a0;
06159 n->Arg<CNode*>(1) = a1;
06160 n->Arg<CNode*>(2) = a2;
06161 n->Arg<CNode*>(3) = a3;
06162 return n;
06163 }
06176 inline CNode* cFOR( CObstack* heap, CNode* a0, CNode* a1, CNode* a2, CNode* a3, Coord_t* loc=NULL )
06177 {
06178 CNode* n = new(heap) CNode( loc, eFOR );
06179 n->Arg<CNode*>(0) = a0;
06180 n->Arg<CNode*>(1) = a1;
06181 n->Arg<CNode*>(2) = a2;
06182 n->Arg<CNode*>(3) = a3;
06183 return n;
06184 }
06194 inline CNode* cCASE( CNode* a0, CNode* a1, Coord_t* loc=NULL )
06195 {
06196 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eCASE );
06197 n->Arg<CNode*>(0) = a0;
06198 n->Arg<CNode*>(1) = a1;
06199 return n;
06200 }
06211 inline CNode* cCASE( CObstack* heap, CNode* a0, CNode* a1, Coord_t* loc=NULL )
06212 {
06213 CNode* n = new(heap) CNode( loc, eCASE );
06214 n->Arg<CNode*>(0) = a0;
06215 n->Arg<CNode*>(1) = a1;
06216 return n;
06217 }
06227 inline CNode* cCASEX( CNode* a0, CNode* a1, Coord_t* loc=NULL )
06228 {
06229 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eCASEX );
06230 n->Arg<CNode*>(0) = a0;
06231 n->Arg<CNode*>(1) = a1;
06232 return n;
06233 }
06244 inline CNode* cCASEX( CObstack* heap, CNode* a0, CNode* a1, Coord_t* loc=NULL )
06245 {
06246 CNode* n = new(heap) CNode( loc, eCASEX );
06247 n->Arg<CNode*>(0) = a0;
06248 n->Arg<CNode*>(1) = a1;
06249 return n;
06250 }
06260 inline CNode* cCASEZ( CNode* a0, CNode* a1, Coord_t* loc=NULL )
06261 {
06262 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eCASEZ );
06263 n->Arg<CNode*>(0) = a0;
06264 n->Arg<CNode*>(1) = a1;
06265 return n;
06266 }
06277 inline CNode* cCASEZ( CObstack* heap, CNode* a0, CNode* a1, Coord_t* loc=NULL )
06278 {
06279 CNode* n = new(heap) CNode( loc, eCASEZ );
06280 n->Arg<CNode*>(0) = a0;
06281 n->Arg<CNode*>(1) = a1;
06282 return n;
06283 }
06293 inline CNode* cCASEITEM( CNode* a0, CNode* a1, Coord_t* loc=NULL )
06294 {
06295 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eCASEITEM );
06296 n->Arg<CNode*>(0) = a0;
06297 n->Arg<CNode*>(1) = a1;
06298 return n;
06299 }
06310 inline CNode* cCASEITEM( CObstack* heap, CNode* a0, CNode* a1, Coord_t* loc=NULL )
06311 {
06312 CNode* n = new(heap) CNode( loc, eCASEITEM );
06313 n->Arg<CNode*>(0) = a0;
06314 n->Arg<CNode*>(1) = a1;
06315 return n;
06316 }
06328 inline CNode* cCASSIGN( StrengthPair_t* a0, CNode* a1, CNode* a2, CNode* a3, Coord_t* loc=NULL )
06329 {
06330 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eCASSIGN );
06331 n->Arg<StrengthPair_t*>(0) = a0;
06332 n->Arg<CNode*>(1) = a1;
06333 n->Arg<CNode*>(2) = a2;
06334 n->Arg<CNode*>(3) = a3;
06335 return n;
06336 }
06349 inline CNode* cCASSIGN( CObstack* heap, StrengthPair_t* a0, CNode* a1, CNode* a2, CNode* a3, Coord_t* loc=NULL )
06350 {
06351 CNode* n = new(heap) CNode( loc, eCASSIGN );
06352 n->Arg<StrengthPair_t*>(0) = a0;
06353 n->Arg<CNode*>(1) = a1;
06354 n->Arg<CNode*>(2) = a2;
06355 n->Arg<CNode*>(3) = a3;
06356 return n;
06357 }
06367 inline CNode* cARG( CSymbol* a0, CNode* a1, Coord_t* loc=NULL )
06368 {
06369 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eARG );
06370 n->Arg<CSymbol*>(0) = a0;
06371 n->Arg<CNode*>(1) = a1;
06372 return n;
06373 }
06384 inline CNode* cARG( CObstack* heap, CSymbol* a0, CNode* a1, Coord_t* loc=NULL )
06385 {
06386 CNode* n = new(heap) CNode( loc, eARG );
06387 n->Arg<CSymbol*>(0) = a0;
06388 n->Arg<CNode*>(1) = a1;
06389 return n;
06390 }
06399 inline CNode* cFUNCTION_DEF( CFunction* a0, Coord_t* loc=NULL )
06400 {
06401 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eFUNCTION_DEF );
06402 n->Arg<CFunction*>(0) = a0;
06403 return n;
06404 }
06414 inline CNode* cFUNCTION_DEF( CObstack* heap, CFunction* a0, Coord_t* loc=NULL )
06415 {
06416 CNode* n = new(heap) CNode( loc, eFUNCTION_DEF );
06417 n->Arg<CFunction*>(0) = a0;
06418 return n;
06419 }
06428 inline CNode* cMODULE_DEF( CModule* a0, Coord_t* loc=NULL )
06429 {
06430 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eMODULE_DEF );
06431 n->Arg<CModule*>(0) = a0;
06432 return n;
06433 }
06443 inline CNode* cMODULE_DEF( CObstack* heap, CModule* a0, Coord_t* loc=NULL )
06444 {
06445 CNode* n = new(heap) CNode( loc, eMODULE_DEF );
06446 n->Arg<CModule*>(0) = a0;
06447 return n;
06448 }
06458 inline CNode* cREPEAT_CONTROL( CNode* a0, CNode* a1, Coord_t* loc=NULL )
06459 {
06460 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eREPEAT_CONTROL );
06461 n->Arg<CNode*>(0) = a0;
06462 n->Arg<CNode*>(1) = a1;
06463 return n;
06464 }
06475 inline CNode* cREPEAT_CONTROL( CObstack* heap, CNode* a0, CNode* a1, Coord_t* loc=NULL )
06476 {
06477 CNode* n = new(heap) CNode( loc, eREPEAT_CONTROL );
06478 n->Arg<CNode*>(0) = a0;
06479 n->Arg<CNode*>(1) = a1;
06480 return n;
06481 }
06490 inline CNode* cDELAY_CONTROL( CNode* a0, Coord_t* loc=NULL )
06491 {
06492 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eDELAY_CONTROL );
06493 n->Arg<CNode*>(0) = a0;
06494 return n;
06495 }
06505 inline CNode* cDELAY_CONTROL( CObstack* heap, CNode* a0, Coord_t* loc=NULL )
06506 {
06507 CNode* n = new(heap) CNode( loc, eDELAY_CONTROL );
06508 n->Arg<CNode*>(0) = a0;
06509 return n;
06510 }
06519 inline CNode* cEVENT_CONTROL( CNode* a0, Coord_t* loc=NULL )
06520 {
06521 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eEVENT_CONTROL );
06522 n->Arg<CNode*>(0) = a0;
06523 return n;
06524 }
06534 inline CNode* cEVENT_CONTROL( CObstack* heap, CNode* a0, Coord_t* loc=NULL )
06535 {
06536 CNode* n = new(heap) CNode( loc, eEVENT_CONTROL );
06537 n->Arg<CNode*>(0) = a0;
06538 return n;
06539 }
06548 inline CNode* cEXTERNAL_REF( CSymbol* a0, Coord_t* loc=NULL )
06549 {
06550 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eEXTERNAL_REF );
06551 n->Arg<CSymbol*>(0) = a0;
06552 return n;
06553 }
06563 inline CNode* cEXTERNAL_REF( CObstack* heap, CSymbol* a0, Coord_t* loc=NULL )
06564 {
06565 CNode* n = new(heap) CNode( loc, eEXTERNAL_REF );
06566 n->Arg<CSymbol*>(0) = a0;
06567 return n;
06568 }
06577 inline CNode* cPORT_DEF( CPort* a0, Coord_t* loc=NULL )
06578 {
06579 CNode* n = new(CNode::CurrentHeap()) CNode( loc, ePORT_DEF );
06580 n->Arg<CPort*>(0) = a0;
06581 return n;
06582 }
06592 inline CNode* cPORT_DEF( CObstack* heap, CPort* a0, Coord_t* loc=NULL )
06593 {
06594 CNode* n = new(heap) CNode( loc, ePORT_DEF );
06595 n->Arg<CPort*>(0) = a0;
06596 return n;
06597 }
06607 inline CNode* cDEFPARAM( CNode* a0, CNode* a1, Coord_t* loc=NULL )
06608 {
06609 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eDEFPARAM );
06610 n->Arg<CNode*>(0) = a0;
06611 n->Arg<CNode*>(1) = a1;
06612 return n;
06613 }
06624 inline CNode* cDEFPARAM( CObstack* heap, CNode* a0, CNode* a1, Coord_t* loc=NULL )
06625 {
06626 CNode* n = new(heap) CNode( loc, eDEFPARAM );
06627 n->Arg<CNode*>(0) = a0;
06628 n->Arg<CNode*>(1) = a1;
06629 return n;
06630 }
06645 inline CNode* cPATH( int a0, CNode* a1, int a2, int a3, CNode* a4, int a5, CNode* a6, Coord_t* loc=NULL )
06646 {
06647 CNode* n = new(CNode::CurrentHeap()) CNode( loc, ePATH );
06648 n->Arg<int>(0) = a0;
06649 n->Arg<CNode*>(1) = a1;
06650 n->Arg<int>(2) = a2;
06651 n->Arg<int>(3) = a3;
06652 n->Arg<CNode*>(4) = a4;
06653 n->Arg<int>(5) = a5;
06654 n->Arg<CNode*>(6) = a6;
06655 return n;
06656 }
06672 inline CNode* cPATH( CObstack* heap, int a0, CNode* a1, int a2, int a3, CNode* a4, int a5, CNode* a6, Coord_t* loc=NULL )
06673 {
06674 CNode* n = new(heap) CNode( loc, ePATH );
06675 n->Arg<int>(0) = a0;
06676 n->Arg<CNode*>(1) = a1;
06677 n->Arg<int>(2) = a2;
06678 n->Arg<int>(3) = a3;
06679 n->Arg<CNode*>(4) = a4;
06680 n->Arg<int>(5) = a5;
06681 n->Arg<CNode*>(6) = a6;
06682 return n;
06683 }
06694 inline CNode* cPATH_ASSIGN( CNode* a0, CNode* a1, CNode* a2, Coord_t* loc=NULL )
06695 {
06696 CNode* n = new(CNode::CurrentHeap()) CNode( loc, ePATH_ASSIGN );
06697 n->Arg<CNode*>(0) = a0;
06698 n->Arg<CNode*>(1) = a1;
06699 n->Arg<CNode*>(2) = a2;
06700 return n;
06701 }
06713 inline CNode* cPATH_ASSIGN( CObstack* heap, CNode* a0, CNode* a1, CNode* a2, Coord_t* loc=NULL )
06714 {
06715 CNode* n = new(heap) CNode( loc, ePATH_ASSIGN );
06716 n->Arg<CNode*>(0) = a0;
06717 n->Arg<CNode*>(1) = a1;
06718 n->Arg<CNode*>(2) = a2;
06719 return n;
06720 }
06730 inline CNode* cIFNONE_PATH_ASSIGN( CNode* a0, CNode* a1, Coord_t* loc=NULL )
06731 {
06732 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eIFNONE_PATH_ASSIGN );
06733 n->Arg<CNode*>(0) = a0;
06734 n->Arg<CNode*>(1) = a1;
06735 return n;
06736 }
06747 inline CNode* cIFNONE_PATH_ASSIGN( CObstack* heap, CNode* a0, CNode* a1, Coord_t* loc=NULL )
06748 {
06749 CNode* n = new(heap) CNode( loc, eIFNONE_PATH_ASSIGN );
06750 n->Arg<CNode*>(0) = a0;
06751 n->Arg<CNode*>(1) = a1;
06752 return n;
06753 }
06762 inline CNode* cTRIGGER( CNode* a0, Coord_t* loc=NULL )
06763 {
06764 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eTRIGGER );
06765 n->Arg<CNode*>(0) = a0;
06766 return n;
06767 }
06777 inline CNode* cTRIGGER( CObstack* heap, CNode* a0, Coord_t* loc=NULL )
06778 {
06779 CNode* n = new(heap) CNode( loc, eTRIGGER );
06780 n->Arg<CNode*>(0) = a0;
06781 return n;
06782 }
06792 inline CNode* cPASSIGN( CNode* a0, CNode* a1, Coord_t* loc=NULL )
06793 {
06794 CNode* n = new(CNode::CurrentHeap()) CNode( loc, ePASSIGN );
06795 n->Arg<CNode*>(0) = a0;
06796 n->Arg<CNode*>(1) = a1;
06797 return n;
06798 }
06809 inline CNode* cPASSIGN( CObstack* heap, CNode* a0, CNode* a1, Coord_t* loc=NULL )
06810 {
06811 CNode* n = new(heap) CNode( loc, ePASSIGN );
06812 n->Arg<CNode*>(0) = a0;
06813 n->Arg<CNode*>(1) = a1;
06814 return n;
06815 }
06824 inline CNode* cDEASSIGN( CNode* a0, Coord_t* loc=NULL )
06825 {
06826 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eDEASSIGN );
06827 n->Arg<CNode*>(0) = a0;
06828 return n;
06829 }
06839 inline CNode* cDEASSIGN( CObstack* heap, CNode* a0, Coord_t* loc=NULL )
06840 {
06841 CNode* n = new(heap) CNode( loc, eDEASSIGN );
06842 n->Arg<CNode*>(0) = a0;
06843 return n;
06844 }
06853 inline CNode* cDISABLE( CSymbol* a0, Coord_t* loc=NULL )
06854 {
06855 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eDISABLE );
06856 n->Arg<CSymbol*>(0) = a0;
06857 return n;
06858 }
06868 inline CNode* cDISABLE( CObstack* heap, CSymbol* a0, Coord_t* loc=NULL )
06869 {
06870 CNode* n = new(heap) CNode( loc, eDISABLE );
06871 n->Arg<CSymbol*>(0) = a0;
06872 return n;
06873 }
06882 inline CNode* cATTRIBUTE( CAttr* a0, Coord_t* loc=NULL )
06883 {
06884 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eATTRIBUTE );
06885 n->Arg<CAttr*>(0) = a0;
06886 return n;
06887 }
06897 inline CNode* cATTRIBUTE( CObstack* heap, CAttr* a0, Coord_t* loc=NULL )
06898 {
06899 CNode* n = new(heap) CNode( loc, eATTRIBUTE );
06900 n->Arg<CAttr*>(0) = a0;
06901 return n;
06902 }
06913 inline CNode* cGIF( CNode* a0, CNode* a1, CNode* a2, Coord_t* loc=NULL )
06914 {
06915 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eGIF );
06916 n->Arg<CNode*>(0) = a0;
06917 n->Arg<CNode*>(1) = a1;
06918 n->Arg<CNode*>(2) = a2;
06919 return n;
06920 }
06932 inline CNode* cGIF( CObstack* heap, CNode* a0, CNode* a1, CNode* a2, Coord_t* loc=NULL )
06933 {
06934 CNode* n = new(heap) CNode( loc, eGIF );
06935 n->Arg<CNode*>(0) = a0;
06936 n->Arg<CNode*>(1) = a1;
06937 n->Arg<CNode*>(2) = a2;
06938 return n;
06939 }
06951 inline CNode* cGFOR( CNode* a0, CNode* a1, CNode* a2, CNode* a3, Coord_t* loc=NULL )
06952 {
06953 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eGFOR );
06954 n->Arg<CNode*>(0) = a0;
06955 n->Arg<CNode*>(1) = a1;
06956 n->Arg<CNode*>(2) = a2;
06957 n->Arg<CNode*>(3) = a3;
06958 return n;
06959 }
06972 inline CNode* cGFOR( CObstack* heap, CNode* a0, CNode* a1, CNode* a2, CNode* a3, Coord_t* loc=NULL )
06973 {
06974 CNode* n = new(heap) CNode( loc, eGFOR );
06975 n->Arg<CNode*>(0) = a0;
06976 n->Arg<CNode*>(1) = a1;
06977 n->Arg<CNode*>(2) = a2;
06978 n->Arg<CNode*>(3) = a3;
06979 return n;
06980 }
06990 inline CNode* cGCASE( CNode* a0, CNode* a1, Coord_t* loc=NULL )
06991 {
06992 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eGCASE );
06993 n->Arg<CNode*>(0) = a0;
06994 n->Arg<CNode*>(1) = a1;
06995 return n;
06996 }
07007 inline CNode* cGCASE( CObstack* heap, CNode* a0, CNode* a1, Coord_t* loc=NULL )
07008 {
07009 CNode* n = new(heap) CNode( loc, eGCASE );
07010 n->Arg<CNode*>(0) = a0;
07011 n->Arg<CNode*>(1) = a1;
07012 return n;
07013 }
07022 inline CNode* cTABLE( CNode* a0, Coord_t* loc=NULL )
07023 {
07024 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eTABLE );
07025 n->Arg<CNode*>(0) = a0;
07026 return n;
07027 }
07037 inline CNode* cTABLE( CObstack* heap, CNode* a0, Coord_t* loc=NULL )
07038 {
07039 CNode* n = new(heap) CNode( loc, eTABLE );
07040 n->Arg<CNode*>(0) = a0;
07041 return n;
07042 }
07051 inline CNode* cTABLE_ENTRY( CNode* a0, Coord_t* loc=NULL )
07052 {
07053 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eTABLE_ENTRY );
07054 n->Arg<CNode*>(0) = a0;
07055 return n;
07056 }
07066 inline CNode* cTABLE_ENTRY( CObstack* heap, CNode* a0, Coord_t* loc=NULL )
07067 {
07068 CNode* n = new(heap) CNode( loc, eTABLE_ENTRY );
07069 n->Arg<CNode*>(0) = a0;
07070 return n;
07071 }
07080 inline CNode* cTABLE_SYMBOL( char* a0, Coord_t* loc=NULL )
07081 {
07082 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eTABLE_SYMBOL );
07083 n->Arg<char*>(0) = a0;
07084 return n;
07085 }
07095 inline CNode* cTABLE_SYMBOL( CObstack* heap, char* a0, Coord_t* loc=NULL )
07096 {
07097 CNode* n = new(heap) CNode( loc, eTABLE_SYMBOL );
07098 n->Arg<char*>(0) = a0;
07099 return n;
07100 }
07108 inline CNode* cPORTLIST_END( Coord_t* loc=NULL )
07109 {
07110 CNode* n = new(CNode::CurrentHeap()) CNode( loc, ePORTLIST_END );
07111 return n;
07112 }
07121 inline CNode* cPORTLIST_END( CObstack* heap, Coord_t* loc=NULL )
07122 {
07123 CNode* n = new(heap) CNode( loc, ePORTLIST_END );
07124 return n;
07125 }
07135 inline CNode* cMACRO_EXPR( const char* a0, CNode* a1, Coord_t* loc=NULL )
07136 {
07137 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eMACRO_EXPR );
07138 n->Arg<const char*>(0) = a0;
07139 n->Arg<CNode*>(1) = a1;
07140 return n;
07141 }
07152 inline CNode* cMACRO_EXPR( CObstack* heap, const char* a0, CNode* a1, Coord_t* loc=NULL )
07153 {
07154 CNode* n = new(heap) CNode( loc, eMACRO_EXPR );
07155 n->Arg<const char*>(0) = a0;
07156 n->Arg<CNode*>(1) = a1;
07157 return n;
07158 }
07169 inline CNode* cENUM_SPEC( CSymbol* a0, CNode* a1, CNode* a2, Coord_t* loc=NULL )
07170 {
07171 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eENUM_SPEC );
07172 n->Arg<CSymbol*>(0) = a0;
07173 n->Arg<CNode*>(1) = a1;
07174 n->Arg<CNode*>(2) = a2;
07175 return n;
07176 }
07188 inline CNode* cENUM_SPEC( CObstack* heap, CSymbol* a0, CNode* a1, CNode* a2, Coord_t* loc=NULL )
07189 {
07190 CNode* n = new(heap) CNode( loc, eENUM_SPEC );
07191 n->Arg<CSymbol*>(0) = a0;
07192 n->Arg<CNode*>(1) = a1;
07193 n->Arg<CNode*>(2) = a2;
07194 return n;
07195 }
07205 inline CNode* cMEMBER( CNode* a0, CSymbol* a1, Coord_t* loc=NULL )
07206 {
07207 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eMEMBER );
07208 n->Arg<CNode*>(0) = a0;
07209 n->Arg<CSymbol*>(1) = a1;
07210 return n;
07211 }
07222 inline CNode* cMEMBER( CObstack* heap, CNode* a0, CSymbol* a1, Coord_t* loc=NULL )
07223 {
07224 CNode* n = new(heap) CNode( loc, eMEMBER );
07225 n->Arg<CNode*>(0) = a0;
07226 n->Arg<CSymbol*>(1) = a1;
07227 return n;
07228 }
07237 inline CNode* cRETURN( CNode* a0, Coord_t* loc=NULL )
07238 {
07239 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eRETURN );
07240 n->Arg<CNode*>(0) = a0;
07241 return n;
07242 }
07252 inline CNode* cRETURN( CObstack* heap, CNode* a0, Coord_t* loc=NULL )
07253 {
07254 CNode* n = new(heap) CNode( loc, eRETURN );
07255 n->Arg<CNode*>(0) = a0;
07256 return n;
07257 }
07266 inline CNode* cPREINC( CNode* a0, Coord_t* loc=NULL )
07267 {
07268 CNode* n = new(CNode::CurrentHeap()) CNode( loc, ePREINC );
07269 n->Arg<CNode*>(0) = a0;
07270 return n;
07271 }
07281 inline CNode* cPREINC( CObstack* heap, CNode* a0, Coord_t* loc=NULL )
07282 {
07283 CNode* n = new(heap) CNode( loc, ePREINC );
07284 n->Arg<CNode*>(0) = a0;
07285 return n;
07286 }
07295 inline CNode* cPOSTINC( CNode* a0, Coord_t* loc=NULL )
07296 {
07297 CNode* n = new(CNode::CurrentHeap()) CNode( loc, ePOSTINC );
07298 n->Arg<CNode*>(0) = a0;
07299 return n;
07300 }
07310 inline CNode* cPOSTINC( CObstack* heap, CNode* a0, Coord_t* loc=NULL )
07311 {
07312 CNode* n = new(heap) CNode( loc, ePOSTINC );
07313 n->Arg<CNode*>(0) = a0;
07314 return n;
07315 }
07324 inline CNode* cPREDEC( CNode* a0, Coord_t* loc=NULL )
07325 {
07326 CNode* n = new(CNode::CurrentHeap()) CNode( loc, ePREDEC );
07327 n->Arg<CNode*>(0) = a0;
07328 return n;
07329 }
07339 inline CNode* cPREDEC( CObstack* heap, CNode* a0, Coord_t* loc=NULL )
07340 {
07341 CNode* n = new(heap) CNode( loc, ePREDEC );
07342 n->Arg<CNode*>(0) = a0;
07343 return n;
07344 }
07353 inline CNode* cPOSTDEC( CNode* a0, Coord_t* loc=NULL )
07354 {
07355 CNode* n = new(CNode::CurrentHeap()) CNode( loc, ePOSTDEC );
07356 n->Arg<CNode*>(0) = a0;
07357 return n;
07358 }
07368 inline CNode* cPOSTDEC( CObstack* heap, CNode* a0, Coord_t* loc=NULL )
07369 {
07370 CNode* n = new(heap) CNode( loc, ePOSTDEC );
07371 n->Arg<CNode*>(0) = a0;
07372 return n;
07373 }
07383 inline CNode* cCAST( CNode* a0, CNode* a1, Coord_t* loc=NULL )
07384 {
07385 CNode* n = new(CNode::CurrentHeap()) CNode( loc, eCAST );
07386 n->Arg<CNode*>(0) = a0;
07387 n->Arg<CNode*>(1) = a1;
07388 return n;
07389 }
07400 inline CNode* cCAST( CObstack* heap, CNode* a0, CNode* a1, Coord_t* loc=NULL )
07401 {
07402 CNode* n = new(heap) CNode( loc, eCAST );
07403 n->Arg<CNode*>(0) = a0;
07404 n->Arg<CNode*>(1) = a1;
07405 return n;
07406 }
07407 #endif // DEFINE_CONSTUCTOR
07408
07409
07410
07411
07412
07413
07414
07415
07416
07417 #ifdef DEFINE_METHODS
07418
07419
07420
07421
07422
07423 int CNode::ArgCount()
07424 {
07425 switch( op ) {
07426 case eERROR:
07427 return 0;
07428 case eVCONSTANT:
07429 return 1;
07430 case eRCONSTANT:
07431 return 1;
07432 case eCOMMENT:
07433 return 1;
07434 case eVRQ:
07435 return 1;
07436 case ePRAGMA:
07437 return 1;
07438 case eELIST:
07439 return 2;
07440 case eWIDTH:
07441 return 2;
07442 case eNOP:
07443 return 0;
07444 case eSUB:
07445 return 2;
07446 case eMUL:
07447 return 2;
07448 case eDIV:
07449 return 2;
07450 case ePOW:
07451 return 2;
07452 case eADD:
07453 return 2;
07454 case eLSH:
07455 return 2;
07456 case eRSH:
07457 return 2;
07458 case eLSHA:
07459 return 2;
07460 case eRSHA:
07461 return 2;
07462 case eMOD:
07463 return 2;
07464 case eOR:
07465 return 2;
07466 case eAND:
07467 return 2;
07468 case eANDANDAND:
07469 return 2;
07470 case eXOR:
07471 return 2;
07472 case eXNOR:
07473 return 2;
07474 case eINSTANCE_REF:
07475 return 1;
07476 case eGATE_REF:
07477 return 1;
07478 case eTASK_ENABLE:
07479 return 2;
07480 case eSYSTASK_CALL:
07481 return 2;
07482 case eTIMING_CALL:
07483 return 2;
07484 case eFUNCTION_CALL:
07485 return 3;
07486 case eARRAY:
07487 return 2;
07488 case eNET_REF:
07489 return 1;
07490 case eVAR_REF:
07491 return 1;
07492 case ePARAM_REF:
07493 return 1;
07494 case ePORT_REF:
07495 return 1;
07496 case eFWD_REF:
07497 return 1;
07498 case eGENVAR_REF:
07499 return 1;
07500 case eENUM_REF:
07501 return 1;
07502 case eTYPE_REF:
07503 return 1;
07504 case eNET_DECL:
07505 return 2;
07506 case eVAR_DECL:
07507 return 2;
07508 case ePARAM_DECL:
07509 return 1;
07510 case eSPECPARAM_DECL:
07511 return 1;
07512 case ePORT_DECL:
07513 return 1;
07514 case eGENVAR_DECL:
07515 return 1;
07516 case eTYPEDEF_DECL:
07517 return 1;
07518 case eLIST:
07519 return 2;
07520 case eRANGE:
07521 return 2;
07522 case eSLICE:
07523 return 2;
07524 case ePSLICE:
07525 return 2;
07526 case eMSLICE:
07527 return 2;
07528 case eCVRI:
07529 return 1;
07530 case eCVIR:
07531 return 1;
07532 case eREP:
07533 return 2;
07534 case eCAT:
07535 return 2;
07536 case eUCAT:
07537 return 1;
07538 case eCOM:
07539 return 1;
07540 case eNEG:
07541 return 1;
07542 case ePLUS:
07543 return 1;
07544 case eNOT:
07545 return 1;
07546 case eGT:
07547 return 2;
07548 case eGE:
07549 return 2;
07550 case eLT:
07551 return 2;
07552 case eLE:
07553 return 2;
07554 case eLAND:
07555 return 2;
07556 case eLOR:
07557 return 2;
07558 case eCEQ:
07559 return 2;
07560 case eCNE:
07561 return 2;
07562 case eEQ:
07563 return 2;
07564 case eNE:
07565 return 2;
07566 case eRAND:
07567 return 1;
07568 case eRNAND:
07569 return 1;
07570 case eROR:
07571 return 1;
07572 case eRNOR:
07573 return 1;
07574 case eRXOR:
07575 return 1;
07576 case eRXNOR:
07577 return 1;
07578 case eHOOK:
07579 return 3;
07580 case eINIT:
07581 return 1;
07582 case eALWAYS:
07583 return 1;
07584 case eALWAYS_LATCH:
07585 return 1;
07586 case eALWAYS_FF:
07587 return 1;
07588 case eALWAYS_COMB:
07589 return 1;
07590 case eEVENT:
07591 return 2;
07592 case eBLOCK_REF:
07593 return 2;
07594 case eSPECIFY_REF:
07595 return 2;
07596 case eASSIGN:
07597 return 3;
07598 case eADD_ASSIGN:
07599 return 3;
07600 case eSUB_ASSIGN:
07601 return 3;
07602 case eMUL_ASSIGN:
07603 return 3;
07604 case eDIV_ASSIGN:
07605 return 3;
07606 case eMOD_ASSIGN:
07607 return 3;
07608 case eAND_ASSIGN:
07609 return 3;
07610 case eOR_ASSIGN:
07611 return 3;
07612 case eXOR_ASSIGN:
07613 return 3;
07614 case eLSH_ASSIGN:
07615 return 3;
07616 case eRSH_ASSIGN:
07617 return 3;
07618 case eLSHA_ASSIGN:
07619 return 3;
07620 case eRSHA_ASSIGN:
07621 return 3;
07622 case eFORCE:
07623 return 2;
07624 case eRELEASE:
07625 return 1;
07626 case eNBASSIGN:
07627 return 3;
07628 case ePOSEDGE:
07629 return 1;
07630 case eNEGEDGE:
07631 return 1;
07632 case eEDGE:
07633 return 2;
07634 case eEVOR:
07635 return 2;
07636 case eDELAY:
07637 return 2;
07638 case eMTM:
07639 return 3;
07640 case eIF:
07641 return 3;
07642 case eFOREVER:
07643 return 1;
07644 case eREPEAT:
07645 return 2;
07646 case eWHILE:
07647 return 2;
07648 case eWAIT:
07649 return 2;
07650 case eFOR:
07651 return 4;
07652 case eCASE:
07653 return 2;
07654 case eCASEX:
07655 return 2;
07656 case eCASEZ:
07657 return 2;
07658 case eCASEITEM:
07659 return 2;
07660 case eCASSIGN:
07661 return 4;
07662 case eARG:
07663 return 2;
07664 case eFUNCTION_DEF:
07665 return 1;
07666 case eMODULE_DEF:
07667 return 1;
07668 case eREPEAT_CONTROL:
07669 return 2;
07670 case eDELAY_CONTROL:
07671 return 1;
07672 case eEVENT_CONTROL:
07673 return 1;
07674 case eEXTERNAL_REF:
07675 return 1;
07676 case ePORT_DEF:
07677 return 1;
07678 case eDEFPARAM:
07679 return 2;
07680 case ePATH:
07681 return 7;
07682 case ePATH_ASSIGN:
07683 return 3;
07684 case eIFNONE_PATH_ASSIGN:
07685 return 2;
07686 case eTRIGGER:
07687 return 1;
07688 case ePASSIGN:
07689 return 2;
07690 case eDEASSIGN:
07691 return 1;
07692 case eDISABLE:
07693 return 1;
07694 case eATTRIBUTE:
07695 return 1;
07696 case eGIF:
07697 return 3;
07698 case eGFOR:
07699 return 4;
07700 case eGCASE:
07701 return 2;
07702 case eTABLE:
07703 return 1;
07704 case eTABLE_ENTRY:
07705 return 1;
07706 case eTABLE_SYMBOL:
07707 return 1;
07708 case ePORTLIST_END:
07709 return 0;
07710 case eMACRO_EXPR:
07711 return 2;
07712 case eENUM_SPEC:
07713 return 3;
07714 case eMEMBER:
07715 return 2;
07716 case eRETURN:
07717 return 1;
07718 case ePREINC:
07719 return 1;
07720 case ePOSTINC:
07721 return 1;
07722 case ePREDEC:
07723 return 1;
07724 case ePOSTDEC:
07725 return 1;
07726 case eCAST:
07727 return 2;
07728 default:
07729 MASSERT(FALSE);
07730 }
07731 return 0;
07732 }
07733
07734
07735
07736
07737
07738
07739 int CNode::Precedence()
07740 {
07741 switch( op ) {
07742 case eERROR:
07743 return 13;
07744 case eVCONSTANT:
07745 return 13;
07746 case eRCONSTANT:
07747 return 13;
07748 case eCOMMENT:
07749 return 13;
07750 case eVRQ:
07751 return 13;
07752 case ePRAGMA:
07753 return 13;
07754 case eELIST:
07755 return 13;
07756 case eWIDTH:
07757 return 13;
07758 case eSUB:
07759 return 9;
07760 case eMUL:
07761 return 10;
07762 case eDIV:
07763 return 10;
07764 case ePOW:
07765 return 11;
07766 case eADD:
07767 return 9;
07768 case eLSH:
07769 return 8;
07770 case eRSH:
07771 return 8;
07772 case eLSHA:
07773 return 8;
07774 case eRSHA:
07775 return 8;
07776 case eMOD:
07777 return 10;
07778 case eOR:
07779 return 3;
07780 case eAND:
07781 return 5;
07782 case eANDANDAND:
07783 return 0;
07784 case eXOR:
07785 return 4;
07786 case eXNOR:
07787 return 4;
07788 case eSYSTASK_CALL:
07789 return 13;
07790 case eFUNCTION_CALL:
07791 return 13;
07792 case eARRAY:
07793 return 13;
07794 case eNET_REF:
07795 return 13;
07796 case eVAR_REF:
07797 return 13;
07798 case ePARAM_REF:
07799 return 13;
07800 case ePORT_REF:
07801 return 13;
07802 case eFWD_REF:
07803 return 13;
07804 case eGENVAR_REF:
07805 return 13;
07806 case eENUM_REF:
07807 return 13;
07808 case eTYPE_REF:
07809 return 13;
07810 case eRANGE:
07811 return 13;
07812 case eSLICE:
07813 return 13;
07814 case ePSLICE:
07815 return 13;
07816 case eMSLICE:
07817 return 13;
07818 case eCVRI:
07819 return 13;
07820 case eCVIR:
07821 return 13;
07822 case eREP:
07823 return 13;
07824 case eCAT:
07825 return 13;
07826 case eUCAT:
07827 return 13;
07828 case eCOM:
07829 return 12;
07830 case eNEG:
07831 return 12;
07832 case ePLUS:
07833 return 12;
07834 case eNOT:
07835 return 12;
07836 case eGT:
07837 return 7;
07838 case eGE:
07839 return 7;
07840 case eLT:
07841 return 7;
07842 case eLE:
07843 return 7;
07844 case eLAND:
07845 return 2;
07846 case eLOR:
07847 return 1;
07848 case eCEQ:
07849 return 6;
07850 case eCNE:
07851 return 6;
07852 case eEQ:
07853 return 6;
07854 case eNE:
07855 return 6;
07856 case eRAND:
07857 return 12;
07858 case eRNAND:
07859 return 12;
07860 case eROR:
07861 return 12;
07862 case eRNOR:
07863 return 12;
07864 case eRXOR:
07865 return 12;
07866 case eRXNOR:
07867 return 12;
07868 case eHOOK:
07869 return 0;
07870 case ePOSEDGE:
07871 return 13;
07872 case eNEGEDGE:
07873 return 13;
07874 case eEDGE:
07875 return 13;
07876 case eEVOR:
07877 return 13;
07878 case eMTM:
07879 return 13;
07880 case eEXTERNAL_REF:
07881 return 13;
07882 case eMACRO_EXPR:
07883 return 13;
07884 case eMEMBER:
07885 return 13;
07886 case ePREINC:
07887 return 12;
07888 case ePOSTINC:
07889 return 12;
07890 case ePREDEC:
07891 return 12;
07892 case ePOSTDEC:
07893 return 12;
07894 case eCAST:
07895 return 13;
07896 default:
07897 MASSERT( FALSE );
07898 return 13;
07899 }
07900 }
07901
07902
07903
07904
07905
07906
07907 int CNode::IsConstant()
07908 {
07909 switch( op ) {
07910 case eERROR:
07911 return FALSE;
07912 case eVCONSTANT:
07913 return TRUE;
07914 case eRCONSTANT:
07915 return TRUE;
07916 case eCOMMENT:
07917 return TRUE;
07918 case eVRQ:
07919 return TRUE;
07920 case ePRAGMA:
07921 return TRUE;
07922 case eELIST:
07923 return Arg<CNode*>(0)->IsConstant() && Arg<CNode*>(1)->IsConstant();
07924 case eWIDTH:
07925 return Arg<CNode*>(0)->IsConstant() && Arg<CNode*>(1)->IsConstant();
07926 case eSUB:
07927 return Arg<CNode*>(0)->IsConstant() && Arg<CNode*>(1)->IsConstant();
07928 case eMUL:
07929 return Arg<CNode*>(0)->IsConstant() && Arg<CNode*>(1)->IsConstant();
07930 case eDIV:
07931 return Arg<CNode*>(0)->IsConstant() && Arg<CNode*>(1)->IsConstant();
07932 case ePOW:
07933 return Arg<CNode*>(0)->IsConstant() && Arg<CNode*>(1)->IsConstant();
07934 case eADD:
07935 return Arg<CNode*>(0)->IsConstant() && Arg<CNode*>(1)->IsConstant();
07936 case eLSH:
07937 return Arg<CNode*>(0)->IsConstant() && Arg<CNode*>(1)->IsConstant();
07938 case eRSH:
07939 return Arg<CNode*>(0)->IsConstant() && Arg<CNode*>(1)->IsConstant();
07940 case eLSHA:
07941 return Arg<CNode*>(0)->IsConstant() && Arg<CNode*>(1)->IsConstant();
07942 case eRSHA:
07943 return Arg<CNode*>(0)->IsConstant() && Arg<CNode*>(1)->IsConstant();
07944 case eMOD:
07945 return Arg<CNode*>(0)->IsConstant() && Arg<CNode*>(1)->IsConstant();
07946 case eOR:
07947 return Arg<CNode*>(0)->IsConstant() && Arg<CNode*>(1)->IsConstant();
07948 case eAND:
07949 return Arg<CNode*>(0)->IsConstant() && Arg<CNode*>(1)->IsConstant();
07950 case eANDANDAND:
07951 return Arg<CNode*>(0)->IsConstant() && Arg<CNode*>(1)->IsConstant();
07952 case eXOR:
07953 return Arg<CNode*>(0)->IsConstant() && Arg<CNode*>(1)->IsConstant();
07954 case eXNOR:
07955 return Arg<CNode*>(0)->IsConstant() && Arg<CNode*>(1)->IsConstant();
07956 case eSYSTASK_CALL:
07957 return TRUE;
07958 case eFUNCTION_CALL:
07959 return Arg<CNode*>(1)->IsConstant();
07960 case eARRAY:
07961 return Arg<CNode*>(0)->IsConstant() && Arg<CNode*>(1)->IsConstant();
07962 case eNET_REF:
07963 return FALSE;
07964 case eVAR_REF:
07965 return FALSE;
07966 case ePARAM_REF:
07967 return TRUE;
07968 case ePORT_REF:
07969 return FALSE;
07970 case eFWD_REF:
07971 return FALSE;
07972 case eGENVAR_REF:
07973 return TRUE;
07974 case eENUM_REF:
07975 return TRUE;
07976 case eTYPE_REF:
07977 return TRUE;
07978 case eRANGE:
07979 return Arg<CNode*>(0)->IsConstant() && Arg<CNode*>(1)->IsConstant();
07980 case eSLICE:
07981 return Arg<CNode*>(0)->IsConstant() && Arg<CNode*>(1)->IsConstant();
07982 case ePSLICE:
07983 return Arg<CNode*>(0)->IsConstant() && Arg<CNode*>(1)->IsConstant();
07984 case eMSLICE:
07985 return Arg<CNode*>(0)->IsConstant() && Arg<CNode*>(1)->IsConstant();
07986 case eCVRI:
07987 return Arg<CNode*>(0)->IsConstant();
07988 case eCVIR:
07989 return Arg<CNode*>(0)->IsConstant();
07990 case eREP:
07991 return Arg<CNode*>(0)->IsConstant() && Arg<CNode*>(1)->IsConstant();
07992 case eCAT:
07993 return Arg<CNode*>(0)->IsConstant() && Arg<CNode*>(1)->IsConstant();
07994 case eUCAT:
07995 return Arg<CNode*>(0)->IsConstant();
07996 case eCOM:
07997 return Arg<CNode*>(0)->IsConstant();
07998 case eNEG:
07999 return Arg<CNode*>(0)->IsConstant();
08000 case ePLUS:
08001 return Arg<CNode*>(0)->IsConstant();
08002 case eNOT:
08003 return Arg<CNode*>(0)->IsConstant();
08004 case eGT:
08005 return Arg<CNode*>(0)->IsConstant() && Arg<CNode*>(1)->IsConstant();
08006 case eGE:
08007 return Arg<CNode*>(0)->IsConstant() && Arg<CNode*>(1)->IsConstant();
08008 case eLT:
08009 return Arg<CNode*>(0)->IsConstant() && Arg<CNode*>(1)->IsConstant();
08010 case eLE:
08011 return Arg<CNode*>(0)->IsConstant() && Arg<CNode*>(1)->IsConstant();
08012 case eLAND:
08013 return Arg<CNode*>(0)->IsConstant() && Arg<CNode*>(1)->IsConstant();
08014 case eLOR:
08015 return Arg<CNode*>(0)->IsConstant() && Arg<CNode*>(1)->IsConstant();
08016 case eCEQ:
08017 return Arg<CNode*>(0)->IsConstant() && Arg<CNode*>(1)->IsConstant();
08018 case eCNE:
08019 return Arg<CNode*>(0)->IsConstant() && Arg<CNode*>(1)->IsConstant();
08020 case eEQ:
08021 return Arg<CNode*>(0)->IsConstant() && Arg<CNode*>(1)->IsConstant();
08022 case eNE:
08023 return Arg<CNode*>(0)->IsConstant() && Arg<CNode*>(1)->IsConstant();
08024 case eRAND:
08025 return Arg<CNode*>(0)->IsConstant();
08026 case eRNAND:
08027 return Arg<CNode*>(0)->IsConstant();
08028 case eROR:
08029 return Arg<CNode*>(0)->IsConstant();
08030 case eRNOR:
08031 return Arg<CNode*>(0)->IsConstant();
08032 case eRXOR:
08033 return Arg<CNode*>(0)->IsConstant();
08034 case eRXNOR:
08035 return Arg<CNode*>(0)->IsConstant();
08036 case eHOOK:
08037 return Arg<CNode*>(0)->IsConstant() && Arg<CNode*>(1)->IsConstant() && Arg<CNode*>(2)->IsConstant();
08038 case eMTM:
08039 return Arg<CNode*>(0)->IsConstant() && Arg<CNode*>(1)->IsConstant() && Arg<CNode*>(2)->IsConstant();
08040 case eEXTERNAL_REF:
08041 return FALSE;
08042 case eMACRO_EXPR:
08043 return TRUE;
08044 case eMEMBER:
08045 return Arg<CNode*>(0)->IsConstant();
08046 case ePREINC:
08047 return Arg<CNode*>(0)->IsConstant();
08048 case ePOSTINC:
08049 return Arg<CNode*>(0)->IsConstant();
08050 case ePREDEC:
08051 return Arg<CNode*>(0)->IsConstant();
08052 case ePOSTDEC:
08053 return Arg<CNode*>(0)->IsConstant();
08054 case eCAST:
08055 return Arg<CNode*>(0)->IsConstant() && Arg<CNode*>(1)->IsConstant();
08056 default:
08057 MASSERT( FALSE );
08058 }
08059
08060 return TRUE;
08061 }
08062
08063
08064
08065
08066
08067
08068
08069 int CNode::IsVolatile()
08070 {
08071 switch( op ) {
08072 case eERROR:
08073 return TRUE;
08074 case eVCONSTANT:
08075 return FALSE;
08076 case eRCONSTANT:
08077 return FALSE;
08078 case eCOMMENT:
08079 return FALSE;
08080 case eVRQ:
08081 return FALSE;
08082 case ePRAGMA:
08083 return FALSE;
08084 case eELIST:
08085 return Arg<CNode*>(0)->IsVolatile() || Arg<CNode*>(1)->IsVolatile();
08086 case eWIDTH:
08087 return Arg<CNode*>(0)->IsVolatile() || Arg<CNode*>(1)->IsVolatile();
08088 case eSUB:
08089 return Arg<CNode*>(0)->IsVolatile() || Arg<CNode*>(1)->IsVolatile();
08090 case eMUL:
08091 return Arg<CNode*>(0)->IsVolatile() || Arg<CNode*>(1)->IsVolatile();
08092 case eDIV:
08093 return Arg<CNode*>(0)->IsVolatile() || Arg<CNode*>(1)->IsVolatile();
08094 case ePOW:
08095 return Arg<CNode*>(0)->IsVolatile() || Arg<CNode*>(1)->IsVolatile();
08096 case eADD:
08097 return Arg<CNode*>(0)->IsVolatile() || Arg<CNode*>(1)->IsVolatile();
08098 case eLSH:
08099 return Arg<CNode*>(0)->IsVolatile() || Arg<CNode*>(1)->IsVolatile();
08100 case eRSH:
08101 return Arg<CNode*>(0)->IsVolatile() || Arg<CNode*>(1)->IsVolatile();
08102 case eLSHA:
08103 return Arg<CNode*>(0)->IsVolatile() || Arg<CNode*>(1)->IsVolatile();
08104 case eRSHA:
08105 return Arg<CNode*>(0)->IsVolatile() || Arg<CNode*>(1)->IsVolatile();
08106 case eMOD:
08107 return Arg<CNode*>(0)->IsVolatile() || Arg<CNode*>(1)->IsVolatile();
08108 case eOR:
08109 return Arg<CNode*>(0)->IsVolatile() || Arg<CNode*>(1)->IsVolatile();
08110 case eAND:
08111 return Arg<CNode*>(0)->IsVolatile() || Arg<CNode*>(1)->IsVolatile();
08112 case eANDANDAND:
08113 return Arg<CNode*>(0)->IsVolatile() || Arg<CNode*>(1)->IsVolatile();
08114 case eXOR:
08115 return Arg<CNode*>(0)->IsVolatile() || Arg<CNode*>(1)->IsVolatile();
08116 case eXNOR:
08117 return Arg<CNode*>(0)->IsVolatile() || Arg<CNode*>(1)->IsVolatile();
08118 case eSYSTASK_CALL:
08119 return TRUE;
08120 case eFUNCTION_CALL:
08121 return Arg<CNode*>(1)->IsVolatile();
08122 case eARRAY:
08123 return Arg<CNode*>(0)->IsVolatile() || Arg<CNode*>(1)->IsVolatile();
08124 case eNET_REF:
08125 return TRUE;
08126 case eVAR_REF:
08127 return TRUE;
08128 case ePARAM_REF:
08129 return TRUE;
08130 case ePORT_REF:
08131 return TRUE;
08132 case eFWD_REF:
08133 return TRUE;
08134 case eGENVAR_REF:
08135 return TRUE;
08136 case eENUM_REF:
08137 return Arg<CEnum*>(0)->GetExpression()->IsVolatile();
08138 case eTYPE_REF:
08139 return FALSE;
08140 case eRANGE:
08141 return Arg<CNode*>(0)->IsVolatile() || Arg<CNode*>(1)->IsVolatile();
08142 case eSLICE:
08143 return Arg<CNode*>(0)->IsVolatile() || Arg<CNode*>(1)->IsVolatile();
08144 case ePSLICE:
08145 return Arg<CNode*>(0)->IsVolatile() || Arg<CNode*>(1)->IsVolatile();
08146 case eMSLICE:
08147 return Arg<CNode*>(0)->IsVolatile() || Arg<CNode*>(1)->IsVolatile();
08148 case eCVRI:
08149 return Arg<CNode*>(0)->IsVolatile();
08150 case eCVIR:
08151 return Arg<CNode*>(0)->IsVolatile();
08152 case eREP:
08153 return Arg<CNode*>(0)->IsVolatile() || Arg<CNode*>(1)->IsVolatile();
08154 case eCAT:
08155 return Arg<CNode*>(0)->IsVolatile() || Arg<CNode*>(1)->IsVolatile();
08156 case eUCAT:
08157 return Arg<CNode*>(0)->IsVolatile();
08158 case eCOM:
08159 return Arg<CNode*>(0)->IsVolatile();
08160 case eNEG:
08161 return Arg<CNode*>(0)->IsVolatile();
08162 case ePLUS:
08163 return Arg<CNode*>(0)->IsVolatile();
08164 case eNOT:
08165 return Arg<CNode*>(0)->IsVolatile();
08166 case eGT:
08167 return Arg<CNode*>(0)->IsVolatile() || Arg<CNode*>(1)->IsVolatile();
08168 case eGE:
08169 return Arg<CNode*>(0)->IsVolatile() || Arg<CNode*>(1)->IsVolatile();
08170 case eLT:
08171 return Arg<CNode*>(0)->IsVolatile() || Arg<CNode*>(1)->IsVolatile();
08172 case eLE:
08173 return Arg<CNode*>(0)->IsVolatile() || Arg<CNode*>(1)->IsVolatile();
08174 case eLAND:
08175 return Arg<CNode*>(0)->IsVolatile() || Arg<CNode*>(1)->IsVolatile();
08176 case eLOR:
08177 return Arg<CNode*>(0)->IsVolatile() || Arg<CNode*>(1)->IsVolatile();
08178 case eCEQ:
08179 return Arg<CNode*>(0)->IsVolatile() || Arg<CNode*>(1)->IsVolatile();
08180 case eCNE:
08181 return Arg<CNode*>(0)->IsVolatile() || Arg<CNode*>(1)->IsVolatile();
08182 case eEQ:
08183 return Arg<CNode*>(0)->IsVolatile() || Arg<CNode*>(1)->IsVolatile();
08184 case eNE:
08185 return Arg<CNode*>(0)->IsVolatile() || Arg<CNode*>(1)->IsVolatile();
08186 case eRAND:
08187 return Arg<CNode*>(0)->IsVolatile();
08188 case eRNAND:
08189 return Arg<CNode*>(0)->IsVolatile();
08190 case eROR:
08191 return Arg<CNode*>(0)->IsVolatile();
08192 case eRNOR:
08193 return Arg<CNode*>(0)->IsVolatile();
08194 case eRXOR:
08195 return Arg<CNode*>(0)->IsVolatile();
08196 case eRXNOR:
08197 return Arg<CNode*>(0)->IsVolatile();
08198 case eHOOK:
08199 return Arg<CNode*>(0)->IsVolatile() || Arg<CNode*>(1)->IsVolatile() || Arg<CNode*>(2)->IsVolatile();
08200 case eMTM:
08201 return TRUE;
08202 case eEXTERNAL_REF:
08203 return TRUE;
08204 case eMACRO_EXPR:
08205 return Arg<CNode*>(1) ? Arg<CNode*>(1)->IsVolatile() : TRUE;
08206 case eMEMBER:
08207 return Arg<CNode*>(0)->IsVolatile();
08208 case ePREINC:
08209 return Arg<CNode*>(0)->IsVolatile();
08210 case ePOSTINC:
08211 return Arg<CNode*>(0)->IsVolatile();
08212 case ePREDEC:
08213 return Arg<CNode*>(0)->IsVolatile();
08214 case ePOSTDEC:
08215 return Arg<CNode*>(0)->IsVolatile();
08216 case eCAST:
08217 return Arg<CNode*>(0)->IsVolatile() || Arg<CNode*>(1)->IsVolatile();
08218 default:
08219 MASSERT( FALSE );
08220 }
08221
08222 return TRUE;
08223 }
08224
08225
08226
08227
08228
08229
08230
08231 int CNode::IsWidthConstant( )
08232 {
08233 switch( GetOp() ) {
08234 case eERROR:
08235 return TRUE;
08236 case eVCONSTANT:
08237 return Arg<CVector*>(0)->IsWidthConstant();
08238 case eRCONSTANT:
08239 return TRUE;
08240 case eELIST:
08241 return Arg<CNode*>(0)->IsWidthConstant() && Arg<CNode*>(1)->IsWidthConstant();
08242 case eWIDTH:
08243 return Arg<CNode*>(0)->IsConstant();
08244 case eSUB:
08245 return Arg<CNode*>(0)->IsWidthConstant() && Arg<CNode*>(1)->IsWidthConstant();
08246 case eMUL:
08247 return Arg<CNode*>(0)->IsWidthConstant() && Arg<CNode*>(1)->IsWidthConstant();
08248 case eDIV:
08249 return Arg<CNode*>(0)->IsWidthConstant() && Arg<CNode*>(1)->IsWidthConstant();
08250 case ePOW:
08251 return Arg<CNode*>(0)->IsWidthConstant();
08252 case eADD:
08253 return Arg<CNode*>(0)->IsWidthConstant() && Arg<CNode*>(1)->IsWidthConstant();
08254 case eLSH:
08255 return Arg<CNode*>(0)->IsWidthConstant();
08256 case eRSH:
08257 return Arg<CNode*>(0)->IsWidthConstant();
08258 case eLSHA:
08259 return Arg<CNode*>(0)->IsWidthConstant();
08260 case eRSHA:
08261 return Arg<CNode*>(0)->IsWidthConstant();
08262 case eMOD:
08263 return Arg<CNode*>(0)->IsWidthConstant() && Arg<CNode*>(1)->IsWidthConstant();
08264 case eOR:
08265 return Arg<CNode*>(0)->IsWidthConstant() && Arg<CNode*>(1)->IsWidthConstant();
08266 case eAND:
08267 return Arg<CNode*>(0)->IsWidthConstant() && Arg<CNode*>(1)->IsWidthConstant();
08268 case eANDANDAND:
08269 return Arg<CNode*>(0)->IsWidthConstant() && Arg<CNode*>(1)->IsWidthConstant();
08270 case eXOR:
08271 return Arg<CNode*>(0)->IsWidthConstant() && Arg<CNode*>(1)->IsWidthConstant();
08272 case eXNOR:
08273 return Arg<CNode*>(0)->IsWidthConstant() && Arg<CNode*>(1)->IsWidthConstant();
08274 case eSYSTASK_CALL:
08275 return Systask::WidthConstant(Arg<CSymbol*>(0),Arg<CNode*>(1));
08276 case eFUNCTION_CALL:
08277 return CFunction::WidthConstant(Arg<CSymbol*>(0),Arg<CNode*>(1),Arg<CScope*>(2));
08278 case eARRAY:
08279 return Array::WidthConstant(Arg<CNode*>(0),Arg<CNode*>(1));
08280 case eNET_REF:
08281 return Arg<CNet*>(0)->IsWidthConstant();
08282 case eVAR_REF:
08283 return Arg<CVar*>(0)->IsWidthConstant();
08284 case ePARAM_REF:
08285 return Arg<CParam*>(0)->IsWidthConstant();
08286 case ePORT_REF:
08287 return Arg<CPortDir*>(0)->IsWidthConstant();
08288 case eFWD_REF:
08289 return Arg<CFref*>(0)->IsWidthConstant();
08290 case eGENVAR_REF:
08291 return Arg<CGenvar*>(0)->IsWidthConstant();
08292 case eENUM_REF:
08293 return Arg<CEnum*>(0)->IsWidthConstant();
08294 case eTYPE_REF:
08295 return TRUE;
08296 case eRANGE:
08297 return Arg<CNode*>(0)->IsConstant() && Arg<CNode*>(1)->IsConstant();
08298 case eSLICE:
08299 return Arg<CNode*>(0)->IsConstant() && Arg<CNode*>(1)->IsConstant();
08300 case ePSLICE:
08301 return Arg<CNode*>(1)->IsConstant();
08302 case eMSLICE:
08303 return Arg<CNode*>(1)->IsConstant();
08304 case eCVRI:
08305 return TRUE;
08306 case eCVIR:
08307 return TRUE;
08308 case eREP:
08309 return Arg<CNode*>(0)->IsConstant() && Arg<CNode*>(1)->IsWidthConstant();
08310 case eCAT:
08311 return Arg<CNode*>(0)->IsWidthConstant() && Arg<CNode*>(1)->IsWidthConstant();
08312 case eUCAT:
08313 return Arg<CNode*>(0)->IsWidthConstant();
08314 case eCOM:
08315 return Arg<CNode*>(0)->IsWidthConstant();
08316 case eNEG:
08317 return Arg<CNode*>(0)->IsWidthConstant();
08318 case ePLUS:
08319 return Arg<CNode*>(0)->IsWidthConstant();
08320 case eNOT:
08321 return TRUE;
08322 case eGT:
08323 return TRUE;
08324 case eGE:
08325 return TRUE;
08326 case eLT:
08327 return TRUE;
08328 case eLE:
08329 return TRUE;
08330 case eLAND:
08331 return TRUE;
08332 case eLOR:
08333 return TRUE;
08334 case eCEQ:
08335 return TRUE;
08336 case eCNE:
08337 return TRUE;
08338 case eEQ:
08339 return TRUE;
08340 case eNE:
08341 return TRUE;
08342 case eRAND:
08343 return TRUE;
08344 case eRNAND:
08345 return TRUE;
08346 case eROR:
08347 return TRUE;
08348 case eRNOR:
08349 return TRUE;
08350 case eRXOR:
08351 return TRUE;
08352 case eRXNOR:
08353 return TRUE;
08354 case eHOOK:
08355 return Arg<CNode*>(1)->IsWidthConstant() && Arg<CNode*>(2)->IsWidthConstant();
08356 case eMTM:
08357 return Arg<CNode*>(0)->IsWidthConstant() && Arg<CNode*>(1)->IsWidthConstant() && Arg<CNode*>(2)->IsWidthConstant();
08358 case eEXTERNAL_REF:
08359 return External::WidthConstant(Arg<CSymbol*>(0));
08360 case eATTRIBUTE:
08361 return TRUE;
08362 case eMACRO_EXPR:
08363 return Arg<CNode*>(1)->IsWidthConstant();
08364 case eMEMBER:
08365 return Member::WidthConstant(Arg<CNode*>(0),Arg<CSymbol*>(1));
08366 case ePREINC:
08367 return Arg<CNode*>(0)->IsWidthConstant();
08368 case ePOSTINC:
08369 return Arg<CNode*>(0)->IsWidthConstant();
08370 case ePREDEC:
08371 return Arg<CNode*>(0)->IsWidthConstant();
08372 case ePOSTDEC:
08373 return Arg<CNode*>(0)->IsWidthConstant();
08374 case eCAST:
08375 return Arg<CNode*>(0)->IsConstant();
08376 default:
08377 MASSERT( FALSE );
08378 return 0;
08379 }
08380 }
08381
08382
08383
08384
08385
08386
08387 int CNode::IsWidthVolatile( )
08388 {
08389 switch( GetOp() ) {
08390 case eERROR:
08391 return FALSE;
08392 case eVCONSTANT:
08393 return Arg<CVector*>(0)->IsWidthVolatile();
08394 case eRCONSTANT:
08395 return FALSE;
08396 case eELIST:
08397 return Arg<CNode*>(0)->IsWidthVolatile() || Arg<CNode*>(1)->IsWidthVolatile();
08398 case eWIDTH:
08399 return Arg<CNode*>(0)->IsVolatile();
08400 case eSUB:
08401 return Arg<CNode*>(0)->IsWidthVolatile() || Arg<CNode*>(1)->IsWidthVolatile();
08402 case eMUL:
08403 return Arg<CNode*>(0)->IsWidthVolatile() || Arg<CNode*>(1)->IsWidthVolatile();
08404 case eDIV:
08405 return Arg<CNode*>(0)->IsWidthVolatile() || Arg<CNode*>(1)->IsWidthVolatile();
08406 case ePOW:
08407 return Arg<CNode*>(0)->IsWidthVolatile();
08408 case eADD:
08409 return Arg<CNode*>(0)->IsWidthVolatile() || Arg<CNode*>(1)->IsWidthVolatile();
08410 case eLSH:
08411 return Arg<CNode*>(0)->IsWidthVolatile();
08412 case eRSH:
08413 return Arg<CNode*>(0)->IsWidthVolatile();
08414 case eLSHA:
08415 return Arg<CNode*>(0)->IsWidthVolatile();
08416 case eRSHA:
08417 return Arg<CNode*>(0)->IsWidthVolatile();
08418 case eMOD:
08419 return Arg<CNode*>(0)->IsWidthVolatile() || Arg<CNode*>(1)->IsWidthVolatile();
08420 case eOR:
08421 return Arg<CNode*>(0)->IsWidthVolatile() || Arg<CNode*>(1)->IsWidthVolatile();
08422 case eAND:
08423 return Arg<CNode*>(0)->IsWidthVolatile() || Arg<CNode*>(1)->IsWidthVolatile();
08424 case eANDANDAND:
08425 return Arg<CNode*>(0)->IsWidthVolatile() || Arg<CNode*>(1)->IsWidthVolatile();
08426 case eXOR:
08427 return Arg<CNode*>(0)->IsWidthVolatile() || Arg<CNode*>(1)->IsWidthVolatile();
08428 case eXNOR:
08429 return Arg<CNode*>(0)->IsWidthVolatile() || Arg<CNode*>(1)->IsWidthVolatile();
08430 case eSYSTASK_CALL:
08431 return Systask::WidthVolatile(Arg<CSymbol*>(0),Arg<CNode*>(1));
08432 case eFUNCTION_CALL:
08433 return CFunction::WidthVolatile(Arg<CSymbol*>(0),Arg<CNode*>(1),Arg<CScope*>(2));
08434 case eARRAY:
08435 return Array::WidthVolatile(Arg<CNode*>(0),Arg<CNode*>(1));
08436 case eNET_REF:
08437 return Arg<CNet*>(0)->IsWidthVolatile();
08438 case eVAR_REF:
08439 return Arg<CVar*>(0)->IsWidthVolatile();
08440 case ePARAM_REF:
08441 return Arg<CParam*>(0)->IsWidthVolatile();
08442 case ePORT_REF:
08443 return Arg<CPortDir*>(0)->IsWidthVolatile();
08444 case eFWD_REF:
08445 return Arg<CFref*>(0)->IsWidthVolatile();
08446 case eGENVAR_REF:
08447 return Arg<CGenvar*>(0)->IsWidthVolatile();
08448 case eENUM_REF:
08449 return Arg<CEnum*>(0)->IsWidthVolatile();
08450 case eTYPE_REF:
08451 return FALSE;
08452 case eRANGE:
08453 return Arg<CNode*>(0)->IsVolatile() || Arg<CNode*>(1)->IsVolatile();
08454 case eSLICE:
08455 return Arg<CNode*>(0)->IsVolatile() || Arg<CNode*>(1)->IsVolatile();
08456 case ePSLICE:
08457 return Arg<CNode*>(1)->IsVolatile();
08458 case eMSLICE:
08459 return Arg<CNode*>(1)->IsVolatile();
08460 case eCVRI:
08461 return FALSE;
08462 case eCVIR:
08463 return FALSE;
08464 case eREP:
08465 return Arg<CNode*>(0)->IsVolatile() || Arg<CNode*>(1)->IsWidthVolatile();
08466 case eCAT:
08467 return Arg<CNode*>(0)->IsWidthVolatile() || Arg<CNode*>(1)->IsWidthVolatile();
08468 case eUCAT:
08469 return Arg<CNode*>(0)->IsWidthVolatile();
08470 case eCOM:
08471 return Arg<CNode*>(0)->IsWidthVolatile();
08472 case eNEG:
08473 return Arg<CNode*>(0)->IsWidthVolatile();
08474 case ePLUS:
08475 return Arg<CNode*>(0)->IsWidthVolatile();
08476 case eNOT:
08477 return FALSE;
08478 case eGT:
08479 return FALSE;
08480 case eGE:
08481 return FALSE;
08482 case eLT:
08483 return FALSE;
08484 case eLE:
08485 return FALSE;
08486 case eLAND:
08487 return FALSE;
08488 case eLOR:
08489 return FALSE;
08490 case eCEQ:
08491 return FALSE;
08492 case eCNE:
08493 return FALSE;
08494 case eEQ:
08495 return FALSE;
08496 case eNE:
08497 return FALSE;
08498 case eRAND:
08499 return FALSE;
08500 case eRNAND:
08501 return FALSE;
08502 case eROR:
08503 return FALSE;
08504 case eRNOR:
08505 return FALSE;
08506 case eRXOR:
08507 return FALSE;
08508 case eRXNOR:
08509 return FALSE;
08510 case eHOOK:
08511 return Arg<CNode*>(1)->IsWidthVolatile() || Arg<CNode*>(2)->IsWidthVolatile();
08512 case eMTM:
08513 return Arg<CNode*>(0)->IsWidthVolatile() || Arg<CNode*>(1)->IsWidthVolatile() || Arg<CNode*>(2)->IsWidthVolatile();
08514 case eEXTERNAL_REF:
08515 return External::WidthVolatile(Arg<CSymbol*>(0));
08516 case eATTRIBUTE:
08517 return FALSE;
08518 case eMACRO_EXPR:
08519 return Arg<CNode*>(1)->IsWidthVolatile();
08520 case eMEMBER:
08521 return Member::WidthVolatile(Arg<CNode*>(0),Arg<CSymbol*>(1));
08522 case ePREINC:
08523 return Arg<CNode*>(0)->IsWidthVolatile();
08524 case ePOSTINC:
08525 return Arg<CNode*>(0)->IsWidthVolatile();
08526 case ePREDEC:
08527 return Arg<CNode*>(0)->IsWidthVolatile();
08528 case ePOSTDEC:
08529 return Arg<CNode*>(0)->IsWidthVolatile();
08530 case eCAST:
08531 return Arg<CNode*>(0)->IsVolatile();
08532 default:
08533 MASSERT( FALSE );
08534 return 0;
08535 }
08536
08537 }
08538
08539
08540
08541
08542
08543
08544
08545 CNode* CNode::GetWidthExp()
08546 {
08547 switch( GetOp() ) {
08548 case eERROR:
08549 return NULL;
08550 case eVCONSTANT:
08551 return Arg<CVector*>(0)->GetWidthExp();
08552 case eRCONSTANT:
08553 return NULL;
08554 case eELIST:
08555 return (Arg<CNode*>(0)->GetWidthExp() && Arg<CNode*>(1)->GetWidthExp()) ? cADD_N(Arg<CNode*>(0)->GetWidthExp(),Arg<CNode*>(1)->GetWidthExp(),NULL) : NULL;
08556 case eWIDTH:
08557 return cINT32(Arg<CNode*>(0)->EvalINT32());
08558 case eSUB:
08559 return (Arg<CNode*>(0)->GetWidthExp() && Arg<CNode*>(1)->GetWidthExp()) ? cMAX_N(Arg<CNode*>(0)->GetWidthExp(),Arg<CNode*>(1)->GetWidthExp(),NULL) : NULL;
08560 case eMUL:
08561 return (Arg<CNode*>(0)->GetWidthExp() && Arg<CNode*>(1)->GetWidthExp()) ? cMAX_N(Arg<CNode*>(0)->GetWidthExp(),Arg<CNode*>(1)->GetWidthExp(),NULL) : NULL;
08562 case eDIV:
08563 return (Arg<CNode*>(0)->GetWidthExp() && Arg<CNode*>(1)->GetWidthExp()) ? cMAX_N(Arg<CNode*>(0)->GetWidthExp(),Arg<CNode*>(1)->GetWidthExp(),NULL) : NULL;
08564 case ePOW:
08565 return Arg<CNode*>(0)->GetWidthExp();
08566 case eADD:
08567 return (Arg<CNode*>(0)->GetWidthExp() && Arg<CNode*>(1)->GetWidthExp()) ? cMAX_N(Arg<CNode*>(0)->GetWidthExp(),Arg<CNode*>(1)->GetWidthExp(),NULL) : NULL;
08568 case eLSH:
08569 return Arg<CNode*>(0)->GetWidthExp();
08570 case eRSH:
08571 return Arg<CNode*>(0)->GetWidthExp();
08572 case eLSHA:
08573 return Arg<CNode*>(0)->GetWidthExp();
08574 case eRSHA:
08575 return Arg<CNode*>(0)->GetWidthExp();
08576 case eMOD:
08577 return (Arg<CNode*>(0)->GetWidthExp() && Arg<CNode*>(1)->GetWidthExp()) ? cMAX_N(Arg<CNode*>(0)->GetWidthExp(),Arg<CNode*>(1)->GetWidthExp(),NULL) : NULL;
08578 case eOR:
08579 return (Arg<CNode*>(0)->GetWidthExp() && Arg<CNode*>(1)->GetWidthExp()) ? cMAX_N(Arg<CNode*>(0)->GetWidthExp(),Arg<CNode*>(1)->GetWidthExp(),NULL) : NULL;
08580 case eAND:
08581 return (Arg<CNode*>(0)->GetWidthExp() && Arg<CNode*>(1)->GetWidthExp()) ? cMAX_N(Arg<CNode*>(0)->GetWidthExp(),Arg<CNode*>(1)->GetWidthExp(),NULL) : NULL;
08582 case eANDANDAND:
08583 return (Arg<CNode*>(0)->GetWidthExp() && Arg<CNode*>(1)->GetWidthExp()) ? cMAX_N(Arg<CNode*>(0)->GetWidthExp(),Arg<CNode*>(1)->GetWidthExp(),NULL) : NULL;
08584 case eXOR:
08585 return (Arg<CNode*>(0)->GetWidthExp() && Arg<CNode*>(1)->GetWidthExp()) ? cMAX_N(Arg<CNode*>(0)->GetWidthExp(),Arg<CNode*>(1)->GetWidthExp(),NULL) : NULL;
08586 case eXNOR:
08587 return (Arg<CNode*>(0)->GetWidthExp() && Arg<CNode*>(1)->GetWidthExp()) ? cMAX_N(Arg<CNode*>(0)->GetWidthExp(),Arg<CNode*>(1)->GetWidthExp(),NULL) : NULL;
08588 case eSYSTASK_CALL:
08589 return Systask::WidthExp(Arg<CSymbol*>(0),Arg<CNode*>(1));
08590 case eFUNCTION_CALL:
08591 return CFunction::WidthExp(Arg<CSymbol*>(0),Arg<CNode*>(1),Arg<CScope*>(2));
08592 case eARRAY:
08593 return Array::WidthExp(Arg<CNode*>(0),Arg<CNode*>(1));
08594 case eNET_REF:
08595 return Arg<CNet*>(0)->GetWidthExp();
08596 case eVAR_REF:
08597 return Arg<CVar*>(0)->GetWidthExp();
08598 case ePARAM_REF:
08599 return Arg<CParam*>(0)->GetWidthExp();
08600 case ePORT_REF:
08601 return Arg<CPortDir*>(0)->GetWidthExp();
08602 case eFWD_REF:
08603 return Arg<CFref*>(0)->GetWidthExp();
08604 case eGENVAR_REF:
08605 return Arg<CGenvar*>(0)->GetWidthExp();
08606 case eENUM_REF:
08607 return Arg<CEnum*>(0)->GetWidthExp();
08608 case eTYPE_REF:
08609 return cINT32(32);
08610 case eRANGE:
08611 return (1 && 1) ? cABSDIFFPLUS1_N(Arg<CNode*>(0)->Clone(),Arg<CNode*>(1)->Clone(),NULL) : NULL;
08612 case eSLICE:
08613 return (1 && 1) ? cABSDIFFPLUS1_N(Arg<CNode*>(0)->Clone(),Arg<CNode*>(1)->Clone(),NULL) : NULL;
08614 case ePSLICE:
08615 return Arg<CNode*>(1);
08616 case eMSLICE:
08617 return Arg<CNode*>(1);
08618 case eCVRI:
08619 return cINT32(32);
08620 case eCVIR:
08621 return NULL;
08622 case eREP:
08623 return (1 && Arg<CNode*>(1)->GetWidthExp()) ? cMUL_N(Arg<CNode*>(0)->Clone(),Arg<CNode*>(1)->GetWidthExp(),NULL) : NULL;
08624 case eCAT:
08625 return (Arg<CNode*>(0)->GetWidthExp() && Arg<CNode*>(1)->GetWidthExp()) ? cADD_N(Arg<CNode*>(0)->GetWidthExp(),Arg<CNode*>(1)->GetWidthExp(),NULL) : NULL;
08626 case eUCAT:
08627 return Arg<CNode*>(0)->GetWidthExp();
08628 case eCOM:
08629 return Arg<CNode*>(0)->GetWidthExp();
08630 case eNEG:
08631 return Arg<CNode*>(0)->GetWidthExp();
08632 case ePLUS:
08633 return Arg<CNode*>(0)->GetWidthExp();
08634 case eNOT:
08635 return cINT32(1);
08636 case eGT:
08637 return cINT32(1);
08638 case eGE:
08639 return cINT32(1);
08640 case eLT:
08641 return cINT32(1);
08642 case eLE:
08643 return cINT32(1);
08644 case eLAND:
08645 return cINT32(1);
08646 case eLOR:
08647 return cINT32(1);
08648 case eCEQ:
08649 return cINT32(1);
08650 case eCNE:
08651 return cINT32(1);
08652 case eEQ:
08653 return cINT32(1);
08654 case eNE:
08655 return cINT32(1);
08656 case eRAND:
08657 return cINT32(1);
08658 case eRNAND:
08659 return cINT32(1);
08660 case eROR:
08661 return cINT32(1);
08662 case eRNOR:
08663 return cINT32(1);
08664 case eRXOR:
08665 return cINT32(1);
08666 case eRXNOR:
08667 return cINT32(1);
08668 case eHOOK:
08669 return (Arg<CNode*>(1)->GetWidthExp() && Arg<CNode*>(2)->GetWidthExp()) ? cMAX_N(Arg<CNode*>(1)->GetWidthExp(),Arg<CNode*>(2)->GetWidthExp(),NULL) : NULL;
08670 case eMTM:
08671 return (Arg<CNode*>(0)->GetWidthExp() && Arg<CNode*>(1)->GetWidthExp() && Arg<CNode*>(2)->GetWidthExp()) ? cMAX_N(Arg<CNode*>(0)->GetWidthExp(),Arg<CNode*>(1)->GetWidthExp(),Arg<CNode*>(2)->GetWidthExp(),NULL) : NULL;
08672 case eEXTERNAL_REF:
08673 return External::WidthExp(Arg<CSymbol*>(0));
08674 case eATTRIBUTE:
08675 return cINT32(0);
08676 case eMACRO_EXPR:
08677 return Arg<CNode*>(1)->GetWidthExp();
08678 case eMEMBER:
08679 return Member::WidthExp(Arg<CNode*>(0),Arg<CSymbol*>(1));
08680 case ePREINC:
08681 return Arg<CNode*>(0)->GetWidthExp();
08682 case ePOSTINC:
08683 return Arg<CNode*>(0)->GetWidthExp();
08684 case ePREDEC:
08685 return Arg<CNode*>(0)->GetWidthExp();
08686 case ePOSTDEC:
08687 return Arg<CNode*>(0)->GetWidthExp();
08688 case eCAST:
08689 return cINT32(Arg<CNode*>(0)->EvalINT32());
08690 default:
08691 MASSERT( FALSE );
08692 return NULL;
08693 }
08694 }
08695
08696
08697
08698
08699
08700
08701 int CNode::IsWidthEvaluateable( )
08702 {
08703 switch( GetOp() ) {
08704 case eERROR:
08705 return FALSE;
08706 case eVCONSTANT:
08707 return Arg<CVector*>(0)->IsWidthEvaluateable();
08708 case eRCONSTANT:
08709 return FALSE;
08710 case eELIST:
08711 return Arg<CNode*>(0)->IsWidthEvaluateable() && Arg<CNode*>(1)->IsWidthEvaluateable();
08712 case eWIDTH:
08713 return Arg<CNode*>(0)->IsEvaluateable();
08714 case eSUB:
08715 return Arg<CNode*>(0)->IsWidthEvaluateable() && Arg<CNode*>(1)->IsWidthEvaluateable();
08716 case eMUL:
08717 return Arg<CNode*>(0)->IsWidthEvaluateable() && Arg<CNode*>(1)->IsWidthEvaluateable();
08718 case eDIV:
08719 return Arg<CNode*>(0)->IsWidthEvaluateable() && Arg<CNode*>(1)->IsWidthEvaluateable();
08720 case ePOW:
08721 return Arg<CNode*>(0)->IsWidthEvaluateable();
08722 case eADD:
08723 return Arg<CNode*>(0)->IsWidthEvaluateable() && Arg<CNode*>(1)->IsWidthEvaluateable();
08724 case eLSH:
08725 return Arg<CNode*>(0)->IsWidthEvaluateable();
08726 case eRSH:
08727 return Arg<CNode*>(0)->IsWidthEvaluateable();
08728 case eLSHA:
08729 return Arg<CNode*>(0)->IsWidthEvaluateable();
08730 case eRSHA:
08731 return Arg<CNode*>(0)->IsWidthEvaluateable();
08732 case eMOD:
08733 return Arg<CNode*>(0)->IsWidthEvaluateable() && Arg<CNode*>(1)->IsWidthEvaluateable();
08734 case eOR:
08735 return Arg<CNode*>(0)->IsWidthEvaluateable() && Arg<CNode*>(1)->IsWidthEvaluateable();
08736 case eAND:
08737 return Arg<CNode*>(0)->IsWidthEvaluateable() && Arg<CNode*>(1)->IsWidthEvaluateable();
08738 case eANDANDAND:
08739 return Arg<CNode*>(0)->IsWidthEvaluateable() && Arg<CNode*>(1)->IsWidthEvaluateable();
08740 case eXOR:
08741 return Arg<CNode*>(0)->IsWidthEvaluateable() && Arg<CNode*>(1)->IsWidthEvaluateable();
08742 case eXNOR:
08743 return Arg<CNode*>(0)->IsWidthEvaluateable() && Arg<CNode*>(1)->IsWidthEvaluateable();
08744 case eSYSTASK_CALL:
08745 return Systask::WidthEvaluateable(Arg<CSymbol*>(0),Arg<CNode*>(1));
08746 case eFUNCTION_CALL:
08747 return CFunction::WidthEvaluateable(Arg<CSymbol*>(0),Arg<CNode*>(1),Arg<CScope*>(2));
08748 case eARRAY:
08749 return Array::WidthEvaluateable(Arg<CNode*>(0),Arg<CNode*>(1));
08750 case eNET_REF:
08751 return Arg<CNet*>(0)->IsWidthEvaluateable();
08752 case eVAR_REF:
08753 return Arg<CVar*>(0)->IsWidthEvaluateable();
08754 case ePARAM_REF:
08755 return Arg<CParam*>(0)->IsWidthEvaluateable();
08756 case ePORT_REF:
08757 return Arg<CPortDir*>(0)->IsWidthEvaluateable();
08758 case eFWD_REF:
08759 return Arg<CFref*>(0)->IsWidthEvaluateable();
08760 case eGENVAR_REF:
08761 return Arg<CGenvar*>(0)->IsWidthEvaluateable();
08762 case eENUM_REF:
08763 return Arg<CEnum*>(0)->IsWidthEvaluateable();
08764 case eTYPE_REF:
08765 return TRUE;
08766 case eRANGE:
08767 return Arg<CNode*>(0)->IsEvaluateable() && Arg<CNode*>(1)->IsEvaluateable();
08768 case eSLICE:
08769 return Arg<CNode*>(0)->IsEvaluateable() && Arg<CNode*>(1)->IsEvaluateable();
08770 case ePSLICE:
08771 return Arg<CNode*>(1)->IsEvaluateable();
08772 case eMSLICE:
08773 return Arg<CNode*>(1)->IsEvaluateable();
08774 case eCVRI:
08775 return TRUE;
08776 case eCVIR:
08777 return FALSE;
08778 case eREP:
08779 return Arg<CNode*>(0)->IsEvaluateable() && Arg<CNode*>(1)->IsWidthEvaluateable();
08780 case eCAT:
08781 return Arg<CNode*>(0)->IsWidthEvaluateable() && Arg<CNode*>(1)->IsWidthEvaluateable();
08782 case eUCAT:
08783 return Arg<CNode*>(0)->IsWidthEvaluateable();
08784 case eCOM:
08785 return Arg<CNode*>(0)->IsWidthEvaluateable();
08786 case eNEG:
08787 return Arg<CNode*>(0)->IsWidthEvaluateable();
08788 case ePLUS:
08789 return Arg<CNode*>(0)->IsWidthEvaluateable();
08790 case eNOT:
08791 return TRUE;
08792 case eGT:
08793 return TRUE;
08794 case eGE:
08795 return TRUE;
08796 case eLT:
08797 return TRUE;
08798 case eLE:
08799 return TRUE;
08800 case eLAND:
08801 return TRUE;
08802 case eLOR:
08803 return TRUE;
08804 case eCEQ:
08805 return TRUE;
08806 case eCNE:
08807 return TRUE;
08808 case eEQ:
08809 return TRUE;
08810 case eNE:
08811 return TRUE;
08812 case eRAND:
08813 return TRUE;
08814 case eRNAND:
08815 return TRUE;
08816 case eROR:
08817 return TRUE;
08818 case eRNOR:
08819 return TRUE;
08820 case eRXOR:
08821 return TRUE;
08822 case eRXNOR:
08823 return TRUE;
08824 case eHOOK:
08825 return Arg<CNode*>(1)->IsWidthEvaluateable() && Arg<CNode*>(2)->IsWidthEvaluateable();
08826 case eMTM:
08827 return Arg<CNode*>(0)->IsWidthEvaluateable() && Arg<CNode*>(1)->IsWidthEvaluateable() && Arg<CNode*>(2)->IsWidthEvaluateable();
08828 case eEXTERNAL_REF:
08829 return External::WidthEvaluateable(Arg<CSymbol*>(0));
08830 case eATTRIBUTE:
08831 return TRUE;
08832 case eMACRO_EXPR:
08833 return Arg<CNode*>(1)->IsWidthEvaluateable();
08834 case eMEMBER:
08835 return Member::WidthEvaluateable(Arg<CNode*>(0),Arg<CSymbol*>(1));
08836 case ePREINC:
08837 return Arg<CNode*>(0)->IsWidthEvaluateable();
08838 case ePOSTINC:
08839 return Arg<CNode*>(0)->IsWidthEvaluateable();
08840 case ePREDEC:
08841 return Arg<CNode*>(0)->IsWidthEvaluateable();
08842 case ePOSTDEC:
08843 return Arg<CNode*>(0)->IsWidthEvaluateable();
08844 case eCAST:
08845 return Arg<CNode*>(0)->IsEvaluateable();
08846 default:
08847 MASSERT( FALSE );
08848 return 0;
08849 }
08850 }
08851
08852
08853
08854
08855
08856
08857
08858
08859 int CNode::IsNonX( int integerIsNonX, char* exclude )
08860 {
08861 switch( GetOp() ) {
08862 case eERROR:
08863 return FALSE;
08864 case eVCONSTANT:
08865 return !Arg<CVector*>(0)->HasXZ();
08866 case eRCONSTANT:
08867 return TRUE;
08868 case eELIST:
08869 return Arg<CNode*>(0)->IsNonX( integerIsNonX, exclude ) && Arg<CNode*>(1)->IsNonX( integerIsNonX, exclude );
08870 case eWIDTH:
08871 return Arg<CNode*>(0)->IsNonX( integerIsNonX, exclude ) && Arg<CNode*>(1)->IsNonX( integerIsNonX, exclude );
08872 case eSUB:
08873 return Arg<CNode*>(0)->IsNonX( integerIsNonX, exclude ) && Arg<CNode*>(1)->IsNonX( integerIsNonX, exclude );
08874 case eMUL:
08875 return Arg<CNode*>(0)->IsNonX( integerIsNonX, exclude ) && Arg<CNode*>(1)->IsNonX( integerIsNonX, exclude );
08876 case eDIV:
08877 return Arg<CNode*>(0)->IsNonX( integerIsNonX, exclude ) && Arg<CNode*>(1)->IsNonX( integerIsNonX, exclude );
08878 case ePOW:
08879 return Arg<CNode*>(0)->IsNonX( integerIsNonX, exclude ) && Arg<CNode*>(1)->IsNonX( integerIsNonX, exclude );
08880 case eADD:
08881 return Arg<CNode*>(0)->IsNonX( integerIsNonX, exclude ) && Arg<CNode*>(1)->IsNonX( integerIsNonX, exclude );
08882 case eLSH:
08883 return Arg<CNode*>(0)->IsNonX( integerIsNonX, exclude ) && Arg<CNode*>(1)->IsNonX( integerIsNonX, exclude );
08884 case eRSH:
08885 return Arg<CNode*>(0)->IsNonX( integerIsNonX, exclude ) && Arg<CNode*>(1)->IsNonX( integerIsNonX, exclude );
08886 case eLSHA:
08887 return Arg<CNode*>(0)->IsNonX( integerIsNonX, exclude ) && Arg<CNode*>(1)->IsNonX( integerIsNonX, exclude );
08888 case eRSHA:
08889 return Arg<CNode*>(0)->IsNonX( integerIsNonX, exclude ) && Arg<CNode*>(1)->IsNonX( integerIsNonX, exclude );
08890 case eMOD:
08891 return Arg<CNode*>(0)->IsNonX( integerIsNonX, exclude ) && Arg<CNode*>(1)->IsNonX( integerIsNonX, exclude );
08892 case eOR:
08893 return Arg<CNode*>(0)->IsNonX( integerIsNonX, exclude ) && Arg<CNode*>(1)->IsNonX( integerIsNonX, exclude );
08894 case eAND:
08895 return Arg<CNode*>(0)->IsNonX( integerIsNonX, exclude ) && Arg<CNode*>(1)->IsNonX( integerIsNonX, exclude );
08896 case eANDANDAND:
08897 return Arg<CNode*>(0)->IsNonX( integerIsNonX, exclude ) && Arg<CNode*>(1)->IsNonX( integerIsNonX, exclude );
08898 case eXOR:
08899 return Arg<CNode*>(0)->IsNonX( integerIsNonX, exclude ) && Arg<CNode*>(1)->IsNonX( integerIsNonX, exclude );
08900 case eXNOR:
08901 return Arg<CNode*>(0)->IsNonX( integerIsNonX, exclude ) && Arg<CNode*>(1)->IsNonX( integerIsNonX, exclude );
08902 case eSYSTASK_CALL:
08903 return FALSE;
08904 case eFUNCTION_CALL:
08905 return FALSE;
08906 case eARRAY:
08907 return Arg<CNode*>(0)->IsNonX( integerIsNonX, exclude ) && Arg<CNode*>(1)->IsNonX( integerIsNonX, exclude );
08908 case eNET_REF:
08909 return Arg<CDecl*>(0)->HasAttribute( exclude ) ||
08910
08911 (integerIsNonX && Arg<CDecl*>(0)->GetDataType()->GetVarDataType() == eINT);
08912 case eVAR_REF:
08913 return Arg<CDecl*>(0)->GetDataType()->GetTwoState() ||
08914
08915 Arg<CDecl*>(0)->GetNodeType() == eR ||
08916
08917 Arg<CDecl*>(0)->HasAttribute( exclude ) ||
08918
08919 (integerIsNonX && Arg<CDecl*>(0)->GetDataType()->GetVarDataType() == eINTEGER);
08920 case ePARAM_REF:
08921 return TRUE;
08922 case ePORT_REF:
08923 return Arg<CDecl*>(0)->HasAttribute( exclude ) ||
08924
08925 (integerIsNonX && Arg<CDecl*>(0)->GetDataType()->GetVarDataType() == eINT);
08926 case eFWD_REF:
08927 return FALSE;
08928 case eGENVAR_REF:
08929 return TRUE;
08930 case eENUM_REF:
08931 return Arg<CEnum*>(0)->GetExpression()->IsNonX( integerIsNonX, exclude );
08932 case eTYPE_REF:
08933 return TRUE;
08934 case eRANGE:
08935 return FALSE;
08936 case eSLICE:
08937 return Arg<CNode*>(0)->IsNonX( integerIsNonX, exclude ) && Arg<CNode*>(1)->IsNonX( integerIsNonX, exclude );
08938 case ePSLICE:
08939 return Arg<CNode*>(0)->IsNonX( integerIsNonX, exclude ) && Arg<CNode*>(1)->IsNonX( integerIsNonX, exclude );
08940 case eMSLICE:
08941 return Arg<CNode*>(0)->IsNonX( integerIsNonX, exclude ) && Arg<CNode*>(1)->IsNonX( integerIsNonX, exclude );
08942 case eCVRI:
08943 return Arg<CNode*>(0)->IsNonX( integerIsNonX, exclude );
08944 case eCVIR:
08945 return Arg<CNode*>(0)->IsNonX( integerIsNonX, exclude );
08946 case eREP:
08947 return Arg<CNode*>(1)->IsNonX( integerIsNonX, exclude );
08948 case eCAT:
08949 return Arg<CNode*>(0)->IsNonX( integerIsNonX, exclude ) && Arg<CNode*>(1)->IsNonX( integerIsNonX, exclude );
08950 case eUCAT:
08951 return Arg<CNode*>(0)->IsNonX( integerIsNonX, exclude );
08952 case eCOM:
08953 return Arg<CNode*>(0)->IsNonX( integerIsNonX, exclude );
08954 case eNEG:
08955 return Arg<CNode*>(0)->IsNonX( integerIsNonX, exclude );
08956 case ePLUS:
08957 return Arg<CNode*>(0)->IsNonX( integerIsNonX, exclude );
08958 case eNOT:
08959 return Arg<CNode*>(0)->IsNonX( integerIsNonX, exclude );
08960 case eGT:
08961 return Arg<CNode*>(0)->IsNonX( integerIsNonX, exclude ) && Arg<CNode*>(1)->IsNonX( integerIsNonX, exclude );
08962 case eGE:
08963 return Arg<CNode*>(0)->IsNonX( integerIsNonX, exclude ) && Arg<CNode*>(1)->IsNonX( integerIsNonX, exclude );
08964 case eLT:
08965 return Arg<CNode*>(0)->IsNonX( integerIsNonX, exclude ) && Arg<CNode*>(1)->IsNonX( integerIsNonX, exclude );
08966 case eLE:
08967 return Arg<CNode*>(0)->IsNonX( integerIsNonX, exclude ) && Arg<CNode*>(1)->IsNonX( integerIsNonX, exclude );
08968 case eLAND:
08969 return Arg<CNode*>(0)->IsNonX( integerIsNonX, exclude ) && Arg<CNode*>(1)->IsNonX( integerIsNonX, exclude );
08970 case eLOR:
08971 return Arg<CNode*>(0)->IsNonX( integerIsNonX, exclude ) && Arg<CNode*>(1)->IsNonX( integerIsNonX, exclude );
08972 case eCEQ:
08973 return Arg<CNode*>(0)->IsNonX( integerIsNonX, exclude ) && Arg<CNode*>(1)->IsNonX( integerIsNonX, exclude );
08974 case eCNE:
08975 return Arg<CNode*>(0)->IsNonX( integerIsNonX, exclude ) && Arg<CNode*>(1)->IsNonX( integerIsNonX, exclude );
08976 case eEQ:
08977 return Arg<CNode*>(0)->IsNonX( integerIsNonX, exclude ) && Arg<CNode*>(1)->IsNonX( integerIsNonX, exclude );
08978 case eNE:
08979 return Arg<CNode*>(0)->IsNonX( integerIsNonX, exclude ) && Arg<CNode*>(1)->IsNonX( integerIsNonX, exclude );
08980 case eRAND:
08981 return Arg<CNode*>(0)->IsNonX( integerIsNonX, exclude );
08982 case eRNAND:
08983 return Arg<CNode*>(0)->IsNonX( integerIsNonX, exclude );
08984 case eROR:
08985 return Arg<CNode*>(0)->IsNonX( integerIsNonX, exclude );
08986 case eRNOR:
08987 return Arg<CNode*>(0)->IsNonX( integerIsNonX, exclude );
08988 case eRXOR:
08989 return Arg<CNode*>(0)->IsNonX( integerIsNonX, exclude );
08990 case eRXNOR:
08991 return Arg<CNode*>(0)->IsNonX( integerIsNonX, exclude );
08992 case eHOOK:
08993 return Arg<CNode*>(0)->IsNonX( integerIsNonX, exclude ) && Arg<CNode*>(1)->IsNonX( integerIsNonX, exclude ) && Arg<CNode*>(2)->IsNonX( integerIsNonX, exclude );
08994 case ePOSEDGE:
08995 return Arg<CNode*>(0)->IsNonX( integerIsNonX, exclude );
08996 case eNEGEDGE:
08997 return Arg<CNode*>(0)->IsNonX( integerIsNonX, exclude );
08998 case eEVOR:
08999 return Arg<CNode*>(0)->IsNonX( integerIsNonX, exclude ) && Arg<CNode*>(1)->IsNonX( integerIsNonX, exclude );
09000 case eMTM:
09001 return Arg<CNode*>(0)->IsNonX( integerIsNonX, exclude ) && Arg<CNode*>(1)->IsNonX( integerIsNonX, exclude ) && Arg<CNode*>(2)->IsNonX( integerIsNonX, exclude );
09002 case eEXTERNAL_REF:
09003 return FALSE;
09004 case eMACRO_EXPR:
09005 return Arg<CNode*>(1) ? Arg<CNode*>(1)->IsNonX(integerIsNonX, exclude) : FALSE;
09006 case eMEMBER:
09007 return Arg<CNode*>(0)->IsNonX( integerIsNonX, exclude );
09008 case ePREINC:
09009 return Arg<CNode*>(0)->IsNonX( integerIsNonX, exclude );
09010 case ePOSTINC:
09011 return Arg<CNode*>(0)->IsNonX( integerIsNonX, exclude );
09012 case ePREDEC:
09013 return Arg<CNode*>(0)->IsNonX( integerIsNonX, exclude );
09014 case ePOSTDEC:
09015 return Arg<CNode*>(0)->IsNonX( integerIsNonX, exclude );
09016 case eCAST:
09017 return Arg<CNode*>(0)->IsNonX( integerIsNonX, exclude ) && Arg<CNode*>(1)->IsNonX( integerIsNonX, exclude );
09018 default:
09019 MASSERT( FALSE );
09020 return 0;
09021 }
09022 }
09023
09024
09025
09026
09027
09028
09029
09030 CNode* CNode::Clone( CObstack* heap )
09031 {
09032 int nodeMask = 0;
09033 switch( GetOp() ) {
09034 case eERROR:
09035 nodeMask = 0;
09036 break;
09037 case eVCONSTANT:
09038 nodeMask = 0;
09039 break;
09040 case eRCONSTANT:
09041 nodeMask = 0;
09042 break;
09043 case eCOMMENT:
09044 nodeMask = 0;
09045 break;
09046 case eVRQ:
09047 nodeMask = 0;
09048 break;
09049 case ePRAGMA:
09050 nodeMask = 0;
09051 break;
09052 case eELIST:
09053 nodeMask = 3;
09054 break;
09055 case eWIDTH:
09056 nodeMask = 3;
09057 break;
09058 case eNOP:
09059 nodeMask = 0;
09060 break;
09061 case eSUB:
09062 nodeMask = 3;
09063 break;
09064 case eMUL:
09065 nodeMask = 3;
09066 break;
09067 case eDIV:
09068 nodeMask = 3;
09069 break;
09070 case ePOW:
09071 nodeMask = 3;
09072 break;
09073 case eADD:
09074 nodeMask = 3;
09075 break;
09076 case eLSH:
09077 nodeMask = 3;
09078 break;
09079 case eRSH:
09080 nodeMask = 3;
09081 break;
09082 case eLSHA:
09083 nodeMask = 3;
09084 break;
09085 case eRSHA:
09086 nodeMask = 3;
09087 break;
09088 case eMOD:
09089 nodeMask = 3;
09090 break;
09091 case eOR:
09092 nodeMask = 3;
09093 break;
09094 case eAND:
09095 nodeMask = 3;
09096 break;
09097 case eANDANDAND:
09098 nodeMask = 3;
09099 break;
09100 case eXOR:
09101 nodeMask = 3;
09102 break;
09103 case eXNOR:
09104 nodeMask = 3;
09105 break;
09106 case eINSTANCE_REF:
09107 nodeMask = 0;
09108 break;
09109 case eGATE_REF:
09110 nodeMask = 0;
09111 break;
09112 case eTASK_ENABLE:
09113 nodeMask = 2;
09114 break;
09115 case eSYSTASK_CALL:
09116 nodeMask = 2;
09117 break;
09118 case eTIMING_CALL:
09119 nodeMask = 2;
09120 break;
09121 case eFUNCTION_CALL:
09122 nodeMask = 2;
09123 break;
09124 case eARRAY:
09125 nodeMask = 3;
09126 break;
09127 case eNET_REF:
09128 nodeMask = 0;
09129 break;
09130 case eVAR_REF:
09131 nodeMask = 0;
09132 break;
09133 case ePARAM_REF:
09134 nodeMask = 0;
09135 break;
09136 case ePORT_REF:
09137 nodeMask = 0;
09138 break;
09139 case eFWD_REF:
09140 nodeMask = 0;
09141 break;
09142 case eGENVAR_REF:
09143 nodeMask = 0;
09144 break;
09145 case eENUM_REF:
09146 nodeMask = 0;
09147 break;
09148 case eTYPE_REF:
09149 nodeMask = 0;
09150 break;
09151 case eNET_DECL:
09152 nodeMask = 2;
09153 break;
09154 case eVAR_DECL:
09155 nodeMask = 2;
09156 break;
09157 case ePARAM_DECL:
09158 nodeMask = 0;
09159 break;
09160 case eSPECPARAM_DECL:
09161 nodeMask = 0;
09162 break;
09163 case ePORT_DECL:
09164 nodeMask = 0;
09165 break;
09166 case eGENVAR_DECL:
09167 nodeMask = 0;
09168 break;
09169 case eTYPEDEF_DECL:
09170 nodeMask = 0;
09171 break;
09172 case eLIST:
09173 nodeMask = 3;
09174 break;
09175 case eRANGE:
09176 nodeMask = 3;
09177 break;
09178 case eSLICE:
09179 nodeMask = 3;
09180 break;
09181 case ePSLICE:
09182 nodeMask = 3;
09183 break;
09184 case eMSLICE:
09185 nodeMask = 3;
09186 break;
09187 case eCVRI:
09188 nodeMask = 1;
09189 break;
09190 case eCVIR:
09191 nodeMask = 1;
09192 break;
09193 case eREP:
09194 nodeMask = 3;
09195 break;
09196 case eCAT:
09197 nodeMask = 3;
09198 break;
09199 case eUCAT:
09200 nodeMask = 1;
09201 break;
09202 case eCOM:
09203 nodeMask = 1;
09204 break;
09205 case eNEG:
09206 nodeMask = 1;
09207 break;
09208 case ePLUS:
09209 nodeMask = 1;
09210 break;
09211 case eNOT:
09212 nodeMask = 1;
09213 break;
09214 case eGT:
09215 nodeMask = 3;
09216 break;
09217 case eGE:
09218 nodeMask = 3;
09219 break;
09220 case eLT:
09221 nodeMask = 3;
09222 break;
09223 case eLE:
09224 nodeMask = 3;
09225 break;
09226 case eLAND:
09227 nodeMask = 3;
09228 break;
09229 case eLOR:
09230 nodeMask = 3;
09231 break;
09232 case eCEQ:
09233 nodeMask = 3;
09234 break;
09235 case eCNE:
09236 nodeMask = 3;
09237 break;
09238 case eEQ:
09239 nodeMask = 3;
09240 break;
09241 case eNE:
09242 nodeMask = 3;
09243 break;
09244 case eRAND:
09245 nodeMask = 1;
09246 break;
09247 case eRNAND:
09248 nodeMask = 1;
09249 break;
09250 case eROR:
09251 nodeMask = 1;
09252 break;
09253 case eRNOR:
09254 nodeMask = 1;
09255 break;
09256 case eRXOR:
09257 nodeMask = 1;
09258 break;
09259 case eRXNOR:
09260 nodeMask = 1;
09261 break;
09262 case eHOOK:
09263 nodeMask = 7;
09264 break;
09265 case eINIT:
09266 nodeMask = 1;
09267 break;
09268 case eALWAYS:
09269 nodeMask = 1;
09270 break;
09271 case eALWAYS_LATCH:
09272 nodeMask = 1;
09273 break;
09274 case eALWAYS_FF:
09275 nodeMask = 1;
09276 break;
09277 case eALWAYS_COMB:
09278 nodeMask = 1;
09279 break;
09280 case eEVENT:
09281 nodeMask = 3;
09282 break;
09283 case eBLOCK_REF:
09284 nodeMask = 2;
09285 break;
09286 case eSPECIFY_REF:
09287 nodeMask = 2;
09288 break;
09289 case eASSIGN:
09290 nodeMask = 7;
09291 break;
09292 case eADD_ASSIGN:
09293 nodeMask = 7;
09294 break;
09295 case eSUB_ASSIGN:
09296 nodeMask = 7;
09297 break;
09298 case eMUL_ASSIGN:
09299 nodeMask = 7;
09300 break;
09301 case eDIV_ASSIGN:
09302 nodeMask = 7;
09303 break;
09304 case eMOD_ASSIGN:
09305 nodeMask = 7;
09306 break;
09307 case eAND_ASSIGN:
09308 nodeMask = 7;
09309 break;
09310 case eOR_ASSIGN:
09311 nodeMask = 7;
09312 break;
09313 case eXOR_ASSIGN:
09314 nodeMask = 7;
09315 break;
09316 case eLSH_ASSIGN:
09317 nodeMask = 7;
09318 break;
09319 case eRSH_ASSIGN:
09320 nodeMask = 7;
09321 break;
09322 case eLSHA_ASSIGN:
09323 nodeMask = 7;
09324 break;
09325 case eRSHA_ASSIGN:
09326 nodeMask = 7;
09327 break;
09328 case eFORCE:
09329 nodeMask = 3;
09330 break;
09331 case eRELEASE:
09332 nodeMask = 1;
09333 break;
09334 case eNBASSIGN:
09335 nodeMask = 7;
09336 break;
09337 case ePOSEDGE:
09338 nodeMask = 1;
09339 break;
09340 case eNEGEDGE:
09341 nodeMask = 1;
09342 break;
09343 case eEDGE:
09344 nodeMask = 1;
09345 break;
09346 case eEVOR:
09347 nodeMask = 3;
09348 break;
09349 case eDELAY:
09350 nodeMask = 3;
09351 break;
09352 case eMTM:
09353 nodeMask = 7;
09354 break;
09355 case eIF:
09356 nodeMask = 7;
09357 break;
09358 case eFOREVER:
09359 nodeMask = 1;
09360 break;
09361 case eREPEAT:
09362 nodeMask = 3;
09363 break;
09364 case eWHILE:
09365 nodeMask = 3;
09366 break;
09367 case eWAIT:
09368 nodeMask = 3;
09369 break;
09370 case eFOR:
09371 nodeMask = 15;
09372 break;
09373 case eCASE:
09374 nodeMask = 3;
09375 break;
09376 case eCASEX:
09377 nodeMask = 3;
09378 break;
09379 case eCASEZ:
09380 nodeMask = 3;
09381 break;
09382 case eCASEITEM:
09383 nodeMask = 3;
09384 break;
09385 case eCASSIGN:
09386 nodeMask = 14;
09387 break;
09388 case eARG:
09389 nodeMask = 2;
09390 break;
09391 case eFUNCTION_DEF:
09392 nodeMask = 0;
09393 break;
09394 case eMODULE_DEF:
09395 nodeMask = 0;
09396 break;
09397 case eREPEAT_CONTROL:
09398 nodeMask = 3;
09399 break;
09400 case eDELAY_CONTROL:
09401 nodeMask = 1;
09402 break;
09403 case eEVENT_CONTROL:
09404 nodeMask = 1;
09405 break;
09406 case eEXTERNAL_REF:
09407 nodeMask = 0;
09408 break;
09409 case ePORT_DEF:
09410 nodeMask = 0;
09411 break;
09412 case eDEFPARAM:
09413 nodeMask = 3;
09414 break;
09415 case ePATH:
09416 nodeMask = 82;
09417 break;
09418 case ePATH_ASSIGN:
09419 nodeMask = 7;
09420 break;
09421 case eIFNONE_PATH_ASSIGN:
09422 nodeMask = 3;
09423 break;
09424 case eTRIGGER:
09425 nodeMask = 1;
09426 break;
09427 case ePASSIGN:
09428 nodeMask = 3;
09429 break;
09430 case eDEASSIGN:
09431 nodeMask = 1;
09432 break;
09433 case eDISABLE:
09434 nodeMask = 0;
09435 break;
09436 case eATTRIBUTE:
09437 nodeMask = 0;
09438 break;
09439 case eGIF:
09440 nodeMask = 7;
09441 break;
09442 case eGFOR:
09443 nodeMask = 15;
09444 break;
09445 case eGCASE:
09446 nodeMask = 3;
09447 break;
09448 case eTABLE:
09449 nodeMask = 1;
09450 break;
09451 case eTABLE_ENTRY:
09452 nodeMask = 1;
09453 break;
09454 case eTABLE_SYMBOL:
09455 nodeMask = 0;
09456 break;
09457 case ePORTLIST_END:
09458 nodeMask = 0;
09459 break;
09460 case eMACRO_EXPR:
09461 nodeMask = 2;
09462 break;
09463 case eENUM_SPEC:
09464 nodeMask = 6;
09465 break;
09466 case eMEMBER:
09467 nodeMask = 1;
09468 break;
09469 case eRETURN:
09470 nodeMask = 1;
09471 break;
09472 case ePREINC:
09473 nodeMask = 1;
09474 break;
09475 case ePOSTINC:
09476 nodeMask = 1;
09477 break;
09478 case ePREDEC:
09479 nodeMask = 1;
09480 break;
09481 case ePOSTDEC:
09482 nodeMask = 1;
09483 break;
09484 case eCAST:
09485 nodeMask = 3;
09486 break;
09487 default:
09488 MASSERT( FALSE );
09489 }
09490
09491 CNode* n = new(stack) CNode( &loc, op );
09492 n->width = width;
09493 n->type = type;
09494 n->fixedWidth = fixedWidth;
09495 if( attributes ) {
09496 n->attributes = attributes->Clone(heap);
09497 }
09498 for( int i = 0; i < ArgCount(); i++ ) {
09499 if( ((nodeMask>>i)&1) && Arg<CNode*>(i) ) {
09500 n->Arg<CNode*>(i) = Arg<CNode*>(i)->Clone(heap);
09501 } else {
09502 void* tmp = Arg<void*>(i);
09503 n->Arg<void*>(i) = tmp;
09504 }
09505 }
09506 return n;
09507 }
09508
09509
09510
09511
09512
09513
09514
09515
09516
09517 void CNode::PreVisit1( int (*func)(CNode*, void*), void* data )
09518 {
09519 if( !(*func)( this, data ) ) {
09520 return;
09521 }
09522
09523 if( GetAttributes() ) {
09524 GetAttributes()->PreVisit1( func, data );
09525 }
09526
09527 int nodeMask = 0;
09528 switch( GetOp() ) {
09529 case eERROR:
09530 nodeMask = 0;
09531 break;
09532 case eVCONSTANT:
09533 nodeMask = 1;
09534 break;
09535 case eRCONSTANT:
09536 nodeMask = 1;
09537 break;
09538 case eCOMMENT:
09539 nodeMask = 1;
09540 break;
09541 case eVRQ:
09542 nodeMask = 1;
09543 break;
09544 case ePRAGMA:
09545 nodeMask = 1;
09546 break;
09547 case eELIST:
09548 nodeMask = 0;
09549 break;
09550 case eWIDTH:
09551 nodeMask = 0;
09552 break;
09553 case eNOP:
09554 nodeMask = 0;
09555 break;
09556 case eSUB:
09557 nodeMask = 0;
09558 break;
09559 case eMUL:
09560 nodeMask = 0;
09561 break;
09562 case eDIV:
09563 nodeMask = 0;
09564 break;
09565 case ePOW:
09566 nodeMask = 0;
09567 break;
09568 case eADD:
09569 nodeMask = 0;
09570 break;
09571 case eLSH:
09572 nodeMask = 0;
09573 break;
09574 case eRSH:
09575 nodeMask = 0;
09576 break;
09577 case eLSHA:
09578 nodeMask = 0;
09579 break;
09580 case eRSHA:
09581 nodeMask = 0;
09582 break;
09583 case eMOD:
09584 nodeMask = 0;
09585 break;
09586 case eOR:
09587 nodeMask = 0;
09588 break;
09589 case eAND:
09590 nodeMask = 0;
09591 break;
09592 case eANDANDAND:
09593 nodeMask = 0;
09594 break;
09595 case eXOR:
09596 nodeMask = 0;
09597 break;
09598 case eXNOR:
09599 nodeMask = 0;
09600 break;
09601 case eINSTANCE_REF:
09602 nodeMask = 1;
09603 if(Arg<CInstance*>(0)) Arg<CInstance*>(0)->PreVisit1( func, data );
09604 break;
09605 case eGATE_REF:
09606 nodeMask = 1;
09607 if(Arg<CGate*>(0)) Arg<CGate*>(0)->PreVisit1( func, data );
09608 break;
09609 case eTASK_ENABLE:
09610 nodeMask = 1;
09611 break;
09612 case eSYSTASK_CALL:
09613 nodeMask = 1;
09614 break;
09615 case eTIMING_CALL:
09616 nodeMask = 1;
09617 break;
09618 case eFUNCTION_CALL:
09619 nodeMask = 5;
09620 break;
09621 case eARRAY:
09622 nodeMask = 0;
09623 break;
09624 case eNET_REF:
09625 return;
09626 case eVAR_REF:
09627 return;
09628 case ePARAM_REF:
09629 return;
09630 case ePORT_REF:
09631 return;
09632 case eFWD_REF:
09633 return;
09634 case eGENVAR_REF:
09635 return;
09636 case eENUM_REF:
09637 return;
09638 case eTYPE_REF:
09639 return;
09640 case eNET_DECL:
09641 nodeMask = 1;
09642 if(Arg<CNet*>(0)) Arg<CNet*>(0)->PreVisit1( func, data );
09643 break;
09644 case eVAR_DECL:
09645 nodeMask = 1;
09646 if(Arg<CVar*>(0)) Arg<CVar*>(0)->PreVisit1( func, data );
09647 break;
09648 case ePARAM_DECL:
09649 nodeMask = 1;
09650 if(Arg<CParam*>(0)) Arg<CParam*>(0)->PreVisit1( func, data );
09651 break;
09652 case eSPECPARAM_DECL:
09653 nodeMask = 1;
09654 if(Arg<CParam*>(0)) Arg<CParam*>(0)->PreVisit1( func, data );
09655 break;
09656 case ePORT_DECL:
09657 nodeMask = 1;
09658 if(Arg<CPortDir*>(0)) Arg<CPortDir*>(0)->PreVisit1( func, data );
09659 break;
09660 case eGENVAR_DECL:
09661 nodeMask = 1;
09662 if(Arg<CGenvar*>(0)) Arg<CGenvar*>(0)->PreVisit1( func, data );
09663 break;
09664 case eTYPEDEF_DECL:
09665 nodeMask = 1;
09666 if(Arg<CTypedef*>(0)) Arg<CTypedef*>(0)->PreVisit1( func, data );
09667 break;
09668 case eLIST:
09669 nodeMask = 0;
09670 break;
09671 case eRANGE:
09672 nodeMask = 0;
09673 break;
09674 case eSLICE:
09675 nodeMask = 0;
09676 break;
09677 case ePSLICE:
09678 nodeMask = 0;
09679 break;
09680 case eMSLICE:
09681 nodeMask = 0;
09682 break;
09683 case eCVRI:
09684 nodeMask = 0;
09685 break;
09686 case eCVIR:
09687 nodeMask = 0;
09688 break;
09689 case eREP:
09690 nodeMask = 0;
09691 break;
09692 case eCAT:
09693 nodeMask = 0;
09694 break;
09695 case eUCAT:
09696 nodeMask = 0;
09697 break;
09698 case eCOM:
09699 nodeMask = 0;
09700 break;
09701 case eNEG:
09702 nodeMask = 0;
09703 break;
09704 case ePLUS:
09705 nodeMask = 0;
09706 break;
09707 case eNOT:
09708 nodeMask = 0;
09709 break;
09710 case eGT:
09711 nodeMask = 0;
09712 break;
09713 case eGE:
09714 nodeMask = 0;
09715 break;
09716 case eLT:
09717 nodeMask = 0;
09718 break;
09719 case eLE:
09720 nodeMask = 0;
09721 break;
09722 case eLAND:
09723 nodeMask = 0;
09724 break;
09725 case eLOR:
09726 nodeMask = 0;
09727 break;
09728 case eCEQ:
09729 nodeMask = 0;
09730 break;
09731 case eCNE:
09732 nodeMask = 0;
09733 break;
09734 case eEQ:
09735 nodeMask = 0;
09736 break;
09737 case eNE:
09738 nodeMask = 0;
09739 break;
09740 case eRAND:
09741 nodeMask = 0;
09742 break;
09743 case eRNAND:
09744 nodeMask = 0;
09745 break;
09746 case eROR:
09747 nodeMask = 0;
09748 break;
09749 case eRNOR:
09750 nodeMask = 0;
09751 break;
09752 case eRXOR:
09753 nodeMask = 0;
09754 break;
09755 case eRXNOR:
09756 nodeMask = 0;
09757 break;
09758 case eHOOK:
09759 nodeMask = 0;
09760 break;
09761 case eINIT:
09762 nodeMask = 0;
09763 break;
09764 case eALWAYS:
09765 nodeMask = 0;
09766 break;
09767 case eALWAYS_LATCH:
09768 nodeMask = 0;
09769 break;
09770 case eALWAYS_FF:
09771 nodeMask = 0;
09772 break;
09773 case eALWAYS_COMB:
09774 nodeMask = 0;
09775 break;
09776 case eEVENT:
09777 nodeMask = 0;
09778 break;
09779 case eBLOCK_REF:
09780 nodeMask = 1;
09781 if(Arg<CBlock*>(0)) Arg<CBlock*>(0)->PreVisit1( func, data );
09782 break;
09783 case eSPECIFY_REF:
09784 nodeMask = 1;
09785 if(Arg<CSpecify*>(0)) Arg<CSpecify*>(0)->PreVisit1( func, data );
09786 break;
09787 case eASSIGN:
09788 nodeMask = 0;
09789 break;
09790 case eADD_ASSIGN:
09791 nodeMask = 0;
09792 break;
09793 case eSUB_ASSIGN:
09794 nodeMask = 0;
09795 break;
09796 case eMUL_ASSIGN:
09797 nodeMask = 0;
09798 break;
09799 case eDIV_ASSIGN:
09800 nodeMask = 0;
09801 break;
09802 case eMOD_ASSIGN:
09803 nodeMask = 0;
09804 break;
09805 case eAND_ASSIGN:
09806 nodeMask = 0;
09807 break;
09808 case eOR_ASSIGN:
09809 nodeMask = 0;
09810 break;
09811 case eXOR_ASSIGN:
09812 nodeMask = 0;
09813 break;
09814 case eLSH_ASSIGN:
09815 nodeMask = 0;
09816 break;
09817 case eRSH_ASSIGN:
09818 nodeMask = 0;
09819 break;
09820 case eLSHA_ASSIGN:
09821 nodeMask = 0;
09822 break;
09823 case eRSHA_ASSIGN:
09824 nodeMask = 0;
09825 break;
09826 case eFORCE:
09827 nodeMask = 0;
09828 break;
09829 case eRELEASE:
09830 nodeMask = 0;
09831 break;
09832 case eNBASSIGN:
09833 nodeMask = 0;
09834 break;
09835 case ePOSEDGE:
09836 nodeMask = 0;
09837 break;
09838 case eNEGEDGE:
09839 nodeMask = 0;
09840 break;
09841 case eEDGE:
09842 nodeMask = 2;
09843 break;
09844 case eEVOR:
09845 nodeMask = 0;
09846 break;
09847 case eDELAY:
09848 nodeMask = 0;
09849 break;
09850 case eMTM:
09851 nodeMask = 0;
09852 break;
09853 case eIF:
09854 nodeMask = 0;
09855 break;
09856 case eFOREVER:
09857 nodeMask = 0;
09858 break;
09859 case eREPEAT:
09860 nodeMask = 0;
09861 break;
09862 case eWHILE:
09863 nodeMask = 0;
09864 break;
09865 case eWAIT:
09866 nodeMask = 0;
09867 break;
09868 case eFOR:
09869 nodeMask = 0;
09870 break;
09871 case eCASE:
09872 nodeMask = 0;
09873 break;
09874 case eCASEX:
09875 nodeMask = 0;
09876 break;
09877 case eCASEZ:
09878 nodeMask = 0;
09879 break;
09880 case eCASEITEM:
09881 nodeMask = 0;
09882 break;
09883 case eCASSIGN:
09884 nodeMask = 1;
09885 break;
09886 case eARG:
09887 nodeMask = 1;
09888 break;
09889 case eFUNCTION_DEF:
09890 nodeMask = 1;
09891 if(Arg<CFunction*>(0)) Arg<CFunction*>(0)->PreVisit1( func, data );
09892 break;
09893 case eMODULE_DEF:
09894 nodeMask = 1;
09895 if(Arg<CModule*>(0)) Arg<CModule*>(0)->PreVisit1( func, data );
09896 break;
09897 case eREPEAT_CONTROL:
09898 nodeMask = 0;
09899 break;
09900 case eDELAY_CONTROL:
09901 nodeMask = 0;
09902 break;
09903 case eEVENT_CONTROL:
09904 nodeMask = 0;
09905 break;
09906 case eEXTERNAL_REF:
09907 nodeMask = 1;
09908 break;
09909 case ePORT_DEF:
09910 nodeMask = 1;
09911 if(Arg<CPort*>(0)) Arg<CPort*>(0)->PreVisit1( func, data );
09912 break;
09913 case eDEFPARAM:
09914 nodeMask = 0;
09915 break;
09916 case ePATH:
09917 nodeMask = 45;
09918 break;
09919 case ePATH_ASSIGN:
09920 nodeMask = 0;
09921 break;
09922 case eIFNONE_PATH_ASSIGN:
09923 nodeMask = 0;
09924 break;
09925 case eTRIGGER:
09926 nodeMask = 0;
09927 break;
09928 case ePASSIGN:
09929 nodeMask = 0;
09930 break;
09931 case eDEASSIGN:
09932 nodeMask = 0;
09933 break;
09934 case eDISABLE:
09935 nodeMask = 1;
09936 break;
09937 case eATTRIBUTE:
09938 nodeMask = 1;
09939 if(Arg<CAttr*>(0)) Arg<CAttr*>(0)->PreVisit1( func, data );
09940 break;
09941 case eGIF:
09942 nodeMask = 0;
09943 break;
09944 case eGFOR:
09945 nodeMask = 0;
09946 break;
09947 case eGCASE:
09948 nodeMask = 0;
09949 break;
09950 case eTABLE:
09951 nodeMask = 0;
09952 break;
09953 case eTABLE_ENTRY:
09954 nodeMask = 0;
09955 break;
09956 case eTABLE_SYMBOL:
09957 nodeMask = 1;
09958 break;
09959 case ePORTLIST_END:
09960 nodeMask = 0;
09961 break;
09962 case eMACRO_EXPR:
09963 nodeMask = 1;
09964 break;
09965 case eENUM_SPEC:
09966 nodeMask = 1;
09967 break;
09968 case eMEMBER:
09969 nodeMask = 2;
09970 break;
09971 case eRETURN:
09972 nodeMask = 0;
09973 break;
09974 case ePREINC:
09975 nodeMask = 0;
09976 break;
09977 case ePOSTINC:
09978 nodeMask = 0;
09979 break;
09980 case ePREDEC:
09981 nodeMask = 0;
09982 break;
09983 case ePOSTDEC:
09984 nodeMask = 0;
09985 break;
09986 case eCAST:
09987 nodeMask = 0;
09988 break;
09989 }
09990
09991
09992
09993
09994 if( GetOp() != eLIST ) {
09995 for( int i = 0; i < ArgCount(); i++ ) {
09996 if( Arg<CNode*>(i) && !((nodeMask>>i)&1) ) Arg<CNode*>(i)->PreVisit1( func, data );
09997 }
09998 } else {
09999 CNode* n = this;
10000 while( 1 ) {
10001 if( n->Arg<CNode*>(0) ) {
10002 n->Arg<CNode*>(0)->PreVisit1( func, data );
10003 }
10004 if( !n->Arg<CNode*>(1) || n->Arg<CNode*>(1)->GetOp() != eLIST ) {
10005 break;
10006 }
10007 n = n->Arg<CNode*>(1);
10008 if( !(*func)( n, data ) ) {
10009 return;
10010 }
10011 if( n->GetAttributes() ) {
10012 n->GetAttributes()->PreVisit1( func, data );
10013 }
10014 }
10015 if( n->Arg<CNode*>(1) ) {
10016 n->Arg<CNode*>(1)->PreVisit1( func, data );
10017 }
10018 }
10019 }
10020
10021
10022
10023
10024
10025
10026
10027 void CNode::PostVisit1( void (*func)(CNode*, void*), void* data )
10028 {
10029 if( GetAttributes() ) {
10030 GetAttributes()->PostVisit1( func, data );
10031 }
10032
10033 int nodeMask = 0;
10034 switch( GetOp() ) {
10035 case eERROR:
10036 nodeMask = 0;
10037 break;
10038 case eVCONSTANT:
10039 nodeMask = 1;
10040 break;
10041 case eRCONSTANT:
10042 nodeMask = 1;
10043 break;
10044 case eCOMMENT:
10045 nodeMask = 1;
10046 break;
10047 case eVRQ:
10048 nodeMask = 1;
10049 break;
10050 case ePRAGMA:
10051 nodeMask = 1;
10052 break;
10053 case eELIST:
10054 nodeMask = 0;
10055 break;
10056 case eWIDTH:
10057 nodeMask = 0;
10058 break;
10059 case eNOP:
10060 nodeMask = 0;
10061 break;
10062 case eSUB:
10063 nodeMask = 0;
10064 break;
10065 case eMUL:
10066 nodeMask = 0;
10067 break;
10068 case eDIV:
10069 nodeMask = 0;
10070 break;
10071 case ePOW:
10072 nodeMask = 0;
10073 break;
10074 case eADD:
10075 nodeMask = 0;
10076 break;
10077 case eLSH:
10078 nodeMask = 0;
10079 break;
10080 case eRSH:
10081 nodeMask = 0;
10082 break;
10083 case eLSHA:
10084 nodeMask = 0;
10085 break;
10086 case eRSHA:
10087 nodeMask = 0;
10088 break;
10089 case eMOD:
10090 nodeMask = 0;
10091 break;
10092 case eOR:
10093 nodeMask = 0;
10094 break;
10095 case eAND:
10096 nodeMask = 0;
10097 break;
10098 case eANDANDAND:
10099 nodeMask = 0;
10100 break;
10101 case eXOR:
10102 nodeMask = 0;
10103 break;
10104 case eXNOR:
10105 nodeMask = 0;
10106 break;
10107 case eINSTANCE_REF:
10108 nodeMask = 1;
10109 if(Arg<CInstance*>(0)) Arg<CInstance*>(0)->PostVisit1( func, data );
10110 break;
10111 case eGATE_REF:
10112 nodeMask = 1;
10113 if(Arg<CGate*>(0)) Arg<CGate*>(0)->PostVisit1( func, data );
10114 break;
10115 case eTASK_ENABLE:
10116 nodeMask = 1;
10117 break;
10118 case eSYSTASK_CALL:
10119 nodeMask = 1;
10120 break;
10121 case eTIMING_CALL:
10122 nodeMask = 1;
10123 break;
10124 case eFUNCTION_CALL:
10125 nodeMask = 5;
10126 break;
10127 case eARRAY:
10128 nodeMask = 0;
10129 break;
10130 case eNET_REF:
10131 nodeMask = ~0;
10132 break;
10133 case eVAR_REF:
10134 nodeMask = ~0;
10135 break;
10136 case ePARAM_REF:
10137 nodeMask = ~0;
10138 break;
10139 case ePORT_REF:
10140 nodeMask = ~0;
10141 break;
10142 case eFWD_REF:
10143 nodeMask = ~0;
10144 break;
10145 case eGENVAR_REF:
10146 nodeMask = ~0;
10147 break;
10148 case eENUM_REF:
10149 nodeMask = ~0;
10150 break;
10151 case eTYPE_REF:
10152 nodeMask = ~0;
10153 break;
10154 case eNET_DECL:
10155 nodeMask = 1;
10156 if(Arg<CNet*>(0)) Arg<CNet*>(0)->PostVisit1( func, data );
10157 break;
10158 case eVAR_DECL:
10159 nodeMask = 1;
10160 if(Arg<CVar*>(0)) Arg<CVar*>(0)->PostVisit1( func, data );
10161 break;
10162 case ePARAM_DECL:
10163 nodeMask = 1;
10164 if(Arg<CParam*>(0)) Arg<CParam*>(0)->PostVisit1( func, data );
10165 break;
10166 case eSPECPARAM_DECL:
10167 nodeMask = 1;
10168 if(Arg<CParam*>(0)) Arg<CParam*>(0)->PostVisit1( func, data );
10169 break;
10170 case ePORT_DECL:
10171 nodeMask = 1;
10172 if(Arg<CPortDir*>(0)) Arg<CPortDir*>(0)->PostVisit1( func, data );
10173 break;
10174 case eGENVAR_DECL:
10175 nodeMask = 1;
10176 if(Arg<CGenvar*>(0)) Arg<CGenvar*>(0)->PostVisit1( func, data );
10177 break;
10178 case eTYPEDEF_DECL:
10179 nodeMask = 1;
10180 if(Arg<CTypedef*>(0)) Arg<CTypedef*>(0)->PostVisit1( func, data );
10181 break;
10182 case eLIST:
10183 nodeMask = 0;
10184 break;
10185 case eRANGE:
10186 nodeMask = 0;
10187 break;
10188 case eSLICE:
10189 nodeMask = 0;
10190 break;
10191 case ePSLICE:
10192 nodeMask = 0;
10193 break;
10194 case eMSLICE:
10195 nodeMask = 0;
10196 break;
10197 case eCVRI:
10198 nodeMask = 0;
10199 break;
10200 case eCVIR:
10201 nodeMask = 0;
10202 break;
10203 case eREP:
10204 nodeMask = 0;
10205 break;
10206 case eCAT:
10207 nodeMask = 0;
10208 break;
10209 case eUCAT:
10210 nodeMask = 0;
10211 break;
10212 case eCOM:
10213 nodeMask = 0;
10214 break;
10215 case eNEG:
10216 nodeMask = 0;
10217 break;
10218 case ePLUS:
10219 nodeMask = 0;
10220 break;
10221 case eNOT:
10222 nodeMask = 0;
10223 break;
10224 case eGT:
10225 nodeMask = 0;
10226 break;
10227 case eGE:
10228 nodeMask = 0;
10229 break;
10230 case eLT:
10231 nodeMask = 0;
10232 break;
10233 case eLE:
10234 nodeMask = 0;
10235 break;
10236 case eLAND:
10237 nodeMask = 0;
10238 break;
10239 case eLOR:
10240 nodeMask = 0;
10241 break;
10242 case eCEQ:
10243 nodeMask = 0;
10244 break;
10245 case eCNE:
10246 nodeMask = 0;
10247 break;
10248 case eEQ:
10249 nodeMask = 0;
10250 break;
10251 case eNE:
10252 nodeMask = 0;
10253 break;
10254 case eRAND:
10255 nodeMask = 0;
10256 break;
10257 case eRNAND:
10258 nodeMask = 0;
10259 break;
10260 case eROR:
10261 nodeMask = 0;
10262 break;
10263 case eRNOR:
10264 nodeMask = 0;
10265 break;
10266 case eRXOR:
10267 nodeMask = 0;
10268 break;
10269 case eRXNOR:
10270 nodeMask = 0;
10271 break;
10272 case eHOOK:
10273 nodeMask = 0;
10274 break;
10275 case eINIT:
10276 nodeMask = 0;
10277 break;
10278 case eALWAYS:
10279 nodeMask = 0;
10280 break;
10281 case eALWAYS_LATCH:
10282 nodeMask = 0;
10283 break;
10284 case eALWAYS_FF:
10285 nodeMask = 0;
10286 break;
10287 case eALWAYS_COMB:
10288 nodeMask = 0;
10289 break;
10290 case eEVENT:
10291 nodeMask = 0;
10292 break;
10293 case eBLOCK_REF:
10294 nodeMask = 1;
10295 if(Arg<CBlock*>(0)) Arg<CBlock*>(0)->PostVisit1( func, data );
10296 break;
10297 case eSPECIFY_REF:
10298 nodeMask = 1;
10299 if(Arg<CSpecify*>(0)) Arg<CSpecify*>(0)->PostVisit1( func, data );
10300 break;
10301 case eASSIGN:
10302 nodeMask = 0;
10303 break;
10304 case eADD_ASSIGN:
10305 nodeMask = 0;
10306 break;
10307 case eSUB_ASSIGN:
10308 nodeMask = 0;
10309 break;
10310 case eMUL_ASSIGN:
10311 nodeMask = 0;
10312 break;
10313 case eDIV_ASSIGN:
10314 nodeMask = 0;
10315 break;
10316 case eMOD_ASSIGN:
10317 nodeMask = 0;
10318 break;
10319 case eAND_ASSIGN:
10320 nodeMask = 0;
10321 break;
10322 case eOR_ASSIGN:
10323 nodeMask = 0;
10324 break;
10325 case eXOR_ASSIGN:
10326 nodeMask = 0;
10327 break;
10328 case eLSH_ASSIGN:
10329 nodeMask = 0;
10330 break;
10331 case eRSH_ASSIGN:
10332 nodeMask = 0;
10333 break;
10334 case eLSHA_ASSIGN:
10335 nodeMask = 0;
10336 break;
10337 case eRSHA_ASSIGN:
10338 nodeMask = 0;
10339 break;
10340 case eFORCE:
10341 nodeMask = 0;
10342 break;
10343 case eRELEASE:
10344 nodeMask = 0;
10345 break;
10346 case eNBASSIGN:
10347 nodeMask = 0;
10348 break;
10349 case ePOSEDGE:
10350 nodeMask = 0;
10351 break;
10352 case eNEGEDGE:
10353 nodeMask = 0;
10354 break;
10355 case eEDGE:
10356 nodeMask = 2;
10357 break;
10358 case eEVOR:
10359 nodeMask = 0;
10360 break;
10361 case eDELAY:
10362 nodeMask = 0;
10363 break;
10364 case eMTM:
10365 nodeMask = 0;
10366 break;
10367 case eIF:
10368 nodeMask = 0;
10369 break;
10370 case eFOREVER:
10371 nodeMask = 0;
10372 break;
10373 case eREPEAT:
10374 nodeMask = 0;
10375 break;
10376 case eWHILE:
10377 nodeMask = 0;
10378 break;
10379 case eWAIT:
10380 nodeMask = 0;
10381 break;
10382 case eFOR:
10383 nodeMask = 0;
10384 break;
10385 case eCASE:
10386 nodeMask = 0;
10387 break;
10388 case eCASEX:
10389 nodeMask = 0;
10390 break;
10391 case eCASEZ:
10392 nodeMask = 0;
10393 break;
10394 case eCASEITEM:
10395 nodeMask = 0;
10396 break;
10397 case eCASSIGN:
10398 nodeMask = 1;
10399 break;
10400 case eARG:
10401 nodeMask = 1;
10402 break;
10403 case eFUNCTION_DEF:
10404 nodeMask = 1;
10405 if(Arg<CFunction*>(0)) Arg<CFunction*>(0)->PostVisit1( func, data );
10406 break;
10407 case eMODULE_DEF:
10408 nodeMask = 1;
10409 if(Arg<CModule*>(0)) Arg<CModule*>(0)->PostVisit1( func, data );
10410 break;
10411 case eREPEAT_CONTROL:
10412 nodeMask = 0;
10413 break;
10414 case eDELAY_CONTROL:
10415 nodeMask = 0;
10416 break;
10417 case eEVENT_CONTROL:
10418 nodeMask = 0;
10419 break;
10420 case eEXTERNAL_REF:
10421 nodeMask = 1;
10422 break;
10423 case ePORT_DEF:
10424 nodeMask = 1;
10425 if(Arg<CPort*>(0)) Arg<CPort*>(0)->PostVisit1( func, data );
10426 break;
10427 case eDEFPARAM:
10428 nodeMask = 0;
10429 break;
10430 case ePATH:
10431 nodeMask = 45;
10432 break;
10433 case ePATH_ASSIGN:
10434 nodeMask = 0;
10435 break;
10436 case eIFNONE_PATH_ASSIGN:
10437 nodeMask = 0;
10438 break;
10439 case eTRIGGER:
10440 nodeMask = 0;
10441 break;
10442 case ePASSIGN:
10443 nodeMask = 0;
10444 break;
10445 case eDEASSIGN:
10446 nodeMask = 0;
10447 break;
10448 case eDISABLE:
10449 nodeMask = 1;
10450 break;
10451 case eATTRIBUTE:
10452 nodeMask = 1;
10453 if(Arg<CAttr*>(0)) Arg<CAttr*>(0)->PostVisit1( func, data );
10454 break;
10455 case eGIF:
10456 nodeMask = 0;
10457 break;
10458 case eGFOR:
10459 nodeMask = 0;
10460 break;
10461 case eGCASE:
10462 nodeMask = 0;
10463 break;
10464 case eTABLE:
10465 nodeMask = 0;
10466 break;
10467 case eTABLE_ENTRY:
10468 nodeMask = 0;
10469 break;
10470 case eTABLE_SYMBOL:
10471 nodeMask = 1;
10472 break;
10473 case ePORTLIST_END:
10474 nodeMask = 0;
10475 break;
10476 case eMACRO_EXPR:
10477 nodeMask = 1;
10478 break;
10479 case eENUM_SPEC:
10480 nodeMask = 1;
10481 break;
10482 case eMEMBER:
10483 nodeMask = 2;
10484 break;
10485 case eRETURN:
10486 nodeMask = 0;
10487 break;
10488 case ePREINC:
10489 nodeMask = 0;
10490 break;
10491 case ePOSTINC:
10492 nodeMask = 0;
10493 break;
10494 case ePREDEC:
10495 nodeMask = 0;
10496 break;
10497 case ePOSTDEC:
10498 nodeMask = 0;
10499 break;
10500 case eCAST:
10501 nodeMask = 0;
10502 break;
10503 }
10504
10505
10506
10507
10508 if( GetOp() != eLIST ) {
10509 for( int i = 0; i < ArgCount(); i++ ) {
10510 if( Arg<CNode*>(i) && !((nodeMask>>i)&1) ) Arg<CNode*>(i)->PostVisit1( func, data );
10511 }
10512 } else {
10513 std::stack<CNode*> visitLog;
10514 CNode* n = this;
10515 while( 1 ) {
10516 if( n->Arg<CNode*>(0) ) {
10517 n->Arg<CNode*>(0)-> PostVisit1( func, data );
10518 }
10519 if( !n->Arg<CNode*>(1) || n->Arg<CNode*>(1)->GetOp() != eLIST ) {
10520 break;
10521 }
10522 visitLog.push(n);
10523 n = n->Arg<CNode*>(1);
10524 if( n->GetAttributes() ) {
10525 n->GetAttributes()->PostVisit1( func, data );
10526 }
10527 }
10528 if( n->Arg<CNode*>(1) ) {
10529 n->Arg<CNode*>(1)->PostVisit1( func, data );
10530 }
10531 while( !visitLog.empty() ) {
10532 CNode* top = visitLog.top();
10533 if( top->Arg<CNode*>(1) ) {
10534 (*func)(top->Arg<CNode*>(1),data);
10535 }
10536 visitLog.pop();
10537 }
10538 }
10539
10540 (*func)( this, data );
10541 }
10542
10543
10544
10545
10546
10547
10548
10549
10550 CNode* CNode::PostSubVisit1( CNode* (*func)(CNode*, void*), void* data )
10551 {
10552 if( GetAttributes() ) {
10553 SetAttributes( GetAttributes()->PostSubVisit1( func, data ) );
10554 }
10555
10556 int nodeMask = 0;
10557 switch( GetOp() ) {
10558 case eERROR:
10559 nodeMask = 0;
10560 break;
10561 case eVCONSTANT:
10562 nodeMask = 1;
10563 break;
10564 case eRCONSTANT:
10565 nodeMask = 1;
10566 break;
10567 case eCOMMENT:
10568 nodeMask = 1;
10569 break;
10570 case eVRQ:
10571 nodeMask = 1;
10572 break;
10573 case ePRAGMA:
10574 nodeMask = 1;
10575 break;
10576 case eELIST:
10577 nodeMask = 0;
10578 break;
10579 case eWIDTH:
10580 nodeMask = 0;
10581 break;
10582 case eNOP:
10583 nodeMask = 0;
10584 break;
10585 case eSUB:
10586 nodeMask = 0;
10587 break;
10588 case eMUL:
10589 nodeMask = 0;
10590 break;
10591 case eDIV:
10592 nodeMask = 0;
10593 break;
10594 case ePOW:
10595 nodeMask = 0;
10596 break;
10597 case eADD:
10598 nodeMask = 0;
10599 break;
10600 case eLSH:
10601 nodeMask = 0;
10602 break;
10603 case eRSH:
10604 nodeMask = 0;
10605 break;
10606 case eLSHA:
10607 nodeMask = 0;
10608 break;
10609 case eRSHA:
10610 nodeMask = 0;
10611 break;
10612 case eMOD:
10613 nodeMask = 0;
10614 break;
10615 case eOR:
10616 nodeMask = 0;
10617 break;
10618 case eAND:
10619 nodeMask = 0;
10620 break;
10621 case eANDANDAND:
10622 nodeMask = 0;
10623 break;
10624 case eXOR:
10625 nodeMask = 0;
10626 break;
10627 case eXNOR:
10628 nodeMask = 0;
10629 break;
10630 case eINSTANCE_REF:
10631 nodeMask = 1;
10632 if(Arg<CInstance*>(0)) Arg<CInstance*>(0)->PostSubVisit1( func, data );
10633 break;
10634 case eGATE_REF:
10635 nodeMask = 1;
10636 if(Arg<CGate*>(0)) Arg<CGate*>(0)->PostSubVisit1( func, data );
10637 break;
10638 case eTASK_ENABLE:
10639 nodeMask = 1;
10640 break;
10641 case eSYSTASK_CALL:
10642 nodeMask = 1;
10643 break;
10644 case eTIMING_CALL:
10645 nodeMask = 1;
10646 break;
10647 case eFUNCTION_CALL:
10648 nodeMask = 5;
10649 break;
10650 case eARRAY:
10651 nodeMask = 0;
10652 break;
10653 case eNET_REF:
10654 nodeMask = ~0;
10655 break;
10656 case eVAR_REF:
10657 nodeMask = ~0;
10658 break;
10659 case ePARAM_REF:
10660 nodeMask = ~0;
10661 break;
10662 case ePORT_REF:
10663 nodeMask = ~0;
10664 break;
10665 case eFWD_REF:
10666 nodeMask = ~0;
10667 break;
10668 case eGENVAR_REF:
10669 nodeMask = ~0;
10670 break;
10671 case eENUM_REF:
10672 nodeMask = ~0;
10673 break;
10674 case eTYPE_REF:
10675 nodeMask = ~0;
10676 break;
10677 case eNET_DECL:
10678 nodeMask = 1;
10679 if(Arg<CNet*>(0)) Arg<CNet*>(0)->PostSubVisit1( func, data );
10680 break;
10681 case eVAR_DECL:
10682 nodeMask = 1;
10683 if(Arg<CVar*>(0)) Arg<CVar*>(0)->PostSubVisit1( func, data );
10684 break;
10685 case ePARAM_DECL:
10686 nodeMask = 1;
10687 if(Arg<CParam*>(0)) Arg<CParam*>(0)->PostSubVisit1( func, data );
10688 break;
10689 case eSPECPARAM_DECL:
10690 nodeMask = 1;
10691 if(Arg<CParam*>(0)) Arg<CParam*>(0)->PostSubVisit1( func, data );
10692 break;
10693 case ePORT_DECL:
10694 nodeMask = 1;
10695 if(Arg<CPortDir*>(0)) Arg<CPortDir*>(0)->PostSubVisit1( func, data );
10696 break;
10697 case eGENVAR_DECL:
10698 nodeMask = 1;
10699 if(Arg<CGenvar*>(0)) Arg<CGenvar*>(0)->PostSubVisit1( func, data );
10700 break;
10701 case eTYPEDEF_DECL:
10702 nodeMask = 1;
10703 if(Arg<CTypedef*>(0)) Arg<CTypedef*>(0)->PostSubVisit1( func, data );
10704 break;
10705 case eLIST:
10706 nodeMask = 0;
10707 break;
10708 case eRANGE:
10709 nodeMask = 0;
10710 break;
10711 case eSLICE:
10712 nodeMask = 0;
10713 break;
10714 case ePSLICE:
10715 nodeMask = 0;
10716 break;
10717 case eMSLICE:
10718 nodeMask = 0;
10719 break;
10720 case eCVRI:
10721 nodeMask = 0;
10722 break;
10723 case eCVIR:
10724 nodeMask = 0;
10725 break;
10726 case eREP:
10727 nodeMask = 0;
10728 break;
10729 case eCAT:
10730 nodeMask = 0;
10731 break;
10732 case eUCAT:
10733 nodeMask = 0;
10734 break;
10735 case eCOM:
10736 nodeMask = 0;
10737 break;
10738 case eNEG:
10739 nodeMask = 0;
10740 break;
10741 case ePLUS:
10742 nodeMask = 0;
10743 break;
10744 case eNOT:
10745 nodeMask = 0;
10746 break;
10747 case eGT:
10748 nodeMask = 0;
10749 break;
10750 case eGE:
10751 nodeMask = 0;
10752 break;
10753 case eLT:
10754 nodeMask = 0;
10755 break;
10756 case eLE:
10757 nodeMask = 0;
10758 break;
10759 case eLAND:
10760 nodeMask = 0;
10761 break;
10762 case eLOR:
10763 nodeMask = 0;
10764 break;
10765 case eCEQ:
10766 nodeMask = 0;
10767 break;
10768 case eCNE:
10769 nodeMask = 0;
10770 break;
10771 case eEQ:
10772 nodeMask = 0;
10773 break;
10774 case eNE:
10775 nodeMask = 0;
10776 break;
10777 case eRAND:
10778 nodeMask = 0;
10779 break;
10780 case eRNAND:
10781 nodeMask = 0;
10782 break;
10783 case eROR:
10784 nodeMask = 0;
10785 break;
10786 case eRNOR:
10787 nodeMask = 0;
10788 break;
10789 case eRXOR:
10790 nodeMask = 0;
10791 break;
10792 case eRXNOR:
10793 nodeMask = 0;
10794 break;
10795 case eHOOK:
10796 nodeMask = 0;
10797 break;
10798 case eINIT:
10799 nodeMask = 0;
10800 break;
10801 case eALWAYS:
10802 nodeMask = 0;
10803 break;
10804 case eALWAYS_LATCH:
10805 nodeMask = 0;
10806 break;
10807 case eALWAYS_FF:
10808 nodeMask = 0;
10809 break;
10810 case eALWAYS_COMB:
10811 nodeMask = 0;
10812 break;
10813 case eEVENT:
10814 nodeMask = 0;
10815 break;
10816 case eBLOCK_REF:
10817 nodeMask = 1;
10818 if(Arg<CBlock*>(0)) Arg<CBlock*>(0)->PostSubVisit1( func, data );
10819 break;
10820 case eSPECIFY_REF:
10821 nodeMask = 1;
10822 if(Arg<CSpecify*>(0)) Arg<CSpecify*>(0)->PostSubVisit1( func, data );
10823 break;
10824 case eASSIGN:
10825 nodeMask = 0;
10826 break;
10827 case eADD_ASSIGN:
10828 nodeMask = 0;
10829 break;
10830 case eSUB_ASSIGN:
10831 nodeMask = 0;
10832 break;
10833 case eMUL_ASSIGN:
10834 nodeMask = 0;
10835 break;
10836 case eDIV_ASSIGN:
10837 nodeMask = 0;
10838 break;
10839 case eMOD_ASSIGN:
10840 nodeMask = 0;
10841 break;
10842 case eAND_ASSIGN:
10843 nodeMask = 0;
10844 break;
10845 case eOR_ASSIGN:
10846 nodeMask = 0;
10847 break;
10848 case eXOR_ASSIGN:
10849 nodeMask = 0;
10850 break;
10851 case eLSH_ASSIGN:
10852 nodeMask = 0;
10853 break;
10854 case eRSH_ASSIGN:
10855 nodeMask = 0;
10856 break;
10857 case eLSHA_ASSIGN:
10858 nodeMask = 0;
10859 break;
10860 case eRSHA_ASSIGN:
10861 nodeMask = 0;
10862 break;
10863 case eFORCE:
10864 nodeMask = 0;
10865 break;
10866 case eRELEASE:
10867 nodeMask = 0;
10868 break;
10869 case eNBASSIGN:
10870 nodeMask = 0;
10871 break;
10872 case ePOSEDGE:
10873 nodeMask = 0;
10874 break;
10875 case eNEGEDGE:
10876 nodeMask = 0;
10877 break;
10878 case eEDGE:
10879 nodeMask = 2;
10880 break;
10881 case eEVOR:
10882 nodeMask = 0;
10883 break;
10884 case eDELAY:
10885 nodeMask = 0;
10886 break;
10887 case eMTM:
10888 nodeMask = 0;
10889 break;
10890 case eIF:
10891 nodeMask = 0;
10892 break;
10893 case eFOREVER:
10894 nodeMask = 0;
10895 break;
10896 case eREPEAT:
10897 nodeMask = 0;
10898 break;
10899 case eWHILE:
10900 nodeMask = 0;
10901 break;
10902 case eWAIT:
10903 nodeMask = 0;
10904 break;
10905 case eFOR:
10906 nodeMask = 0;
10907 break;
10908 case eCASE:
10909 nodeMask = 0;
10910 break;
10911 case eCASEX:
10912 nodeMask = 0;
10913 break;
10914 case eCASEZ:
10915 nodeMask = 0;
10916 break;
10917 case eCASEITEM:
10918 nodeMask = 0;
10919 break;
10920 case eCASSIGN:
10921 nodeMask = 1;
10922 break;
10923 case eARG:
10924 nodeMask = 1;
10925 break;
10926 case eFUNCTION_DEF:
10927 nodeMask = 1;
10928 if(Arg<CFunction*>(0)) Arg<CFunction*>(0)->PostSubVisit1( func, data );
10929 break;
10930 case eMODULE_DEF:
10931 nodeMask = 1;
10932 if(Arg<CModule*>(0)) Arg<CModule*>(0)->PostSubVisit1( func, data );
10933 break;
10934 case eREPEAT_CONTROL:
10935 nodeMask = 0;
10936 break;
10937 case eDELAY_CONTROL:
10938 nodeMask = 0;
10939 break;
10940 case eEVENT_CONTROL:
10941 nodeMask = 0;
10942 break;
10943 case eEXTERNAL_REF:
10944 nodeMask = 1;
10945 break;
10946 case ePORT_DEF:
10947 nodeMask = 1;
10948 if(Arg<CPort*>(0)) Arg<CPort*>(0)->PostSubVisit1( func, data );
10949 break;
10950 case eDEFPARAM:
10951 nodeMask = 0;
10952 break;
10953 case ePATH:
10954 nodeMask = 45;
10955 break;
10956 case ePATH_ASSIGN:
10957 nodeMask = 0;
10958 break;
10959 case eIFNONE_PATH_ASSIGN:
10960 nodeMask = 0;
10961 break;
10962 case eTRIGGER:
10963 nodeMask = 0;
10964 break;
10965 case ePASSIGN:
10966 nodeMask = 0;
10967 break;
10968 case eDEASSIGN:
10969 nodeMask = 0;
10970 break;
10971 case eDISABLE:
10972 nodeMask = 1;
10973 break;
10974 case eATTRIBUTE:
10975 nodeMask = 1;
10976 if(Arg<CAttr*>(0)) Arg<CAttr*>(0)->PostSubVisit1( func, data );
10977 break;
10978 case eGIF:
10979 nodeMask = 0;
10980 break;
10981 case eGFOR:
10982 nodeMask = 0;
10983 break;
10984 case eGCASE:
10985 nodeMask = 0;
10986 break;
10987 case eTABLE:
10988 nodeMask = 0;
10989 break;
10990 case eTABLE_ENTRY:
10991 nodeMask = 0;
10992 break;
10993 case eTABLE_SYMBOL:
10994 nodeMask = 1;
10995 break;
10996 case ePORTLIST_END:
10997 nodeMask = 0;
10998 break;
10999 case eMACRO_EXPR:
11000 nodeMask = 1;
11001 break;
11002 case eENUM_SPEC:
11003 nodeMask = 1;
11004 break;
11005 case eMEMBER:
11006 nodeMask = 2;
11007 break;
11008 case eRETURN:
11009 nodeMask = 0;
11010 break;
11011 case ePREINC:
11012 nodeMask = 0;
11013 break;
11014 case ePOSTINC:
11015 nodeMask = 0;
11016 break;
11017 case ePREDEC:
11018 nodeMask = 0;
11019 break;
11020 case ePOSTDEC:
11021 nodeMask = 0;
11022 break;
11023 case eCAST:
11024 nodeMask = 0;
11025 break;
11026 }
11027
11028
11029
11030
11031 if( GetOp() != eLIST ) {
11032 for( int i = 0; i < ArgCount(); i++ ) {
11033 if( Arg<CNode*>(i) && !((nodeMask>>i)&1) ) Arg<CNode*>(i) = Arg<CNode*>(i)->PostSubVisit1( func, data );
11034 }
11035 } else {
11036 std::stack<CNode*> visitLog;
11037 CNode* n = this;
11038 while( 1 ) {
11039 if( n->Arg<CNode*>(0) ) {
11040 n->Arg<CNode*>(0) = n->Arg<CNode*>(0)->
11041 PostSubVisit1( func, data );
11042 }
11043 if( !n->Arg<CNode*>(1) || n->Arg<CNode*>(1)->GetOp() != eLIST ) {
11044 break;
11045 }
11046 visitLog.push(n);
11047 n = n->Arg<CNode*>(1);
11048 if( n->GetAttributes() ) {
11049 n->SetAttributes( n->GetAttributes()->PostSubVisit1( func, data ) );
11050 }
11051 }
11052 if( n->Arg<CNode*>(1) ) {
11053 n->Arg<CNode*>(1) = n->Arg<CNode*>(1)->PostSubVisit1( func, data );
11054 }
11055 while( !visitLog.empty() ) {
11056 CNode* top = visitLog.top();
11057 if( top->Arg<CNode*>(1) ) {
11058 top->Arg<CNode*>(1) = (*func)(top->Arg<CNode*>(1),data);
11059 }
11060 visitLog.pop();
11061 }
11062 }
11063
11064 return (*func)( this, data );
11065 }
11066
11067
11068
11069
11070
11071
11072
11073
11074
11075 unsigned CNode::Hash()
11076 {
11077 unsigned result = GetOp();
11078 int nodeMask = 0;
11079 switch( GetOp() ) {
11080 case eERROR:
11081 nodeMask = 0;
11082 break;
11083 case eVCONSTANT:
11084 nodeMask = 1;
11085 result ^= Arg<CVector*>(0)->Hash();
11086 break;
11087 case eRCONSTANT:
11088 nodeMask = 1;
11089 result ^= strlen(Arg<char*>(0));
11090 break;
11091 case eCOMMENT:
11092 nodeMask = 1;
11093 result ^= strlen(Arg<char*>(0));
11094 break;
11095 case eVRQ:
11096 nodeMask = 1;
11097 result ^= strlen(Arg<char*>(0));
11098 break;
11099 case ePRAGMA:
11100 nodeMask = 1;
11101 result ^= strlen(Arg<char*>(0));
11102 break;
11103 case eELIST:
11104 nodeMask = 0;
11105 break;
11106 case eWIDTH:
11107 nodeMask = 0;
11108 break;
11109 case eNOP:
11110 nodeMask = 0;
11111 break;
11112 case eSUB:
11113 nodeMask = 0;
11114 break;
11115 case eMUL:
11116 nodeMask = 0;
11117 break;
11118 case eDIV:
11119 nodeMask = 0;
11120 break;
11121 case ePOW:
11122 nodeMask = 0;
11123 break;
11124 case eADD:
11125 nodeMask = 0;
11126 break;
11127 case eLSH:
11128 nodeMask = 0;
11129 break;
11130 case eRSH:
11131 nodeMask = 0;
11132 break;
11133 case eLSHA:
11134 nodeMask = 0;
11135 break;
11136 case eRSHA:
11137 nodeMask = 0;
11138 break;
11139 case eMOD:
11140 nodeMask = 0;
11141 break;
11142 case eOR:
11143 nodeMask = 0;
11144 break;
11145 case eAND:
11146 nodeMask = 0;
11147 break;
11148 case eANDANDAND:
11149 nodeMask = 0;
11150 break;
11151 case eXOR:
11152 nodeMask = 0;
11153 break;
11154 case eXNOR:
11155 nodeMask = 0;
11156 break;
11157 case eINSTANCE_REF:
11158 nodeMask = 1;
11159 result ^= Arg<unsigned long>(0);
11160 break;
11161 case eGATE_REF:
11162 nodeMask = 1;
11163 result ^= Arg<unsigned long>(0);
11164 break;
11165 case eTASK_ENABLE:
11166 nodeMask = 1;
11167 result ^= Arg<unsigned long>(0);
11168 break;
11169 case eSYSTASK_CALL:
11170 nodeMask = 1;
11171 result ^= Arg<unsigned long>(0);
11172 break;
11173 case eTIMING_CALL:
11174 nodeMask = 1;
11175 result ^= Arg<unsigned long>(0);
11176 break;
11177 case eFUNCTION_CALL:
11178 nodeMask = 5;
11179 result ^= Arg<unsigned long>(0);
11180 result ^= Arg<unsigned long>(2);
11181 break;
11182 case eARRAY:
11183 nodeMask = 0;
11184 break;
11185 case eNET_REF:
11186 nodeMask = 1;
11187 result ^= Arg<unsigned long>(0);
11188 break;
11189 case eVAR_REF:
11190 nodeMask = 1;
11191 result ^= Arg<unsigned long>(0);
11192 break;
11193 case ePARAM_REF:
11194 nodeMask = 1;
11195 result ^= Arg<unsigned long>(0);
11196 break;
11197 case ePORT_REF:
11198 nodeMask = 1;
11199 result ^= Arg<unsigned long>(0);
11200 break;
11201 case eFWD_REF:
11202 nodeMask = 1;
11203 result ^= Arg<unsigned long>(0);
11204 break;
11205 case eGENVAR_REF:
11206 nodeMask = 1;
11207 result ^= Arg<unsigned long>(0);
11208 break;
11209 case eENUM_REF:
11210 nodeMask = 1;
11211 result ^= Arg<unsigned long>(0);
11212 break;
11213 case eTYPE_REF:
11214 nodeMask = 1;
11215 result ^= Arg<unsigned long>(0);
11216 break;
11217 case eNET_DECL:
11218 nodeMask = 1;
11219 result ^= Arg<unsigned long>(0);
11220 break;
11221 case eVAR_DECL:
11222 nodeMask = 1;
11223 result ^= Arg<unsigned long>(0);
11224 break;
11225 case ePARAM_DECL:
11226 nodeMask = 1;
11227 result ^= Arg<unsigned long>(0);
11228 break;
11229 case eSPECPARAM_DECL:
11230 nodeMask = 1;
11231 result ^= Arg<unsigned long>(0);
11232 break;
11233 case ePORT_DECL:
11234 nodeMask = 1;
11235 result ^= Arg<unsigned long>(0);
11236 break;
11237 case eGENVAR_DECL:
11238 nodeMask = 1;
11239 result ^= Arg<unsigned long>(0);
11240 break;
11241 case eTYPEDEF_DECL:
11242 nodeMask = 1;
11243 result ^= Arg<unsigned long>(0);
11244 break;
11245 case eLIST:
11246 nodeMask = 0;
11247 break;
11248 case eRANGE:
11249 nodeMask = 0;
11250 break;
11251 case eSLICE:
11252 nodeMask = 0;
11253 break;
11254 case ePSLICE:
11255 nodeMask = 0;
11256 break;
11257 case eMSLICE:
11258 nodeMask = 0;
11259 break;
11260 case eCVRI:
11261 nodeMask = 0;
11262 break;
11263 case eCVIR:
11264 nodeMask = 0;
11265 break;
11266 case eREP:
11267 nodeMask = 0;
11268 break;
11269 case eCAT:
11270 nodeMask = 0;
11271 break;
11272 case eUCAT:
11273 nodeMask = 0;
11274 break;
11275 case eCOM:
11276 nodeMask = 0;
11277 break;
11278 case eNEG:
11279 nodeMask = 0;
11280 break;
11281 case ePLUS:
11282 nodeMask = 0;
11283 break;
11284 case eNOT:
11285 nodeMask = 0;
11286 break;
11287 case eGT:
11288 nodeMask = 0;
11289 break;
11290 case eGE:
11291 nodeMask = 0;
11292 break;
11293 case eLT:
11294 nodeMask = 0;
11295 break;
11296 case eLE:
11297 nodeMask = 0;
11298 break;
11299 case eLAND:
11300 nodeMask = 0;
11301 break;
11302 case eLOR:
11303 nodeMask = 0;
11304 break;
11305 case eCEQ:
11306 nodeMask = 0;
11307 break;
11308 case eCNE:
11309 nodeMask = 0;
11310 break;
11311 case eEQ:
11312 nodeMask = 0;
11313 break;
11314 case eNE:
11315 nodeMask = 0;
11316 break;
11317 case eRAND:
11318 nodeMask = 0;
11319 break;
11320 case eRNAND:
11321 nodeMask = 0;
11322 break;
11323 case eROR:
11324 nodeMask = 0;
11325 break;
11326 case eRNOR:
11327 nodeMask = 0;
11328 break;
11329 case eRXOR:
11330 nodeMask = 0;
11331 break;
11332 case eRXNOR:
11333 nodeMask = 0;
11334 break;
11335 case eHOOK:
11336 nodeMask = 0;
11337 break;
11338 case eINIT:
11339 nodeMask = 0;
11340 break;
11341 case eALWAYS:
11342 nodeMask = 0;
11343 break;
11344 case eALWAYS_LATCH:
11345 nodeMask = 0;
11346 break;
11347 case eALWAYS_FF:
11348 nodeMask = 0;
11349 break;
11350 case eALWAYS_COMB:
11351 nodeMask = 0;
11352 break;
11353 case eEVENT:
11354 nodeMask = 0;
11355 break;
11356 case eBLOCK_REF:
11357 nodeMask = 1;
11358 result ^= Arg<unsigned long>(0);
11359 break;
11360 case eSPECIFY_REF:
11361 nodeMask = 1;
11362 result ^= Arg<unsigned long>(0);
11363 break;
11364 case eASSIGN:
11365 nodeMask = 0;
11366 break;
11367 case eADD_ASSIGN:
11368 nodeMask = 0;
11369 break;
11370 case eSUB_ASSIGN:
11371 nodeMask = 0;
11372 break;
11373 case eMUL_ASSIGN:
11374 nodeMask = 0;
11375 break;
11376 case eDIV_ASSIGN:
11377 nodeMask = 0;
11378 break;
11379 case eMOD_ASSIGN:
11380 nodeMask = 0;
11381 break;
11382 case eAND_ASSIGN:
11383 nodeMask = 0;
11384 break;
11385 case eOR_ASSIGN:
11386 nodeMask = 0;
11387 break;
11388 case eXOR_ASSIGN:
11389 nodeMask = 0;
11390 break;
11391 case eLSH_ASSIGN:
11392 nodeMask = 0;
11393 break;
11394 case eRSH_ASSIGN:
11395 nodeMask = 0;
11396 break;
11397 case eLSHA_ASSIGN:
11398 nodeMask = 0;
11399 break;
11400 case eRSHA_ASSIGN:
11401 nodeMask = 0;
11402 break;
11403 case eFORCE:
11404 nodeMask = 0;
11405 break;
11406 case eRELEASE:
11407 nodeMask = 0;
11408 break;
11409 case eNBASSIGN:
11410 nodeMask = 0;
11411 break;
11412 case ePOSEDGE:
11413 nodeMask = 0;
11414 break;
11415 case eNEGEDGE:
11416 nodeMask = 0;
11417 break;
11418 case eEDGE:
11419 nodeMask = 2;
11420 result ^= (unsigned long)Arg<Edge_t>(1);
11421 break;
11422 case eEVOR:
11423 nodeMask = 0;
11424 break;
11425 case eDELAY:
11426 nodeMask = 0;
11427 break;
11428 case eMTM:
11429 nodeMask = 0;
11430 break;
11431 case eIF:
11432 nodeMask = 0;
11433 break;
11434 case eFOREVER:
11435 nodeMask = 0;
11436 break;
11437 case eREPEAT:
11438 nodeMask = 0;
11439 break;
11440 case eWHILE:
11441 nodeMask = 0;
11442 break;
11443 case eWAIT:
11444 nodeMask = 0;
11445 break;
11446 case eFOR:
11447 nodeMask = 0;
11448 break;
11449 case eCASE:
11450 nodeMask = 0;
11451 break;
11452 case eCASEX:
11453 nodeMask = 0;
11454 break;
11455 case eCASEZ:
11456 nodeMask = 0;
11457 break;
11458 case eCASEITEM:
11459 nodeMask = 0;
11460 break;
11461 case eCASSIGN:
11462 nodeMask = 1;
11463 result ^= Arg<unsigned long>(0);
11464 break;
11465 case eARG:
11466 nodeMask = 1;
11467 result ^= Arg<unsigned long>(0);
11468 break;
11469 case eFUNCTION_DEF:
11470 nodeMask = 1;
11471 result ^= Arg<unsigned long>(0);
11472 break;
11473 case eMODULE_DEF:
11474 nodeMask = 1;
11475 result ^= Arg<unsigned long>(0);
11476 break;
11477 case eREPEAT_CONTROL:
11478 nodeMask = 0;
11479 break;
11480 case eDELAY_CONTROL:
11481 nodeMask = 0;
11482 break;
11483 case eEVENT_CONTROL:
11484 nodeMask = 0;
11485 break;
11486 case eEXTERNAL_REF:
11487 nodeMask = 1;
11488 result ^= Arg<unsigned long>(0);
11489 break;
11490 case ePORT_DEF:
11491 nodeMask = 1;
11492 result ^= Arg<unsigned long>(0);
11493 break;
11494 case eDEFPARAM:
11495 nodeMask = 0;
11496 break;
11497 case ePATH:
11498 nodeMask = 45;
11499 result ^= Arg<int>(0);
11500 result ^= Arg<int>(2);
11501 result ^= Arg<int>(3);
11502 result ^= Arg<int>(5);
11503 break;
11504 case ePATH_ASSIGN:
11505 nodeMask = 0;
11506 break;
11507 case eIFNONE_PATH_ASSIGN:
11508 nodeMask = 0;
11509 break;
11510 case eTRIGGER:
11511 nodeMask = 0;
11512 break;
11513 case ePASSIGN:
11514 nodeMask = 0;
11515 break;
11516 case eDEASSIGN:
11517 nodeMask = 0;
11518 break;
11519 case eDISABLE:
11520 nodeMask = 1;
11521 result ^= Arg<unsigned long>(0);
11522 break;
11523 case eATTRIBUTE:
11524 nodeMask = 1;
11525 result ^= Arg<unsigned long>(0);
11526 break;
11527 case eGIF:
11528 nodeMask = 0;
11529 break;
11530 case eGFOR:
11531 nodeMask = 0;
11532 break;
11533 case eGCASE:
11534 nodeMask = 0;
11535 break;
11536 case eTABLE:
11537 nodeMask = 0;
11538 break;
11539 case eTABLE_ENTRY:
11540 nodeMask = 0;
11541 break;
11542 case eTABLE_SYMBOL:
11543 nodeMask = 1;
11544 result ^= strlen(Arg<char*>(0));
11545 break;
11546 case ePORTLIST_END:
11547 nodeMask = 0;
11548 break;
11549 case eMACRO_EXPR:
11550 nodeMask = 1;
11551 result ^= strlen(Arg<char*>(0));
11552 break;
11553 case eENUM_SPEC:
11554 nodeMask = 1;
11555 result ^= Arg<unsigned long>(0);
11556 break;
11557 case eMEMBER:
11558 nodeMask = 2;
11559 result ^= Arg<unsigned long>(1);
11560 break;
11561 case eRETURN:
11562 nodeMask = 0;
11563 break;
11564 case ePREINC:
11565 nodeMask = 0;
11566 break;
11567 case ePOSTINC:
11568 nodeMask = 0;
11569 break;
11570 case ePREDEC:
11571 nodeMask = 0;
11572 break;
11573 case ePOSTDEC:
11574 nodeMask = 0;
11575 break;
11576 case eCAST:
11577 nodeMask = 0;
11578 break;
11579 }
11580
11581 for( int i = 0; i < ArgCount(); i++ ) {
11582 if( !((nodeMask>>i)&1) ) result ^= Arg<CNode*>(i)->Hash();
11583 }
11584 return result;
11585 }
11586
11587
11588
11589
11590
11591
11592
11593
11594
11595
11596
11597
11598
11599 int Equivalent( CNode* a, CNode* b )
11600 {
11601
11602
11603
11604 if( a == b ) {
11605 return TRUE;
11606 }
11607
11608
11609
11610 if( a == NULL || b == NULL ) {
11611 return FALSE;
11612 }
11613
11614
11615
11616 if( a->GetOp() != b->GetOp() ) {
11617 return FALSE;
11618 }
11619
11620 int nodeMask = 0;
11621 switch( a->GetOp() ) {
11622 case eERROR:
11623 nodeMask = 0;
11624 break;
11625 case eVCONSTANT:
11626 nodeMask = 1;
11627 if( !(*a->Arg<CVector*>(0)==*b->Arg<CVector*>(0)) ) { return FALSE; }
11628 break;
11629 case eRCONSTANT:
11630 nodeMask = 1;
11631 if( !(!strcmp(a->Arg<char*>(0),b->Arg<char*>(0))) ) { return FALSE; }
11632 break;
11633 case eCOMMENT:
11634 nodeMask = 1;
11635 if( !(!strcmp(a->Arg<char*>(0),b->Arg<char*>(0))) ) { return FALSE; }
11636 break;
11637 case eVRQ:
11638 nodeMask = 1;
11639 if( !(!strcmp(a->Arg<char*>(0),b->Arg<char*>(0))) ) { return FALSE; }
11640 break;
11641 case ePRAGMA:
11642 nodeMask = 1;
11643 if( !(!strcmp(a->Arg<char*>(0),b->Arg<char*>(0))) ) { return FALSE; }
11644 break;
11645 case eELIST:
11646 nodeMask = 0;
11647 break;
11648 case eWIDTH:
11649 nodeMask = 0;
11650 break;
11651 case eNOP:
11652 nodeMask = 0;
11653 break;
11654 case eSUB:
11655 nodeMask = 0;
11656 break;
11657 case eMUL:
11658 nodeMask = 0;
11659 break;
11660 case eDIV:
11661 nodeMask = 0;
11662 break;
11663 case ePOW:
11664 nodeMask = 0;
11665 break;
11666 case eADD:
11667 nodeMask = 0;
11668 break;
11669 case eLSH:
11670 nodeMask = 0;
11671 break;
11672 case eRSH:
11673 nodeMask = 0;
11674 break;
11675 case eLSHA:
11676 nodeMask = 0;
11677 break;
11678 case eRSHA:
11679 nodeMask = 0;
11680 break;
11681 case eMOD:
11682 nodeMask = 0;
11683 break;
11684 case eOR:
11685 nodeMask = 0;
11686 break;
11687 case eAND:
11688 nodeMask = 0;
11689 break;
11690 case eANDANDAND:
11691 nodeMask = 0;
11692 break;
11693 case eXOR:
11694 nodeMask = 0;
11695 break;
11696 case eXNOR:
11697 nodeMask = 0;
11698 break;
11699 case eINSTANCE_REF:
11700 nodeMask = 1;
11701 if( !(a->Arg<CInstance*>(0)==b->Arg<CInstance*>(0)) ) { return FALSE; }
11702 break;
11703 case eGATE_REF:
11704 nodeMask = 1;
11705 if( !(a->Arg<CGate*>(0)==b->Arg<CGate*>(0)) ) { return FALSE; }
11706 break;
11707 case eTASK_ENABLE:
11708 nodeMask = 1;
11709 if( !(a->Arg<CSymbol*>(0)==b->Arg<CSymbol*>(0)) ) { return FALSE; }
11710 break;
11711 case eSYSTASK_CALL:
11712 nodeMask = 1;
11713 if( !(a->Arg<CSymbol*>(0)==b->Arg<CSymbol*>(0)) ) { return FALSE; }
11714 break;
11715 case eTIMING_CALL:
11716 nodeMask = 1;
11717 if( !(a->Arg<CSymbol*>(0)==b->Arg<CSymbol*>(0)) ) { return FALSE; }
11718 break;
11719 case eFUNCTION_CALL:
11720 nodeMask = 5;
11721 if( !(a->Arg<CSymbol*>(0)==b->Arg<CSymbol*>(0)) ) { return FALSE; }
11722 if( !(a->Arg<CScope*>(2)==b->Arg<CScope*>(2)) ) { return FALSE; }
11723 break;
11724 case eARRAY:
11725 nodeMask = 0;
11726 break;
11727 case eNET_REF:
11728 nodeMask = 1;
11729 if( !(a->Arg<CNet*>(0)==b->Arg<CNet*>(0)) ) { return FALSE; }
11730 break;
11731 case eVAR_REF:
11732 nodeMask = 1;
11733 if( !(a->Arg<CVar*>(0)==b->Arg<CVar*>(0)) ) { return FALSE; }
11734 break;
11735 case ePARAM_REF:
11736 nodeMask = 1;
11737 if( !(a->Arg<CParam*>(0)==b->Arg<CParam*>(0)) ) { return FALSE; }
11738 break;
11739 case ePORT_REF:
11740 nodeMask = 1;
11741 if( !(a->Arg<CPortDir*>(0)==b->Arg<CPortDir*>(0)) ) { return FALSE; }
11742 break;
11743 case eFWD_REF:
11744 nodeMask = 1;
11745 if( !(a->Arg<CFref*>(0)==b->Arg<CFref*>(0)) ) { return FALSE; }
11746 break;
11747 case eGENVAR_REF:
11748 nodeMask = 1;
11749 if( !(a->Arg<CGenvar*>(0)==b->Arg<CGenvar*>(0)) ) { return FALSE; }
11750 break;
11751 case eENUM_REF:
11752 nodeMask = 1;
11753 MASSERT(FALSE);
11754 break;
11755 case eTYPE_REF:
11756 nodeMask = 1;
11757 MASSERT(FALSE);
11758 break;
11759 case eNET_DECL:
11760 nodeMask = 1;
11761 if( !(a->Arg<CNet*>(0)==b->Arg<CNet*>(0)) ) { return FALSE; }
11762 break;
11763 case eVAR_DECL:
11764 nodeMask = 1;
11765 if( !(a->Arg<CVar*>(0)==b->Arg<CVar*>(0)) ) { return FALSE; }
11766 break;
11767 case ePARAM_DECL:
11768 nodeMask = 1;
11769 if( !(a->Arg<CParam*>(0)==b->Arg<CParam*>(0)) ) { return FALSE; }
11770 break;
11771 case eSPECPARAM_DECL:
11772 nodeMask = 1;
11773 if( !(a->Arg<CParam*>(0)==b->Arg<CParam*>(0)) ) { return FALSE; }
11774 break;
11775 case ePORT_DECL:
11776 nodeMask = 1;
11777 if( !(a->Arg<CPortDir*>(0)==b->Arg<CPortDir*>(0)) ) { return FALSE; }
11778 break;
11779 case eGENVAR_DECL:
11780 nodeMask = 1;
11781 if( !(a->Arg<CGenvar*>(0)==b->Arg<CGenvar*>(0)) ) { return FALSE; }
11782 break;
11783 case eTYPEDEF_DECL:
11784 nodeMask = 1;
11785 MASSERT(FALSE);
11786 break;
11787 case eLIST:
11788 nodeMask = 0;
11789 break;
11790 case eRANGE:
11791 nodeMask = 0;
11792 break;
11793 case eSLICE:
11794 nodeMask = 0;
11795 break;
11796 case ePSLICE:
11797 nodeMask = 0;
11798 break;
11799 case eMSLICE:
11800 nodeMask = 0;
11801 break;
11802 case eCVRI:
11803 nodeMask = 0;
11804 break;
11805 case eCVIR:
11806 nodeMask = 0;
11807 break;
11808 case eREP:
11809 nodeMask = 0;
11810 break;
11811 case eCAT:
11812 nodeMask = 0;
11813 break;
11814 case eUCAT:
11815 nodeMask = 0;
11816 break;
11817 case eCOM:
11818 nodeMask = 0;
11819 break;
11820 case eNEG:
11821 nodeMask = 0;
11822 break;
11823 case ePLUS:
11824 nodeMask = 0;
11825 break;
11826 case eNOT:
11827 nodeMask = 0;
11828 break;
11829 case eGT:
11830 nodeMask = 0;
11831 break;
11832 case eGE:
11833 nodeMask = 0;
11834 break;
11835 case eLT:
11836 nodeMask = 0;
11837 break;
11838 case eLE:
11839 nodeMask = 0;
11840 break;
11841 case eLAND:
11842 nodeMask = 0;
11843 break;
11844 case eLOR:
11845 nodeMask = 0;
11846 break;
11847 case eCEQ:
11848 nodeMask = 0;
11849 break;
11850 case eCNE:
11851 nodeMask = 0;
11852 break;
11853 case eEQ:
11854 nodeMask = 0;
11855 break;
11856 case eNE:
11857 nodeMask = 0;
11858 break;
11859 case eRAND:
11860 nodeMask = 0;
11861 break;
11862 case eRNAND:
11863 nodeMask = 0;
11864 break;
11865 case eROR:
11866 nodeMask = 0;
11867 break;
11868 case eRNOR:
11869 nodeMask = 0;
11870 break;
11871 case eRXOR:
11872 nodeMask = 0;
11873 break;
11874 case eRXNOR:
11875 nodeMask = 0;
11876 break;
11877 case eHOOK:
11878 nodeMask = 0;
11879 break;
11880 case eINIT:
11881 nodeMask = 0;
11882 break;
11883 case eALWAYS:
11884 nodeMask = 0;
11885 break;
11886 case eALWAYS_LATCH:
11887 nodeMask = 0;
11888 break;
11889 case eALWAYS_FF:
11890 nodeMask = 0;
11891 break;
11892 case eALWAYS_COMB:
11893 nodeMask = 0;
11894 break;
11895 case eEVENT:
11896 nodeMask = 0;
11897 break;
11898 case eBLOCK_REF:
11899 nodeMask = 1;
11900 if( !(a->Arg<CBlock*>(0)==b->Arg<CBlock*>(0)) ) { return FALSE; }
11901 break;
11902 case eSPECIFY_REF:
11903 nodeMask = 1;
11904 if( !(a->Arg<CSpecify*>(0)==b->Arg<CSpecify*>(0)) ) { return FALSE; }
11905 break;
11906 case eASSIGN:
11907 nodeMask = 0;
11908 break;
11909 case eADD_ASSIGN:
11910 nodeMask = 0;
11911 break;
11912 case eSUB_ASSIGN:
11913 nodeMask = 0;
11914 break;
11915 case eMUL_ASSIGN:
11916 nodeMask = 0;
11917 break;
11918 case eDIV_ASSIGN:
11919 nodeMask = 0;
11920 break;
11921 case eMOD_ASSIGN:
11922 nodeMask = 0;
11923 break;
11924 case eAND_ASSIGN:
11925 nodeMask = 0;
11926 break;
11927 case eOR_ASSIGN:
11928 nodeMask = 0;
11929 break;
11930 case eXOR_ASSIGN:
11931 nodeMask = 0;
11932 break;
11933 case eLSH_ASSIGN:
11934 nodeMask = 0;
11935 break;
11936 case eRSH_ASSIGN:
11937 nodeMask = 0;
11938 break;
11939 case eLSHA_ASSIGN:
11940 nodeMask = 0;
11941 break;
11942 case eRSHA_ASSIGN:
11943 nodeMask = 0;
11944 break;
11945 case eFORCE:
11946 nodeMask = 0;
11947 break;
11948 case eRELEASE:
11949 nodeMask = 0;
11950 break;
11951 case eNBASSIGN:
11952 nodeMask = 0;
11953 break;
11954 case ePOSEDGE:
11955 nodeMask = 0;
11956 break;
11957 case eNEGEDGE:
11958 nodeMask = 0;
11959 break;
11960 case eEDGE:
11961 nodeMask = 2;
11962 if( !(a->Arg<Edge_t>(1)==b->Arg<Edge_t>(1)) ) { return FALSE; }
11963 break;
11964 case eEVOR:
11965 nodeMask = 0;
11966 break;
11967 case eDELAY:
11968 nodeMask = 0;
11969 break;
11970 case eMTM:
11971 nodeMask = 0;
11972 break;
11973 case eIF:
11974 nodeMask = 0;
11975 break;
11976 case eFOREVER:
11977 nodeMask = 0;
11978 break;
11979 case eREPEAT:
11980 nodeMask = 0;
11981 break;
11982 case eWHILE:
11983 nodeMask = 0;
11984 break;
11985 case eWAIT:
11986 nodeMask = 0;
11987 break;
11988 case eFOR:
11989 nodeMask = 0;
11990 break;
11991 case eCASE:
11992 nodeMask = 0;
11993 break;
11994 case eCASEX:
11995 nodeMask = 0;
11996 break;
11997 case eCASEZ:
11998 nodeMask = 0;
11999 break;
12000 case eCASEITEM:
12001 nodeMask = 0;
12002 break;
12003 case eCASSIGN:
12004 nodeMask = 1;
12005 if( !(a->Arg<StrengthPair_t*>(0)==b->Arg<StrengthPair_t*>(0)) ) { return FALSE; }
12006 break;
12007 case eARG:
12008 nodeMask = 1;
12009 if( !(a->Arg<CSymbol*>(0)==b->Arg<CSymbol*>(0)) ) { return FALSE; }
12010 break;
12011 case eFUNCTION_DEF:
12012 nodeMask = 1;
12013 if( !(a->Arg<CFunction*>(0)==b->Arg<CFunction*>(0)) ) { return FALSE; }
12014 break;
12015 case eMODULE_DEF:
12016 nodeMask = 1;
12017 if( !(a->Arg<CModule*>(0)==b->Arg<CModule*>(0)) ) { return FALSE; }
12018 break;
12019 case eREPEAT_CONTROL:
12020 nodeMask = 0;
12021 break;
12022 case eDELAY_CONTROL:
12023 nodeMask = 0;
12024 break;
12025 case eEVENT_CONTROL:
12026 nodeMask = 0;
12027 break;
12028 case eEXTERNAL_REF:
12029 nodeMask = 1;
12030 if( !(a->Arg<CSymbol*>(0)==b->Arg<CSymbol*>(0)) ) { return FALSE; }
12031 break;
12032 case ePORT_DEF:
12033 nodeMask = 1;
12034 if( !(a->Arg<CPort*>(0)==b->Arg<CPort*>(0)) ) { return FALSE; }
12035 break;
12036 case eDEFPARAM:
12037 nodeMask = 0;
12038 break;
12039 case ePATH:
12040 nodeMask = 45;
12041 if( !(a->Arg<int>(0)==b->Arg<int>(0)) ) { return FALSE; }
12042 if( !(a->Arg<int>(2)==b->Arg<int>(2)) ) { return FALSE; }
12043 if( !(a->Arg<int>(3)==b->Arg<int>(3)) ) { return FALSE; }
12044 if( !(a->Arg<int>(5)==b->Arg<int>(5)) ) { return FALSE; }
12045 break;
12046 case ePATH_ASSIGN:
12047 nodeMask = 0;
12048 break;
12049 case eIFNONE_PATH_ASSIGN:
12050 nodeMask = 0;
12051 break;
12052 case eTRIGGER:
12053 nodeMask = 0;
12054 break;
12055 case ePASSIGN:
12056 nodeMask = 0;
12057 break;
12058 case eDEASSIGN:
12059 nodeMask = 0;
12060 break;
12061 case eDISABLE:
12062 nodeMask = 1;
12063 if( !(a->Arg<CSymbol*>(0)==b->Arg<CSymbol*>(0)) ) { return FALSE; }
12064 break;
12065 case eATTRIBUTE:
12066 nodeMask = 1;
12067 if( !(a->Arg<CAttr*>(0)==b->Arg<CAttr*>(0)) ) { return FALSE; }
12068 break;
12069 case eGIF:
12070 nodeMask = 0;
12071 break;
12072 case eGFOR:
12073 nodeMask = 0;
12074 break;
12075 case eGCASE:
12076 nodeMask = 0;
12077 break;
12078 case eTABLE:
12079 nodeMask = 0;
12080 break;
12081 case eTABLE_ENTRY:
12082 nodeMask = 0;
12083 break;
12084 case eTABLE_SYMBOL:
12085 nodeMask = 1;
12086 if( !(!strcmp(a->Arg<char*>(0),b->Arg<char*>(0))) ) { return FALSE; }
12087 break;
12088 case ePORTLIST_END:
12089 nodeMask = 0;
12090 break;
12091 case eMACRO_EXPR:
12092 nodeMask = 1;
12093 if( !(!strcmp(a->Arg<char*>(0),b->Arg<char*>(0))) ) { return FALSE; }
12094 break;
12095 case eENUM_SPEC:
12096 nodeMask = 1;
12097 if( !(a->Arg<CSymbol*>(0)==b->Arg<CSymbol*>(0)) ) { return FALSE; }
12098 break;
12099 case eMEMBER:
12100 nodeMask = 2;
12101 if( !(a->Arg<CSymbol*>(1)==b->Arg<CSymbol*>(1)) ) { return FALSE; }
12102 break;
12103 case eRETURN:
12104 nodeMask = 0;
12105 break;
12106 case ePREINC:
12107 nodeMask = 0;
12108 break;
12109 case ePOSTINC:
12110 nodeMask = 0;
12111 break;
12112 case ePREDEC:
12113 nodeMask = 0;
12114 break;
12115 case ePOSTDEC:
12116 nodeMask = 0;
12117 break;
12118 case eCAST:
12119 nodeMask = 0;
12120 break;
12121 }
12122
12123 for( int i = 0; i < a->ArgCount(); i++ ) {
12124 if( !((nodeMask>>i)&1) &&
12125 !Equivalent(a->Arg<CNode*>(i),b->Arg<CNode*>(i)) ) return FALSE;
12126 }
12127 return TRUE;
12128 }
12129
12130
12131
12132
12133
12134
12135 int CNode::IsEvaluateable()
12136 {
12137 switch( op ) {
12138 case eFUNCTION_CALL:
12139 return CFunction::Evaluateable(Arg<CSymbol*>(0),Arg<CNode*>(1),Arg<CBlock*>(2));;
12140 case ePARAM_REF:
12141 return Arg<CParam*>(0)->GetExpression()->IsEvaluateable();
12142 case eENUM_REF:
12143 return Arg<CParam*>(0)->GetExpression()->IsEvaluateable();
12144 case eMACRO_EXPR:
12145 return Arg<CNode*>(1) ? Arg<CNode*>(1)->IsEvaluateable() : FALSE;
12146 case eVCONSTANT:
12147 case eRCONSTANT:
12148 return TRUE;
12149 case eWIDTH:
12150 case eSUB:
12151 case eMUL:
12152 case eDIV:
12153 case ePOW:
12154 case eADD:
12155 case eLSH:
12156 case eRSH:
12157 case eLSHA:
12158 case eRSHA:
12159 case eMOD:
12160 case eOR:
12161 case eAND:
12162 case eXOR:
12163 case eXNOR:
12164 case eCVRI:
12165 case eCVIR:
12166 case eREP:
12167 case eCAT:
12168 case eUCAT:
12169 case eCOM:
12170 case eNEG:
12171 case ePLUS:
12172 case eNOT:
12173 case eGT:
12174 case eGE:
12175 case eLT:
12176 case eLE:
12177 case eLAND:
12178 case eLOR:
12179 case eCEQ:
12180 case eCNE:
12181 case eEQ:
12182 case eNE:
12183 case eRAND:
12184 case eRNAND:
12185 case eROR:
12186 case eRNOR:
12187 case eRXOR:
12188 case eRXNOR:
12189 case eHOOK:
12190 break;
12191 case eERROR:
12192 case eCOMMENT:
12193 case eVRQ:
12194 case ePRAGMA:
12195 case eELIST:
12196 case eNOP:
12197 case eANDANDAND:
12198 case eINSTANCE_REF:
12199 case eGATE_REF:
12200 case eTASK_ENABLE:
12201 case eSYSTASK_CALL:
12202 case eTIMING_CALL:
12203 case eARRAY:
12204 case eNET_REF:
12205 case eVAR_REF:
12206 case ePORT_REF:
12207 case eFWD_REF:
12208 case eGENVAR_REF:
12209 case eTYPE_REF:
12210 case eNET_DECL:
12211 case eVAR_DECL:
12212 case ePARAM_DECL:
12213 case eSPECPARAM_DECL:
12214 case ePORT_DECL:
12215 case eGENVAR_DECL:
12216 case eTYPEDEF_DECL:
12217 case eLIST:
12218 case eRANGE:
12219 case eSLICE:
12220 case ePSLICE:
12221 case eMSLICE:
12222 case eINIT:
12223 case eALWAYS:
12224 case eALWAYS_LATCH:
12225 case eALWAYS_FF:
12226 case eALWAYS_COMB:
12227 case eEVENT:
12228 case eBLOCK_REF:
12229 case eSPECIFY_REF:
12230 case eASSIGN:
12231 case eADD_ASSIGN:
12232 case eSUB_ASSIGN:
12233 case eMUL_ASSIGN:
12234 case eDIV_ASSIGN:
12235 case eMOD_ASSIGN:
12236 case eAND_ASSIGN:
12237 case eOR_ASSIGN:
12238 case eXOR_ASSIGN:
12239 case eLSH_ASSIGN:
12240 case eRSH_ASSIGN:
12241 case eLSHA_ASSIGN:
12242 case eRSHA_ASSIGN:
12243 case eFORCE:
12244 case eRELEASE:
12245 case eNBASSIGN:
12246 case ePOSEDGE:
12247 case eNEGEDGE:
12248 case eEDGE:
12249 case eEVOR:
12250 case eDELAY:
12251 case eMTM:
12252 case eIF:
12253 case eFOREVER:
12254 case eREPEAT:
12255 case eWHILE:
12256 case eWAIT:
12257 case eFOR:
12258 case eCASE:
12259 case eCASEX:
12260 case eCASEZ:
12261 case eCASEITEM:
12262 case eCASSIGN:
12263 case eARG:
12264 case eFUNCTION_DEF:
12265 case eMODULE_DEF:
12266 case eREPEAT_CONTROL:
12267 case eDELAY_CONTROL:
12268 case eEVENT_CONTROL:
12269 case eEXTERNAL_REF:
12270 case ePORT_DEF:
12271 case eDEFPARAM:
12272 case ePATH:
12273 case ePATH_ASSIGN:
12274 case eIFNONE_PATH_ASSIGN:
12275 case eTRIGGER:
12276 case ePASSIGN:
12277 case eDEASSIGN:
12278 case eDISABLE:
12279 case eATTRIBUTE:
12280 case eGIF:
12281 case eGFOR:
12282 case eGCASE:
12283 case eTABLE:
12284 case eTABLE_ENTRY:
12285 case eTABLE_SYMBOL:
12286 case ePORTLIST_END:
12287 case eENUM_SPEC:
12288 case eMEMBER:
12289 case eRETURN:
12290 case ePREINC:
12291 case ePOSTINC:
12292 case ePREDEC:
12293 case ePOSTDEC:
12294 case eCAST:
12295 return FALSE;
12296 default:
12297 MASSERT( FALSE );
12298 }
12299
12300 for( int i = 0; i < ArgCount(); i++ ) {
12301 if( !Arg<CNode*>(i)->IsEvaluateable() ) return FALSE;
12302 }
12303
12304 return TRUE;
12305 }
12306
12307
12308
12309
12310
12311
12312
12313
12314
12315
12316 void CNode::_EvalVector( CVector& v )
12317 {
12318 switch( op ) {
12319 case eVCONSTANT:
12320 { int width = v.GetWidth(); v.SetWidth(Arg<CVector*>(0)->GetWidth()); v = *Arg<CVector*>(0); v.SetWidth(width); };
12321 break;
12322 case eWIDTH:
12323 {CVector vi(Arg<CNode*>(1)->width); vi.Signed(Arg<CNode*>(1)->type==eS);v.Signed(type==eS); Arg<CNode*>(1)->_EvalVector(vi); vi.SetWidth(width);vi.Signed(type==eS); v = vi;};
12324 break;
12325 case eSUB:
12326 EVAL_VECTOR_BINARY(Sub);
12327 break;
12328 case eMUL:
12329 EVAL_VECTOR_BINARY(Mul);
12330 break;
12331 case eDIV:
12332 EVAL_VECTOR_BINARY(Div);
12333 break;
12334 case ePOW:
12335 EVAL_VECTOR_BINARY(Pow);
12336 break;
12337 case eADD:
12338 EVAL_VECTOR_BINARY(Add);
12339 break;
12340 case eLSH:
12341 EVAL_VECTOR_BINARY_SELF_RIGHT(Lsh);
12342 break;
12343 case eRSH:
12344 EVAL_VECTOR_BINARY_SELF_RIGHT(Rsh);
12345 break;
12346 case eLSHA:
12347 EVAL_VECTOR_BINARY_SELF_RIGHT(Lsha);
12348 break;
12349 case eRSHA:
12350 EVAL_VECTOR_BINARY_SELF_RIGHT(Rsha);
12351 break;
12352 case eMOD:
12353 EVAL_VECTOR_BINARY(Mod);
12354 break;
12355 case eOR:
12356 EVAL_VECTOR_BINARY(Or);
12357 break;
12358 case eAND:
12359 EVAL_VECTOR_BINARY(And);
12360 break;
12361 case eXOR:
12362 EVAL_VECTOR_BINARY(Xor);
12363 break;
12364 case eXNOR:
12365 EVAL_VECTOR_BINARY(Xnor);
12366 break;
12367 case eFUNCTION_CALL:
12368 CFunction::EvalVector(v,Arg<CSymbol*>(0),Arg<CNode*>(1),Arg<CBlock*>(2));;
12369 break;
12370 case ePARAM_REF:
12371 EVAL_VECTOR_PARAM_REF();
12372 break;
12373 case eENUM_REF:
12374 EVAL_VECTOR_ENUM_REF();
12375 break;
12376 case eCVRI:
12377 v.LoadReal( Arg<CNode*>(0)->_EvalReal() );
12378 break;
12379 case eREP:
12380 EVAL_VECTOR_BINARY(Rep);
12381 break;
12382 case eCAT:
12383 EVAL_VECTOR_BINARY(Cat);
12384 break;
12385 case eUCAT:
12386 { CVector vv(Arg<CNode*>(0)->width); Arg<CNode*>(0)->_EvalVector(vv); v = vv;};
12387 break;
12388 case eCOM:
12389 EVAL_VECTOR_UNARY(Com);
12390 break;
12391 case eNEG:
12392 EVAL_VECTOR_UNARY(Neg);
12393 break;
12394 case ePLUS:
12395 EVAL_VECTOR_UNARY(Plus);
12396 break;
12397 case eNOT:
12398 EVAL_VECTOR_UNARY(Not);
12399 break;
12400 case eGT:
12401 EVAL_RELATIONAL(Gt);
12402 break;
12403 case eGE:
12404 EVAL_RELATIONAL(Ge);
12405 break;
12406 case eLT:
12407 EVAL_RELATIONAL(Lt);
12408 break;
12409 case eLE:
12410 EVAL_RELATIONAL(Le);
12411 break;
12412 case eLAND:
12413 EVAL_VECTOR_BINARY(Land);
12414 break;
12415 case eLOR:
12416 EVAL_VECTOR_BINARY(Lor);
12417 break;
12418 case eCEQ:
12419 EVAL_RELATIONAL(Ceq);
12420 break;
12421 case eCNE:
12422 EVAL_RELATIONAL(Cne);
12423 break;
12424 case eEQ:
12425 EVAL_RELATIONAL(Eq);
12426 break;
12427 case eNE:
12428 EVAL_RELATIONAL(Ne);
12429 break;
12430 case eRAND:
12431 EVAL_VECTOR_UNARY_SELF(Rand);
12432 break;
12433 case eRNAND:
12434 EVAL_VECTOR_UNARY_SELF(Rnand);
12435 break;
12436 case eROR:
12437 EVAL_VECTOR_UNARY_SELF(Ror);
12438 break;
12439 case eRNOR:
12440 EVAL_VECTOR_UNARY_SELF(Rnor);
12441 break;
12442 case eRXOR:
12443 EVAL_VECTOR_UNARY_SELF(Rxor);
12444 break;
12445 case eRXNOR:
12446 EVAL_VECTOR_UNARY_SELF(Rxnor);
12447 break;
12448 case eHOOK:
12449 EVAL_VECTOR_HOOK();
12450 break;
12451 case eMACRO_EXPR:
12452 Arg<CNode*>(1)->EvalVector(v);
12453 break;
12454 default:
12455 MASSERT( FALSE );
12456 }
12457 }
12458
12459
12460
12461
12462
12463
12464
12465
12466
12467
12468 double CNode::_EvalReal()
12469 {
12470 double d;
12471 switch( op ) {
12472 case eRCONSTANT:
12473 d = s2d(Arg<char*>(0));
12474 break;
12475 case eSUB:
12476 EVAL_REAL_BINARY(Sub);
12477 break;
12478 case eMUL:
12479 EVAL_REAL_BINARY(Mul);
12480 break;
12481 case eDIV:
12482 EVAL_REAL_BINARY(Div);
12483 break;
12484 case ePOW:
12485 EVAL_REAL_BINARY(Pow);
12486 break;
12487 case eADD:
12488 EVAL_REAL_BINARY(Add);
12489 break;
12490 case eFUNCTION_CALL:
12491 d = CFunction::EvalReal(Arg<CSymbol*>(0),Arg<CNode*>(1),Arg<CBlock*>(2));;
12492 break;
12493 case ePARAM_REF:
12494 EVAL_REAL_PARAM_REF();
12495 break;
12496 case eENUM_REF:
12497 EVAL_REAL_ENUM_REF();
12498 break;
12499 case eCVIR:
12500 { CVector v(Arg<CNode*>(0)->width); v.Signed(Arg<CNode*>(0)->type == eS); Arg<CNode*>(0)->_EvalVector(v); d = v.GetReal(); };
12501 break;
12502 case eNEG:
12503 EVAL_REAL_UNARY(Neg);
12504 break;
12505 case ePLUS:
12506 EVAL_REAL_UNARY(Plus);
12507 break;
12508 case eHOOK:
12509 EVAL_REAL_HOOK();
12510 break;
12511 case eMACRO_EXPR:
12512 d = Arg<CNode*>(1)->EvalReal();
12513 break;
12514 default:
12515 MASSERT( FALSE );
12516 }
12517 return d;
12518 }
12519
12520
12521
12522
12523
12524 int CNode::ConditionalWiden()
12525 {
12526 switch( GetOp() ) {
12527 case eVCONSTANT:
12528 return 0;
12529 case eRCONSTANT:
12530 return 0;
12531 case eELIST:
12532 return 0;
12533 case eWIDTH:
12534 return 0;
12535 case eSUB:
12536 return 0;
12537 case eMUL:
12538 return 0;
12539 case eDIV:
12540 return 0;
12541 case ePOW:
12542 return 0;
12543 case eADD:
12544 return 0;
12545 case eLSH:
12546 return 0;
12547 case eRSH:
12548 return 0;
12549 case eLSHA:
12550 return 0;
12551 case eRSHA:
12552 return 0;
12553 case eMOD:
12554 return 0;
12555 case eOR:
12556 return 1;
12557 case eAND:
12558 return 1;
12559 case eANDANDAND:
12560 return 0;
12561 case eXOR:
12562 return 1;
12563 case eXNOR:
12564 return 1;
12565 case eSYSTASK_CALL:
12566 return 0;
12567 case eFUNCTION_CALL:
12568 return 0;
12569 case eARRAY:
12570 return 0;
12571 case eNET_REF:
12572 return 0;
12573 case eVAR_REF:
12574 return 0;
12575 case ePARAM_REF:
12576 return 0;
12577 case ePORT_REF:
12578 return 0;
12579 case eFWD_REF:
12580 return 0;
12581 case eGENVAR_REF:
12582 return 0;
12583 case eENUM_REF:
12584 return 0;
12585 case eTYPE_REF:
12586 return 0;
12587 case eRANGE:
12588 return 0;
12589 case eSLICE:
12590 return 0;
12591 case ePSLICE:
12592 return 0;
12593 case eMSLICE:
12594 return 0;
12595 case eCVRI:
12596 return 0;
12597 case eCVIR:
12598 return 0;
12599 case eREP:
12600 return 0;
12601 case eCAT:
12602 return 0;
12603 case eUCAT:
12604 return 0;
12605 case eCOM:
12606 return 0;
12607 case eNEG:
12608 return 0;
12609 case ePLUS:
12610 return 0;
12611 case eNOT:
12612 return 0;
12613 case eGT:
12614 return 0;
12615 case eGE:
12616 return 0;
12617 case eLT:
12618 return 0;
12619 case eLE:
12620 return 0;
12621 case eLAND:
12622 return 0;
12623 case eLOR:
12624 return 0;
12625 case eCEQ:
12626 return 0;
12627 case eCNE:
12628 return 0;
12629 case eEQ:
12630 return 0;
12631 case eNE:
12632 return 0;
12633 case eRAND:
12634 return 0;
12635 case eRNAND:
12636 return 0;
12637 case eROR:
12638 return 0;
12639 case eRNOR:
12640 return 0;
12641 case eRXOR:
12642 return 0;
12643 case eRXNOR:
12644 return 0;
12645 case eHOOK:
12646 return 0;
12647 case ePOSEDGE:
12648 return 0;
12649 case eNEGEDGE:
12650 return 0;
12651 case eEVOR:
12652 return 0;
12653 case eMTM:
12654 return 0;
12655 case eEXTERNAL_REF:
12656 return 0;
12657 case eATTRIBUTE:
12658 return 0;
12659 case eMACRO_EXPR:
12660 return 0;
12661 case eMEMBER:
12662 return 0;
12663 case ePREINC:
12664 return 0;
12665 case ePOSTINC:
12666 return 0;
12667 case ePREDEC:
12668 return 0;
12669 case ePOSTDEC:
12670 return 0;
12671 case eCAST:
12672 return 0;
12673 default:
12674 MASSERT( FALSE );
12675 }
12676 return 0;
12677 }
12678
12679
12680
12681
12682
12683
12684 unsigned CNode::NodeMask()
12685 {
12686 switch( GetOp() ) {
12687 case eERROR:
12688 return 0;
12689 case eVCONSTANT:
12690 return 0;
12691 case eRCONSTANT:
12692 return 0;
12693 case eCOMMENT:
12694 return 0;
12695 case eVRQ:
12696 return 0;
12697 case ePRAGMA:
12698 return 0;
12699 case eELIST:
12700 return 3;
12701 case eWIDTH:
12702 return 3;
12703 case eNOP:
12704 return 0;
12705 case eSUB:
12706 return 3;
12707 case eMUL:
12708 return 3;
12709 case eDIV:
12710 return 3;
12711 case ePOW:
12712 return 3;
12713 case eADD:
12714 return 3;
12715 case eLSH:
12716 return 3;
12717 case eRSH:
12718 return 3;
12719 case eLSHA:
12720 return 3;
12721 case eRSHA:
12722 return 3;
12723 case eMOD:
12724 return 3;
12725 case eOR:
12726 return 3;
12727 case eAND:
12728 return 3;
12729 case eANDANDAND:
12730 return 3;
12731 case eXOR:
12732 return 3;
12733 case eXNOR:
12734 return 3;
12735 case eINSTANCE_REF:
12736 return 0;
12737 case eGATE_REF:
12738 return 0;
12739 case eTASK_ENABLE:
12740 return 2;
12741 case eSYSTASK_CALL:
12742 return 2;
12743 case eTIMING_CALL:
12744 return 2;
12745 case eFUNCTION_CALL:
12746 return 2;
12747 case eARRAY:
12748 return 3;
12749 case eNET_REF:
12750 return 0;
12751 case eVAR_REF:
12752 return 0;
12753 case ePARAM_REF:
12754 return 0;
12755 case ePORT_REF:
12756 return 0;
12757 case eFWD_REF:
12758 return 0;
12759 case eGENVAR_REF:
12760 return 0;
12761 case eENUM_REF:
12762 return 0;
12763 case eTYPE_REF:
12764 return 0;
12765 case eNET_DECL:
12766 return 2;
12767 case eVAR_DECL:
12768 return 2;
12769 case ePARAM_DECL:
12770 return 0;
12771 case eSPECPARAM_DECL:
12772 return 0;
12773 case ePORT_DECL:
12774 return 0;
12775 case eGENVAR_DECL:
12776 return 0;
12777 case eTYPEDEF_DECL:
12778 return 0;
12779 case eLIST:
12780 return 3;
12781 case eRANGE:
12782 return 3;
12783 case eSLICE:
12784 return 3;
12785 case ePSLICE:
12786 return 3;
12787 case eMSLICE:
12788 return 3;
12789 case eCVRI:
12790 return 1;
12791 case eCVIR:
12792 return 1;
12793 case eREP:
12794 return 3;
12795 case eCAT:
12796 return 3;
12797 case eUCAT:
12798 return 1;
12799 case eCOM:
12800 return 1;
12801 case eNEG:
12802 return 1;
12803 case ePLUS:
12804 return 1;
12805 case eNOT:
12806 return 1;
12807 case eGT:
12808 return 3;
12809 case eGE:
12810 return 3;
12811 case eLT:
12812 return 3;
12813 case eLE:
12814 return 3;
12815 case eLAND:
12816 return 3;
12817 case eLOR:
12818 return 3;
12819 case eCEQ:
12820 return 3;
12821 case eCNE:
12822 return 3;
12823 case eEQ:
12824 return 3;
12825 case eNE:
12826 return 3;
12827 case eRAND:
12828 return 1;
12829 case eRNAND:
12830 return 1;
12831 case eROR:
12832 return 1;
12833 case eRNOR:
12834 return 1;
12835 case eRXOR:
12836 return 1;
12837 case eRXNOR:
12838 return 1;
12839 case eHOOK:
12840 return 7;
12841 case eINIT:
12842 return 1;
12843 case eALWAYS:
12844 return 1;
12845 case eALWAYS_LATCH:
12846 return 1;
12847 case eALWAYS_FF:
12848 return 1;
12849 case eALWAYS_COMB:
12850 return 1;
12851 case eEVENT:
12852 return 3;
12853 case eBLOCK_REF:
12854 return 2;
12855 case eSPECIFY_REF:
12856 return 2;
12857 case eASSIGN:
12858 return 7;
12859 case eADD_ASSIGN:
12860 return 7;
12861 case eSUB_ASSIGN:
12862 return 7;
12863 case eMUL_ASSIGN:
12864 return 7;
12865 case eDIV_ASSIGN:
12866 return 7;
12867 case eMOD_ASSIGN:
12868 return 7;
12869 case eAND_ASSIGN:
12870 return 7;
12871 case eOR_ASSIGN:
12872 return 7;
12873 case eXOR_ASSIGN:
12874 return 7;
12875 case eLSH_ASSIGN:
12876 return 7;
12877 case eRSH_ASSIGN:
12878 return 7;
12879 case eLSHA_ASSIGN:
12880 return 7;
12881 case eRSHA_ASSIGN:
12882 return 7;
12883 case eFORCE:
12884 return 3;
12885 case eRELEASE:
12886 return 1;
12887 case eNBASSIGN:
12888 return 7;
12889 case ePOSEDGE:
12890 return 1;
12891 case eNEGEDGE:
12892 return 1;
12893 case eEDGE:
12894 return 1;
12895 case eEVOR:
12896 return 3;
12897 case eDELAY:
12898 return 3;
12899 case eMTM:
12900 return 7;
12901 case eIF:
12902 return 7;
12903 case eFOREVER:
12904 return 1;
12905 case eREPEAT:
12906 return 3;
12907 case eWHILE:
12908 return 3;
12909 case eWAIT:
12910 return 3;
12911 case eFOR:
12912 return 15;
12913 case eCASE:
12914 return 3;
12915 case eCASEX:
12916 return 3;
12917 case eCASEZ:
12918 return 3;
12919 case eCASEITEM:
12920 return 3;
12921 case eCASSIGN:
12922 return 14;
12923 case eARG:
12924 return 2;
12925 case eFUNCTION_DEF:
12926 return 0;
12927 case eMODULE_DEF:
12928 return 0;
12929 case eREPEAT_CONTROL:
12930 return 3;
12931 case eDELAY_CONTROL:
12932 return 1;
12933 case eEVENT_CONTROL:
12934 return 1;
12935 case eEXTERNAL_REF:
12936 return 0;
12937 case ePORT_DEF:
12938 return 0;
12939 case eDEFPARAM:
12940 return 3;
12941 case ePATH:
12942 return 82;
12943 case ePATH_ASSIGN:
12944 return 7;
12945 case eIFNONE_PATH_ASSIGN:
12946 return 3;
12947 case eTRIGGER:
12948 return 1;
12949 case ePASSIGN:
12950 return 3;
12951 case eDEASSIGN:
12952 return 1;
12953 case eDISABLE:
12954 return 0;
12955 case eATTRIBUTE:
12956 return 0;
12957 case eGIF:
12958 return 7;
12959 case eGFOR:
12960 return 15;
12961 case eGCASE:
12962 return 3;
12963 case eTABLE:
12964 return 1;
12965 case eTABLE_ENTRY:
12966 return 1;
12967 case eTABLE_SYMBOL:
12968 return 0;
12969 case ePORTLIST_END:
12970 return 0;
12971 case eMACRO_EXPR:
12972 return 2;
12973 case eENUM_SPEC:
12974 return 6;
12975 case eMEMBER:
12976 return 1;
12977 case eRETURN:
12978 return 1;
12979 case ePREINC:
12980 return 1;
12981 case ePOSTINC:
12982 return 1;
12983 case ePREDEC:
12984 return 1;
12985 case ePOSTDEC:
12986 return 1;
12987 case eCAST:
12988 return 3;
12989 default:
12990 MASSERT( FALSE );
12991 }
12992 return 0;
12993 }
12994
12995
12996
12997
12998
12999
13000 int CNode::WidthFixed()
13001 {
13002 switch( GetOp() ) {
13003 case eVCONSTANT:
13004 return NodeMask()==0;
13005 case eRCONSTANT:
13006 return 1;
13007 case eELIST:
13008 return NodeMask()==0;
13009 case eWIDTH:
13010 return NodeMask()==0;
13011 case eSUB:
13012 return NodeMask()==0;
13013 case eMUL:
13014 return NodeMask()==0;
13015 case eDIV:
13016 return NodeMask()==0;
13017 case ePOW:
13018 return NodeMask()==0;
13019 case eADD:
13020 return NodeMask()==0;
13021 case eLSH:
13022 return NodeMask()==0;
13023 case eRSH:
13024 return NodeMask()==0;
13025 case eLSHA:
13026 return NodeMask()==0;
13027 case eRSHA:
13028 return NodeMask()==0;
13029 case eMOD:
13030 return NodeMask()==0;
13031 case eOR:
13032 return NodeMask()==0;
13033 case eAND:
13034 return NodeMask()==0;
13035 case eANDANDAND:
13036 return NodeMask()==0;
13037 case eXOR:
13038 return NodeMask()==0;
13039 case eXNOR:
13040 return NodeMask()==0;
13041 case eSYSTASK_CALL:
13042 return NodeMask()==0;
13043 case eFUNCTION_CALL:
13044 return NodeMask()==0;
13045 case eARRAY:
13046 return NodeMask()==0;
13047 case eNET_REF:
13048 return NodeMask()==0;
13049 case eVAR_REF:
13050 return NodeMask()==0;
13051 case ePARAM_REF:
13052 return NodeMask()==0;
13053 case ePORT_REF:
13054 return NodeMask()==0;
13055 case eFWD_REF:
13056 return NodeMask()==0;
13057 case eGENVAR_REF:
13058 return NodeMask()==0;
13059 case eENUM_REF:
13060 return NodeMask()==0;
13061 case eTYPE_REF:
13062 return 1;
13063 case eRANGE:
13064 return NodeMask()==0;
13065 case eSLICE:
13066 return NodeMask()==0;
13067 case ePSLICE:
13068 return NodeMask()==0;
13069 case eMSLICE:
13070 return NodeMask()==0;
13071 case eCVRI:
13072 return 1;
13073 case eCVIR:
13074 return 1;
13075 case eREP:
13076 return NodeMask()==0;
13077 case eCAT:
13078 return NodeMask()==0;
13079 case eUCAT:
13080 return NodeMask()==0;
13081 case eCOM:
13082 return NodeMask()==0;
13083 case eNEG:
13084 return NodeMask()==0;
13085 case ePLUS:
13086 return NodeMask()==0;
13087 case eNOT:
13088 return 1;
13089 case eGT:
13090 return 1;
13091 case eGE:
13092 return 1;
13093 case eLT:
13094 return 1;
13095 case eLE:
13096 return 1;
13097 case eLAND:
13098 return 1;
13099 case eLOR:
13100 return 1;
13101 case eCEQ:
13102 return 1;
13103 case eCNE:
13104 return 1;
13105 case eEQ:
13106 return 1;
13107 case eNE:
13108 return 1;
13109 case eRAND:
13110 return 1;
13111 case eRNAND:
13112 return 1;
13113 case eROR:
13114 return 1;
13115 case eRNOR:
13116 return 1;
13117 case eRXOR:
13118 return 1;
13119 case eRXNOR:
13120 return 1;
13121 case eHOOK:
13122 return NodeMask()==0;
13123 case ePOSEDGE:
13124 return NodeMask()==0;
13125 case eNEGEDGE:
13126 return NodeMask()==0;
13127 case eEVOR:
13128 return NodeMask()==0;
13129 case eMTM:
13130 return NodeMask()==0;
13131 case eEXTERNAL_REF:
13132 return NodeMask()==0;
13133 case eATTRIBUTE:
13134 return 1;
13135 case eMACRO_EXPR:
13136 return NodeMask()==0;
13137 case eMEMBER:
13138 return NodeMask()==0;
13139 case ePREINC:
13140 return NodeMask()==0;
13141 case ePOSTINC:
13142 return NodeMask()==0;
13143 case ePREDEC:
13144 return NodeMask()==0;
13145 case ePOSTDEC:
13146 return NodeMask()==0;
13147 case eCAST:
13148 return NodeMask()==0;
13149 default:
13150 MASSERT( FALSE );
13151 }
13152 return 0;
13153 }
13154
13155
13156
13157
13158
13159 struct LabelBitsInfo {
13160 int suppressErrorMessages;
13161 int error;
13162 };
13163
13164 void CNode::_LabelBits( CNode* n, void* arg )
13165 {
13166
13167
13168
13169
13170
13171
13172 if( labelCacheEnabled && (evalCount == 0 || !evalHeap.IsOwner(n)) ) {
13173 if( labelCache.find(n) != labelCache.end() ) {
13174 return;
13175 }
13176 labelCache[n] = 1;
13177 }
13178
13179
13180 LabelBitsInfo* info = (LabelBitsInfo*)arg;
13181 int suppressErrorMessages = info->suppressErrorMessages;
13182 unsigned nodeMask = n->NodeMask();
13183 int conditionalWiden = n->ConditionalWiden();
13184
13185 switch( n->GetOp() ) {
13186 case eVCONSTANT:
13187 n->type = n->Arg<CVector*>(0)->GetNodeType();
13188 break;
13189 case eRCONSTANT:
13190 if(1) {
13191 n->type = eR;
13192 }
13193 break;
13194 case eELIST:
13195 if( n->Arg<CNode*>(0)->type == eR ) {
13196 info->error = 1;
13197 if( !suppressErrorMessages ) {
13198 error(n->GetCoord(), "Illegal expression operand" );
13199 }
13200 } else if( n->Arg<CNode*>(1)->type == eR ) {
13201 info->error = 1;
13202 if( !suppressErrorMessages ) {
13203 error(n->GetCoord(), "Illegal expression operand" );
13204 }
13205 } else if(1) {
13206 n->type = eB;
13207 }
13208 break;
13209 case eWIDTH:
13210 if( n->Arg<CNode*>(1)->type == eS ) {
13211 n->type = eS;
13212 } else if(1) {
13213 n->type = eB;
13214 }
13215 break;
13216 case eSUB:
13217 if( n->Arg<CNode*>(0)->type == eR ) {
13218 n->type = eR;
13219 } else if( n->Arg<CNode*>(1)->type == eR ) {
13220 n->type = eR;
13221 } else if( n->Arg<CNode*>(0)->type == eS && n->Arg<CNode*>(1)->type == eS ) {
13222 n->type = eS;
13223 } else if(1) {
13224 n->type = eB;
13225 }
13226 break;
13227 case eMUL:
13228 if( n->Arg<CNode*>(0)->type == eR ) {
13229 n->type = eR;
13230 } else if( n->Arg<CNode*>(1)->type == eR ) {
13231 n->type = eR;
13232 } else if( n->Arg<CNode*>(0)->type == eS && n->Arg<CNode*>(1)->type == eS ) {
13233 n->type = eS;
13234 } else if(1) {
13235 n->type = eB;
13236 }
13237 break;
13238 case eDIV:
13239 if( n->Arg<CNode*>(0)->type == eR ) {
13240 n->type = eR;
13241 } else if( n->Arg<CNode*>(1)->type == eR ) {
13242 n->type = eR;
13243 } else if( n->Arg<CNode*>(0)->type == eS && n->Arg<CNode*>(1)->type == eS ) {
13244 n->type = eS;
13245 } else if(1) {
13246 n->type = eB;
13247 }
13248 break;
13249 case ePOW:
13250 if( n->Arg<CNode*>(0)->type == eR ) {
13251 n->type = eR;
13252 } else if( n->Arg<CNode*>(1)->type == eR ) {
13253 n->type = eR;
13254 } else if( n->Arg<CNode*>(0)->type == eS && n->Arg<CNode*>(1)->type == eS ) {
13255 n->type = eS;
13256 } else if(1) {
13257 n->type = eB;
13258 }
13259 break;
13260 case eADD:
13261 if( n->Arg<CNode*>(0)->type == eR ) {
13262 n->type = eR;
13263 } else if( n->Arg<CNode*>(1)->type == eR ) {
13264 n->type = eR;
13265 } else if( n->Arg<CNode*>(0)->type == eS && n->Arg<CNode*>(1)->type == eS ) {
13266 n->type = eS;
13267 } else if(1) {
13268 n->type = eB;
13269 }
13270 break;
13271 case eLSH:
13272 if( n->Arg<CNode*>(0)->type == eS ) {
13273 n->type = eS;
13274 } else if(1) {
13275 n->type = eB;
13276 }
13277 break;
13278 case eRSH:
13279 if( n->Arg<CNode*>(0)->type == eS ) {
13280 n->type = eS;
13281 } else if(1) {
13282 n->type = eB;
13283 }
13284 break;
13285 case eLSHA:
13286 if( n->Arg<CNode*>(0)->type == eS ) {
13287 n->type = eS;
13288 } else if(1) {
13289 n->type = eB;
13290 }
13291 break;
13292 case eRSHA:
13293 if( n->Arg<CNode*>(0)->type == eS ) {
13294 n->type = eS;
13295 } else if(1) {
13296 n->type = eB;
13297 }
13298 break;
13299 case eMOD:
13300 if( n->Arg<CNode*>(0)->type == eR ) {
13301 info->error = 1;
13302 if( !suppressErrorMessages ) {
13303 error(n->GetCoord(), "Illegal expression operand" );
13304 }
13305 } else if( n->Arg<CNode*>(1)->type == eR ) {
13306 info->error = 1;
13307 if( !suppressErrorMessages ) {
13308 error(n->GetCoord(), "Illegal expression operand" );
13309 }
13310 } else if( n->Arg<CNode*>(0)->type == eS && n->Arg<CNode*>(1)->type == eS ) {
13311 n->type = eS;
13312 } else if(1) {
13313 n->type = eB;
13314 }
13315 break;
13316 case eOR:
13317 if( n->Arg<CNode*>(0)->type == eR ) {
13318 info->error = 1;
13319 if( !suppressErrorMessages ) {
13320 error(n->GetCoord(), "Illegal expression operand" );
13321 }
13322 } else if( n->Arg<CNode*>(1)->type == eR ) {
13323 info->error = 1;
13324 if( !suppressErrorMessages ) {
13325 error(n->GetCoord(), "Illegal expression operand" );
13326 }
13327 } else if( n->Arg<CNode*>(0)->type == eS && n->Arg<CNode*>(1)->type == eS ) {
13328 n->type = eS;
13329 } else if(1) {
13330 n->type = eB;
13331 }
13332 break;
13333 case eAND:
13334 if( n->Arg<CNode*>(0)->type == eR ) {
13335 info->error = 1;
13336 if( !suppressErrorMessages ) {
13337 error(n->GetCoord(), "Illegal expression operand" );
13338 }
13339 } else if( n->Arg<CNode*>(1)->type == eR ) {
13340 info->error = 1;
13341 if( !suppressErrorMessages ) {
13342 error(n->GetCoord(), "Illegal expression operand" );
13343 }
13344 } else if( n->Arg<CNode*>(0)->type == eS && n->Arg<CNode*>(1)->type == eS ) {
13345 n->type = eS;
13346 } else if(1) {
13347 n->type = eB;
13348 }
13349 break;
13350 case eANDANDAND:
13351 if( n->Arg<CNode*>(0)->type == eR ) {
13352 info->error = 1;
13353 if( !suppressErrorMessages ) {
13354 error(n->GetCoord(), "Illegal expression operand" );
13355 }
13356 } else if( n->Arg<CNode*>(1)->type == eR ) {
13357 info->error = 1;
13358 if( !suppressErrorMessages ) {
13359 error(n->GetCoord(), "Illegal expression operand" );
13360 }
13361 } else if(1) {
13362 n->type = eB;
13363 }
13364 break;
13365 case eXOR:
13366 if( n->Arg<CNode*>(0)->type == eR ) {
13367 info->error = 1;
13368 if( !suppressErrorMessages ) {
13369 error(n->GetCoord(), "Illegal expression operand" );
13370 }
13371 } else if( n->Arg<CNode*>(1)->type == eR ) {
13372 info->error = 1;
13373 if( !suppressErrorMessages ) {
13374 error(n->GetCoord(), "Illegal expression operand" );
13375 }
13376 } else if( n->Arg<CNode*>(0)->type == eS && n->Arg<CNode*>(1)->type == eS ) {
13377 n->type = eS;
13378 } else if(1) {
13379 n->type = eB;
13380 }
13381 break;
13382 case eXNOR:
13383 if( n->Arg<CNode*>(0)->type == eR ) {
13384 info->error = 1;
13385 if( !suppressErrorMessages ) {
13386 error(n->GetCoord(), "Illegal expression operand" );
13387 }
13388 } else if( n->Arg<CNode*>(1)->type == eR ) {
13389 info->error = 1;
13390 if( !suppressErrorMessages ) {
13391 error(n->GetCoord(), "Illegal expression operand" );
13392 }
13393 } else if( n->Arg<CNode*>(0)->type == eS && n->Arg<CNode*>(1)->type == eS ) {
13394 n->type = eS;
13395 } else if(1) {
13396 n->type = eB;
13397 }
13398 break;
13399 case eSYSTASK_CALL:
13400 n->type = Systask::Type(n->Arg<CSymbol*>(0),n->Arg<CNode*>(1));
13401 break;
13402 case eFUNCTION_CALL:
13403 n->type = CFunction::Type(n->Arg<CSymbol*>(0),n->Arg<CNode*>(1),n->Arg<CScope*>(2));
13404 break;
13405 case eARRAY:
13406 n->type = Array::Type(n->Arg<CNode*>(0),n->Arg<CNode*>(1));
13407 break;
13408 case eNET_REF:
13409 n->type = n->Arg<CNet*>(0)->GetNodeType();
13410 break;
13411 case eVAR_REF:
13412 n->type = n->Arg<CVar*>(0)->GetNodeType();
13413 break;
13414 case ePARAM_REF:
13415 n->type = n->Arg<CParam*>(0)->GetNodeType();
13416 break;
13417 case ePORT_REF:
13418 n->type = n->Arg<CPortDir*>(0)->GetNodeType();
13419 break;
13420 case eFWD_REF:
13421 if(1) {
13422 n->type = eB;
13423 }
13424 break;
13425 case eGENVAR_REF:
13426 n->type = n->Arg<CGenvar*>(0)->GetNodeType();
13427 break;
13428 case eENUM_REF:
13429 n->type = n->Arg<CEnum*>(0)->GetNodeType();
13430 break;
13431 case eTYPE_REF:
13432 if(1) {
13433 n->type = eS;
13434 }
13435 break;
13436 case eRANGE:
13437 if( n->Arg<CNode*>(0)->type == eR ) {
13438 info->error = 1;
13439 if( !suppressErrorMessages ) {
13440 error(n->GetCoord(), "Illegal expression operand" );
13441 }
13442 } else if( n->Arg<CNode*>(1)->type == eR ) {
13443 info->error = 1;
13444 if( !suppressErrorMessages ) {
13445 error(n->GetCoord(), "Illegal expression operand" );
13446 }
13447 } else if(1) {
13448 n->type = eB;
13449 }
13450 break;
13451 case eSLICE:
13452 if( n->Arg<CNode*>(0)->type == eR ) {
13453 info->error = 1;
13454 if( !suppressErrorMessages ) {
13455 error(n->GetCoord(), "Illegal expression operand" );
13456 }
13457 } else if( n->Arg<CNode*>(1)->type == eR ) {
13458 info->error = 1;
13459 if( !suppressErrorMessages ) {
13460 error(n->GetCoord(), "Illegal expression operand" );
13461 }
13462 } else if(1) {
13463 n->type = eB;
13464 }
13465 break;
13466 case ePSLICE:
13467 if( n->Arg<CNode*>(1)->type == eR ) {
13468 info->error = 1;
13469 if( !suppressErrorMessages ) {
13470 error(n->GetCoord(), "Illegal expression operand" );
13471 }
13472 } else if(1) {
13473 n->type = eB;
13474 }
13475 break;
13476 case eMSLICE:
13477 if( n->Arg<CNode*>(1)->type == eR ) {
13478 info->error = 1;
13479 if( !suppressErrorMessages ) {
13480 error(n->GetCoord(), "Illegal expression operand" );
13481 }
13482 } else if(1) {
13483 n->type = eB;
13484 }
13485 break;
13486 case eCVRI:
13487 if(1) {
13488 n->type = eS;
13489 }
13490 break;
13491 case eCVIR:
13492 if(1) {
13493 n->type = eR;
13494 }
13495 break;
13496 case eREP:
13497 if( n->Arg<CNode*>(0)->type == eR ) {
13498 info->error = 1;
13499 if( !suppressErrorMessages ) {
13500 error(n->GetCoord(), "Illegal expression operand" );
13501 }
13502 } else if( n->Arg<CNode*>(1)->type == eR ) {
13503 info->error = 1;
13504 if( !suppressErrorMessages ) {
13505 error(n->GetCoord(), "Illegal expression operand" );
13506 }
13507 } else if(1) {
13508 n->type = eB;
13509 }
13510 break;
13511 case eCAT:
13512 if( n->Arg<CNode*>(0)->type == eR ) {
13513 info->error = 1;
13514 if( !suppressErrorMessages ) {
13515 error(n->GetCoord(), "Illegal expression operand" );
13516 }
13517 } else if( n->Arg<CNode*>(1)->type == eR ) {
13518 info->error = 1;
13519 if( !suppressErrorMessages ) {
13520 error(n->GetCoord(), "Illegal expression operand" );
13521 }
13522 } else if(1) {
13523 n->type = eB;
13524 }
13525 break;
13526 case eUCAT:
13527 if( n->Arg<CNode*>(0)->type == eR ) {
13528 info->error = 1;
13529 if( !suppressErrorMessages ) {
13530 error(n->GetCoord(), "Illegal expression operand" );
13531 }
13532 } else if(1) {
13533 n->type = eB;
13534 }
13535 break;
13536 case eCOM:
13537 if( n->Arg<CNode*>(0)->type == eR ) {
13538 info->error = 1;
13539 if( !suppressErrorMessages ) {
13540 error(n->GetCoord(), "Illegal expression operand" );
13541 }
13542 } else if( n->Arg<CNode*>(0)->type == eS ) {
13543 n->type = eS;
13544 } else if(1) {
13545 n->type = eB;
13546 }
13547 break;
13548 case eNEG:
13549 n->type = n->Arg<CNode*>(0)->type;
13550 break;
13551 case ePLUS:
13552 n->type = n->Arg<CNode*>(0)->type;
13553 break;
13554 case eNOT:
13555 if(1) {
13556 n->type = eB;
13557 }
13558 break;
13559 case eGT:
13560 if(1) {
13561 n->type = eB;
13562 }
13563 break;
13564 case eGE:
13565 if(1) {
13566 n->type = eB;
13567 }
13568 break;
13569 case eLT:
13570 if(1) {
13571 n->type = eB;
13572 }
13573 break;
13574 case eLE:
13575 if(1) {
13576 n->type = eB;
13577 }
13578 break;
13579 case eLAND:
13580 if(1) {
13581 n->type = eB;
13582 }
13583 break;
13584 case eLOR:
13585 if(1) {
13586 n->type = eB;
13587 }
13588 break;
13589 case eCEQ:
13590 if( n->Arg<CNode*>(0)->type == eR ) {
13591 info->error = 1;
13592 if( !suppressErrorMessages ) {
13593 error(n->GetCoord(), "Illegal expression operand" );
13594 }
13595 } else if( n->Arg<CNode*>(1)->type == eR ) {
13596 info->error = 1;
13597 if( !suppressErrorMessages ) {
13598 error(n->GetCoord(), "Illegal expression operand" );
13599 }
13600 } else if(1) {
13601 n->type = eB;
13602 }
13603 break;
13604 case eCNE:
13605 if( n->Arg<CNode*>(0)->type == eR ) {
13606 info->error = 1;
13607 if( !suppressErrorMessages ) {
13608 error(n->GetCoord(), "Illegal expression operand" );
13609 }
13610 } else if( n->Arg<CNode*>(1)->type == eR ) {
13611 info->error = 1;
13612 if( !suppressErrorMessages ) {
13613 error(n->GetCoord(), "Illegal expression operand" );
13614 }
13615 } else if(1) {
13616 n->type = eB;
13617 }
13618 break;
13619 case eEQ:
13620 if(1) {
13621 n->type = eB;
13622 }
13623 break;
13624 case eNE:
13625 if(1) {
13626 n->type = eB;
13627 }
13628 break;
13629 case eRAND:
13630 if( n->Arg<CNode*>(0)->type == eR ) {
13631 info->error = 1;
13632 if( !suppressErrorMessages ) {
13633 error(n->GetCoord(), "Illegal expression operand" );
13634 }
13635 } else if(1) {
13636 n->type = eB;
13637 }
13638 break;
13639 case eRNAND:
13640 if( n->Arg<CNode*>(0)->type == eR ) {
13641 info->error = 1;
13642 if( !suppressErrorMessages ) {
13643 error(n->GetCoord(), "Illegal expression operand" );
13644 }
13645 } else if(1) {
13646 n->type = eB;
13647 }
13648 break;
13649 case eROR:
13650 if( n->Arg<CNode*>(0)->type == eR ) {
13651 info->error = 1;
13652 if( !suppressErrorMessages ) {
13653 error(n->GetCoord(), "Illegal expression operand" );
13654 }
13655 } else if(1) {
13656 n->type = eB;
13657 }
13658 break;
13659 case eRNOR:
13660 if( n->Arg<CNode*>(0)->type == eR ) {
13661 info->error = 1;
13662 if( !suppressErrorMessages ) {
13663 error(n->GetCoord(), "Illegal expression operand" );
13664 }
13665 } else if(1) {
13666 n->type = eB;
13667 }
13668 break;
13669 case eRXOR:
13670 if( n->Arg<CNode*>(0)->type == eR ) {
13671 info->error = 1;
13672 if( !suppressErrorMessages ) {
13673 error(n->GetCoord(), "Illegal expression operand" );
13674 }
13675 } else if(1) {
13676 n->type = eB;
13677 }
13678 break;
13679 case eRXNOR:
13680 if( n->Arg<CNode*>(0)->type == eR ) {
13681 info->error = 1;
13682 if( !suppressErrorMessages ) {
13683 error(n->GetCoord(), "Illegal expression operand" );
13684 }
13685 } else if(1) {
13686 n->type = eB;
13687 }
13688 break;
13689 case eHOOK:
13690 if( n->Arg<CNode*>(1)->type == eR ) {
13691 n->type = eR;
13692 } else if( n->Arg<CNode*>(2)->type == eR ) {
13693 n->type = eR;
13694 } else if( n->Arg<CNode*>(1)->type == eS && n->Arg<CNode*>(2)->type == eS ) {
13695 n->type = eS;
13696 } else if(1) {
13697 n->type = eB;
13698 }
13699 break;
13700 case ePOSEDGE:
13701 if(1) {
13702 n->type = eE;
13703 }
13704 break;
13705 case eNEGEDGE:
13706 if(1) {
13707 n->type = eE;
13708 }
13709 break;
13710 case eEVOR:
13711 if(1) {
13712 n->type = eE;
13713 }
13714 break;
13715 case eMTM:
13716 if( n->Arg<CNode*>(0)->type == eR ) {
13717 n->type = eR;
13718 } else if( n->Arg<CNode*>(1)->type == eR ) {
13719 n->type = eR;
13720 } else if( n->Arg<CNode*>(2)->type == eR ) {
13721 n->type = eR;
13722 } else if( n->Arg<CNode*>(0)->type == eS && n->Arg<CNode*>(1)->type == eS && n->Arg<CNode*>(2)->type == eS ) {
13723 n->type = eS;
13724 } else if(1) {
13725 n->type = eB;
13726 }
13727 break;
13728 case eEXTERNAL_REF:
13729 n->type = External::Type(n->Arg<CSymbol*>(0));
13730 break;
13731 case eATTRIBUTE:
13732 if(1) {
13733 n->type = eU;
13734 }
13735 break;
13736 case eMACRO_EXPR:
13737 n->type = n->Arg<CNode*>(1)->type;
13738 break;
13739 case eMEMBER:
13740 n->type = Member::Type(n->Arg<CNode*>(0),n->Arg<CSymbol*>(1));
13741 break;
13742 case ePREINC:
13743 if( n->Arg<CNode*>(0)->type == eR ) {
13744 n->type = eR;
13745 } else if( n->Arg<CNode*>(0)->type == eS ) {
13746 n->type = eS;
13747 } else if(1) {
13748 n->type = eB;
13749 }
13750 break;
13751 case ePOSTINC:
13752 if( n->Arg<CNode*>(0)->type == eR ) {
13753 n->type = eR;
13754 } else if( n->Arg<CNode*>(0)->type == eS ) {
13755 n->type = eS;
13756 } else if(1) {
13757 n->type = eB;
13758 }
13759 break;
13760 case ePREDEC:
13761 if( n->Arg<CNode*>(0)->type == eR ) {
13762 n->type = eR;
13763 } else if( n->Arg<CNode*>(0)->type == eS ) {
13764 n->type = eS;
13765 } else if(1) {
13766 n->type = eB;
13767 }
13768 break;
13769 case ePOSTDEC:
13770 if( n->Arg<CNode*>(0)->type == eR ) {
13771 n->type = eR;
13772 } else if( n->Arg<CNode*>(0)->type == eS ) {
13773 n->type = eS;
13774 } else if(1) {
13775 n->type = eB;
13776 }
13777 break;
13778 case eCAST:
13779 if(1) {
13780 n->type = eB;
13781 }
13782 break;
13783 default:
13784 MASSERT( FALSE );
13785 }
13786
13787
13788
13789
13790 switch( n->type ) {
13791 case eU:
13792 case eE:
13793 case eR:
13794 n->width = 0;
13795 return;
13796 }
13797
13798
13799
13800
13801 switch( n->GetOp() ) {
13802 case eERROR:
13803 n->width = 0;
13804 break;
13805 case eVCONSTANT:
13806 n->width = (!n->Arg<CVector*>(0)->IsWidthEvaluateable()&&suppressErrorMessages) ? 0 : n->Arg<CVector*>(0)->GetWidth();
13807 break;
13808 case eRCONSTANT:
13809 n->width = 0;
13810 break;
13811 case eELIST:
13812 n->width = cADD(n->Arg<CNode*>(0)->width,n->Arg<CNode*>(1)->width);
13813 break;
13814 case eWIDTH:
13815 n->width = ((info->error |= !n->Arg<CNode*>(0)->IsEvaluateable())&&suppressErrorMessages) ? 0 : n->Arg<CNode*>(0)->EvalINT32();
13816 break;
13817 case eSUB:
13818 n->width = cMAX(n->Arg<CNode*>(0)->width,n->Arg<CNode*>(1)->width);
13819 break;
13820 case eMUL:
13821 n->width = cMAX(n->Arg<CNode*>(0)->width,n->Arg<CNode*>(1)->width);
13822 break;
13823 case eDIV:
13824 n->width = cMAX(n->Arg<CNode*>(0)->width,n->Arg<CNode*>(1)->width);
13825 break;
13826 case ePOW:
13827 n->width = n->Arg<CNode*>(0)->width;
13828 break;
13829 case eADD:
13830 n->width = cMAX(n->Arg<CNode*>(0)->width,n->Arg<CNode*>(1)->width);
13831 break;
13832 case eLSH:
13833 n->width = n->Arg<CNode*>(0)->width;
13834 break;
13835 case eRSH:
13836 n->width = n->Arg<CNode*>(0)->width;
13837 break;
13838 case eLSHA:
13839 n->width = n->Arg<CNode*>(0)->width;
13840 break;
13841 case eRSHA:
13842 n->width = n->Arg<CNode*>(0)->width;
13843 break;
13844 case eMOD:
13845 n->width = cMAX(n->Arg<CNode*>(0)->width,n->Arg<CNode*>(1)->width);
13846 break;
13847 case eOR:
13848 n->width = cMAX(n->Arg<CNode*>(0)->width,n->Arg<CNode*>(1)->width);
13849 break;
13850 case eAND:
13851 n->width = cMAX(n->Arg<CNode*>(0)->width,n->Arg<CNode*>(1)->width);
13852 break;
13853 case eANDANDAND:
13854 n->width = cMAX(n->Arg<CNode*>(0)->width,n->Arg<CNode*>(1)->width);
13855 break;
13856 case eXOR:
13857 n->width = cMAX(n->Arg<CNode*>(0)->width,n->Arg<CNode*>(1)->width);
13858 break;
13859 case eXNOR:
13860 n->width = cMAX(n->Arg<CNode*>(0)->width,n->Arg<CNode*>(1)->width);
13861 break;
13862 case eSYSTASK_CALL:
13863 n->width = Systask::Width(n->Arg<CSymbol*>(0),n->Arg<CNode*>(1));
13864 break;
13865 case eFUNCTION_CALL:
13866 n->width = CFunction::Width(n->Arg<CSymbol*>(0),n->Arg<CNode*>(1),n->Arg<CScope*>(2));
13867 break;
13868 case eARRAY:
13869 n->width = Array::Width(n->Arg<CNode*>(0),n->Arg<CNode*>(1));
13870 break;
13871 case eNET_REF:
13872 n->width = (!n->Arg<CNet*>(0)->IsWidthEvaluateable()&&suppressErrorMessages) ? 0 : n->Arg<CNet*>(0)->GetWidth();
13873 break;
13874 case eVAR_REF:
13875 n->width = (!n->Arg<CVar*>(0)->IsWidthEvaluateable()&&suppressErrorMessages) ? 0 : n->Arg<CVar*>(0)->GetWidth();
13876 break;
13877 case ePARAM_REF:
13878 n->width = (!n->Arg<CParam*>(0)->IsWidthEvaluateable()&&suppressErrorMessages) ? 0 : n->Arg<CParam*>(0)->GetWidth();
13879 break;
13880 case ePORT_REF:
13881 n->width = (!n->Arg<CPortDir*>(0)->IsWidthEvaluateable()&&suppressErrorMessages) ? 0 : n->Arg<CPortDir*>(0)->GetWidth();
13882 break;
13883 case eFWD_REF:
13884 n->width = (!n->Arg<CFref*>(0)->IsWidthEvaluateable()&&suppressErrorMessages) ? 0 : n->Arg<CFref*>(0)->GetWidth();
13885 break;
13886 case eGENVAR_REF:
13887 n->width = (!n->Arg<CGenvar*>(0)->IsWidthEvaluateable()&&suppressErrorMessages) ? 0 : n->Arg<CGenvar*>(0)->GetWidth();
13888 break;
13889 case eENUM_REF:
13890 n->width = (!n->Arg<CEnum*>(0)->IsWidthEvaluateable()&&suppressErrorMessages) ? 0 : n->Arg<CEnum*>(0)->GetWidth();
13891 break;
13892 case eTYPE_REF:
13893 n->width = 32;
13894 break;
13895 case eRANGE:
13896 n->width = cABSDIFFPLUS1(((info->error |= !n->Arg<CNode*>(0)->IsEvaluateable())&&suppressErrorMessages) ? 0: n->Arg<CNode*>(0)->EvalINT32(),((info->error |= !n->Arg<CNode*>(1)->IsEvaluateable())&&suppressErrorMessages) ? 0: n->Arg<CNode*>(1)->EvalINT32());
13897 break;
13898 case eSLICE:
13899 n->width = cABSDIFFPLUS1(((info->error |= !n->Arg<CNode*>(0)->IsEvaluateable())&&suppressErrorMessages) ? 0: n->Arg<CNode*>(0)->EvalINT32(),((info->error |= !n->Arg<CNode*>(1)->IsEvaluateable())&&suppressErrorMessages) ? 0: n->Arg<CNode*>(1)->EvalINT32());
13900 break;
13901 case ePSLICE:
13902 n->width = (!n->Arg<CNode*>(1)->IsEvaluateable()&&suppressErrorMessages) ? 0 : n->Arg<CNode*>(1)->EvalINT32();
13903 break;
13904 case eMSLICE:
13905 n->width = (!n->Arg<CNode*>(1)->IsEvaluateable()&&suppressErrorMessages) ? 0 : n->Arg<CNode*>(1)->EvalINT32();
13906 break;
13907 case eCVRI:
13908 n->width = 32;
13909 break;
13910 case eCVIR:
13911 n->width = 0;
13912 break;
13913 case eREP:
13914 n->width = cMUL(((info->error |= !n->Arg<CNode*>(0)->IsEvaluateable())&&suppressErrorMessages) ? 0: n->Arg<CNode*>(0)->EvalINT32(),n->Arg<CNode*>(1)->width);
13915 break;
13916 case eCAT:
13917 n->width = cADD(n->Arg<CNode*>(0)->width,n->Arg<CNode*>(1)->width);
13918 break;
13919 case eUCAT:
13920 n->width = n->Arg<CNode*>(0)->width;
13921 break;
13922 case eCOM:
13923 n->width = n->Arg<CNode*>(0)->width;
13924 break;
13925 case eNEG:
13926 n->width = n->Arg<CNode*>(0)->width;
13927 break;
13928 case ePLUS:
13929 n->width = n->Arg<CNode*>(0)->width;
13930 break;
13931 case eNOT:
13932 n->width = 1;
13933 break;
13934 case eGT:
13935 n->width = 1;
13936 break;
13937 case eGE:
13938 n->width = 1;
13939 break;
13940 case eLT:
13941 n->width = 1;
13942 break;
13943 case eLE:
13944 n->width = 1;
13945 break;
13946 case eLAND:
13947 n->width = 1;
13948 break;
13949 case eLOR:
13950 n->width = 1;
13951 break;
13952 case eCEQ:
13953 n->width = 1;
13954 break;
13955 case eCNE:
13956 n->width = 1;
13957 break;
13958 case eEQ:
13959 n->width = 1;
13960 break;
13961 case eNE:
13962 n->width = 1;
13963 break;
13964 case eRAND:
13965 n->width = 1;
13966 break;
13967 case eRNAND:
13968 n->width = 1;
13969 break;
13970 case eROR:
13971 n->width = 1;
13972 break;
13973 case eRNOR:
13974 n->width = 1;
13975 break;
13976 case eRXOR:
13977 n->width = 1;
13978 break;
13979 case eRXNOR:
13980 n->width = 1;
13981 break;
13982 case eHOOK:
13983 n->width = cMAX(n->Arg<CNode*>(1)->width,n->Arg<CNode*>(2)->width);
13984 break;
13985 case eMTM:
13986 n->width = cMAX(n->Arg<CNode*>(0)->width,n->Arg<CNode*>(1)->width,n->Arg<CNode*>(2)->width);
13987 break;
13988 case eEXTERNAL_REF:
13989 n->width = External::Width(n->Arg<CSymbol*>(0));
13990 break;
13991 case eATTRIBUTE:
13992 n->width = 0;
13993 break;
13994 case eMACRO_EXPR:
13995 n->width = n->Arg<CNode*>(1)->width;
13996 break;
13997 case eMEMBER:
13998 n->width = Member::Width(n->Arg<CNode*>(0),n->Arg<CSymbol*>(1));
13999 break;
14000 case ePREINC:
14001 n->width = n->Arg<CNode*>(0)->width;
14002 break;
14003 case ePOSTINC:
14004 n->width = n->Arg<CNode*>(0)->width;
14005 break;
14006 case ePREDEC:
14007 n->width = n->Arg<CNode*>(0)->width;
14008 break;
14009 case ePOSTDEC:
14010 n->width = n->Arg<CNode*>(0)->width;
14011 break;
14012 case eCAST:
14013 n->width = ((info->error |= !n->Arg<CNode*>(0)->IsEvaluateable())&&suppressErrorMessages) ? 0 : n->Arg<CNode*>(0)->EvalINT32();
14014 break;
14015 }
14016
14017
14018
14019
14020 n->FixedWidth(1);
14021 int operandWidth = -1;
14022 for( int i = 0; i < n->ArgCount(); i++ ) {
14023 if( ((nodeMask>>i)&1) && n->Arg<CNode*>(i) ) {
14024 int widthFixed = n->Arg<CNode*>(i)->WidthFixed() ||
14025 n->Arg<CNode*>(i)->FixedWidth();
14026
14027 if( n->ConditionalWiden() && !widthFixed ) {
14028 n->FixedWidth( 0 );
14029 break;
14030 } else if( !widthFixed ) {
14031 n->FixedWidth( 0 );
14032 break;
14033 } else {
14034 int w = n->Arg<CNode*>(i)->width;
14035 if( operandWidth != w ) {
14036 if( operandWidth >= 0 ) {
14037 n->FixedWidth( 0 );
14038 break;
14039 }
14040 operandWidth = w;
14041 }
14042 }
14043 }
14044 }
14045 if( !conditionalWiden && nodeMask != 0 ) {
14046 n->FixedWidth( 0 );
14047 }
14048 }
14049
14050
14051
14052
14053
14054
14055
14056
14057
14058
14059 CNode* CNode::FixBits( INT32 newWidth, NodeType_t newType )
14060 {
14061
14062 int calculateMax = 0;
14063 int realOp = 0;
14064 int conditionalWiden = ConditionalWiden();
14065 unsigned nodeMask = NodeMask();
14066 unsigned scalarMask = 0;
14067 unsigned selfDeterminedMask = 0;
14068 switch( GetOp() ) {
14069 case eERROR:
14070 realOp = 0;
14071 break;
14072 case eVCONSTANT:
14073 realOp = 0;
14074 break;
14075 case eRCONSTANT:
14076 realOp = 0;
14077 break;
14078 case eCOMMENT:
14079 realOp = 0;
14080 break;
14081 case eVRQ:
14082 realOp = 0;
14083 break;
14084 case ePRAGMA:
14085 realOp = 0;
14086 break;
14087 case eELIST:
14088 realOp = 0;
14089 selfDeterminedMask = nodeMask;
14090 break;
14091 case eWIDTH:
14092 realOp = 0;
14093 selfDeterminedMask = nodeMask;
14094 break;
14095 case eNOP:
14096 realOp = 0;
14097 break;
14098 case eSUB:
14099 realOp = 1;
14100 break;
14101 case eMUL:
14102 realOp = 1;
14103 break;
14104 case eDIV:
14105 realOp = 1;
14106 break;
14107 case ePOW:
14108 realOp = 1;
14109 selfDeterminedMask = 1<<1;
14110 break;
14111 case eADD:
14112 realOp = 1;
14113 break;
14114 case eLSH:
14115 realOp = 0;
14116 selfDeterminedMask = 1<<1;
14117 break;
14118 case eRSH:
14119 realOp = 0;
14120 selfDeterminedMask = 1<<1;
14121 break;
14122 case eLSHA:
14123 realOp = 0;
14124 selfDeterminedMask = 1<<1;
14125 break;
14126 case eRSHA:
14127 realOp = 0;
14128 selfDeterminedMask = 1<<1;
14129 break;
14130 case eMOD:
14131 realOp = 0;
14132 break;
14133 case eOR:
14134 realOp = 0;
14135 break;
14136 case eAND:
14137 realOp = 0;
14138 break;
14139 case eANDANDAND:
14140 realOp = 0;
14141 break;
14142 case eXOR:
14143 realOp = 0;
14144 break;
14145 case eXNOR:
14146 realOp = 0;
14147 break;
14148 case eINSTANCE_REF:
14149 realOp = 0;
14150 break;
14151 case eGATE_REF:
14152 realOp = 0;
14153 break;
14154 case eTASK_ENABLE:
14155 realOp = 0;
14156 break;
14157 case eSYSTASK_CALL:
14158 realOp = 0;
14159 selfDeterminedMask = nodeMask;
14160 break;
14161 case eTIMING_CALL:
14162 realOp = 0;
14163 break;
14164 case eFUNCTION_CALL:
14165 realOp = 0;
14166 selfDeterminedMask = nodeMask;
14167 break;
14168 case eARRAY:
14169 realOp = 0;
14170 selfDeterminedMask = 1<<1;
14171 break;
14172 case eNET_REF:
14173 realOp = 0;
14174 break;
14175 case eVAR_REF:
14176 realOp = 0;
14177 break;
14178 case ePARAM_REF:
14179 realOp = 0;
14180 break;
14181 case ePORT_REF:
14182 realOp = 0;
14183 break;
14184 case eFWD_REF:
14185 realOp = 0;
14186 break;
14187 case eGENVAR_REF:
14188 realOp = 0;
14189 break;
14190 case eENUM_REF:
14191 realOp = 0;
14192 break;
14193 case eTYPE_REF:
14194 realOp = 0;
14195 break;
14196 case eNET_DECL:
14197 realOp = 0;
14198 break;
14199 case eVAR_DECL:
14200 realOp = 0;
14201 break;
14202 case ePARAM_DECL:
14203 realOp = 0;
14204 break;
14205 case eSPECPARAM_DECL:
14206 realOp = 0;
14207 break;
14208 case ePORT_DECL:
14209 realOp = 0;
14210 break;
14211 case eGENVAR_DECL:
14212 realOp = 0;
14213 break;
14214 case eTYPEDEF_DECL:
14215 realOp = 0;
14216 break;
14217 case eLIST:
14218 realOp = 0;
14219 break;
14220 case eRANGE:
14221 realOp = 0;
14222 selfDeterminedMask = nodeMask;
14223 break;
14224 case eSLICE:
14225 realOp = 0;
14226 selfDeterminedMask = nodeMask;
14227 break;
14228 case ePSLICE:
14229 realOp = 0;
14230 selfDeterminedMask = nodeMask;
14231 break;
14232 case eMSLICE:
14233 realOp = 0;
14234 selfDeterminedMask = nodeMask;
14235 break;
14236 case eCVRI:
14237 realOp = 0;
14238 selfDeterminedMask = nodeMask;
14239 break;
14240 case eCVIR:
14241 realOp = 0;
14242 selfDeterminedMask = nodeMask;
14243 break;
14244 case eREP:
14245 realOp = 0;
14246 selfDeterminedMask = nodeMask;
14247 break;
14248 case eCAT:
14249 realOp = 0;
14250 selfDeterminedMask = nodeMask;
14251 break;
14252 case eUCAT:
14253 realOp = 0;
14254 selfDeterminedMask = nodeMask;
14255 break;
14256 case eCOM:
14257 realOp = 0;
14258 break;
14259 case eNEG:
14260 realOp = 0;
14261 break;
14262 case ePLUS:
14263 realOp = 0;
14264 break;
14265 case eNOT:
14266 realOp = 0;
14267 scalarMask = 1;
14268 break;
14269 case eGT:
14270 realOp = 0;
14271 calculateMax = 1;
14272 break;
14273 case eGE:
14274 realOp = 0;
14275 calculateMax = 1;
14276 break;
14277 case eLT:
14278 realOp = 0;
14279 calculateMax = 1;
14280 break;
14281 case eLE:
14282 realOp = 0;
14283 calculateMax = 1;
14284 break;
14285 case eLAND:
14286 realOp = 0;
14287 scalarMask = 3;
14288 break;
14289 case eLOR:
14290 realOp = 0;
14291 scalarMask = 3;
14292 break;
14293 case eCEQ:
14294 realOp = 0;
14295 calculateMax = 1;
14296 break;
14297 case eCNE:
14298 realOp = 0;
14299 calculateMax = 1;
14300 break;
14301 case eEQ:
14302 realOp = 0;
14303 calculateMax = 1;
14304 break;
14305 case eNE:
14306 realOp = 0;
14307 calculateMax = 1;
14308 break;
14309 case eRAND:
14310 realOp = 0;
14311 selfDeterminedMask = nodeMask;
14312 break;
14313 case eRNAND:
14314 realOp = 0;
14315 selfDeterminedMask = nodeMask;
14316 break;
14317 case eROR:
14318 realOp = 0;
14319 selfDeterminedMask = nodeMask;
14320 break;
14321 case eRNOR:
14322 realOp = 0;
14323 selfDeterminedMask = nodeMask;
14324 break;
14325 case eRXOR:
14326 realOp = 0;
14327 selfDeterminedMask = nodeMask;
14328 break;
14329 case eRXNOR:
14330 realOp = 0;
14331 selfDeterminedMask = nodeMask;
14332 break;
14333 case eHOOK:
14334 realOp = 1;
14335 scalarMask = 1;
14336 break;
14337 case eINIT:
14338 realOp = 0;
14339 break;
14340 case eALWAYS:
14341 realOp = 0;
14342 break;
14343 case eALWAYS_LATCH:
14344 realOp = 0;
14345 break;
14346 case eALWAYS_FF:
14347 realOp = 0;
14348 break;
14349 case eALWAYS_COMB:
14350 realOp = 0;
14351 break;
14352 case eEVENT:
14353 realOp = 0;
14354 break;
14355 case eBLOCK_REF:
14356 realOp = 0;
14357 break;
14358 case eSPECIFY_REF:
14359 realOp = 0;
14360 break;
14361 case eASSIGN:
14362 realOp = 0;
14363 break;
14364 case eADD_ASSIGN:
14365 realOp = 0;
14366 break;
14367 case eSUB_ASSIGN:
14368 realOp = 0;
14369 break;
14370 case eMUL_ASSIGN:
14371 realOp = 0;
14372 break;
14373 case eDIV_ASSIGN:
14374 realOp = 0;
14375 break;
14376 case eMOD_ASSIGN:
14377 realOp = 0;
14378 break;
14379 case eAND_ASSIGN:
14380 realOp = 0;
14381 break;
14382 case eOR_ASSIGN:
14383 realOp = 0;
14384 break;
14385 case eXOR_ASSIGN:
14386 realOp = 0;
14387 break;
14388 case eLSH_ASSIGN:
14389 realOp = 0;
14390 break;
14391 case eRSH_ASSIGN:
14392 realOp = 0;
14393 break;
14394 case eLSHA_ASSIGN:
14395 realOp = 0;
14396 break;
14397 case eRSHA_ASSIGN:
14398 realOp = 0;
14399 break;
14400 case eFORCE:
14401 realOp = 0;
14402 break;
14403 case eRELEASE:
14404 realOp = 0;
14405 break;
14406 case eNBASSIGN:
14407 realOp = 0;
14408 break;
14409 case ePOSEDGE:
14410 realOp = 0;
14411 break;
14412 case eNEGEDGE:
14413 realOp = 0;
14414 break;
14415 case eEDGE:
14416 realOp = 0;
14417 break;
14418 case eEVOR:
14419 realOp = 0;
14420 break;
14421 case eDELAY:
14422 realOp = 0;
14423 break;
14424 case eMTM:
14425 realOp = 1;
14426 break;
14427 case eIF:
14428 realOp = 0;
14429 break;
14430 case eFOREVER:
14431 realOp = 0;
14432 break;
14433 case eREPEAT:
14434 realOp = 0;
14435 break;
14436 case eWHILE:
14437 realOp = 0;
14438 break;
14439 case eWAIT:
14440 realOp = 0;
14441 break;
14442 case eFOR:
14443 realOp = 0;
14444 break;
14445 case eCASE:
14446 realOp = 0;
14447 break;
14448 case eCASEX:
14449 realOp = 0;
14450 break;
14451 case eCASEZ:
14452 realOp = 0;
14453 break;
14454 case eCASEITEM:
14455 realOp = 0;
14456 break;
14457 case eCASSIGN:
14458 realOp = 0;
14459 break;
14460 case eARG:
14461 realOp = 0;
14462 break;
14463 case eFUNCTION_DEF:
14464 realOp = 0;
14465 break;
14466 case eMODULE_DEF:
14467 realOp = 0;
14468 break;
14469 case eREPEAT_CONTROL:
14470 realOp = 0;
14471 break;
14472 case eDELAY_CONTROL:
14473 realOp = 0;
14474 break;
14475 case eEVENT_CONTROL:
14476 realOp = 0;
14477 break;
14478 case eEXTERNAL_REF:
14479 realOp = 0;
14480 break;
14481 case ePORT_DEF:
14482 realOp = 0;
14483 break;
14484 case eDEFPARAM:
14485 realOp = 0;
14486 break;
14487 case ePATH:
14488 realOp = 0;
14489 break;
14490 case ePATH_ASSIGN:
14491 realOp = 0;
14492 break;
14493 case eIFNONE_PATH_ASSIGN:
14494 realOp = 0;
14495 break;
14496 case eTRIGGER:
14497 realOp = 0;
14498 break;
14499 case ePASSIGN:
14500 realOp = 0;
14501 break;
14502 case eDEASSIGN:
14503 realOp = 0;
14504 break;
14505 case eDISABLE:
14506 realOp = 0;
14507 break;
14508 case eATTRIBUTE:
14509 realOp = 0;
14510 break;
14511 case eGIF:
14512 realOp = 0;
14513 break;
14514 case eGFOR:
14515 realOp = 0;
14516 break;
14517 case eGCASE:
14518 realOp = 0;
14519 break;
14520 case eTABLE:
14521 realOp = 0;
14522 break;
14523 case eTABLE_ENTRY:
14524 realOp = 0;
14525 break;
14526 case eTABLE_SYMBOL:
14527 realOp = 0;
14528 break;
14529 case ePORTLIST_END:
14530 realOp = 0;
14531 break;
14532 case eMACRO_EXPR:
14533 realOp = 0;
14534 break;
14535 case eENUM_SPEC:
14536 realOp = 0;
14537 break;
14538 case eMEMBER:
14539 realOp = 0;
14540 break;
14541 case eRETURN:
14542 realOp = 0;
14543 break;
14544 case ePREINC:
14545 realOp = 1;
14546 break;
14547 case ePOSTINC:
14548 realOp = 1;
14549 break;
14550 case ePREDEC:
14551 realOp = 1;
14552 break;
14553 case ePOSTDEC:
14554 realOp = 1;
14555 break;
14556 case eCAST:
14557 realOp = 0;
14558 selfDeterminedMask = nodeMask;
14559 break;
14560 default:
14561 MASSERT( FALSE );
14562 }
14563
14564
14565
14566 unsigned realMask = 0;
14567 unsigned forceRealMask = 0;
14568 int widthsDiffer = 0;
14569 int originalWidth = width;
14570 for( int i = 0; i < ArgCount(); i++ ) {
14571 if( ((nodeMask>>i)&1) && Arg<CNode*>(i)->type == eR ) {
14572 realMask |= 1<<i;
14573 }
14574 if( ((nodeMask>>i)&1) &&
14575 Arg<CNode*>(i)->type != eR &&
14576 (Arg<CNode*>(i)->GetOp() != eVCONSTANT ||
14577 Arg<CNode*>(i)->width != width) ) {
14578 widthsDiffer = 1;
14579 }
14580 }
14581
14582
14583
14584
14585 if( newType == eU && newWidth == 0 ) {
14586 newType = type;
14587 newWidth = width;
14588
14589
14590
14591
14592 } else if( (newType == eB || newType == eS || newType == eU) &&
14593 (type == eB || type == eS) ) {
14594 if( newWidth > width ) {
14595 width = newWidth;
14596 }
14597 if( newType == eU ) {
14598 newType = type;
14599 }
14600 }
14601
14602 MASSERT( newType != eR || newWidth == 0 );
14603 MASSERT( newType != eE || newWidth == 0 );
14604
14605
14606
14607
14608
14609 if( realMask ) {
14610 forceRealMask = (~realMask & nodeMask);
14611 }
14612
14613
14614
14615
14616
14617 int convertWidth = conditionalWiden && FixedWidth();
14618 if( convertWidth ) {
14619 width = originalWidth;
14620 }
14621 if( newType == eB && type == eS ) {
14622 type = eB;
14623 }
14624
14625
14626
14627 int cWidth = width;
14628 NodeType_t cType = type;
14629 if( calculateMax ) {
14630 cType = eS;
14631 int max = 0;
14632 int foundReal = 0;
14633 int foundUnsigned = 0;
14634 for( int i = 0; i < ArgCount(); i++ ) {
14635 if( (nodeMask>>i)&1 ) {
14636 switch( Arg<CNode*>(i)->type ) {
14637 case eB:
14638 foundUnsigned = 1;
14639 break;
14640 case eR:
14641 foundReal = 1;
14642 break;
14643 }
14644 if( Arg<CNode*>(i)->width > max ) {
14645 max = Arg<CNode*>(i)->width;
14646 }
14647 }
14648 }
14649 if( foundReal ) {
14650 cWidth = 0;
14651 cType = eR;
14652 } else if( foundUnsigned ) {
14653 cType = eB;
14654 cWidth = max;
14655 } else {
14656 cWidth = max;
14657 }
14658 }
14659
14660
14661
14662
14663 for( int i = 0; i < ArgCount(); i++ ) {
14664 if( (nodeMask>>i)&1 ) {
14665 if( (scalarMask>>i)&1 ) {
14666 if( Arg<CNode*>(i)->type == eR ) {
14667 CNode* node;
14668 Arg<CNode*>(i) = cNE( Arg<CNode*>(i), cREAL(0), &loc );
14669 Arg<CNode*>(i)->LabelBits();
14670 } else if( type == eR ) {
14671
14672 CNode* node;
14673 Arg<CNode*>(i) = cCNE( Arg<CNode*>(i), cINT32(0), &loc );
14674 Arg<CNode*>(i)->LabelBits();
14675 }
14676 Arg<CNode*>(i) = Arg<CNode*>(i)->FixBits( 0, eU );
14677 } else if( (forceRealMask>>i)&1 ) {
14678 Arg<CNode*>(i) = Arg<CNode*>(i)->FixBits( 0, eR );
14679 } else if( (selfDeterminedMask>>i)&1 ) {
14680 Arg<CNode*>(i) = Arg<CNode*>(i)->FixBits( 0, eU );
14681 } else {
14682 Arg<CNode*>(i) = Arg<CNode*>(i)->FixBits( cWidth, cType );
14683 }
14684 }
14685 }
14686
14687
14688
14689
14690
14691
14692 if( newType != eR && convertWidth ) {
14693 CNode* nn = cWIDTH(cINT32(newWidth), this);
14694 nn->width = newWidth;
14695 nn->type = type;
14696 return nn;
14697 }
14698 if( newType == eR && (type == eB || type == eS) ) {
14699 CNode* nn = cCVIR( this );
14700 nn->width = 0;
14701 nn->type = eR;
14702 return nn;
14703
14704 } else if( (newType == eB || newType == eS) && type == eR ) {
14705 CNode* nn = cCVRI( this );
14706 nn->width = newWidth;
14707 nn->type = newType;
14708 return nn;
14709 }
14710
14711 return this;
14712 }
14713
14714
14715
14716
14717
14718 void CNode::Dump( FILE* f )
14719 {
14720 switch( GetOp() ) {
14721 case eERROR:
14722 fprintf( f, "???" );
14723 break;
14724 case eVCONSTANT:
14725 fprintf( f, "%s", Arg<CVector*>(0)->GetVString() );
14726 break;
14727 case eRCONSTANT:
14728 fprintf( f, "%s", (char*)Arg<char*>(0) );
14729 break;
14730 case ePRAGMA:
14731 fprintf( f, "%s", (char*)Arg<char*>(0) );
14732 break;
14733 case eELIST:
14734 fprintf( f, "" );
14735 Arg<CNode*>(0)->Dump( f );
14736 fprintf( f, "," );
14737 Arg<CNode*>(1)->Dump( f );
14738 fprintf( f, "" );
14739 break;
14740 case eWIDTH:
14741 fprintf( f, "WIDTH(" );
14742 fprintf( f, "%s", type==eS ? "S" : "U" );
14743 fprintf( f, "," );
14744 fprintf( f, "%d", width );
14745 fprintf( f, "," );
14746 Arg<CNode*>(0)->Dump( f );
14747 fprintf( f, "," );
14748 Arg<CNode*>(1)->Dump( f );
14749 fprintf( f, ")" );
14750 break;
14751 case eSUB:
14752 fprintf( f, "(" );
14753 Arg<CNode*>(0)->Dump( f );
14754 fprintf( f, ")-(" );
14755 Arg<CNode*>(1)->Dump( f );
14756 fprintf( f, ")" );
14757 break;
14758 case eMUL:
14759 fprintf( f, "(" );
14760 Arg<CNode*>(0)->Dump( f );
14761 fprintf( f, ")*(" );
14762 Arg<CNode*>(1)->Dump( f );
14763 fprintf( f, ")" );
14764 break;
14765 case eDIV:
14766 fprintf( f, "(" );
14767 Arg<CNode*>(0)->Dump( f );
14768 fprintf( f, ")/(" );
14769 Arg<CNode*>(1)->Dump( f );
14770 fprintf( f, ")" );
14771 break;
14772 case ePOW:
14773 fprintf( f, "(" );
14774 Arg<CNode*>(0)->Dump( f );
14775 fprintf( f, ")**(" );
14776 Arg<CNode*>(1)->Dump( f );
14777 fprintf( f, ")" );
14778 break;
14779 case eADD:
14780 fprintf( f, "(" );
14781 Arg<CNode*>(0)->Dump( f );
14782 fprintf( f, ")+(" );
14783 Arg<CNode*>(1)->Dump( f );
14784 fprintf( f, ")" );
14785 break;
14786 case eLSH:
14787 fprintf( f, "(" );
14788 Arg<CNode*>(0)->Dump( f );
14789 fprintf( f, ")<<(" );
14790 Arg<CNode*>(1)->Dump( f );
14791 fprintf( f, ")" );
14792 break;
14793 case eRSH:
14794 fprintf( f, "(" );
14795 Arg<CNode*>(0)->Dump( f );
14796 fprintf( f, ")>>(" );
14797 Arg<CNode*>(1)->Dump( f );
14798 fprintf( f, ")" );
14799 break;
14800 case eLSHA:
14801 fprintf( f, "(" );
14802 Arg<CNode*>(0)->Dump( f );
14803 fprintf( f, ")<<<(" );
14804 Arg<CNode*>(1)->Dump( f );
14805 fprintf( f, ")" );
14806 break;
14807 case eRSHA:
14808 fprintf( f, "(" );
14809 Arg<CNode*>(0)->Dump( f );
14810 fprintf( f, ")>>>(" );
14811 Arg<CNode*>(1)->Dump( f );
14812 fprintf( f, ")" );
14813 break;
14814 case eMOD:
14815 fprintf( f, "(" );
14816 Arg<CNode*>(0)->Dump( f );
14817 fprintf( f, ")%%(" );
14818 Arg<CNode*>(1)->Dump( f );
14819 fprintf( f, ")" );
14820 break;
14821 case eOR:
14822 fprintf( f, "(" );
14823 Arg<CNode*>(0)->Dump( f );
14824 fprintf( f, ")|(" );
14825 Arg<CNode*>(1)->Dump( f );
14826 fprintf( f, ")" );
14827 break;
14828 case eAND:
14829 fprintf( f, "(" );
14830 Arg<CNode*>(0)->Dump( f );
14831 fprintf( f, ")&(" );
14832 Arg<CNode*>(1)->Dump( f );
14833 fprintf( f, ")" );
14834 break;
14835 case eANDANDAND:
14836 fprintf( f, "(" );
14837 Arg<CNode*>(0)->Dump( f );
14838 fprintf( f, ")&&&(" );
14839 Arg<CNode*>(1)->Dump( f );
14840 fprintf( f, ")" );
14841 break;
14842 case eXOR:
14843 fprintf( f, "(" );
14844 Arg<CNode*>(0)->Dump( f );
14845 fprintf( f, ")^(" );
14846 Arg<CNode*>(1)->Dump( f );
14847 fprintf( f, ")" );
14848 break;
14849 case eXNOR:
14850 fprintf( f, "(" );
14851 Arg<CNode*>(0)->Dump( f );
14852 fprintf( f, ")~^(" );
14853 Arg<CNode*>(1)->Dump( f );
14854 fprintf( f, ")" );
14855 break;
14856 case eFUNCTION_CALL:
14857 fprintf( f, "" );
14858 fprintf( f, "%s", Arg<CSymbol*>(0)->GetName() );
14859 fprintf( f, "(" );
14860 Arg<CNode*>(1)->Dump( f );
14861 fprintf( f, ")" );
14862 break;
14863 case eARRAY:
14864 fprintf( f, "" );
14865 Arg<CNode*>(0)->Dump( f );
14866 fprintf( f, "[" );
14867 Arg<CNode*>(1)->Dump( f );
14868 fprintf( f, "]" );
14869 break;
14870 case eNET_REF:
14871 fprintf( f, "%s", Arg<CNet*>(0)->GetName() );
14872 break;
14873 case eVAR_REF:
14874 fprintf( f, "%s", Arg<CVar*>(0)->GetName() );
14875 break;
14876 case ePARAM_REF:
14877 fprintf( f, "%s", Arg<CParam*>(0)->GetName() );
14878 break;
14879 case ePORT_REF:
14880 fprintf( f, "%s", Arg<CPort*>(0)->GetName() );
14881 break;
14882 case eFWD_REF:
14883 fprintf( f, "%s", Arg<CFref*>(0)->GetName() );
14884 break;
14885 case eGENVAR_REF:
14886 fprintf( f, "%s", Arg<CGenvar*>(0)->GetName() );
14887 break;
14888 case eENUM_REF:
14889 fprintf( f, "%s", Arg<CEnum*>(0)->GetName() );
14890 break;
14891 case eTYPE_REF:
14892 fprintf( f, "%s", Arg<CTypedef*>(0)->GetName() );
14893 break;
14894 case eVAR_DECL:
14895 fprintf( f, "VarDecl" );
14896 break;
14897 case eLIST:
14898 fprintf( f, "(" );
14899 Arg<CNode*>(0)->Dump( f );
14900 fprintf( f, "," );
14901 Arg<CNode*>(1)->Dump( f );
14902 fprintf( f, ")" );
14903 break;
14904 case eRANGE:
14905 fprintf( f, "" );
14906 Arg<CNode*>(0)->Dump( f );
14907 fprintf( f, ":" );
14908 Arg<CNode*>(1)->Dump( f );
14909 fprintf( f, "" );
14910 break;
14911 case eSLICE:
14912 fprintf( f, "" );
14913 Arg<CNode*>(0)->Dump( f );
14914 fprintf( f, ":" );
14915 Arg<CNode*>(1)->Dump( f );
14916 fprintf( f, "" );
14917 break;
14918 case ePSLICE:
14919 fprintf( f, "" );
14920 Arg<CNode*>(0)->Dump( f );
14921 fprintf( f, "+:" );
14922 Arg<CNode*>(1)->Dump( f );
14923 fprintf( f, "" );
14924 break;
14925 case eMSLICE:
14926 fprintf( f, "" );
14927 Arg<CNode*>(0)->Dump( f );
14928 fprintf( f, "-:" );
14929 Arg<CNode*>(1)->Dump( f );
14930 fprintf( f, "" );
14931 break;
14932 case eCVRI:
14933 fprintf( f, "CVRI(" );
14934 Arg<CNode*>(0)->Dump( f );
14935 fprintf( f, ")" );
14936 break;
14937 case eCVIR:
14938 fprintf( f, "CVIR(" );
14939 Arg<CNode*>(0)->Dump( f );
14940 fprintf( f, ")" );
14941 break;
14942 case eREP:
14943 fprintf( f, "{" );
14944 Arg<CNode*>(0)->Dump( f );
14945 fprintf( f, "{" );
14946 Arg<CNode*>(1)->Dump( f );
14947 fprintf( f, "}}" );
14948 break;
14949 case eCAT:
14950 fprintf( f, "{" );
14951 Arg<CNode*>(0)->Dump( f );
14952 fprintf( f, "," );
14953 Arg<CNode*>(1)->Dump( f );
14954 fprintf( f, "}" );
14955 break;
14956 case eUCAT:
14957 fprintf( f, "{" );
14958 Arg<CNode*>(0)->Dump( f );
14959 fprintf( f, "}" );
14960 break;
14961 case eCOM:
14962 fprintf( f, "~(" );
14963 Arg<CNode*>(0)->Dump( f );
14964 fprintf( f, ")" );
14965 break;
14966 case eNEG:
14967 fprintf( f, "-(" );
14968 Arg<CNode*>(0)->Dump( f );
14969 fprintf( f, ")" );
14970 break;
14971 case ePLUS:
14972 fprintf( f, "+(" );
14973 Arg<CNode*>(0)->Dump( f );
14974 fprintf( f, ")" );
14975 break;
14976 case eNOT:
14977 fprintf( f, "!(" );
14978 Arg<CNode*>(0)->Dump( f );
14979 fprintf( f, ")" );
14980 break;
14981 case eGT:
14982 fprintf( f, "(" );
14983 Arg<CNode*>(0)->Dump( f );
14984 fprintf( f, ")>(" );
14985 Arg<CNode*>(1)->Dump( f );
14986 fprintf( f, ")" );
14987 break;
14988 case eGE:
14989 fprintf( f, "(" );
14990 Arg<CNode*>(0)->Dump( f );
14991 fprintf( f, ")>=(" );
14992 Arg<CNode*>(1)->Dump( f );
14993 fprintf( f, ")" );
14994 break;
14995 case eLT:
14996 fprintf( f, "(" );
14997 Arg<CNode*>(0)->Dump( f );
14998 fprintf( f, ")<(" );
14999 Arg<CNode*>(1)->Dump( f );
15000 fprintf( f, ")" );
15001 break;
15002 case eLE:
15003 fprintf( f, "(" );
15004 Arg<CNode*>(0)->Dump( f );
15005 fprintf( f, ")<=(" );
15006 Arg<CNode*>(1)->Dump( f );
15007 fprintf( f, ")" );
15008 break;
15009 case eLAND:
15010 fprintf( f, "(" );
15011 Arg<CNode*>(0)->Dump( f );
15012 fprintf( f, ")&&(" );
15013 Arg<CNode*>(1)->Dump( f );
15014 fprintf( f, ")" );
15015 break;
15016 case eLOR:
15017 fprintf( f, "(" );
15018 Arg<CNode*>(0)->Dump( f );
15019 fprintf( f, ")||(" );
15020 Arg<CNode*>(1)->Dump( f );
15021 fprintf( f, ")" );
15022 break;
15023 case eCEQ:
15024 fprintf( f, "(" );
15025 Arg<CNode*>(0)->Dump( f );
15026 fprintf( f, ")===(" );
15027 Arg<CNode*>(1)->Dump( f );
15028 fprintf( f, ")" );
15029 break;
15030 case eCNE:
15031 fprintf( f, "(" );
15032 Arg<CNode*>(0)->Dump( f );
15033 fprintf( f, ")!==(" );
15034 Arg<CNode*>(1)->Dump( f );
15035 fprintf( f, ")" );
15036 break;
15037 case eEQ:
15038 fprintf( f, "(" );
15039 Arg<CNode*>(0)->Dump( f );
15040 fprintf( f, ")==(" );
15041 Arg<CNode*>(1)->Dump( f );
15042 fprintf( f, ")" );
15043 break;
15044 case eNE:
15045 fprintf( f, "(" );
15046 Arg<CNode*>(0)->Dump( f );
15047 fprintf( f, ")!=(" );
15048 Arg<CNode*>(1)->Dump( f );
15049 fprintf( f, ")" );
15050 break;
15051 case eRAND:
15052 fprintf( f, "&(" );
15053 Arg<CNode*>(0)->Dump( f );
15054 fprintf( f, ")" );
15055 break;
15056 case eRNAND:
15057 fprintf( f, "~&(" );
15058 Arg<CNode*>(0)->Dump( f );
15059 fprintf( f, ")" );
15060 break;
15061 case eROR:
15062 fprintf( f, "|(" );
15063 Arg<CNode*>(0)->Dump( f );
15064 fprintf( f, ")" );
15065 break;
15066 case eRNOR:
15067 fprintf( f, "~|(" );
15068 Arg<CNode*>(0)->Dump( f );
15069 fprintf( f, ")" );
15070 break;
15071 case eRXOR:
15072 fprintf( f, "^(" );
15073 Arg<CNode*>(0)->Dump( f );
15074 fprintf( f, ")" );
15075 break;
15076 case eRXNOR:
15077 fprintf( f, "~^(" );
15078 Arg<CNode*>(0)->Dump( f );
15079 fprintf( f, ")" );
15080 break;
15081 case eHOOK:
15082 fprintf( f, "(" );
15083 Arg<CNode*>(0)->Dump( f );
15084 fprintf( f, ")?(" );
15085 Arg<CNode*>(1)->Dump( f );
15086 fprintf( f, "):(" );
15087 Arg<CNode*>(2)->Dump( f );
15088 fprintf( f, ")" );
15089 break;
15090 case eINIT:
15091 fprintf( f, "INIT(*)" );
15092 break;
15093 case ePOSEDGE:
15094 fprintf( f, "POSEDGE(" );
15095 Arg<CNode*>(0)->Dump( f );
15096 fprintf( f, ")" );
15097 break;
15098 case eNEGEDGE:
15099 fprintf( f, "NEGEDGE(" );
15100 Arg<CNode*>(0)->Dump( f );
15101 fprintf( f, ")" );
15102 break;
15103 case eEDGE:
15104 fprintf( f, "EDGE(" );
15105 Arg<CNode*>(0)->Dump( f );
15106 fprintf( f, ")" );
15107 break;
15108 case eMTM:
15109 fprintf( f, "(" );
15110 Arg<CNode*>(0)->Dump( f );
15111 fprintf( f, ":" );
15112 Arg<CNode*>(1)->Dump( f );
15113 fprintf( f, ":" );
15114 Arg<CNode*>(2)->Dump( f );
15115 fprintf( f, ")" );
15116 break;
15117 case eMODULE_DEF:
15118 fprintf( f, "MODULE_DEF" );
15119 break;
15120 case eMACRO_EXPR:
15121 fprintf( f, "" );
15122 fprintf( f, "%s", (const char*)Arg<const char*>(0) );
15123 fprintf( f, "<" );
15124 Arg<CNode*>(1)->Dump( f );
15125 fprintf( f, ">" );
15126 break;
15127 case eMEMBER:
15128 fprintf( f, "" );
15129 Arg<CNode*>(0)->Dump( f );
15130 fprintf( f, "." );
15131 fprintf( f, "%s", Arg<CSymbol*>(1)->GetName() );
15132 fprintf( f, "" );
15133 break;
15134 case ePREINC:
15135 fprintf( f, "++(" );
15136 Arg<CNode*>(0)->Dump( f );
15137 fprintf( f, ")" );
15138 break;
15139 case ePOSTINC:
15140 fprintf( f, "(" );
15141 Arg<CNode*>(0)->Dump( f );
15142 fprintf( f, ")++" );
15143 break;
15144 case ePREDEC:
15145 fprintf( f, "--(" );
15146 Arg<CNode*>(0)->Dump( f );
15147 fprintf( f, ")" );
15148 break;
15149 case ePOSTDEC:
15150 fprintf( f, "(" );
15151 Arg<CNode*>(0)->Dump( f );
15152 fprintf( f, ")--" );
15153 break;
15154 case eCAST:
15155 fprintf( f, "CAST(" );
15156 Arg<CNode*>(0)->Dump( f );
15157 fprintf( f, "," );
15158 Arg<CNode*>(1)->Dump( f );
15159 fprintf( f, ")" );
15160 break;
15161 case eCOMMENT:
15162 case eVRQ:
15163 case eNOP:
15164 case eINSTANCE_REF:
15165 case eGATE_REF:
15166 case eTASK_ENABLE:
15167 case eSYSTASK_CALL:
15168 case eTIMING_CALL:
15169 case eNET_DECL:
15170 case ePARAM_DECL:
15171 case eSPECPARAM_DECL:
15172 case ePORT_DECL:
15173 case eGENVAR_DECL:
15174 case eTYPEDEF_DECL:
15175 case eALWAYS:
15176 case eALWAYS_LATCH:
15177 case eALWAYS_FF:
15178 case eALWAYS_COMB:
15179 case eEVENT:
15180 case eBLOCK_REF:
15181 case eSPECIFY_REF:
15182 case eASSIGN:
15183 case eADD_ASSIGN:
15184 case eSUB_ASSIGN:
15185 case eMUL_ASSIGN:
15186 case eDIV_ASSIGN:
15187 case eMOD_ASSIGN:
15188 case eAND_ASSIGN:
15189 case eOR_ASSIGN:
15190 case eXOR_ASSIGN:
15191 case eLSH_ASSIGN:
15192 case eRSH_ASSIGN:
15193 case eLSHA_ASSIGN:
15194 case eRSHA_ASSIGN:
15195 case eFORCE:
15196 case eRELEASE:
15197 case eNBASSIGN:
15198 case eEVOR:
15199 case eDELAY:
15200 case eIF:
15201 case eFOREVER:
15202 case eREPEAT:
15203 case eWHILE:
15204 case eWAIT:
15205 case eFOR:
15206 case eCASE:
15207 case eCASEX:
15208 case eCASEZ:
15209 case eCASEITEM:
15210 case eCASSIGN:
15211 case eARG:
15212 case eFUNCTION_DEF:
15213 case eREPEAT_CONTROL:
15214 case eDELAY_CONTROL:
15215 case eEVENT_CONTROL:
15216 case eEXTERNAL_REF:
15217 case ePORT_DEF:
15218 case eDEFPARAM:
15219 case ePATH:
15220 case ePATH_ASSIGN:
15221 case eIFNONE_PATH_ASSIGN:
15222 case eTRIGGER:
15223 case ePASSIGN:
15224 case eDEASSIGN:
15225 case eDISABLE:
15226 case eATTRIBUTE:
15227 case eGIF:
15228 case eGFOR:
15229 case eGCASE:
15230 case eTABLE:
15231 case eTABLE_ENTRY:
15232 case eTABLE_SYMBOL:
15233 case ePORTLIST_END:
15234 case eENUM_SPEC:
15235 case eRETURN:
15236 MASSERT( FALSE );
15237 break;
15238 }
15239 }
15240
15241 #endif // DEFINE_METHODS
15242
15243 #ifdef DEFINE_TEST_HARNESS
15244 void CNodeTestHarness()
15245 {
15246 for( int i = 0; i < 150; ++i ) {
15247 CNode* n = new(CNode::stack) CNode( NULL, (NodeOp_t)i );
15248 if( n->Precedence() != n->Precedence_1() ) {
15249 printf( "Fail %s\n", nodeOpName[i] );
15250 exit(1);
15251 }
15252 }
15253 }
15254 #endif // DEFINE_TEST_HARNESS