From 2a53255445310f7079e8658d4c5936364adbdae2 Mon Sep 17 00:00:00 2001 From: Larry Doolittle Date: Mon, 23 Mar 2009 19:02:45 -0700 Subject: [PATCH] Add support for virtual reg arrays to tgt-stub This patch adds support for virtualized register arrays to the tgt-stub back end. Based Cary's patch, but with a slightly different style. Both work fine. --- t-dll-api.cc | 3 ++- tgt-stub/stub.c | 12 +++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/t-dll-api.cc b/t-dll-api.cc index 9b3cae302..46e261b93 100644 --- a/t-dll-api.cc +++ b/t-dll-api.cc @@ -1897,7 +1897,8 @@ extern "C" ivl_nexus_t ivl_signal_nex(ivl_signal_t net, unsigned word) if (net->pins) { return net->pins[word]; } else { - cerr << "AACK! ivl_signal_nex() returning NULL" << endl; + // net->pins can be NULL for a virtualized reg array. + assert(net->type_ == IVL_SIT_REG); return NULL; } } else { diff --git a/tgt-stub/stub.c b/tgt-stub/stub.c index 520189f26..98723b0a8 100644 --- a/tgt-stub/stub.c +++ b/tgt-stub/stub.c @@ -1272,15 +1272,21 @@ static void show_signal(ivl_signal_t net) ivl_nexus_t nex = ivl_signal_nex(net, idx); - fprintf(out, " %s %s %s%s[%d:%d] %s[word=%u, adr=%d] nexus=%p\n", + fprintf(out, " %s %s %s%s[%d:%d] %s[word=%u, adr=%d] " + " ", type, sign, port, data_type, ivl_signal_msb(net), ivl_signal_lsb(net), ivl_signal_basename(net), idx, ivl_signal_array_base(net)+idx, ivl_signal_width(net), ivl_signal_local(net)? ", local":"", - discipline_txt, - nex); + discipline_txt); + if (nex == NULL) { + fprintf(out, "nexus=\n"); + continue; + } else { + fprintf(out, "nexus=%p\n", nex); + } show_nexus_details(net, nex); }