Update compiler with suggestions from cppcheck

This commit is contained in:
Cary R 2021-01-02 14:04:06 -08:00
parent 7299625ab5
commit da7484eea1
24 changed files with 466 additions and 448 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998-2020 Stephen Williams <steve@icarus.com>
* Copyright (c) 1998-2021 Stephen Williams <steve@icarus.com>
* Copyright CERN 2013 / Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
@ -31,8 +31,8 @@
# include <typeinfo>
PExpr::PExpr()
: expr_type_(IVL_VT_NO_TYPE)
{
expr_type_ = IVL_VT_NO_TYPE;
expr_width_ = 0;
min_width_ = 0;
signed_flag_ = false;

View File

@ -1,7 +1,7 @@
#ifndef IVL_PExpr_H
#define IVL_PExpr_H
/*
* Copyright (c) 1998-2020 Stephen Williams <steve@icarus.com>
* Copyright (c) 1998-2021 Stephen Williams <steve@icarus.com>
* Copyright CERN 2013 / Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
@ -231,7 +231,7 @@ class PEAssignPattern : public PExpr {
class PEConcat : public PExpr {
public:
PEConcat(const list<PExpr*>&p, PExpr*r =0);
explicit PEConcat(const list<PExpr*>&p, PExpr*r =0);
~PEConcat();
virtual verinum* eval_const(Design*des, NetScope*sc) const;

View File

@ -1,6 +1,20 @@
// These are correct and are used to find the base (zero) pin.
thisSubtraction:netlist.h:5126
thisSubtraction:netlist.h:5135
thisSubtraction:netlist.h:5213
thisSubtraction:netlist.h:5222
// This is used when running a debugger
// debugger_release
knownConditionTrueFalse:main.cc:919
// This are just stubs
// vpi_control()
unusedFunction:vpi_modules.cc:107
// vpi_mcd_printf()
unusedFunction:vpi_modules.cc:84
// vpi_printf()
unusedFunction:vpi_modules.cc:88
// vpi_sim_control()
unusedFunction:vpi_modules.cc:108
// These are the functions that the compiler exports to the targets.
//ivl_branch_island()
@ -9,36 +23,36 @@ unusedFunction:t-dll-api.cc:39
unusedFunction:t-dll-api.cc:45
//ivl_const_bits()
unusedFunction:t-dll-api.cc:196
unusedFunction:t-dll-api.cc:189
//ivl_const_delay()
unusedFunction:t-dll-api.cc:214
unusedFunction:t-dll-api.cc:207
//ivl_const_file()
unusedFunction:t-dll-api.cc:221
unusedFunction:t-dll-api.cc:214
//ivl_const_lineno()
unusedFunction:t-dll-api.cc:227
unusedFunction:t-dll-api.cc:220
//ivl_const_nex()
unusedFunction:t-dll-api.cc:233
unusedFunction:t-dll-api.cc:226
//ivl_const_real()
unusedFunction:t-dll-api.cc:239
unusedFunction:t-dll-api.cc:232
//ivl_const_scope()
unusedFunction:t-dll-api.cc:246
unusedFunction:t-dll-api.cc:239
//ivl_const_signed()
unusedFunction:t-dll-api.cc:252
unusedFunction:t-dll-api.cc:245
//ivl_const_type()
unusedFunction:t-dll-api.cc:190
unusedFunction:t-dll-api.cc:183
//ivl_const_width()
unusedFunction:t-dll-api.cc:258
unusedFunction:t-dll-api.cc:251
//ivl_design_const()
unusedFunction:t-dll-api.cc:127
unusedFunction:t-dll-api.cc:120
//ivl_design_consts()
unusedFunction:t-dll-api.cc:121
unusedFunction:t-dll-api.cc:114
//ivl_design_delay_sel()
unusedFunction:t-dll-api.cc:52
//ivl_design_discipline()
unusedFunction:t-dll-api.cc:140
unusedFunction:t-dll-api.cc:133
//ivl_design_disciplines()
unusedFunction:t-dll-api.cc:134
unusedFunction:t-dll-api.cc:127
//ivl_design_flag()
unusedFunction:t-dll-api.cc:59
//ivl_design_process()
@ -48,211 +62,211 @@ unusedFunction:t-dll-api.cc:80
//ivl_design_roots()
unusedFunction:t-dll-api.cc:89
//ivl_design_time_precision()
unusedFunction:t-dll-api.cc:115
unusedFunction:t-dll-api.cc:108
//ivl_discipline_domain()
unusedFunction:t-dll-api.cc:147
unusedFunction:t-dll-api.cc:140
//ivl_discipline_flow()
unusedFunction:t-dll-api.cc:153
unusedFunction:t-dll-api.cc:146
//ivl_discipline_name()
unusedFunction:t-dll-api.cc:159
unusedFunction:t-dll-api.cc:152
//ivl_discipline_potential()
unusedFunction:t-dll-api.cc:165
unusedFunction:t-dll-api.cc:158
//ivl_enum_bits()
unusedFunction:t-dll-api.cc:277
//ivl_enum_file()
unusedFunction:t-dll-api.cc:302
//ivl_enum_lineno()
unusedFunction:t-dll-api.cc:308
//ivl_enum_name()
unusedFunction:t-dll-api.cc:270
//ivl_enum_file()
unusedFunction:t-dll-api.cc:295
//ivl_enum_lineno()
unusedFunction:t-dll-api.cc:301
//ivl_enum_name()
unusedFunction:t-dll-api.cc:263
//ivl_enum_names()
unusedFunction:t-dll-api.cc:264
unusedFunction:t-dll-api.cc:257
//ivl_enum_signed()
unusedFunction:t-dll-api.cc:296
unusedFunction:t-dll-api.cc:289
//ivl_enum_type()
unusedFunction:t-dll-api.cc:284
unusedFunction:t-dll-api.cc:277
//ivl_enum_width()
unusedFunction:t-dll-api.cc:290
unusedFunction:t-dll-api.cc:283
//ivl_event_any()
unusedFunction:t-dll-api.cc:369
unusedFunction:t-dll-api.cc:362
//ivl_event_file()
unusedFunction:t-dll-api.cc:345
unusedFunction:t-dll-api.cc:338
//ivl_event_lineno()
unusedFunction:t-dll-api.cc:351
unusedFunction:t-dll-api.cc:344
//ivl_event_name()
unusedFunction:t-dll-api.cc:314
unusedFunction:t-dll-api.cc:307
//ivl_event_nany()
unusedFunction:t-dll-api.cc:363
unusedFunction:t-dll-api.cc:356
//ivl_event_neg()
unusedFunction:t-dll-api.cc:382
unusedFunction:t-dll-api.cc:375
//ivl_event_nneg()
unusedFunction:t-dll-api.cc:376
unusedFunction:t-dll-api.cc:369
//ivl_event_npos()
unusedFunction:t-dll-api.cc:389
unusedFunction:t-dll-api.cc:382
//ivl_event_pos()
unusedFunction:t-dll-api.cc:395
unusedFunction:t-dll-api.cc:388
//ivl_event_scope()
unusedFunction:t-dll-api.cc:357
unusedFunction:t-dll-api.cc:350
//ivl_expr_bits()
unusedFunction:t-dll-api.cc:402
unusedFunction:t-dll-api.cc:395
//ivl_expr_branch()
unusedFunction:t-dll-api.cc:409
unusedFunction:t-dll-api.cc:402
//ivl_expr_def()
unusedFunction:t-dll-api.cc:416
unusedFunction:t-dll-api.cc:409
//ivl_expr_delay_val()
unusedFunction:t-dll-api.cc:432
unusedFunction:t-dll-api.cc:425
//ivl_expr_dvalue()
unusedFunction:t-dll-api.cc:439
unusedFunction:t-dll-api.cc:432
//ivl_expr_enumtype()
unusedFunction:t-dll-api.cc:446
unusedFunction:t-dll-api.cc:439
//ivl_expr_event()
unusedFunction:t-dll-api.cc:656
//ivl_expr_file()
unusedFunction:t-dll-api.cc:178
//ivl_expr_lineno()
unusedFunction:t-dll-api.cc:184
//ivl_expr_name()
unusedFunction:t-dll-api.cc:459
//ivl_expr_nature()
unusedFunction:t-dll-api.cc:483
//ivl_expr_net_type()
unusedFunction:t-dll-api.cc:453
//ivl_expr_opcode()
unusedFunction:t-dll-api.cc:490
//ivl_expr_oper1()
unusedFunction:t-dll-api.cc:506
//ivl_expr_oper2()
unusedFunction:t-dll-api.cc:544
//ivl_expr_oper3()
unusedFunction:t-dll-api.cc:570
//ivl_expr_parameter()
unusedFunction:t-dll-api.cc:584
//ivl_expr_parm()
unusedFunction:t-dll-api.cc:599
//ivl_expr_parms()
unusedFunction:t-dll-api.cc:626
//ivl_expr_repeat()
unusedFunction:t-dll-api.cc:649
//ivl_expr_scope()
unusedFunction:t-dll-api.cc:670
//ivl_expr_sel_type()
unusedFunction:t-dll-api.cc:677
//ivl_expr_signed()
unusedFunction:t-dll-api.cc:702
//ivl_expr_sized()
unusedFunction:t-dll-api.cc:708
//ivl_expr_string()
unusedFunction:t-dll-api.cc:714
//ivl_expr_type()
//ivl_expr_file()
unusedFunction:t-dll-api.cc:171
//ivl_expr_lineno()
unusedFunction:t-dll-api.cc:177
//ivl_expr_name()
unusedFunction:t-dll-api.cc:452
//ivl_expr_nature()
unusedFunction:t-dll-api.cc:476
//ivl_expr_net_type()
unusedFunction:t-dll-api.cc:446
//ivl_expr_opcode()
unusedFunction:t-dll-api.cc:483
//ivl_expr_oper1()
unusedFunction:t-dll-api.cc:499
//ivl_expr_oper2()
unusedFunction:t-dll-api.cc:537
//ivl_expr_oper3()
unusedFunction:t-dll-api.cc:563
//ivl_expr_parameter()
unusedFunction:t-dll-api.cc:577
//ivl_expr_parm()
unusedFunction:t-dll-api.cc:592
//ivl_expr_parms()
unusedFunction:t-dll-api.cc:619
//ivl_expr_repeat()
unusedFunction:t-dll-api.cc:642
//ivl_expr_scope()
unusedFunction:t-dll-api.cc:663
//ivl_expr_sel_type()
unusedFunction:t-dll-api.cc:670
//ivl_expr_signed()
unusedFunction:t-dll-api.cc:795
//ivl_expr_sized()
unusedFunction:t-dll-api.cc:701
//ivl_expr_string()
unusedFunction:t-dll-api.cc:707
//ivl_expr_type()
unusedFunction:t-dll-api.cc:164
//ivl_expr_uvalue()
unusedFunction:t-dll-api.cc:721
unusedFunction:t-dll-api.cc:714
//ivl_expr_value()
unusedFunction:t-dll-api.cc:747
unusedFunction:t-dll-api.cc:740
//ivl_expr_width()
unusedFunction:t-dll-api.cc:753
unusedFunction:t-dll-api.cc:746
//ivl_file_table_index()
unusedFunction:t-dll-api.cc:795
unusedFunction:t-dll-api.cc:788
//ivl_file_table_item()
unusedFunction:t-dll-api.cc:785
unusedFunction:t-dll-api.cc:778
//ivl_file_table_size()
unusedFunction:t-dll-api.cc:813
unusedFunction:t-dll-api.cc:806
//ivl_island_flag_set()
unusedFunction:t-dll-api.cc:822
unusedFunction:t-dll-api.cc:815
//ivl_island_flag_test()
unusedFunction:t-dll-api.cc:837
unusedFunction:t-dll-api.cc:830
//ivl_logic_attr()
unusedFunction:t-dll-api.cc:864
unusedFunction:t-dll-api.cc:857
//ivl_logic_attr_cnt()
unusedFunction:t-dll-api.cc:880
unusedFunction:t-dll-api.cc:873
//ivl_logic_attr_val()
unusedFunction:t-dll-api.cc:886
unusedFunction:t-dll-api.cc:879
//ivl_logic_basename()
unusedFunction:t-dll-api.cc:935
//ivl_logic_delay()
unusedFunction:t-dll-api.cc:974
//ivl_logic_drive0()
unusedFunction:t-dll-api.cc:894
//ivl_logic_drive1()
unusedFunction:t-dll-api.cc:911
//ivl_logic_file()
unusedFunction:t-dll-api.cc:846
//ivl_logic_is_cassign()
unusedFunction:t-dll-api.cc:858
//ivl_logic_lineno()
unusedFunction:t-dll-api.cc:852
//ivl_logic_name()
unusedFunction:t-dll-api.cc:928
//ivl_logic_delay()
unusedFunction:t-dll-api.cc:967
//ivl_logic_drive0()
unusedFunction:t-dll-api.cc:887
//ivl_logic_drive1()
unusedFunction:t-dll-api.cc:904
//ivl_logic_file()
unusedFunction:t-dll-api.cc:839
//ivl_logic_is_cassign()
unusedFunction:t-dll-api.cc:851
//ivl_logic_lineno()
unusedFunction:t-dll-api.cc:845
//ivl_logic_name()
unusedFunction:t-dll-api.cc:921
//ivl_logic_pins()
unusedFunction:t-dll-api.cc:953
unusedFunction:t-dll-api.cc:946
//ivl_logic_scope()
unusedFunction:t-dll-api.cc:941
unusedFunction:t-dll-api.cc:934
//ivl_logic_type()
unusedFunction:t-dll-api.cc:947
unusedFunction:t-dll-api.cc:940
//ivl_logic_udp()
unusedFunction:t-dll-api.cc:966
unusedFunction:t-dll-api.cc:959
//ivl_logic_width()
unusedFunction:t-dll-api.cc:981
unusedFunction:t-dll-api.cc:974
//ivl_lpm_array()
unusedFunction:t-dll-api.cc:1109
unusedFunction:t-dll-api.cc:1102
//ivl_lpm_aset_value()
unusedFunction:t-dll-api.cc:1160
unusedFunction:t-dll-api.cc:1153
//ivl_lpm_async_clr()
unusedFunction:t-dll-api.cc:1054
unusedFunction:t-dll-api.cc:1047
//ivl_lpm_async_set()
unusedFunction:t-dll-api.cc:1085
//ivl_lpm_base()
unusedFunction:t-dll-api.cc:1121
//ivl_lpm_basename()
unusedFunction:t-dll-api.cc:1048
//ivl_lpm_clk()
unusedFunction:t-dll-api.cc:1148
//ivl_lpm_data()
unusedFunction:t-dll-api.cc:1221
//ivl_lpm_datab()
unusedFunction:t-dll-api.cc:1321
//ivl_lpm_define()
unusedFunction:t-dll-api.cc:1183
//ivl_lpm_delay()
unusedFunction:t-dll-api.cc:1078
//ivl_lpm_base()
unusedFunction:t-dll-api.cc:1114
//ivl_lpm_basename()
unusedFunction:t-dll-api.cc:1041
//ivl_lpm_clk()
unusedFunction:t-dll-api.cc:1141
//ivl_lpm_data()
unusedFunction:t-dll-api.cc:1214
//ivl_lpm_datab()
unusedFunction:t-dll-api.cc:1316
//ivl_lpm_define()
unusedFunction:t-dll-api.cc:1176
//ivl_lpm_delay()
unusedFunction:t-dll-api.cc:1071
//ivl_lpm_drive0()
unusedFunction:t-dll-api.cc:1453
unusedFunction:t-dll-api.cc:1450
//ivl_lpm_drive1()
unusedFunction:t-dll-api.cc:1470
unusedFunction:t-dll-api.cc:1467
//ivl_lpm_enable()
unusedFunction:t-dll-api.cc:1195
unusedFunction:t-dll-api.cc:1188
//ivl_lpm_file()
unusedFunction:t-dll-api.cc:1209
unusedFunction:t-dll-api.cc:1202
//ivl_lpm_lineno()
unusedFunction:t-dll-api.cc:1215
unusedFunction:t-dll-api.cc:1208
//ivl_lpm_name()
unusedFunction:t-dll-api.cc:1355
unusedFunction:t-dll-api.cc:1350
//ivl_lpm_negedge()
unusedFunction:t-dll-api.cc:1136
unusedFunction:t-dll-api.cc:1129
//ivl_lpm_select()
unusedFunction:t-dll-api.cc:1493
unusedFunction:t-dll-api.cc:1490
//ivl_lpm_selects()
unusedFunction:t-dll-api.cc:1510
unusedFunction:t-dll-api.cc:1507
//ivl_lpm_signed()
unusedFunction:t-dll-api.cc:1528
unusedFunction:t-dll-api.cc:1526
//ivl_lpm_size()
unusedFunction:t-dll-api.cc:1587
//ivl_lpm_sset_value()
unusedFunction:t-dll-api.cc:1171
unusedFunction:t-dll-api.cc:1164
//ivl_lpm_string()
unusedFunction:t-dll-api.cc:1640
//ivl_lpm_sync_clr()
unusedFunction:t-dll-api.cc:1066
unusedFunction:t-dll-api.cc:1059
//ivl_lpm_sync_set()
unusedFunction:t-dll-api.cc:1097
unusedFunction:t-dll-api.cc:1090
//ivl_lpm_trigger()
unusedFunction:t-dll-api.cc:1659
//ivl_lpm_type()
@ -317,303 +331,308 @@ unusedFunction:t-dll-api.cc:1887
//ivl_path_condit()
unusedFunction:t-dll-api.cc:1920
//ivl_path_delay()
unusedFunction:t-dll-api.cc:1932
unusedFunction:t-dll-api.cc:1938
//ivl_path_is_condit()
unusedFunction:t-dll-api.cc:1926
//ivl_path_is_parallel()
unusedFunction:t-dll-api.cc:1932
//ivl_path_scope()
unusedFunction:t-dll-api.cc:1938
unusedFunction:t-dll-api.cc:1944
//ivl_path_source()
unusedFunction:t-dll-api.cc:1945
//ivl_path_source_negedge()
unusedFunction:t-dll-api.cc:1957
//ivl_path_source_posedge()
unusedFunction:t-dll-api.cc:1951
//ivl_path_source_negedge()
unusedFunction:t-dll-api.cc:1963
//ivl_path_source_posedge()
unusedFunction:t-dll-api.cc:1957
//ivl_process_analog()
unusedFunction:t-dll-api.cc:1981
//ivl_process_attr_cnt()
unusedFunction:t-dll-api.cc:1999
//ivl_process_attr_val()
unusedFunction:t-dll-api.cc:2005
//ivl_process_file()
unusedFunction:t-dll-api.cc:1963
//ivl_process_lineno()
unusedFunction:t-dll-api.cc:1969
//ivl_process_scope()
unusedFunction:t-dll-api.cc:1987
//ivl_process_stmt()
unusedFunction:t-dll-api.cc:1993
//ivl_process_type()
//ivl_process_attr_cnt()
unusedFunction:t-dll-api.cc:2005
//ivl_process_attr_val()
unusedFunction:t-dll-api.cc:2011
//ivl_process_file()
unusedFunction:t-dll-api.cc:1969
//ivl_process_lineno()
unusedFunction:t-dll-api.cc:1975
//ivl_process_scope()
unusedFunction:t-dll-api.cc:1993
//ivl_process_stmt()
unusedFunction:t-dll-api.cc:1999
//ivl_process_type()
unusedFunction:t-dll-api.cc:1981
//ivl_scope_attr_cnt()
unusedFunction:t-dll-api.cc:2013
//ivl_scope_attr_val()
unusedFunction:t-dll-api.cc:2019
//ivl_scope_attr_val()
unusedFunction:t-dll-api.cc:2025
//ivl_scope_basename()
unusedFunction:t-dll-api.cc:2027
//ivl_scope_child()
unusedFunction:t-dll-api.cc:2054
//ivl_scope_children()
unusedFunction:t-dll-api.cc:2033
//ivl_scope_child()
unusedFunction:t-dll-api.cc:2060
//ivl_scope_children()
unusedFunction:t-dll-api.cc:2039
//ivl_scope_childs()
unusedFunction:t-dll-api.cc:2047
unusedFunction:t-dll-api.cc:2053
//ivl_scope_class()
unusedFunction:t-dll-api.cc:2061
unusedFunction:t-dll-api.cc:2067
//ivl_scope_classes()
unusedFunction:t-dll-api.cc:2068
unusedFunction:t-dll-api.cc:2074
//ivl_scope_def()
unusedFunction:t-dll-api.cc:2075
//ivl_scope_def_file()
unusedFunction:t-dll-api.cc:2081
//ivl_scope_def_lineno()
//ivl_scope_def_file()
unusedFunction:t-dll-api.cc:2087
//ivl_scope_enumerate()
unusedFunction:t-dll-api.cc:2099
//ivl_scope_enumerates()
//ivl_scope_def_lineno()
unusedFunction:t-dll-api.cc:2093
//ivl_scope_enumerate()
unusedFunction:t-dll-api.cc:2105
//ivl_scope_enumerates()
unusedFunction:t-dll-api.cc:2099
//ivl_scope_event()
unusedFunction:t-dll-api.cc:2112
unusedFunction:t-dll-api.cc:2118
//ivl_scope_events()
unusedFunction:t-dll-api.cc:2106
unusedFunction:t-dll-api.cc:2112
//ivl_scope_file()
unusedFunction:t-dll-api.cc:2119
//ivl_scope_func_signed
unusedFunction:t-dll-api.cc:2132
//ivl_scope_func_type
unusedFunction:t-dll-api.cc:2125
//ivl_scope_func_signed
unusedFunction:t-dll-api.cc:2138
//ivl_scope_func_type
unusedFunction:t-dll-api.cc:2131
//ivl_scope_func_width
unusedFunction:t-dll-api.cc:2140
unusedFunction:t-dll-api.cc:2146
//ivl_scope_is_auto()
unusedFunction:t-dll-api.cc:2148
//ivl_scope_is_cell()
unusedFunction:t-dll-api.cc:2154
//ivl_scope_lineno()
//ivl_scope_is_cell()
unusedFunction:t-dll-api.cc:2160
//ivl_scope_log()
unusedFunction:t-dll-api.cc:2172
//ivl_scope_logs()
//ivl_scope_lineno()
unusedFunction:t-dll-api.cc:2166
//ivl_scope_log()
unusedFunction:t-dll-api.cc:2178
//ivl_scope_logs()
unusedFunction:t-dll-api.cc:2172
//ivl_scope_lpm()
unusedFunction:t-dll-api.cc:2185
unusedFunction:t-dll-api.cc:2191
//ivl_scope_lpms()
unusedFunction:t-dll-api.cc:2179
unusedFunction:t-dll-api.cc:2185
//ivl_scope_mod_module_port_name()
unusedFunction:t-dll-api.cc:2264
unusedFunction:t-dll-api.cc:2270
//ivl_scope_mod_module_port_type()
unusedFunction:t-dll-api.cc:2273
unusedFunction:t-dll-api.cc:2279
//ivl_scope_mod_module_port_width()
unusedFunction:t-dll-api.cc:2285
unusedFunction:t-dll-api.cc:2291
//ivl_scope_mod_module_ports()
unusedFunction:t-dll-api.cc:2257
unusedFunction:t-dll-api.cc:2263
//ivl_scope_mod_port()
unusedFunction:t-dll-api.cc:2310
unusedFunction:t-dll-api.cc:2316
//ivl_scope_param()
unusedFunction:t-dll-api.cc:2243
unusedFunction:t-dll-api.cc:2249
//ivl_scope_params()
unusedFunction:t-dll-api.cc:2237
unusedFunction:t-dll-api.cc:2243
//ivl_scope_parent()
unusedFunction:t-dll-api.cc:2250
unusedFunction:t-dll-api.cc:2256
//ivl_scope_port()
unusedFunction:t-dll-api.cc:2301
unusedFunction:t-dll-api.cc:2307
//ivl_scope_ports()
unusedFunction:t-dll-api.cc:2292
unusedFunction:t-dll-api.cc:2298
//ivl_scope_sig()
unusedFunction:t-dll-api.cc:2324
unusedFunction:t-dll-api.cc:2330
//ivl_scope_sigs()
unusedFunction:t-dll-api.cc:2318
unusedFunction:t-dll-api.cc:2324
//ivl_scope_switch()
unusedFunction:t-dll-api.cc:2337
unusedFunction:t-dll-api.cc:2343
//ivl_scope_switches()
unusedFunction:t-dll-api.cc:2331
unusedFunction:t-dll-api.cc:2337
//ivl_scope_time_precision()
unusedFunction:t-dll-api.cc:2344
//ivl_scope_time_units()
unusedFunction:t-dll-api.cc:2350
//ivl_scope_tname()
unusedFunction:t-dll-api.cc:2362
//ivl_scope_type()
//ivl_scope_time_units()
unusedFunction:t-dll-api.cc:2356
//ivl_scope_tname()
unusedFunction:t-dll-api.cc:2368
//ivl_scope_type()
unusedFunction:t-dll-api.cc:2362
//ivl_signal_array_addr_swapped()
unusedFunction:t-dll-api.cc:2380
//ivl_signal_array_base()
unusedFunction:t-dll-api.cc:2368
//ivl_signal_array_count()
unusedFunction:t-dll-api.cc:2374
//ivl_signal_attr()
unusedFunction:t-dll-api.cc:2398
//ivl_signal_attr_cnt()
unusedFunction:t-dll-api.cc:2414
//ivl_signal_attr_val()
unusedFunction:t-dll-api.cc:2420
//ivl_signal_basename()
unusedFunction:t-dll-api.cc:2427
//ivl_signal_data_type()
unusedFunction:t-dll-api.cc:2578
//ivl_signal_dimensions()
unusedFunction:t-dll-api.cc:2386
//ivl_signal_discipline()
unusedFunction:t-dll-api.cc:2392
//ivl_signal_file()
unusedFunction:t-dll-api.cc:2555
//ivl_signal_forced_net()
unusedFunction:t-dll-api.cc:2549
//ivl_signal_integer()
unusedFunction:t-dll-api.cc:2567
//ivl_signal_lineno()
unusedFunction:t-dll-api.cc:2561
//ivl_signal_local()
unusedFunction:t-dll-api.cc:2536
//ivl_signal_lsb()
unusedFunction:t-dll-api.cc:2501
//ivl_signal_module_port_index()
unusedFunction:t-dll-api.cc:2530
//ivl_signal_msb()
unusedFunction:t-dll-api.cc:2491
//ivl_signal_name()
//ivl_signal_array_base()
unusedFunction:t-dll-api.cc:2374
//ivl_signal_array_count()
unusedFunction:t-dll-api.cc:2380
//ivl_signal_attr()
unusedFunction:t-dll-api.cc:2404
//ivl_signal_attr_cnt()
unusedFunction:t-dll-api.cc:2420
//ivl_signal_attr_val()
unusedFunction:t-dll-api.cc:2426
//ivl_signal_basename()
unusedFunction:t-dll-api.cc:2433
//ivl_signal_nex()
unusedFunction:t-dll-api.cc:2454
//ivl_signal_npath()
unusedFunction:t-dll-api.cc:2591
//ivl_signal_packed_dimensions()
unusedFunction:t-dll-api.cc:2471
//ivl_signal_packed_lsb()
unusedFunction:t-dll-api.cc:2484
//ivl_signal_packed_msb()
unusedFunction:t-dll-api.cc:2477
//ivl_signal_path()
unusedFunction:t-dll-api.cc:2597
//ivl_signal_port()
unusedFunction:t-dll-api.cc:2524
//ivl_signal_scope()
unusedFunction:t-dll-api.cc:2511
//ivl_signal_signed()
//ivl_signal_data_type()
unusedFunction:t-dll-api.cc:2584
//ivl_signal_dimensions()
unusedFunction:t-dll-api.cc:2392
//ivl_signal_discipline()
unusedFunction:t-dll-api.cc:2398
//ivl_signal_file()
unusedFunction:t-dll-api.cc:2561
//ivl_signal_forced_net()
unusedFunction:t-dll-api.cc:2555
//ivl_signal_integer()
unusedFunction:t-dll-api.cc:2573
//ivl_signal_lineno()
unusedFunction:t-dll-api.cc:2567
//ivl_signal_local()
unusedFunction:t-dll-api.cc:2542
//ivl_signal_width()
//ivl_signal_lsb()
unusedFunction:t-dll-api.cc:2507
//ivl_signal_module_port_index()
unusedFunction:t-dll-api.cc:2536
//ivl_signal_msb()
unusedFunction:t-dll-api.cc:2497
//ivl_signal_name()
unusedFunction:t-dll-api.cc:2439
//ivl_signal_nex()
unusedFunction:t-dll-api.cc:2460
//ivl_signal_npath()
unusedFunction:t-dll-api.cc:2597
//ivl_signal_packed_dimensions()
unusedFunction:t-dll-api.cc:2477
//ivl_signal_packed_lsb()
unusedFunction:t-dll-api.cc:2490
//ivl_signal_packed_msb()
unusedFunction:t-dll-api.cc:2483
//ivl_signal_path()
unusedFunction:t-dll-api.cc:2603
//ivl_signal_port()
unusedFunction:t-dll-api.cc:2530
//ivl_signal_scope()
unusedFunction:t-dll-api.cc:2517
//ivl_signal_signed()
unusedFunction:t-dll-api.cc:2548
//ivl_signal_width()
unusedFunction:t-dll-api.cc:2523
//ivl_statement_type()
unusedFunction:t-dll-api.cc:2610
unusedFunction:t-dll-api.cc:2616
//ivl_stmt_block_count()
unusedFunction:t-dll-api.cc:2643
unusedFunction:t-dll-api.cc:2649
//ivl_stmt_block_scope()
unusedFunction:t-dll-api.cc:2628
unusedFunction:t-dll-api.cc:2634
//ivl_stmt_block_stmt()
unusedFunction:t-dll-api.cc:2658
unusedFunction:t-dll-api.cc:2664
//ivl_stmt_call()
unusedFunction:t-dll-api.cc:2674
unusedFunction:t-dll-api.cc:2680
//ivl_stmt_case_count()
unusedFunction:t-dll-api.cc:2695
unusedFunction:t-dll-api.cc:2701
//ivl_stmt_case_expr()
unusedFunction:t-dll-api.cc:2710
unusedFunction:t-dll-api.cc:2716
//ivl_stmt_case_quality()
unusedFunction:t-dll-api.cc:2733
//ivl_stmt_case_stmt()
unusedFunction:t-dll-api.cc:2727
unusedFunction:t-dll-api.cc:2749
//ivl_stmt_cond_expr()
unusedFunction:t-dll-api.cc:2744
unusedFunction:t-dll-api.cc:2766
//ivl_stmt_cond_false()
unusedFunction:t-dll-api.cc:2771
unusedFunction:t-dll-api.cc:2793
//ivl_stmt_cond_true()
unusedFunction:t-dll-api.cc:2781
unusedFunction:t-dll-api.cc:2803
//ivl_stmt_delay_expr()
unusedFunction:t-dll-api.cc:2791
unusedFunction:t-dll-api.cc:2813
//ivl_stmt_delay_val()
unusedFunction:t-dll-api.cc:2808
unusedFunction:t-dll-api.cc:2830
//ivl_stmt_events()
unusedFunction:t-dll-api.cc:2834
unusedFunction:t-dll-api.cc:2866
//ivl_stmt_file()
unusedFunction:t-dll-api.cc:2616
//ivl_stmt_lexp()
unusedFunction:t-dll-api.cc:2862
//ivl_stmt_lineno()
unusedFunction:t-dll-api.cc:2622
//ivl_stmt_lexp()
unusedFunction:t-dll-api.cc:2894
//ivl_stmt_lineno()
unusedFunction:t-dll-api.cc:2628
//ivl_stmt_lval()
unusedFunction:t-dll-api.cc:2874
unusedFunction:t-dll-api.cc:2906
//ivl_stmt_lvals()
unusedFunction:t-dll-api.cc:2893
unusedFunction:t-dll-api.cc:2925
//ivl_stmt_lwidth()
unusedFunction:t-dll-api.cc:2911
unusedFunction:t-dll-api.cc:2943
//ivl_stmt_name()
unusedFunction:t-dll-api.cc:2944
unusedFunction:t-dll-api.cc:2976
//ivl_stmt_needs_t0_trigger()
unusedFunction:t-dll-api.cc:2837
//ivl_stmt_nevent()
unusedFunction:t-dll-api.cc:2815
unusedFunction:t-dll-api.cc:2847
//ivl_stmt_opcode()
unusedFunction:t-dll-api.cc:2957
unusedFunction:t-dll-api.cc:2989
//ivl_stmt_parm()
unusedFunction:t-dll-api.cc:2969
unusedFunction:t-dll-api.cc:3001
//ivl_stmt_parm_count()
unusedFunction:t-dll-api.cc:2983
unusedFunction:t-dll-api.cc:3015
//ivl_stmt_rval()
unusedFunction:t-dll-api.cc:2995
unusedFunction:t-dll-api.cc:3027
//ivl_stmt_sfunc_as_task()
unusedFunction:t-dll-api.cc:3013
unusedFunction:t-dll-api.cc:3045
//ivl_stmt_sub_stmt()
unusedFunction:t-dll-api.cc:3026
unusedFunction:t-dll-api.cc:3058
//ivl_switch_a()
unusedFunction:t-dll-api.cc:3067
unusedFunction:t-dll-api.cc:3099
//ivl_switch_b()
unusedFunction:t-dll-api.cc:3073
unusedFunction:t-dll-api.cc:3105
//ivl_switch_basename()
unusedFunction:t-dll-api.cc:3049
unusedFunction:t-dll-api.cc:3081
//ivl_switch_delay()
unusedFunction:t-dll-api.cc:3103
unusedFunction:t-dll-api.cc:3135
//ivl_switch_enable()
unusedFunction:t-dll-api.cc:3079
unusedFunction:t-dll-api.cc:3111
//ivl_switch_file()
unusedFunction:t-dll-api.cc:3110
unusedFunction:t-dll-api.cc:3142
//ivl_switch_island()
unusedFunction:t-dll-api.cc:3116
unusedFunction:t-dll-api.cc:3148
//ivl_switch_lineno()
unusedFunction:t-dll-api.cc:3122
unusedFunction:t-dll-api.cc:3154
//ivl_switch_offset()
unusedFunction:t-dll-api.cc:3097
unusedFunction:t-dll-api.cc:3129
//ivl_switch_part()
unusedFunction:t-dll-api.cc:3091
unusedFunction:t-dll-api.cc:3123
//ivl_switch_scope()
unusedFunction:t-dll-api.cc:3055
unusedFunction:t-dll-api.cc:3087
//ivl_switch_type()
unusedFunction:t-dll-api.cc:3061
unusedFunction:t-dll-api.cc:3093
//ivl_switch_width()
unusedFunction:t-dll-api.cc:3085
unusedFunction:t-dll-api.cc:3117
//ivl_type_base()
unusedFunction:t-dll-api.cc:3128
//unusedFunction:t-dll-api.cc:3128 Used in netmisc.cc
//ivl_type_element()
unusedFunction:t-dll-api.cc:3134
//ivl_type_name()
unusedFunction:t-dll-api.cc:3166
//ivl_type_name()
unusedFunction:t-dll-api.cc:3198
//ivl_type_packed_dimensions()
unusedFunction:t-dll-api.cc:3143
unusedFunction:t-dll-api.cc:3175
//ivl_type_packed_lsb()
unusedFunction:t-dll-api.cc:3150
unusedFunction:t-dll-api.cc:3182
//ivl_type_packed_msb()
unusedFunction:t-dll-api.cc:3158
unusedFunction:t-dll-api.cc:3190
//ivl_type_prop_type()
unusedFunction:t-dll-api.cc:3191
unusedFunction:t-dll-api.cc:3223
//ivl_type_properties()
unusedFunction:t-dll-api.cc:3174
unusedFunction:t-dll-api.cc:3206
//ivl_type_signed()
unusedFunction:t-dll-api.cc:3199
unusedFunction:t-dll-api.cc:3231
//ivl_udp_file()
unusedFunction:t-dll-api.cc:1036
//ivl_udp_init()
unusedFunction:t-dll-api.cc:999
//ivl_udp_lineno()
unusedFunction:t-dll-api.cc:1042
//ivl_udp_name()
unusedFunction:t-dll-api.cc:1029
//ivl_udp_init()
unusedFunction:t-dll-api.cc:992
//ivl_udp_lineno()
unusedFunction:t-dll-api.cc:1035
//ivl_udp_name()
unusedFunction:t-dll-api.cc:1022
//ivl_udp_nin()
unusedFunction:t-dll-api.cc:993
unusedFunction:t-dll-api.cc:986
//ivl_udp_port()
unusedFunction:t-dll-api.cc:1005
unusedFunction:t-dll-api.cc:998
//ivl_udp_row()
unusedFunction:t-dll-api.cc:1014
unusedFunction:t-dll-api.cc:1007
//ivl_udp_rows()
unusedFunction:t-dll-api.cc:1023
unusedFunction:t-dll-api.cc:1016
// ivl_udp_sequ()
unusedFunction:t-dll-api.cc:987
unusedFunction:t-dll-api.cc:980

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998-2013 Stephen Williams (steve@icarus.com)
* Copyright (c) 1998-2021 Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
@ -42,14 +42,14 @@ struct cprop_functor : public functor_t {
virtual void signal(Design*des, NetNet*obj);
virtual void lpm_add_sub(Design*des, NetAddSub*obj);
virtual void lpm_compare(Design*des, NetCompare*obj);
virtual void lpm_compare(Design*des, const NetCompare*obj);
virtual void lpm_concat(Design*des, NetConcat*obj);
virtual void lpm_ff(Design*des, NetFF*obj);
virtual void lpm_logic(Design*des, NetLogic*obj);
virtual void lpm_mux(Design*des, NetMux*obj);
virtual void lpm_part_select(Design*des, NetPartSelect*obj);
void lpm_compare_eq_(Design*des, NetCompare*obj);
void lpm_compare_eq_(Design*des, const NetCompare*obj);
};
void cprop_functor::signal(Design*, NetNet*)
@ -60,7 +60,7 @@ void cprop_functor::lpm_add_sub(Design*, NetAddSub*)
{
}
void cprop_functor::lpm_compare(Design*des, NetCompare*obj)
void cprop_functor::lpm_compare(Design*des, const NetCompare*obj)
{
if (obj->pin_AEB().is_linked()) {
assert( ! obj->pin_AGB().is_linked() );
@ -74,7 +74,7 @@ void cprop_functor::lpm_compare(Design*des, NetCompare*obj)
}
}
void cprop_functor::lpm_compare_eq_(Design*, NetCompare*)
void cprop_functor::lpm_compare_eq_(Design*, const NetCompare*)
{
}
@ -295,11 +295,11 @@ void cprop_functor::lpm_part_select(Design*des, NetPartSelect*obj)
if (off < sig_width)
part_count += 1;
NetConcat*concat = new NetConcat(scope, scope->local_symbol(),
NetConcat*cncat = new NetConcat(scope, scope->local_symbol(),
sig_width, part_count);
concat->set_line(*obj);
des->add_node(concat);
connect(concat->pin(0), obj->pin(1));
cncat->set_line(*obj);
des->add_node(cncat);
connect(cncat->pin(0), obj->pin(1));
off = 0;
size_t concat_pin = 1;
@ -307,20 +307,20 @@ void cprop_functor::lpm_part_select(Design*des, NetPartSelect*obj)
NetPartSelect*cobj = obj_set[idx];
if (cobj->base() > off) {
NetNet*zzz = make_const_z(des, scope, cobj->base()-off);
connect(concat->pin(concat_pin), zzz->pin(0));
connect(cncat->pin(concat_pin), zzz->pin(0));
concat_pin += 1;
off = cobj->base();
}
connect(concat->pin(concat_pin), cobj->pin(0));
connect(cncat->pin(concat_pin), cobj->pin(0));
concat_pin += 1;
off += cobj->width();
}
if (off < sig_width) {
NetNet*zzz = make_const_z(des, scope, sig_width-off);
connect(concat->pin(concat_pin), zzz->pin(0));
connect(cncat->pin(concat_pin), zzz->pin(0));
concat_pin += 1;
}
ivl_assert(*obj, concat_pin == concat->pin_count());
ivl_assert(*obj, concat_pin == cncat->pin_count());
for (size_t idx = 0 ; idx < obj_set.size() ; idx += 1) {
delete obj_set[idx];
@ -392,7 +392,7 @@ void cprop_dc_functor::lpm_const(Design*, NetConst*obj)
unsigned pin;
clnk->cur_link(cur, pin);
NetNet*tmp = dynamic_cast<NetNet*>(cur);
const NetNet*tmp = dynamic_cast<NetNet*>(cur);
if (tmp == 0)
continue;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999-2020 Stephen Williams (steve@icarus.com)
* Copyright (c) 1999-2021 Stephen Williams (steve@icarus.com)
* Copyright CERN 2013 / Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
@ -817,7 +817,7 @@ unsigned PEBLeftWidth::test_width(Design*des, NetScope*scope, width_mode_t&mode)
// type and width of the right operand.
long r_val = LONG_MAX;
if (r_width < sizeof(long)*8) {
r_val = (1L << r_width) - 1L;
r_val = (1UL << r_width) - 1UL;
if ((op_ == 'p') && right_->has_sign())
r_val >>= 1;
}
@ -2148,7 +2148,7 @@ static NetExpr* check_for_struct_members(const LineInfo*li,
// In any case, this should be the tail of the
// member_path, because the array element of this
// kind of array cannot be a struct.
if (member_comp.index.size() > 0) {
if (!member_comp.index.empty()) {
// These are the dimensions defined by the type
const vector<netrange_t>&mem_packed_dims = mem_vec->packed_dims();
@ -2219,7 +2219,7 @@ static NetExpr* check_for_struct_members(const LineInfo*li,
// variable, then stepping to the element type to
// possibly iterate through more of the member_path.
ivl_assert(*li, array->packed());
ivl_assert(*li, member_comp.index.size() > 0);
ivl_assert(*li, !member_comp.index.empty());
// These are the dimensions defined by the type
const vector<netrange_t>&mem_packed_dims = array->static_dimensions();
@ -2295,7 +2295,7 @@ static NetExpr* check_for_struct_members(const LineInfo*li,
completed_path .push_back(member_comp);
member_path.pop_front();
} while (member_path.size() > 0 && struct_type != 0);
} while (!member_path.empty() && struct_type != 0);
// The dimensions in the expression must match the packed
// dimensions that are declared for the variable. For example,
@ -3362,14 +3362,14 @@ NetExpr* PEConcat::elaborate_expr(Design*des, NetScope*scope,
}
/* Make the empty concat expression. */
NetEConcat*concat = new NetEConcat(parm_cnt, repeat_count_, expr_type_);
concat->set_line(*this);
NetEConcat*cncat = new NetEConcat(parm_cnt, repeat_count_, expr_type_);
cncat->set_line(*this);
/* Remove any zero width constants. */
unsigned off = 0;
for (unsigned idx = 0 ; idx < parm_cnt ; idx += 1) {
while (parms[off+idx] == 0) off += 1;
concat->set(idx, parms[off+idx]);
cncat->set(idx, parms[off+idx]);
}
if (wid_sum == 0 && expr_type_ != IVL_VT_STRING) {
@ -3377,11 +3377,11 @@ NetExpr* PEConcat::elaborate_expr(Design*des, NetScope*scope,
<< "may not have zero width in this context." << endl;
des->errors += 1;
concat_depth -= 1;
delete concat;
delete cncat;
return 0;
}
NetExpr*tmp = pad_to_width(concat, expr_wid, signed_flag_, *this);
NetExpr*tmp = pad_to_width(cncat, expr_wid, signed_flag_, *this);
concat_depth -= 1;
return tmp;
@ -4248,7 +4248,7 @@ NetExpr* PEIdent::elaborate_expr(Design*des, NetScope*scope,
pform_name_t base_path = path_;
pform_name_t member_path;
NetScope*found_in = 0;
while (net==0 && par==0 && eve==0 && base_path.size()>0) {
while (net==0 && par==0 && eve==0 && !base_path.empty()) {
found_in = symbol_search(this, des, use_scope, base_path,
net, par, eve, par_type);
if (net) break;
@ -4274,7 +4274,7 @@ NetExpr* PEIdent::elaborate_expr(Design*des, NetScope*scope,
// the parameter value.
if (par != 0) {
if (member_path.size() > 0) {
if (!member_path.empty()) {
cerr << get_fileline() << ": error: Paramater name " << base_path
<< " can't have member names (member_path=" << member_path << ")."
<< endl;
@ -4313,7 +4313,7 @@ NetExpr* PEIdent::elaborate_expr(Design*des, NetScope*scope,
// If this is a struct, and there are members in the
// member_path, then generate an expression that
// reflects the member selection.
if (net->struct_type() && member_path.size() > 0) {
if (net->struct_type() && !member_path.empty()) {
if (debug_elaborate) {
cerr << get_fileline() << ": PEIdent::elaborate_expr: "
<< "Ident " << base_path
@ -4330,7 +4330,7 @@ NetExpr* PEIdent::elaborate_expr(Design*des, NetScope*scope,
// If this is an array object, and there are members in
// the member_path, check for array properties.
if (net->darray_type() && member_path.size() > 0) {
if (net->darray_type() && !member_path.empty()) {
if (debug_elaborate) {
cerr << get_fileline() << ": PEIdent::elaborate_expr: "
<< "Ident " << base_path
@ -4354,7 +4354,7 @@ NetExpr* PEIdent::elaborate_expr(Design*des, NetScope*scope,
// If this is a queue object, and there are members in
// the member_path, check for array properties.
if (net->queue_type() && member_path.size() > 0) {
if (net->queue_type() && !member_path.empty()) {
if (debug_elaborate) {
cerr << get_fileline() << ": PEIdent::elaborate_expr: "
<< "Ident " << base_path
@ -4392,7 +4392,7 @@ NetExpr* PEIdent::elaborate_expr(Design*des, NetScope*scope,
}
}
if (net->class_type() && member_path.size() > 0) {
if (net->class_type() && !member_path.empty()) {
if (debug_elaborate) {
cerr << get_fileline() << ": PEIdent::elaborate_expr: "
<< "Ident " << base_path
@ -4406,7 +4406,7 @@ NetExpr* PEIdent::elaborate_expr(Design*des, NetScope*scope,
net, member_comp);
}
if (net->enumeration() && member_path.size() > 0) {
if (net->enumeration() && !member_path.empty()) {
const netenum_t*netenum = net->enumeration();
if (debug_elaborate) {
cerr << get_fileline() << ": PEIdent::elaborate_expr: "
@ -4425,7 +4425,7 @@ NetExpr* PEIdent::elaborate_expr(Design*des, NetScope*scope,
expr, expr_wid, NULL, 0);
}
ivl_assert(*this, member_path.size() == 0);
ivl_assert(*this, member_path.empty());
NetExpr*tmp = elaborate_expr_net(des, scope, net, found_in,
expr_wid, flags);
@ -4462,7 +4462,7 @@ NetExpr* PEIdent::elaborate_expr(Design*des, NetScope*scope,
scope->is_const_func(false);
}
if (member_path.size() > 0) {
if (!member_path.empty()) {
cerr << get_fileline() << ": error: Event name " << base_path
<< " can't have member names (member_path=" << member_path << ")"
<< endl;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000-2019 Stephen Williams (steve@icarus.com)
* Copyright (c) 2000-2021 Stephen Williams (steve@icarus.com)
* Copyright CERN 2012-2013 / Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
@ -189,7 +189,7 @@ NetAssign_* PEIdent::elaborate_lval(Design*des,
and reg will remain nil. */
pform_name_t base_path = path_;
pform_name_t member_path;
while (reg == 0 && base_path.size() > 0) {
while (reg == 0 && !base_path.empty()) {
symbol_search(this, des, use_scope, base_path, reg, par, eve);
// Found it!
if (reg != 0) break;
@ -285,7 +285,7 @@ NetAssign_* PEIdent::elaborate_lval(Design*des,
// If we find that the matched variable is a packed struct,
// then we can handled it with the net_packed_member_ method.
if (reg->struct_type() && member_path.size() > 0) {
if (reg->struct_type() && !member_path.empty()) {
NetAssign_*lv = new NetAssign_(reg);
elaborate_lval_net_packed_member_(des, use_scope, lv, member_path);
return lv;
@ -293,7 +293,7 @@ NetAssign_* PEIdent::elaborate_lval(Design*des,
// If the variable is a class object, then handle it with the
// net_class_member_ method.
if (reg->class_type() && member_path.size() > 0 && gn_system_verilog()) {
if (reg->class_type() && !member_path.empty() && gn_system_verilog()) {
NetAssign_*lv = elaborate_lval_net_class_member_(des, use_scope, reg, member_path);
return lv;
}
@ -302,7 +302,7 @@ NetAssign_* PEIdent::elaborate_lval(Design*des,
// Past this point, we should have taken care of the cases
// where the name is a member/method of a struct/class.
// XXXX ivl_assert(*this, method_name.nil());
ivl_assert(*this, member_path.size() == 0);
ivl_assert(*this, member_path.empty());
bool need_const_idx = is_cassign || is_force || (reg->type()==NetNet::UNRESOLVED_WIRE);
@ -1125,7 +1125,7 @@ NetAssign_* PEIdent::elaborate_lval_net_class_member_(Design*des, NetScope*scope
// class type.
class_type = dynamic_cast<const netclass_t*>(ptype);
} while (member_path.size() > 0);
} while (!member_path.empty());
return lv;
@ -1289,7 +1289,7 @@ bool PEIdent::elaborate_lval_net_packed_member_(Design*des, NetScope*scope,
// In any case, this should be the tail of the
// member_path, because the array element of this
// kind of array cannot be a struct.
if (member_comp.index.size() > 0) {
if (!member_comp.index.empty()) {
// These are the dimensions defined by the type
const vector<netrange_t>&mem_packed_dims = mem_vec->packed_dims();
@ -1356,7 +1356,7 @@ bool PEIdent::elaborate_lval_net_packed_member_(Design*des, NetScope*scope,
// possibly iterate through more of the member_path.
ivl_assert(*this, array->packed());
ivl_assert(*this, member_comp.index.size() > 0);
ivl_assert(*this, !member_comp.index.empty());
// These are the dimensions defined by the type
const vector<netrange_t>&mem_packed_dims = array->static_dimensions();
@ -1448,7 +1448,6 @@ bool PEIdent::elaborate_lval_net_packed_member_(Design*des, NetScope*scope,
<< endl;
des->errors += 1;
return false;
struct_type = 0;
}
// Complete this component of the path, mark it
@ -1456,7 +1455,7 @@ bool PEIdent::elaborate_lval_net_packed_member_(Design*des, NetScope*scope,
completed_path .push_back(member_comp);
member_path.pop_front();
} while (member_path.size() > 0 && struct_type != 0);
} while (!member_path.empty() && struct_type != 0);
if (debug_elaborate) {
cerr << get_fileline() << ": PEIdent::elaborate_lval_net_packed_member_: "

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999-2020 Stephen Williams (steve@icarus.com)
* Copyright (c) 1999-2021 Stephen Williams (steve@icarus.com)
* Copyright CERN 2012 / Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
@ -470,7 +470,7 @@ NetNet* PEIdent::elaborate_lnet_common_(Design*des, NetScope*scope,
pform_name_t base_path = path_;
pform_name_t member_path;
while (sig == 0 && base_path.size() > 0) {
while (sig == 0 && !base_path.empty()) {
symbol_search(this, des, scope, base_path, sig, par, eve);
// Found it!
if (sig != 0) break;
@ -642,14 +642,13 @@ NetNet* PEIdent::elaborate_lnet_common_(Design*des, NetScope*scope,
// Elaborate an expression from the packed indices and
// the member offset (into the structure) to get a
// canonical expression into the packed signal vector.
NetExpr*packed_base = 0;
if (sig->packed_dimensions() > 1) {
list<index_component_t>tmp_index = base_path.back().index;
index_component_t member_select;
member_select.sel = index_component_t::SEL_BIT;
member_select.msb = new PENumber(new verinum(member_off));
tmp_index.push_back(member_select);
packed_base = collapse_array_indices(des, scope, sig, tmp_index);
NetExpr*packed_base = collapse_array_indices(des, scope, sig, tmp_index);
if (debug_elaborate) {
cerr << get_fileline() << ": PEIdent::elaborate_lnet_common_: "

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000-2020 Stephen Williams (steve@icarus.com)
* Copyright (c) 2000-2021 Stephen Williams (steve@icarus.com)
* Copyright CERN 2013 / Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
@ -1480,7 +1480,7 @@ void PGModule::elaborate_scope_mod_instances_(Design*des, Module*mod, NetScope*s
hname_t use_name (get_name());
if (instance_array) {
int instance_idx = idx;
int instance_idx;
if (instance_low < instance_high)
instance_idx = instance_low + idx;
else

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998-2020 Stephen Williams (steve@icarus.com)
* Copyright (c) 1998-2021 Stephen Williams (steve@icarus.com)
* Copyright CERN 2013 / Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
@ -1471,7 +1471,11 @@ void PGModule::elaborate_mod_(Design*des, Module*rmod, NetScope*scope) const
// that connects to the port.
NetNet*sig = 0;
NetNet::PortType ptype = prts[0]->port_type();
NetNet::PortType ptype;
if (prts.empty())
ptype = NetNet::NOT_A_PORT;
else
ptype = prts[0]->port_type();
if (prts.empty() || (ptype == NetNet::PINPUT)) {
// Special case: If the input port is an unpacked
@ -1787,7 +1791,7 @@ void PGModule::elaborate_mod_(Design*des, Module*rmod, NetScope*scope) const
/* This may not be correct! */
as_signed = prts[0]->get_signed() && sig->get_signed();
break;
case NetNet::PREF:
case NetNet::PREF:
ivl_assert(*this, 0);
break;
default:
@ -2174,6 +2178,7 @@ void PGModule::elaborate_udp_(Design*des, PUdp*udp, NetScope*scope) const
<< "port of " << udp->name_
<< " is " << udp->ports[0] << "." << endl;
des->errors += 1;
return;
} else {
connect(sig->pin(0), net->pin(0));
}
@ -2642,9 +2647,8 @@ NetProc* PAssign::elaborate(Design*des, NetScope*scope) const
cerr << get_fileline() << ": PAssign::elaborate: "
<< "lv->word() = <nil>" << endl;
}
ivl_type_t use_lv_type = lv_net_type;
ivl_assert(*this, lv->word());
use_lv_type = utype->element_type();
ivl_type_t use_lv_type = utype->element_type();
ivl_assert(*this, use_lv_type);
rv = elaborate_rval_(des, scope, use_lv_type);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999-2020 Stephen Williams (steve@icarus.com)
* Copyright (c) 1999-2021 Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
@ -2039,7 +2039,7 @@ NetEConst* NetESFunc::evaluate_isunknown_(const NetExpr* arg) const
return res;
}
static bool is_onehot(verinum&value, bool zero_is_okay)
static bool is_onehot(const verinum&value, bool zero_is_okay)
{
bool found_a_one = false;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999-2020 Stephen Williams (steve@icarus.com)
* Copyright (c) 1999-2021 Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
@ -780,12 +780,12 @@ NetNet* NetEConcat::synthesize(Design*des, NetScope*scope, NetExpr*root)
osig->set_line(*this);
osig->local_flag(true);
NetConcat*concat = new NetConcat(scope, scope->local_symbol(),
NetConcat*cncat = new NetConcat(scope, scope->local_symbol(),
osig->vector_width(),
num_parms * repeat());
concat->set_line(*this);
des->add_node(concat);
connect(concat->pin(0), osig->pin(0));
cncat->set_line(*this);
des->add_node(cncat);
connect(cncat->pin(0), osig->pin(0));
unsigned count_input_width = 0;
unsigned cur_pin = 1;
@ -793,7 +793,7 @@ NetNet* NetEConcat::synthesize(Design*des, NetScope*scope, NetExpr*root)
for (unsigned idx = 0 ; idx < parms_.size() ; idx += 1) {
unsigned concat_item = parms_.size()-idx-1;
if (tmp[concat_item] == 0) continue;
connect(concat->pin(cur_pin), tmp[concat_item]->pin(0));
connect(cncat->pin(cur_pin), tmp[concat_item]->pin(0));
cur_pin += 1;
count_input_width += tmp[concat_item]->vector_width();
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999-2016 Stephen Williams (steve@icarus.com)
* Copyright (c) 1999-2021 Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
@ -50,7 +50,7 @@ void functor_t::lpm_add_sub(Design*, NetAddSub*)
{
}
void functor_t::lpm_compare(Design*, NetCompare*)
void functor_t::lpm_compare(Design*, const NetCompare*)
{
}

View File

@ -1,7 +1,7 @@
#ifndef IVL_functor_H
#define IVL_functor_H
/*
* Copyright (c) 1999-2016 Stephen Williams (steve@icarus.com)
* Copyright (c) 1999-2021 Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
@ -40,65 +40,65 @@ struct functor_t {
virtual ~functor_t();
/* Events are scanned here. */
virtual void event(class Design*des, class NetEvent*);
virtual void event(Design*des, class NetEvent*);
/* This is called once for each signal in the design. */
virtual void signal(class Design*des, class NetNet*);
virtual void signal(Design*des, NetNet*);
/* This method is called for each process in the design. */
virtual void process(class Design*des, class NetProcTop*);
virtual void process(Design*des, NetProcTop*);
/* This method is called for each structural abs(). */
virtual void lpm_abs(class Design*des, class NetAbs*);
virtual void lpm_abs(Design*des, class NetAbs*);
/* This method is called for each structural adder. */
virtual void lpm_add_sub(class Design*des, class NetAddSub*);
virtual void lpm_add_sub(Design*des, class NetAddSub*);
/* This method is called for each structural comparator. */
virtual void lpm_compare(class Design*des, class NetCompare*);
virtual void lpm_compare(Design*des, const class NetCompare*);
/* This method is called for each structural concatenation. */
virtual void lpm_concat(class Design*des, class NetConcat*);
virtual void lpm_concat(Design*des, class NetConcat*);
/* This method is called for each structural constant. */
virtual void lpm_const(class Design*des, class NetConst*);
virtual void lpm_const(Design*des, class NetConst*);
/* This method is called for each structural constant. */
virtual void lpm_divide(class Design*des, class NetDivide*);
virtual void lpm_divide(Design*des, class NetDivide*);
/* Constant literals. */
virtual void lpm_literal(class Design*des, class NetLiteral*);
virtual void lpm_literal(Design*des, class NetLiteral*);
/* This method is called for each structural constant. */
virtual void lpm_modulo(class Design*des, class NetModulo*);
virtual void lpm_modulo(Design*des, class NetModulo*);
/* This method is called for each FF in the design. */
virtual void lpm_ff(class Design*des, class NetFF*);
virtual void lpm_ff(Design*des, class NetFF*);
/* This method is called for each LATCH in the design. */
virtual void lpm_latch(class Design*des, class NetLatch*);
virtual void lpm_latch(Design*des, class NetLatch*);
/* Handle LPM combinational logic devices. */
virtual void lpm_logic(class Design*des, class NetLogic*);
virtual void lpm_logic(Design*des, class NetLogic*);
/* This method is called for each multiplier. */
virtual void lpm_mult(class Design*des, class NetMult*);
virtual void lpm_mult(Design*des, class NetMult*);
/* This method is called for each MUX. */
virtual void lpm_mux(class Design*des, class NetMux*);
virtual void lpm_mux(Design*des, class NetMux*);
virtual void lpm_part_select(class Design*des, class NetPartSelect*);
virtual void lpm_part_select(Design*des, class NetPartSelect*);
/* This method is called for each power. */
virtual void lpm_pow(class Design*des, class NetPow*);
virtual void lpm_pow(Design*des, class NetPow*);
/* This method is called for each part substitute. */
virtual void lpm_substitute(class Design*des, class NetSubstitute*);
virtual void lpm_substitute(Design*des, class NetSubstitute*);
/* This method is called for each unary reduction gate. */
virtual void lpm_ureduce(class Design*des, class NetUReduce*);
virtual void lpm_ureduce(Design*des, class NetUReduce*);
virtual void sign_extend(class Design*des, class NetSignExtend*);
virtual void sign_extend(Design*des, class NetSignExtend*);
};
struct proc_match_t {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012-2018 Stephen Williams (steve@icarus.com)
* Copyright (c) 2012-2021 Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
@ -218,7 +218,7 @@ bool NetProc::evaluate_function(const LineInfo&,
}
void NetAssign::eval_func_lval_op_real_(const LineInfo&loc,
verireal&lv, verireal&rv) const
verireal&lv, const verireal&rv) const
{
switch (op_) {
case '+':

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998-2020 Stephen Williams (steve@icarus.com)
* Copyright (c) 1998-2021 Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
@ -3189,7 +3189,6 @@ bool NetBlock::check_synth(ivl_process_type_t pr_type,
for (const NetProc*cur = proc_first(); cur; cur = proc_next(cur)) {
result |= cur->check_synth(pr_type, scope);
}
scope = save_scope;
return result;
}

View File

@ -1,7 +1,7 @@
#ifndef IVL_netlist_H
#define IVL_netlist_H
/*
* Copyright (c) 1998-2020 Stephen Williams (steve@icarus.com)
* Copyright (c) 1998-2021 Stephen Williams (steve@icarus.com)
* Copyright CERN 2013 / Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
@ -2975,7 +2975,7 @@ class NetAssign : public NetAssignBase {
map<perm_string,LocalVar>&ctx) const;
private:
void eval_func_lval_op_real_(const LineInfo&loc, verireal&lv, verireal&rv) const;
void eval_func_lval_op_real_(const LineInfo&loc, verireal&lv, const verireal&rv) const;
void eval_func_lval_op_(const LineInfo&loc, verinum&lv, verinum&rv) const;
bool eval_func_lval_(const LineInfo&loc, map<perm_string,LocalVar>&ctx,
const NetAssign_*lval, NetExpr*rval_result) const;

View File

@ -1,7 +1,7 @@
#ifndef IVL_netmisc_H
#define IVL_netmisc_H
/*
* Copyright (c) 1999-2019 Stephen Williams (steve@icarus.com)
* Copyright (c) 1999-2021 Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
@ -41,7 +41,7 @@ class netsarray_t;
extern NetScope* symbol_search(const LineInfo*li,
Design*des,
NetScope*start,
pform_name_t path,
const pform_name_t&path,
NetNet*&net, /* net/reg */
const NetExpr*&par,/* parameter/expr */
NetEvent*&eve, /* named event */

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998-2020 Stephen Williams (steve@icarus.com)
* Copyright (c) 1998-2021 Stephen Williams (steve@icarus.com)
* Copyright CERN 2013 / Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
@ -1415,7 +1415,7 @@ void pform_endmodule(const char*name, bool inside_celldefine,
// bar module. Try to find the foo module in the stack, and
// print error messages as we go.
if (strcmp(name, mod_name) != 0) {
while (pform_cur_module.size() > 0) {
while (!pform_cur_module.empty()) {
Module*tmp_module = pform_cur_module.front();
perm_string tmp_name = tmp_module->mod_name();
pform_cur_module.pop_front();

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998-2020 Stephen Williams (steve@icarus.com)
* Copyright (c) 1998-2021 Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
@ -99,7 +99,7 @@ ostream& operator<< (ostream&out, const name_component_t&that)
ostream& operator<< (ostream&o, const pform_name_t&that)
{
pform_name_t::const_iterator cur;
if (that.size() == 0) {
if (that.empty()) {
o << "<nil>";
return o;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012-2019 Stephen Williams (steve@icarus.com)
* Copyright (c) 2012-2021 Stephen Williams (steve@icarus.com)
* Copyright CERN 2013 Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
@ -57,8 +57,6 @@ void pform_end_package_declaration(const struct vlltype&loc)
msg << "Package " << use_name << " was already declared here: "
<< test->second->get_fileline() << ends;
VLerror(msg.str().c_str());
} else {
pform_packages[use_name] = pform_cur_package;
}

View File

@ -1,7 +1,7 @@
#ifndef IVL_svector_H
#define IVL_svector_H
/*
* Copyright (c) 1999-2017 Stephen Williams (steve@icarus.com)
* Copyright (c) 1999-2021 Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
@ -57,7 +57,7 @@ template <class TYPE> class svector {
items_[l.nitems_+idx] = r[idx];
}
svector(const svector<TYPE>&l, TYPE&r)
svector(const svector<TYPE>&l, const TYPE&r)
: nitems_(l.nitems_ + 1), items_(new TYPE[nitems_])
{ for (unsigned idx = 0 ; idx < l.nitems_ ; idx += 1)
items_[idx] = l[idx];

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003-2020 Stephen Williams (steve@icarus.com)
* Copyright (c) 2003-2021 Stephen Williams (steve@icarus.com)
* Copyright CERN 2012 / Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
@ -185,7 +185,7 @@ static bool symbol_search(const LineInfo*li, Design*des, NetScope*scope,
* Compatibility version. Remove me!
*/
NetScope*symbol_search(const LineInfo*li, Design*des, NetScope*scope,
pform_name_t path,
const pform_name_t&path,
NetNet*&net,
const NetExpr*&par,
NetEvent*&eve,

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000-2020 Stephen Williams (steve@icarus.com)
* Copyright (c) 2000-2021 Stephen Williams (steve@icarus.com)
* Copyright CERN 2013 / Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
@ -105,8 +105,8 @@ inline const char*dlerror(void)
#endif
ivl_scope_s::ivl_scope_s()
: func_type(IVL_VT_NO_TYPE)
{
func_type = IVL_VT_NO_TYPE;
func_signed = false;
func_width = 0;
}
@ -2845,14 +2845,14 @@ void dll_target::test_version(const char*target_name)
return;
}
target_query_f target_query = (target_query_f)ivl_dlsym(dll_, LU "target_query" TU);
if (target_query == 0) {
target_query_f targ_query = (target_query_f)ivl_dlsym(dll_, LU "target_query" TU);
if (targ_query == 0) {
cerr << "Target " << target_name
<< " has no version hooks." << endl;
return;
}
const char*version_string = (*target_query) ("version");
const char*version_string = (*targ_query) ("version");
if (version_string == 0) {
cerr << "Target " << target_name
<< " has no version string" << endl;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998-2018 Stephen Williams (steve@icarus.com)
* Copyright (c) 1998-2021 Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
@ -593,8 +593,8 @@ unsigned verinum::significant_bits() const
unsigned sbits = nbits_;
if (has_sign_) {
V sign_bit = bits_[sbits-1];
while ((sbits > 1) && (bits_[sbits-2] == sign_bit))
V sgn_bit = bits_[sbits-1];
while ((sbits > 1) && (bits_[sbits-2] == sgn_bit))
sbits -= 1;
} else {
while ((sbits > 1) && (bits_[sbits-1] == verinum::V0))
@ -1326,17 +1326,17 @@ verinum operator >> (const verinum&that, unsigned shift)
unsigned len = that.len();
verinum::V sign_bit = that.has_sign() ? that.get(len-1) : verinum::V0;
verinum::V sgn_bit = that.has_sign() ? that.get(len-1) : verinum::V0;
if (shift >= len) {
if (!has_len_flag) len = 1;
verinum result(sign_bit, len, has_len_flag);
verinum result(sgn_bit, len, has_len_flag);
result.has_sign(that.has_sign());
return result;
}
if (!has_len_flag) len -= shift;
verinum result(sign_bit, len, has_len_flag);
verinum result(sgn_bit, len, has_len_flag);
result.has_sign(that.has_sign());
for (unsigned idx = shift ; idx < that.len() ; idx += 1)