[core] fixed a few bugs due to the changes in vtr regarding flat router

This commit is contained in:
tangxifan 2023-04-19 11:08:18 +08:00
parent ffca43266f
commit a84cc52d7c
3 changed files with 18 additions and 14 deletions

View File

@ -208,14 +208,14 @@ int annotate_simulation_setting(
* - MUST mention in documentation that VPR should be run in timing
* enabled mode
*/
ClbNetPinsMatrix<float> net_delay =
make_net_pins_matrix<float>(cluster_ctx.clb_nlist);
NetPinsMatrix<float> net_delay =
make_net_pins_matrix<float>((const Netlist<>&)cluster_ctx.clb_nlist);
/* Load the net delays */
load_net_delay_from_routing(net_delay);
load_net_delay_from_routing((const Netlist<>&)cluster_ctx.clb_nlist, net_delay, false);
/* Do final timing analysis */
auto analysis_delay_calc = std::make_shared<AnalysisDelayCalculator>(
atom_ctx.nlist, atom_ctx.lookup, net_delay);
atom_ctx.nlist, atom_ctx.lookup, net_delay, false);
auto timing_info = make_setup_hold_timing_info(analysis_delay_calc,
e_timing_update_type::FULL);
timing_info->update();

View File

@ -22,12 +22,12 @@ void annotate_vpr_rr_node_nets(const DeviceContext& device_ctx,
const RoutingContext& routing_ctx,
VprRoutingAnnotation& vpr_routing_annotation,
const bool& verbose) {
vtr::vector<RRNodeId, ClusterNetId> node2net = annotate_rr_node_nets(
device_ctx, clustering_ctx, routing_ctx, verbose, false);
vtr::vector<RRNodeId, ParentNetId> node2net = annotate_rr_node_nets(
(const Netlist<>&)clustering_ctx.clb_nlist, device_ctx, routing_ctx, verbose, false);
for (size_t node_id = 0; node_id < device_ctx.rr_graph.num_nodes();
++node_id) {
vpr_routing_annotation.set_rr_node_net(RRNodeId(node_id),
node2net[RRNodeId(node_id)]);
convert_to_cluster_net_id(node2net[RRNodeId(node_id)]));
}
VTR_LOG("Loaded node-to-net mapping\n");
}

View File

@ -118,16 +118,17 @@ static int vpr_standalone(int argc, char** argv) {
/* Read options, architecture, and circuit netlist */
vpr_init(argc, const_cast<const char**>(argv), &Options, &vpr_setup, &Arch);
const Netlist<>& net_list = vpr_setup.RouterOpts.flat_routing ? (const Netlist<>&)g_vpr_ctx.atom().nlist : (const Netlist<>&)g_vpr_ctx.clustering().clb_nlist;
if (Options.show_version) {
vpr_free_all(Arch, vpr_setup);
vpr_free_all(net_list, Arch, vpr_setup);
return SUCCESS_EXIT_CODE;
}
bool flow_succeeded = vpr_flow(vpr_setup, Arch);
if (!flow_succeeded) {
VTR_LOG("VPR failed to implement circuit\n");
vpr_free_all(Arch, vpr_setup);
vpr_free_all(net_list, Arch, vpr_setup);
return UNIMPLEMENTABLE_EXIT_CODE;
}
@ -135,31 +136,34 @@ static int vpr_standalone(int argc, char** argv) {
print_timing_stats("Flow", timing_ctx.stats);
/* free data structures */
vpr_free_all(Arch, vpr_setup);
vpr_free_all(net_list, Arch, vpr_setup);
VTR_LOG("VPR succeeded\n");
} catch (const tatum::Error& tatum_error) {
VTR_LOG_ERROR("%s\n", format_tatum_error(tatum_error).c_str());
vpr_free_all(Arch, vpr_setup);
const Netlist<>& net_list = vpr_setup.RouterOpts.flat_routing ? (const Netlist<>&)g_vpr_ctx.atom().nlist : (const Netlist<>&)g_vpr_ctx.clustering().clb_nlist;
vpr_free_all(net_list, Arch, vpr_setup);
return ERROR_EXIT_CODE;
} catch (const VprError& vpr_error) {
vpr_print_error(vpr_error);
const Netlist<>& net_list = vpr_setup.RouterOpts.flat_routing ? (const Netlist<>&)g_vpr_ctx.atom().nlist : (const Netlist<>&)g_vpr_ctx.clustering().clb_nlist;
if (vpr_error.type() == VPR_ERROR_INTERRUPTED) {
vpr_free_all(Arch, vpr_setup);
vpr_free_all(net_list, Arch, vpr_setup);
return INTERRUPTED_EXIT_CODE;
} else {
vpr_free_all(Arch, vpr_setup);
vpr_free_all(net_list, Arch, vpr_setup);
return ERROR_EXIT_CODE;
}
} catch (const vtr::VtrError& vtr_error) {
VTR_LOG_ERROR("%s:%d %s\n", vtr_error.filename_c_str(), vtr_error.line(),
vtr_error.what());
vpr_free_all(Arch, vpr_setup);
const Netlist<>& net_list = vpr_setup.RouterOpts.flat_routing ? (const Netlist<>&)g_vpr_ctx.atom().nlist : (const Netlist<>&)g_vpr_ctx.clustering().clb_nlist;
vpr_free_all(net_list, Arch, vpr_setup);
return ERROR_EXIT_CODE;
}