Fix GitHub issue #356 - use pull strength for tri0/tri1 tie-offs.
When connecting module inout ports, an island is created. If there
is no other driver on one of the island ports, a tie-off is added.
In the case of a tri0 or tri1 net, this must have the correct (pull)
drive strength.
(cherry picked from commit 9d15b771b1)
This commit is contained in:
parent
f6c2b79608
commit
fabdf42365
|
|
@ -651,14 +651,15 @@ static void draw_net_input_x(ivl_nexus_t nex,
|
||||||
0.0 into the net. */
|
0.0 into the net. */
|
||||||
if (ndrivers == 0) {
|
if (ndrivers == 0) {
|
||||||
unsigned wid = width_of_nexus(nex);
|
unsigned wid = width_of_nexus(nex);
|
||||||
|
int pull = (res == IVL_SIT_TRI0) || (res == IVL_SIT_TRI1);
|
||||||
/* For real nets put 0.0. */
|
/* For real nets put 0.0. */
|
||||||
if (signal_data_type_of_nexus(nex) == IVL_VT_REAL) {
|
if (signal_data_type_of_nexus(nex) == IVL_VT_REAL) {
|
||||||
nex_private = draw_Cr_to_string(0.0);
|
nex_private = draw_Cr_to_string(0.0);
|
||||||
} else {
|
} else {
|
||||||
unsigned jdx;
|
unsigned jdx;
|
||||||
char*tmp = malloc(wid + 5);
|
char*tmp = malloc((pull ? 3 : 1) * wid + 5);
|
||||||
nex_private = tmp;
|
nex_private = tmp;
|
||||||
strcpy(tmp, "C4<");
|
strcpy(tmp, pull ? "C8<" : "C4<");
|
||||||
tmp += strlen(tmp);
|
tmp += strlen(tmp);
|
||||||
switch (res) {
|
switch (res) {
|
||||||
case IVL_SIT_TRI:
|
case IVL_SIT_TRI:
|
||||||
|
|
@ -669,12 +670,18 @@ static void draw_net_input_x(ivl_nexus_t nex,
|
||||||
*tmp++ = 'z';
|
*tmp++ = 'z';
|
||||||
break;
|
break;
|
||||||
case IVL_SIT_TRI0:
|
case IVL_SIT_TRI0:
|
||||||
for (jdx = 0 ; jdx < wid ; jdx += 1)
|
for (jdx = 0 ; jdx < wid ; jdx += 1) {
|
||||||
|
*tmp++ = '5';
|
||||||
|
*tmp++ = '5';
|
||||||
*tmp++ = '0';
|
*tmp++ = '0';
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case IVL_SIT_TRI1:
|
case IVL_SIT_TRI1:
|
||||||
for (jdx = 0 ; jdx < wid ; jdx += 1)
|
for (jdx = 0 ; jdx < wid ; jdx += 1) {
|
||||||
|
*tmp++ = '5';
|
||||||
|
*tmp++ = '5';
|
||||||
*tmp++ = '1';
|
*tmp++ = '1';
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
assert(0);
|
assert(0);
|
||||||
|
|
@ -687,8 +694,13 @@ static void draw_net_input_x(ivl_nexus_t nex,
|
||||||
to do this so that .nets have something to hang onto. */
|
to do this so that .nets have something to hang onto. */
|
||||||
char buf[64];
|
char buf[64];
|
||||||
snprintf(buf, sizeof buf, "o%p", nex);
|
snprintf(buf, sizeof buf, "o%p", nex);
|
||||||
fprintf(vvp_out, "%s .functor BUFZ %u, %s; HiZ drive\n",
|
if (pull) {
|
||||||
buf, wid, nex_private);
|
fprintf(vvp_out, "%s .functor BUFT %u, %s, C4<0>, C4<0>, C4<0>; pull drive\n",
|
||||||
|
buf, wid, nex_private);
|
||||||
|
} else {
|
||||||
|
fprintf(vvp_out, "%s .functor BUFZ %u, %s; HiZ drive\n",
|
||||||
|
buf, wid, nex_private);
|
||||||
|
}
|
||||||
nex_private = realloc(nex_private, strlen(buf)+1);
|
nex_private = realloc(nex_private, strlen(buf)+1);
|
||||||
strcpy(nex_private, buf);
|
strcpy(nex_private, buf);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue