63 "HCLK_IOB_CMT_BOT_MGT",
65 "HCLK_IOB_CMT_MID_MGT",
67 "HCLK_IOB_CMT_TOP_MGT",
70 "HCLK_IOI_BOTCEN_MGT",
75 "HCLK_IOI_TOPCEN_MGT",
99 return (siteType.compare(
"SLICEM") == 0 ||
100 siteType.compare(
"SLICELO") == 0 || siteType.compare(
"SLICELE") == 0 ||
101 siteType.compare(
"RAMB36_EXP") == 0 || siteType.compare(
"DSP48E") == 0 ||
103 siteType.compare(
"*BUFR") == 0 || siteType.compare(
"*BUFG") == 0);
108 uint32_t supportedTileIndex = 0;
109 std::vector<std::string> tilesSupported;
113 return tilesSupported;
126 if(referenceBitstreamPtr && primBitstreamPtr) {
127 std::cout <<
"Read the two bit files - " << primaryFile.filename() <<
" and " << referenceFile.filename() <<
" successfully" << std::endl;
129 std::cout <<
"Could not read the bit files " << primaryFile <<
" " << referenceFile << std::endl;
135 boost::shared_ptr<torc::bitstream::Virtex5> refVirtex5BitstreamPtr = boost::dynamic_pointer_cast<
torc::bitstream::Virtex5>(
136 referenceBitstreamPtr);
138 boost::shared_ptr<torc::bitstream::Virtex5> primVirtexBitstreamPtr = boost::dynamic_pointer_cast<
torc::bitstream::Virtex5>(
143 refVirtex5BitstreamPtr->initializeFrameMaps();
144 refVirtex5BitstreamPtr->readFramePackets();
146 primVirtexBitstreamPtr->initializeDeviceInfo(primBitstreamPtr->getDesignName());
147 primVirtexBitstreamPtr->initializeFrameMaps();
148 primVirtexBitstreamPtr->readFramePackets();
155 std::vector<boost::int32_t> combinedAddressVector;
164 if(nullFrameSet.size() != primFrameSet.size()) {
165 std::cout <<
"Frame set sizes do not match" << std::endl;
170 uint32_t relativeFrameIndex = 0, currentMajorIndex = 0, previousMajorIndex = 0;
171 bool firstMismatch =
true;
174 for(uint32_t frameIndex = 0; frameIndex < nullFrameSet.size(); frameIndex++) {
185 + nullFramePtr->getLength();
188 if(nullFramePtr->getLength() != primFramePtr->getLength()) {
189 std::cout <<
"WARNING: Frames of different sizes " << nullFramePtr->getLength() <<
" "
190 << primFramePtr->getLength() << std::endl;
198 while(pReferenceWords < eReferenceWords) {
200 if(*pPrimWords != 0 && *pReferenceWords != *pPrimWords && wordIndex !=
sCrcWordIndex) {
202 boost::int32_t bitIndex = 0;
204 primVirtexBitstreamPtr->splitFrameIndex(frameIndex, currentMajorIndex,
209 if(currentMajorIndex != previousMajorIndex) {
210 std::cout <<
"WARNING: Bitstream mismatch across major indices: " << currentMajorIndex <<
" and " << previousMajorIndex << std::endl;
215 firstMismatch =
false;
216 previousMajorIndex = currentMajorIndex;
222 while(tempWord != 0) {
226 combinedAddressVector.push_back((relativeFrameIndex << 16) | ((wordIndex - wordOffset)
230 tempWord = tempWord >> 1;
241 std::cout <<
"Found unmatching frame: block " << blockIndex <<
", relative index "
242 <<
Hex32(relativeFrameIndex) <<
", global index: " <<
Hex32(frameIndex)
243 <<
", major index: " <<
Hex32(currentMajorIndex) << std::endl;
244 pReferenceWords = wordsReference;
246 std::cout <<
" Referen: ";
247 while(pReferenceWords < eReferenceWords) {
248 std::cout <<
Hex32(*pReferenceWords++) <<
" ";
250 std::cout << std::endl;
251 pPrimWords = wordsPrim;
252 std::cout <<
" Primary: ";
253 while(pPrimWords < ePrimWords) {
254 std::cout <<
Hex32(*pPrimWords++) <<
" ";
256 std::cout << std::endl;
266 std::ofstream sparceBitstreamFile;
267 sparceBitstreamFile.open(sparceBitstreamPath.string().c_str(), std::ios::binary | std::ios::out);
268 if(sparceBitstreamFile.good()) {
269 std::cout <<
" Opened library file to write " << sparceBitstreamPath.string().c_str()
272 std::cerr <<
" Could not open library file to write - "
273 << sparceBitstreamPath.string().c_str() << std::endl;
277 boost::int32_t vectorSize = combinedAddressVector.size();
278 sparceBitstreamFile.write((
char *) &vectorSize, 4);
279 std::cout <<
"Different words -" << std::endl;
281 for(std::vector<boost::int32_t>::const_iterator iter = combinedAddressVector.begin(); iter
282 != combinedAddressVector.end(); iter++) {
283 sparceBitstreamFile.write((
char *) (&*iter), 4);
284 std::cout <<
Hex32((*iter)) <<
" ";
286 std::cout << std::endl;
288 std::cout <<
"Wrote data to the library file." << std::endl;
290 sparceBitstreamFile.close();
295 uint32_t bitIndexBegin = 0, bitIndexEnd = 0;
296 boost::shared_ptr<Virtex5> virtex5Ptr = boost::dynamic_pointer_cast<
Virtex5>(inBitstreamPtr);
298 virtex5Ptr->getXdlFrames(tileRow, primaryXdlCol,
299 bitIndexBegin, bitIndexEnd);
304 uint32_t outWordOffset = 0;
305 if(bitIndexBegin != bitIndexEnd) {
311 return outWordOffset;
321 PrimitiveDefArray::const_iterator pPrimitiveDefs = primitiveDefs.begin();
322 PrimitiveDefArray::const_iterator ePrimitiveDefs = primitiveDefs.end();
324 while(pPrimitiveDefs < ePrimitiveDefs) {
329 primitiveStructurePtr->getPrimitiveDefPtr();
333 primitiveStructures[primitiveDefName] = primitiveStructurePtr;
335 string sliceEven = primitiveDefName +
"E";
336 string sliceOdd = primitiveDefName +
"O";
337 primitiveStructures[sliceEven] = primitiveStructurePtr;
338 primitiveStructures[sliceOdd] = primitiveStructurePtr;
341 return primitiveStructures;
347 string perlScript = libraryMemFolder.string() +
"/extract-bits-for-luts.pl";
349 path llFilePath = libraryMemFolder / llFile;
350 string systemCommand =
"perl " + perlScript +
" " + llFilePath.string();
351 int systemReturn = system(systemCommand.c_str());
353 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.
std::map< string, string > getReferenceConfigMap()
Get a map from config setting to reference value.
const string & getFamilyName(void) const
Returns the family name.
const Sites & mSites
Sites from the database object.
Header for the Virtex5PrimitiveStructure class.
Encapsulation of primitive site definition, with associated connections, elements, and pins.
bool isSlicelType(const string &inSiteType)
Return true if site type is SLICEL.
static CompoundSettingMap getCompoundSettingsMap()
Returns map of coumpound settings.
virtual void compressBitFile(path primaryFile, path referenceFile)
Compress given bitstream file against reference bitstream file.
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.
virtual PrimitiveStructuresSharedPtrMap getPrimitiveNameToStructreMap()
Populate primitive name to primitive structure map.
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.
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.
DDB & mDB
Database object.
static const int sCrcWordIndex
This have to be changed for different Family.
virtual void generateMemoryMicroBitstream()
Generate micro-bitstreams for memory elements like LUT in RAM mode.
static BitstreamSharedPtr newBitstreamPtr(const boost::filesystem::path &inPath)
virtual bool isSiteTypeSupported(const string &inSiteType)
Returns true if site type is supported.
virtual std::vector< std::string > getTilesSupportedForPips()
Returns list of supported tiles.
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.
void initialize()
Do architecture specific part of initialization.
virtual uint32_t getWordOffsetFromTileLocation(TileRow tileRow, TileCol tileCol, BitstreamSharedPtr inBitstreamPtr)
Get word offset from tile row and col.
static const string sTilesSupportedForPips[]
Array of supported routing tiles.
uint32_t getPrimaryXdlColumn(uint32_t inXdlCol)
Returns the primary column corresponding to the given column. If immediately to the left of a BRAM...
boost::shared_ptr< Bitstream > BitstreamSharedPtr
torc::bitstream::BitstreamSharedPtr BitstreamSharedPtr
Imported type name.
Subclass of PrimitiveStructure for Virtex5.
boost::filesystem::path path
Imported type name.
WORD_TYPE word_t
Frame word type.
virtual void initializeDeviceInfo(const std::string &inDeviceName)
Initialize the device information.
const string & getName(void) const
Returns the name of the primitive.