source: icGREP/icgrep-devel/icgrep/kernels/streamset.h @ 5055

Last change on this file since 5055 was 5044, checked in by cameron, 3 years ago

Stream set declaraations and buffers

File size: 1.3 KB
Line 
1/*
2 *  Copyright (c) 2016 International Characters.
3 *  This software is licensed to the public under the Open Software License 3.0.
4 */
5
6#ifndef STREAMSET_H
7#define STREAMSET_H
8
9#include <string>
10#include <vector>
11#include <IDISA/idisa_builder.h>
12#include <llvm/IR/Type.h>
13   
14namespace kernel {
15
16class StreamSetType {
17public:
18    StreamSetType(int count, int width) : mStreamCount(count), mFieldWidth(width) {}
19    int StreamCount() { return mStreamCount;}
20    int StreamFieldWidth() { return mFieldWidth;}
21   
22    llvm::Type * getStreamSetBlockType(IDISA::IDISA_Builder * iBuilder);
23   
24private:
25    int mStreamCount;
26    int mFieldWidth;
27};
28
29class StreamSetBuffer {
30public:
31    StreamSetBuffer(IDISA::IDISA_Builder * b, StreamSetType ss_type, unsigned SegmentSize) :
32    iBuilder(b), mStreamSetType(ss_type), mSegmentSize(SegmentSize), mStreamSetBufferPtr(nullptr) {}
33
34    llvm::Type * getStreamSetBlockType();
35   
36    llvm::Type * getStreamSetBufferType();
37   
38    void setStreamSetBuffer(llvm::Value * ptr) {mStreamSetBufferPtr = ptr;}
39   
40    llvm::Value * allocateBuffer();
41   
42    llvm::Value * getBlockPointer(llvm::Value * blockNo);
43private:
44    IDISA::IDISA_Builder * iBuilder;
45    StreamSetType mStreamSetType;
46    unsigned mSegmentSize;
47    llvm::Value * mStreamSetBufferPtr;
48   
49
50};
51}
52#endif // STREAMSET_H
Note: See TracBrowser for help on using the repository browser.