summaryrefslogtreecommitdiff
path: root/src/intersim/outputset.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/intersim/outputset.hpp')
-rw-r--r--src/intersim/outputset.hpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/intersim/outputset.hpp b/src/intersim/outputset.hpp
new file mode 100644
index 0000000..ad8d2ad
--- /dev/null
+++ b/src/intersim/outputset.hpp
@@ -0,0 +1,36 @@
+#ifndef _OUTPUTSET_HPP_
+#define _OUTPUTSET_HPP_
+
+#include <queue>
+#include <list>
+
+class OutputSet {
+ int _num_outputs;
+
+ struct sSetElement {
+ int vc_start;
+ int vc_end;
+ int pri;
+ };
+
+ list<sSetElement> *_outputs;
+
+public:
+ OutputSet( int num_outputs );
+ ~OutputSet( );
+
+ void Clear( );
+ void Add( int output_port, int vc, int pri = 0 );
+ void AddRange( int output_port, int vc_start, int vc_end, int pri = 0 );
+
+ int Size( ) const;
+ bool OutputEmpty( int output_port ) const;
+ int NumVCs( int output_port ) const;
+
+ int GetVC( int output_port, int vc_index, int *pri = 0 ) const;
+ bool GetPortVC( int *out_port, int *out_vc ) const;
+};
+
+#endif
+
+