Add basic the .tran device.

The .tran device is simply a .tranif0 without the enable. It is
always enabled.
This commit is contained in:
Stephen Williams 2008-06-01 10:37:41 -07:00
parent 052870c0e5
commit 6f8bf90dc4
2 changed files with 10 additions and 3 deletions

View File

@ -688,6 +688,9 @@ statement
| T_LABEL K_EXPORT T_SYMBOL ';'
{ compile_island_export($1, $3); }
| K_TRAN T_SYMBOL ',' T_SYMBOL T_SYMBOL ';'
{ compile_island_tranif(0, $2, $4, $5, 0); }
| K_TRANIF0 T_SYMBOL ',' T_SYMBOL T_SYMBOL ',' T_SYMBOL ';'
{ compile_island_tranif(0, $2, $4, $5, $7); }

View File

@ -490,14 +490,18 @@ void compile_island_tranif(int sense, char*island, char*pa, char*pb, char*pe)
else
br->active_high = false;
br->en = use_island->find_port(pe);
assert(br->en);
if (pe == 0) {
br->en = 0;
} else {
br->en = use_island->find_port(pe);
assert(br->en);
free(pe);
}
use_island->add_branch(br, pa, pb);
free(pa);
free(pb);
free(pe);
}
void compile_island_cleanup(void)