Slight cleanup. Some work ensuring that generated names do not collide may be necessary.
This commit is contained in:
parent
219ca23635
commit
89c698d4ea
|
|
@ -1109,15 +1109,15 @@ char *new_inverter(char *iname, char *node, Xlatorp xlp)
|
||||||
char *tmp = NULL;
|
char *tmp = NULL;
|
||||||
Xlatep xdata = NULL;
|
Xlatep xdata = NULL;
|
||||||
|
|
||||||
tmp = tprintf("a%s_%s %s not_%s_%s d_zero_inv99",
|
tmp = tprintf("a%s_%s %s not_a%s_%s d_zero_inv99",
|
||||||
iname, node, node, iname, node);
|
iname, node, node, iname, node);
|
||||||
/* instantiate the new inverter */
|
/* instantiate the new inverter */
|
||||||
/* e.g. au5_s1bar s1bar not_u5_s1bar d_zero_inv99 */
|
/* e.g. au5_s1bar s1bar not_au5_s1bar d_zero_inv99 */
|
||||||
xdata = create_xlate_translated(tmp);
|
xdata = create_xlate_translated(tmp);
|
||||||
(void) add_xlator(xlp, xdata);
|
(void) add_xlator(xlp, xdata);
|
||||||
tfree(tmp);
|
tfree(tmp);
|
||||||
/* the name of the inverter output */
|
/* the name of the inverter output */
|
||||||
tmp = tprintf("not_%s_%s", iname, node);
|
tmp = tprintf("not_a%s_%s", iname, node);
|
||||||
return tmp;
|
return tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1200,7 +1200,7 @@ static Xlatorp gen_dff_instance(struct dff_instance *ip)
|
||||||
clk = ip->clk;
|
clk = ip->clk;
|
||||||
tmodel = ip->tmodel;
|
tmodel = ip->tmodel;
|
||||||
/* model name, same for each dff */
|
/* model name, same for each dff */
|
||||||
modelnm = tprintf("d_a%s%s", iname, itype);
|
modelnm = tprintf("d_a%s_%s", iname, itype);
|
||||||
for (i = 0; i < num_gates; i++) {
|
for (i = 0; i < num_gates; i++) {
|
||||||
qout = qarr[i];
|
qout = qarr[i];
|
||||||
if (strcmp(qout, "$d_nc") == 0) {
|
if (strcmp(qout, "$d_nc") == 0) {
|
||||||
|
|
@ -1275,7 +1275,7 @@ static Xlatorp gen_jkff_instance(struct jkff_instance *ip)
|
||||||
|
|
||||||
tmodel = ip->tmodel;
|
tmodel = ip->tmodel;
|
||||||
/* model name, same for each latch */
|
/* model name, same for each latch */
|
||||||
modelnm = tprintf("d_a%s%s", iname, itype);
|
modelnm = tprintf("d_a%s_%s", iname, itype);
|
||||||
for (i = 0; i < num_gates; i++) {
|
for (i = 0; i < num_gates; i++) {
|
||||||
qout = qarr[i];
|
qout = qarr[i];
|
||||||
if (strcmp(qout, "$d_nc") == 0) {
|
if (strcmp(qout, "$d_nc") == 0) {
|
||||||
|
|
@ -1342,7 +1342,7 @@ static Xlatorp gen_dltch_instance(struct dltch_instance *ip)
|
||||||
gate = ip->gate;
|
gate = ip->gate;
|
||||||
tmodel = ip->tmodel;
|
tmodel = ip->tmodel;
|
||||||
/* model name, same for each latch */
|
/* model name, same for each latch */
|
||||||
modelnm = tprintf("d_a%s%s", iname, itype);
|
modelnm = tprintf("d_a%s_%s", iname, itype);
|
||||||
for (i = 0; i < num_gates; i++) {
|
for (i = 0; i < num_gates; i++) {
|
||||||
qout = qarr[i];
|
qout = qarr[i];
|
||||||
if (strcmp(qout, "$d_nc") == 0) {
|
if (strcmp(qout, "$d_nc") == 0) {
|
||||||
|
|
@ -1423,7 +1423,7 @@ static Xlatorp gen_compound_instance(struct compound_instance *compi)
|
||||||
num_gates = compi->num_gates;
|
num_gates = compi->num_gates;
|
||||||
output = compi->output;
|
output = compi->output;
|
||||||
tmodel = compi->tmodel;
|
tmodel = compi->tmodel;
|
||||||
model_name = tprintf("d_%s%s", inst, itype);
|
model_name = tprintf("d_%s_%s", inst, itype);
|
||||||
connector = TMALLOC(char *, num_gates);
|
connector = TMALLOC(char *, num_gates);
|
||||||
xxp = create_xlator();
|
xxp = create_xlator();
|
||||||
k = 0;
|
k = 0;
|
||||||
|
|
@ -1437,7 +1437,7 @@ static Xlatorp gen_compound_instance(struct compound_instance *compi)
|
||||||
tmp[0] = '\0';
|
tmp[0] = '\0';
|
||||||
k = 0;
|
k = 0;
|
||||||
for (i = 0; i < num_gates; i++) {
|
for (i = 0; i < num_gates; i++) {
|
||||||
connector[i] = tprintf("con%s_%d", inst, i);
|
connector[i] = tprintf("con_%s_%d", inst, i);
|
||||||
num_ins_kept = 0;
|
num_ins_kept = 0;
|
||||||
tmp[0] = '\0';
|
tmp[0] = '\0';
|
||||||
/* $d_hi AND gate inputs are ignored */
|
/* $d_hi AND gate inputs are ignored */
|
||||||
|
|
@ -1599,7 +1599,7 @@ static Xlatorp gen_gate_instance(struct gate_instance *gip)
|
||||||
connector = tprintf("a%s_%s", iname, outarr[0]);
|
connector = tprintf("a%s_%s", iname, outarr[0]);
|
||||||
|
|
||||||
/* keep a copy of the model name of original gate */
|
/* keep a copy of the model name of original gate */
|
||||||
modelnm = tprintf("d_a%s%s", iname, itype);
|
modelnm = tprintf("d_a%s_%s", iname, itype);
|
||||||
|
|
||||||
if (!add_tristate) {
|
if (!add_tristate) {
|
||||||
char *instance_stmt = NULL;
|
char *instance_stmt = NULL;
|
||||||
|
|
@ -1644,7 +1644,7 @@ static Xlatorp gen_gate_instance(struct gate_instance *gip)
|
||||||
tfree(new_stmt);
|
tfree(new_stmt);
|
||||||
/* now the added tristate */
|
/* now the added tristate */
|
||||||
/* model name of added tristate */
|
/* model name of added tristate */
|
||||||
new_model_nm = tprintf("d_a%stribuf", iname);
|
new_model_nm = tprintf("d_a%s_tribuf", iname);
|
||||||
new_stmt = tprintf("a%s_tri %s %s %s %s",
|
new_stmt = tprintf("a%s_tri %s %s %s %s",
|
||||||
iname, connector, enable, outarr[0], new_model_nm);
|
iname, connector, enable, outarr[0], new_model_nm);
|
||||||
xdata = create_xlate_instance(new_stmt, "d_tristate",
|
xdata = create_xlate_instance(new_stmt, "d_tristate",
|
||||||
|
|
@ -1701,7 +1701,7 @@ static Xlatorp gen_gate_instance(struct gate_instance *gip)
|
||||||
endvec = "";
|
endvec = "";
|
||||||
}
|
}
|
||||||
/* model name, same for all primary gates */
|
/* model name, same for all primary gates */
|
||||||
primary_model = tprintf("d_a%s%s", iname, itype);
|
primary_model = tprintf("d_a%s_%s", iname, itype);
|
||||||
for (i = 0; i < num_gates; i++) {
|
for (i = 0; i < num_gates; i++) {
|
||||||
/* inputs */
|
/* inputs */
|
||||||
/* First calculate the space */
|
/* First calculate the space */
|
||||||
|
|
@ -1786,7 +1786,7 @@ static Xlatorp gen_gate_instance(struct gate_instance *gip)
|
||||||
tfree(s1);
|
tfree(s1);
|
||||||
}
|
}
|
||||||
/* model name of added tristate */
|
/* model name of added tristate */
|
||||||
modelnm = tprintf("d_a%stribuf", iname);
|
modelnm = tprintf("d_a%s_tribuf", iname);
|
||||||
/*
|
/*
|
||||||
instance name of added tristate, connector,
|
instance name of added tristate, connector,
|
||||||
enable, original primary gate output, timing model.
|
enable, original primary gate output, timing model.
|
||||||
|
|
@ -2639,7 +2639,7 @@ static Xlatorp translate_pull(struct instance_hdr *hdr, char *start)
|
||||||
xspice = find_xspice_for_delay(itype);
|
xspice = find_xspice_for_delay(itype);
|
||||||
newline = TMALLOC(char, strlen(start) + 1);
|
newline = TMALLOC(char, strlen(start) + 1);
|
||||||
(void) memcpy(newline, start, strlen(start) + 1);
|
(void) memcpy(newline, start, strlen(start) + 1);
|
||||||
model_name = tprintf("d_%s%s", iname, itype);
|
model_name = tprintf("d_%s_%s", iname, itype);
|
||||||
for (i = 0; i < numpulls; i++) {
|
for (i = 0; i < numpulls; i++) {
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
tok = strtok(newline, " \t");
|
tok = strtok(newline, " \t");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue