X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/blast.git/blobdiff_plain/abbc64cf04a35ab3549d5c516f44c7c5921baa63..cf93fd850a8b6e9a6f40faed9f796a0e2fb0cedb:/ReferenceInterface.cpp diff --git a/ReferenceInterface.cpp b/ReferenceInterface.cpp index 8aca132..a0f50ca 100644 --- a/ReferenceInterface.cpp +++ b/ReferenceInterface.cpp @@ -11,13 +11,19 @@ ReferenceInterface::ReferenceInterface(AbstractBlock* _owner, const QString& _width, int _direction, int _purpose, - int _level, int _multiplicity) -throw (Exception) : AbstractInterface(_owner, _name, _type, _width, _direction, _purpose, _level) { +throw (Exception) : AbstractInterface(_owner, _name, _type, _width, _direction, _purpose) { if (_owner->isReferenceBlock()) throw(Exception(BLOCK_INVALID_TYPE)); multiplicity = _multiplicity; + + if (purpose == Control) { + // override some attributes with forced values + type = Boolean; + width = "1"; + multiplicity = 1; + } if (direction == InOut) { multiplicity = 1; } @@ -43,20 +49,12 @@ int ReferenceInterface::translatePurpose(const QString& txt) { else if (txt == "reset") { return Reset; } - if (txt == "wb") { + else if (txt == "wb") { return Wishbone; - } + } return Data; } -int ReferenceInterface::translateLevel(const QString& txt) { - - if (txt == "top") { - return Top; - } - return Basic; -} - int ReferenceInterface::translateMultiplicity(const QString& txt) { bool ok; int mult;