From 6411e96193ba582f7846a171b895689435a8c971 Mon Sep 17 00:00:00 2001 From: Stephen Williams Date: Sat, 6 Sep 2008 18:05:18 -0700 Subject: [PATCH] Generate delay devices for sign-extend devices. It is possible for signe-extend to have a delay attached to it. (Same for repeat.) Handle it like other LPM devices, by stuffing a .delay device into the output path of the device, if appropriate. --- design_dump.cc | 10 ++++++++-- tgt-vvp/vvp_scope.c | 10 +++++++--- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/design_dump.cc b/design_dump.cc index 25e61d04e..f17ee9605 100644 --- a/design_dump.cc +++ b/design_dump.cc @@ -567,8 +567,14 @@ void NetReplicate::dump_node(ostream&o, unsigned ind) const void NetSignExtend::dump_node(ostream&o, unsigned ind) const { - o << setw(ind) << "" << "NetSignExtend: " - << name() << " output width=" << width_ << endl; + o << setw(ind) << "" << "NetSignExtend: " << name(); + if (rise_time()) + o << " #(" << *rise_time() + << "," << *fall_time() + << "," << *decay_time() << ")"; + else + o << " #(.,.,.)"; + o << " output width=" << width_ << endl; dump_node_pins(o, ind+4); dump_obj_attr(o, ind+4); } diff --git a/tgt-vvp/vvp_scope.c b/tgt-vvp/vvp_scope.c index 89cc691a9..32780a41d 100644 --- a/tgt-vvp/vvp_scope.c +++ b/tgt-vvp/vvp_scope.c @@ -1650,15 +1650,19 @@ static void draw_lpm_re(ivl_lpm_t net, const char*type) static void draw_lpm_repeat(ivl_lpm_t net) { - fprintf(vvp_out, "L_%p .repeat %u, %u, %s;\n", net, + const char*dly = draw_lpm_output_delay(net); + + fprintf(vvp_out, "L_%p%s .repeat %u, %u, %s;\n", net, dly, ivl_lpm_width(net), ivl_lpm_size(net), draw_net_input(ivl_lpm_data(net,0))); } static void draw_lpm_sign_ext(ivl_lpm_t net) { - fprintf(vvp_out, "L_%p .extend/s %u, %s;\n", - net, ivl_lpm_width(net), + const char*dly = draw_lpm_output_delay(net); + + fprintf(vvp_out, "L_%p%s .extend/s %u, %s;\n", + net, dly, ivl_lpm_width(net), draw_net_input(ivl_lpm_data(net,0))); }