CGRA-ME
Public Types | Public Member Functions | Private Attributes | Friends | List of all members
BitStream Class Reference

#include <CGRA.h>

Public Types

using BitArray = std::vector< std::vector< BitSetting > >
 

Public Member Functions

void append (const ConfigCell *ccell, const BitArray &bits, int con_used=0)
 
void printTestbench (std::ostream &os, const int &II, bool is_elastic=false) const
 
const BitArraysettingFor (const ConfigCell *cc) const
 
auto & ccellOrder () const
 

Private Attributes

std::unordered_map< const ConfigCell *, BitArraysetting_storage = {}
 
std::vector< const ConfigCell * > ccell_order = {}
 
std::unordered_map< const ConfigCell *, int > contexts_used = {}
 

Friends

std::ostream & operator<< (std::ostream &os, const BitStream &bs)
 

Detailed Description

Represents a configuration bitstream. Provides storage for BitSettings, and an order among ConfigCells

Definition at line 34 of file CGRA.h.

Member Typedef Documentation

◆ BitArray

using BitStream::BitArray = std::vector<std::vector<BitSetting> >

Definition at line 37 of file CGRA.h.

Member Function Documentation

◆ append()

void BitStream::append ( const ConfigCell ccell,
const BitArray bits,
int  con_used = 0 
)

Add the given bits to the configuration database, and place ccell at the end of the ConfigCell order.

Definition at line 19 of file BitStream.cpp.

◆ ccellOrder()

auto& BitStream::ccellOrder ( ) const
inline

The ordering among the ConfigCells.

Definition at line 60 of file CGRA.h.

◆ printTestbench()

void BitStream::printTestbench ( std::ostream &  os,
const int &  II,
bool  is_elastic = false 
) const

Prints out a Verilog file intended to help with creating a testbench for the CGRA.

Bitstream is given all the bits for an element at once. Bits are given in order from last cycle to first cycle. From last bit to first bit.

Definition at line 44 of file BitStream.cpp.

◆ settingFor()

const BitArray& BitStream::settingFor ( const ConfigCell cc) const
inline

Get the configuration for a particular ConfigCell throws if it does not exist.

Definition at line 55 of file CGRA.h.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const BitStream bs 
)
friend

Print the bitstream in a human-friendly way.

Prints out the bit settings for each element. For each element, the bit setting is printed from cycle 0 to II, from first bit to last bit

Definition at line 28 of file BitStream.cpp.

Member Data Documentation

◆ ccell_order

std::vector<const ConfigCell*> BitStream::ccell_order = {}
private

Definition at line 69 of file CGRA.h.

◆ contexts_used

std::unordered_map<const ConfigCell*, int> BitStream::contexts_used = {}
private

Definition at line 70 of file CGRA.h.

◆ setting_storage

std::unordered_map<const ConfigCell*, BitArray> BitStream::setting_storage = {}
private

Definition at line 68 of file CGRA.h.


The documentation for this class was generated from the following files: