Adding some missing files into cvs
authorPraveen Kumar Jagadishprasad <jagadish@uiuc.edu>
Sat, 9 Oct 2004 21:06:46 +0000 (21:06 +0000)
committerPraveen Kumar Jagadishprasad <jagadish@uiuc.edu>
Sat, 9 Oct 2004 21:06:46 +0000 (21:06 +0000)
examples/pose/HiSim/InputVcSelection/outputBufferIn.C [new file with mode: 0644]
examples/pose/HiSim/InputVcSelection/outputBufferIn.h [new file with mode: 0644]

diff --git a/examples/pose/HiSim/InputVcSelection/outputBufferIn.C b/examples/pose/HiSim/InputVcSelection/outputBufferIn.C
new file mode 100644 (file)
index 0000000..8a4a667
--- /dev/null
@@ -0,0 +1,20 @@
+#include "outputBufferIn.h"
+int outputBufferIn::selectInputVc(map<int,int> & Bufsize,map<int,int> & requested,map<int, vector <Header> > &inBuffer, const int lastOutputVc) {
+
+       int maxsize = 0,vc = NO_VC_AVAILABLE,outPort = lastOutputVc/config.switchVc;    
+
+// We can provide some sort of QOS for particular virtual channels here
+       if(requested[outPort])
+               return NO_VC_AVAILABLE;
+
+       for(int i=outPort*config.switchVc;i<((outPort+1)*config.switchVc);i++) {
+                if(inBuffer[i].size()) {
+               if(maxsize < inBuffer[i].size()) {
+                       maxsize = inBuffer[i].size();
+                       vc = i;
+               }
+                }
+        }
+
+       return vc;
+}
diff --git a/examples/pose/HiSim/InputVcSelection/outputBufferIn.h b/examples/pose/HiSim/InputVcSelection/outputBufferIn.h
new file mode 100644 (file)
index 0000000..38437a2
--- /dev/null
@@ -0,0 +1,7 @@
+#include "MainInputVcSelection.h"
+
+class outputBufferIn : public InputVcSelection {
+        public:
+        int selectInputVc(map<int,int> & Bufsize,map<int,int> & requested,map<int, vector <Header> > & inBuffer, const int ignore );
+};
+