Skip analog probes in logic-only output formats.

This commit is contained in:
Bert Vermeulen 2013-12-29 10:57:38 +01:00
parent 05c644ea08
commit 3699a8a1ff
6 changed files with 30 additions and 8 deletions

View File

@ -108,6 +108,8 @@ static int init(struct sr_output *o)
/* Get the unitsize. */ /* Get the unitsize. */
for (l = o->sdi->probes; l; l = l->next) { for (l = o->sdi->probes; l; l = l->next) {
probe = l->data; probe = l->data;
if (probe->type != SR_PROBE_LOGIC)
continue;
if (!probe->enabled) if (!probe->enabled)
continue; continue;
ctx->num_enabled_probes++; ctx->num_enabled_probes++;

View File

@ -76,8 +76,11 @@ static int init(struct sr_output *o)
/* Get the number of probes, and the unitsize. */ /* Get the number of probes, and the unitsize. */
for (l = o->sdi->probes; l; l = l->next) { for (l = o->sdi->probes; l; l = l->next) {
probe = l->data; probe = l->data;
if (probe->enabled) if (probe->type != SR_PROBE_LOGIC)
ctx->num_enabled_probes++; continue;
if (!probe->enabled)
continue;
ctx->num_enabled_probes++;
} }
ctx->unitsize = (ctx->num_enabled_probes + 7) / 8; ctx->unitsize = (ctx->num_enabled_probes + 7) / 8;
@ -107,8 +110,11 @@ static int init(struct sr_output *o)
ctx->num_enabled_probes, num_probes); ctx->num_enabled_probes, num_probes);
for (l = o->sdi->probes; l; l = l->next) { for (l = o->sdi->probes; l; l = l->next) {
probe = l->data; probe = l->data;
if (probe->enabled) if (probe->type != SR_PROBE_LOGIC)
g_string_append_printf(ctx->header, "%s, ", probe->name); continue;
if (!probe->enabled)
continue;
g_string_append_printf(ctx->header, "%s, ", probe->name);
} }
g_string_append_printf(ctx->header, "\n"); g_string_append_printf(ctx->header, "\n");

View File

@ -80,8 +80,11 @@ static int init(struct sr_output *o)
ctx->num_enabled_probes = 0; ctx->num_enabled_probes = 0;
for (l = o->sdi->probes; l; l = l->next) { for (l = o->sdi->probes; l; l = l->next) {
probe = l->data; probe = l->data;
if (probe->enabled) if (probe->type != SR_PROBE_LOGIC)
ctx->num_enabled_probes++; continue;
if (!probe->enabled)
continue;
ctx->num_enabled_probes++;
} }
ctx->unitsize = (ctx->num_enabled_probes + 7) / 8; ctx->unitsize = (ctx->num_enabled_probes + 7) / 8;
@ -106,6 +109,8 @@ static int init(struct sr_output *o)
wbuf[0] = '\0'; wbuf[0] = '\0';
for (i = 0, l = o->sdi->probes; l; l = l->next, i++) { for (i = 0, l = o->sdi->probes; l; l = l->next, i++) {
probe = l->data; probe = l->data;
if (probe->type != SR_PROBE_LOGIC)
continue;
if (!probe->enabled) if (!probe->enabled)
continue; continue;
c = (char *)&wbuf + strlen((const char *)&wbuf); c = (char *)&wbuf + strlen((const char *)&wbuf);

View File

@ -71,8 +71,11 @@ static GString *gen_header(const struct sr_dev_inst *sdi, struct context *ctx)
num_enabled_probes = 0; num_enabled_probes = 0;
for (l = sdi->probes; l; l = l->next) { for (l = sdi->probes; l; l = l->next) {
probe = l->data; probe = l->data;
if (probe->enabled) if (probe->type != SR_PROBE_LOGIC)
num_enabled_probes++; continue;
if (!probe->enabled)
continue;
num_enabled_probes++;
} }
s = g_string_sized_new(512); s = g_string_sized_new(512);

View File

@ -92,6 +92,8 @@ SR_PRIV int init(struct sr_output *o, int default_spl, enum outputmode mode)
for (l = o->sdi->probes; l; l = l->next) { for (l = o->sdi->probes; l; l = l->next) {
probe = l->data; probe = l->data;
if (probe->type != SR_PROBE_LOGIC)
continue;
if (!probe->enabled) if (!probe->enabled)
continue; continue;
ctx->probenames = g_slist_append(ctx->probenames, probe->name); ctx->probenames = g_slist_append(ctx->probenames, probe->name);

View File

@ -62,6 +62,8 @@ static int init(struct sr_output *o)
for (l = o->sdi->probes; l; l = l->next) { for (l = o->sdi->probes; l; l = l->next) {
probe = l->data; probe = l->data;
if (probe->type != SR_PROBE_LOGIC)
continue;
if (!probe->enabled) if (!probe->enabled)
continue; continue;
ctx->probeindices = g_array_append_val( ctx->probeindices = g_array_append_val(
@ -124,6 +126,8 @@ static int init(struct sr_output *o)
/* Wires / channels */ /* Wires / channels */
for (i = 0, l = o->sdi->probes; l; l = l->next, i++) { for (i = 0, l = o->sdi->probes; l; l = l->next, i++) {
probe = l->data; probe = l->data;
if (probe->type != SR_PROBE_LOGIC)
continue;
if (!probe->enabled) if (!probe->enabled)
continue; continue;
g_string_append_printf(ctx->header, "$var wire 1 %c %s $end\n", g_string_append_printf(ctx->header, "$var wire 1 %c %s $end\n",