forked from steveicarus/iverilog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtarget.cc
619 lines (524 loc) · 15.3 KB
/
target.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
/*
* Copyright (c) 1998-2021 Stephen Williams <[email protected]>
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
* General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
# include "config.h"
# include <iostream>
# include "target.h"
# include <typeinfo>
using namespace std;
target_t::~target_t()
{
}
void target_t::scope(const NetScope*)
{
}
void target_t::convert_module_ports(const NetScope*)
{
}
bool target_t::branch(const NetBranch*obj)
{
cerr << obj->get_fileline() << ": error: target (" << typeid(*this).name()
<< "): Unhandled branch." << endl;
return false;
}
bool target_t::class_type(const NetScope*, netclass_t*obj)
{
cerr << "<>:0" << ": error: target (" << typeid(*this).name()
<< "): Unhandled class_type <" << obj << ">." << endl;
return false;
}
void target_t::event(const NetEvent*ev)
{
cerr << ev->get_fileline() << ": error: target (" << typeid(*this).name()
<< "): Unhandled event <" << ev->name() << ">." << endl;
}
bool target_t::enumeration(const NetScope*, netenum_t*obj)
{
cerr << "<>:0" << ": error: target (" << typeid(*this).name()
<< "): Unhandled enumeration <" << obj << ">." << endl;
return false;
}
bool target_t::signal_paths(const NetNet*)
{
return true;
}
bool target_t::func_def(const NetScope*)
{
cerr << "target (" << typeid(*this).name() << "): "
"Unhandled function definition." << endl;
return false;
}
void target_t::task_def(const NetScope*)
{
cerr << "target (" << typeid(*this).name() << "): "
"Unhandled task definition." << endl;
}
void target_t::logic(const NetLogic*)
{
cerr << "target (" << typeid(*this).name() << "): "
"Unhandled logic gate" << endl;
}
bool target_t::tran(const NetTran*)
{
cerr << "target (" << typeid(*this).name() << "): "
<< "TRAN devices not supported." << endl;
return false;
}
bool target_t::bufz(const NetBUFZ*)
{
cerr << "target (" << typeid(*this).name() << "): "
"Unhandled continuous assign (BUFZ)." << endl;
return false;
}
void target_t::udp(const NetUDP*)
{
cerr << "target (" << typeid(*this).name() << "): "
"Unhandled UDP." << endl;
}
bool target_t::ureduce(const NetUReduce*)
{
cerr << "target (" << typeid(*this).name() << "): "
"Unhandled unary reduction logic gate." << endl;
return false;
}
void target_t::lpm_abs(const NetAbs*)
{
cerr << "target (" << typeid(*this).name() << "): "
"Unhandled NetAbs." << endl;
}
void target_t::lpm_add_sub(const NetAddSub*)
{
cerr << "target (" << typeid(*this).name() << "): "
"Unhandled NetAddSub." << endl;
}
bool target_t::lpm_array_dq(const NetArrayDq*)
{
cerr << "target (" << typeid(*this).name() << "): "
"Unhandled NetArrayDq." << endl;
return false;
}
bool target_t::lpm_cast_int2(const NetCastInt2*)
{
cerr << "target (" << typeid(*this).name() << "): "
"Unhandled NetCastInt2." << endl;
return false;
}
bool target_t::lpm_cast_int4(const NetCastInt4*)
{
cerr << "target (" << typeid(*this).name() << "): "
"Unhandled NetCastInt4." << endl;
return false;
}
bool target_t::lpm_cast_real(const NetCastReal*)
{
cerr << "target (" << typeid(*this).name() << "): "
"Unhandled NetCastReal." << endl;
return false;
}
void target_t::lpm_clshift(const NetCLShift*)
{
cerr << "target (" << typeid(*this).name() << "): "
"Unhandled NetCLShift." << endl;
}
void target_t::lpm_compare(const NetCompare*)
{
cerr << "target (" << typeid(*this).name() << "): "
"Unhandled NetCompare." << endl;
}
void target_t::lpm_divide(const NetDivide*)
{
cerr << "target (" << typeid(*this).name() << "): "
"Unhandled NetDivide." << endl;
}
void target_t::lpm_modulo(const NetModulo*)
{
cerr << "target (" << typeid(*this).name() << "): "
"Unhandled NetModulo." << endl;
}
void target_t::lpm_ff(const NetFF*)
{
cerr << "target (" << typeid(*this).name() << "): "
"Unhandled NetFF." << endl;
}
void target_t::lpm_latch(const NetLatch*)
{
cerr << "target (" << typeid(*this).name() << "): "
"Unhandled NetLatch." << endl;
}
void target_t::lpm_mult(const NetMult*)
{
cerr << "target (" << typeid(*this).name() << "): "
"Unhandled NetMult." << endl;
}
void target_t::lpm_mux(const NetMux*)
{
cerr << "target (" << typeid(*this).name() << "): "
"Unhandled NetMux." << endl;
}
void target_t::lpm_pow(const NetPow*)
{
cerr << "target (" << typeid(*this).name() << "): "
"Unhandled NetPow." << endl;
}
bool target_t::concat(const NetConcat*)
{
cerr << "target (" << typeid(*this).name() << "): "
"Unhandled NetConcat." << endl;
return false;
}
bool target_t::part_select(const NetPartSelect*)
{
cerr << "target (" << typeid(*this).name() << "): "
"Unhandled NetPartSelect." << endl;
return false;
}
bool target_t::replicate(const NetReplicate*)
{
cerr << "target (" << typeid(*this).name() << "): "
"Unhandled NetReplicate." << endl;
return false;
}
void target_t::net_case_cmp(const NetCaseCmp*)
{
cerr << "target (" << typeid(*this).name() << "): "
"Unhandled case compare node." << endl;
}
bool target_t::net_const(const NetConst*)
{
cerr << "target (" << typeid(*this).name() << "): "
"Unhandled CONSTANT node." << endl;
return false;
}
bool target_t::net_sysfunction(const NetSysFunc*)
{
cerr << "target (" << typeid(*this).name() << "): "
"Unhandled NetSysFunc node." << endl;
return false;
}
bool target_t::net_function(const NetUserFunc*)
{
cerr << "target (" << typeid(*this).name() << "): "
"Unhandled NetUserFunc node." << endl;
return false;
}
bool target_t::net_literal(const NetLiteral*)
{
cerr << "target (" << typeid(*this).name() << "): "
"Unhandled LITERAL node." << endl;
return false;
}
void target_t::net_probe(const NetEvProbe*net)
{
cerr << "target (" << typeid(*this).name() << "): "
"Unhandled probe trigger node" << endl;
net->dump_node(cerr, 4);
}
bool target_t::sign_extend(const NetSignExtend*)
{
cerr << "target (" << typeid(*this).name() << "): "
"Unhandled NetSignExtend node." << endl;
return false;
}
bool target_t::substitute(const NetSubstitute*)
{
cerr << "target (" << typeid(*this).name() << "): "
"Unhandled NetSubstitute node." << endl;
return false;
}
bool target_t::process(const NetProcTop*)
{
cerr << "target (" << typeid(*this).name() << "): "
"Unhandled process(NetProcTop)." << endl;
return false;
}
bool target_t::process(const NetAnalogTop*)
{
cerr << "target (" << typeid(*this).name() << "): "
"Unhandled process(NetAnalogTop)." << endl;
return false;
}
void target_t::proc_alloc(const NetAlloc*)
{
cerr << "target (" << typeid(*this).name() << "): "
"Unhandled proc_alloc." << endl;
}
bool target_t::proc_assign(const NetAssign*)
{
cerr << "target (" << typeid(*this).name() << "): "
"Unhandled procedural assignment." << endl;
return false;
}
void target_t::proc_assign_nb(const NetAssignNB*)
{
cerr << "target (" << typeid(*this).name() << "): "
"Unhandled non-blocking assignment." << endl;
}
bool target_t::proc_block(const NetBlock*)
{
cerr << "target (" << typeid(*this).name() << "): "
"Unhandled proc_block." << endl;
return false;
}
bool target_t::proc_break(const NetBreak*)
{
cerr << "target (" << typeid(*this).name() << "): "
"Unhandled proc_break." << endl;
return false;
}
void target_t::proc_case(const NetCase*cur)
{
cerr << "target (" << typeid(*this).name() << "): "
"Unhandled case:" << endl;
cur->dump(cerr, 6);
}
bool target_t::proc_cassign(const NetCAssign*dev)
{
cerr << "target (" << typeid(*this).name() << "): ";
cerr << dev->get_fileline();
cerr << ": Target does not support procedural continuous assignment." << endl;
return false;
}
bool target_t::proc_condit(const NetCondit*condit)
{
cerr << "target (" << typeid(*this).name() << "): "
"Unhandled conditional:" << endl;
condit->dump(cerr, 6);
return false;
}
bool target_t::proc_continue(const NetContinue*)
{
cerr << "target (" << typeid(*this).name() << "): "
"Unhandled proc_continue." << endl;
return false;
}
bool target_t::proc_contribution(const NetContribution*net)
{
cerr << "target (" << typeid(*this).name() << "): "
"Unhandled contribution:" << endl;
net->dump(cerr, 6);
return false;
}
bool target_t::proc_deassign(const NetDeassign*dev)
{
cerr << dev->get_fileline() << ": internal error: "
<< "target (" << typeid(*this).name() << "): "
<< "Unhandled proc_deassign." << endl;
return false;
}
bool target_t::proc_delay(const NetPDelay*)
{
cerr << "target (" << typeid(*this).name() << "): "
"Unhandled proc_delay." << endl;
return false;
}
bool target_t::proc_disable(const NetDisable*obj)
{
cerr << obj->get_fileline() << ": internal error: "
<< "target (" << typeid(*this).name() << "): "
<< "does not support disable statements." << endl;
return false;
}
void target_t::proc_do_while(const NetDoWhile*net)
{
cerr << "target (" << typeid(*this).name() << "): "
"Unhandled do/while:" << endl;
net->dump(cerr, 6);
}
bool target_t::proc_force(const NetForce*)
{
cerr << "target (" << typeid(*this).name() << "): "
"Unhandled proc_force." << endl;
return false;
}
void target_t::proc_forever(const NetForever*)
{
cerr << "target (" << typeid(*this).name() << "): "
"Unhandled proc_forever." << endl;
}
bool target_t::proc_forloop(const NetForLoop*)
{
cerr << "target (" << typeid(*this).name() << "): "
"Unhandled proc_forloop." << endl;
return false;
}
void target_t::proc_free(const NetFree*)
{
cerr << "target (" << typeid(*this).name() << "): "
"Unhandled proc_free." << endl;
}
bool target_t::proc_release(const NetRelease*dev)
{
cerr << dev->get_fileline() << ": internal error: "
<< "target (" << typeid(*this).name() << "): "
<< "Unhandled proc_release." << endl;
return false;
}
void target_t::proc_repeat(const NetRepeat*)
{
cerr << "target (" << typeid(*this).name() << "): "
"Unhandled proc_repeat." << endl;
}
bool target_t::proc_trigger(const NetEvTrig*tr)
{
cerr << tr->get_fileline() << ": error: target (" << typeid(*this).name()
<< "): Unhandled event trigger." << endl;
return false;
}
bool target_t::proc_nb_trigger(const NetEvNBTrig*tr)
{
cerr << tr->get_fileline() << ": error: target (" << typeid(*this).name()
<< "): Unhandled non-blocking event trigger." << endl;
return false;
}
void target_t::proc_stask(const NetSTask*)
{
cerr << "target (" << typeid(*this).name() << "): "
"Unhandled proc_stask." << endl;
}
void target_t::proc_utask(const NetUTask*)
{
cerr << "target (" << typeid(*this).name() << "): "
"Unhandled proc_utask." << endl;
}
bool target_t::proc_wait(const NetEvWait*tr)
{
cerr << tr->get_fileline() << ": error: target (" << typeid(*this).name()
<< "): Unhandled event wait." << endl;
return false;
}
void target_t::proc_while(const NetWhile*net)
{
cerr << "target (" << typeid(*this).name() << "): "
"Unhandled while:" << endl;
net->dump(cerr, 6);
}
int target_t::end_design(const Design*)
{
return 0;
}
expr_scan_t::~expr_scan_t()
{
}
void expr_scan_t::expr_access_func(const NetEAccess*)
{
cerr << "expr_scan_t (" << typeid(*this).name() << "): "
"unhandled expr_access_func." << endl;
}
void expr_scan_t::expr_array_pattern(const NetEArrayPattern*)
{
cerr << "expr_scan_t (" << typeid(*this).name() << "): "
"unhandled expr_array_pattern." << endl;
}
void expr_scan_t::expr_const(const NetEConst*)
{
cerr << "expr_scan_t (" << typeid(*this).name() << "): "
"unhandled expr_const." << endl;
}
void expr_scan_t::expr_last(const NetELast*exp)
{
cerr << exp->get_fileline() << ": expr_scan_t(" << typeid(*this).name() << "): "
<< "unhandled expr_last." << endl;
}
void expr_scan_t::expr_new(const NetENew*)
{
cerr << "expr_scan_t (" << typeid(*this).name() << "): "
"unhandled expr_new." << endl;
}
void expr_scan_t::expr_null(const NetENull*)
{
cerr << "expr_scan_t (" << typeid(*this).name() << "): "
"unhandled expr_null." << endl;
}
void expr_scan_t::expr_param(const NetEConstParam*that)
{
expr_const(that);
}
void expr_scan_t::expr_property(const NetEProperty*)
{
cerr << "expr_scan_t (" << typeid(*this).name() << "): "
"unhandled expr_property." << endl;
}
void expr_scan_t::expr_creal(const NetECReal*)
{
cerr << "expr_scan_t (" << typeid(*this).name() << "): "
"unhandled expr_creal." << endl;
}
void expr_scan_t::expr_rparam(const NetECRealParam*that)
{
expr_creal(that);
}
void expr_scan_t::expr_concat(const NetEConcat*that)
{
cerr << that->get_fileline() << ": expr_scan_t (" <<
typeid(*this).name() << "): unhandled expr_concat." << endl;
}
void expr_scan_t::expr_event(const NetEEvent*)
{
cerr << "expr_scan_t (" << typeid(*this).name() << "): "
"unhandled expr_event." << endl;
}
void expr_scan_t::expr_netenum(const NetENetenum*)
{
cerr << "expr_scan_t (" << typeid(*this).name() << "): "
"unhandled expr_netenum." << endl;
}
void expr_scan_t::expr_scope(const NetEScope*)
{
cerr << "expr_scan_t (" << typeid(*this).name() << "): "
"unhandled expr_scope." << endl;
}
void expr_scan_t::expr_scopy(const NetEShallowCopy*)
{
cerr << "expr_scan_t (" << typeid(*this).name() << "): "
"unhandled expr_scopy." << endl;
}
void expr_scan_t::expr_select(const NetESelect*)
{
cerr << "expr_scan_t (" << typeid(*this).name() << "): "
"unhandled expr_select." << endl;
}
void expr_scan_t::expr_sfunc(const NetESFunc*)
{
cerr << "expr_scan_t (" << typeid(*this).name() << "): "
"unhandled expr_sfunc." << endl;
}
void expr_scan_t::expr_signal(const NetESignal*)
{
cerr << "expr_scan_t (" << typeid(*this).name() << "): "
"unhandled expr_signal." << endl;
}
void expr_scan_t::expr_ternary(const NetETernary*)
{
cerr << "expr_scan_t (" << typeid(*this).name() << "): "
"unhandled expr_ternary." << endl;
}
void expr_scan_t::expr_ufunc(const NetEUFunc*)
{
cerr << "expr_scan_t (" << typeid(*this).name() << "): "
"unhandled function call." << endl;
}
void expr_scan_t::expr_unary(const NetEUnary*)
{
cerr << "expr_scan_t (" << typeid(*this).name() << "): "
"unhandled expr_unary." << endl;
}
void expr_scan_t::expr_binary(const NetEBinary*ex)
{
cerr << "expr_scan_t (" << typeid(*this).name() << "): "
"unhandled expr_binary: " <<*ex << endl;
}