diff --git a/crlcore/src/ccore/alliance/vst/VstDriver.cpp b/crlcore/src/ccore/alliance/vst/VstDriver.cpp index 46fbd84d..ad477f82 100644 --- a/crlcore/src/ccore/alliance/vst/VstDriver.cpp +++ b/crlcore/src/ccore/alliance/vst/VstDriver.cpp @@ -151,20 +151,16 @@ unsigned FindIndex(const string& stringtosearch, string::size_type openpar) return atoi(numberString.c_str()); } -string getNetDirection(const Net* net) { - switch (net->getDirection()) { - case Net::Direction::UNDEFINED: - return ("linkage"); - case Net::Direction::IN: - return ("in"); - case Net::Direction::OUT: - case Net::Direction::TRISTATE: - return ("out"); - case Net::Direction::INOUT: - return ("inout"); - default: - throw Error("Unrecognized direction"); - } +string getNetDirection(const Net* net) +{ + switch ( net->getDirection() & Net::Direction::INOUT ) { + case Net::Direction::UNDEFINED: return "linkage"; + case Net::Direction::IN: return "in"; + case Net::Direction::OUT: return "out"; + case Net::Direction::INOUT: return "inout"; + default: + throw Error( "Unrecognized direction" ); + } } typedef vector StringPtVector; @@ -233,10 +229,9 @@ void DumpPortList(ofstream &ccell, Cell* cell) } Net* net1 = snmit->second; string bitType; - if (net1->getDirection() == Net::Direction::TRISTATE) - bitType = " mux_bit bus"; - else - bitType = " bit"; + if (net1->getDirection() & Net::Direction::ConnTristate) bitType = " mux_bit bus"; + else if (net1->getDirection() & Net::Direction::ConnWiredOr ) bitType = " wor_bit bus"; + else bitType = " bit"; if (string1OpenPar == string::npos) { @@ -298,13 +293,15 @@ void DumpPortList(ofstream &ccell, Cell* cell) string name = string(*string1, 0, string1OpenPar); string vectorType; string busType; - if (net1->getDirection() == Net::Direction::TRISTATE) - { - vectorType = " mux_vector("; - busType = " bus"; - } - else - vectorType = " bit_vector("; + if (net1->getDirection() & Net::Direction::ConnTristate) { + vectorType = " mux_vector("; + busType = " bus"; + } else if (net1->getDirection() & Net::Direction::ConnWiredOr) { + vectorType = " wor_vector("; + busType = " bus"; + } else + vectorType = " bit_vector("; + vectorizedNetsString.push_back( " " + name diff --git a/crlcore/src/ccore/alliance/vst/VstParserGrammar.yy b/crlcore/src/ccore/alliance/vst/VstParserGrammar.yy index b5fc01d1..d2b4fdaa 100644 --- a/crlcore/src/ccore/alliance/vst/VstParserGrammar.yy +++ b/crlcore/src/ccore/alliance/vst/VstParserGrammar.yy @@ -45,7 +45,6 @@ #include #include - #include #include #include @@ -500,11 +499,7 @@ formal_port_element { if ( !__ys->_firstPass ) { Net::Direction modeDirection = (Net::Direction::Code)$4; Net::Direction typeDirection = (Net::Direction::Code)$5; - Net::Direction direction; - if ( typeDirection != Net::Direction::UNDEFINED ) - direction = typeDirection; - else - direction = modeDirection; + Net::Direction direction = (Net::Direction::Code)(modeDirection | typeDirection); for ( unsigned int i=0 ; i < __ys->_identifiersList.size() ; i++ ) { if ( __ys->_constraint.IsSet() ) { int j; @@ -1056,19 +1051,19 @@ type_convertion ; type_mark - : BIT { $$ = Net::Direction::UNDEFINED; } - | WOR_BIT { $$ = Net::Direction::UNDEFINED; } - | MUX_BIT { $$ = Net::Direction::TRISTATE; } - | BIT_VECTOR { $$ = Net::Direction::UNDEFINED; } - | WOR_VECTOR { $$ = Net::Direction::UNDEFINED; } - | MUX_VECTOR { $$ = Net::Direction::TRISTATE; } - | INTEGER { $$ = Net::Direction::UNDEFINED; } - | NATURAL { $$ = Net::Direction::UNDEFINED; } - | NATURAL_VECTOR { $$ = Net::Direction::UNDEFINED; } - | POSITIVE { $$ = Net::Direction::UNDEFINED; } - | STRING { $$ = Net::Direction::UNDEFINED; } - | _LIST { $$ = Net::Direction::UNDEFINED; } - | ARG { $$ = Net::Direction::UNDEFINED; } + : BIT { $$ = Net::Direction::UNDEFINED; } + | WOR_BIT { $$ = Net::Direction::ConnWiredOr; } + | MUX_BIT { $$ = Net::Direction::ConnTristate; } + | BIT_VECTOR { $$ = Net::Direction::UNDEFINED; } + | WOR_VECTOR { $$ = Net::Direction::ConnWiredOr; } + | MUX_VECTOR { $$ = Net::Direction::ConnTristate; } + | INTEGER { $$ = Net::Direction::UNDEFINED; } + | NATURAL { $$ = Net::Direction::UNDEFINED; } + | NATURAL_VECTOR { $$ = Net::Direction::UNDEFINED; } + | POSITIVE { $$ = Net::Direction::UNDEFINED; } + | STRING { $$ = Net::Direction::UNDEFINED; } + | _LIST { $$ = Net::Direction::UNDEFINED; } + | ARG { $$ = Net::Direction::UNDEFINED; } ; .BUS. diff --git a/hurricane/doc/hurricane/Net.dox b/hurricane/doc/hurricane/Net.dox index d545a8cf..a15f55c7 100644 --- a/hurricane/doc/hurricane/Net.dox +++ b/hurricane/doc/hurricane/Net.dox @@ -30,50 +30,76 @@ * signal category. */ - /*! \enum Net::Type::Code - * This enumeration defines the signal category inside the Net::Type. - */ - /*! \var Net::Type::Code Net::Type::UNDEFINED - * Type undefined. - */ - /*! \var Net::Type::Code Net::Type::LOGICAL - * Type assigned to ordinary signals. - */ - /*! \var Net::Type::Code Net::Type::CLOCK - * Type assigned to clock signals. - */ - /*! \var Net::Type::Code Net::Type::POWER - * Type assigned to supply signals. - */ - /*! \var Net::Type::Code Net::Type::GROUND - * Type assigned to supply signals. - */ + //! \enum Net::Type::Code + //! This enumeration defines the signal category inside the Net::Type. - /*! \class Net::Direction - * Encapsulate the Net::Direction::Code enumeration that defines the - * signal direction. This direction is meaningful for external nets only. - */ + //! \var Net::Type::Code Net::Type::UNDEFINED + //! Type undefined. - /*! \enum Net::Direction::Code - * This enumeration defines the signal direction inside the Net::Direction. - */ - /*! \var Net::Direction::Code Net::Direction::UNDEFINED - * Undefined direction. - */ - /*! \var Net::Direction::Code Net::Direction::IN - * There must be no driver inside and a single permanent driver - * outside. - */ - /*! \var Net::Direction::Code Net::Direction::OUT - * There must be no driver outside and a single permanent driver - * inside. - */ - /*! \var Net::Direction::Code Net::Direction::INOUT - * No constraint. - */ - /*! \var Net::Direction::Code Net::Direction::TRISTATE - * Type assigned to logical tri-states signals. - */ + //! \var Net::Type::Code Net::Type::LOGICAL + //! Type assigned to ordinary signals. + + //! \var Net::Type::Code Net::Type::CLOCK + //! Type assigned to clock signals. + + //! \var Net::Type::Code Net::Type::POWER + //! Type assigned to supply signals. + + //! \var Net::Type::Code Net::Type::GROUND + //! Type assigned to supply signals. + + //! \class Net::Direction + //! Encapsulate the Net::Direction::Code enumeration that defines the + //! signal direction. This direction is meaningful for external nets only. + //! + + //! \enum Net::Direction::Code + //! This enumeration defines the signal direction inside the Net::Direction. + //! It is build upon two kind of atomic flags, one telling were the sources + //! and sinks are located regarding the Cell and the other indicating the + //! nature of the driver (normal, tristate, wired-or). + //! + //! \var Net::Direction::Code Net::Direction::DirUndefined + //! Undefined direction (atomic). + //! + //! \var Net::Direction::Code Net::Direction::DirIn + //! There is at least one sink on this net (atomic). + //! + //! \var Net::Direction::Code Net::Direction::DirOut + //! There is at least one source on this net (atomic). + //! + //! \var Net::Direction::Code Net::Direction::ConnTristate + //! The sources are tristates, this a bus (atomic). + //! + //! \var Net::Direction::Code Net::Direction::ConnWiredOr + //! The sources are wired or, this a bus (atomic). + //! + //! \var Net::Direction::Code Net::Direction::UNDEFINED + //! Undefined direction. + //! + //! \var Net::Direction::Code Net::Direction::IN + //! There must be only sinks inside and a single permanent driver + //! outside. + //! + //! \var Net::Direction::Code Net::Direction::OUT + //! There must be no driver outside and a single permanent driver + //! inside (and no sinks inside). + //! + //! \var Net::Direction::Code Net::Direction::INOUT + //! There must be one permanent driver inside withs at least one + //! sink inside. + //! + //! \var Net::Direction::Code Net::Direction::TRISTATE + //! An OUT signal with a tristate driver (bus). + //! + //! \var Net::Direction::Code Net::Direction::TRANSCV + //! An INOUT signal with a tristate driver (bus). + //! + //! \var Net::Direction::Code Net::Direction::WOR_OUT + //! An OUT signal with a wired-or driver (bus). + //! + //! \var Net::Direction::Code Net::Direction::WOR_INOUT + //! An INOUT signal with a wired-or driver (bus). /*! \function Net* Net::create(Cell* cell, const Name& name); diff --git a/hurricane/src/hurricane/hurricane/Commons.h b/hurricane/src/hurricane/hurricane/Commons.h index a94fd64c..2ad1515d 100644 --- a/hurricane/src/hurricane/hurricane/Commons.h +++ b/hurricane/src/hurricane/hurricane/Commons.h @@ -1,7 +1,7 @@ // -*- C++ -*- // -// Copyright (c) BULL S.A. 2000-2009, All Rights Reserved +// Copyright (c) BULL S.A. 2000-2014, All Rights Reserved // // This file is part of Hurricane. // @@ -23,8 +23,7 @@ // // $Id$ // -// x-----------------------------------------------------------------x -// | | +// +-----------------------------------------------------------------+ // | H U R R I C A N E | // | V L S I B a c k e n d D a t a - B a s e | // | | @@ -32,21 +31,16 @@ // | E-mail : Jean-Paul.Chaput@lip6.fr | // | =============================================================== | // | C++ Header : "./hurricane/Commons.h" | -// | *************************************************************** | -// | U p d a t e s | -// | | -// x-----------------------------------------------------------------x +// +-----------------------------------------------------------------+ -#ifndef __HURRICANE_COMMONS__ -#define __HURRICANE_COMMONS__ - +#ifndef HURRICANE_COMMONS_H +#define HURRICANE_COMMONS_H #include #include #include - -#include +#include #include #include #include @@ -58,27 +52,21 @@ #include - - -// x-----------------------------------------------------------------x +// +-----------------------------------------------------------------+ // | Macros Definition | -// x-----------------------------------------------------------------x +// +-----------------------------------------------------------------+ namespace Hurricane { - using namespace std; - class Slot; - - - // x-------------------------------------------------------------x + // +-------------------------------------------------------------+ // | Tracing/Debugging Utilites | - // x-------------------------------------------------------------x + // +-------------------------------------------------------------+ bool in_trace (); @@ -98,9 +86,9 @@ namespace Hurricane { - // x-------------------------------------------------------------x + // +-------------------------------------------------------------+ // | shared_ptr<> support for DBo | - // x-------------------------------------------------------------x + // +-------------------------------------------------------------+ template @@ -111,17 +99,17 @@ namespace Hurricane { template - class dbo_ptr : public tr1::shared_ptr { + class dbo_ptr : public std::shared_ptr { public: - dbo_ptr ( DboType* dbo ) : tr1::shared_ptr(dbo,DboDestroy()) { } + dbo_ptr ( DboType* dbo ) : std::shared_ptr(dbo,DboDestroy()) { } }; - // x-------------------------------------------------------------x + // +-------------------------------------------------------------+ // | Miscellaneous Utilites | - // x-------------------------------------------------------------x + // +-------------------------------------------------------------+ inline string _TName ( const string& s ) { return s; } @@ -171,9 +159,9 @@ namespace Hurricane { #include "hurricane/Record.h" -// x-----------------------------------------------------------------x +// +-----------------------------------------------------------------+ // | Functions for Inspector Support | -// x-----------------------------------------------------------------x +// +-----------------------------------------------------------------+ // Note 1: Theses are specialized templates for "getString<>()" & "getRecord<>()". // Note 2: we are outside the Hurricane namespace. @@ -750,11 +738,8 @@ inline Hurricane::Record* getRecord ( const std::multiset* s ) // | Classes Neededs in All Hurricane Modules | // x-----------------------------------------------------------------x - #include "hurricane/Slot.h" #include "hurricane/Tabulation.h" - - -#endif +#endif // HURRICANE_COMMONS_H diff --git a/hurricane/src/hurricane/hurricane/Net.h b/hurricane/src/hurricane/hurricane/Net.h index 17bdd40d..c9f1939a 100644 --- a/hurricane/src/hurricane/hurricane/Net.h +++ b/hurricane/src/hurricane/hurricane/Net.h @@ -80,7 +80,20 @@ class Net : public Entity { public: class Direction { // ******************** - public: enum Code {UNDEFINED=0, IN=1, OUT=2, INOUT=3, TRISTATE=4}; + public: enum Code { DirUndefined = 0x0000 + , DirIn = 0x0001 + , DirOut = 0x0002 + , ConnTristate = 0x0100 + , ConnWiredOr = 0x0200 + , UNDEFINED = DirUndefined + , IN = DirIn + , OUT = DirOut + , INOUT = DirIn | DirOut + , TRISTATE = DirOut | ConnTristate + , TRANSCV = DirIn | DirOut | ConnTristate + , WOR_OUT = DirOut | ConnWiredOr + , WOR_INOUT = DirIn | DirOut | ConnWiredOr + }; private: Code _code; @@ -271,14 +284,23 @@ template<> inline std::string getString ( const Hurricane::Net::Direction::Code* object ) { - switch ( *object ) { - case Hurricane::Net::Direction::UNDEFINED: return "UNDEFINED"; - case Hurricane::Net::Direction::IN: return "IN"; - case Hurricane::Net::Direction::OUT: return "OUT"; - case Hurricane::Net::Direction::INOUT: return "INOUT"; - case Hurricane::Net::Direction::TRISTATE: return "TRISTATE"; + std::ostringstream s; + s << (((*object) & Hurricane::Net::Direction::DirIn ) ? 'i' : '-'); + s << (((*object) & Hurricane::Net::Direction::DirOut ) ? 'o' : '-'); + s << (((*object) & Hurricane::Net::Direction::ConnTristate) ? 't' : '-'); + s << (((*object) & Hurricane::Net::Direction::ConnWiredOr ) ? 'w' : '-'); + + switch ( (int)*object ) { + case Hurricane::Net::Direction::UNDEFINED: s << " (UNDEFINED)"; break; + case Hurricane::Net::Direction::IN: s << " (IN)"; break; + case Hurricane::Net::Direction::OUT: s << " (OUT)"; break; + case Hurricane::Net::Direction::INOUT: s << " (INOUT)"; break; + case Hurricane::Net::Direction::TRISTATE: s << " (TRISTATE)"; break; + case Hurricane::Net::Direction::TRANSCV: s << " (TRANSCV)"; break; + case Hurricane::Net::Direction::WOR_OUT: s << " (WOR_OUT)"; break; + case Hurricane::Net::Direction::WOR_INOUT: s << " (WOR_INOUT)"; break; } - return "ABNORMAL"; + return s.str(); } template<> diff --git a/hurricane/src/hurricane/hurricane/Record.h b/hurricane/src/hurricane/hurricane/Record.h index 574de673..6c9721e3 100644 --- a/hurricane/src/hurricane/hurricane/Record.h +++ b/hurricane/src/hurricane/hurricane/Record.h @@ -1,7 +1,6 @@ - // -*- C++ -*- // -// Copyright (c) BULL S.A. 2000-2009, All Rights Reserved +// Copyright (c) BULL S.A. 2000-2014, All Rights Reserved // // This file is part of Hurricane. // @@ -19,12 +18,7 @@ // License along with Hurricane. If not, see // . // -// =================================================================== -// -// $Id$ -// -// x-----------------------------------------------------------------x -// | | +// +-----------------------------------------------------------------+ // | H U R R I C A N E | // | V L S I B a c k e n d D a t a - B a s e | // | | @@ -32,24 +26,19 @@ // | E-mail : Jean-Paul.Chaput@lip6.fr | // | =============================================================== | // | C++ Header : "./hurricane/Record.h" | -// | *************************************************************** | -// | U p d a t e s | -// | | -// x-----------------------------------------------------------------x +// +-----------------------------------------------------------------+ -#ifndef __HURRICANE_RECORD__ -#define __HURRICANE_RECORD__ +#ifndef HURRICANE_RECORD_H +#define HURRICANE_RECORD_H - -#ifndef __HURRICANE_COMMONS__ +#ifndef HURRICANE_COMMONS_H #error "Record.h musn't be included alone, please uses Commons.h." #endif namespace Hurricane { - class Slot; @@ -89,9 +78,7 @@ namespace Hurricane { inline Record::SlotVector& Record::_getSlotVector () { return _slots; } -} // End of Hurricane namespace. +} // Hurricane namespace. - - -#endif +#endif // HURRICANE_RECORD_H diff --git a/hurricane/src/hurricane/hurricane/Slot.h b/hurricane/src/hurricane/hurricane/Slot.h index f0e9bddc..6c7f6c97 100644 --- a/hurricane/src/hurricane/hurricane/Slot.h +++ b/hurricane/src/hurricane/hurricane/Slot.h @@ -1,7 +1,6 @@ - // -*- C++ -*- // -// Copyright (c) BULL S.A. 2000-2009, All Rights Reserved +// Copyright (c) BULL S.A. 2000-2014, All Rights Reserved // // This file is part of Hurricane. // @@ -19,12 +18,7 @@ // License along with Hurricane. If not, see // . // -// =================================================================== -// -// $Id$ -// -// x-----------------------------------------------------------------x -// | | +// +-----------------------------------------------------------------+ // | H U R R I C A N E | // | V L S I B a c k e n d D a t a - B a s e | // | | @@ -32,30 +26,22 @@ // | E-mail : Jean-Paul.Chaput@lip6.fr | // | =============================================================== | // | C++ Header : "./hurricane/Slot.h" | -// | *************************************************************** | -// | U p d a t e s | -// | | -// x-----------------------------------------------------------------x +// +-----------------------------------------------------------------+ -#ifndef __HURRICANE_SLOT__ -#define __HURRICANE_SLOT__ +#ifndef HURRICANE_SLOT_H +#define HURRICANE_SLOT_H - -#ifndef __HURRICANE_COMMONS__ +#ifndef HURRICANE_COMMONS_H #error "Slot.h musn't be included alone, please uses Commons.h." #endif - - namespace Hurricane { - // ------------------------------------------------------------------- // Class : "Slot". - class Slot { public: @@ -322,7 +308,7 @@ namespace Hurricane { { return new SlotTemplate(_name,_data); } -} // End of Hurricane namespace. +} // Hurricane namespace. template @@ -356,5 +342,4 @@ inline Hurricane::Slot* getSlot( const std::string& name, Data* d ) return new Hurricane::SlotTemplate ( name, d ); } - -#endif +#endif // HURRICANE_SLOT_H diff --git a/hurricane/src/hurricane/hurricane/Tabulation.h b/hurricane/src/hurricane/hurricane/Tabulation.h index aaf0d188..6cc28703 100644 --- a/hurricane/src/hurricane/hurricane/Tabulation.h +++ b/hurricane/src/hurricane/hurricane/Tabulation.h @@ -17,12 +17,12 @@ // not, see . // **************************************************************************************************** -#ifndef HURRICANE_TABULATION -#define HURRICANE_TABULATION +#ifndef HURRICANE_TABULATION_H +#define HURRICANE_TABULATION_H #include "hurricane/Commons.h" -#ifndef __HURRICANE_SLOT__ +#ifndef HURRICANE_SLOT_H #error "Tabulation.h must be included after Commons.h" #endif @@ -96,7 +96,7 @@ INSPECTOR_PV_SUPPORT(Hurricane::Tabulation); // Generic functions // **************************************************************************************************** -#endif // HURRICANE_TABULATION +#endif // HURRICANE_TABULATION_H // **************************************************************************************************** diff --git a/hurricane/src/viewer/hurricane/viewer/DisplayStyle.h b/hurricane/src/viewer/hurricane/viewer/DisplayStyle.h index 1710a7cc..b838d7e8 100644 --- a/hurricane/src/viewer/hurricane/viewer/DisplayStyle.h +++ b/hurricane/src/viewer/hurricane/viewer/DisplayStyle.h @@ -32,8 +32,8 @@ namespace Hurricane { class RawDrawingStyle; - typedef std::tr1::shared_ptr DrawingStyle; - typedef std::vector DrawingStyles; + typedef std::shared_ptr DrawingStyle; + typedef std::vector DrawingStyles; class DrawingGroup {