added N=1 cases

This commit is contained in:
alexmadison 2022-03-03 17:05:56 +01:00
parent f7cd7006d0
commit da5948f493
1 changed files with 21 additions and 0 deletions

View File

@ -48,6 +48,9 @@ defproc ortree (bool? in[N]; bool! out; power supply)
{ N > 0 : "What?" };
[N = 1 -> BUF_X1 b(.vss=supply.vss, .vdd = supply.vdd, .a = in[0], .y = out);
[] N > 1 ->
pint i, end, j;
i = 0;
end = N-1;
@ -148,6 +151,8 @@ defproc ortree (bool? in[N]; bool! out; power supply)
]
out = tmp[end];
]
}
export template<pint N>
@ -157,6 +162,11 @@ defproc andtree (bool? in[N]; bool! out; power supply)
{ N > 0 : "What?" };
[N = 1 -> BUF_X1 b(.vss=supply.vss, .vdd = supply.vdd, .a = in[0], .y = out);
[] N > 1 ->
pint i, end, j;
i = 0;
end = N-1;
@ -257,6 +267,8 @@ defproc andtree (bool? in[N]; bool! out; power supply)
]
out = tmp[end];
]
}
/*
@ -270,6 +282,10 @@ defproc ctree (bool? in[N]; bool! out; power supply)
{ N > 0 : "What?" };
bool meaningless_var;
[N = 1 -> BUF_X1 b(.vss=supply.vss, .vdd = supply.vdd, .a = in[0], .y = out);
[] N > 1 ->
pint i, end, j;
i = 0;
end = N-1;
@ -374,6 +390,11 @@ defproc ctree (bool? in[N]; bool! out; power supply)
out = tmp[end];
]
}
export template<pint N>