11
11
12
12
#include " absl/strings/match.h"
13
13
#include " firrtl.pb.h"
14
- #include " google/protobuf/util/time_util.h"
14
+ // #include "google/protobuf/util/time_util.h"
15
15
#include " inou_firrtl.hpp"
16
16
#include " perf_tracing.hpp"
17
17
#include " thread_pool.hpp"
18
18
19
- using google::protobuf::util::TimeUtil;
19
+ // using google::protobuf::util::TimeUtil;
20
20
21
21
/* For help understanding FIRRTL/Protobuf:
22
22
* 1) Semantics regarding FIRRTL language:
@@ -246,9 +246,11 @@ uint16_t Inou_firrtl_module::get_vector_size(const Lnast& lnast, std::string_vie
246
246
if (var2vec_size.find (vec_name) == var2vec_size.end ()) {
247
247
auto module_name = lnast.get_top_module_name ();
248
248
#ifndef NDEBUG
249
- Pass::warn (" Warning: the \" if\" statement below is to enable RocketTile LG generation. Remove the if block and use the assertion above it instead.\n " );
249
+ Pass::warn (
250
+ " Warning: the \" if\" statement below is to enable RocketTile LG generation. Remove the if block and use the assertion "
251
+ " above it instead.\n " );
250
252
#endif
251
- // I(Inou_firrtl::glob_info.module_var2vec_size.find(module_name) != Inou_firrtl::glob_info.module_var2vec_size.end());
253
+ // I(Inou_firrtl::glob_info.module_var2vec_size.find(module_name) != Inou_firrtl::glob_info.module_var2vec_size.end());
252
254
if (Inou_firrtl::glob_info.module_var2vec_size .find (module_name) == Inou_firrtl::glob_info.module_var2vec_size .end ()) {
253
255
return 1 ;
254
256
}
@@ -329,7 +331,7 @@ void Inou_firrtl_module::handle_register(Lnast& lnast, const firrtl::FirrtlPB_Ty
329
331
= reg_bits > 0 ? true
330
332
: false ; // some chirrtl code don't have bits set on register, but must have bits set on init expression
331
333
auto diff_type = type.type_case () != firrtl::FirrtlPB_Type::kUintType ;
332
- // setup_scalar_bits(lnast, absl::StrCat("#", id), reg_bits, parent_node, diff_type, stmt);
334
+ // setup_scalar_bits(lnast, absl::StrCat("#", id), reg_bits, parent_node, diff_type, stmt);
333
335
setup_scalar_bits (lnast, id, reg_bits, parent_node, diff_type, stmt);
334
336
335
337
setup_register_reset_init (lnast,
@@ -2276,7 +2278,7 @@ void Inou_firrtl_module::setup_register_q_pin(Lnast& lnast, Lnast_nid& parent_no
2276
2278
fname = subtrngs[0 ];
2277
2279
}
2278
2280
2279
- // auto flop_qpin_var = absl::StrCat("_#_", reg_name, "_q");
2281
+ // auto flop_qpin_var = absl::StrCat("_#_", reg_name, "_q");
2280
2282
auto flop_qpin_var = absl::StrCat (" _#_" , reg_name, " _q" );
2281
2283
auto idx_asg2 = lnast.add_child (parent_node, Lnast_node::create_assign (" " , 0 , line_pos, col_pos, fname));
2282
2284
lnast.add_child (idx_asg2, Lnast_node::create_ref (flop_qpin_var, 0 , line_pos, col_pos, fname));
@@ -2299,8 +2301,8 @@ void Inou_firrtl_module::declare_register(Lnast& lnast, Lnast_nid& parent_node,
2299
2301
fname = subtrngs[0 ];
2300
2302
}
2301
2303
2302
- auto idx_attget = lnast.add_child (parent_node, Lnast_node::create_attr_get (" " , 0 , line_pos, col_pos, fname));
2303
- // auto full_register_name = absl::StrCat("#", reg_name);
2304
+ auto idx_attget = lnast.add_child (parent_node, Lnast_node::create_attr_get (" " , 0 , line_pos, col_pos, fname));
2305
+ // auto full_register_name = absl::StrCat("#", reg_name);
2304
2306
auto full_register_name = reg_name;
2305
2307
auto tmp_var_str = create_tmp_var ();
2306
2308
lnast.add_child (idx_attget, Lnast_node::create_ref (tmp_var_str, 0 , line_pos, col_pos, fname));
@@ -2346,7 +2348,7 @@ void Inou_firrtl_module::setup_register_reset_init(Lnast& lnast, Lnast_nid& pare
2346
2348
}
2347
2349
2348
2350
if (!value_node.is_invalid ()) {
2349
- // create_tuple_add_from_str(lnast, parent_node, absl::StrCat("#", reg_raw_name, ".__reset_pin"), value_node, stmt);
2351
+ // create_tuple_add_from_str(lnast, parent_node, absl::StrCat("#", reg_raw_name, ".__reset_pin"), value_node, stmt);
2350
2352
create_tuple_add_from_str (lnast, parent_node, absl::StrCat (reg_raw_name, " .__reset_pin" ), value_node, stmt);
2351
2353
}
2352
2354
@@ -2363,7 +2365,7 @@ void Inou_firrtl_module::setup_register_reset_init(Lnast& lnast, Lnast_nid& pare
2363
2365
2364
2366
if (!bits_set_done) {
2365
2367
auto bits = inite.uint_literal ().width ().value ();
2366
- // setup_scalar_bits(lnast, absl::StrCat("#", reg_raw_name), bits, parent_node, false, stmt);
2368
+ // setup_scalar_bits(lnast, absl::StrCat("#", reg_raw_name), bits, parent_node, false, stmt);
2367
2369
setup_scalar_bits (lnast, reg_raw_name, bits, parent_node, false , stmt);
2368
2370
}
2369
2371
} else if (inite_case == firrtl::FirrtlPB_Expression::kSintLiteral ) {
@@ -2372,7 +2374,7 @@ void Inou_firrtl_module::setup_register_reset_init(Lnast& lnast, Lnast_nid& pare
2372
2374
2373
2375
if (!bits_set_done) {
2374
2376
auto bits = inite.uint_literal ().width ().value ();
2375
- // setup_scalar_bits(lnast, absl::StrCat("#", reg_raw_name), bits, parent_node, true, stmt);
2377
+ // setup_scalar_bits(lnast, absl::StrCat("#", reg_raw_name), bits, parent_node, true, stmt);
2376
2378
setup_scalar_bits (lnast, reg_raw_name, bits, parent_node, true , stmt);
2377
2379
}
2378
2380
} else if (inite_case == firrtl::FirrtlPB_Expression::kReference ) {
@@ -2390,7 +2392,7 @@ void Inou_firrtl_module::setup_register_reset_init(Lnast& lnast, Lnast_nid& pare
2390
2392
}
2391
2393
2392
2394
if (!initial_node.is_invalid ()) {
2393
- // create_tuple_add_from_str(lnast, parent_node, absl::StrCat("#", reg_raw_name, ".__initial"), initial_node, stmt);
2395
+ // create_tuple_add_from_str(lnast, parent_node, absl::StrCat("#", reg_raw_name, ".__initial"), initial_node, stmt);
2394
2396
create_tuple_add_from_str (lnast, parent_node, absl::StrCat (reg_raw_name, " .__initial" ), initial_node, stmt);
2395
2397
}
2396
2398
}
@@ -2795,7 +2797,7 @@ void Inou_firrtl_module::list_statement_info(Lnast& lnast, const firrtl::FirrtlP
2795
2797
Pass::warn (" Warning: commented \" I(false)\" to enable RocketTile LG generation." );
2796
2798
#endif
2797
2799
Pass::warn (" Unknown statement type: {}, at line {} in file {}" , (int )stmt.statement_case (), line_pos, fname);
2798
- // I(false);
2800
+ // I(false);
2799
2801
return ;
2800
2802
}
2801
2803
// TODO: Attach source info into node creation (line #, col #).
0 commit comments