10
10
#include < fiction/io/print_layout.hpp>
11
11
#include < fiction/io/write_svg_layout.hpp>
12
12
#include < fiction/layouts/coordinates.hpp>
13
- #include < fiction/technology/cell_technologies.hpp>
14
13
#include < fiction/traits.hpp>
15
14
#include < fiction/types.hpp>
16
15
19
18
#include < kitty/print.hpp>
20
19
#include < mockturtle/views/depth_view.hpp>
21
20
21
+ #include < cstdint>
22
+ #include < stdexcept>
22
23
#include < type_traits>
23
24
#include < variant>
24
25
@@ -74,7 +75,7 @@ ALICE_DESCRIBE_STORE(fiction::logic_network_t, ln)
74
75
{
75
76
using Ntk = typename std::decay_t <decltype (ntk_ptr)>::element_type;
76
77
77
- mockturtle::depth_view depth_ntk{*ntk_ptr};
78
+ const mockturtle::depth_view depth_ntk{*ntk_ptr};
78
79
79
80
return fmt::format (" {} ({}) - I/O: {}/{}, gates: {}, level: {}" , ntk_ptr->get_network_name (),
80
81
fiction::ntk_type_name<Ntk>, ntk_ptr->num_pis (), ntk_ptr->num_pos (), ntk_ptr->num_gates (),
@@ -90,7 +91,7 @@ ALICE_PRINT_STORE_STATISTICS(fiction::logic_network_t, os, ln)
90
91
{
91
92
using Ntk = typename std::decay_t <decltype (ntk_ptr)>::element_type;
92
93
93
- mockturtle::depth_view depth_ntk{*ntk_ptr};
94
+ const mockturtle::depth_view depth_ntk{*ntk_ptr};
94
95
95
96
os << fmt::format (" [i] {} ({}) - I/O: {}/{}, gates: {}, level: {}\n " , ntk_ptr->get_network_name (),
96
97
fiction::ntk_type_name<Ntk>, ntk_ptr->num_pis (), ntk_ptr->num_pos (), ntk_ptr->num_gates (),
@@ -106,7 +107,7 @@ ALICE_LOG_STORE_STATISTICS(fiction::logic_network_t, ln)
106
107
{
107
108
using Ntk = typename std::decay_t <decltype (ntk_ptr)>::element_type;
108
109
109
- mockturtle::depth_view depth_ntk{*ntk_ptr};
110
+ const mockturtle::depth_view depth_ntk{*ntk_ptr};
110
111
111
112
return nlohmann::json{{" name" , ntk_ptr->get_network_name ()}, {" type" , fiction::ntk_type_name<Ntk>},
112
113
{" inputs" , ntk_ptr->num_pis ()}, {" outputs" , ntk_ptr->num_pos ()},
@@ -135,7 +136,7 @@ void show<fiction::logic_network_t>(std::ostream& os, const fiction::logic_netwo
135
136
{
136
137
try
137
138
{
138
- mockturtle::depth_view depth_ntk{*ntk_ptr};
139
+ const mockturtle::depth_view depth_ntk{*ntk_ptr};
139
140
140
141
using Ntk = typename std::decay_t <decltype (depth_ntk)>;
141
142
@@ -182,13 +183,12 @@ ALICE_DESCRIBE_STORE(fiction::gate_layout_t, layout)
182
183
num_se = lyt_ptr->num_se ();
183
184
}
184
185
185
- fiction::critical_path_length_and_throughput_stats st{};
186
- fiction::critical_path_length_and_throughput (*lyt_ptr, &st);
186
+ const auto cp_tp = fiction::critical_path_length_and_throughput (*lyt_ptr);
187
187
188
188
return fmt::format (" {} ({}) - {} × {}, I/O: {}/{}, gates: {}, wires: {}, CP: {}, TP: 1/{}, sync. elems.: {}" ,
189
189
lyt_ptr->get_layout_name (), lyt_ptr->get_clocking_scheme ().name , lyt_ptr->x () + 1 ,
190
190
lyt_ptr->y () + 1 , lyt_ptr->num_pis (), lyt_ptr->num_pos (), lyt_ptr->num_gates (),
191
- lyt_ptr->num_wires (), st .critical_path_length , st .throughput , num_se);
191
+ lyt_ptr->num_wires (), cp_tp .critical_path_length , cp_tp .throughput , num_se);
192
192
};
193
193
194
194
return std::visit (describe, layout);
@@ -208,14 +208,13 @@ ALICE_PRINT_STORE_STATISTICS(fiction::gate_layout_t, os, layout)
208
208
num_se = lyt_ptr->num_se ();
209
209
}
210
210
211
- fiction::critical_path_length_and_throughput_stats st{};
212
- fiction::critical_path_length_and_throughput (*lyt_ptr, &st);
211
+ const auto cp_tp = fiction::critical_path_length_and_throughput (*lyt_ptr);
213
212
214
213
os << fmt::format (
215
214
" [i] {} ({}) - {} × {}, I/O: {}/{}, gates: {}, wires: {}, CP: {}, TP: 1/{}, sync. elems.: {}\n " ,
216
215
lyt_ptr->get_layout_name (), lyt_ptr->get_clocking_scheme ().name , lyt_ptr->x () + 1 , lyt_ptr->y () + 1 ,
217
- lyt_ptr->num_pis (), lyt_ptr->num_pos (), lyt_ptr->num_gates (), lyt_ptr->num_wires (), st. critical_path_length ,
218
- st .throughput , num_se);
216
+ lyt_ptr->num_pis (), lyt_ptr->num_pos (), lyt_ptr->num_gates (), lyt_ptr->num_wires (),
217
+ cp_tp. critical_path_length , cp_tp .throughput , num_se);
219
218
};
220
219
221
220
std::visit (print_statistics, layout);
@@ -234,8 +233,7 @@ ALICE_LOG_STORE_STATISTICS(fiction::gate_layout_t, layout)
234
233
num_se = lyt_ptr->num_se ();
235
234
}
236
235
237
- fiction::critical_path_length_and_throughput_stats st{};
238
- fiction::critical_path_length_and_throughput (*lyt_ptr, &st);
236
+ const auto cp_tp = fiction::critical_path_length_and_throughput (*lyt_ptr);
239
237
240
238
return nlohmann::json{
241
239
{" name" , lyt_ptr->get_layout_name ()},
@@ -248,8 +246,8 @@ ALICE_LOG_STORE_STATISTICS(fiction::gate_layout_t, layout)
248
246
// {"free tiles", area - (gate_tiles + wire_tiles - crossings)}, // free tiles in ground layer
249
247
// {"crossings", crossings},
250
248
{" synchronization elements" , num_se},
251
- {" critical path" , st .critical_path_length },
252
- {" throughput" , fmt::format (" 1/{}" , st .throughput )}};
249
+ {" critical path" , cp_tp .critical_path_length },
250
+ {" throughput" , fmt::format (" 1/{}" , cp_tp .throughput )}};
253
251
};
254
252
255
253
return std::visit (log_statistics, layout);
0 commit comments