60 return (siteType.compare(
"SLICEM") == 0 ||
61 siteType.compare(
"SLICELO") == 0 || siteType.compare(
"SLICELE") == 0 ||
62 siteType.compare(
"*RAMB36E1") == 0 || siteType.compare(
"*DSP48E1") == 0 ||
64 siteType.compare(
"*BUFR") == 0 || siteType.compare(
"*BUFG") == 0)
70 uint32_t supportedTileIndex = 0;
71 std::vector<std::string> tilesSupported;
75 return tilesSupported;
88 if(referenceBitstreamPtr && primBitstreamPtr) {
89 std::cout <<
"Read the two bit files - " << primaryFile.filename() <<
" and " << referenceFile.filename() <<
" successfully" << std::endl;
91 std::cout <<
"Could not read the bit files " << primaryFile <<
" " << referenceFile << std::endl;
97 boost::shared_ptr<torc::bitstream::Virtex7> primVirtexBitstreamPtr = boost::dynamic_pointer_cast<
torc::bitstream::Virtex7>(
99 boost::shared_ptr<torc::bitstream::Virtex7> refVirtex7BitstreamPtr = boost::dynamic_pointer_cast<
torc::bitstream::Virtex7>(
100 referenceBitstreamPtr);
104 refVirtex7BitstreamPtr->initializeFrameMaps();
105 refVirtex7BitstreamPtr->readFramePackets();
107 primVirtexBitstreamPtr->initializeDeviceInfo(primBitstreamPtr->getDesignName());
108 primVirtexBitstreamPtr->initializeFrameMaps();
109 primVirtexBitstreamPtr->readFramePackets();
116 std::vector<boost::int32_t> combinedAddressVector;
125 if(nullFrameSet.size() != primFrameSet.size()) {
126 std::cout <<
"Frame set sizes do not match" << std::endl;
131 uint32_t relativeFrameIndex = 0, currentMajorIndex = 0, previousMajorIndex = 0;
132 bool firstMismatch =
true;
135 for(uint32_t frameIndex = 0; frameIndex < nullFrameSet.size(); frameIndex++) {
146 + nullFramePtr->getLength();
149 if(nullFramePtr->getLength() != primFramePtr->getLength()) {
150 std::cout <<
"WARNING: Frames of different sizes " << nullFramePtr->getLength() <<
" "
151 << primFramePtr->getLength() << std::endl;
159 while(pReferenceWords < eReferenceWords) {
161 if(*pPrimWords != 0 && *pReferenceWords != *pPrimWords && wordIndex !=
sCrcWordIndex) {
163 boost::int32_t bitIndex = 0;
165 primVirtexBitstreamPtr->splitFrameIndex(frameIndex, currentMajorIndex, relativeFrameIndex);
169 if(currentMajorIndex != previousMajorIndex) {
170 std::cout <<
"WARNING: Bitstream mismatch across major indices: " << currentMajorIndex <<
" and " << previousMajorIndex << std::endl;
175 firstMismatch =
false;
176 previousMajorIndex = currentMajorIndex;
182 while(tempWord != 0) {
186 combinedAddressVector.push_back((relativeFrameIndex << 16) | ((wordIndex - wordOffset)
190 tempWord = tempWord >> 1;
201 std::cout <<
"Found unmatching frame: block " << blockIndex <<
", relative index "
202 <<
Hex32(relativeFrameIndex) <<
", global index: " <<
Hex32(frameIndex)
203 <<
", major index: " <<
Hex32(currentMajorIndex) << std::endl;
204 pReferenceWords = wordsReference;
206 std::cout <<
" Referen: ";
207 while(pReferenceWords < eReferenceWords) {
208 std::cout <<
Hex32(*pReferenceWords++) <<
" ";
210 std::cout << std::endl;
211 pPrimWords = wordsPrim;
212 std::cout <<
" Primary: ";
213 while(pPrimWords < ePrimWords) {
214 std::cout <<
Hex32(*pPrimWords++) <<
" ";
216 std::cout << std::endl;
226 std::ofstream sparceBitstreamFile;
227 sparceBitstreamFile.open(sparceBitstreamPath.string().c_str(), std::ios::binary | std::ios::out);
228 if(sparceBitstreamFile.good()) {
229 std::cout <<
" Opened library file to write " << sparceBitstreamPath.string().c_str()
232 std::cerr <<
" Could not open library file to write - "
233 << sparceBitstreamPath.string().c_str() << std::endl;
237 boost::int32_t vectorSize = combinedAddressVector.size();
238 sparceBitstreamFile.write((
char *) &vectorSize, 4);
239 std::cout <<
"Different words -" << std::endl;
241 for(std::vector<boost::int32_t>::const_iterator iter = combinedAddressVector.begin(); iter
242 != combinedAddressVector.end(); iter++) {
243 sparceBitstreamFile.write((
char *) (&*iter), 4);
244 std::cout <<
Hex32((*iter)) <<
" ";
246 std::cout << std::endl;
248 std::cout <<
"Wrote data to the library file." << std::endl;
250 sparceBitstreamFile.close();
255 uint32_t bitIndexBegin = 0, bitIndexEnd = 0;
256 boost::shared_ptr<Virtex7> virtex7Ptr = boost::dynamic_pointer_cast<
Virtex7>(inBitstreamPtr);
259 virtex7Ptr->getXdlFrames(tileRow, primaryXdlCol, bitIndexBegin,
265 uint32_t outWordOffset = 0;
266 if(bitIndexBegin != bitIndexEnd) {
271 std::cout <<
"*******Word offset " << outWordOffset << std::endl;
273 return outWordOffset;
284 PrimitiveDefArray::const_iterator pPrimitiveDefs = primitiveDefs.begin();
285 PrimitiveDefArray::const_iterator ePrimitiveDefs = primitiveDefs.end();
287 while(pPrimitiveDefs < ePrimitiveDefs) {
292 primitiveStructurePtr->getPrimitiveDefPtr();
296 primitiveStructures[primitiveDefName] = primitiveStructurePtr;
298 string sliceEven = primitiveDefName +
"E";
299 string sliceOdd = primitiveDefName +
"O";
300 primitiveStructures[sliceEven] = primitiveStructurePtr;
301 primitiveStructures[sliceOdd] = primitiveStructurePtr;
304 return primitiveStructures;
310 string perlScript = libraryMemFolder.string() +
"/extract-bits-for-luts.pl";
312 path llFilePath = libraryMemFolder / llFile;
313 string systemCommand =
"perl " + perlScript +
" " + llFilePath.string();
314 int systemReturn = system(systemCommand.c_str());
317 llFilePath = libraryMemFolder / llFile;
318 systemCommand =
"perl " + perlScript +
" " + llFilePath.string();
319 systemReturn = system(systemCommand.c_str());
322 systemReturn = system(cpyCmd.c_str());
Encapsulation of a tile row in an unsigned 16-bit integer.
path mXdlGenerationFolder
Folder in which Xdls will be generated.
Encapsulation of a tile column in an unsigned 16-bit integer.
const Sites & mSites
Sites from the database object.
static const string sTilesSupportedForPips[]
Array of supported routing tiles.
virtual uint32_t getWordOffsetFromTileLocation(TileRow tileRow, TileCol tileCol, BitstreamSharedPtr inBitstreamPtr)
Get word offset from tile row and col.
virtual PrimitiveStructuresSharedPtrMap getPrimitiveNameToStructreMap()
Populate primitive name to primitive structure map.
Encapsulation of primitive site definition, with associated connections, elements, and pins.
Header for the Virtex7PrimitiveStructure class.
virtual string getParentFamilyName()
Get parent family name.
uint32_t getPrimaryXdlColumn(uint32_t inXdlRow, uint32_t inXdlCol)
Returns the primary column corresponding to the given tile. If the specified tile falls in an INT_L ...
bool isSlicelType(const string &inSiteType)
Return true if site type is SLICEL.
void initialize()
Do architecture specific part of initialization.
virtual bool isSiteTypeSupported(const string &inSiteType)
Returns true if site type is supported.
uint32_t getWordOffsetFromXdlFile(path inBitstreamPath, BitstreamSharedPtr inBitstreamPtr)
Get word offset in frame for the site/pip in corresponding Xdl.
const Array< const PrimitiveDef > & getSiteTypes(void) const
Returns the site types for this family.
static const int sCrcWordIndex
This have to be changed for different Family.
std::map< string, string > mReferenceConfigMap
Map from config setting to reference config value.
CompoundSettingMap mCompoundSettingMap
Map from one compound setting to vector of other related settings.
Subclass of PrimitiveStructure for Virtex7.
FrameSet< FRAME_TYPE > mBlock[Bitstream::eBlockTypeCount]
FrameSets for each of the eight block types.
boost::filesystem::path path
std::map< std::string, PrimitiveStructureSharedPtr > PrimitiveStructuresSharedPtrMap
Typedef of map from primitive name to primitive structure shared pointer.
static BitstreamSharedPtr newBitstreamPtr(const boost::filesystem::path &inPath)
boost::shared_ptr< VirtexFrame > VirtexFrameSharedPtr
Virtex frame type.
path mLibraryFolder
Path to library folder.
boost::shared_ptr< PrimitiveStructure > PrimitiveStructureSharedPtr
Shared pointer encapsulation of a PrimitiveStructure.
std::map< string, string > getReferenceConfigMap()
Get a map from config setting to reference value.
static CompoundSettingMap getCompoundSettingsMap()
Returns map of coumpound settings.
virtual std::vector< std::string > getTilesSupportedForPips()
Returns list of supported tiles. Assumes last tile is "LAST_TILE".
boost::shared_ptr< Bitstream > BitstreamSharedPtr
torc::bitstream::BitstreamSharedPtr BitstreamSharedPtr
Imported type name.
virtual void compressBitFile(path primaryFile, path referenceFile)
Compress given bitstream file against reference bitstream file.
virtual void generateMemoryMicroBitstream()
Generate micro-bitstreams for memory elements like LUT in RAM mode.
boost::filesystem::path path
Imported type name.
WORD_TYPE word_t
Frame word type.
Header for the Virtex7 class.
virtual void initializeDeviceInfo(const std::string &inDeviceName)
Initialize the Device Information.
const string & getName(void) const
Returns the name of the primitive.