From 6fc3e4b99c650dd4bf457f50d59d9121d13a05d2 Mon Sep 17 00:00:00 2001 From: alexmadison Date: Thu, 3 Mar 2022 11:56:59 +0100 Subject: [PATCH] removed arbiter tree --- dataflow_neuro/treegates.act | 110 +---------------------------------- 1 file changed, 1 insertion(+), 109 deletions(-) diff --git a/dataflow_neuro/treegates.act b/dataflow_neuro/treegates.act index c1e8294..165939b 100644 --- a/dataflow_neuro/treegates.act +++ b/dataflow_neuro/treegates.act @@ -26,6 +26,7 @@ **************************************************************************/ import "../../dataflow_neuro/cell_lib_async.act"; import "../../dataflow_neuro/cell_lib_std.act"; + import std::channel; open std::channel; namespace tmpl { @@ -419,114 +420,5 @@ defproc sigbuf (bool? in; bool! out[N]; power supply) - -/* - * Build a completion tree using a combination of 2-input and 3-input - * arbiters - */ -export template -defproc arbtree (bool? in[N]; bool! out; power supply) -{ - bool tout; - - { N > 0 : "What?" }; - - pint i, end, j; - i = 0; - end = N-1; - - pint arbCount; - arbCount = 0; - /* Pre"calculate" the number of C cells required, look below if confused */ - *[ i != end -> - j = 0; - *[ i <= end -> - j = j + 1; - [i = end -> - i = end+1; - [] i+1 = end -> - i = end+1; - arbCount = arbCount +1; - [] else -> - i = i + 2; - arbCount = arbCount +1; - ] - ] - /*-- update range that has to be combined --*/ - // i = end+1; - end = end+j; - ] - - /* array that holds ALL the nodes in the completion tree */ - bool tmp[end+1]; - - - // Connecting the first nodes to the input - (l:N: - tmp[l] = in[l]; - ) - - /* array to hold the actual C-elments, either A2C or A3C */ - [arbCount > 0 -> - OR2_X1 arbs[arbCount]; - ] - - - (h:arbCount:arbs[h].vdd = supply.vdd;) - (h:arbCount:arbs[h].vss = supply.vss;) - - /* Reset the variables we just stole lol */ - i = 0; - end = N-1; - j = 0; - pint arbIndex = 0; - - /* Invariant: i <= end */ - - *[ i != end -> - /* - * Invariant: tmp[i..end] has the current signals that need to be - * combined together, and "isinv" specifies if they are the inverted - * sense or not - */ - j = 0; - *[ i <= end -> - /*-- there are still signals that need to be combined --*/ - j = j + 1; - [ i = end -> - /*-- last piece: pipe input through to next layer --*/ - tmp[end+j] = tmp[i]; - i = end+1; - [] i+1 = end -> - /*-- last piece: use either a 2 input C-element --*/ - arbs[arbIndex].a = tmp[i]; - arbs[arbIndex].b = tmp[i+1]; - arbs[arbIndex].y = tmp[end+j]; - arbIndex = arbIndex +1; - i = end+1; - [] else -> - /*-- more to come; so use a two input C-element --*/ - arbs[arbIndex].a = tmp[i]; - arbs[arbIndex].b = tmp[i+1]; - arbs[arbIndex].y = tmp[end+j]; - arbIndex = arbIndex +1; - i = i + 2; - ] - ] - /*-- update range that has to be combined --*/ - i = end+1; - end = end+j; - j = 0; - ] - - out = tmp[end]; - -} - - - - - - }}