Skip to content

Commit e262b2a

Browse files
committed
TimingGraph builder: write triggering edge info to TimingGraph
Signed-off-by: Pawel Czarnecki <pczarnecki@antmicro.com>
1 parent 955983d commit e262b2a

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

vpr/src/timing/timing_graph_builder.cpp

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,10 @@ void TimingGraphBuilder::add_io_to_timing_graph(const AtomBlockId blk) {
351351
}
352352
}
353353

354-
NodeId tnode = tg_->add_node(node_type);
354+
AtomPortId port = netlist_.pin_port(pin);
355+
const t_model_ports* model_port = netlist_.port_model(port);
356+
357+
NodeId tnode = tg_->add_node(node_type, model_port->trigg_edge);
355358

356359
netlist_lookup_.set_atom_pin_tnode(pin, tnode, BlockTnode::EXTERNAL);
357360
}
@@ -413,21 +416,21 @@ std::set<tatum::NodeId> TimingGraphBuilder::create_block_timing_nodes(const Atom
413416
VTR_ASSERT(!model_port->is_clock);
414417
if (model_port->clock.empty()) {
415418
//No clock => combinational input
416-
tnode = tg_->add_node(NodeType::IPIN);
419+
tnode = tg_->add_node(NodeType::IPIN, model_port->trigg_edge);
417420

418421
//A combinational pin is really both internal and external, mark it internal here
419422
//and external in the default case below
420423
netlist_lookup_.set_atom_pin_tnode(input_pin, tnode, BlockTnode::INTERNAL);
421424
} else {
422425
//This is a sequential data input (i.e. a sequential data capture point/timing path end-point)
423-
tnode = tg_->add_node(NodeType::SINK);
426+
tnode = tg_->add_node(NodeType::SINK, model_port->trigg_edge);
424427

425428
if (!model_port->combinational_sink_ports.empty()) {
426429
//There is an internal combinational connection starting at this sequential input
427430
//pin. This is a new timing path and hence we must create a new SOURCE node.
428431

429432
//Create the internal source
430-
NodeId internal_tnode = tg_->add_node(NodeType::SOURCE);
433+
NodeId internal_tnode = tg_->add_node(NodeType::SOURCE, model_port->trigg_edge);
431434
netlist_lookup_.set_atom_pin_tnode(input_pin, internal_tnode, BlockTnode::INTERNAL);
432435
}
433436
}
@@ -452,7 +455,7 @@ std::set<tatum::NodeId> TimingGraphBuilder::create_block_timing_nodes(const Atom
452455
VTR_ASSERT(model_port->is_clock);
453456
VTR_ASSERT(model_port->clock.empty());
454457

455-
NodeId tnode = tg_->add_node(NodeType::CPIN);
458+
NodeId tnode = tg_->add_node(NodeType::CPIN, model_port->trigg_edge);
456459

457460
netlist_lookup_.set_atom_pin_tnode(clock_pin, tnode, BlockTnode::EXTERNAL);
458461
}
@@ -468,7 +471,7 @@ std::set<tatum::NodeId> TimingGraphBuilder::create_block_timing_nodes(const Atom
468471
NodeId tnode;
469472
if (is_netlist_clock_source(output_pin)) {
470473
//A generated clock source
471-
tnode = tg_->add_node(NodeType::SOURCE);
474+
tnode = tg_->add_node(NodeType::SOURCE, model_port->trigg_edge);
472475

473476
clock_generator_tnodes.insert(tnode);
474477

@@ -488,7 +491,7 @@ std::set<tatum::NodeId> TimingGraphBuilder::create_block_timing_nodes(const Atom
488491

489492
if (model_port->clock.empty()) {
490493
//No clock => combinational output
491-
tnode = tg_->add_node(NodeType::OPIN);
494+
tnode = tg_->add_node(NodeType::OPIN, model_port->trigg_edge);
492495

493496
//A combinational pin is really both internal and external, mark it internal here
494497
//and external in the default case below
@@ -497,13 +500,13 @@ std::set<tatum::NodeId> TimingGraphBuilder::create_block_timing_nodes(const Atom
497500
} else {
498501
VTR_ASSERT(!model_port->clock.empty());
499502
//Has an associated clock => sequential output
500-
tnode = tg_->add_node(NodeType::SOURCE);
503+
tnode = tg_->add_node(NodeType::SOURCE, model_port->trigg_edge);
501504

502505
if (output_ports_used_as_combinational_sinks.count(model_port->name)) {
503506
//There is a combinational path within the primitive terminating at this sequential output
504507

505508
//Create the internal sink node
506-
NodeId internal_tnode = tg_->add_node(NodeType::SINK);
509+
NodeId internal_tnode = tg_->add_node(NodeType::SINK, model_port->trigg_edge);
507510
netlist_lookup_.set_atom_pin_tnode(output_pin, internal_tnode, BlockTnode::INTERNAL);
508511
}
509512
}

0 commit comments

Comments
 (0)