degate  0.1.2
ERCNet.h
Go to the documentation of this file.
00001 /* -*-c++-*-
00002 
00003   This file is part of the IC reverse engineering tool degate.
00004 
00005   Copyright 2008, 2009, 2010 by Martin Schobert
00006 
00007   Degate is free software: you can redistribute it and/or modify
00008   it under the terms of the GNU General Public License as published by
00009   the Free Software Foundation, either version 3 of the License, or
00010   any later version.
00011 
00012   Degate is distributed in the hope that it will be useful,
00013   but WITHOUT ANY WARRANTY; without even the implied warranty of
00014   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015   GNU General Public License for more details.
00016 
00017   You should have received a copy of the GNU General Public License
00018   along with degate. If not, see <http://www.gnu.org/licenses/>.
00019 
00020 */
00021 
00022 #ifndef __ERCNET_H__
00023 #define __ERCNET_H__
00024 
00025 #include <boost/foreach.hpp>
00026 #include <memory>
00027 #include <list>
00028 #include <LogicModel.h>
00029 #include <RCBase.h>
00030 
00031 namespace degate {
00032 
00033 
00034   /**
00035    * Electrical Rule Checks that detects unusual net configurations.
00036    * These cases are checked:
00037    * - A net connects gate ports, but these ports are all of the
00038    *   type. E.g. only inports or only outports are connected.
00039    * - Corresponding gate templates have an undefined port direction.
00040    * - Connection of multiple output ports.
00041    *
00042    * It is possible, that the port direction is still undefined, because
00043    * the user forgot to define it. This could be checked with a dedicated RC
00044    * for gate template ports, but in order to simplify it, we generate a
00045    * violation entry here. The drawback is, that it will generate more
00046    * entries than necessary, because the template port direction is implicitly
00047    * checked multiple times.
00048    *
00049    */
00050 
00051   class ERCNet : public RCBase {
00052 
00053   public:
00054 
00055     ERCNet();
00056 
00057     void run(LogicModel_shptr lmodel);
00058 
00059   private:
00060 
00061     void check_net(LogicModel_shptr lmodel, Net_shptr net);
00062 
00063   };
00064 
00065 }
00066 
00067 #endif