Trying to get ortree test working

This commit is contained in:
2022-02-21 17:59:41 +01:00
parent 296411da8c
commit 0a5a271409
7 changed files with 103 additions and 9 deletions

View File

@ -37,16 +37,14 @@ export deftype power (bool?! vdd, vss) { }
export template<pint N; pbool invert>
defproc ortree (bool? in[N]; bool out)
export template<pint N>
defproc ortree (bool? in[N]; bool! out; power supply)
{
bool tout;
{ N > 0 : "What?" };
pint i, end, j;
pbool isinv;
isinv = invert;
i = 0;
end = N-1;
@ -81,6 +79,12 @@ defproc ortree (bool? in[N]; bool out)
OR2_X1 C2Els[lenTree2Count];
OR3_X1 C3Els[lenTree3Count];
(h:lenTree2Count:C2Els[h].vdd = supply.vdd;)
(h:lenTree3Count:C3Els[h].vdd = supply.vdd;)
(h:lenTree2Count:C2Els[h].vss = supply.vss;)
(h:lenTree3Count:C3Els[h].vss = supply.vss;)
/* Reset the variables we just stole lol */
i = 0;
end = N-1;
@ -137,16 +141,14 @@ defproc ortree (bool? in[N]; bool out)
* Build a completion tree using a combination of 2-input and 3-input
* C-elements
*/
export template<pint N; pbool invert>
defproc ctree (bool? in[N]; bool out)
export template<pint N>
defproc ctree (bool? in[N]; bool! out; power supply)
{
bool tout;
{ N > 0 : "What?" };
pint i, end, j;
pbool isinv;
isinv = invert;
i = 0;
end = N-1;
@ -170,7 +172,6 @@ defproc ctree (bool? in[N]; bool out)
/*-- update range that has to be combined --*/
i = end+1;
end = end+j;
j = 0;
]
/* array that holds ALL the nodes in the completion tree */
@ -181,6 +182,12 @@ defproc ctree (bool? in[N]; bool out)
A_2C_B_X1 C2Els[lenTree2Count];
A_3C_B_X1 C3Els[lenTree3Count];
(h:lenTree2Count:C2Els[h].vdd = supply.vdd;)
(h:lenTree3Count:C3Els[h].vdd = supply.vdd;)
(h:lenTree2Count:C2Els[h].vss = supply.vss;)
(h:lenTree3Count:C3Els[h].vss = supply.vss;)
/* Reset the variables we just stole lol */
i = 0;
end = N-1;