Skip to content

Commit cd6ff36

Browse files
committed
vpr: base: atom_netlist_utils: add support for printing netlist with falling edge clocked FFs as blif
Signed-off-by: Pawel Czarnecki <pczarnecki@antmicro.com>
1 parent ca6ece0 commit cd6ff36

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

vpr/src/base/atom_netlist_utils.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,16 @@ void print_netlist_as_blif(FILE* f, const AtomNetlist& netlist) {
189189
clk_net = make_unconn(unconn_count, PinType::SINK);
190190
}
191191

192-
//Latch type: VPR always assumes rising edge
193-
auto type = "re";
192+
//Latch type
193+
auto type = "xy";
194+
if ((blk_model->name == std::string(MODEL_LATCH)) && (blk_model->inputs[1].is_clock)) {
195+
if (blk_model->inputs[1].trigg_edge == TriggeringEdge::FALLING_EDGE) {
196+
type = "fe";
197+
} else {
198+
//Always assume rising edge
199+
type = "re";
200+
}
201+
}
194202

195203
//Latch initial value
196204
int init_val = 3; //Unkown or unspecified

0 commit comments

Comments
 (0)