23 namespace architecture {
28 char scratch[1 << 10];
29 uint16_t nameLength = 0;
39 if(sectionName !=
">>>>Packages>>>>")
throw -1;
42 inStream.
read(packageCount);
44 mOut() <<
"\tReading " << packageCount <<
" package" << (packageCount != 1 ?
"s" :
"")
49 Package&
package = const_cast<Package&>(mPackages[i]);
51 inStream.
read(nameLength);
53 if(nameLength >
sizeof(scratch))
throw -1;
54 inStream.
read(scratch, nameLength);
55 scratch[nameLength] = 0;
57 package.mName = scratch;
59 mOut() << scratch << (i + 1 < packageCount ?
", " :
"");
61 inStream.
read(padCount);
62 package.mPads.setSize(padCount);
66 Pad& pad =
const_cast<Pad&
>(package.mPads[j]);
68 inStream.
read(siteIndex);
70 inStream.
read(siteFlags);
72 inStream.
read(nameLength);
74 if(nameLength >
sizeof(scratch))
throw -1;
75 inStream.
read(scratch, nameLength);
76 scratch[nameLength] = 0;
84 mOut() <<
") ..." << std::endl;
93 char scratch[1 << 10];
94 uint16_t nameLength = 0;
96 uint32_t elementCount;
99 uint32_t elementIndex;
106 if(sectionName !=
">>>>PrimDefs>>>>")
throw -1;
109 inStream.
read(siteTypeCount);
111 mOut() <<
"\tReading " << siteTypeCount <<
" site types..." << std::endl;
117 inStream.
read(nameLength);
119 if(nameLength >
sizeof(scratch))
throw -1;
120 inStream.
read(scratch, nameLength);
121 scratch[nameLength] = 0;
125 inStream.
read(pinCount);
127 primitiveDef.
mName = scratch;
130 for(
PinCount j; j < pinCount; j++) {
134 inStream.
read(pinFlags);
136 inStream.
read(nameLength);
138 if(nameLength >
sizeof(scratch))
throw -1;
139 inStream.
read(scratch, nameLength);
140 scratch[nameLength] = 0;
142 primitivePin.
mFlags = pinFlags;
143 primitivePin.
mName = scratch;
147 inStream.
read(elementCount);
151 for(uint32_t j = 0; j < elementCount; j++) {
156 inStream.
read(nameLength);
158 if(nameLength >
sizeof(scratch))
throw -1;
159 inStream.
read(scratch, nameLength);
160 scratch[nameLength] = 0;
162 element.
mName = scratch;
167 inStream.
read(isBel);
169 inStream.
read(pinCount);
171 element.
mIsBel = isBel != 0;
174 for(
PinCount k; k < pinCount; k++) {
179 inStream.
read(pinFlags);
181 inStream.
read(nameLength);
183 if(nameLength >
sizeof(scratch))
throw -1;
184 inStream.
read(scratch, nameLength);
185 scratch[nameLength] = 0;
193 elementPin.
mFlags = pinFlags;
194 elementPin.
mName = scratch;
200 inStream.
read(cfgCount);
204 for(uint32_t k = 0; k < cfgCount; k++) {
206 inStream.
read(nameLength);
208 if(nameLength >
sizeof(scratch))
throw -1;
209 inStream.
read(scratch, nameLength);
210 scratch[nameLength] = 0;
213 element.
mCfgs.insert(scratch);
219 inStream.
read(connCount);
225 for(uint32_t j = 0; j < connCount; j++) {
228 connectionPtr = boost::shared_ptr<PrimitiveConn>(
new PrimitiveConn());
231 uint16_t sourceCount;
232 inStream.
read(sourceCount);
234 if(sourceCount != 1)
throw -1;
236 inStream.
read(elementIndex);
237 inStream.
read(pinIndex);
242 connection.mSourcePtr = &pin;
246 inStream.
read(sinkCount);
248 for(uint32_t k = 0; k < sinkCount; k++) {
250 inStream.
read(elementIndex);
251 inStream.
read(pinIndex);
252 elementPtr = elements.
begin() + elementIndex;
256 connection.mSinks.push_back(&pin);
270 uint16_t primitivePinMapCount = 0;
278 if(sectionName !=
">>>>Pin Maps>>>>")
throw -1;
281 inStream.
read(primitivePinMapCount);
283 mOut() <<
"\tReading " << primitivePinMapCount <<
" primitive pin maps..." << std::endl;
285 for(uint16_t i = 0; i < primitivePinMapCount; i++) {
287 inStream.
read(pinCount);
292 for(
PinCount j; j < pinCount; j++) {
296 inStream.
read(wireIndex);
308 char scratch[1 << 10];
309 uint16_t nameLength = 0;
320 if(sectionName !=
">>>> Sites >>>>")
throw -1;
323 inStream.
read(siteCount);
324 mSites.setSize(siteCount);
325 mOut() <<
"\tReading " << siteCount <<
" sites..." << std::endl;
329 inStream.
read(nameLength);
331 if(nameLength >
sizeof(scratch))
throw -1;
332 inStream.
read(scratch, nameLength);
333 scratch[nameLength] = 0;
335 inStream.
read(siteTypeIndex);
336 inStream.
read(tileIndex);
337 inStream.
read(flags);
338 inStream.
read(pinMap);
PrimitiveElementPinArray mPins
The array of pins.
Encapsulation of the site index, pin name, and pin flags for a package.
Encapsulation of a physical device package and its pins.
SiteIndex mSiteIndex
The index of the site corresponding to this pad.
Encapsulation of a tile index in an unsigned 32-bit integer.
PinNameToPinIndexMap mPinNameToPinIndex
The map of pin names to pin indexes.
string mName
The name of the pad in its physical package.
std::istream & read(uint8_t &outValue)
Read and return a uint8_t.
string mName
The pin name.
SiteNameToSiteIndexMap mSiteNameToSiteIndex
The mapping from site name to site index for this device.
Encapsulation of a pad count in an unsigned 32-bit integer.
PinNameToPinIndexMap mPinNameToPinIndex
The map of pin names to pin indexes.
const PrimitiveElement * mElementPtr
The primitive element that owns this pin.
Encapsulation of a pin count in an unsigned 32-bit integer.
string mName
The pin name.
Encapsulation of primitive site definition, with associated connections, elements, and pins.
Header for the Sites class.
std::string mName
The primitive name.
Encapsulation of a site count in an unsigned 32-bit integer.
Array< const PrimitiveDef > mSiteTypes
The site types for this family.
const PrimitiveConnSharedPtr mPrimitiveConn
The primitive connection that includes this pin.
PinFlags mFlags
The pin direction flags.
PrimitiveElementArray mElements
The primitive elements.
Encapsulation of a pin index in an unsigned 32-bit integer.
Encapsulation of a wire index in an unsigned 16-bit integer.
Array< const Package > mPackages
The packages for this device.
Encapsulation of a package count in an unsigned 16-bit integer.
string mName
The element name.
Encapsulation of a site type index in an unsigned 16-bit integer.
PrimitiveElementPinArray & getPins(void)
Returns a non-constant array of element pins. This function should only be used by the Sites class d...
PinFlags mFlags
The pin direction flags.
StringSet mCfgs
The set of allowable configuration values.
Array< const Site > mSites
The logic sites for this device.
Encapsulation of a device logic site.
Encapsulation of a PrimitiveDef internal connection. This class is analogous to a permanent net with...
PrimitiveConnSharedPtrArray mConnections
The primitive internal connections.
size_t readPrimitivePinMaps(DigestStream &inStream)
Read the site pin mappings for the family.
PackageNameToPackageIndexMap mPackageNameToPackageIndex
The mapping from package name to package index for this device.
SiteFlags mFlags
The site flags for this pad, specifically including bonding.
Encapsulation of a package index in an unsigned 16-bit integer.
Encapsulation of pin attribute flags in an unsigned 16-bit integer.
Encapsulation of a site type count in an unsigned 16-bit integer.
Encapsulation of a primitive pin's name and flags. Primitive pins are logic site inputs or outputs...
boost::shared_ptr< const PrimitiveConn > PrimitiveConnSharedPtr
void readSectionHeader(string &outHeader)
Read and return a section header.
ostream & mOut(void)
Returns the database console output stream.
const PrimitiveElementArray & getElements(void) const
Returns a constant array of primitive elements.
Encapsulation of site attribute flags in an unsigned 16-bit integer.
Encapsulation of a primitive site element. Primitive elements are subcomponents of logic primitive s...
Encapsulation of a primitive element pin's name, flags, and element pointer. Primitive element pins ...
PrimitivePinArray mPins
The primitive pins.
Encapsulation of a site index in an unsigned 32-bit integer.
Array2D< const WireIndex > mPrimitivePinMaps
The site pin maps for this family.
T * begin(void)
Returns the non-constant begin iterator.
size_t readPackages(DigestStream &inStream)
Read the packages for the device.
void setSize(uint32_t inSize)
Discards all contents and resizes the array.
Encapsulation of a device or family digest stream.
size_t getBytesRead(void) const
Returns the number of bytes read.
size_t readPrimitiveTypes(DigestStream &inStream)
Read the primitive types for the family.
Encapsulation of a pad index in an unsigned 32-bit integer.
bool mIsBel
A flag indicating whether or not this element is a BEL (Basic ELement).
size_t readSites(DigestStream &inStream)
Read the sites for the device.