diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..96e462f7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,11 @@ +*~ +*.swp +*.pyc +*.log +man/ +rtf/ +html/ +latex/ + +crlcore/doc/UsersGuide/UsersGuide.tex +crlcore/doc/UsersGuide/UsersGuide.html diff --git a/bootstrap/CMakeLists.txt b/bootstrap/CMakeLists.txt index f690b646..5601e405 100644 --- a/bootstrap/CMakeLists.txt +++ b/bootstrap/CMakeLists.txt @@ -1,3 +1,4 @@ +# -*- mode: CMAKE explicit-buffer-name: "CMakeLists.txt" -*- project(Bootstrap) diff --git a/bootstrap/build.conf b/bootstrap/build.conf index c707aebe..73ec6648 100644 --- a/bootstrap/build.conf +++ b/bootstrap/build.conf @@ -1,23 +1,14 @@ - # -*- mode:Python -*- # This file is *not* a Python module but will be executed # inside a Python function. -svnconfig = { 'method':'svn+ssh://bip.soc.lip6.fr' } - projectdir = 'coriolis-2.x' -projects = [ { 'name' : 'bootstrap' - , 'tools' : [ 'bootstrap' ] - , 'repository': '/users/outil/coriolis/svn' } - - , { 'name' : 'vlsisapd' - , 'tools' : [ 'vlsisapd' ] - , 'repository': '/users/outil/coriolis/svn' } - - , { 'name' : "coriolis" - , 'tools' : [ "hurricane" +projects = [ { 'name' : "coriolis" + , 'tools' : [ "bootstrap" + , "vlsisapd" + , "hurricane" , "crlcore" , "nimbus" , "metis" @@ -33,27 +24,21 @@ projects = [ { 'name' : 'bootstrap' , "cumulus" , "stratus1" ] - , 'repository': "/users/outil/coriolis/svn" } + , 'repository': 'ssh://asim-t/users/largo2/git/coriolis.git' } - , { 'name' : "coriolis-redev" - , 'tools' : [ "katabatic3" - , "kite3" - ] - , 'repository': "/users/outil/coriolis/svn" } - - , { 'name' : "chams" - , 'tools' : [ "hurricaneAMS" - , "amsCore" - , "opSim" - , "scribe" - , "graph" - , "pharos" - , "isis" - , "schematic" - , "solver" - , "autoDTR" - ] - , 'repository':"/users/outil/chams/svn" } + #, { 'name' : "chams" + # , 'tools' : [ "hurricaneAMS" + # , "amsCore" + # , "opSim" + # , "scribe" + # , "graph" + # , "pharos" + # , "isis" + # , "schematic" + # , "solver" + # , "autoDTR" + # ] + # , 'repository':"/users/outil/chams/svn" } ] package = { 'name' : 'coriolis2' diff --git a/bootstrap/builder/AboutWidget.py b/bootstrap/builder/AboutWidget.py index f38a3a36..64183e7d 100644 --- a/bootstrap/builder/AboutWidget.py +++ b/bootstrap/builder/AboutWidget.py @@ -2,7 +2,7 @@ # -*- mode:Python -*- # # This file is part of the Coriolis Software. -# Copyright (c) UPMC/LIP6 2012-2012, All Rights Reserved +# Copyright (c) UPMC/LIP6 2012-2014, All Rights Reserved # # +-----------------------------------------------------------------+ # | C O R I O L I S | diff --git a/bootstrap/builder/Builder.py b/bootstrap/builder/Builder.py index 58eb98ce..b51c0547 100644 --- a/bootstrap/builder/Builder.py +++ b/bootstrap/builder/Builder.py @@ -2,7 +2,7 @@ # -*- mode:Python -*- # # This file is part of the Coriolis Software. -# Copyright (c) UPMC/LIP6 2008-2012, All Rights Reserved +# Copyright (c) UPMC/LIP6 2008-2014, All Rights Reserved # # +-----------------------------------------------------------------+ # | C O R I O L I S | @@ -75,23 +75,24 @@ class Builder: return self.__dict__[attribute] - def _guessSvnTag ( self, project ): - revisionPattern = re.compile ( r"^Revision:\s*(?P\d+)" ) - projectSvnDir = os.path.join ( self.svnMethod+project.getRepository() ) - - command = [ "svn", "info", projectSvnDir ] - svnInfo = subprocess.Popen ( command, stdout=subprocess.PIPE ) - - for line in svnInfo.stdout.readlines(): - m = revisionPattern.match ( line ) - if m: - self.svnTag = m.group("revision") - print "Latest revision of project %s is %s." % (project.getName(),self.svnTag) - return - - print "[WARNING] Cannot guess revision for project \"%s\"." % project.getName() - print " (using: \"x\")" - return + #def _guessGitHash ( self, project ): + # revisionPattern = re.compile ( r"^Revision:\s*(?P\d+)" ) + # projectSvnDir = os.path.join ( self.svnMethod+project.getRepository() ) + # + # os.chdir( ) + # command = [ 'git', 'log', '--pretty="%h"', '-n', '1'] + # svnInfo = subprocess.Popen ( command, stdout=subprocess.PIPE ) + # + # for line in svnInfo.stdout.readlines(): + # m = revisionPattern.match ( line ) + # if m: + # self.gitHash = m.group("revision") + # print "Latest revision of project %s is %s." % (project.getName(),self.gitHash) + # return + # + # print "[WARNING] Cannot guess revision for project \"%s\"." % project.getName() + # print " (using: \"x\")" + # return def _configure ( self, fileIn, file ): @@ -103,7 +104,7 @@ class Builder: substituted0 = line while not stable: - substituted1 = re.sub ( r"@svntag@" , self.svnTag, substituted0 ) + substituted1 = re.sub ( r"@svntag@" , self.gitHash, substituted0 ) substituted1 = re.sub ( r"@coriolisTop@", "/opt/coriolis2" , substituted1 ) if substituted0 == substituted1: stable = True else: substituted0 = substituted1 @@ -141,8 +142,8 @@ class Builder: def _build ( self, tool ): - toolSourceDir = os.path.join ( self.sourceDir, tool ) - toolBuildDir = os.path.join ( self.buildDir , tool ) + toolSourceDir = os.path.join ( self.sourceDir, tool.getToolDir() ) + toolBuildDir = os.path.join ( self.buildDir , tool.name ) # Supplied directly in the CMakeLists.txt. #cmakeModules = os.path.join ( self.installDir, "share", "cmake", "Modules" ) @@ -188,8 +189,8 @@ class Builder: command = [ "make" ] #command += [ "DESTDIR=%s" % self.installDir ] if self._enableDoc == "ON": - #if tool == "crlcore" or tool == "stratus1": - if tool == "stratus1": + #if tool.name == "crlcore" or tool.name == "stratus1": + if tool.name == "stratus1": command += [ "dvi", "safepdf", "html" ] command += self._makeArguments print "Make command:", command @@ -198,108 +199,108 @@ class Builder: return - def _svnStatus ( self, tool ): - toolSourceDir = os.path.join ( self.sourceDir , tool ) - if not os.path.isdir(toolSourceDir): - if not self._quiet: - print ErrorMessage( 0, "Missing tool source directory: \"%s\" (skipped)."%toolSourceDir ) - return - os.chdir ( toolSourceDir ) - - print "Checking SVN status of tool: ", tool - command = [ "svn", "status", "-u", "-q" ] - self._execute ( command, "svn status -u -q" ) - print - return - - - def _svnDiff ( self, tool ): - toolSourceDir = os.path.join ( self.sourceDir , tool ) - if not os.path.isdir(toolSourceDir): - if not self._quiet: - print ErrorMessage( 0, "Missing tool source directory: \"%s\" (skipped)."%toolSourceDir ) - return - os.chdir ( toolSourceDir ) - - print "Doing a SVN diff of tool: ", tool - command = [ "svn", "diff" ] - if self.svnTag != "x": - command += [ "--revision", self.svnTag ] - self._execute ( command, "svn diff %s" % tool ) - print - return - - - def _svnUpdate ( self, tool ): - toolSourceDir = os.path.join ( self.sourceDir , tool ) - if not os.path.isdir(toolSourceDir): - if not self._quiet: - print ErrorMessage( 0, "Missing tool source directory: \"%s\" (skipped)."%toolSourceDir) - return - os.chdir ( toolSourceDir ) - - print "Doing a SVN update of tool: ", tool - command = [ "svn", "update" ] - self._execute ( command, "svn update" ) - print - return - - - def _svnCheckout ( self, tool ): - project = self._conf.getToolProject ( tool ) - if not project: - print ErrorMessage( 0, "Tool \"%s\" is not part of any project."%tool - ,"Cannot guess the SVN repository." ) - return - if not project.getRepository (): - print ErrorMessage( 0, "Project \"%s\" isn't associated to a repository."%project.getName() ) - return - - if not os.path.isdir(self.sourceDir): - print ErrorMessage( 0, "Source directory <%s> doesn't exists. Creating."%self.sourceDir ) - os.makedirs( self.sourceDir ) - - toolSvnTrunkDir = os.path.join ( self.svnMethod+project.getRepository(), tool, "trunk" ) - os.chdir ( self.sourceDir ) - - print "Doing a SVN checkout of tool: ", tool - command = [ "svn", "co", toolSvnTrunkDir, tool ] - if self.svnTag != "x": - command += [ "--revision", self.svnTag ] - self._execute ( command, "svn checkout %s" % tool ) - print - return - - - def _svnExport ( self, tool ): - project = self._conf.getToolProject ( tool ) - if not project: - print ErrorMessage( 0, "Tool \"%s\" is not part of any project."%tool - , "Cannot guess the SVN repository.") - return - if not project.getRepository (): - print ErrorMessage( 0, "Project \"%s\" isn't associated to a repository."%project.getName() ) - return - - toolSvnTrunkDir = os.path.join ( self.svnMethod+project.getRepository(), tool, "trunk" ) - - if not os.path.isdir ( self.archiveDir ): - os.mkdir ( self.archiveDir ) - os.chdir ( self.archiveDir ) - - toolExportDir = os.path.join ( self.archiveDir, tool ) - if os.path.isdir ( toolExportDir ): - print "Removing tool export (tarball) directory: \"%s\"." % toolExportDir - command = [ "/bin/rm", "-r", toolExportDir ] - self._execute ( command, "Removing tool export (tarball) directory" ) - - print "Doing a SVN export of tool: ", tool - command = [ "svn", "export", toolSvnTrunkDir, toolExportDir ] - if self.svnTag != "x": - command += [ "--revision", self.svnTag ] - self._execute ( command, "svn export %s" % toolExportDir ) - print - return + #def _svnStatus ( self, tool ): + # toolSourceDir = os.path.join ( self.sourceDir , tool ) + # if not os.path.isdir(toolSourceDir): + # if not self._quiet: + # print ErrorMessage( 0, "Missing tool source directory: \"%s\" (skipped)."%toolSourceDir ) + # return + # os.chdir ( toolSourceDir ) + # + # print "Checking SVN status of tool: ", tool + # command = [ "svn", "status", "-u", "-q" ] + # self._execute ( command, "svn status -u -q" ) + # print + # return + # + # + #def _svnDiff ( self, tool ): + # toolSourceDir = os.path.join ( self.sourceDir , tool ) + # if not os.path.isdir(toolSourceDir): + # if not self._quiet: + # print ErrorMessage( 0, "Missing tool source directory: \"%s\" (skipped)."%toolSourceDir ) + # return + # os.chdir ( toolSourceDir ) + # + # print "Doing a SVN diff of tool: ", tool + # command = [ "svn", "diff" ] + # if self.gitHash != "x": + # command += [ "--revision", self.gitHash ] + # self._execute ( command, "svn diff %s" % tool ) + # print + # return + # + # + #def _svnUpdate ( self, tool ): + # toolSourceDir = os.path.join ( self.sourceDir , tool ) + # if not os.path.isdir(toolSourceDir): + # if not self._quiet: + # print ErrorMessage( 0, "Missing tool source directory: \"%s\" (skipped)."%toolSourceDir) + # return + # os.chdir ( toolSourceDir ) + # + # print "Doing a SVN update of tool: ", tool + # command = [ "svn", "update" ] + # self._execute ( command, "svn update" ) + # print + # return + # + # + #def _svnCheckout ( self, tool ): + # project = self._conf.getToolProject ( tool ) + # if not project: + # print ErrorMessage( 0, "Tool \"%s\" is not part of any project."%tool + # ,"Cannot guess the SVN repository." ) + # return + # if not project.getRepository (): + # print ErrorMessage( 0, "Project \"%s\" isn't associated to a repository."%project.getName() ) + # return + # + # if not os.path.isdir(self.sourceDir): + # print ErrorMessage( 0, "Source directory <%s> doesn't exists. Creating."%self.sourceDir ) + # os.makedirs( self.sourceDir ) + # + # toolSvnTrunkDir = os.path.join ( self.svnMethod+project.getRepository(), tool, "trunk" ) + # os.chdir ( self.sourceDir ) + # + # print "Doing a SVN checkout of tool: ", tool + # command = [ "svn", "co", toolSvnTrunkDir, tool ] + # if self.gitHash != "x": + # command += [ "--revision", self.gitHash ] + # self._execute ( command, "svn checkout %s" % tool ) + # print + # return + # + # + #def _svnExport ( self, tool ): + # project = self._conf.getToolProject ( tool ) + # if not project: + # print ErrorMessage( 0, "Tool \"%s\" is not part of any project."%tool + # , "Cannot guess the SVN repository.") + # return + # if not project.getRepository (): + # print ErrorMessage( 0, "Project \"%s\" isn't associated to a repository."%project.getName() ) + # return + # + # toolSvnTrunkDir = os.path.join ( self.svnMethod+project.getRepository(), tool, "trunk" ) + # + # if not os.path.isdir ( self.archiveDir ): + # os.mkdir ( self.archiveDir ) + # os.chdir ( self.archiveDir ) + # + # toolExportDir = os.path.join ( self.archiveDir, tool ) + # if os.path.isdir ( toolExportDir ): + # print "Removing tool export (tarball) directory: \"%s\"." % toolExportDir + # command = [ "/bin/rm", "-r", toolExportDir ] + # self._execute ( command, "Removing tool export (tarball) directory" ) + # + # print "Doing a SVN export of tool: ", tool + # command = [ "svn", "export", toolSvnTrunkDir, toolExportDir ] + # if self.gitHash != "x": + # command += [ "--revision", self.gitHash ] + # self._execute ( command, "svn export %s" % toolExportDir ) + # print + # return def _setEnvironment ( self, systemVariable, userVariable ): @@ -347,12 +348,8 @@ class Builder: for project in self.projects: for tool in project.getActives(): - print "\nProcessing tool: \"%s\"." % tool + print "\nProcessing tool: \"%s\"." % tool.name getattr(self,command) ( tool ) - - for tool in self.standalones: - print "\nProcessing tool: \"%s\"." % tool - getattr(self,command) ( tool ) return @@ -373,81 +370,81 @@ class Builder: return - def svnStatus ( self, tools, projects ): - self._commandTemplate ( tools, projects, "_svnStatus" ) - return - - - def svnUpdate ( self, tools, projects ): - self._commandTemplate ( tools, projects, "_svnUpdate" ) - return - - - def svnCheckout ( self, tools, projects ): - self._commandTemplate ( tools, projects, "_svnCheckout" ) - return - - - def svnDiff ( self, tools, projects ): - self._commandTemplate ( tools, projects, "_svnDiff" ) - return - - - def svnExport ( self, tools, projects ): - self._commandTemplate ( tools, projects, "_svnExport" ) - return - - - def svnTarball ( self, tools, projects ): - if self.svnTag == "x": - self._guessSvnTag ( self.getProject(projects[0]) ) - - self._doSpec () - self._doDebChangelog () - - if os.path.isdir(self.tarballDir): - print "Removing previous tarball directory: \"%s\"." % self.tarballDir - command = [ "/bin/rm", "-rf", self.tarballDir ] - self._execute ( command, "Removing top export (tarball) directory" ) - - print "Creating tarball directory: \"%s\"." % self.tarballDir - os.makedirs ( self.tarballDir ) - self.svnExport ( tools, projects ) - - # Remove unpublisheds (yet) tools/files. - for item in self.packageExcludes: - command = [ "/bin/rm", "-rf", os.path.join(self.archiveDir,item) ] - self._execute ( command, "rm of %s failed" % item) - - # Adds files neededs only for packaging purpose. - command = [ "/bin/cp", "-r", os.path.join(self.sourceDir ,"bootstrap","Makefile.package") - , os.path.join(self.archiveDir,"Makefile") ] - self._execute ( command, "copy of %s failed" % "boostrap/Makefile.package") - - command = [ "/bin/cp", self.specFile, self.archiveDir ] - self._execute ( command, "Copying RPM spec file" ) - - command = [ "/bin/cp", "-r", self.debianDir, self.archiveDir ] - self._execute ( command, "Copying Debian/Ubuntu package control files" ) - - os.chdir ( self.archiveDir ) - #command = [ "/usr/bin/patch", "--remove-empty-files" - # , "--no-backup-if-mismatch" - # , "-p0", "-i", self.distribPatch ] - #self._execute ( command, "patch for distribution command failed" ) - - os.chdir ( self.tarballDir ) - command = [ "/bin/tar" - , "--exclude-backups" - , "--exclude-vcs" - , "-jcvf", self.sourceTarBz2, os.path.basename(self.archiveDir) ] - self._execute ( command, "tar command failed" ) - - print "Cleanup SVN export tarball archive directory: \"%s\"." % self.archiveDir - command = [ "/bin/rm", "-rf", self.archiveDir ] - self._execute ( command, "Removing archive export (tarball) directory" ) - - return + #def svnStatus ( self, tools, projects ): + # self._commandTemplate ( tools, projects, "_svnStatus" ) + # return + # + # + #def svnUpdate ( self, tools, projects ): + # self._commandTemplate ( tools, projects, "_svnUpdate" ) + # return + # + # + #def svnCheckout ( self, tools, projects ): + # self._commandTemplate ( tools, projects, "_svnCheckout" ) + # return + # + # + #def svnDiff ( self, tools, projects ): + # self._commandTemplate ( tools, projects, "_svnDiff" ) + # return + # + # + #def svnExport ( self, tools, projects ): + # self._commandTemplate ( tools, projects, "_svnExport" ) + # return + # + # + #def svnTarball ( self, tools, projects ): + # if self.gitHash == "x": + # self._guessGitHash ( self.getProject(projects[0]) ) + # + # self._doSpec () + # self._doDebChangelog () + # + # if os.path.isdir(self.tarballDir): + # print "Removing previous tarball directory: \"%s\"." % self.tarballDir + # command = [ "/bin/rm", "-rf", self.tarballDir ] + # self._execute ( command, "Removing top export (tarball) directory" ) + # + # print "Creating tarball directory: \"%s\"." % self.tarballDir + # os.makedirs ( self.tarballDir ) + # self.svnExport ( tools, projects ) + # + # # Remove unpublisheds (yet) tools/files. + # for item in self.packageExcludes: + # command = [ "/bin/rm", "-rf", os.path.join(self.archiveDir,item) ] + # self._execute ( command, "rm of %s failed" % item) + # + # # Adds files neededs only for packaging purpose. + # command = [ "/bin/cp", "-r", os.path.join(self.sourceDir ,"bootstrap","Makefile.package") + # , os.path.join(self.archiveDir,"Makefile") ] + # self._execute ( command, "copy of %s failed" % "boostrap/Makefile.package") + # + # command = [ "/bin/cp", self.specFile, self.archiveDir ] + # self._execute ( command, "Copying RPM spec file" ) + # + # command = [ "/bin/cp", "-r", self.debianDir, self.archiveDir ] + # self._execute ( command, "Copying Debian/Ubuntu package control files" ) + # + # os.chdir ( self.archiveDir ) + # #command = [ "/usr/bin/patch", "--remove-empty-files" + # # , "--no-backup-if-mismatch" + # # , "-p0", "-i", self.distribPatch ] + # #self._execute ( command, "patch for distribution command failed" ) + # + # os.chdir ( self.tarballDir ) + # command = [ "/bin/tar" + # , "--exclude-backups" + # , "--exclude-vcs" + # , "-jcvf", self.sourceTarBz2, os.path.basename(self.archiveDir) ] + # self._execute ( command, "tar command failed" ) + # + # print "Cleanup SVN export tarball archive directory: \"%s\"." % self.archiveDir + # command = [ "/bin/rm", "-rf", self.archiveDir ] + # self._execute ( command, "Removing archive export (tarball) directory" ) + # + # return def userTarball ( self, tools, projects ): @@ -516,7 +513,7 @@ class Builder: os.chdir ( self.debbuildDir ) sourceFile = os.path.join ( self.tarballDir , self.sourceTarBz2 ) - debOrigFile = os.path.join ( self.debbuildDir, "coriolis2_1.0.%s.orig.tar.bz2" % self.svnTag ) + debOrigFile = os.path.join ( self.debbuildDir, "coriolis2_1.0.%s.orig.tar.bz2" % self.gitHash ) if not os.path.islink(debOrigFile): os.link ( sourceFile, debOrigFile ) @@ -526,7 +523,7 @@ class Builder: #command = [ "/bin/cp", "-r", self.debianDir, "." ] #self._execute ( command, "Copying Debian/Ubuntu package control files" ) - packageDir = os.path.join ( self.debbuildDir, "coriolis2-1.0.%s" % self.svnTag ) + packageDir = os.path.join ( self.debbuildDir, "coriolis2-1.0.%s" % self.gitHash ) os.chdir ( packageDir ) self._environment["CFLAGS" ] = "-O2" diff --git a/bootstrap/builder/BuilderGui.py b/bootstrap/builder/BuilderGui.py index 20195bdf..36d9fe29 100644 --- a/bootstrap/builder/BuilderGui.py +++ b/bootstrap/builder/BuilderGui.py @@ -2,7 +2,7 @@ # -*- mode:Python -*- # # This file is part of the Coriolis Software. -# Copyright (c) UPMC/LIP6 2012-2012, All Rights Reserved +# Copyright (c) UPMC/LIP6 2012-2014, All Rights Reserved # # +-----------------------------------------------------------------+ # | C O R I O L I S | diff --git a/bootstrap/builder/CompileWidget.py b/bootstrap/builder/CompileWidget.py index 8f6b5830..57c85dde 100644 --- a/bootstrap/builder/CompileWidget.py +++ b/bootstrap/builder/CompileWidget.py @@ -2,7 +2,7 @@ # -*- mode:Python -*- # # This file is part of the Coriolis Software. -# Copyright (c) UPMC/LIP6 2012-2012, All Rights Reserved +# Copyright (c) UPMC/LIP6 2012-2014, All Rights Reserved # # +-----------------------------------------------------------------+ # | C O R I O L I S | @@ -131,7 +131,7 @@ class CompileWidget ( QWidget ): def shellCommand ( self ): - command = [ 'buildCoriolis.py' ] + command = [ self.conf.bootstrapDir+'/ccb.py' ] for project in self.options.projects: for tool in project.actives: command += [ '--tool='+tool ] @@ -139,8 +139,8 @@ class CompileWidget ( QWidget ): if self.conf.rootDir: command += [ '--root=%s'%self.conf.rootDir ] - if self.options.svnUpdate: command += [ '--svn-update' ] - if self.options.svnStatus: command += [ '--svn-update' ] + #if self.options.svnUpdate: command += [ '--svn-update' ] + #if self.options.svnStatus: command += [ '--svn-update' ] if self.options.enableDoc: command += [ '--doc' ] if self.options.noCache: command += [ '--no-cache' ] if self.options.rmBuild: command += [ '--rm-build' ] diff --git a/bootstrap/builder/Configuration.py b/bootstrap/builder/Configuration.py index 5745e199..2406337b 100644 --- a/bootstrap/builder/Configuration.py +++ b/bootstrap/builder/Configuration.py @@ -2,7 +2,7 @@ # -*- mode:Python -*- # # This file is part of the Coriolis Software. -# Copyright (c) UPMC/LIP6 2008-2013, All Rights Reserved +# Copyright (c) UPMC/LIP6 2008-2014, All Rights Reserved # # +-----------------------------------------------------------------+ # | C O R I O L I S | @@ -29,7 +29,7 @@ class Configuration ( object ): PrimaryNames = \ [ 'confFile', 'projects', 'standalones' - , 'svnTag', 'svnMethod' + , 'gitHash', 'gitMethod' , 'projectDir', 'rootDir' , 'packageName', 'packageVersion', 'packageExcludes', 'packageProject' , 'osType', 'libSuffix', 'buildMode', 'libMode', 'enableShared' @@ -37,7 +37,7 @@ class Configuration ( object ): SecondaryNames = \ [ 'rpmbuildDir' , 'debbuildDir' , 'tmppathDir' , 'tarballDir' , 'archiveDir' , 'sourceDir' , 'osDir' , 'buildDir' - , 'installDir' , 'specFileIn' , 'specFile' + , 'installDir' , 'bootstrapDir' , 'specFileIn' , 'specFile' , 'debianDir' , 'debChangelogIn', 'debChangelog', 'sourceTarBz2' , 'binaryTarBz2', 'distribPatch' ] @@ -46,8 +46,8 @@ class Configuration ( object ): self._confFile = None self._projects = [] self._standalones = [] - self._svnTag = "x" - self._svnMethod = None + self._gitHash = "x" + self._gitMethod = None self._projectDir = 'coriolis-2.x' self._rootDir = os.path.join ( os.environ["HOME"], self._projectDir ) self._packageName = None @@ -92,28 +92,29 @@ class Configuration ( object ): if self._enableShared == "ON": self._libMode = "Shared" else: self._libMode = "Static" - #self._rootDir = os.path.join ( os.environ["HOME"], self._projectDir ) - self._rpmbuildDir = os.path.join ( self._rootDir , "rpmbuild" ) - self._debbuildDir = os.path.join ( self._rootDir , "debbuild" ) - self._tmppathDir = os.path.join ( self._rpmbuildDir, "tmp" ) - self._tarballDir = os.path.join ( self._rootDir , "tarball" ) - self._archiveDir = os.path.join ( self._tarballDir , "%s-%s.%s" % (self._packageName - ,self._packageVersion - ,self._svnTag) ) - self._sourceDir = os.path.join ( self._rootDir , "src" ) - self._osDir = os.path.join ( self._rootDir - , self._osType - , "%s.%s" % (self._buildMode,self._libMode) ) - self._buildDir = os.path.join ( self._osDir, "build" ) - self._installDir = os.path.join ( self._osDir, "install" ) + #self._rootDir = os.path.join ( os.environ["HOME"], self._projectDir ) + self._rpmbuildDir = os.path.join ( self._rootDir , "rpmbuild" ) + self._debbuildDir = os.path.join ( self._rootDir , "debbuild" ) + self._tmppathDir = os.path.join ( self._rpmbuildDir, "tmp" ) + self._tarballDir = os.path.join ( self._rootDir , "tarball" ) + self._archiveDir = os.path.join ( self._tarballDir , "%s-%s.%s" % (self._packageName + ,self._packageVersion + ,self._gitHash) ) + self._sourceDir = os.path.join ( self._rootDir , "src" ) + self._bootstrapDir = os.path.join ( self._sourceDir , "coriolis/bootstrap" ) + self._osDir = os.path.join ( self._rootDir + , self._osType + , "%s.%s" % (self._buildMode,self._libMode) ) + self._buildDir = os.path.join ( self._osDir, "build" ) + self._installDir = os.path.join ( self._osDir, "install" ) - self._specFileIn = os.path.join ( self._sourceDir, "bootstrap", "%s.spec.in"%self._packageName ) - self._specFile = os.path.join ( self._sourceDir, "bootstrap", "%s.spec" %self._packageName ) - self._debianDir = os.path.join ( self._sourceDir, "bootstrap", "debian" ) - self._debChangelogIn = os.path.join ( self._debianDir, "changelog.in" ) - self._debChangelog = os.path.join ( self._debianDir, "changelog" ) - self._sourceTarBz2 = "%s-%s.%s.tar.bz2" % (self._packageName,self._packageVersion,self._svnTag) - self._binaryTarBz2 = "%s-binary-%s.%s-1.slsoc6.tar.bz2" % (self._packageName,self._packageVersion,self._svnTag) + self._specFileIn = os.path.join ( self._bootstrapDir, "%s.spec.in"%self._packageName ) + self._specFile = os.path.join ( self._bootstrapDir, "%s.spec" %self._packageName ) + self._debianDir = os.path.join ( self._bootstrapDir, "debian" ) + self._debChangelogIn = os.path.join ( self._debianDir , "changelog.in" ) + self._debChangelog = os.path.join ( self._debianDir , "changelog" ) + self._sourceTarBz2 = "%s-%s.%s.tar.bz2" % (self._packageName,self._packageVersion,self._gitHash) + self._binaryTarBz2 = "%s-binary-%s.%s-1.slsoc6.tar.bz2" % (self._packageName,self._packageVersion,self._gitHash) self._distribPatch = os.path.join ( self._sourceDir, "bootstrap", "%s-for-distribution.patch"%self._packageName ) return @@ -198,12 +199,12 @@ class Configuration ( object ): if not confFile: print 'Making an educated guess to locate the configuration file:' locations = [ os.path.abspath(os.path.dirname(sys.argv[0])) - , os.environ['HOME']+'/coriolis-2.x/src/bootstrap' - , os.environ['HOME']+'/coriolis/src/bootstrap' - , os.environ['HOME']+'/chams-2.x/src/bootstrap' - , os.environ['HOME']+'/chams/src/bootstrap' - , '/users/outil/coriolis/coriolis-2.x/src/bootstrap' - , self._rootDir+'/src/bootstrap' + , os.environ['HOME']+'/coriolis-2.x/src/coriolis/bootstrap' + , os.environ['HOME']+'/coriolis/src/coriolis/bootstrap' + , os.environ['HOME']+'/chams-2.x/src/coriolis/bootstrap' + , os.environ['HOME']+'/chams/src/coriolis/bootstrap' + , '/users/outil/coriolis/coriolis-2.x/src/coriolis/bootstrap' + , self._rootDir+'/src/coriolis/bootstrap' ] for location in locations: @@ -278,10 +279,10 @@ class Configuration ( object ): def show ( self ): print 'CCB Configuration:' - if self._svnMethod: - print ' SVN Method: <%s>' % self._svnMethod + if self._gitMethod: + print ' Git Method: <%s>' % self._gitMethod else: - print ' SVN Method not defined, will not be able to checkout/commit.' + print ' Git Method not defined, will not be able to push/pull.' for project in self._projects: print ' project:%-15s repository:<%s>' % ( ('<%s>'%project.getName()), project.getRepository() ) diff --git a/bootstrap/builder/ConfigureWidget.py b/bootstrap/builder/ConfigureWidget.py index 2d739f53..21c330a1 100644 --- a/bootstrap/builder/ConfigureWidget.py +++ b/bootstrap/builder/ConfigureWidget.py @@ -2,7 +2,7 @@ # -*- mode:Python -*- # # This file is part of the Coriolis Software. -# Copyright (c) UPMC/LIP6 2012-2012, All Rights Reserved +# Copyright (c) UPMC/LIP6 2012-2014, All Rights Reserved # # +-----------------------------------------------------------------+ # | C O R I O L I S | @@ -165,11 +165,13 @@ class ConfigureWidget ( QWidget ): gLayout.addWidget( ConfSettingsWidget(self._conf), 1, 0, 1, 1 ) - def _getRootDir ( self ): return self._rootDir - def _getConf ( self ): return self._conf + def _getConf ( self ): return self._conf + def _getRootDir ( self ): return self._rootDir + def _getBootstrapDir ( self ): return self._getConf().bootstrapDir - rootDir = property( _getRootDir ) - conf = property( _getConf ) + conf = property( _getConf ) + rootDir = property( _getRootDir ) + bootstrapDir = property( _getBootstrapDir ) def rootDirChanged ( self, rootDir ): diff --git a/bootstrap/builder/Highlighter.py b/bootstrap/builder/Highlighter.py index 2ce0cb03..4584600c 100644 --- a/bootstrap/builder/Highlighter.py +++ b/bootstrap/builder/Highlighter.py @@ -2,7 +2,7 @@ # -*- mode:Python -*- # # This file is part of the Coriolis Software. -# Copyright (c) UPMC/LIP6 2012-2012, All Rights Reserved +# Copyright (c) UPMC/LIP6 2012-2014, All Rights Reserved # # +-----------------------------------------------------------------+ # | C O R I O L I S | diff --git a/bootstrap/builder/OptionsWidget.py b/bootstrap/builder/OptionsWidget.py index 29474639..0471d314 100644 --- a/bootstrap/builder/OptionsWidget.py +++ b/bootstrap/builder/OptionsWidget.py @@ -2,7 +2,7 @@ # -*- mode:Python -*- # # This file is part of the Coriolis Software. -# Copyright (c) UPMC/LIP6 2012-2012, All Rights Reserved +# Copyright (c) UPMC/LIP6 2012-2014, All Rights Reserved # # +-----------------------------------------------------------------+ # | C O R I O L I S | @@ -48,20 +48,21 @@ class OptionsWidget ( QWidget ): self._projects += [ ProjectWidgets(project) ] gLayout = QGridLayout() - for column in range(len(self._projects)): - self._projects[column].addToLayout( column, gLayout ) + column = 0 + for iproject in range(len(self._projects)): + column += self._projects[iproject].addToLayout( column, gLayout ) toolsGroup = QGroupBox( 'Projects && Tools' ) toolsGroup.setLayout( gLayout ) scrollToolsGroup = QScrollArea() - scrollToolsGroup.setMinimumHeight( 400 ) + scrollToolsGroup.setMinimumHeight( 350 ) #scrollToolsGroup.setVerticalScrollBarPolicy( Qt.ScrollBarAlwaysOn ) scrollToolsGroup.setWidget( toolsGroup ) self._buildMode = QComboBox() self._buildMode.addItems( ('Release', 'Debug') ) - self._svnUpdate = QCheckBox( 'SVN Update' ) - self._svnStatus = QCheckBox( 'SVN Status' ) + #self._svnUpdate = QCheckBox( 'SVN Update' ) + #self._svnStatus = QCheckBox( 'SVN Status' ) self._make = QCheckBox( 'Build' ) self._enableDoc = QCheckBox( 'Build Documentation' ) self._noCache = QCheckBox( 'Remove previous CMake cache' ) @@ -73,13 +74,13 @@ class OptionsWidget ( QWidget ): self._commandGroup = QButtonGroup() self._commandGroup.setExclusive( True ) - self._commandGroup.addButton( self._svnUpdate ) - self._commandGroup.addButton( self._svnStatus ) + #self._commandGroup.addButton( self._svnUpdate ) + #self._commandGroup.addButton( self._svnStatus ) self._commandGroup.addButton( self._make ) vLayout = QVBoxLayout() - vLayout.addWidget( self._svnUpdate ) - vLayout.addWidget( self._svnStatus ) + #vLayout.addWidget( self._svnUpdate ) + #vLayout.addWidget( self._svnStatus ) vLayout.addWidget( self._make ) vLayout.addStretch() commandGroup = QGroupBox( 'Command' ) @@ -121,8 +122,8 @@ class OptionsWidget ( QWidget ): def _getProjects ( self ): return self._projects def _getBuildMode ( self ): return self._buildMode.currentText() def _getThreads ( self ): return self._threads.currentText() - def _getSvnUpdate ( self ): return self._svnUpdate.isChecked() - def _getSvnStatus ( self ): return self._svnStatus.isChecked() + #def _getSvnUpdate ( self ): return self._svnUpdate.isChecked() + #def _getSvnStatus ( self ): return self._svnStatus.isChecked() def _getMake ( self ): return self._make.isChecked() def _getEnableDoc ( self ): return self._enableDoc.isChecked() def _getNoCache ( self ): return self._noCache.isChecked() @@ -132,8 +133,8 @@ class OptionsWidget ( QWidget ): projects = property( _getProjects ) buildMode = property( _getBuildMode ) threads = property( _getThreads ) - svnUpdate = property( _getSvnUpdate ) - svnStatus = property( _getSvnStatus ) + #svnUpdate = property( _getSvnUpdate ) + #svnStatus = property( _getSvnStatus ) make = property( _getMake ) enableDoc = property( _getEnableDoc ) noCache = property( _getNoCache ) @@ -143,8 +144,8 @@ class OptionsWidget ( QWidget ): def readSettings ( self ): settings = QSettings() - self._svnUpdate.setChecked( settings.value('builder/svnUpdate').toBool() ) - self._svnStatus.setChecked( settings.value('builder/svnStatus').toBool() ) + #self._svnUpdate.setChecked( settings.value('builder/svnUpdate').toBool() ) + #self._svnStatus.setChecked( settings.value('builder/svnStatus').toBool() ) self._make .setChecked( settings.value('builder/make' ).toBool() ) self._enableDoc.setChecked( settings.value('builder/enableDoc').toBool() ) self._noCache .setChecked( settings.value('builder/noCache' ).toBool() ) @@ -165,8 +166,8 @@ class OptionsWidget ( QWidget ): def saveSettings ( self ): settings = QSettings() - settings.setValue('builder/svnUpdate', self._svnUpdate.isChecked() ) - settings.setValue('builder/svnStatus', self._svnStatus.isChecked() ) + #settings.setValue('builder/svnUpdate', self._svnUpdate.isChecked() ) + #settings.setValue('builder/svnStatus', self._svnStatus.isChecked() ) settings.setValue('builder/make' , self._make .isChecked() ) settings.setValue('builder/enableDoc', self._enableDoc.isChecked() ) settings.setValue('builder/buildMode', self._buildMode.currentText() ) diff --git a/bootstrap/builder/Project.py b/bootstrap/builder/Project.py index 22bb45b4..a69db038 100644 --- a/bootstrap/builder/Project.py +++ b/bootstrap/builder/Project.py @@ -2,7 +2,7 @@ # -*- mode:Python -*- # # This file is part of the Coriolis Software. -# Copyright (c) UPMC/LIP6 2012-2012, All Rights Reserved +# Copyright (c) UPMC/LIP6 2012-2014, All Rights Reserved # # +-----------------------------------------------------------------+ # | C O R I O L I S | @@ -15,37 +15,58 @@ # +-----------------------------------------------------------------+ +class Tool ( object ): + + def __init__ ( self, project, name ): + self.project = project + self.name = name + self.active = False + return + + def getToolDir ( self ): return self.project.getName()+'/'+self.name + + class Project ( object ): - def __init__ ( self, name, tools, repository ): + def __init__ ( self, name, toolNames, repository ): self._name = name - self._tools = tools + self._tools = [] self._repository = repository - self._actives = [] + + for toolName in toolNames: + self._tools.append( Tool(self,toolName) ) return def getName ( self ): return self._name def getTools ( self ): return self._tools def getRepository ( self ): return self._repository - def getActives ( self ): return self._actives - def hasTool ( self, tool ): return tool in self._tools + + def hasTool ( self, toolName ): + for tool in self._tools: + if tool.name == toolName: return True + return False + + def getActives ( self ): + actives = [] + for tool in self._tools: + if tool.active: actives.append( tool ) + return actives def desactivate ( self ): self._active = [] return def activateAll ( self ): - self._actives = self._tools + for tool in self._tools: + tool.active = True return - def activate ( self, tools ): - # Build the ordered list. - for tool in self._tools: - if (tool in tools) and not (tool in self._actives): - self._actives += [ tool ] - # Find the tools not part of the project. + def activate ( self, toolNames ): rejecteds = [] - for tool in tools: - if not (tool in self._tools) and (not tool in rejecteds): - rejecteds += [ tool ] + for tool in self._tools: + if tool.name in toolNames: + tool.active = True + else: + if tool.name in toolNames: + rejecteds.append( tool.name ) return rejecteds diff --git a/bootstrap/builder/ProjectWidgets.py b/bootstrap/builder/ProjectWidgets.py index 902495c2..235fab39 100644 --- a/bootstrap/builder/ProjectWidgets.py +++ b/bootstrap/builder/ProjectWidgets.py @@ -2,7 +2,7 @@ # -*- mode:Python -*- # # This file is part of the Coriolis Software. -# Copyright (c) UPMC/LIP6 2012-2012, All Rights Reserved +# Copyright (c) UPMC/LIP6 2012-2014, All Rights Reserved # # +-----------------------------------------------------------------+ # | C O R I O L I S | @@ -15,23 +15,29 @@ # +-----------------------------------------------------------------+ +import string from PyQt4.QtCore import Qt from PyQt4.QtCore import QObject from PyQt4.QtCore import QSettings +from PyQt4.QtGui import QSizePolicy +from PyQt4.QtGui import QFrame from PyQt4.QtGui import QPushButton from PyQt4.QtGui import QCheckBox +from PyQt4.QtGui import QLabel class ProjectWidgets ( QObject ): def __init__ ( self, project ): self._project = project - self._projectButton = QPushButton( self._project.getName() ) + self._projectButton = QLabel( string.capwords(self._project.getName()) ) self._projectButton.setStyleSheet( 'font-weight: bold;' ) + self._projectButton.setFrameShape( QFrame.Box ) + self._projectButton.setSizePolicy( QSizePolicy.Expanding, QSizePolicy.Preferred ) self._toolsCheckBoxes = [] for tool in self._project.getTools(): - self._toolsCheckBoxes += [ QCheckBox( tool ) ] + self._toolsCheckBoxes += [ QCheckBox( tool.name ) ] #self._projectButton.clicked.connect( self.toggleToolsVisibility ) return @@ -50,10 +56,22 @@ class ProjectWidgets ( QObject ): actives = property( _getActives ) def addToLayout( self, column, layout ): - layout.addWidget( self._projectButton, 0, column, Qt.AlignLeft ) - for row in range(len(self._toolsCheckBoxes)): + toolsNb = len(self._toolsCheckBoxes) + if toolsNb <= 10: + layout.addWidget( self._projectButton, 0, column, Qt.AlignLeft ) + for row in range(toolsNb): layout.addWidget( self._toolsCheckBoxes[row], row+1, column, Qt.AlignTop ) - return + return 1 + + columnSpan = toolsNb / 10 + if toolsNb % 10: columnSpan += 1 + + layout.addWidget( self._projectButton, 0, column, 1, columnSpan, Qt.AlignJustify ) + for row in range(toolsNb): + if row and row % 10 == 0: column += 1 + layout.addWidget( self._toolsCheckBoxes[row], row%10+1, column, Qt.AlignTop ) + + return columnSpan #def toggleToolsVisibility ( self ): # self._visibleTools = not self._visibleTools diff --git a/bootstrap/builder/__init__.py b/bootstrap/builder/__init__.py index bf225cf7..aa34abc6 100644 --- a/bootstrap/builder/__init__.py +++ b/bootstrap/builder/__init__.py @@ -1,5 +1,18 @@ # -*- mode:Python -*- +# +# This file is part of the Coriolis Software. +# Copyright (c) UPMC/LIP6 2012-2014, All Rights Reserved +# +# +-----------------------------------------------------------------+ +# | C O R I O L I S | +# | C o r i o l i s / C h a m s B u i l d e r | +# | | +# | Author : Damien Dupuis | +# | E-mail : Jean-Paul.Chaput@asim.lip6.fr | +# | =============================================================== | +# | Python : "./builder/__init__.py" | +# +-----------------------------------------------------------------+ import sys diff --git a/bootstrap/ccb.py b/bootstrap/ccb.py index fd314762..17bece46 100755 --- a/bootstrap/ccb.py +++ b/bootstrap/ccb.py @@ -3,7 +3,7 @@ # -*- mode:Python -*- # # This file is part of the Coriolis Software. -# Copyright (c) UPMC 2008-2013, All Rights Reserved +# Copyright (c) UPMC 2008-2014, All Rights Reserved # # +-----------------------------------------------------------------+ # | C O R I O L I S | @@ -116,11 +116,11 @@ def autoLocate (): builderDir = None locations = [ os.path.abspath(os.path.dirname(sys.argv[0])) - , os.environ['HOME']+'/coriolis-2.x/src/bootstrap' - , os.environ['HOME']+'/coriolis/src/bootstrap' - , os.environ['HOME']+'/chams-1.x/src/bootstrap' - , os.environ['HOME']+'/chams/src/bootstrap' - , '/users/outil/coriolis/coriolis-2.x/src/bootstrap' + , os.environ['HOME']+'/coriolis-2.x/src/coriolis/bootstrap' + , os.environ['HOME']+'/coriolis/src/coriolis/bootstrap' + , os.environ['HOME']+'/chams-1.x/src/coriolis/bootstrap' + , os.environ['HOME']+'/chams/src/coriolis/bootstrap' + , '/users/outil/coriolis/coriolis-2.x/src/coriolis/bootstrap' , os.environ['HOME']+'/coriolis-2.x/'+osType+'/Release.Shared/install/'+libDir+'/'+sitePackage , os.environ['HOME']+'/chams-1.x/'+osType+'/Release.Shared/install/'+libDir+'/'+sitePackage , os.environ['HOME']+'/chams/'+osType+'/Release.Shared/install/'+libDir+'/'+sitePackage @@ -173,12 +173,13 @@ parser.add_option ( "--make" , action="store" , type="string", parser.add_option ( "--project" , action="append" , type="string", dest="projects" , help="The name of a project to build (may appears any number of time)." ) parser.add_option ( "-t", "--tool" , action="append" , type="string", dest="tools" , help="The name of a tool to build (may appears any number of time)." ) # SVN repository relateds. -parser.add_option ( "--svn-tag" , action="store" , type="string", dest="svnTag" , help="Explicitly select a SVN tag (for SVN related commands)." ) -parser.add_option ( "--svn-method" , action="store" , type="string", dest="svnMethod" , help="Allows to sets the svn checkout method (svn+ssh://coriolis.soc.lip6.fr)." ) -parser.add_option ( "--svn-status" , action="store_true" , dest="svnStatus" , help="Check status against the SVN repository." ) -parser.add_option ( "--svn-diff" , action="store_true" , dest="svnDiff" , help="Perform a diff against the SVN repository." ) -parser.add_option ( "--svn-update" , action="store_true" , dest="svnUpdate" , help="Update to the latest SVN version *or* the one given by svn-tag." ) -parser.add_option ( "--svn-checkout" , action="store_true" , dest="svnCheckout", help="Checkout the latest SVN version *or* the one given by svn-tag." ) +# Have to be ported to Git. +#parser.add_option ( "--svn-tag" , action="store" , type="string", dest="svnTag" , help="Explicitly select a SVN tag (for SVN related commands)." ) +#parser.add_option ( "--svn-method" , action="store" , type="string", dest="svnMethod" , help="Allows to sets the svn checkout method (svn+ssh://coriolis.soc.lip6.fr)." ) +#parser.add_option ( "--svn-status" , action="store_true" , dest="svnStatus" , help="Check status against the SVN repository." ) +#parser.add_option ( "--svn-diff" , action="store_true" , dest="svnDiff" , help="Perform a diff against the SVN repository." ) +#parser.add_option ( "--svn-update" , action="store_true" , dest="svnUpdate" , help="Update to the latest SVN version *or* the one given by svn-tag." ) +#parser.add_option ( "--svn-checkout" , action="store_true" , dest="svnCheckout", help="Checkout the latest SVN version *or* the one given by svn-tag." ) # Miscellaneous. parser.add_option ( "--user-tarball" , action="store_true" , dest="userTarball", help="Regenerate a tarball from checked out sources (in /tarball/." ) parser.add_option ( "--tarball" , action="store_true" , dest="tarball" , help="Regenerate a tarball (in /tarball/." ) @@ -239,14 +240,14 @@ else: if options.noCache: builder.noCache = True if options.rmBuild: builder.rmBuild = True if options.makeArguments: builder.makeArguments = options.makeArguments - if options.svnMethod: builder.svnMethod = options.svnMethod - if options.svnTag: builder.svnTag = options.svnTag + #if options.svnMethod: builder.svnMethod = options.svnMethod + #if options.svnTag: builder.svnTag = options.svnTag - if options.svnStatus: builder.svnStatus ( tools=options.tools, projects=options.projects ) - elif options.svnUpdate: builder.svnUpdate ( tools=options.tools, projects=options.projects ) - elif options.svnDiff: builder.svnDiff ( tools=options.tools, projects=options.projects ) - elif options.svnCheckout: builder.svnCheckout ( tools=options.tools, projects=options.projects ) - elif options.userTarball: builder.userTarball ( tools=options.tools, projects=options.projects ) + #if options.svnStatus: builder.svnStatus ( tools=options.tools, projects=options.projects ) + #elif options.svnUpdate: builder.svnUpdate ( tools=options.tools, projects=options.projects ) + #elif options.svnDiff: builder.svnDiff ( tools=options.tools, projects=options.projects ) + #elif options.svnCheckout: builder.svnCheckout ( tools=options.tools, projects=options.projects ) + if options.userTarball: builder.userTarball ( tools=options.tools, projects=options.projects ) elif options.tarball: builder.svnTarball ( tools=options.tools, projects=options.projects ) elif options.doRpm: builder.doRpm () elif options.doDeb: builder.doDeb () diff --git a/bootstrap/cmake_modules/FindBootstrap.cmake b/bootstrap/cmake_modules/FindBootstrap.cmake index 8d5009d3..13e944e9 100644 --- a/bootstrap/cmake_modules/FindBootstrap.cmake +++ b/bootstrap/cmake_modules/FindBootstrap.cmake @@ -220,21 +220,34 @@ # Setup the _SEARCH_PATH. # Where to find includes & libraries. # - MACRO(SETUP_SEARCH_DIR project) - IF( NOT("$ENV{${project}_TOP}" STREQUAL "") ) - MESSAGE("-- ${project}_TOP is set to $ENV{${project}_TOP}") - LIST(INSERT ${project}_DIR_SEARCH 0 "${DESTDIR}$ENV{${project}_TOP}") - ENDIF( NOT("$ENV{${project}_TOP}" STREQUAL "") ) + macro(setup_search_dir project) + if( NOT("$ENV{${project}_TOP}" STREQUAL "") ) + message("-- ${project}_TOP is set to $ENV{${project}_TOP}") + list(INSERT ${project}_DIR_SEARCH 0 "${DESTDIR}$ENV{${project}_TOP}") + endif( NOT("$ENV{${project}_TOP}" STREQUAL "") ) - IF( NOT("$ENV{${project}_USER_TOP}" STREQUAL "") ) - MESSAGE("-- ${project}_USER_TOP is set to $ENV{${project}_USER_TOP}") - LIST(INSERT ${project}_DIR_SEARCH 0 "${DESTDIR}$ENV{${project}_USER_TOP}") - ENDIF( NOT("$ENV{${project}_USER_TOP}" STREQUAL "") ) + if( NOT("$ENV{${project}_USER_TOP}" STREQUAL "") ) + message("-- ${project}_USER_TOP is set to $ENV{${project}_USER_TOP}") + list(INSERT ${project}_DIR_SEARCH 0 "${DESTDIR}$ENV{${project}_USER_TOP}") + endif( NOT("$ENV{${project}_USER_TOP}" STREQUAL "") ) LIST(REMOVE_DUPLICATES ${project}_DIR_SEARCH) - MESSAGE("-- Components of ${project}_DIR_SEARCH:") - FOREACH(PATH ${${project}_DIR_SEARCH}) - MESSAGE("-- ${PATH}") - ENDFOREACH(PATH) - ENDMACRO(SETUP_SEARCH_DIR project) + message("-- Components of ${project}_DIR_SEARCH:") + foreach(PATH ${${project}_DIR_SEARCH}) + message("-- ${PATH}") + endforeach(PATH) + endmacro(setup_search_dir project) + + +# +# Setup the _FOUND. +# Set to TRUE if both includes & libraries have been found. +# + macro(set_found project) + if(${project}_INCLUDE_DIR AND ${project}_LIBRARY) + set(${project}_FOUND TRUE) + else(${project}_INCLUDE_DIR AND ${project}_LIBRARY) + set(${project}_FOUND FALSE) + endif(${project}_INCLUDE_DIR AND ${project}_LIBRARY) + endmacro(set_found project) diff --git a/bootstrap/svn2git/authors.txt b/bootstrap/svn2git/authors.txt new file mode 100644 index 00000000..1c00a46b --- /dev/null +++ b/bootstrap/svn2git/authors.txt @@ -0,0 +1,30 @@ +alain = Alain Greiner +bodin = Bruno Bodin +boris = Boris Boutillier +caba = Jean-Manuel Caba +chams = The Chams Project +cobell = Sophie Belloeil +coriolis = The Coriolis Project +czo = Olivier Sirol +d2 = Damien Dupuis +dom = Dominique Ledu +franck = Franck Wajsburt +francois = Francois Donnet +fred = Frederic Petrot +gregoire = Gregoire Avot +hcl = Hugo Clement +javid = Farakh Javid +karim = Karim Dioury +labiadh = Forgotten Author (labiadh) +ludo = Ludovic Jacomme +masson = Christian Masson +mitri = Forgotten Author (mitri) +noury = Ludovic Noury +pnt = Pierre Nguyen Tuong +sirol = Olivier Sirol +stephany = Stephanie Youssef +xtof = Christophe Alexandre +youssef = Stephanie Youssef +jpc = Jean-Paul Chaput +ramy = Ramy Iskander +roselyne = Roselyne Chotin diff --git a/bootstrap/svn2git/coriolis.rules b/bootstrap/svn2git/coriolis.rules new file mode 100644 index 00000000..cf441141 --- /dev/null +++ b/bootstrap/svn2git/coriolis.rules @@ -0,0 +1,30 @@ + +create repository coriolis.git +end repository + +match /io/trunk/ + repository coriolis.git + branch master + prefix vlsisapd/ +end match + +match /goodies/trunk/ + repository coriolis.git + branch master + prefix bootstrap/ +end match + +match /vlsisapd/trunk/ + repository coriolis.git + branch master + prefix vlsisapd/ +end match + +match /([a-z0-9]+)/trunk/ + repository coriolis.git + branch master + prefix \1/ +end match + +match .*/ +end match diff --git a/bootstrap/svn2git/svn2git.sh b/bootstrap/svn2git/svn2git.sh new file mode 100644 index 00000000..793431d8 --- /dev/null +++ b/bootstrap/svn2git/svn2git.sh @@ -0,0 +1,6 @@ +#!/bin/sh + + svn-all-fast-export --resume-from 0 \ + --rules ./coriolis.rules \ + --identity-map ./authors.txt \ + /dsk/l1/jpc/svn2git/svn > svn-all-fast-export.log diff --git a/chamsin/CMakeLists.txt b/chamsin/CMakeLists.txt deleted file mode 100644 index 22a992dc..00000000 --- a/chamsin/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -project(CHAMSIN) - -cmake_minimum_required(VERSION 2.4.0) - -set(CMAKE_MODULE_PATH "$ENV{HURRICANE_TOP}/share/cmake_modules/" - "$ENV{HURRICANE_TOP}/share/cmake_modules/") - -find_package(BISON REQUIRED) -find_package(FLEX REQUIRED) -find_package(HURRICANE REQUIRED) -find_package(CORIOLIS REQUIRED) -find_package(Qt4 REQUIRED) # find and setup Qt4 for this project -find_package(LibXml2 REQUIRED) - -add_subdirectory(src) -add_subdirectory(etc) diff --git a/chamsin/etc/CMakeLists.txt b/chamsin/etc/CMakeLists.txt deleted file mode 100644 index 373440f6..00000000 --- a/chamsin/etc/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -install(FILES technology.hcmos9.dtr.xml DESTINATION /share/etc) diff --git a/chamsin/etc/technology.hcmos9.dtr.xml b/chamsin/etc/technology.hcmos9.dtr.xml deleted file mode 100644 index c3d225c9..00000000 --- a/chamsin/etc/technology.hcmos9.dtr.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/chamsin/src/CMakeLists.txt b/chamsin/src/CMakeLists.txt deleted file mode 100644 index a0d8dff8..00000000 --- a/chamsin/src/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -ADD_SUBDIRECTORY(technology) -ADD_SUBDIRECTORY(analogic) -ADD_SUBDIRECTORY(tests) diff --git a/chamsin/src/analogic/AnalogComponent.h b/chamsin/src/analogic/AnalogComponent.h deleted file mode 100644 index 98ee0dea..00000000 --- a/chamsin/src/analogic/AnalogComponent.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef ANALOGCOMPONENT_H -#define ANALOGCOMPONENT_H - -#include "hurricane/Cell.h" -using namespace Hurricane; - -//#include "DeviceParameter.h" - -class AnalogComponent : public Cell { -#if 0 - public: - struct ParameterCompare: - public std::binary_function { - bool operator()(const Parameter<>* dp1, const Parameter<>* dp2) const { - return dp1->_id < dp2->_id; - } - }; - - typedef set, ParameterCompare> ParameterSet; - Parameter* getParameter(const string& parameterId) const; -#endif - protected: - AnalogComponent(Library* library, const Name& name): Cell(library, name) {} -#if 0 - void addParameter(const Parameter* parameter) { - _parameterSet.insert(parameter); - } - private: - ParameterSet _parameterSet; -#endif - -}; - -#endif // ANALOGCOMPONENT_H diff --git a/chamsin/src/analogic/CMakeLists.txt b/chamsin/src/analogic/CMakeLists.txt deleted file mode 100644 index 9c2f6474..00000000 --- a/chamsin/src/analogic/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -INCLUDE_DIRECTORIES(${CHAMSIN_SOURCE_DIR}/src/technology ${HURRICANE_INCLUDE_DIR}) - -ADD_LIBRARY(analogic SHARED Transistor.cpp Capacitor.cpp Resistor.cpp Device.cpp - MetaTransistor.cpp MetaCapacitor.cpp) - -TARGET_LINK_LIBRARIES(analogic atechnology ${HURRICANE_LIBRARIES}) - -INSTALL(TARGETS analogic DESTINATION /lib) diff --git a/chamsin/src/analogic/Capacitor.cpp b/chamsin/src/analogic/Capacitor.cpp deleted file mode 100644 index 277d54dd..00000000 --- a/chamsin/src/analogic/Capacitor.cpp +++ /dev/null @@ -1,298 +0,0 @@ -#include "hurricane/Technology.h" -#include "hurricane/Pad.h" -#include "hurricane/UpdateSession.h" -#include "hurricane/DataBase.h" -using namespace Hurricane; - -#include "AEnv.h" -#include "ATechnology.h" -#include "Capacitor.h" - -namespace { -Layer* getLayer(Technology* technology, const string& layerStr) { - Layer* layer = technology->getLayer(layerStr); - if (!layer) { - throw Error("Unknown Layer : " + layerStr); - } - return layer; -} - -Pad* createPad(Technology* technology, Net* net, const string& layerName) { - static Box emptyBox(0, 0, 0, 0); - Layer* layer = getLayer(technology, layerName); - Pad* pad = Pad::create(net, layer, emptyBox); - return pad; -} -} - - -//Déclaration des deux armatures: -//******************************* -const Name Capacitor::BottomPlateName("BOTTOMPLATE"); -const Name Capacitor::TopPlateName("TOPPLATE"); - -#if 0 -const Name Capacitor::AnonymousName("ANONYMOUS"); - - -//les 4 types des capas unitaire: -//1-capa unitaire -//2-le Rectangle -//3-le Stub -//4-le Trou -Capacitor::Type::Type(const Code& code): - _code(code) -{} - -Capacitor::Type::Type(const Type& type): - _code(type._code) -{}SVN - -Capasitor::Type& Capasitor::Type::operator=(const Type& type) { - _code = type._code; - return *this; -} -#endif - - -//la mise des valeurs initials: -//c'est le Constructeur: -//********************* -Capacitor::Capacitor(Library* library, const Name& name): - AnalogComponent(library, name), - _bottomPlate(NULL), - _topPlate(NULL), - _anonymous(NULL), - _l(0), _w(0), - _topPlate10(NULL), - _topPlate20(NULL),_topPlate30(NULL), - _bottomPlate00(NULL) -#if 0 - _anonymous01(NULL), - _anonymous11(NULL), - _anonymous12(NULL), - _anonymous13(NULL), - _anonymous21(NULL), - _anonymousT11(NULL), - _anonymousT12(NULL), - _anonymousT13(NULL), - _anonymousT14(NULL), - _anonymousT21(NULL) -#endif -{} - - -//Déclaration de la library: -//************************* -Capacitor* Capacitor::create(Library* library, const Name& name) { - Capacitor* capacitor = new Capacitor(library, name); - capacitor->_postCreate(); - return capacitor; -} - - -//création des signaux et des noeuds: -//*********************************** -void Capacitor::_postCreate() { - Inherit::_postCreate(); - - DataBase* db = DataBase::getDB(); - Technology* technology = db->getTechnology(); - - _bottomPlate = Net::create(this, BottomPlateName); - _bottomPlate->setExternal(true); - _topPlate = Net::create(this, TopPlateName); - _topPlate->setExternal(true); -// _anonymous = Net::create(this, AnonymousName); - - - _topPlate10 = createPad(technology, _topPlate, "topmim6"); - _topPlate20 = createPad(technology, _topPlate, "padopen"); - _topPlate30 = createPad(technology, _topPlate, "alucap"); - _bottomPlate00 = createPad(technology, _bottomPlate, "botmim6"); - #if 0 - - _anonymous01 = createPad(technology, _anonymous, "Implant"); - _anonymous11 = createPad(technology, _anonymous, "topmim6"); - _anonymous12 = createPad(technology, _anonymous, "topmim6"); - _anonymous13 = createPad(technology, _anonymous, "topmim6"); - _anonymous21 = createPad(technology, _anonymous, "padopen"); - _anonymous14 = createPad(technology, _anonymous, "topmim6"); - -#endif - -} - -#if 0 -void Capacitor::setType(Type type) { - UpdateSession::open(); - if (type != _type) { - _type = type; - DataBase* db = DataBase::getDB(); - Technology* technology = db->getTechnology(); - - if (_type == Type::unitaire) { - _anonymous01->setLayer(getLayer(technology, "Implant")); - } else if (_type == Type::Rectangle) { - _anonymous11->setLayer(getLayer(technology, "topmim6")); - _anonymous12->setLayer(getLayer(technology, "topmim6")); - _anonymous21->setLayer(getLayer(technology, "padopen")); - } else if (_type == Type::Stub) { - _anonymous11->setLayer(getLayer(technology, "topmim6")); - _anonymous12->setLayer(getLayer(technology, "topmim6")); - _anonymous13->setLayer(getLayer(technology, "topmim6")); - _anonymous21->setLayer(getLayer(technology, "padopen")); - } else if (_type == Type::Trou) { - _anonymous11->setLayer(getLayer(technology, "topmim6")); - _anonymous12->setLayer(getLayer(technology, "topmim6")); - _anonymous13->setLayer(getLayer(technology, "topmim6")); - _anonymous14->setLayer(getLayer(technology, "topmim6")); - _anonymous21->setLayer(getLayer(technology, "padopen")); - - updateLayout(); - } - UpdateSession::close(); -} - -#endif - -//la fonction updateLayout -//qui met en oeuvre de nouvau les parametres du capa -//au cas ou il y a n' importe auel changement -//****************************************** -void Capacitor::updateLayout() { - DataBase* db = DataBase::getDB(); - - if (!db) { - throw Error("Error : no DataBase"); - } - Technology* techno = db->getTechnology(); - if (!techno) { - throw Error("Error : no Technology"); - } - - ATechnology* atechno = AEnv::getATechnology(); - - //**Pour topPlate20 -> PADOPEN-MIM - //******************************** - DbU::Unit widthCut6 = atechno->getPhysicalRule("padOpenMIMWidth")->getValue(); - DbU::Unit spacingCut6 = atechno->getPhysicalRule("padOpenMIMSpace")->getValue(); - DbU::Unit enclosureCut6 = atechno->getPhysicalRule("padOpenMIMMETAL6Enclosure")->getValue(); - - //**Pour topPlate30 -> ALUCAP-MIM - //******************************* - DbU::Unit widthAluCap = atechno->getPhysicalRule("aluCapMIMWidth")->getValue(); - DbU::Unit enclosureVia6 = atechno->getPhysicalRule("aluCapMIMVIA6Enclosure")->getValue(); - //DbU::Unit distanceAlucapTopmin = atechno->getPhysicalRule("aluCapMIMDistance")->getValue(); - DbU::Unit enclosureTopMim = atechno->getPhysicalRule("aluCapMIMTopMIM6Enclosure")->getValue(); - DbU::Unit enclosureBotMim = atechno->getPhysicalRule("aluCapMIMBotMIM6Enclosure")->getValue(); - //DbU::Unit distanceAluc = atechno->getPhysicalRule("minAlucapDistance")->getValue(); - - //**Pour topPlate10 -> TOPMIM6 - //**************************** - DbU::Unit widthTopmim = atechno->getPhysicalRule("topPlateMIMminWidth")->getValue(); - DbU::Unit spacingTopmim = atechno->getPhysicalRule("topPlateMIMSpacing")->getValue(); - DbU::Unit enclosureByBotmimTopmim = atechno->getPhysicalRule("topPlateMIMBotEnclosure")->getValue(); - //DbU::Unit enclosureVia6Topmim = atechno->getPhysicalRule("minViaEnclosure")->getValue(); - DbU::Unit enclosureBotmimContact = atechno->getPhysicalRule("topPlateMIMBotmimContact")->getValue(); - - //**Pour BottomPlate -> BOTMIM6 - //***************************** - DbU::Unit widthBotmim = atechno->getPhysicalRule("botPlateMIMWidth")->getValue(); - DbU::Unit spacingBotmim = atechno->getPhysicalRule("botPlateMIMSpacing")->getValue(); - DbU::Unit enclosureVia6Botmim = atechno->getPhysicalRule("botPlateMIMViaEnclosure")->getValue(); - - UpdateSession::open(); - DbU::setStringMode(1); - - - //*les Box*// - //*********// - - //topPlate 10: - //l'armature haute est le reference - //car la valeur du capa corespond au W et L de l'armature haute - //************************************************************* - - DbU::Unit x10 = 0; - DbU::Unit y10 = 0; - DbU::Unit dx10 = _l; - DbU::Unit dy10 = _w; - Box box10(x10, y10, x10 + dx10, y10 + dy10); - _topPlate10->setBoundingBox(box10); - - - //topPlate 30: - //*********** - DbU::Unit x30 = enclosureTopMim; - DbU::Unit y30 = enclosureTopMim; - DbU::Unit dx30 = _l -(2 * enclosureTopMim); - DbU::Unit dy30 = _w -(2 * enclosureTopMim) ; - Box box30(x30, y30, x30 + dx30, y30 + dy30); - _topPlate30->setBoundingBox(box30); - - - //topPlate 20: - //*********** - DbU::Unit x20 = enclosureTopMim + enclosureVia6 ; - DbU::Unit y20 = enclosureTopMim + enclosureVia6 ; - DbU::Unit dx20 = widthCut6 ; - DbU::Unit dy20 = widthCut6 ; - Box box20(x20, y20, x20 + dx20, y20 + dy20); - _topPlate20->setBoundingBox(box20); - - - //bottomPlate 00: - //************** - DbU::Unit x00 = 0 - enclosureByBotmimTopmim; - DbU::Unit y00 = 0 - enclosureByBotmimTopmim; - DbU::Unit dx00 = _l + (2 * enclosureByBotmimTopmim); - DbU::Unit dy00 = _w + (2 * enclosureByBotmimTopmim); - Box box00(x00, y00, x00 + dx00, y00 + dy00); - _bottomPlate00->setBoundingBox(box00); - -#if 0 - - //emboitement->anonymous01: - //************************ - DbU::Unit x01 = 0 - enclosureByBotmimTopmim - spacingTopmim ; - DbU::Unit y01 = 0 - enclosureByBotmimTopmim - spacingTopmim ; - DbU::Unit dx01 = _l + (2 * enclosureByBotmimTopmim) + (2 * spacingTopmim); - DbU::Unit dy01 = _w + (2 * enclosureByBotmimTopmim) + (2 * spacingTopmim); - Box box01(x01, y01, x01 + dx01, y01 + dy01); - _anonymous01->setBoundingBox(box01); -#endif - - UpdateSession::close(); -} - - -Record* Capacitor::_getRecord() const { - Record* record = Inherit::_getRecord(); - if (record) { - record->add(getSlot("BottomPlate", _bottomPlate)); - record->add(getSlot("TopPlate", _topPlate)); - - record->add(getSlot("L", &_l)); - record->add(getSlot("W", &_w)); - - record->add(getSlot("TopPlate20", _topPlate20)); - record->add(getSlot("TopPlate30", _topPlate30)); - record->add(getSlot("TopPlate10", _topPlate10)); - record->add(getSlot("BottomPlate00", _bottomPlate00)); - -#if 0 - record->add(getSlot("Anonymous01", _anonymous01)); - record->add(getSlot("Anonymous11", _anonymous11)); - record->add(getSlot("Anonymous12", _anonymous12)); - record->add(getSlot("Anonymous13", _anonymous13)); - record->add(getSlot("Anonymous21", _anonymous21)); - record->add(getSlot("AnonymousT11", _anonymousT11)); - record->add(getSlot("AnonymousT12", _anonymousT12)); - record->add(getSlot("AnonymousT13", _anonymousT13)); - record->add(getSlot("AnonymousT14", _anonymousT14)); - record->add(getSlot("AnonymousT21", _anonymousT21)); -#endif - } - return record; -} diff --git a/chamsin/src/analogic/Capacitor.h b/chamsin/src/analogic/Capacitor.h deleted file mode 100644 index 12964980..00000000 --- a/chamsin/src/analogic/Capacitor.h +++ /dev/null @@ -1,48 +0,0 @@ -#ifndef CAPACITOR_H -#define CAPACITOR_H - -#include "AnalogComponent.h" - -class Capacitor : public AnalogComponent { - public: - static const Name BottomPlateName; - static const Name TopPlateName; - - static Capacitor* create(Library* library, const Name& name); - void updateLayout(); - -// void setType(Type type); -// void setType(Type type); - - void setW(DbU::Unit value) { _w = value; updateLayout(); } - void setL(DbU::Unit value) { _l = value; updateLayout(); } - - virtual Record* _getRecord() const; - - protected: - void _postCreate(); - - private: - Net* _bottomPlate; - Net* _topPlate; - Net* _anonymous; - DbU::Unit _l; - DbU::Unit _w; - Pad* _topPlate10; - Pad* _topPlate20; - Pad* _topPlate30; - Pad* _bottomPlate00; - Pad *_anonymous01; - Pad *_anonymous11; - Pad *_anonymous12; - Pad *_anonymous13; - Pad *_anonymous21; - Pad *_anonymous14; - - - - Capacitor(Library* library, const Name& name); -}; - - -#endif // CAPACITOR_H diff --git a/chamsin/src/analogic/ChoiceParameter.h b/chamsin/src/analogic/ChoiceParameter.h deleted file mode 100644 index 36a5cb95..00000000 --- a/chamsin/src/analogic/ChoiceParameter.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef CHOICEPARAMETER_H -#define CHOICEPARAMETER_H - -#include "DeviceParameter.h" - -template -class ChoiceParameter : public Parameter { - public: - typedef vector Choices; - ChoiceParameter(string id, Choices& choices, - unsigned value, CallBack* callBack): - Parameter(id, callBack), _choices(), _value(value) { - if (_value > choices.size()) { - throw Error(""); - } - } - private: - Choices _choices; - unsigned _value; - -}; - -#endif // CHOICEPARAMETER_H diff --git a/chamsin/src/analogic/Device.cpp b/chamsin/src/analogic/Device.cpp deleted file mode 100644 index fb297584..00000000 --- a/chamsin/src/analogic/Device.cpp +++ /dev/null @@ -1,24 +0,0 @@ -#include "hurricane/UpdateSession.h" -using namespace Hurricane; - -#include "Device.h" - -Device::Device(Library* library, const Name& name): - AnalogComponent(library, name) -{} - -Device* Device::create(Library* library, const Name& name) { - Device* device = new Device(library, name); - - device->_postCreate(); - - return device; -} - -void Device::_postCreate() { - Inherit::_postCreate(); - - UpdateSession::open(); - ///// - UpdateSession::close(); -} diff --git a/chamsin/src/analogic/Device.h b/chamsin/src/analogic/Device.h deleted file mode 100644 index 7105b2da..00000000 --- a/chamsin/src/analogic/Device.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef DEVICE_H -#define DEVICE_H - -#include "AnalogComponent.h" - -class Device : public AnalogComponent { - public: - static Device* create(Library* library, const Name& name); - - protected: - void _postCreate(); - - protected: - - Device(Library* library, const Name& name); -}; - - -#endif // DEVICE_H diff --git a/chamsin/src/analogic/DeviceParameter.h b/chamsin/src/analogic/DeviceParameter.h deleted file mode 100644 index f9fef02a..00000000 --- a/chamsin/src/analogic/DeviceParameter.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef PARAMETER_H -#define PARAMETER_H - -#include "CallBack.h" - -class Parameter { - public: - const string _id; - protected: - Parameter(string id, CallBack* callBack): _id(id), _callBack(callBack) {} - private: - CallBack* _callBack; -}; - -#endif // PARAMETER_H diff --git a/chamsin/src/analogic/GenV1Trans.cpp b/chamsin/src/analogic/GenV1Trans.cpp deleted file mode 100644 index bc2ba6dd..00000000 --- a/chamsin/src/analogic/GenV1Trans.cpp +++ /dev/null @@ -1,581 +0,0 @@ -// **************************************************************************************************** -// File: GenV1Trans.cpp -// Authors: Wu YiFei -// Date : 04/04/2007 -// **************************************************************************************************** - -#include "Technology.h" -#include "UpdateSession.h" -#include "DataBase.h" - -#include "RdsUnit.h" -#include "DtrAccess.h" -#include "AnalogicalCommons.h" -#include "GenTrans.h" - -#define MAXLONG(a,b) (a>b?a:b) -#define MINLONG(a,b) (a>b?b:a) - -#define SAVE_RECTANGLE(s, x, y, dx, dy) \ - _mapString2Box[string(s)] = Box(getUnit(x), getUnit(y), getUnit(x+dx), getUnit(y+dy)); \ - xmin = MINLONG(xmin, getUnit(x)); \ - ymin = MINLONG(ymin, getUnit(y)); - -#define GET_RULE(s) \ - dtraccess->getSingleRdsRuleByLabel(string(s)) - -#define BOX_IS_VALID(box) \ - ( (long)(getValue(box.getXMin()))%2==0 )&& \ - ( (long)(getValue(box.getXMax()))%2==0 )&& \ - ( (long)(getValue(box.getYMin()))%2==0 )&& \ - ( (long)(getValue(box.getYMax()))%2==0 ) - -#define CREATE_CONTACT_MATRIX_UNDER(underbox, nbcolumn, layer, net) \ - \ - if(underbox.getHeight()getL() < dtraccess->getSingleRealRuleByLabel("L_TRANS") || - _masqueV1Info->getL() > dtraccess->getSingleRealRuleByLabel("L_TRANS_MAX") || - _masqueV1Info->getW() < dtraccess->getSingleRealRuleByLabel("W_TRANS") || - _masqueV1Info->getW() > dtraccess->getSingleRealRuleByLabel("W_TRANS_MAX") ) - - throw Error("Can't launch function GenV1Trans::Calculate for " + getString(transistor) - + " the L " + getString(_masqueV1Info->getL()) - + " or the W " + getString(_masqueV1Info->getW()) - + " of this transistor is invalid." - ); - - if(_masqueV1Info->getNbSourceColumn() < 1 || _masqueV1Info->getNbSourceColumn() > GenV1Trans::maxNbContacts || - _masqueV1Info->getNbDrainColumn() < 1 || _masqueV1Info->getNbDrainColumn() > GenV1Trans::maxNbContacts ) - - throw Error("Can't launch function GenV1Trans::Calculate for " + getString(transistor) - + " the nbsourcecolumn " + getString(_masqueV1Info->getNbSourceColumn()) - + " or the nbdraincolumn " + getString(_masqueV1Info->getNbDrainColumn()) - + " of this transistor is invalid." - ); - - IF_DEBUG_HUR_ANALOG - cout << getString(transistor) + " 's masqueinfo is " + getString(_masqueV1Info) - << endl; - END_IF - - - // Tempory Variable. - // ************************** - long x00, y00, dx00, dy00; - long x10, y10, dx10, dy10; - long x11, y11, dx11, dy11; - long x12, y12, dx12, dy12; - long x20, y20, dx20, dy20; - long x23, y23, dx23, dy23; - long x30, y30, dx30, dy30; - long x31, y31, dx31, dy31; - long x01, y01, dx01, dy01; - long x40, y40, dx40, dy40; - long x43, y43, dx43, dy43; - long x50, y50, dx50, dy50; - - long xmin = 999999L, ymin = 999999L; - long realw = 0; - - // Tempory Variable. - // ************************** - long extension1 = 0; - long extension2 = 0; - long extension3 = 0; - long extension4 = 0; - long ymax = 0; - string mostype; // get Mos Type (N/P). - - if(transistor->isNmos()) - mostype='N'; - else - mostype='P'; - - //string mostype; // get Mos Type (N/P). - //mostype=transistor->getType(); - - // ------------------------------------------------------------- - // Begin Calculate. - - //long re_imp_acti = GET_RULE_BYNP("RE_", mostype, "IMP_ACTI"); - long re_imp_acti = dtraccess->getSingleRdsRuleByLabel("RE_", mostype, "IMP_ACTI"); - long re_imp_poly = dtraccess->getSingleRdsRuleByLabel("RE_", mostype, "IMP_POLY"); - long re_imp_cont = dtraccess->getSingleRdsRuleByLabel("RE_", mostype, "IMP_CONT"); - long re_imp_gate = dtraccess->getSingleRdsRuleByLabel("RE_", mostype, "IMP_GATE"); - //long re_well_acti = GET_RULE_BYNP("RE_", mostype, "WELL_ACTI"); - - // Calculate Rectangle 00 - // ********************** - x00 = 0; - y00 = -dtraccess->getSingleRdsRuleByLabel("RE_GATE_ACTI"); - - dx00 = ConvertRealToRdsUnit(_masqueV1Info->getL()); - realw = ConvertRealToRdsUnit(_masqueV1Info->getW()); - - dy00 = realw + 2*(-y00); - - SAVE_RECTANGLE("00", x00, y00, dx00, dy00); - - - // Calculate Rectangle 30 - // ********************** - -// cout << "RD_ACTI_CONT is " << dtraccess->getSingleRdsRuleByLabel("RD_ACTI_CONT")<getSingleRdsRuleByLabel("RD_ACTI_POLY")<getSingleRdsRuleByLabel("RE_POLY_CONT")<getSingleRdsRuleByLabel("RD_ACTI_CONT"), GET_RULE("RD_ACTI_POLY") + GET_RULE("RE_POLY_CONT"))) <getSingleRdsRuleByLabel("RW_CONT") + 2*GET_RULE("RE_POLY_CONT"); - if (dx31 >= dx00) { - dx30 = dtraccess->getSingleRdsRuleByLabel("RW_CONT"); - dy30 = dx30; - y30 = 0 + realw + MAXLONG(dtraccess->getSingleRdsRuleByLabel("RD_ACTI_CONT"), GET_RULE("RD_ACTI_POLY") + GET_RULE("RE_POLY_CONT")); - } - else { - dx30 = dx00 - 2*dtraccess->getSingleRdsRuleByLabel("RE_POLY_CONT"); - dy30 = dtraccess->getSingleRdsRuleByLabel("RW_CONT"); - y30 = 0 + realw + dtraccess->getSingleRdsRuleByLabel("RD_ACTI_CONT"); - } - - x30 = x00 + dx00/2 - dx30/2; - - SAVE_RECTANGLE("30", x30, y30, dx30, dy30) - - - // Calculate Rectangle 31 - // ********************** - dx31 = dx30 + 2*dtraccess->getSingleRdsRuleByLabel("RE_POLY_CONT"); - dy31 = dy30 + 2*dtraccess->getSingleRdsRuleByLabel("RE_POLY_CONT"); - x31 = x30 - dtraccess->getSingleRdsRuleByLabel("RE_POLY_CONT"); - y31 = y30 - dtraccess->getSingleRdsRuleByLabel("RE_POLY_CONT"); - - SAVE_RECTANGLE("31", x31, y31, dx31, dy31) - - - // Calculate Rectangle 01 - // ********************** - if ( y31 <= (y00+dy00) ) { - x01 = 0; y01 = 0; dx01 = 0; dy01 = 0; - } - else { - x01 = x00; - y01 = y00 + dy00; - dx01 = dx00; - dy01 = y31 - (y00 + dy00); - } - - SAVE_RECTANGLE("01", x01, y01, dx01, dy01) - - - // Calculate Rectangle 12 - // ********************** - x12 = MINLONG(x31, x00) - re_imp_poly; - y12 = MINLONG(0 - re_imp_acti, y00 - re_imp_poly); - dx12 = MAXLONG(dx31, dx00) + 2 * re_imp_poly; - - ymax = MAXLONG( MAXLONG( y30 + dy30 + re_imp_cont - , MAXLONG(y31 + dy31, y00 + dy00) + re_imp_poly ) - , realw + re_imp_acti ); - - dy12 = ymax - y12 ; - - SAVE_RECTANGLE("12", x12, y12, dx12, dy12) - - - // Calculate Rectangle 20 - // ********************** - y20 = 0 + dtraccess->getSingleRdsRuleByLabel("RE_ACTI_CONT"); - dy20 = realw - 2 * dtraccess->getSingleRdsRuleByLabel("RE_ACTI_CONT"); - dx20 = (_masqueV1Info->getNbSourceColumn()) * dtraccess->getSingleRdsRuleByLabel("RW_CONT") + - ((_masqueV1Info->getNbSourceColumn()) - 1) * dtraccess->getSingleRdsRuleByLabel("RD_CONT"); - x20 = 0 - ( dx20 + dtraccess->getSingleRdsRuleByLabel("RD_CONT_GATE") ); - - SAVE_RECTANGLE("20", x20, y20, dx20, dy20) - - - // Calculate Rectangle 40 - // ********************** - y40 = y20; - x40 = x00 + dx00 + dtraccess->getSingleRdsRuleByLabel("RD_CONT_GATE"); - dx40 = (_masqueV1Info->getNbDrainColumn()) * dtraccess->getSingleRdsRuleByLabel("RW_CONT") + - ((_masqueV1Info->getNbDrainColumn()) - 1) * dtraccess->getSingleRdsRuleByLabel("RD_CONT"); - dy40 = dy20; - - SAVE_RECTANGLE("40", x40, y40, dx40, dy40) - - // Calculate Rectangle 10 - // ********************** - y10 = 0; - x10 = MINLONG(x20 - dtraccess->getSingleRdsRuleByLabel("RE_ACTI_CONT"), 0 - GET_RULE("RE_ACTI_GATE")); - dy10 = realw; - - extension1 = MAXLONG(0 + x40 + dx40 + dtraccess->getSingleRdsRuleByLabel("RE_ACTI_CONT"), dx00 + GET_RULE("RE_ACTI_GATE")); - - dx10 = 0 - x10 + extension1; - - SAVE_RECTANGLE("10", x10, y10, dx10, dy10) - - - // Calculate Rectangle 23 - // *********************** - x23 = x10; - y23 = y10; - dx23 = 0 - x10; - dy23 = realw; - - SAVE_RECTANGLE("23", x23, y23, dx23, dy23) - - - // Calculate Rectangle 43 - // ********************** - x43 = x00 + dx00 ; - y43 = y10; - dx43 = x10 + dx10 - (x00 + dx00); - dy43 = realw; - - SAVE_RECTANGLE("43", x43, y43, dx43, dy43) - - - // Calculate Rectangle 11 - // ********************** - extension1 = re_imp_gate; - extension2 = re_imp_cont + 0 - x20; - extension3 = re_imp_acti + 0 - x10; - - extension4 = MAXLONG(MAXLONG(extension1, extension2), extension3); - - x11 = 0 - extension4; - - extension1 = re_imp_gate + x00 + dx00; - extension2 = re_imp_cont + x40 + dx40; - extension3 = re_imp_acti + x10 + dx10; - - extension4 = MAXLONG(MAXLONG(extension1, extension2), extension3); - - dx11 = 0 - x11 + extension4; - - y11 = MINLONG(y20 - re_imp_cont, y23 - re_imp_acti); - - ymax = MAXLONG(y20 + dy20 + re_imp_cont, y23 + dy23 + re_imp_acti); - - dy11 = ymax - y11; - - SAVE_RECTANGLE("11", x11, y11, dx11, dy11); - - - // Calculate Rectangle 50 just for PMOS. - // ------------------------------------------------------------- - if (transistor->isPmos()) { // Calculate Rectangle 50 for PMos. - x50 = x10 - dtraccess->getSingleRdsRuleByLabel("RE_NWELL_ACTI"); - y50 = y10 - dtraccess->getSingleRdsRuleByLabel("RE_NWELL_ACTI"); - dx50 = dx10 + 2 * dtraccess->getSingleRdsRuleByLabel("RE_NWELL_ACTI"); - dy50 = dy10 + 2 * dtraccess->getSingleRdsRuleByLabel("RE_NWELL_ACTI"); - - SAVE_RECTANGLE("50", x50, y50, dx50, dy50); - } - - // End Calculate. - // ------------------------------------------------------------- - - // Translate rectangles. - // ********************* - map::iterator i = _mapString2Box.begin(), - j = _mapString2Box.end(); - - while(i!=j) { - _mapString2Box[(*i).first] = (*i).second.translate(-xmin, -ymin); - - IF_DEBUG_HUR_ANALOG - cout << (*i).first <<" " << getString((*i).second) << endl; - END_IF - - assert(BOX_IS_VALID((*i).second)); - i++; - } - -} - - -void GenV1Trans::Generate(Transistor* transistor) -// ********************************************* -{ - UpdateSession::open(); - - Net* source = transistor->getNet(Name(transistor->getSourceName())); - Net* drain = transistor->getNet(Name(transistor->getDrainName()) ); - Net* grid = transistor->getNet(Name(transistor->getGridName()) ); - - DtrAccess * dtraccess = DtrAccess::getDtrAccess(); - //string mostype(1, transistor->getType()); // get Mos Type (N/P). - - string mostype; // get Mos Type (N/P). - - if(transistor->isNmos()) - mostype='N'; - else - mostype='P'; - - long rw_cont = getUnit(dtraccess->getSingleRdsRuleByLabel("RW_CONT")); - long rd_cont = getUnit(dtraccess->getSingleRdsRuleByLabel("RD_CONT")); - unsigned nbcontact = 0; - long tmp_xcenter = 0; - long tmp_ycenter = 0; - - DataBase * db = getDataBase(); - - if(!db) throw Error("In getV1Trans::Generate : can't find DataBase"); - - //Technology * tech = db->getTechnology(); - - Layer* layer_20 = dtraccess->getSingleLayerByLabel("M1TRANS_",mostype,"_LAYER_20"); - Layer* layer_30 = dtraccess->getSingleLayerByLabel("M1TRANS_",mostype,"_LAYER_30"); - Layer* layer_40 = dtraccess->getSingleLayerByLabel("M1TRANS_",mostype,"_LAYER_40"); - - - // ------------------------------------------------------------- - // Begin Generation. - - // Cenerate Components For Net Source. - // *********************************** -IF_DEBUG_HUR_ANALOG - cout << "Begin for create components for net Source of " << getString(transistor) << endl; -END_IF - - for(size_t i=0; igetNbSourceColumn(), layer_20, source) - //cout << " Finish create contact for source " <getSingleLayerByLabel("M1TRANS_",mostype,"_LAYER_"+segsforsource[i]) - // , _mapString2Box[segsforsource[i]].getXCenter() - // , _mapString2Box[segsforsource[i]].getYCenter() - // , _mapString2Box[segsforsource[i]].getWidth() - // , _mapString2Box[segsforsource[i]].getHeight() - // ); - } - } - -IF_DEBUG_HUR_ANALOG - cout << "End for create components for net Source of " << getString(transistor) << endl; -END_IF - - - // Generate Components For Net Grid. - // ********************************* -IF_DEBUG_HUR_ANALOG - cout << "Begin for create components for net Grid of " << getString(transistor) << endl; -END_IF - for(size_t i=0; igetSingleRdsRuleByLabel("RW_CONT") ) { - Contact::create(grid, dtraccess->getSingleLayerByLabel("M1TRANS_",mostype,"_LAYER_"+segsforgrid[i]) - , _mapString2Box[segsforgrid[i]].getXCenter() - , _mapString2Box[segsforgrid[i]].getYCenter() - , _mapString2Box[segsforgrid[i]].getWidth() - , _mapString2Box[segsforgrid[i]].getHeight() - ); - } - else { - unsigned int nbcolumn = (_mapString2Box[segsforgrid[i]].getWidth()-rw_cont)/(rw_cont + rd_cont) + 1; - -IF_DEBUG_HUR_ANALOG - cout << "nbcolumn in rectangle 30 is " << nbcolumn <getSingleLayerByLabel("M1TRANS_",mostype,"_LAYER_"+segsforgrid[i]) - , _mapString2Box[segsforgrid[i]].getXCenter() - , _mapString2Box[segsforgrid[i]].getYCenter() - , _mapString2Box[segsforgrid[i]].getWidth() - , _mapString2Box[segsforgrid[i]].getHeight() - ); - } - } - - } - -IF_DEBUG_HUR_ANALOG - cout << "End for create components for net Grid of " << getString(transistor) << endl; -END_IF - - - // Generate Components For Net Drain. - // ********************************** -IF_DEBUG_HUR_ANALOG - cout << "Begin for create components for net Drain of " << getString(transistor) << endl; -END_IF - for(size_t i=0; igetNbDrainColumn(), layer_40, drain) - //cout << " Finish create contact for drain" <getSingleLayerByLabel("M1TRANS_",mostype,"_LAYER_"+segsfordrain[i]) - , _mapString2Box[segsfordrain[i]].getXCenter() - , _mapString2Box[segsfordrain[i]].getYCenter() - , _mapString2Box[segsfordrain[i]].getWidth() - , _mapString2Box[segsfordrain[i]].getHeight() - ); - } - } - -IF_DEBUG_HUR_ANALOG - cout << "End for create components for net Drain of " << getString(transistor) << endl; -END_IF - - // Generate Components For Anonyms Nets. - // ************************************* -IF_DEBUG_HUR_ANALOG - cout << "Begin for create components for net Anonyme of " << getString(transistor) << endl; -END_IF - Net * anonym = Net::create(transistor, Name("anonym")); - for(size_t i=0; iisNmos() && segsforanonym[i]=="50") - continue; - - Contact::create(anonym, dtraccess->getSingleLayerByLabel("M1TRANS_",mostype,"_LAYER_"+segsforanonym[i]) - , _mapString2Box[segsforanonym[i]].getXCenter() - , _mapString2Box[segsforanonym[i]].getYCenter() - , _mapString2Box[segsforanonym[i]].getWidth() - , _mapString2Box[segsforanonym[i]].getHeight() - ); - } - -IF_DEBUG_HUR_ANALOG - cout << "End for create components for net Anonyme of " << getString(transistor) << endl; -END_IF - - // End Generation. - // ------------------------------------------------------------- - - UpdateSession::close(); - - // Set Transistor::_mapNet2Box. - // **************************** - (*(transistor->_getMapNet2Box()))[grid] = _mapString2Box[string("30")]; - (*(transistor->_getMapNet2Box()))[source] = _mapString2Box[string("20")]; - (*(transistor->_getMapNet2Box()))[drain] = _mapString2Box[string("40")]; - - cout<< getString(_mapString2Box[string("30")]) <getAbutmentType().getCode()) { - - case Transistor::Type::INTERNAL : - transistor->setAbutmentBox( Box(_mapString2Box[string("20")].getXCenter() - , transistor->getBoundingBox().getYMin() - , _mapString2Box[string("40")].getXCenter() - , transistor->getBoundingBox().getYMax() - ) - ); - break; - - case Transistor::Type::LEFT: - transistor->setAbutmentBox( Box(_mapString2Box[string("11")].getXMin() - , transistor->getBoundingBox().getYMin() - , _mapString2Box[string("40")].getXCenter() - , transistor->getBoundingBox().getYMax() - ) - ); - break ; - - case Transistor::Type::RIGHT: - transistor->setAbutmentBox( Box(_mapString2Box[string("20")].getXCenter() - , transistor->getBoundingBox().getYMin() - , _mapString2Box[string("11")].getXMax() - , transistor->getBoundingBox().getYMax() - ) - ); - break ; - - case Transistor::Type::SINGLE: - transistor->setAbutmentBox( Box(_mapString2Box[string("11")].getXMin() - , transistor->getBoundingBox().getYMin() - , _mapString2Box[string("11")].getXMax() - , transistor->getBoundingBox().getYMax() - ) - ); - break ; - - default : - break; - } - - -} - -} diff --git a/chamsin/src/analogic/MetaCapacitor.cpp b/chamsin/src/analogic/MetaCapacitor.cpp deleted file mode 100644 index f143148b..00000000 --- a/chamsin/src/analogic/MetaCapacitor.cpp +++ /dev/null @@ -1,44 +0,0 @@ -#include "hurricane/UpdateSession.h" -using namespace Hurricane; - -#include "Capacitor.h" -#include "MetaCapacitor.h" - -const Name MetaCapacitor::BottomPlateName("BOTTOMPLATE"); -const Name MetaCapacitor::TopPlateName("TOPPLATE"); - -MetaCapacitor::MetaCapacitor(Library* library, const Name& name): - Device(library, name), - _capacitorMatrix(), - _rows(0), _columns(0) -{} - -MetaCapacitor* MetaCapacitor::create(Library* library, const Name& name) { - MetaCapacitor* mCapacitor = new MetaCapacitor(library, name); - - mCapacitor->_postCreate(); - - return mCapacitor; -} - -//création des signaux et des noeuds: -//*********************************** -void MetaCapacitor::_postCreate() { - Inherit::_postCreate(); - - _bottomPlate = Net::create(this, BottomPlateName); - _bottomPlate->setExternal(true); - _topPlate = Net::create(this, TopPlateName); - _topPlate->setExternal(true); - - setTerminal(false); -} - -//La matrice des capas: -void MetaCapacitor::setMatrixSize(unsigned rows, unsigned columns) { - assert(_capacitorMatrix.size() == _rows); - - if (_rows != rows && _columns != columns) { - UpdateSession::open(); - } -} diff --git a/chamsin/src/analogic/MetaCapacitor.h b/chamsin/src/analogic/MetaCapacitor.h deleted file mode 100644 index 2d71c75a..00000000 --- a/chamsin/src/analogic/MetaCapacitor.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef METACAPACITOR_H -#define METACAPACITOR_H - -#include "Device.h" - -class Capacitor; - -class MetaCapacitor : public Device { - public: - static const Name BottomPlateName; - static const Name TopPlateName; - static MetaCapacitor* create(Library* library, const Name& name); - void setMatrixSize(unsigned rows, unsigned columns); - - protected: - void _postCreate(); - - private: - MetaCapacitor(Library* library, const Name& name); - - typedef vector CapacitorVector; - typedef vector CapacitorMatrix; - CapacitorMatrix _capacitorMatrix; - unsigned _rows; - unsigned _columns; - Net* _bottomPlate; - Net* _topPlate; -}; - -#endif // METACAPACITOR_H diff --git a/chamsin/src/analogic/MetaTransistor.cpp b/chamsin/src/analogic/MetaTransistor.cpp deleted file mode 100644 index 58ca0243..00000000 --- a/chamsin/src/analogic/MetaTransistor.cpp +++ /dev/null @@ -1,166 +0,0 @@ -#include "hurricane/UpdateSession.h" -using namespace Hurricane; - -#include "Transistor.h" -#include "MetaTransistor.h" - -namespace { - -Transistor::Type metaTransistorTypeToTransistorType(const MetaTransistor::Type& type) { - switch (type) { - case MetaTransistor::Type::UNDEFINED: - return Transistor::Type::UNDEFINED; - case MetaTransistor::Type::NMOS: - return Transistor::Type::NMOS; - case MetaTransistor::Type::PMOS: - return Transistor::Type::PMOS; - default: - throw Error("Unknown MetaTransistor Type"); - } -} - -} - -const Name MetaTransistor::DrainName("DRAIN"); -const Name MetaTransistor::SourceName("SOURCE"); -const Name MetaTransistor::GridName("GRID"); -const Name MetaTransistor::BulkName("BULK"); -const Name MetaTransistor::AnonymousName("ANONYMOUS"); - -MetaTransistor::Type::Type(const Code& code): - _code(code) -{} - -MetaTransistor::Type::Type(const Type& type): - _code(type._code) -{} - -MetaTransistor::Type& MetaTransistor::Type::operator=(const Type& type) { - _code = type._code; - return *this; -} - -MetaTransistor::MetaTransistor(Library* library, const Name& name): - Device(library, name), - _drain(NULL), - _source(NULL), - _grid(NULL), - _bulk(NULL), - _anonymous(NULL), - _type(), - _m(0), _l(0.0), _w(0.0), - _transistors() -{} - -MetaTransistor* MetaTransistor::create(Library* library, const Name& name) { - MetaTransistor* mTransistor = new MetaTransistor(library, name); - - mTransistor->_postCreate(); - - return mTransistor; -} - -void MetaTransistor::_postCreate() { - Inherit::_postCreate(); - - _drain = Net::create(this, DrainName); - _drain->setExternal(true); - _source = Net::create(this, SourceName); - _source->setExternal(true); - _grid = Net::create(this, GridName); - _grid->setExternal(true); - _bulk = Net::create(this, BulkName); - _bulk->setExternal(true); - _anonymous = Net::create(this, AnonymousName); - - setTerminal(false); -} - -void MetaTransistor::setType(Type type) { - if (type != _type) { - UpdateSession::open(); - _type = type; - Transistor::Type ttype = metaTransistorTypeToTransistorType(_type); - for (Transistors::iterator tit = _transistors.begin(); - tit != _transistors.end(); - tit++) { - (*tit)->setType(ttype); - } - UpdateSession::close(); - } -} - - -void MetaTransistor::setM(unsigned m) { - assert(_transistors.size() == _m); - assert(getInstances().getSize() == _m); - if (_m != m) { - UpdateSession::open(); - if (m > _m) { - Library* library = getLibrary(); - Transformation transformation; - for (unsigned i=_m; isetType(metaTransistorTypeToTransistorType(_type)); - transistor->setL(_l); - transistor->setW(_w); - _transistors.push_back(transistor); - Instance* instance = Instance::create(this, transistorName, - transistor, transformation, Instance::PlacementStatus::FIXED); - instance->getPlug(transistor->getNet(GridName))->setNet(_grid); - instance->getPlug(transistor->getNet(SourceName))->setNet(_source); - instance->getPlug(transistor->getNet(DrainName))->setNet(_drain); - instance->getPlug(transistor->getNet(BulkName))->setNet(_bulk); - } - } else { - for (unsigned i=m; i<_m; i++) { - Transistor* transistor = _transistors.back(); - transistor->destroy(); - _transistors.pop_back(); - } - } - UpdateSession::close(); - _m = m; - updateLayout(); - } -} - -void MetaTransistor::setW(DbU::Unit value) { - _w = value; - for (Transistors::iterator tit = _transistors.begin(); - tit != _transistors.end(); - tit++) { - (*tit)->setW(_w); - } -} - -void MetaTransistor::setL(DbU::Unit value) { - _l = value; - for (Transistors::iterator tit = _transistors.begin(); - tit != _transistors.end(); - tit++) { - (*tit)->setL(_l); - } - updateLayout(); -} - -void MetaTransistor::updateLayout() { - if (_m > 0) { - assert(_transistors.size() == _m); - assert(getInstances().getSize() == _m); - - Transformation transformation(0, 0); - - UpdateSession::open(); - for_each_instance(instance, getInstances()) { - instance->setTransformation(transformation); - Box abox = instance->getAbutmentBox(); - transformation = Transformation(transformation.getTx() + abox.getWidth(), 0); - end_for; - } - UpdateSession::close(); - } -} diff --git a/chamsin/src/analogic/MetaTransistor.h b/chamsin/src/analogic/MetaTransistor.h deleted file mode 100644 index 716d0c13..00000000 --- a/chamsin/src/analogic/MetaTransistor.h +++ /dev/null @@ -1,61 +0,0 @@ -#ifndef METATRANSISTOR_H -#define METATRANSISTOR_H - -#include "Device.h" - -class Transistor; - -class MetaTransistor : public Device { - public: - class Type { - public: - enum Code {UNDEFINED=0, NMOS=1, PMOS=2}; - - Type(const Code& code = UNDEFINED); - Type(const Type& type); - - Type& operator=(const Type& type); - operator const Code&() const {return _code;}; - - const Code& getCode() const {return _code;}; - - private: - Code _code; - }; - - typedef deque Transistors; - - static const Name DrainName; - static const Name SourceName; - static const Name GridName; - static const Name BulkName; - static const Name AnonymousName; - - static MetaTransistor* create(Library* library, const Name& name); - void updateLayout(); - - void setType(Type type); - void setM(unsigned m); - void setW(DbU::Unit value); - void setL(DbU::Unit value); - - protected: - void _postCreate(); - - private: - Net* _drain; - Net* _source; - Net* _grid; - Net* _bulk; - Net* _anonymous; - Type _type; - unsigned _m; - DbU::Unit _l; - DbU::Unit _w; - Transistors _transistors; - - MetaTransistor(Library* library, const Name& name); -}; - - -#endif // METATRANSISTOR_H diff --git a/chamsin/src/analogic/Resistor.cpp b/chamsin/src/analogic/Resistor.cpp deleted file mode 100644 index 49587698..00000000 --- a/chamsin/src/analogic/Resistor.cpp +++ /dev/null @@ -1,21 +0,0 @@ -#include "hurricane/UpdateSession.h" -using namespace Hurricane; - -#include "Resistor.h" - -Resistor::Resistor(Library* library, const Name& name): - AnalogComponent(library, name) -{} - -Resistor* Resistor::create(Library* library, const Name& name) { - Resistor* resistor = new Resistor(library, name); - - resistor->_postCreate(); - - return resistor; -} - -void Resistor::_postCreate() { - Inherit::_postCreate(); - -} diff --git a/chamsin/src/analogic/Resistor.h b/chamsin/src/analogic/Resistor.h deleted file mode 100644 index 1cb8ccaa..00000000 --- a/chamsin/src/analogic/Resistor.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef RESISTOR_H -#define RESISTOR_H - -#include "AnalogComponent.h" - -class Resistor : public AnalogComponent { - public: - static Resistor* create(Library* library, const Name& name); - - protected: - void _postCreate(); - - private: - - Resistor(Library* library, const Name& name); -}; - - -#endif // RESISTOR_H diff --git a/chamsin/src/analogic/StepParameter.h b/chamsin/src/analogic/StepParameter.h deleted file mode 100644 index d2b76cde..00000000 --- a/chamsin/src/analogic/StepParameter.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef STEPPARAMETER_H -#define STEPPARAMETER_H - -template -class StepParameter : public DeviceParameter { - public: - StepParameter(Type min, Type max, Type step): - _min(min), _max(max), _step(step) {} - Type getMin() const { return _min; } - Type getMax() const { return _max, } - Type getStep() const { return _step; } - Type getValue() const { return _value, } - void setValue(Type value); - - private: - Type _min; - Type _max; - Type _step; - Type _value; -}; - -typedef StepParameter StepIntParameter; - -#endif // STEPPARAMETER_H diff --git a/chamsin/src/analogic/Transistor.cpp b/chamsin/src/analogic/Transistor.cpp deleted file mode 100644 index 3b5e278d..00000000 --- a/chamsin/src/analogic/Transistor.cpp +++ /dev/null @@ -1,347 +0,0 @@ -#include "hurricane/DataBase.h" -#include "hurricane/Technology.h" -#include "hurricane/UpdateSession.h" -#include "hurricane/Pad.h" -using namespace Hurricane; - -#include "AEnv.h" -#include "ATechnology.h" -#include "Transistor.h" - -namespace { - -Layer* getLayer(Technology* technology, const string& layerStr) { - Layer* layer = technology->getLayer(layerStr); - if (!layer) { - throw Error("Unknown Layer : " + layerStr); - } - return layer; -} - -Pad* createPad(Technology* technology, Net* net, const string& layerName) { - static Box emptyBox(0, 0, 0, 0); - Layer* layer = getLayer(technology, layerName); - Pad* pad = Pad::create(net, layer, emptyBox); - return pad; -} - - -} - -const Name Transistor::DrainName("DRAIN"); -const Name Transistor::SourceName("SOURCE"); -const Name Transistor::GridName("GRID"); -const Name Transistor::BulkName("BULK"); -const Name Transistor::AnonymousName("ANONYMOUS"); - -Transistor::Type::Type(const Code& code): - _code(code) -{} - -Transistor::Type::Type(const Type& type): - _code(type._code) -{} - -Transistor::Type& Transistor::Type::operator=(const Type& type) { - _code = type._code; - return *this; -} - -Transistor::Transistor(Library* library, const Name& name): - AnalogComponent(library, name), - _drain(NULL), - _source(NULL), - _grid(NULL), - _bulk(NULL), - _anonymous(NULL), - _type(), - _l(0), - _w(0), - //_source20(NULL), - _source22(NULL), - //_drain40(NULL), - _drain42(NULL), - _grid00(NULL), _grid01(NULL), _grid30(NULL), _grid31(NULL), - _anonymous10(NULL), _anonymous11(NULL), _anonymous12(NULL), _anonymous50(NULL) -{} - - -Transistor* Transistor::create(Library* library, const Name& name) { - Transistor* transistor = new Transistor(library, name); - - transistor->_postCreate(); - - return transistor; -} - -void Transistor::_postCreate() { - Inherit::_postCreate(); - - //ChoiceParameter::Choices choices; - //choices.push_back(string("N")); - //choices.push_back(string("P")); - //addParameter(ChoiceParameter("type", choices, 0, new CallBack(this, &Transistor::updateType))); - - DataBase* db = DataBase::getDB(); - Technology* technology = db->getTechnology(); - _drain = Net::create(this, DrainName); - _drain->setExternal(true); - _source = Net::create(this, SourceName); - _source->setExternal(true); - _grid = Net::create(this, GridName); - _grid->setExternal(true); - _bulk = Net::create(this, BulkName); - _bulk->setExternal(true); - _anonymous = Net::create(this, AnonymousName); - //_source20 = createPad(technology, _source, "cut0"); - _source22 = createPad(technology, _source, "cut1"); - //_drain40 = createPad(technology, _drain, "cut0"); - _drain42 = createPad(technology, _drain, "cut1"); - _grid00 = createPad(technology, _grid, "poly"); - _grid01 = createPad(technology, _grid, "poly"); - _grid30 = createPad(technology, _grid, "cut0"); - _grid31 = createPad(technology, _grid, "metal1"); - _anonymous10 = createPad(technology, _anonymous, "active"); - if (_type == Type::NMOS) { - _anonymous11 = createPad(technology, _anonymous, "nImplant"); - _anonymous12 = createPad(technology, _anonymous, "nImplant"); - } else { - _anonymous11 = createPad(technology, _anonymous, "pImplant"); - _anonymous12 = createPad(technology, _anonymous, "pImplant"); - } - setTerminal(false); -} - -void Transistor::setType(Type type) { - UpdateSession::open(); - if (type != _type) { - _type = type; - DataBase* db = DataBase::getDB(); - Technology* technology = db->getTechnology(); - if (_type == Type::NMOS) { - _anonymous11->setLayer(getLayer(technology, "nImplant")); - _anonymous12->setLayer(getLayer(technology, "nImplant")); - } else { - _anonymous11->setLayer(getLayer(technology, "pImplant")); - _anonymous12->setLayer(getLayer(technology, "pImplant")); - } - updateLayout(); - } - UpdateSession::close(); -} - -void Transistor::updateLayout() { - DataBase* db = DataBase::getDB(); - if (!db) { - throw Error("Error : no DataBase"); - } - Technology* techno = db->getTechnology(); - if (!techno) { - throw Error("Error : no Technology"); - } - ATechnology* atechno = AEnv::getATechnology(); - - DbU::Unit widthCut0 = atechno->getPhysicalRule("minWidth", getLayer(techno, "cut0"))->getValue(); - DbU::Unit spacingCut0 = atechno->getPhysicalRule("minSpacing", getLayer(techno, "cut0"))->getValue(); - DbU::Unit extGateActive = atechno->getPhysicalRule("minExtension", - getLayer(techno, "poly"), getLayer(techno, "active"))->getValue(); - DbU::Unit extPolyCut0 = atechno->getPhysicalRule("minExtension", - getLayer(techno, "poly"), getLayer(techno, "cut0"))->getValue(); - DbU::Unit spacingActiveCut0 = atechno->getPhysicalRule("minSpacing", - getLayer(techno, "active"), getLayer(techno, "cut0"))->getValue(); - DbU::Unit spacingGateCut0 = atechno->getPhysicalRule("minGateSpacing", - getLayer(techno, "cut0"), getLayer(techno, "active"))->getValue(); - DbU::Unit spacingActivePoly = atechno->getPhysicalRule("minSpacing", - getLayer(techno, "active"), getLayer(techno, "poly"))->getValue(); - DbU::Unit sourceDrainWidth = atechno->getPhysicalRule("minExtension", - getLayer(techno, "active"), getLayer(techno, "poly"))->getValue(); - DbU::Unit extActiveCut0 = atechno->getPhysicalRule("minExtension", - getLayer(techno, "active"), getLayer(techno, "cut0"))->getValue(); - DbU::Unit enclosurePPlusActive = atechno->getPhysicalRule("minEnclosure", - getLayer(techno, "nWell"), getLayer(techno, "active"))->getValue(); - DbU::Unit enclosureImplantPoly = 0; - DbU::Unit enclosureGateImplant = 0; - DbU::Unit extImplantActive = 0; - DbU::Unit extImplantCut0 = 0; - - if (_type == Type::NMOS) { - enclosureImplantPoly = atechno->getPhysicalRule("minEnclosure", - getLayer(techno, "nImplant"), getLayer(techno, "poly"))->getValue(); - enclosureGateImplant = atechno->getPhysicalRule("minGateEnclosure", - getLayer(techno, "nImplant"), getLayer(techno, "poly"))->getValue(); - extImplantActive = atechno->getPhysicalRule("minExtension", - getLayer(techno, "nImplant"), getLayer(techno, "active"))->getValue(); - extImplantCut0 = atechno->getPhysicalRule("minExtension", - getLayer(techno, "nImplant"), getLayer(techno, "cut0"))->getValue(); - } else { - enclosureImplantPoly = atechno->getPhysicalRule("minEnclosure", - getLayer(techno, "pImplant"), getLayer(techno, "poly"))->getValue(); - enclosureGateImplant = atechno->getPhysicalRule("minGateEnclosure", - getLayer(techno, "nImplant"), getLayer(techno, "poly"))->getValue(); - extImplantActive = atechno->getPhysicalRule("minExtension", - getLayer(techno, "pImplant"), getLayer(techno, "active"))->getValue(); - extImplantCut0 = atechno->getPhysicalRule("minExtension", - getLayer(techno, "pImplant"), getLayer(techno, "cut0"))->getValue(); - } - - UpdateSession::open(); - DbU::setStringMode(1); - - //grid 00 - DbU::Unit x00 = 0; - DbU::Unit y00 = -extGateActive; - DbU::Unit dx00 = _l; - DbU::Unit dy00 = _w + extGateActive; - Box box00(x00, y00, x00 + dx00, y00 + dy00); - _grid00->setBoundingBox(box00); - - //grid30 - DbU::Unit maxValue = widthCut0 + 2*extPolyCut0; - DbU::Unit x30 = 0, dx30 = 0, y30 = 0, dy30 = 0; - if (maxValue > _l) { - dx30 = widthCut0; - dy30 = dx30; - y30 = _w + max(spacingActiveCut0, spacingActivePoly + extPolyCut0); - } else { - dx30 = dx00 - 2*extPolyCut0; - dy30 = widthCut0; - y30 = _w + spacingActiveCut0; - } - x30 = x00 + dx00/2 - dx30/2; - Box box30(x30, y30, x30 + dx30, y30 + dy30); - _grid30->setBoundingBox(box30); - - //grid31 - DbU::Unit dx31 = dx30 + 2*extPolyCut0; - DbU::Unit dy31 = dy30 + 2*extPolyCut0; - DbU::Unit x31 = x30 - extPolyCut0; - DbU::Unit y31 = y30 - extPolyCut0; - Box box31(x31, y31, x31 + dx31, y31 + dy31); - _grid31->setBoundingBox(box31); - - //grid01 - DbU::Unit x01 = 0, y01 = 0, dx01 = 0, dy01 = 0; - if (y31 <= y00+dy00) { - x01 = 0; y01 = 0; dx01 = 0; dy01 = 0; - } else { - x01 = x00; - y01 = y00 + dy00; - dx01 = dx00; - dy01 = y31 - (y00 + dy00); - } - Box box01(x01, y01, x01 + dx01, y01 + dy01); - _grid01->setBoundingBox(box01); - - //anonymous12 - DbU::Unit x12 = min(x31, x00) - enclosureImplantPoly; - DbU::Unit y12 = min(0 - extImplantActive, y00 - enclosureImplantPoly); - DbU::Unit dx12 = max(dx31, dx00) + 2 * enclosureImplantPoly; - DbU::Unit yMax = max( max(y30 + dy30 + extImplantCut0, max(y31 + dy31, y00 + dy00) + enclosureImplantPoly), _w + extImplantActive); - DbU::Unit dy12 = yMax - y12; - - Box box12(x12, y12, x12 + dx12, y12 + dy12); - _anonymous12->setBoundingBox(box12); - - ////_source20 - DbU::Unit y20 = extActiveCut0; - DbU::Unit dy20 = _w - 2 * extActiveCut0; - unsigned sourceColumnNumber = 1; - DbU::Unit dx20 = sourceColumnNumber * widthCut0 + (sourceColumnNumber - 1) * spacingCut0; - DbU::Unit x20 = -(dx20 + spacingGateCut0); - //Box box20(x20, y20, x20 + dx20, y20 + dy20); - ////_source20->setBoundingBox(box20); - - ////_drain40 - //DbU::Unit y40 = y20; - DbU::Unit x40 = x00 + dx00 + spacingGateCut0; - unsigned drainColumnNumber = 1; - DbU::Unit dx40 = drainColumnNumber * widthCut0 + (drainColumnNumber - 1) * (spacingCut0); - //DbU::Unit dy40 = dy20; - - //Box box40(x40, y40, x40 + dx40, y40 + dy40); - //_drain40->setBoundingBox(box40); - - //_anonymous10 - DbU::Unit y10 = 0; - DbU::Unit x10 = min(x20 - spacingActiveCut0, sourceDrainWidth); - DbU::Unit dy10 = _w; - DbU::Unit extension10 = max(x40 + dx40 + spacingActiveCut0, dx00 + sourceDrainWidth); - DbU::Unit dx10 = -x10 + extension10; - - Box box10(x10, y10, x10 + dx10, y10 + dy10); - _anonymous10->setBoundingBox(box10); - - //Rectangle 23 - DbU::Unit x23 = x10; - DbU::Unit y23 = y10; - DbU::Unit dx23 = x10; - DbU::Unit dy23 = _w; - - - //_anonymous11 - DbU::Unit extension11_1 = enclosureGateImplant; - DbU::Unit extension11_2 = extImplantCut0 - x20; - DbU::Unit extension11_3 = extImplantActive - x10; - - DbU::Unit extension11_4 = max(max(extension11_1, extension11_2), extension11_3); - - DbU::Unit x11 = -extension11_4; - - extension11_1 = enclosureGateImplant + x00 + dx00; - extension11_2 = extImplantCut0 + x40 + dx40; - extension11_3 = extImplantActive + x10 + dx10; - - extension11_4 = max(max(extension11_1, extension11_2), extension11_3); - - DbU::Unit dx11 = -x11 + extension11_4; - - DbU::Unit y11 = min(y20 - extImplantCut0, y23 - extImplantActive); - DbU::Unit dy11 = max(y20 + dy20 + extImplantCut0, y23 + dy23 + extImplantActive) - y11; - - Box box11(x11, y11, x11 + dx11, y11 + dy11); - _anonymous11->setBoundingBox(box11); - - if (_type == Type::PMOS) { - DbU::Unit x50 = x10 - enclosurePPlusActive; - DbU::Unit y50 = y10 - enclosurePPlusActive; - DbU::Unit dx50 = dx10 + 2 * enclosurePPlusActive; - DbU::Unit dy50 = dy10 + 2 * enclosurePPlusActive; - Box box50(x50, y50, x50 + dx50, y50 + dy50); - if (!_anonymous50) { - _anonymous50 = createPad(techno, _anonymous, "nWell"); - } - _anonymous50->setBoundingBox(box50); - } else { - if (_anonymous50) { - _anonymous50->destroy(); - _anonymous50 = NULL; - } - } - - setAbutmentBox(box12); - UpdateSession::close(); -} - -Record* Transistor::_getRecord() const { - Record* record = Inherit::_getRecord(); - if (record) { - record->add(getSlot("Drain", _drain)); - record->add(getSlot("Source", _source)); - record->add(getSlot("Grid", _grid)); - record->add(getSlot("Bulk", _bulk)); - record->add(getSlot("L", &_l)); - record->add(getSlot("W", &_w)); - //record->add(getSlot("Source20", _source20)); - record->add(getSlot("Source22", _source22)); - //record->add(getSlot("Drain40", _drain40)); - record->add(getSlot("Drain42", _drain42)); - record->add(getSlot("Grid00", _grid00)); - record->add(getSlot("Grid01", _grid01)); - record->add(getSlot("Grid30", _grid30)); - record->add(getSlot("Grid31", _grid31)); - record->add(getSlot("10", _anonymous10)); - record->add(getSlot("11", _anonymous11)); - record->add(getSlot("12", _anonymous12)); - } - return record; -} diff --git a/chamsin/src/analogic/Transistor.cpp.backup b/chamsin/src/analogic/Transistor.cpp.backup deleted file mode 100644 index cdc2c530..00000000 --- a/chamsin/src/analogic/Transistor.cpp.backup +++ /dev/null @@ -1,462 +0,0 @@ -// **************************************************************************************************** -// File: Transistor.h -// Authors: Wu YiFei -// Date : 21/12/2006 -// **************************************************************************************************** - -#include "Vertical.h" -#include "Horizontal.h" -#include "UpdateSession.h" -using namespace Hurricane; - -#include "AnalogicalCommons.h" -#include "GenTrans.h" - -#include "Transistor.h" - -namespace Hurricane { - -// **************************************************************************************************** -// Transistor::Polarity implementation -// **************************************************************************************************** - -Transistor::Polarity::Polarity(const Code& code) :_code(code) -{} - - -Transistor::Polarity::Polarity(const Polarity& type) :_code(type._code) -{} - - -Transistor::Polarity& Transistor::Polarity::operator=(const Polarity& type) { - _code = type._code; - return *this; -} - - -string Transistor::Polarity::_getString() const { - switch(_code) { - case N : return "N"; - case P : return "P"; - } - return "ABNORMAL"; -} - - -Record* Transistor::Polarity::_getRecord() const -// ***************************************** -{ - Record* record = new Record(getString(this)); - record->add(getSlot("Code", _code)); - return record; -} - - -// **************************************************************************************************** -// Transistor::MaskVersion implementation -// **************************************************************************************************** -Transistor::MaskVersion::MaskVersion(const Code& code) -// ******************************************************* -:_code(code) -{ -} - -Transistor::MaskVersion::MaskVersion(const MaskVersion& version) -// ******************************************************************* -:_code(version._code) -{ -} - - -Transistor::MaskVersion& Transistor::MaskVersion::operator=(const MaskVersion& version) -// ****************************************************************************************** -{ - _code = version._code; - return *this; -} - - -string Transistor::MaskVersion::_getString() const -// ************************************************* -{ - switch(_code) { - case VERSION1 : return "VERSION1"; - } - return "ABNORMAL"; -} - - -Record* Transistor::MaskVersion::_getRecord() const -// ************************************************** -{ - Record* record = new Record(getString(this)); - record->add(getSlot("Code", _code)); - return record; -} - - -// **************************************************************************************************** -// Transistor::Type implementation -// **************************************************************************************************** -Transistor::Type::Type(const Code& code) -// ************************************* -:_code(code) -{ -} - - -Transistor::Type::Type(const Type& type) -// ************************************* -:_code(type._code) -{ -} - - -Transistor::Type& Transistor::Type::operator=(const Type& type) -// ************************************************************ -{ - _code = type._code; - return *this; -} - - -string Transistor::Type::_getString() const -// ***************************************** -{ - switch(_code) { - case INTERNAL : return "INTERNAL"; - case LEFT : return "LEFT"; - case RIGHT : return "RIGHT"; - case SINGLE : return "SINGLE"; - } - - return "ABNORMAL"; -} - - -Record* Transistor::Type::_getRecord() const -// ***************************************** -{ - Record* record = new Record(getString(this)); - record->add(getSlot("Code", _code)); - return record; -} - - -// **************************************************************************************************** -// Transistor::MaskInfo implementation -// **************************************************************************************************** -Transistor::MaskInfo::MaskInfo(const double& l, const double& w, const Type::Code& type - , const unsigned& nbDrainColumn - , const unsigned& nbSourceColumn) -// **************************************************************************************************** -: _l(l) - , _w(w) - , _type(type) - , _nbDrainColumn(nbDrainColumn) - , _nbSourceColumn(nbSourceColumn) -{}; - - -Transistor::MaskInfo& Transistor::MaskInfo::operator=(const MaskInfo& masqueinfo) -// ************************************************************************************ -{ - _l = masqueinfo.getL(); - _w = masqueinfo.getW(); - _type= masqueinfo.getType(); - _nbDrainColumn = masqueinfo.getNbDrainColumn(); - _nbSourceColumn = masqueinfo.getNbSourceColumn(); - - return *this; -} - - -bool Transistor::MaskInfo::operator==(const MaskInfo& masqueinfo) -// ****************************************************************** -{ - if(_l == masqueinfo.getL() && - _w == masqueinfo.getW() && - _type== masqueinfo.getType() && - _nbDrainColumn == masqueinfo.getNbDrainColumn() && - _nbSourceColumn == masqueinfo.getNbSourceColumn() - ) - return true; - - return false; -} - - -string Transistor::MaskInfo::_getString() const -// ********************************************** -{ - string s = "<" + _getTypeName() + " " - + getString(_l) + " " - + getString(_w) + " " - + _type._getString() + " " - + getString(_nbSourceColumn) + " " - + getString(_nbDrainColumn) - + ">"; - return s; -} - - -Record* Transistor::MaskInfo::_getRecord() const -// *********************************************** -{ - Record * record = new Record(_getString()); - return record; -} - - -// **************************************************************************************************** -// Transistor::MaskV1Info implementation -// **************************************************************************************************** -Transistor::MaskV1Info::MaskV1Info(const double& l, const double& w, const Type::Code& type - , const unsigned& nbDrainColumn - , const unsigned& nbSourceColumn) -// **************************************************************************************************** -: Inherit(l - , w - , type - , nbDrainColumn - , nbSourceColumn - ) -{} - -Transistor::MaskInfo& Transistor::MaskV1Info::operator=(const MaskInfo& masqueinfo) -// ************************************************************************************** -{ -// (*(static_cast(this)))=masqueinfo; - Inherit::operator=(masqueinfo); - - return *this; -} - -bool Transistor::MaskV1Info::operator == (const MaskInfo& masqueinfo) -// ********************************************************************** -{ - //return (*(static_cast(this)))==masqueinfo; - return Inherit::operator==(masqueinfo); -} - - -string Transistor::MaskV1Info::_getString() const -// ************************************************ -{ - string s = Inherit::_getString(); - return s; -} - -Record* Transistor::MaskV1Info::_getRecord() const -// ************************************************* -{ - Record* record = Inherit::_getRecord(); - return record; -} - -// **************************************************************************************************** -// Transistor implementation -// **************************************************************************************************** - -Transistor::Transistor(Library* library, const Name& name, const Polarity& polarity) : - Inherit(library, name), - _polarity(polarity), - _masqueInfo(NULL), - _genTrans(NULL) -{} - - -Transistor* Transistor::create(Library* library, const Name& name, const Polarity& polarity) { - Transistor* transistor = new Transistor(library, name, polarity); - - transistor->_postCreate(); - - return transistor; -} - - - -void Transistor::_preDestroy() { - // Delete aggregated objets. - // ************************* - if(_masqueInfo) - delete _masqueInfo; - - if(_genTrans) - delete _genTrans; - - Inherit::_preDestroy(); -} - - -void Transistor::_postCreate() -// ******************************* -{ - Inherit::_postCreate(); - - (Net::create(this, Name("DRAIN")))->setExternal(true); - (Net::create(this, Name("SOURCE")))->setExternal(true); - (Net::create(this, Name("GRID")))->setExternal(true); - (Net::create(this, Name("BULK")))->setExternal(true); - - // By default, transistor's length and heigth is NULL, and is internal. - // ******************************************************************** - _masqueInfo = new MaskV1Info(0.0, 0.0); -} - - -string Transistor::_getString() const { - string s = Inherit::_getString(); - s.insert(s.length()-1, " " + getString(_polarity)); - s.insert(s.length()-1, " " + getAbutmentType()._getString()); - return s; -} - - -Record* Transistor::_getRecord() const { - Record* record = Inherit::_getRecord(); - return record; -} - - -Transistor::MaskVersion Transistor::_getMaskInfoVersion(MaskInfo* masqueinfo) -// *************************************************************************************** -{ - if(!masqueinfo) - throw Error("Error : In Transistor::_getMaskInfoVersion, param masqueinfo is NULL"); - - if(dynamic_cast(masqueinfo)) - return MaskVersion(MaskVersion::VERSION1); - - throw Error("Error : In Transistor::_getMaskInfoVersion, can't dynamic cast param masqueinfo"); - return MaskVersion(MaskVersion::VERSION1); -} - - -Transistor::MaskInfo* Transistor::_createMaskInfo(const MaskVersion& version) -// ******************************************************************************* -{ - switch((const MaskVersion::Code&)version) { - case MaskVersion::VERSION1 : - return new MaskV1Info(0.0, 0.0); - - default : - throw Error ("Error : In Transistor::_createMaskInfoBy, unknown param version"); - return NULL; - } -} - - -void Transistor::setMaskInfo(MaskInfo* masqueinfo) -// *************************************************** -{ - if(!masqueinfo) - throw Error("Error : In Transistor::createLayout : masqueinfo is NULL"); - - // Set new Param. - // *************** - MaskVersion newversion = _getMaskInfoVersion(masqueinfo); - MaskVersion oldversion = _getMaskInfoVersion(_masqueInfo); - - if(newversion == oldversion) { // If they are the same version. - if((*_masqueInfo)==(*masqueinfo)) // If they are identical. - return; - else - (*_masqueInfo)=(*masqueinfo); - } - else { // If change the version. - delete _masqueInfo; - _masqueInfo = _createMaskInfo(newversion); - (*_masqueInfo) == (*masqueinfo); - } -} - - -void Transistor::createLayout() -// **************************** -{ - MaskVersion version = _getMaskInfoVersion(_masqueInfo); - MaskV1Info* masquev1info = NULL; - - // Select algorithme with technology and masque version. - // ***************************************************** - switch((const MaskVersion::Code&)version) { - - case MaskVersion::VERSION1 : - masquev1info = dynamic_cast(_masqueInfo); - _genTrans = new GenV1Trans(masquev1info); - break; - - default : - break; - } - - setTerminal(false); - - // Launch the selected algorithme. - // ****************************** - _genTrans->Calculate(this); - _genTrans->Generate(this); - - materialize(); - - delete _genTrans; - _genTrans = NULL; - -} - - -void Transistor::duplicateLayout(Transistor* transistor) -// ***************************************************** -{ - UpdateSession::open(); - - setTerminal(false); - - Net * tmp = NULL; - Contact * con = NULL; - Segment * seg = NULL; - - for_each_net(net, transistor->getNets()) - if( !( tmp=getNet(net->getName()) ) ) { // - tmp = Net::create(this, net->getName()); - tmp->setExternal(net->isExternal()); - } - - for_each_component(component, net->getComponents()) - if( (con=dynamic_cast(component)) ){ - Contact::create(tmp, component->getLayer(), con->getX(), con->getY(), con->getWidth(), con->getHeight()); - } - else if( (seg=dynamic_cast(component)) ) { - Vertical::create(tmp, component->getLayer(), seg->getSourceX(), seg->getWidth(), seg->getSourceY(), - seg->getTargetY()); - } - else if( (seg=dynamic_cast(component)) ){ - Horizontal::create(tmp, component->getLayer(), seg->getSourceY(), seg->getWidth(), seg->getSourceX(), - seg->getTargetX()); - } - else - throw Error ("Error : In Transistor::DuplicateLayout, find illegal elem : " + getString(component) + - "In Transistor, all component must be contact or segment" ) ; - end_for - end_for - - setAbutmentBox(transistor->getAbutmentBox()); - - _mapNet2Box.clear(); - - map::iterator i = transistor->_getMapNet2Box()->begin(), - j = transistor->_getMapNet2Box()->end(); - - while(i!=j) { - _mapNet2Box[getNet((*i).first->getName())]=(*i).second; - i++; - } - - materialize(); - - UpdateSession::close(); - -} - -} diff --git a/chamsin/src/analogic/Transistor.h b/chamsin/src/analogic/Transistor.h deleted file mode 100644 index 66a1b238..00000000 --- a/chamsin/src/analogic/Transistor.h +++ /dev/null @@ -1,61 +0,0 @@ -#ifndef TRANSISTOR_H -#define TRANSISTOR_H - -#include "AnalogComponent.h" - -class Transistor : public AnalogComponent { - public: - class Type { - public: - enum Code {UNDEFINED=0, NMOS=1, PMOS=2}; - - Type(const Code& code = UNDEFINED); - Type(const Type& type); - - Type& operator=(const Type& type); - operator const Code&() const {return _code;}; - - const Code& getCode() const {return _code;}; - - private: - Code _code; - }; - - static const Name DrainName; - static const Name SourceName; - static const Name GridName; - static const Name BulkName; - static const Name AnonymousName; - - static Transistor* create(Library* library, const Name& name); - void updateLayout(); - - void setType(Type type); - void setW(DbU::Unit value) { _w = value; updateLayout(); } - void setL(DbU::Unit value) { _l = value; updateLayout(); } - - virtual Record* _getRecord() const; - - protected: - void _postCreate(); - - private: - Net* _drain; - Net* _source; - Net* _grid; - Net* _bulk; - Net* _anonymous; - Type _type; - DbU::Unit _l; - DbU::Unit _w; - Pad *_source22; - Pad *_drain42; - Pad *_grid00, *_grid01, *_grid30, *_grid31; - Pad *_anonymous10, *_anonymous11, *_anonymous12, *_anonymous50; - - Transistor(Library* library, const Name& name); -}; - -//INSPECTOR_P_SUPPORT(Transistor); - -#endif // TRANSISTOR_H diff --git a/chamsin/src/analogic/Transistors.h b/chamsin/src/analogic/Transistors.h deleted file mode 100644 index c806ce5c..00000000 --- a/chamsin/src/analogic/Transistors.h +++ /dev/null @@ -1,59 +0,0 @@ - -// **************************************************************************************************** -// File: Transistors.h -// Authors: YIFEI WU -// Date : 21/12/2006 -// **************************************************************************************************** - -#ifndef HURRICANE_TRANSISTORS -#define HURRICANE_TRANSISTORS - -#include "Collection.h" - -namespace Hurricane { - -class Transistor; - - -// **************************************************************************************************** -// Transistors declaration -// **************************************************************************************************** - -typedef GenericCollection Transistors; - - - -// **************************************************************************************************** -// TransistorLocator declaration -// **************************************************************************************************** - -typedef GenericLocator TransistorLocator; - - - -// **************************************************************************************************** -// TransistorFilter declaration -// **************************************************************************************************** - -typedef GenericFilter TransistorFilter; - - - -// **************************************************************************************************** -// for_each_transistor declaration -// **************************************************************************************************** - -#define for_each_transistor(transistor, transistors)\ -/******************************/\ -{\ - TransistorLocator _locator = transistors.GetLocator();\ - while (_locator.IsValid()) {\ - Transistor* transistor = _locator.GetElement();\ - _locator.Progress(); - - - -} - -#endif // HURRICANE_TRANSISTORS - diff --git a/chamsin/src/device_backup/CMakeLists.txt b/chamsin/src/device_backup/CMakeLists.txt deleted file mode 100644 index 9ae18f6b..00000000 --- a/chamsin/src/device_backup/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -INCLUDE_DIRECTORIES(${CHAMSIN_SOURCE_DIR}/src/dtr ${CHAMSIN_SOURCE_DIR}/src/analogic -${HURRICANE_INCLUDE_DIR}) - -#ADD_LIBRARY(device SHARED Device.cpp TrMos.cpp TrMos_PlaceRoute.cpp) -# -#TARGET_LINK_LIBRARIES(device analogic dtr hurricane) -# -#INSTALL(TARGETS device DESTINATION /lib) diff --git a/chamsin/src/device_backup/Device.cpp b/chamsin/src/device_backup/Device.cpp deleted file mode 100644 index e4208e20..00000000 --- a/chamsin/src/device_backup/Device.cpp +++ /dev/null @@ -1,161 +0,0 @@ -// **************************************************************************************************** -// File: Device.cpp -// Authors: Wu YiFei -// Date : 21/12/2006 -// **************************************************************************************************** - - -#include "Device.h" - -#include "Transformation.h" -#include "Point.h" -#include "Instance.h" -#include "Box.h" -#include "Error.h" - -#include "Cells.h" -#include "DtrAccess.h" -using namespace Hurricane; - -// **************************************************************************************************** -// Static data function -// **************************************************************************************************** - -static Instance * refins = NULL; - - -static set cellSet; - - -static void getAllCells(Cell* cell) -// ******************************** -{ - cellSet.insert(cell); - - if(!(cell->isLeaf())){ - for_each_instance(instance, cell->getInstances()) - Cell * mastercell = instance->getMasterCell(); - getAllCells(mastercell); - end_for - } -} - - - -namespace DEVICE { - - -// **************************************************************************************************** -// Device implementation -// **************************************************************************************************** - -Device::Device(Library* library, const Name& name) -// ************************************************************************** -: Inherit(library, name) -{ -} - - -void Device::_postCreate() { - Inherit::_postCreate(); - - //CDataBase* database = getCDataBase(); - //CCatal* ccatal = database->getCCatal(); - - //CCatal::State* state = ccatal->getState(getName(), true); - //state->SetFlags(CCatal::State::LOGICAL|CCatal::State::PHYSICAL|CCatal::State::IN_MEMORY|CCatal::State::GDS, true); - //state->SetCell(this); - //state->SetLibrary(getLibrary()); - -} - - -void Device::SaveLogicalView() -// *************************** -{ - cellSet.clear(); - getAllCells(this); - - //CDataBase * db = getCDataBase(); - - // set::iterator i = cellSet.begin(), j = cellSet.end(); - // - // while(i!=j) { - // db->SaveCell(*i, CCatal::State::LOGICAL ); - // i++; - // } -} - -void Device::_Place(Instance* ins, const Transformation::Orientation& orientation, const Point& point) -// ************************************************************************************************** -{ - if(!ins) { - throw Error("Can't Place Instance : ins is NULL"); - } - - if(ins->isPlaced()) { - throw Error("Can't Place " + getString(ins) + " : it has already been placed"); - } - - Transformation transformation(Point(0,0), orientation); - Box orientedmastercellbox = transformation.getBox(ins->getMasterCell()->getAbutmentBox()); - - Point translation( point.getX() - orientedmastercellbox.getXMin() - , point.getY() - orientedmastercellbox.getYMin() ); - - Transformation transformation_ins = Transformation(translation, orientation); - - ins->setTransformation(transformation_ins); - ins->setPlacementStatus(Instance::PlacementStatus::PLACED); -} - - -void Device::_setRefIns(Instance* ins) const -// ***************************************** -{ - if(!ins) { - throw Error("Can't SetRefIns : ref instance is NULL"); - } - - if(ins->isUnplaced()) { - throw Error("Can't SetRefIns : ref instance has't been placed"); - } - - refins = ins; -} - - -void Device::_PlaceRight(Instance* ins, const Transformation::Orientation& orientation, const Point& offset) -// ******************************************************************************************************** -{ - if(!ins) { - throw Error("Can't PlaceRight Instance : ins is NULL"); - } - - if(ins->isPlaced()) { - throw Error("Can't PlaceRight " + getString(ins) + " : it has already been placed"); - } - - - if(!refins) { - throw Error("Can't Place Right " + getString(ins) + " : can't find refins"); - } - - Box refinsbox = refins->getAbutmentBox(); - - Transformation transformation(Point(0,0), orientation); - Box orientedmastercellbox = transformation.getBox(ins->getMasterCell()->getAbutmentBox()); - - Point translation( refinsbox.getXMax() - orientedmastercellbox.getXMin() + offset.getX() - , refinsbox.getYMin() - orientedmastercellbox.getYMin() + offset.getY() ); - - Transformation transformation_ins = Transformation(translation, orientation); - - ins->setTransformation(transformation_ins); - ins->setPlacementStatus(Instance::PlacementStatus::PLACED); - - refins = ins; -} - - -} // end namespace Device diff --git a/chamsin/src/device_backup/Device.h b/chamsin/src/device_backup/Device.h deleted file mode 100644 index 79a47f96..00000000 --- a/chamsin/src/device_backup/Device.h +++ /dev/null @@ -1,71 +0,0 @@ - -// **************************************************************************************************** -// File: Device.h -// Authors: Wu YiFei -// Date : 21/12/2006 -// **************************************************************************************************** - -#ifndef DEVICE_H -#define DEVICE_H - - -#include "Cell.h" -using namespace Hurricane; - -namespace DEVICE { - -class Device : public Cell { - -#if !defined(__DOXYGEN_PROCESSOR__) -// Types -// ***** - public : typedef Cell Inherit; - -// Attributes -// ********** - - -// Constructors -// ************ - protected : Device(Library* library, const Name& name); - protected : virtual void _postCreate(); - - -#endif - -// Operations -// ********** -// public : virtual void Create(const char, const bool) = 0; - public : virtual void dses() = 0; - public : virtual void shape() = 0; -// public : virtual void Generate() = 0; - - -# if !defined(__DOXYGEN_PROCESSOR__) - public : virtual void SaveLogicalView(); - public : virtual void SavePhysicalView() {}; - -// Accessors -// ********* - -// Updators -// ******** - -// Others -// ****** - public : virtual void _Flush() = 0; - - // Description of Layout - // ********************** - public: void _Place(Instance* ins, const Transformation::Orientation& orientation, const Point& point); - public: void _setRefIns(Instance*) const; - public: void _PlaceRight(Instance* ins, const Transformation::Orientation& orientation, const Point& offset=Point()); - - -#endif - -}; - -} - -#endif // DEVICE_H diff --git a/chamsin/src/device_backup/TrMos.cpp b/chamsin/src/device_backup/TrMos.cpp deleted file mode 100644 index 8eb6496c..00000000 --- a/chamsin/src/device_backup/TrMos.cpp +++ /dev/null @@ -1,417 +0,0 @@ -// **************************************************************************************************** -// File: TrMos.cpp -// Authors: Wu YiFei -// Date : 21/12/2006 -// **************************************************************************************************** - -#include "Instance.h" -#include "MetaTransistor.h" -#include "Net.h" -#include "Transistor.h" -#include "Transistors.h" - -#include "UpdateSession.h" - -#include "DtrAccess.h" - -#include "TrMos.h" -using namespace Hurricane; - - -namespace DEVICE { - -// **************************************************************************************************** -// TrMos implementation -// **************************************************************************************************** - -TrMos::TrMos(Library* library, const Name& name): - Device(library, name), - _polarity(Transistor::N), - _isBsConnected(false), - _m(1), - _sourceIsFirst(true), - _hasDummy(false), - _hasRing(true), - _tr1(NULL), - _capaRouting(0) -{} - - -TrMos* TrMos::create(Library* library, const Name & name) { - TrMos* trmos= new TrMos(library, name); - trmos->_postCreate(); - return trmos; -} - -void TrMos::_postCreate() { - Inherit::_postCreate(); - - // do something. - // Initialize pin order list and other attributes. - // ********************************************** - // _lowPinOrder[0]=D; - // _lowPinOrder[1]=G; - - // _highPinOrder[0]=S; - // _highPinOrder[1]=B; - - _highPinOrder.push_back(D); - _highPinOrder.push_back(G); - - _lowPinOrder.push_back(S); - _lowPinOrder.push_back(B); - - double minWidth = (DtrAccess::getDtrAccess())->getSingleRealRuleByLabel(string("RW_ALU1")); - - _widthOfSourceWire = minWidth; - _widthOfDrainWire = minWidth; - -} - -void TrMos::create(const Transistor::Polarity& polarity, const bool isbsconnected) -{ - if( _tr1 ) { - throw Error("Can't Create Logical View of TrMos " + getString(getName()) + - " : " + "it has already been created"); - } - - _polarity = polarity; - _isBsConnected = isbsconnected; - - // MetaTransistor is in the same library than Trmos - // ************************************************ - Library * library = getLibrary(); - - // Create signals - // ************** - Net * drain = NULL; - Net * source = NULL; - Net * grid = NULL; - Net * bulk = NULL; - - (drain = Net::create(this, Name("drain")))->setExternal(true); - (source = Net::create(this, Name("source")))->setExternal(true); - (grid = Net::create(this, Name("grid")))->setExternal(true); - - if(!isbsconnected) { - (bulk = Net::create(this, Name("bulk")))->setExternal(true); - } - - - // Instancier a MetaTransistor and create the connection - // The name of MetaTransistor is nameoftrmos_tr1 - // **************************************************** - - _tr1 = MetaTransistor::create(library, Name( getString(getName())+"_Mos1" ), _polarity); - Instance * instance = Instance::create(this, - Name("Ins_" + getString(_tr1->getName())), - _tr1); - - instance->getPlug(_tr1->getNet(Name("DRAIN")))->setNet(drain); - instance->getPlug(_tr1->getNet(Name("SOURCE")))->setNet(source); - instance->getPlug(_tr1->getNet(Name("GRID")))->setNet(grid); - - if(!isbsconnected) - instance->getPlug(_tr1->getNet(Name("BULK")))->setNet(bulk); - else - instance->getPlug(_tr1->getNet(Name("BULK")))->setNet(source); - - -} - - -void TrMos::generate(const unsigned m, const bool sourceisfirst, const bool hasring - , const unsigned nbsourcecolumn, const unsigned nbdraincolumn) -// ********************************************************************************* -{ - if( !_tr1 ) { - throw Error("Can't Create Physical View for " + getString(this) + - " : " + "Logical view has't been created yet."); - } - -// if( !(_transistorList.empty()) ) { -// throw Error("Can't Create Physical View of TrMos " + getString(getName()) + " : " -// + "it has already been created"); -// } - - // Check out param of realization. - // ******************************* - if( m <= 0 ) - throw Error("Can't generate for " + getString(this) + " : m " - + getString(m) + " is invalid."); - - if(nbsourcecolumn<1) - throw Error("Can't generate for " + getString(this) - + " : nbsourcecolumn " + getString(nbsourcecolumn) + " is invalid."); - - if(nbdraincolumn<1) - throw Error("Can't generate for" + getString(this) + " : nbdraincolumn " - + getString(nbdraincolumn) + " is invalid."); - - - if(!(_transistorList.empty())) { - _Flush(); - } - - _m = m; - _sourceIsFirst = sourceisfirst; - _hasRing = hasring; - - // Motifs are in the same library than Trmos - // ***************************************** - Library * library = getLibrary(); - - cout << "################################################################" << endl << - "#### BEGIN AUTOGENERATON FOR " + _getTypeName() + " " + getString(getName()) + " #####" << endl << - "################################################################" << endl << endl; - -// OpenUpdateSession(); - -/* (1) */ - - //IF_DEBUG_HUR_ANALOG - cout << "*** Stage 1 : CreateLayout of " + getString(this) + " Begin ***" <setM(_m); - - for(unsigned i=0; igetName()) + "_Finger_" + getString(i), - _polarity); - - _transistorList.push_back(finger); - Instance::create(_tr1, Name("Ins_" + getString(finger->getName())), finger); - } - - //IF_DEBUG_HUR_ANALOG - - cout << "*** Stage 1 : CreateLayout of " + getString(this) + " finish ***" <getM()) + ".\n" - << getString(_m) + " Transistors are created.\n" <createConnection(); - - //IF_DEBUG_HUR_ANALOG - cout << "*** Stage 2 : CreateLayout of " + getString(this) + " finish ***" <setLe(10); -// _tr1->setWe(11); - -/* (3) */ - //IF_DEBUG_HUR_ANALOG - cout << "*** Stage 3 : CreateLayout of " + getString(this) + " Begin ***" <getLe() ; - double w_finger = (_tr1->getWe()) / (double)(_tr1->getM()) ; - unsigned count = 0; - - Transistor::MaskV1Info * masqueinfo = new Transistor::MaskV1Info(l_finger, w_finger); - masqueinfo->setNbSourceColumn(nbsourcecolumn); - masqueinfo->setNbDrainColumn(nbdraincolumn); - - list::iterator i = _transistorList.begin() - , j = _transistorList.end(); - - if(_m == 1) { - masqueinfo->setType(Transistor::Type::SINGLE); - (*(_transistorList.begin()))->setMaskInfo(masqueinfo); - } else if(_m%2==0) { // if m is pair, create two left fingers if is source first. - // and create two right fingers if is drain first. - while(i!=j) { - if(++count>2) - masqueinfo->setType(Transistor::Type::INTERNAL); - else { - if ( _sourceIsFirst ) - masqueinfo->setType(Transistor::Type::LEFT); - else - masqueinfo->setType(Transistor::Type::RIGHT); - } - - (*i)->setMaskInfo(masqueinfo); - i++; - } - } else if(_m%2==1) { // if m is impair, create one left finger, one right finger. - while(i!=j){ - ++ count ; - if (count == 1) - masqueinfo-> setType(Transistor::Type::LEFT); - else if (count == 2) - masqueinfo-> setType(Transistor::Type::RIGHT); - else - masqueinfo-> setType(Transistor::Type::INTERNAL); - - (*i)->setMaskInfo(masqueinfo); - i++; - } - } - - delete masqueinfo; - - //IF_DEBUG_HUR_ANALOG - cout << "*** Stage 3 : CreateLayout of " + getString(this) + " finish ***" <_le) + "." << endl -// << "Real w of " << (long)_tr1 << getString(_tr1) + " is " + getString(_tr1->_we) + "." << endl -// <createLayout(); - - //IF_DEBUG_HUR_ANALOG - cout << "*** Stage 4 : CreateLayout of " + getString(this) + " finish ***"<setTransformation(instance->getTransformation()); - instance->unmaterialize(); - instance->materialize(); - -//IF_DEBUG_HUR_ANALOG - cout << getString(instance) <<" 's boundingBox is " << getString(instance->getBoundingBox())<::iterator i = _lowPinOrder.begin(), j = _lowPinOrder.end(); - - cout << " Low Pin Order " << endl; - - while(i!=j) { - cout << *i << endl; - i++; - } - -} - - -void TrMos::setHighPinOrder(const PinName pin1, const PinName pin2) -// ***************************************************************** -{ - _highPinOrder[0]=pin1; - _highPinOrder[1]=pin2; - - vector::iterator i = _highPinOrder.begin(), j = _highPinOrder.end(); - - cout << " High Pin Order " << endl; - - while(i!=j) { - cout << *i << endl; - i++; - } -} - - -void TrMos::_Flush() -// **************** -{ - if(_transistorList.empty()) { - throw Error("Can't delete Physical View of TrMos " + getString(getName()) + " : " + "il doesn't exist"); - } - - _tr1->Flush(); - - _transistorList.clear(); - - // Delete all segments of TrMos - // **************************** - /* to do */ - - -} - - -string TrMos::_getString() const -// *************************************** -{ - string s= Inherit::_getString(); - return s; -} - -Record* TrMos::_getRecord() const -// ********************************* -{ - Record* record = Inherit::_getRecord(); - return record; -} - -} // end of namespace Device diff --git a/chamsin/src/device_backup/TrMos.h b/chamsin/src/device_backup/TrMos.h deleted file mode 100644 index 929811b4..00000000 --- a/chamsin/src/device_backup/TrMos.h +++ /dev/null @@ -1,126 +0,0 @@ -// **************************************************************************************************** -// File: TrMos.h -// Authors: Wu YiFei -// Date : 21/12/2006 -// **************************************************************************************************** - -#ifndef TRMOS_H -#define TRMOS_H - -#include "Net.h" -using namespace Hurricane; - -#include "Transistor.h" - -//#include "MetaTransistor.h" -#include "Device.h" - - -namespace DEVICE { - -class TrMos : public Device { - - public : enum PinName { D, G, S, B }; - -// Attributes -// ******************* - - // Structural parameter. - // ******************** - private : Transistor::Polarity _polarity; - private : bool _isBsConnected; - private : unsigned _m; - - // Parameter of the electric synthesis. - // *********************************** - /* to do */ - - // Physical parameter of realization. - // ********************************** - /* Placement. */ - private : bool _sourceIsFirst; - private : bool _hasDummy; - private : bool _hasRing; - - /* Routing. */ - private : vector _lowPinOrder; // relative position of the connectors on the basis of the top. - private : vector _highPinOrder; - - private : map _mapNetToPinBoxInLeftSide; - private : map _mapNetToPinBoxInRightSide; - - private : double _widthOfSourceWire; // by defect, minWidth, unit of valeur is Micro - private : double _widthOfDrainWire; // by defect, minWidth, unit of valeur is Micro - - /* Others */ - private : MetaTransistor * _tr1; - private : double _capaRouting; - private : list _transistorList; - - -// Constructors -// ************ - protected : TrMos(Library* library, const Name& name); - protected : virtual void _postCreate(); - - public : static TrMos* create(Library* library, const Name & name); - - - -// Operations -// ********** - public : virtual void dses() { /* to do */}; - public : virtual void shape() { /* to do */}; - - - public : void create(const Transistor::Polarity& polarity, const bool isbsconnected); - public : void generate(const unsigned m, const bool sourceisfirst, const bool hasring, - const unsigned nbsourcecolumn, const unsigned nbdraincolumn); - -// Accessors -// ********* - public : const Transistor::Polarity& getPolarity() const { return _polarity; }; - public : unsigned getM() const { return _m; }; - public : const double getWidthOfSourceWire() const { return _widthOfSourceWire; }; - public : const double getWidthOfDrainWire() const { return _widthOfDrainWire; }; - public : MetaTransistor* getTr1() const { return _tr1; }; - -// Updators -// ******** - public : void setMosLength(const double length) { if(_tr1) _tr1->setLe(length); } - public : void setMosWidth(const double width) { if(_tr1) _tr1->setWe(width); } - public : void setWidthOfSourceWire(const double width) { _widthOfSourceWire = width; }; - public : void setWidthOfDrainWire(const double width) { _widthOfDrainWire=width; }; - public : void setLowPinOrder(const PinName, const PinName) ; - public : void setHighPinOrder(const PinName, const PinName) ; - -// Predicats -// ********* - public : bool isBsConnected() const { return _isBsConnected; }; - public : bool sourceIsFirst() const { return _sourceIsFirst; }; - public : bool hasRing() const { return _hasRing; }; - - -# if !defined(__DOXYGEN_PROCESSOR__) - -// Others -// ****** - public: virtual string _getTypeName() const {return _TName("TrMos"); }; - public: virtual string _getString() const; - public: virtual Record* _getRecord() const; - - public: vector& getLowPinOrder() { return _lowPinOrder; }; - public: vector& getHighPinOrder() { return _highPinOrder; }; - - public: map& getMapNetToPinBoxInLeftSide() { return _mapNetToPinBoxInLeftSide; }; - public: map& getMapNetToPinBoxInRightSide() { return _mapNetToPinBoxInRightSide; }; - - public : virtual void _Flush(); - protected : void _PlaceAndRoute(); -#endif - -}; - -} - -#endif // TRMOS_H diff --git a/chamsin/src/device_backup/TrMos_PlaceRoute.cpp b/chamsin/src/device_backup/TrMos_PlaceRoute.cpp deleted file mode 100644 index 76ecb557..00000000 --- a/chamsin/src/device_backup/TrMos_PlaceRoute.cpp +++ /dev/null @@ -1,685 +0,0 @@ -// **************************************************************************************************** -// File: TrMos.cpp -// Authors: Wu YiFei -// Date : 21/12/2006 -// **************************************************************************************************** - - -#include "TrMos.h" - -#include "Instances.h" -#include "MetaTransistor.h" -#include "Net.h" -#include "Transistors.h" -#include "Box.h" -#include "UpdateSession.h" -#include "HyperNet.h" -#include "DataBase.h" -#include "Technology.h" -#include "Vertical.h" -#include "Horizontal.h" -#include "Pin.h" - -#include "RdsUnit.h" -#include "Transistor.h" -#include "DtrAccess.h" -using namespace Hurricane; - - - -#include "DeviceUtil.h" - - -namespace DEVICE{ - - -// **************************************************************************************************** -// TrMos implementation -// **************************************************************************************************** -void TrMos::_PlaceAndRoute() -// ************************* -{ - - // get Dtr Rules And Calculate the Size of AbutmentBox of Device. - // ************************************************************** - DtrAccess * dtraccess = DtrAccess::getDtrAccess(); - - Transistor::Polarity polarity; - if(_polarity == Transistor::Polarity::P) polarity = Transistor::Polarity::N; - else polarity = Transistor::Polarity::P; - - long minImpWidth = dtraccess->getSingleRdsRuleByLabel("RW_", getString(polarity), "IMP"); - long minContWidth = dtraccess->getSingleRdsRuleByLabel(string("RW_CONT")); - long minAlu1Width = dtraccess->getSingleRdsRuleByLabel(string("RW_ALU1")); - long minVia1Width = dtraccess->getSingleRdsRuleByLabel(string("RW_VIA1")); - - long rdImp = dtraccess->getSingleRdsRuleByLabel(string("RD_NIMP")); - long rdActive = dtraccess->getSingleRdsRuleByLabel(string("RD_ACTI")); - long rdAlu2 = dtraccess->getSingleRdsRuleByLabel(string("RD_ALU1")); - - long reImpActi = dtraccess->getSingleRdsRuleByLabel("RE_", getString(polarity), "IMP_CONT"); - long reActiContact = dtraccess->getSingleRdsRuleByLabel("RE_ACTI_CONT"); - long reAlu1Contact = dtraccess->getSingleRdsRuleByLabel("RE_ALU1_CONT"); - long reAlu1Via1 = dtraccess->getSingleRdsRuleByLabel("RE_ALU1_VIA1"); - - long minActiWidth = 2*reActiContact + minContWidth; - - long widthOfSourceWire = ConvertRealToRdsUnit(_widthOfSourceWire); - long widthOfDrainWire = ConvertRealToRdsUnit(_widthOfDrainWire); - - long widthOfActive = MAX_INTEGER(minActiWidth, minContWidth + 2*reActiContact); - long widthOfImp = MAX_INTEGER(widthOfActive + 2*reImpActi, minImpWidth); - - - // ************************************************************** - // Placing . - // ************************************************************** - - Transformation::Orientation::Code internalTransCode = Transformation::Orientation::ID; - - Unit horizontalMargin = 0; // the horizontal margin of trmos. - Unit verticalLowMargin = 0; // the vertical low margin of trmos. - Unit verticalHighMargin = 0; // the vertical high margin of trmos. - - Unit fingerHeight = 0; // the height of trmos. - Instance * leftins = NULL; - Instance * rightins = NULL; - - OccurrenceLocator locator = getLeafInstanceOccurrences().getLocator(); - Instance * instance = dynamic_cast(locator.getElement().getEntity());; - fingerHeight = instance->getCell()->getBoundingBox().getHeight(); - horizontalMargin = getUnit(RETURN_EVEN((long)(getValue(fingerHeight))/4)); - verticalLowMargin = getUnit(RETURN_EVEN((long)(getValue(fingerHeight))/2)); - verticalHighMargin = getUnit(RETURN_EVEN((long)(getValue(fingerHeight))/2)); - - - verticalLowMargin = MAX_INTEGER(verticalLowMargin, getUnit(RETURN_EVEN(rdImp + widthOfImp/2 + widthOfSourceWire - + rdAlu2 + widthOfActive + rdActive)) ); - - verticalHighMargin = MAX_INTEGER(verticalHighMargin, horizontalMargin + getUnit(2*rdAlu2 + 2*widthOfDrainWire) ); - horizontalMargin = MAX_INTEGER(horizontalMargin, getUnit(RETURN_EVEN(rdImp + widthOfImp/2)) ); - - UpdateSession::open(); - - if(_m == 1 ) { // If there is only one finger. - _Place( instance, Transformation::Orientation::ID, Point( horizontalMargin, verticalLowMargin ) ); - - } else { - // get instance who's model's abutment type is Left or Right. - // ************************************************************ - for_each_occurrence(occurrence, getLeafInstanceOccurrences()) - instance = dynamic_cast(occurrence.getEntity()); - Transistor * trans = dynamic_cast(instance->getMasterCell()); - - if ( _sourceIsFirst ) { - if(trans->isLeft() && !leftins) - leftins = instance; - else if ( trans->isLeft() && leftins) - rightins = instance; - else if ( trans->isRight()) - rightins = instance; - } else { - if(trans->isRight() && !leftins) - leftins = instance; - else if (trans->isRight() && leftins ) - rightins = instance; - else if (trans->isLeft()) - rightins = instance; - } - end_for - - // You must place this first instance who's model is left finger in a point who's - // x, y are all pair. - // Because if you do this, you can be sure that all rectangle of this instance are - // correctly in the grille of fondor. - // *********************************************************************************** - - if(_sourceIsFirst) - _Place( leftins, Transformation::Orientation::ID, Point(horizontalMargin, verticalLowMargin) ); - else - _Place( leftins, Transformation::Orientation::MX, Point(horizontalMargin, verticalLowMargin) ); - - _setRefIns(leftins); - - if(_sourceIsFirst) // internal Finger's transformation. - internalTransCode = Transformation::Orientation::MX; - else - internalTransCode = Transformation::Orientation::ID; - - // Place internal finger. - // ********************* - for_each_occurrence(occurrence, getLeafInstanceOccurrences()) - - Instance * instance = dynamic_cast(occurrence.getEntity()); - - if(instance==leftins || instance==rightins ) - continue; - - _PlaceRight( instance, internalTransCode); - - if(internalTransCode == Transformation::Orientation::MX) - internalTransCode = Transformation::Orientation::ID; - else - internalTransCode = Transformation::Orientation::MX; - - end_for - - // Place the last finger. - // ********************** - Transistor * trans = dynamic_cast(rightins->getMasterCell()); - - if( trans->isRight()) - _PlaceRight( rightins, Transformation::Orientation::ID); - else - _PlaceRight( rightins, Transformation::Orientation::MX); - - } - - UpdateSession::close(); - - - - // Set AbutmentBox. - // **************** - for_each_instance(instance, getInstances()) - instance->unmaterialize(); - instance->materialize(); - end_for - - UpdateSession::open(); - - - cout <<"Bounding box of TrMos is "< netName2PositionOfConnectorMap; - list routingZoneList; - list sourcePositionList; - list drainPositionList; - Unit sourceRoutingZoneWidth; - Unit drainRoutingZoneWidth; - - DataBase * db = getDataBase(); - if(!db) throw Error("Can't launch Trmos::PlaceAndRoute for " + getString(this) + " : can't find DataBase"); - - Layer * layerAlu1 = db->getTechnology()->getLayer(Name("ALU1")); - Layer * layerAlu2 = db->getTechnology()->getLayer(Name("ALU2")); - - Layer * layerVia1 = db->getTechnology()->getLayer(Name("VIA1")); - Layer * layerActive = db->getTechnology()->getLayer(Name("ACTIVE")); - - Layer * layerVia01 = db->getTechnology()->getLayer(Name("via01")); - Layer * layerVia12 = db->getTechnology()->getLayer(Name("via12")); - - Layer * layerPoly = db->getTechnology()->getLayer(Name("POLY")); - Layer * layerNwell = db->getTechnology()->getLayer(Name("NWELL")); - Layer * layerCont = db->getTechnology()->getLayer(Name("CONT")); - - Layer * layerImp = NULL; - - if(_polarity == Transistor::Polarity::P) - layerImp = db->getTechnology()->getLayer(Name("NIMP")); - else - layerImp = db->getTechnology()->getLayer(Name("PIMP")); - - Pin * pin = NULL; // For get the adresse of Created Pins. - - long connectorPosition = 0; - - - cout << " Begin routage " << endl; - - - // Set position of four connectors. - // ******************************** - vector::iterator i = _highPinOrder.begin(), - j = _highPinOrder.end(); - - while(i!=j) { - if(*i == D) - netName2PositionOfConnectorMap[string("drain")] = initialPosition; - if(*i == G) - netName2PositionOfConnectorMap[string("grid")] = initialPosition; - - interval = MAX_INTEGER(expectedInterval, getUnit(widthOfDrainWire + rdAlu2)); - - // initialPosition += horizontalMargin/2; - initialPosition += interval; - i++; - } - - vector::iterator m = _lowPinOrder.begin(), - n = _lowPinOrder.end(); - - //initialPosition = verticalMargin - horizontalMargin/2; - //initialPosition = verticalLowMargin - MAX_INTEGER(expectedInterval, getUnit(rdImp + widthOfImp/2)); - initialPosition = verticalLowMargin - getUnit(rdImp + widthOfImp/2); - - while(m!=n) { - if(*m == S) - netName2PositionOfConnectorMap[string("source")] = initialPosition; - if(*m == B) - netName2PositionOfConnectorMap[string("bulk")] = initialPosition; - - interval = MAX_INTEGER(expectedInterval, getUnit(rdAlu2 + widthOfSourceWire)); - - initialPosition -= interval; - m++; - } - - cout << " Main loop "<< endl; - - // Main Routing Algorithm. - // *********************** - - // Main Loop. - // ********** - for_each_net(net, getNets()) // For all hypernets. - - if(getString(net->getName())=="bulk" || getString(net->getName())=="BULK" ) - continue; - - // get Routing Zone. - // ***************** - HyperNet hyperNet(Occurrence(net, Path())); - for_each_occurrence(occurrence, hyperNet.getNetOccurrences()) // For all net occurrences. - Net * net = dynamic_cast(occurrence.getEntity()); - Box routingZone; - - if(net->getCell()->isLeaf()) { - Transistor * trans = dynamic_cast(net->getCell()); - if ( !trans ) - throw Error("Can't launch Trmos::PlaceAndRoute for " + getString(this) - + ", it is not a Transistor"); - - cout << getString(occurrence) << endl; - cout << getString(occurrence.getPath().getTransformation()) <_getMapNet2Box()))[net]) << endl; - - // get Routing Zone. - // ***************** - routingZone = occurrence.getPath().getTransformation().getBox((*(trans->_getMapNet2Box()))[net]); - routingZoneList.push_back(routingZone); - - if(getString(net->getName())=="SOURCE") { - sourcePositionList.push_back(routingZone.getXCenter()); - sourceRoutingZoneWidth = routingZone.getWidth(); - } - else if (getString(net->getName())=="DRAIN") { - drainPositionList.push_back(routingZone.getXCenter()); - drainRoutingZoneWidth = routingZone.getWidth(); - } - } - - end_for - - - cout <<"Print routing zone for " <::iterator it_begin_listbox = routingZoneList.begin(), - it_end_listbox = routingZoneList.end(); - - while(it_begin_listbox != it_end_listbox) - { - cout<< getString(*it_begin_listbox) <::iterator routingzonelist_begin_it = routingZoneList.begin(), - routingzonelist_end_it = routingZoneList.end(); - - connectorPosition = netName2PositionOfConnectorMap[getString(net->getName())]; - cout << "Connector Position is " << netName2PositionOfConnectorMap[getString(net)] << endl; - - while(routingzonelist_begin_it!=routingzonelist_end_it) { - - Box routingZoneBox = *routingzonelist_begin_it; - - // Create vertical line and Contact. - // ******************************** - if(connectorPosition > routingZoneBox.getYMin()) { - Vertical::create(net, layerAlu1, routingZoneBox.getXCenter() - , routingZoneBox.getWidth() + getUnit(2*reAlu1Contact) - , routingZoneBox.getYMin() - getUnit(reAlu1Contact) - , connectorPosition); - } - else { - Vertical::create(net, layerAlu1, routingZoneBox.getXCenter() - , routingZoneBox.getWidth() + getUnit(2*reAlu1Contact) - , connectorPosition - , routingZoneBox.getYMax() + getUnit(reAlu1Contact) ) ; - } - - Contact::create(net, layerVia12, routingZoneBox.getXCenter() - , connectorPosition - , getUnit(minVia1Width) - , getUnit(minVia1Width) - ); - - routingzonelist_begin_it ++ ; - } - - // Create horizontal line. - // *********************** - long widthOfWire = 0; - - if(getString(net->getName())=="source") - widthOfWire = widthOfSourceWire; - else if(getString(net->getName())=="drain") - widthOfWire = widthOfDrainWire; - else - widthOfWire = widthOfDrainWire; - - - Horizontal::create(net, layerAlu2, connectorPosition - , getUnit(widthOfWire) - , 0 - , getAbutmentBox().getXMax() - ); - - // Create Two Pins. - // **************** - pin = Pin::create(net - , Name(getString(net->getName())+"_west") - , Pin::AccessDirection(Pin::AccessDirection::WEST) - , Pin::PlacementStatus(Pin::PlacementStatus::PLACED) - , layerAlu2 - , getAbutmentBox().getXMin() - , connectorPosition - , getUnit(widthOfWire) - , getUnit(widthOfWire) - ); - - _mapNetToPinBoxInLeftSide[net] = pin; - - pin = Pin::create(net - , Name(getString(net->getName())+"_east") - , Pin::AccessDirection(Pin::AccessDirection::EAST) - , Pin::PlacementStatus(Pin::PlacementStatus::PLACED) - , layerAlu2 - , getAbutmentBox().getXMax() - , connectorPosition - , getUnit(widthOfWire) - , getUnit(widthOfWire) - ); - - _mapNetToPinBoxInRightSide[net] = pin; - - routingZoneList.clear(); - - // End Of Main Loop. - // ***************** - end_for - - // Route Net Bulk. - // *************** - connectorPosition = netName2PositionOfConnectorMap[string("bulk")]; - - Net * netBulk = getNet(Name("bulk")); - - if(!netBulk) // bulk and source are connected. - netBulk = getNet(Name("source")); - - // Calculate the width of Contact Alu1. - // ************************************ - long widthOfAlu1 = MAX_INTEGER( MAX_INTEGER(minAlu1Width, 2*reAlu1Contact + minContWidth), 2*reAlu1Via1 + minVia1Width); - - Unit bulkPosition = netName2PositionOfConnectorMap[string("bulk")]; - Unit sourcePosition = netName2PositionOfConnectorMap[string("source")]; - - Horizontal::create( netBulk - , layerImp - , bulkPosition - , getUnit(widthOfImp) - , 0 - getUnit(reImpActi) - , getAbutmentBox().getXMax() + getUnit(reImpActi) - ); - - Horizontal::create( netBulk - , layerActive - , bulkPosition - , getUnit(widthOfActive) - , 0 - , getAbutmentBox().getXMax() - ); - - Horizontal::create( netBulk - , layerAlu2 - , bulkPosition - , getUnit(widthOfSourceWire) - , 0 - , getAbutmentBox().getXMax() - ); - - // Create Two Pins For Net bulk. - // ***************************** - if(!_isBsConnected) { - - pin = Pin::create(netBulk - , Name(getString(netBulk->getName())+"_west") - , Pin::AccessDirection(Pin::AccessDirection::WEST) - , Pin::PlacementStatus(Pin::PlacementStatus::PLACED) - , layerAlu2 - , getAbutmentBox().getXMin() - , bulkPosition - , getUnit(widthOfSourceWire) - , getUnit(widthOfSourceWire) - ); - - _mapNetToPinBoxInLeftSide[netBulk] = pin; - - pin = Pin::create(netBulk - , Name(getString(netBulk->getName())+"_east") - , Pin::AccessDirection(Pin::AccessDirection::EAST) - , Pin::PlacementStatus(Pin::PlacementStatus::PLACED) - , layerAlu2 - , getAbutmentBox().getXMax() - , bulkPosition - , getUnit(widthOfSourceWire) - , getUnit(widthOfSourceWire) - ); - - _mapNetToPinBoxInRightSide[netBulk] = pin; - } - - - if( netName2PositionOfConnectorMap[string("source")] > netName2PositionOfConnectorMap[string("bulk")] ) { - // Source Is Upper Than Bulk. - - cout << " Source is Upper Than Bulk" << endl; - - list::iterator i = sourcePositionList.begin(), j = sourcePositionList.end(); - - while(i!=j) { - - cout << " ######### Create Contact ###########" <::iterator i , j; - - - if( _isBsConnected ) { // If bulk and Source are connected. - i = sourcePositionList.begin(); - j = sourcePositionList.end(); - } - else { - i = drainPositionList.begin(); - j = drainPositionList.end(); - } - - while(i!=j) { - - cout << " ######### Create Contact ###########" < cellSet; - - -static void getAllCells(Cell* cell) -// ******************************** -{ - cellSet.insert(cell); - - if(!(cell->isLeaf())){ - for_each_instance(instance, cell->getInstances()) - Cell * mastercell = instance->getMasterCell(); - getAllCells(mastercell); - end_for - } -} - - - -namespace DEVICE { - - -// **************************************************************************************************** -// Device implementation -// **************************************************************************************************** - -Device::Device(Library* library, const Name& name) -// ************************************************************************** -: Inherit(library, name) -{ -} - - -void Device::_postCreate() { - Inherit::_postCreate(); - - //CDataBase* database = getCDataBase(); - //CCatal* ccatal = database->getCCatal(); - - //CCatal::State* state = ccatal->getState(getName(), true); - //state->SetFlags(CCatal::State::LOGICAL|CCatal::State::PHYSICAL|CCatal::State::IN_MEMORY|CCatal::State::GDS, true); - //state->SetCell(this); - //state->SetLibrary(getLibrary()); - -} - - -void Device::SaveLogicalView() -// *************************** -{ - cellSet.clear(); - getAllCells(this); - - //CDataBase * db = getCDataBase(); - - // set::iterator i = cellSet.begin(), j = cellSet.end(); - // - // while(i!=j) { - // db->SaveCell(*i, CCatal::State::LOGICAL ); - // i++; - // } -} - -void Device::_Place(Instance* ins, const Transformation::Orientation& orientation, const Point& point) -// ************************************************************************************************** -{ - if(!ins) { - throw Error("Can't Place Instance : ins is NULL"); - } - - if(ins->isPlaced()) { - throw Error("Can't Place " + getString(ins) + " : it has already been placed"); - } - - Transformation transformation(Point(0,0), orientation); - Box orientedmastercellbox = transformation.getBox(ins->getMasterCell()->getAbutmentBox()); - - Point translation( point.getX() - orientedmastercellbox.getXMin() - , point.getY() - orientedmastercellbox.getYMin() ); - - Transformation transformation_ins = Transformation(translation, orientation); - - ins->setTransformation(transformation_ins); - ins->setPlacementStatus(Instance::PlacementStatus::PLACED); -} - - -void Device::_setRefIns(Instance* ins) const -// ***************************************** -{ - if(!ins) { - throw Error("Can't SetRefIns : ref instance is NULL"); - } - - if(ins->isUnplaced()) { - throw Error("Can't SetRefIns : ref instance has't been placed"); - } - - refins = ins; -} - - -void Device::_PlaceRight(Instance* ins, const Transformation::Orientation& orientation, const Point& offset) -// ******************************************************************************************************** -{ - if(!ins) { - throw Error("Can't PlaceRight Instance : ins is NULL"); - } - - if(ins->isPlaced()) { - throw Error("Can't PlaceRight " + getString(ins) + " : it has already been placed"); - } - - - if(!refins) { - throw Error("Can't Place Right " + getString(ins) + " : can't find refins"); - } - - Box refinsbox = refins->getAbutmentBox(); - - Transformation transformation(Point(0,0), orientation); - Box orientedmastercellbox = transformation.getBox(ins->getMasterCell()->getAbutmentBox()); - - Point translation( refinsbox.getXMax() - orientedmastercellbox.getXMin() + offset.getX() - , refinsbox.getYMin() - orientedmastercellbox.getYMin() + offset.getY() ); - - Transformation transformation_ins = Transformation(translation, orientation); - - ins->setTransformation(transformation_ins); - ins->setPlacementStatus(Instance::PlacementStatus::PLACED); - - refins = ins; -} - - -} // end namespace Device diff --git a/chamsin/src/device_backup/device/Device.h b/chamsin/src/device_backup/device/Device.h deleted file mode 100644 index 79a47f96..00000000 --- a/chamsin/src/device_backup/device/Device.h +++ /dev/null @@ -1,71 +0,0 @@ - -// **************************************************************************************************** -// File: Device.h -// Authors: Wu YiFei -// Date : 21/12/2006 -// **************************************************************************************************** - -#ifndef DEVICE_H -#define DEVICE_H - - -#include "Cell.h" -using namespace Hurricane; - -namespace DEVICE { - -class Device : public Cell { - -#if !defined(__DOXYGEN_PROCESSOR__) -// Types -// ***** - public : typedef Cell Inherit; - -// Attributes -// ********** - - -// Constructors -// ************ - protected : Device(Library* library, const Name& name); - protected : virtual void _postCreate(); - - -#endif - -// Operations -// ********** -// public : virtual void Create(const char, const bool) = 0; - public : virtual void dses() = 0; - public : virtual void shape() = 0; -// public : virtual void Generate() = 0; - - -# if !defined(__DOXYGEN_PROCESSOR__) - public : virtual void SaveLogicalView(); - public : virtual void SavePhysicalView() {}; - -// Accessors -// ********* - -// Updators -// ******** - -// Others -// ****** - public : virtual void _Flush() = 0; - - // Description of Layout - // ********************** - public: void _Place(Instance* ins, const Transformation::Orientation& orientation, const Point& point); - public: void _setRefIns(Instance*) const; - public: void _PlaceRight(Instance* ins, const Transformation::Orientation& orientation, const Point& offset=Point()); - - -#endif - -}; - -} - -#endif // DEVICE_H diff --git a/chamsin/src/device_backup/device/DeviceUtil.h b/chamsin/src/device_backup/device/DeviceUtil.h deleted file mode 100644 index 18eb1f58..00000000 --- a/chamsin/src/device_backup/device/DeviceUtil.h +++ /dev/null @@ -1,77 +0,0 @@ -// **************************************************************************************************** -// File: DeviceUtil.h -// Authors: Wu YiFei -// Date : 28/05/2006 -// **************************************************************************************************** - - -# ifndef DEVICEUTIL_H -# define DEVICEUTIL_H - - -// **************************************************************************************************** -// Identifier Declaration. -// **************************************************************************************************** - - - - -namespace DEVICE { - -// **************************************************************************************************** -// Constants. -// **************************************************************************************************** - - -// **************************************************************************************************** -// Macros. -// **************************************************************************************************** - -// -------------------------------------------------------------------- -// Macro Method "RETURN_EVEN(num)" -// This Method Macro is return a number even. - - /* \num must be a integer. - */ - -# define RETURN_EVEN(num) \ - (num%2)==0?num:num+1 - - -// -------------------------------------------------------------------- -// Macro Method "MAX_INTEGER(a, b)" -// This Method Macro is return the Max between a and b. - - /* \a must be a integer. - * \b must be a integer. - */ - -# define MAX_INTEGER(a, b) \ - a>b?a:b - - - -// **************************************************************************************************** -// Class. -// **************************************************************************************************** - - -// **************************************************************************************************** -// Variables. -// **************************************************************************************************** - - -// **************************************************************************************************** -// Utilitarians (functions). -// **************************************************************************************************** - - -} // END OF NAMESPACE DEVICE - - -// **************************************************************************************************** -// Generic Functions. -// **************************************************************************************************** - - -# endif diff --git a/chamsin/src/device_backup/device/TrMos.cpp b/chamsin/src/device_backup/device/TrMos.cpp deleted file mode 100644 index 8eb6496c..00000000 --- a/chamsin/src/device_backup/device/TrMos.cpp +++ /dev/null @@ -1,417 +0,0 @@ -// **************************************************************************************************** -// File: TrMos.cpp -// Authors: Wu YiFei -// Date : 21/12/2006 -// **************************************************************************************************** - -#include "Instance.h" -#include "MetaTransistor.h" -#include "Net.h" -#include "Transistor.h" -#include "Transistors.h" - -#include "UpdateSession.h" - -#include "DtrAccess.h" - -#include "TrMos.h" -using namespace Hurricane; - - -namespace DEVICE { - -// **************************************************************************************************** -// TrMos implementation -// **************************************************************************************************** - -TrMos::TrMos(Library* library, const Name& name): - Device(library, name), - _polarity(Transistor::N), - _isBsConnected(false), - _m(1), - _sourceIsFirst(true), - _hasDummy(false), - _hasRing(true), - _tr1(NULL), - _capaRouting(0) -{} - - -TrMos* TrMos::create(Library* library, const Name & name) { - TrMos* trmos= new TrMos(library, name); - trmos->_postCreate(); - return trmos; -} - -void TrMos::_postCreate() { - Inherit::_postCreate(); - - // do something. - // Initialize pin order list and other attributes. - // ********************************************** - // _lowPinOrder[0]=D; - // _lowPinOrder[1]=G; - - // _highPinOrder[0]=S; - // _highPinOrder[1]=B; - - _highPinOrder.push_back(D); - _highPinOrder.push_back(G); - - _lowPinOrder.push_back(S); - _lowPinOrder.push_back(B); - - double minWidth = (DtrAccess::getDtrAccess())->getSingleRealRuleByLabel(string("RW_ALU1")); - - _widthOfSourceWire = minWidth; - _widthOfDrainWire = minWidth; - -} - -void TrMos::create(const Transistor::Polarity& polarity, const bool isbsconnected) -{ - if( _tr1 ) { - throw Error("Can't Create Logical View of TrMos " + getString(getName()) + - " : " + "it has already been created"); - } - - _polarity = polarity; - _isBsConnected = isbsconnected; - - // MetaTransistor is in the same library than Trmos - // ************************************************ - Library * library = getLibrary(); - - // Create signals - // ************** - Net * drain = NULL; - Net * source = NULL; - Net * grid = NULL; - Net * bulk = NULL; - - (drain = Net::create(this, Name("drain")))->setExternal(true); - (source = Net::create(this, Name("source")))->setExternal(true); - (grid = Net::create(this, Name("grid")))->setExternal(true); - - if(!isbsconnected) { - (bulk = Net::create(this, Name("bulk")))->setExternal(true); - } - - - // Instancier a MetaTransistor and create the connection - // The name of MetaTransistor is nameoftrmos_tr1 - // **************************************************** - - _tr1 = MetaTransistor::create(library, Name( getString(getName())+"_Mos1" ), _polarity); - Instance * instance = Instance::create(this, - Name("Ins_" + getString(_tr1->getName())), - _tr1); - - instance->getPlug(_tr1->getNet(Name("DRAIN")))->setNet(drain); - instance->getPlug(_tr1->getNet(Name("SOURCE")))->setNet(source); - instance->getPlug(_tr1->getNet(Name("GRID")))->setNet(grid); - - if(!isbsconnected) - instance->getPlug(_tr1->getNet(Name("BULK")))->setNet(bulk); - else - instance->getPlug(_tr1->getNet(Name("BULK")))->setNet(source); - - -} - - -void TrMos::generate(const unsigned m, const bool sourceisfirst, const bool hasring - , const unsigned nbsourcecolumn, const unsigned nbdraincolumn) -// ********************************************************************************* -{ - if( !_tr1 ) { - throw Error("Can't Create Physical View for " + getString(this) + - " : " + "Logical view has't been created yet."); - } - -// if( !(_transistorList.empty()) ) { -// throw Error("Can't Create Physical View of TrMos " + getString(getName()) + " : " -// + "it has already been created"); -// } - - // Check out param of realization. - // ******************************* - if( m <= 0 ) - throw Error("Can't generate for " + getString(this) + " : m " - + getString(m) + " is invalid."); - - if(nbsourcecolumn<1) - throw Error("Can't generate for " + getString(this) - + " : nbsourcecolumn " + getString(nbsourcecolumn) + " is invalid."); - - if(nbdraincolumn<1) - throw Error("Can't generate for" + getString(this) + " : nbdraincolumn " - + getString(nbdraincolumn) + " is invalid."); - - - if(!(_transistorList.empty())) { - _Flush(); - } - - _m = m; - _sourceIsFirst = sourceisfirst; - _hasRing = hasring; - - // Motifs are in the same library than Trmos - // ***************************************** - Library * library = getLibrary(); - - cout << "################################################################" << endl << - "#### BEGIN AUTOGENERATON FOR " + _getTypeName() + " " + getString(getName()) + " #####" << endl << - "################################################################" << endl << endl; - -// OpenUpdateSession(); - -/* (1) */ - - //IF_DEBUG_HUR_ANALOG - cout << "*** Stage 1 : CreateLayout of " + getString(this) + " Begin ***" <setM(_m); - - for(unsigned i=0; igetName()) + "_Finger_" + getString(i), - _polarity); - - _transistorList.push_back(finger); - Instance::create(_tr1, Name("Ins_" + getString(finger->getName())), finger); - } - - //IF_DEBUG_HUR_ANALOG - - cout << "*** Stage 1 : CreateLayout of " + getString(this) + " finish ***" <getM()) + ".\n" - << getString(_m) + " Transistors are created.\n" <createConnection(); - - //IF_DEBUG_HUR_ANALOG - cout << "*** Stage 2 : CreateLayout of " + getString(this) + " finish ***" <setLe(10); -// _tr1->setWe(11); - -/* (3) */ - //IF_DEBUG_HUR_ANALOG - cout << "*** Stage 3 : CreateLayout of " + getString(this) + " Begin ***" <getLe() ; - double w_finger = (_tr1->getWe()) / (double)(_tr1->getM()) ; - unsigned count = 0; - - Transistor::MaskV1Info * masqueinfo = new Transistor::MaskV1Info(l_finger, w_finger); - masqueinfo->setNbSourceColumn(nbsourcecolumn); - masqueinfo->setNbDrainColumn(nbdraincolumn); - - list::iterator i = _transistorList.begin() - , j = _transistorList.end(); - - if(_m == 1) { - masqueinfo->setType(Transistor::Type::SINGLE); - (*(_transistorList.begin()))->setMaskInfo(masqueinfo); - } else if(_m%2==0) { // if m is pair, create two left fingers if is source first. - // and create two right fingers if is drain first. - while(i!=j) { - if(++count>2) - masqueinfo->setType(Transistor::Type::INTERNAL); - else { - if ( _sourceIsFirst ) - masqueinfo->setType(Transistor::Type::LEFT); - else - masqueinfo->setType(Transistor::Type::RIGHT); - } - - (*i)->setMaskInfo(masqueinfo); - i++; - } - } else if(_m%2==1) { // if m is impair, create one left finger, one right finger. - while(i!=j){ - ++ count ; - if (count == 1) - masqueinfo-> setType(Transistor::Type::LEFT); - else if (count == 2) - masqueinfo-> setType(Transistor::Type::RIGHT); - else - masqueinfo-> setType(Transistor::Type::INTERNAL); - - (*i)->setMaskInfo(masqueinfo); - i++; - } - } - - delete masqueinfo; - - //IF_DEBUG_HUR_ANALOG - cout << "*** Stage 3 : CreateLayout of " + getString(this) + " finish ***" <_le) + "." << endl -// << "Real w of " << (long)_tr1 << getString(_tr1) + " is " + getString(_tr1->_we) + "." << endl -// <createLayout(); - - //IF_DEBUG_HUR_ANALOG - cout << "*** Stage 4 : CreateLayout of " + getString(this) + " finish ***"<setTransformation(instance->getTransformation()); - instance->unmaterialize(); - instance->materialize(); - -//IF_DEBUG_HUR_ANALOG - cout << getString(instance) <<" 's boundingBox is " << getString(instance->getBoundingBox())<::iterator i = _lowPinOrder.begin(), j = _lowPinOrder.end(); - - cout << " Low Pin Order " << endl; - - while(i!=j) { - cout << *i << endl; - i++; - } - -} - - -void TrMos::setHighPinOrder(const PinName pin1, const PinName pin2) -// ***************************************************************** -{ - _highPinOrder[0]=pin1; - _highPinOrder[1]=pin2; - - vector::iterator i = _highPinOrder.begin(), j = _highPinOrder.end(); - - cout << " High Pin Order " << endl; - - while(i!=j) { - cout << *i << endl; - i++; - } -} - - -void TrMos::_Flush() -// **************** -{ - if(_transistorList.empty()) { - throw Error("Can't delete Physical View of TrMos " + getString(getName()) + " : " + "il doesn't exist"); - } - - _tr1->Flush(); - - _transistorList.clear(); - - // Delete all segments of TrMos - // **************************** - /* to do */ - - -} - - -string TrMos::_getString() const -// *************************************** -{ - string s= Inherit::_getString(); - return s; -} - -Record* TrMos::_getRecord() const -// ********************************* -{ - Record* record = Inherit::_getRecord(); - return record; -} - -} // end of namespace Device diff --git a/chamsin/src/device_backup/device/TrMos.h b/chamsin/src/device_backup/device/TrMos.h deleted file mode 100644 index 929811b4..00000000 --- a/chamsin/src/device_backup/device/TrMos.h +++ /dev/null @@ -1,126 +0,0 @@ -// **************************************************************************************************** -// File: TrMos.h -// Authors: Wu YiFei -// Date : 21/12/2006 -// **************************************************************************************************** - -#ifndef TRMOS_H -#define TRMOS_H - -#include "Net.h" -using namespace Hurricane; - -#include "Transistor.h" - -//#include "MetaTransistor.h" -#include "Device.h" - - -namespace DEVICE { - -class TrMos : public Device { - - public : enum PinName { D, G, S, B }; - -// Attributes -// ******************* - - // Structural parameter. - // ******************** - private : Transistor::Polarity _polarity; - private : bool _isBsConnected; - private : unsigned _m; - - // Parameter of the electric synthesis. - // *********************************** - /* to do */ - - // Physical parameter of realization. - // ********************************** - /* Placement. */ - private : bool _sourceIsFirst; - private : bool _hasDummy; - private : bool _hasRing; - - /* Routing. */ - private : vector _lowPinOrder; // relative position of the connectors on the basis of the top. - private : vector _highPinOrder; - - private : map _mapNetToPinBoxInLeftSide; - private : map _mapNetToPinBoxInRightSide; - - private : double _widthOfSourceWire; // by defect, minWidth, unit of valeur is Micro - private : double _widthOfDrainWire; // by defect, minWidth, unit of valeur is Micro - - /* Others */ - private : MetaTransistor * _tr1; - private : double _capaRouting; - private : list _transistorList; - - -// Constructors -// ************ - protected : TrMos(Library* library, const Name& name); - protected : virtual void _postCreate(); - - public : static TrMos* create(Library* library, const Name & name); - - - -// Operations -// ********** - public : virtual void dses() { /* to do */}; - public : virtual void shape() { /* to do */}; - - - public : void create(const Transistor::Polarity& polarity, const bool isbsconnected); - public : void generate(const unsigned m, const bool sourceisfirst, const bool hasring, - const unsigned nbsourcecolumn, const unsigned nbdraincolumn); - -// Accessors -// ********* - public : const Transistor::Polarity& getPolarity() const { return _polarity; }; - public : unsigned getM() const { return _m; }; - public : const double getWidthOfSourceWire() const { return _widthOfSourceWire; }; - public : const double getWidthOfDrainWire() const { return _widthOfDrainWire; }; - public : MetaTransistor* getTr1() const { return _tr1; }; - -// Updators -// ******** - public : void setMosLength(const double length) { if(_tr1) _tr1->setLe(length); } - public : void setMosWidth(const double width) { if(_tr1) _tr1->setWe(width); } - public : void setWidthOfSourceWire(const double width) { _widthOfSourceWire = width; }; - public : void setWidthOfDrainWire(const double width) { _widthOfDrainWire=width; }; - public : void setLowPinOrder(const PinName, const PinName) ; - public : void setHighPinOrder(const PinName, const PinName) ; - -// Predicats -// ********* - public : bool isBsConnected() const { return _isBsConnected; }; - public : bool sourceIsFirst() const { return _sourceIsFirst; }; - public : bool hasRing() const { return _hasRing; }; - - -# if !defined(__DOXYGEN_PROCESSOR__) - -// Others -// ****** - public: virtual string _getTypeName() const {return _TName("TrMos"); }; - public: virtual string _getString() const; - public: virtual Record* _getRecord() const; - - public: vector& getLowPinOrder() { return _lowPinOrder; }; - public: vector& getHighPinOrder() { return _highPinOrder; }; - - public: map& getMapNetToPinBoxInLeftSide() { return _mapNetToPinBoxInLeftSide; }; - public: map& getMapNetToPinBoxInRightSide() { return _mapNetToPinBoxInRightSide; }; - - public : virtual void _Flush(); - protected : void _PlaceAndRoute(); -#endif - -}; - -} - -#endif // TRMOS_H diff --git a/chamsin/src/device_backup/device/TrMos_PlaceRoute.cpp b/chamsin/src/device_backup/device/TrMos_PlaceRoute.cpp deleted file mode 100644 index 76ecb557..00000000 --- a/chamsin/src/device_backup/device/TrMos_PlaceRoute.cpp +++ /dev/null @@ -1,685 +0,0 @@ -// **************************************************************************************************** -// File: TrMos.cpp -// Authors: Wu YiFei -// Date : 21/12/2006 -// **************************************************************************************************** - - -#include "TrMos.h" - -#include "Instances.h" -#include "MetaTransistor.h" -#include "Net.h" -#include "Transistors.h" -#include "Box.h" -#include "UpdateSession.h" -#include "HyperNet.h" -#include "DataBase.h" -#include "Technology.h" -#include "Vertical.h" -#include "Horizontal.h" -#include "Pin.h" - -#include "RdsUnit.h" -#include "Transistor.h" -#include "DtrAccess.h" -using namespace Hurricane; - - - -#include "DeviceUtil.h" - - -namespace DEVICE{ - - -// **************************************************************************************************** -// TrMos implementation -// **************************************************************************************************** -void TrMos::_PlaceAndRoute() -// ************************* -{ - - // get Dtr Rules And Calculate the Size of AbutmentBox of Device. - // ************************************************************** - DtrAccess * dtraccess = DtrAccess::getDtrAccess(); - - Transistor::Polarity polarity; - if(_polarity == Transistor::Polarity::P) polarity = Transistor::Polarity::N; - else polarity = Transistor::Polarity::P; - - long minImpWidth = dtraccess->getSingleRdsRuleByLabel("RW_", getString(polarity), "IMP"); - long minContWidth = dtraccess->getSingleRdsRuleByLabel(string("RW_CONT")); - long minAlu1Width = dtraccess->getSingleRdsRuleByLabel(string("RW_ALU1")); - long minVia1Width = dtraccess->getSingleRdsRuleByLabel(string("RW_VIA1")); - - long rdImp = dtraccess->getSingleRdsRuleByLabel(string("RD_NIMP")); - long rdActive = dtraccess->getSingleRdsRuleByLabel(string("RD_ACTI")); - long rdAlu2 = dtraccess->getSingleRdsRuleByLabel(string("RD_ALU1")); - - long reImpActi = dtraccess->getSingleRdsRuleByLabel("RE_", getString(polarity), "IMP_CONT"); - long reActiContact = dtraccess->getSingleRdsRuleByLabel("RE_ACTI_CONT"); - long reAlu1Contact = dtraccess->getSingleRdsRuleByLabel("RE_ALU1_CONT"); - long reAlu1Via1 = dtraccess->getSingleRdsRuleByLabel("RE_ALU1_VIA1"); - - long minActiWidth = 2*reActiContact + minContWidth; - - long widthOfSourceWire = ConvertRealToRdsUnit(_widthOfSourceWire); - long widthOfDrainWire = ConvertRealToRdsUnit(_widthOfDrainWire); - - long widthOfActive = MAX_INTEGER(minActiWidth, minContWidth + 2*reActiContact); - long widthOfImp = MAX_INTEGER(widthOfActive + 2*reImpActi, minImpWidth); - - - // ************************************************************** - // Placing . - // ************************************************************** - - Transformation::Orientation::Code internalTransCode = Transformation::Orientation::ID; - - Unit horizontalMargin = 0; // the horizontal margin of trmos. - Unit verticalLowMargin = 0; // the vertical low margin of trmos. - Unit verticalHighMargin = 0; // the vertical high margin of trmos. - - Unit fingerHeight = 0; // the height of trmos. - Instance * leftins = NULL; - Instance * rightins = NULL; - - OccurrenceLocator locator = getLeafInstanceOccurrences().getLocator(); - Instance * instance = dynamic_cast(locator.getElement().getEntity());; - fingerHeight = instance->getCell()->getBoundingBox().getHeight(); - horizontalMargin = getUnit(RETURN_EVEN((long)(getValue(fingerHeight))/4)); - verticalLowMargin = getUnit(RETURN_EVEN((long)(getValue(fingerHeight))/2)); - verticalHighMargin = getUnit(RETURN_EVEN((long)(getValue(fingerHeight))/2)); - - - verticalLowMargin = MAX_INTEGER(verticalLowMargin, getUnit(RETURN_EVEN(rdImp + widthOfImp/2 + widthOfSourceWire - + rdAlu2 + widthOfActive + rdActive)) ); - - verticalHighMargin = MAX_INTEGER(verticalHighMargin, horizontalMargin + getUnit(2*rdAlu2 + 2*widthOfDrainWire) ); - horizontalMargin = MAX_INTEGER(horizontalMargin, getUnit(RETURN_EVEN(rdImp + widthOfImp/2)) ); - - UpdateSession::open(); - - if(_m == 1 ) { // If there is only one finger. - _Place( instance, Transformation::Orientation::ID, Point( horizontalMargin, verticalLowMargin ) ); - - } else { - // get instance who's model's abutment type is Left or Right. - // ************************************************************ - for_each_occurrence(occurrence, getLeafInstanceOccurrences()) - instance = dynamic_cast(occurrence.getEntity()); - Transistor * trans = dynamic_cast(instance->getMasterCell()); - - if ( _sourceIsFirst ) { - if(trans->isLeft() && !leftins) - leftins = instance; - else if ( trans->isLeft() && leftins) - rightins = instance; - else if ( trans->isRight()) - rightins = instance; - } else { - if(trans->isRight() && !leftins) - leftins = instance; - else if (trans->isRight() && leftins ) - rightins = instance; - else if (trans->isLeft()) - rightins = instance; - } - end_for - - // You must place this first instance who's model is left finger in a point who's - // x, y are all pair. - // Because if you do this, you can be sure that all rectangle of this instance are - // correctly in the grille of fondor. - // *********************************************************************************** - - if(_sourceIsFirst) - _Place( leftins, Transformation::Orientation::ID, Point(horizontalMargin, verticalLowMargin) ); - else - _Place( leftins, Transformation::Orientation::MX, Point(horizontalMargin, verticalLowMargin) ); - - _setRefIns(leftins); - - if(_sourceIsFirst) // internal Finger's transformation. - internalTransCode = Transformation::Orientation::MX; - else - internalTransCode = Transformation::Orientation::ID; - - // Place internal finger. - // ********************* - for_each_occurrence(occurrence, getLeafInstanceOccurrences()) - - Instance * instance = dynamic_cast(occurrence.getEntity()); - - if(instance==leftins || instance==rightins ) - continue; - - _PlaceRight( instance, internalTransCode); - - if(internalTransCode == Transformation::Orientation::MX) - internalTransCode = Transformation::Orientation::ID; - else - internalTransCode = Transformation::Orientation::MX; - - end_for - - // Place the last finger. - // ********************** - Transistor * trans = dynamic_cast(rightins->getMasterCell()); - - if( trans->isRight()) - _PlaceRight( rightins, Transformation::Orientation::ID); - else - _PlaceRight( rightins, Transformation::Orientation::MX); - - } - - UpdateSession::close(); - - - - // Set AbutmentBox. - // **************** - for_each_instance(instance, getInstances()) - instance->unmaterialize(); - instance->materialize(); - end_for - - UpdateSession::open(); - - - cout <<"Bounding box of TrMos is "< netName2PositionOfConnectorMap; - list routingZoneList; - list sourcePositionList; - list drainPositionList; - Unit sourceRoutingZoneWidth; - Unit drainRoutingZoneWidth; - - DataBase * db = getDataBase(); - if(!db) throw Error("Can't launch Trmos::PlaceAndRoute for " + getString(this) + " : can't find DataBase"); - - Layer * layerAlu1 = db->getTechnology()->getLayer(Name("ALU1")); - Layer * layerAlu2 = db->getTechnology()->getLayer(Name("ALU2")); - - Layer * layerVia1 = db->getTechnology()->getLayer(Name("VIA1")); - Layer * layerActive = db->getTechnology()->getLayer(Name("ACTIVE")); - - Layer * layerVia01 = db->getTechnology()->getLayer(Name("via01")); - Layer * layerVia12 = db->getTechnology()->getLayer(Name("via12")); - - Layer * layerPoly = db->getTechnology()->getLayer(Name("POLY")); - Layer * layerNwell = db->getTechnology()->getLayer(Name("NWELL")); - Layer * layerCont = db->getTechnology()->getLayer(Name("CONT")); - - Layer * layerImp = NULL; - - if(_polarity == Transistor::Polarity::P) - layerImp = db->getTechnology()->getLayer(Name("NIMP")); - else - layerImp = db->getTechnology()->getLayer(Name("PIMP")); - - Pin * pin = NULL; // For get the adresse of Created Pins. - - long connectorPosition = 0; - - - cout << " Begin routage " << endl; - - - // Set position of four connectors. - // ******************************** - vector::iterator i = _highPinOrder.begin(), - j = _highPinOrder.end(); - - while(i!=j) { - if(*i == D) - netName2PositionOfConnectorMap[string("drain")] = initialPosition; - if(*i == G) - netName2PositionOfConnectorMap[string("grid")] = initialPosition; - - interval = MAX_INTEGER(expectedInterval, getUnit(widthOfDrainWire + rdAlu2)); - - // initialPosition += horizontalMargin/2; - initialPosition += interval; - i++; - } - - vector::iterator m = _lowPinOrder.begin(), - n = _lowPinOrder.end(); - - //initialPosition = verticalMargin - horizontalMargin/2; - //initialPosition = verticalLowMargin - MAX_INTEGER(expectedInterval, getUnit(rdImp + widthOfImp/2)); - initialPosition = verticalLowMargin - getUnit(rdImp + widthOfImp/2); - - while(m!=n) { - if(*m == S) - netName2PositionOfConnectorMap[string("source")] = initialPosition; - if(*m == B) - netName2PositionOfConnectorMap[string("bulk")] = initialPosition; - - interval = MAX_INTEGER(expectedInterval, getUnit(rdAlu2 + widthOfSourceWire)); - - initialPosition -= interval; - m++; - } - - cout << " Main loop "<< endl; - - // Main Routing Algorithm. - // *********************** - - // Main Loop. - // ********** - for_each_net(net, getNets()) // For all hypernets. - - if(getString(net->getName())=="bulk" || getString(net->getName())=="BULK" ) - continue; - - // get Routing Zone. - // ***************** - HyperNet hyperNet(Occurrence(net, Path())); - for_each_occurrence(occurrence, hyperNet.getNetOccurrences()) // For all net occurrences. - Net * net = dynamic_cast(occurrence.getEntity()); - Box routingZone; - - if(net->getCell()->isLeaf()) { - Transistor * trans = dynamic_cast(net->getCell()); - if ( !trans ) - throw Error("Can't launch Trmos::PlaceAndRoute for " + getString(this) - + ", it is not a Transistor"); - - cout << getString(occurrence) << endl; - cout << getString(occurrence.getPath().getTransformation()) <_getMapNet2Box()))[net]) << endl; - - // get Routing Zone. - // ***************** - routingZone = occurrence.getPath().getTransformation().getBox((*(trans->_getMapNet2Box()))[net]); - routingZoneList.push_back(routingZone); - - if(getString(net->getName())=="SOURCE") { - sourcePositionList.push_back(routingZone.getXCenter()); - sourceRoutingZoneWidth = routingZone.getWidth(); - } - else if (getString(net->getName())=="DRAIN") { - drainPositionList.push_back(routingZone.getXCenter()); - drainRoutingZoneWidth = routingZone.getWidth(); - } - } - - end_for - - - cout <<"Print routing zone for " <::iterator it_begin_listbox = routingZoneList.begin(), - it_end_listbox = routingZoneList.end(); - - while(it_begin_listbox != it_end_listbox) - { - cout<< getString(*it_begin_listbox) <::iterator routingzonelist_begin_it = routingZoneList.begin(), - routingzonelist_end_it = routingZoneList.end(); - - connectorPosition = netName2PositionOfConnectorMap[getString(net->getName())]; - cout << "Connector Position is " << netName2PositionOfConnectorMap[getString(net)] << endl; - - while(routingzonelist_begin_it!=routingzonelist_end_it) { - - Box routingZoneBox = *routingzonelist_begin_it; - - // Create vertical line and Contact. - // ******************************** - if(connectorPosition > routingZoneBox.getYMin()) { - Vertical::create(net, layerAlu1, routingZoneBox.getXCenter() - , routingZoneBox.getWidth() + getUnit(2*reAlu1Contact) - , routingZoneBox.getYMin() - getUnit(reAlu1Contact) - , connectorPosition); - } - else { - Vertical::create(net, layerAlu1, routingZoneBox.getXCenter() - , routingZoneBox.getWidth() + getUnit(2*reAlu1Contact) - , connectorPosition - , routingZoneBox.getYMax() + getUnit(reAlu1Contact) ) ; - } - - Contact::create(net, layerVia12, routingZoneBox.getXCenter() - , connectorPosition - , getUnit(minVia1Width) - , getUnit(minVia1Width) - ); - - routingzonelist_begin_it ++ ; - } - - // Create horizontal line. - // *********************** - long widthOfWire = 0; - - if(getString(net->getName())=="source") - widthOfWire = widthOfSourceWire; - else if(getString(net->getName())=="drain") - widthOfWire = widthOfDrainWire; - else - widthOfWire = widthOfDrainWire; - - - Horizontal::create(net, layerAlu2, connectorPosition - , getUnit(widthOfWire) - , 0 - , getAbutmentBox().getXMax() - ); - - // Create Two Pins. - // **************** - pin = Pin::create(net - , Name(getString(net->getName())+"_west") - , Pin::AccessDirection(Pin::AccessDirection::WEST) - , Pin::PlacementStatus(Pin::PlacementStatus::PLACED) - , layerAlu2 - , getAbutmentBox().getXMin() - , connectorPosition - , getUnit(widthOfWire) - , getUnit(widthOfWire) - ); - - _mapNetToPinBoxInLeftSide[net] = pin; - - pin = Pin::create(net - , Name(getString(net->getName())+"_east") - , Pin::AccessDirection(Pin::AccessDirection::EAST) - , Pin::PlacementStatus(Pin::PlacementStatus::PLACED) - , layerAlu2 - , getAbutmentBox().getXMax() - , connectorPosition - , getUnit(widthOfWire) - , getUnit(widthOfWire) - ); - - _mapNetToPinBoxInRightSide[net] = pin; - - routingZoneList.clear(); - - // End Of Main Loop. - // ***************** - end_for - - // Route Net Bulk. - // *************** - connectorPosition = netName2PositionOfConnectorMap[string("bulk")]; - - Net * netBulk = getNet(Name("bulk")); - - if(!netBulk) // bulk and source are connected. - netBulk = getNet(Name("source")); - - // Calculate the width of Contact Alu1. - // ************************************ - long widthOfAlu1 = MAX_INTEGER( MAX_INTEGER(minAlu1Width, 2*reAlu1Contact + minContWidth), 2*reAlu1Via1 + minVia1Width); - - Unit bulkPosition = netName2PositionOfConnectorMap[string("bulk")]; - Unit sourcePosition = netName2PositionOfConnectorMap[string("source")]; - - Horizontal::create( netBulk - , layerImp - , bulkPosition - , getUnit(widthOfImp) - , 0 - getUnit(reImpActi) - , getAbutmentBox().getXMax() + getUnit(reImpActi) - ); - - Horizontal::create( netBulk - , layerActive - , bulkPosition - , getUnit(widthOfActive) - , 0 - , getAbutmentBox().getXMax() - ); - - Horizontal::create( netBulk - , layerAlu2 - , bulkPosition - , getUnit(widthOfSourceWire) - , 0 - , getAbutmentBox().getXMax() - ); - - // Create Two Pins For Net bulk. - // ***************************** - if(!_isBsConnected) { - - pin = Pin::create(netBulk - , Name(getString(netBulk->getName())+"_west") - , Pin::AccessDirection(Pin::AccessDirection::WEST) - , Pin::PlacementStatus(Pin::PlacementStatus::PLACED) - , layerAlu2 - , getAbutmentBox().getXMin() - , bulkPosition - , getUnit(widthOfSourceWire) - , getUnit(widthOfSourceWire) - ); - - _mapNetToPinBoxInLeftSide[netBulk] = pin; - - pin = Pin::create(netBulk - , Name(getString(netBulk->getName())+"_east") - , Pin::AccessDirection(Pin::AccessDirection::EAST) - , Pin::PlacementStatus(Pin::PlacementStatus::PLACED) - , layerAlu2 - , getAbutmentBox().getXMax() - , bulkPosition - , getUnit(widthOfSourceWire) - , getUnit(widthOfSourceWire) - ); - - _mapNetToPinBoxInRightSide[netBulk] = pin; - } - - - if( netName2PositionOfConnectorMap[string("source")] > netName2PositionOfConnectorMap[string("bulk")] ) { - // Source Is Upper Than Bulk. - - cout << " Source is Upper Than Bulk" << endl; - - list::iterator i = sourcePositionList.begin(), j = sourcePositionList.end(); - - while(i!=j) { - - cout << " ######### Create Contact ###########" <::iterator i , j; - - - if( _isBsConnected ) { // If bulk and Source are connected. - i = sourcePositionList.begin(); - j = sourcePositionList.end(); - } - else { - i = drainPositionList.begin(); - j = drainPositionList.end(); - } - - while(i!=j) { - - cout << " ######### Create Contact ###########" <getTechnology(); - ATechnologyXmlParser::parse(analogTechnoFilePath, techno); -} - -ATechnology* AEnv::getATechnology() { - DataBase* db = DataBase::getDB(); - if (!db) { - throw Error(""); - } - Technology* technology = db->getTechnology(); - if (!technology) { - throw Error(""); - } - ATechnology* atechnology = ATechnology::getATechnology(technology); - return atechnology; -} diff --git a/chamsin/src/technology/AEnv.h b/chamsin/src/technology/AEnv.h deleted file mode 100644 index 0d412da9..00000000 --- a/chamsin/src/technology/AEnv.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef AENV_H_ -#define AENV_H_ - -class ATechnology; - -class AEnv { - public: - static void create(const char* symbTechnoFilePath, - const char* realTechnoFilePath, - const char* graphicFilePath, - const char* analogTechnoFilePath); - static ATechnology* getATechnology(); -}; - -#endif /* AENV_H_ */ diff --git a/chamsin/src/technology/ATechnology.cpp b/chamsin/src/technology/ATechnology.cpp deleted file mode 100644 index 143aa51a..00000000 --- a/chamsin/src/technology/ATechnology.cpp +++ /dev/null @@ -1,248 +0,0 @@ -#include "hurricane/Technology.h" -using namespace Hurricane; - -#include "ATechnology.h" - -namespace { -static Name ATechnologyPropertyName("ATechnologyProperty"); - -void printPhysicalRule(const ATechnology::PhysicalRule* physicalRule) { - cout << " - name = " << physicalRule->_name << - ", value = " << physicalRule->_value << - ", ref = " << physicalRule->_reference << endl; -} - -void printPhysicalRules(const ATechnology::PhysicalRules& physicalRules) { - for (ATechnology::PhysicalRules::const_iterator prit = physicalRules.begin(); - prit != physicalRules.end(); - prit++) { - ATechnology::PhysicalRule* physicalRule = *prit; - printPhysicalRule(physicalRule); - } -} - -void printPhysicalRules(const ATechnology::TwoLayersPhysicalRulesSet& physicalRules) { - for (ATechnology::TwoLayersPhysicalRulesSet::const_iterator prit = physicalRules.begin(); - prit != physicalRules.end(); - prit++) { - ATechnology::PhysicalRule* physicalRule = *prit; - printPhysicalRule(physicalRule); - } -} - -} - -string ATechnology::PhysicalRule::_getTypeName() const { - return "PhysicalRule"; -} - -string ATechnology::PhysicalRule::_getString() const { - return "<" + _getTypeName() + " " + getString(_name) + ">"; -} - -Record* ATechnology::PhysicalRule::_getRecord() const { - Record* record = new Record(getString(this)); - record->add(getSlot("Name", &_name)); - record->add(getSlot("Value", &_value)); - record->add(getSlot("Reference", &_reference)); - return record; -} - -string ATechnology::TwoLayersPhysicalRule::_getTypeName() const { - return "TwoLayersPhysicalRule"; -} - -string ATechnology::TwoLayersPhysicalRule::_getString() const { - return "<" + _getTypeName() + " " + getString(_name) + ">"; -} - -Record* ATechnology::TwoLayersPhysicalRule::_getRecord() const { - Record* record = Inherit::_getRecord(); - if (record) { - record->add(getSlot("Symetric", _symetric)); - } - return record; -} - -Name ATechnology::getName() const { - return ATechnologyPropertyName; -} - -string ATechnology::_getTypeName() const { - return _TName("ATechnologyProperty"); -} - -Record* ATechnology::_getRecord() const { - Record* record = Inherit::_getRecord(); - if (record) { - record->add(getSlot("NoLayerPhysicalRules", &_noLayerPhysicalRules)); - record->add(getSlot("OneLayerPhysicalRules", &_oneLayerPhysicalRules)); - record->add(getSlot("TwoLayersPhysicalRules", &_twoLayersPhysicalRules)); - } - return record; -} - -void ATechnology::addPhysicalRule(const Name& name, DbU::Unit value, const string& reference) { - PhysicalRule searchPR(name, 0, ""); - PhysicalRules::iterator prit = _noLayerPhysicalRules.find(&searchPR); - if (prit != _noLayerPhysicalRules.end()) { - throw Error(""); - } - PhysicalRule* newPhysicalRule = new PhysicalRule(name, value, reference); - _noLayerPhysicalRules.insert(newPhysicalRule); -} - -void ATechnology::addPhysicalRule(const Name& name, const Name& layerName, DbU::Unit value, const string& reference) { - Layer* layer = getLayer(layerName); - OneLayerPhysicalRules::iterator olprit = _oneLayerPhysicalRules.find(layer); - if (olprit == _oneLayerPhysicalRules.end()) { - pair result = - _oneLayerPhysicalRules.insert(OneLayerPhysicalRules::value_type(layer, PhysicalRules())); - olprit = result.first; - PhysicalRule* newPhysicalRule = new PhysicalRule(name, value, reference); - olprit->second.insert(newPhysicalRule); - } else { - PhysicalRules& physicalRules = olprit->second; - PhysicalRule searchPR(name, 0, ""); - if (physicalRules.find(&searchPR) != physicalRules.end()) { - throw Error("duplicate rule"); - } - PhysicalRule* newPhysicalRule = new PhysicalRule(name, value, reference); - physicalRules.insert(newPhysicalRule); - } -} - -void ATechnology::addPhysicalRule(const Name& name, const Name& layer1Name, - const Name& layer2Name, bool symetric, DbU::Unit value, - const string& reference) { - Layer* layer1 = getLayer(layer1Name); - Layer* layer2 = getLayer(layer2Name); - LayerPair layerPair(layer1, layer2); - TwoLayersPhysicalRules::iterator tlprit = _twoLayersPhysicalRules.find(layerPair); - if (tlprit == _twoLayersPhysicalRules.end()) { - pair result = - _twoLayersPhysicalRules.insert(TwoLayersPhysicalRules::value_type(layerPair, TwoLayersPhysicalRulesSet())); - tlprit = result.first; - TwoLayersPhysicalRule* newPhysicalRule = new TwoLayersPhysicalRule(name, value, reference, symetric); - tlprit->second.insert(newPhysicalRule); - } else { - TwoLayersPhysicalRulesSet& physicalRules = tlprit->second; - TwoLayersPhysicalRule searchPR(name, 0, "", true); - if (physicalRules.find(&searchPR) != physicalRules.end()) { - throw Error("duplicate rule"); - } - TwoLayersPhysicalRule* newPhysicalRule = new TwoLayersPhysicalRule(name, value, reference, symetric); - physicalRules.insert(newPhysicalRule); - } -} - -ATechnology* ATechnology::create(Technology* technology) { - ATechnology* prop = new ATechnology(); - - prop->_postCreate(); - - technology->put(prop); - - return prop; -} - -ATechnology* ATechnology::getATechnology(Technology* technology) { - Property* property = technology->getProperty(ATechnologyPropertyName); - if (property) { - ATechnology* aTechnology = static_cast(property); - return aTechnology; - } - return NULL; -} - -void ATechnology::print() { - cout << "Printing ATechnology" << endl; - cout << " o No Layer Physical Rules" << endl; - printPhysicalRules(_noLayerPhysicalRules); - cout << endl; - cout << " o One Layer Physical Rules" << endl; - for (OneLayerPhysicalRules::iterator olprit = _oneLayerPhysicalRules.begin(); - olprit != _oneLayerPhysicalRules.end(); - olprit++) { - const Layer* layer = olprit->first; - cout << " o layer " << layer << endl; - printPhysicalRules(olprit->second); - cout << endl; - } - cout << " o Two Layers Physical Rules" << endl; - for (TwoLayersPhysicalRules::iterator tlprit = _twoLayersPhysicalRules.begin(); - tlprit != _twoLayersPhysicalRules.end(); - tlprit++) { - const Layer* layer1 = tlprit->first.first; - const Layer* layer2 = tlprit->first.second; - cout << " o layer1 " << layer1 << endl; - cout << " o layer2 " << layer2 << endl; - printPhysicalRules(tlprit->second); - cout << endl; - } -} - -const ATechnology::PhysicalRule* ATechnology::getPhysicalRule(const Name& name) const { - PhysicalRule searchPR(name, 0, ""); - PhysicalRules::iterator prit = _noLayerPhysicalRules.find(&searchPR); - if (prit == _noLayerPhysicalRules.end()) { - throw Error("Cannot find Physical Rule " + getString(name)); - } - return *prit; -} - -const ATechnology::PhysicalRule* ATechnology::getPhysicalRule(const Name& name, const Layer* layer) const { - OneLayerPhysicalRules::const_iterator olprit = _oneLayerPhysicalRules.find(layer); - if (olprit == _oneLayerPhysicalRules.end()) { - throw Error("Cannot find Physical Rules for layer " + getString(layer->getName())); - } - const PhysicalRules& physicalRules = olprit->second; - PhysicalRule searchPR(name, 0, ""); - PhysicalRules::iterator prit = physicalRules.find(&searchPR); - if (prit == physicalRules.end()) { - throw Error("Cannot find Physical Rule " + getString(name)); - } - return *prit; -} - -const ATechnology::PhysicalRule* ATechnology::getPhysicalRule( - const Name& name, - const Layer* layer1, - const Layer* layer2) const { - LayerPair searchLayerPair(layer1, layer2); - TwoLayersPhysicalRules::const_iterator tlprit = _twoLayersPhysicalRules.find(searchLayerPair); - if (tlprit != _twoLayersPhysicalRules.end()) { - const TwoLayersPhysicalRulesSet& physicalRules = tlprit->second; - TwoLayersPhysicalRule searchPR(name, 0, "", true); - TwoLayersPhysicalRulesSet::const_iterator prit = physicalRules.find(&searchPR); - if (prit != physicalRules.end()) { - return *prit; - } - } - LayerPair reverseSearchLayerPair(layer2, layer1); - tlprit = _twoLayersPhysicalRules.find(reverseSearchLayerPair); - if (tlprit != _twoLayersPhysicalRules.end()) { - const TwoLayersPhysicalRulesSet& physicalRules = tlprit->second; - TwoLayersPhysicalRule searchPR(name, 0, "", true); - TwoLayersPhysicalRulesSet::const_iterator prit = physicalRules.find(&searchPR); - if (prit != physicalRules.end()) { - if ((*prit)->isSymetric()) { - return *prit; - } - } - } - throw Error("Cannot find Physical Rule " + - getString(name) + " for layers " + - getString(layer1->getName()) + - " and " + - getString(layer2->getName())); -} - -Layer* ATechnology::getLayer(const Name& layerName) { - Technology* technology = static_cast(getOwner()); - Layer* layer = technology->getLayer(layerName); - if (!layer) { - throw Error("cannot find layer " + getString(layerName)); - } - return layer; -} diff --git a/chamsin/src/technology/ATechnology.h b/chamsin/src/technology/ATechnology.h deleted file mode 100644 index bf3bf436..00000000 --- a/chamsin/src/technology/ATechnology.h +++ /dev/null @@ -1,114 +0,0 @@ -#ifndef ATECHNOLOGY_H_ -#define ATECHNOLOGY_H_ - -#include "hurricane/Property.h" -#include "hurricane/DbU.h" -using namespace Hurricane; - -namespace Hurricane { - class Technology; - class Layer; -} - -class ATechnology : public PrivateProperty { - public: - typedef PrivateProperty Inherit; - - class PhysicalRule { - public: - PhysicalRule(const Name& name, - DbU::Unit value, - const string& reference): - _name(name), - _value(value), - _reference(reference) {} - PhysicalRule(const PhysicalRule& physicalRule): - _name(physicalRule._name), - _value(physicalRule._value), - _reference(physicalRule._reference) {} - const Name _name; - const DbU::Unit _value; - const string _reference; - double getValue() const { return _value; } - - string _getTypeName() const; - string _getString() const; - Record* _getRecord() const; - }; - - class TwoLayersPhysicalRule : public PhysicalRule { - public: - typedef PhysicalRule Inherit; - - TwoLayersPhysicalRule(const Name& name, - DbU::Unit value, - const string& reference, - bool symetric): - PhysicalRule(name, value, reference), - _symetric(symetric) {} - - bool isSymetric() const { return _symetric; } - const bool _symetric; - - string _getTypeName() const; - string _getString() const; - Record* _getRecord() const; - }; - - struct PhysicalRuleNameCompare: - public std::binary_function { - bool operator()(const PhysicalRule* pr1, const PhysicalRule* pr2) const { - return pr1->_name < pr2->_name; - } - }; - - typedef pair LayerPair; - - typedef set PhysicalRules; - typedef set TwoLayersPhysicalRulesSet; - typedef map OneLayerPhysicalRules; - typedef map TwoLayersPhysicalRules; - - static ATechnology* create(Hurricane::Technology* technology); - static ATechnology* getATechnology(Hurricane::Technology* technology); - const PhysicalRule* getPhysicalRule(const Name& name) const; - const PhysicalRule* getPhysicalRule(const Name& name, const Layer* layer) const; - const PhysicalRule* getPhysicalRule(const Name& name, const Layer* layer1, const Layer* layer2) const; - void addPhysicalRule(const Name& name, DbU::Unit value, const string& reference); - void addPhysicalRule(const Name& name, const Name& layerName, DbU::Unit value, const string& reference); - void addPhysicalRule(const Name& name, const Name& layer1Name, - const Name& layer2Name, bool symetric, DbU::Unit value, const string& reference); - Layer* getLayer(const Name& layerName); - void print(); - - virtual Name getName() const; - - virtual string _getTypeName() const; - virtual Record* _getRecord() const; - - ATechnology(): - Inherit(), - _noLayerPhysicalRules(), - _oneLayerPhysicalRules(), - _twoLayersPhysicalRules() {} - - private: - PhysicalRules _noLayerPhysicalRules; - OneLayerPhysicalRules _oneLayerPhysicalRules; - TwoLayersPhysicalRules _twoLayersPhysicalRules; -}; - - -// ------------------------------------------------------------------- -// Inspector Support for : "ATechnology::LayerPair". - -template<> -inline std::string getString (ATechnology::LayerPair lp) { - return ""; -} - -INSPECTOR_P_SUPPORT(ATechnology); -INSPECTOR_P_SUPPORT(ATechnology::PhysicalRule); -INSPECTOR_P_SUPPORT(ATechnology::TwoLayersPhysicalRule); - -#endif /* ATECHNOLOGY_H_*/ diff --git a/chamsin/src/technology/ATechnologyXmlParser.cpp b/chamsin/src/technology/ATechnologyXmlParser.cpp deleted file mode 100644 index 11c5c73c..00000000 --- a/chamsin/src/technology/ATechnologyXmlParser.cpp +++ /dev/null @@ -1,122 +0,0 @@ -#include -#include - -#include "hurricane/Technology.h" - -#include "ATechnology.h" - -#include "ATechnologyXmlParser.h" - - -using namespace Hurricane; - - -namespace { - -void syntaxError(const string& reason) { - throw Error(reason); -} - -DbU::Unit getUnitValue(double physicalValue) { - return DbU::grid(DbU::physicalToGrid(physicalValue, DbU::Micro)); -} - -void readPhysicalRules(xmlNode* node, ATechnology* aTechnology) { - if (node->type == XML_ELEMENT_NODE && node->children) { - for (xmlNode* ruleNode = node->children; - ruleNode; - ruleNode = ruleNode->next) { - if (ruleNode->type == XML_ELEMENT_NODE) { - if (xmlStrEqual(ruleNode->name, (xmlChar*)"arule")) { - xmlChar* ruleNameC = xmlGetProp(ruleNode, (xmlChar*)"name"); - xmlChar* valueC = xmlGetProp(ruleNode, (xmlChar*)"value"); - xmlChar* refC = xmlGetProp(ruleNode, (xmlChar*)"ref"); - xmlChar* layer1C = xmlGetProp(ruleNode, (xmlChar*)"layer1"); - xmlChar* layer2C = xmlGetProp(ruleNode, (xmlChar*)"layer2"); - if (ruleNameC && valueC && refC && layer1C && layer2C) { - string ruleName((const char*)ruleNameC); - double value = atof((const char*)valueC); - DbU::Unit unitValue = getUnitValue(value); - cerr << value << ", " << unitValue << endl; - string reference((const char*)refC); - Name layer1Name((const char*)layer1C); - Name layer2Name((const char*)layer2C); - aTechnology->addPhysicalRule(ruleName, layer1Name, layer2Name, false, unitValue, reference); - } - } else if (xmlStrEqual(ruleNode->name, (xmlChar*)"rule")) { - xmlChar* ruleNameC = xmlGetProp(ruleNode, (xmlChar*)"name"); - xmlChar* valueC = xmlGetProp(ruleNode, (xmlChar*)"value"); - xmlChar* refC = xmlGetProp(ruleNode, (xmlChar*)"ref"); - xmlChar* layerC = xmlGetProp(ruleNode, (xmlChar*)"layer"); - xmlChar* layer1C = xmlGetProp(ruleNode, (xmlChar*)"layer1"); - xmlChar* layer2C = xmlGetProp(ruleNode, (xmlChar*)"layer2"); - if (ruleNameC && valueC && refC) { - string ruleName((const char*)ruleNameC); - double value = atof((const char*)valueC); - DbU::Unit unitValue = getUnitValue(value); - string reference((const char*)refC); - if (layerC) { - Name layerName((const char*)layerC); - aTechnology->addPhysicalRule(ruleName, layerName, unitValue, reference); - } else if (layer1C && layer2C) { - Name layer1Name((const char*)layer1C); - Name layer2Name((const char*)layer2C); - aTechnology->addPhysicalRule(ruleName, layer1Name, layer2Name, true, unitValue, reference); - } else { - aTechnology->addPhysicalRule(ruleName, unitValue, reference); - } - } else { - syntaxError(""); - } - } - } - } - } -} - -ATechnology* parseFileAsTechnology(const char* filePath, Technology* technology) { - ATechnology* aTechnology = ATechnology::create(technology); - - - xmlDocPtr doc; /* the resulting document tree */ - - doc = xmlReadFile(filePath, NULL, 0); - if (doc == NULL) { - fprintf(stderr, "Failed to parse %s\n", filePath); - exit(5); - } - - /*Get the design element node */ - xmlNode* rootElement = xmlDocGetRootElement(doc); - if (rootElement->type == XML_ELEMENT_NODE && - xmlStrEqual(rootElement->name, (xmlChar*)"technology")) { - xmlNode* child = rootElement->children; - for (xmlNode* node = child; node; node = node->next) { - if (node->type == XML_ELEMENT_NODE) { - if (xmlStrEqual(node->name, (xmlChar*)"physical_rules")) { - readPhysicalRules(node, aTechnology); - } else { - syntaxError("unknown tag"); - } - } - } - } -} - -} - -ATechnology* ATechnologyXmlParser::parse(const char* filePath, Technology* technology) { - - LIBXML_TEST_VERSION - - ATechnology* aTechnology = parseFileAsTechnology(filePath, technology); - - xmlCleanupParser(); - /* - * this is to debug memory for regression tests - */ - - xmlMemoryDump(); - - return NULL; -} diff --git a/chamsin/src/technology/ATechnologyXmlParser.h b/chamsin/src/technology/ATechnologyXmlParser.h deleted file mode 100644 index ca8df01a..00000000 --- a/chamsin/src/technology/ATechnologyXmlParser.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef ATECHNOLOGYXMLPARSER_H_ -#define ATECHNOLOGYXMLPARSER_H_ - -namespace Hurricane { - class Technology; -} - -class ATechnology; - -class ATechnologyXmlParser { - public: - static ATechnology* parse(const char* filePath, Hurricane::Technology* technology); -}; - -#endif /*ATECHNOLOGYXMLPARSER_H_*/ diff --git a/chamsin/src/technology/CMakeLists.txt b/chamsin/src/technology/CMakeLists.txt deleted file mode 100644 index e12ea6e7..00000000 --- a/chamsin/src/technology/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${HURRICANE_INCLUDE_DIR} ${CORIOLIS_INCLUDE_DIR}) - -ADD_LIBRARY(atechnology SHARED -AEnv.cpp ATechnology.cpp ATechnologyXmlParser.cpp) - -TARGET_LINK_LIBRARIES(atechnology ${HURRICANE_LIBRARIES} ${CORIOLIS_LIBRARIES} ${LIBXML2_LIBRARIES}) - -INSTALL(TARGETS atechnology DESTINATION /lib) diff --git a/chamsin/src/tests/CMakeLists.txt b/chamsin/src/tests/CMakeLists.txt deleted file mode 100644 index 18719b48..00000000 --- a/chamsin/src/tests/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -include(${QT_USE_FILE}) - -qt4_wrap_cpp(MOC_TRANSISTOR TransistorViewer.h) -qt4_wrap_cpp(MOC_CAPACITOR CapacitorViewer.h) - -include_directories(${HURRICANE_INCLUDE_DIR} ${HURRICANE_GRAPHICAL_INCLUDE_DIR} - ${CORIOLIS_INCLUDE_DIR} ${CHAMSIN_SOURCE_DIR}/src/technology - ${CHAMSIN_SOURCE_DIR}/src/analogic ${CHAMSIN_SOURCE_DIR}/src/device) - -add_executable(transview TransistorViewer.cpp ${MOC_TRANSISTOR} TransistorTest.cpp) -add_executable(capaview CapacitorViewer.cpp ${MOC_CAPACITOR} CapacitorTest.cpp) - -target_link_libraries(transview atechnology analogic ${HURRICANE_LIBRARIES} ${HURRICANE_GRAPHICAL_LIBRARIES} ${QT_LIBRARIES}) -target_link_libraries(capaview atechnology analogic ${HURRICANE_LIBRARIES} ${HURRICANE_GRAPHICAL_LIBRARIES} ${QT_LIBRARIES}) - -install(TARGETS transview capaview DESTINATION /bin) diff --git a/chamsin/src/tests/CapacitorTest.cpp b/chamsin/src/tests/CapacitorTest.cpp deleted file mode 100644 index 411cc974..00000000 --- a/chamsin/src/tests/CapacitorTest.cpp +++ /dev/null @@ -1,57 +0,0 @@ -#include - -#include - -#include "hurricane/Warning.h" -#include "hurricane/Error.h" -#include "hurricane/DataBase.h" -#include "hurricane/Library.h" -#include "hurricane/viewer/CellViewer.h" - -using namespace Hurricane; - -#include "AEnv.h" -#include "ATechnology.h" -#include "Transistor.h" -#include "CapacitorViewer.h" - - -int main(int argc, char* argv[]) { - int returnCode; - try { - - QApplication* qa = new QApplication(argc, argv); - - if (argc != 5) { - cerr << "capview symbtechno.xml s2rtechno.xml graphic.xml anatechno.xml"; - exit(56); - } - AEnv::create(argv[1], argv[2], argv[3], argv[4]); - DataBase* db = DataBase::getDB(); - Library* rootLibrary = db->getRootLibrary(); - Library* userLibrary = Library::create(rootLibrary, Name("USER")); - - ATechnology* aTechnology = AEnv::getATechnology(); - if (!aTechnology) { - exit(56); - } - - CapacitorViewer* viewer = new CapacitorViewer(userLibrary); - - viewer->show(); - - returnCode = qa->exec(); - delete viewer; - delete qa; - - } catch (Hurricane::Warning& w) { - cerr << w.what() << endl; - } catch (Hurricane::Error& e) { - cerr << e.what() << endl; - exit (1); - } catch (...) { - cout << "Abnormal termination\n" << endl; - exit(2); - } - return returnCode; -} diff --git a/chamsin/src/tests/CapacitorViewer.cpp b/chamsin/src/tests/CapacitorViewer.cpp deleted file mode 100644 index e5dcf5f4..00000000 --- a/chamsin/src/tests/CapacitorViewer.cpp +++ /dev/null @@ -1,118 +0,0 @@ -#include -#include -#include -#include - -#include "Capacitor.h" -#include "hurricane/DataBase.h" -#include "hurricane/viewer/CellWidget.h" -#include "hurricane/viewer/HInspectorWidget.h" -#include "hurricane/viewer/HPalette.h" -#include "AEnv.h" -#include "ATechnology.h" - -#include "CapacitorViewer.h" - - -CapacitorViewer::CapacitorViewer(Library* library) { - - ATechnology* aTechnology = AEnv::getATechnology(); - if (!aTechnology) { - exit(56); - } - - DbU::Unit capacitorMinL = aTechnology->getPhysicalRule("topPlateMIMminWidth")->getValue(); - DbU::Unit capacitorMaxL = 10 * capacitorMinL; - DbU::Unit capacitorMinW = aTechnology->getPhysicalRule("topPlateMIMminWidth")->getValue(); - DbU::Unit capacitorMaxW = 10 * capacitorMinW; - - _capacitor = Capacitor::create(library, Name("TEST")); - _capacitor->setL(capacitorMinL); - _capacitor->setW(capacitorMinW); - _cellWidget = new CellWidget; - _palette = new HPalette (); - _cellWidget->bindToPalette ( _palette ); - _cellWidget->setCell(_capacitor); - _cellWidget->fitToContents(); - setCentralWidget(_cellWidget); - QSlider* wSlider = new QSlider(Qt::Horizontal); - wSlider->setRange(capacitorMinW, 4 * capacitorMinW); - wSlider->setPageStep(DbU::grid(1)); - wSlider->setSliderPosition(capacitorMinW); - QSlider* lSlider = new QSlider(Qt::Horizontal); - lSlider->setRange(capacitorMinL, 4 * capacitorMinL); - lSlider->setPageStep(DbU::grid(1)); - lSlider->setSliderPosition(capacitorMinL); - - QWidget* slidersWidget = new QWidget; - QGridLayout* layout = new QGridLayout; - layout->addWidget(wSlider, 0, 0); - layout->addWidget(lSlider, 1, 0); - slidersWidget->setLayout(layout); - - QDockWidget *dockWidget = new QDockWidget(tr("Dock Widget"), this); - dockWidget->setAllowedAreas(Qt::LeftDockWidgetArea | - Qt::RightDockWidgetArea); - dockWidget->setWidget(slidersWidget); - addDockWidget(Qt::LeftDockWidgetArea, dockWidget); - - - QDockWidget* layerMapDock = new QDockWidget ( tr("Layers") ); - layerMapDock->setFeatures ( QDockWidget::DockWidgetVerticalTitleBar - | QDockWidget::DockWidgetMovable - | QDockWidget::DockWidgetFloatable - ); - layerMapDock->setObjectName ( "HPalette" ); - layerMapDock->setWidget ( _palette ); - layerMapDock->setAllowedAreas ( Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea ); - addDockWidget ( Qt::RightDockWidgetArea, layerMapDock ); - - _runInspectorOnDataBase= new QAction ( tr("Inspect &DataBase"), this ); - _runInspectorOnDataBase->setStatusTip ( tr("Run Inspector on Hurricane DataBase") ); - - _runInspectorOnCell= new QAction ( tr("Inspect &Cell"), this ); - _runInspectorOnCell->setStatusTip ( tr("Run Inspector on the current Cell") ); - - connect(wSlider, SIGNAL(valueChanged(int)), this, SLOT(wvalueChanged(int))); - connect(lSlider, SIGNAL(valueChanged(int)), this, SLOT(lvalueChanged(int))); - connect(_runInspectorOnDataBase, SIGNAL(triggered()) , this, SLOT(runInspectorOnDataBase())); - connect(_runInspectorOnCell , SIGNAL(triggered()) , this, SLOT(runInspectorOnCell ())); - - QMenu* toolsMenu = menuBar()->addMenu(tr("Tool")); - toolsMenu->addAction(_runInspectorOnDataBase); - toolsMenu->addAction(_runInspectorOnCell); -} - -void CapacitorViewer::wvalueChanged(int value) { - _capacitor->setW(value); - _cellWidget->redraw(); -} - -void CapacitorViewer::lvalueChanged(int value) { - _capacitor->setL(value); - _cellWidget->redraw(); -} - -void CapacitorViewer::runInspectorOnDataBase() { - runInspector(getRecord(DataBase::getDB())); -} - -void CapacitorViewer::runInspectorOnCell() { - Cell* cell = _cellWidget->getCell(); - if (cell) { - runInspector(getRecord(cell)); - } -} - -void CapacitorViewer::runInspector(Record* record) { - static HInspectorWidget* inspector = NULL; - - if (record) { - inspector = new HInspectorWidget (); - - inspector->setRootRecord ( record ); - inspector->show (); - } else { - cerr << "[ERROR] Attempt to run Inspector on NULL record." << endl; - } -} diff --git a/chamsin/src/tests/CapacitorViewer.h b/chamsin/src/tests/CapacitorViewer.h deleted file mode 100644 index c1b06b9d..00000000 --- a/chamsin/src/tests/CapacitorViewer.h +++ /dev/null @@ -1,46 +0,0 @@ -#ifndef _CAPACITORVIEWER_H -#define _CAPACITORVIEWER_H - -#include - -namespace Hurricane { - class Library; - class Record; - class CellWidget; - class HPalette; - class HMousePosition; -} -using namespace Hurricane; - -class Capacitor; - -class CapacitorViewer : public QMainWindow { - Q_OBJECT - public: - CapacitorViewer(Library* library); - - private slots: - void lvalueChanged(int value); - void wvalueChanged(int value); - void runInspectorOnDataBase(); - void runInspectorOnCell(); - - private: - CapacitorViewer(); - void createActions(); - void createMenus(); - void createLayout(); - void runInspector(Record* record); - - CellWidget* _cellWidget; - Capacitor* _capacitor; - QAction* _runInspectorOnDataBase; - QAction* _runInspectorOnCell; - QMenu* _viewMenu; - QMenu* _toolsMenu; - HPalette* _palette; - HMousePosition* _mousePosition; -}; - - -#endif /* _CAPACITORVIEWER_H */ diff --git a/chamsin/src/tests/TransistorTest.cpp b/chamsin/src/tests/TransistorTest.cpp deleted file mode 100644 index fa60672a..00000000 --- a/chamsin/src/tests/TransistorTest.cpp +++ /dev/null @@ -1,57 +0,0 @@ -#include - -#include - -#include "hurricane/Warning.h" -#include "hurricane/Error.h" -#include "hurricane/DataBase.h" -#include "hurricane/Library.h" -#include "hurricane/viewer/CellViewer.h" - -using namespace Hurricane; - -#include "AEnv.h" -#include "ATechnology.h" -#include "Transistor.h" -#include "TransistorViewer.h" - - -int main(int argc, char* argv[]) { - int returnCode; - try { - - QApplication* qa = new QApplication(argc, argv); - - if (argc != 5) { - cerr << "transview symbtechno.xml s2rtechno.xml graphic.xml anatechno.xml"; - exit(56); - } - AEnv::create(argv[1], argv[2], argv[3], argv[4]); - DataBase* db = DataBase::getDB(); - Library* rootLibrary = db->getRootLibrary(); - Library* userLibrary = Library::create(rootLibrary, Name("USER")); - - ATechnology* aTechnology = AEnv::getATechnology(); - if (!aTechnology) { - exit(56); - } - - TransistorViewer* viewer = new TransistorViewer(userLibrary); - - viewer->show(); - - returnCode = qa->exec(); - delete viewer; - delete qa; - - } catch (Hurricane::Warning& w) { - cerr << w.what() << endl; - } catch (Hurricane::Error& e) { - cerr << e.what() << endl; - exit (1); - } catch (...) { - cout << "Abnormal termination\n" << endl; - exit(2); - } - return returnCode; -} diff --git a/chamsin/src/tests/TransistorViewer.cpp b/chamsin/src/tests/TransistorViewer.cpp deleted file mode 100644 index bea9f815..00000000 --- a/chamsin/src/tests/TransistorViewer.cpp +++ /dev/null @@ -1,95 +0,0 @@ -#include -#include -#include -#include - -#include "MetaTransistor.h" -#include "hurricane/viewer/CellWidget.h" -#include "AEnv.h" -#include "ATechnology.h" - -#include "TransistorViewer.h" - - -TransistorViewer::TransistorViewer(Library* library) { - - ATechnology* aTechnology = AEnv::getATechnology(); - if (!aTechnology) { - exit(56); - } - - DbU::Unit transistorMinL = aTechnology->getPhysicalRule("transistorMinL")->getValue(); - DbU::Unit transistorMaxL = aTechnology->getPhysicalRule("transistorMaxL")->getValue(); - DbU::Unit transistorMinW = aTechnology->getPhysicalRule("transistorMinW")->getValue(); - DbU::Unit transistorMaxW = aTechnology->getPhysicalRule("transistorMaxW")->getValue(); - - _transistor = MetaTransistor::create(library, Name("TEST")); - _transistor->setType(MetaTransistor::Type::NMOS); - _transistor->setL(transistorMinL); - _transistor->setW(transistorMinW); - _transistor->setM(1); - _cellWidget = new CellWidget; - _cellWidget->setCell(_transistor); - _cellWidget->fitToContents(); - setCentralWidget(_cellWidget); - QSlider* wSlider = new QSlider(Qt::Horizontal); - wSlider->setRange(transistorMinW, 4 * transistorMinW); - wSlider->setPageStep(DbU::grid(1)); - wSlider->setSliderPosition(transistorMinW); - QSlider* lSlider = new QSlider(Qt::Horizontal); - lSlider->setRange(transistorMinL, 4 * transistorMinL); - lSlider->setPageStep(DbU::grid(1)); - lSlider->setSliderPosition(transistorMinL); - QSlider* mSlider = new QSlider(Qt::Horizontal); - mSlider->setRange(1, 5); - mSlider->setPageStep(1); - mSlider->setSliderPosition(1); - QStringList choices; - choices << "NMOS" << "PMOS"; - QComboBox* choiceBox = new QComboBox; - choiceBox->addItems(choices); - - QWidget* slidersWidget = new QWidget; - QGridLayout* layout = new QGridLayout; - layout->addWidget(wSlider, 0, 0); - layout->addWidget(lSlider, 1, 0); - layout->addWidget(mSlider, 2, 0); - layout->addWidget(choiceBox, 3, 0); - slidersWidget->setLayout(layout); - - QDockWidget *dockWidget = new QDockWidget(tr("Dock Widget"), this); - dockWidget->setAllowedAreas(Qt::LeftDockWidgetArea | - Qt::RightDockWidgetArea); - dockWidget->setWidget(slidersWidget); - addDockWidget(Qt::LeftDockWidgetArea, dockWidget); - - connect(wSlider, SIGNAL(valueChanged(int)), this, SLOT(wvalueChanged(int))); - connect(lSlider, SIGNAL(valueChanged(int)), this, SLOT(lvalueChanged(int))); - connect(mSlider, SIGNAL(valueChanged(int)), this, SLOT(mvalueChanged(int))); - connect(choiceBox, SIGNAL(currentIndexChanged(int)), this, SLOT(transistorTypeChanged(int))); -} - -void TransistorViewer::wvalueChanged(int value) { - _transistor->setW(value); - _cellWidget->redraw(); -} - -void TransistorViewer::lvalueChanged(int value) { - _transistor->setL(value); - _cellWidget->redraw(); -} - -void TransistorViewer::mvalueChanged(int value) { - _transistor->setM(value); - _cellWidget->redraw(); -} - -void TransistorViewer::transistorTypeChanged(int value) { - if (value == 0) { - _transistor->setType(MetaTransistor::Type::NMOS); - _cellWidget->redraw(); - } else if (value == 1) { - _transistor->setType(MetaTransistor::Type::PMOS); - _cellWidget->redraw(); - } -} diff --git a/chamsin/src/tests/TransistorViewer.h b/chamsin/src/tests/TransistorViewer.h deleted file mode 100644 index 765a677e..00000000 --- a/chamsin/src/tests/TransistorViewer.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef _TRANSISTORVIEWER_H -#define _TRANSISTORVIEWER_H - -#include - -namespace Hurricane { - class Library; - class CellWidget; -} -using namespace Hurricane; - -class MetaTransistor; - -class TransistorViewer : public QMainWindow { - Q_OBJECT - public: - TransistorViewer(Library* library); - private slots: - void lvalueChanged(int value); - void wvalueChanged(int value); - void transistorTypeChanged(int value); - void mvalueChanged(int value); - - private: - TransistorViewer(); - CellWidget* _cellWidget; - MetaTransistor* _transistor; -}; - - -#endif /* _TRANSISTORVIEWER_H */ diff --git a/crlcore/CMakeLists.txt b/crlcore/CMakeLists.txt index 9aa7f3f3..ad6a4350 100644 --- a/crlcore/CMakeLists.txt +++ b/crlcore/CMakeLists.txt @@ -1,3 +1,4 @@ +# -*- mode: CMAKE explicit-buffer-name: "CMakeLists.txt" -*- project(CRLCORE) @@ -5,9 +6,8 @@ OPTION(BUILD_DOC "Build the documentation (latex+doxygen)" OFF) - list(INSERT CMAKE_MODULE_PATH 0 "${DESTDIR}/$ENV{BOOTSTRAP_TOP}/share/cmake/Modules/") + list(INSERT CMAKE_MODULE_PATH 0 "${DESTDIR}/$ENV{CORIOLIS_TOP}/share/cmake/Modules/") find_package(Bootstrap REQUIRED) - setup_project_paths(VLSISAPD) setup_project_paths(CORIOLIS) list(INSERT CMAKE_MODULE_PATH 0 "${CRLCORE_SOURCE_DIR}/cmake_modules/") print_cmake_module_path() diff --git a/cumulus/CMakeLists.txt b/cumulus/CMakeLists.txt index 29dd414c..cf78a823 100644 --- a/cumulus/CMakeLists.txt +++ b/cumulus/CMakeLists.txt @@ -1,10 +1,10 @@ +# -*- mode: CMAKE explicit-buffer-name: "CMakeLists.txt" -*- project(CUMULUS) cmake_minimum_required(VERSION 2.4.0) - list(INSERT CMAKE_MODULE_PATH 0 "${DESTDIR}/$ENV{BOOTSTRAP_TOP}/share/cmake/Modules/") + list(INSERT CMAKE_MODULE_PATH 0 "${DESTDIR}/$ENV{CORIOLIS_TOP}/share/cmake/Modules/") find_package(Bootstrap REQUIRED) - setup_project_paths(VLSISAPD) setup_project_paths(CORIOLIS) set_cmake_policies() diff --git a/equinox/CMakeLists.txt b/equinox/CMakeLists.txt index 628291f4..a92ee3bb 100644 --- a/equinox/CMakeLists.txt +++ b/equinox/CMakeLists.txt @@ -1,11 +1,11 @@ +# -*- mode: CMAKE explicit-buffer-name: "CMakeLists.txt" -*- project(EQUINOX) cmake_minimum_required(VERSION 2.4.0) - list(INSERT CMAKE_MODULE_PATH 0 "${DESTDIR}/$ENV{BOOTSTRAP_TOP}/share/cmake/Modules/") + list(INSERT CMAKE_MODULE_PATH 0 "${DESTDIR}/$ENV{CORIOLIS_TOP}/share/cmake/Modules/") find_package(Bootstrap REQUIRED) - setup_project_paths(VLSISAPD) setup_project_paths(CORIOLIS) set_cmake_policies() diff --git a/hurricane/CMakeLists.txt b/hurricane/CMakeLists.txt index 65cb4f36..dcd6d4d2 100644 --- a/hurricane/CMakeLists.txt +++ b/hurricane/CMakeLists.txt @@ -1,3 +1,4 @@ +# -*- mode: CMAKE explicit-buffer-name: "CMakeLists.txt" -*- project(HURRICANE) @@ -5,10 +6,9 @@ cmake_minimum_required(VERSION 2.4.0) - list(INSERT CMAKE_MODULE_PATH 0 "${DESTDIR}/$ENV{BOOTSTRAP_TOP}/share/cmake/Modules") + list(INSERT CMAKE_MODULE_PATH 0 "${DESTDIR}/$ENV{CORIOLIS_TOP}/share/cmake/Modules") find_package(Bootstrap REQUIRED) - setup_project_paths(BOOTSTRAP) - setup_project_paths(VLSISAPD) + setup_project_paths(CORIOLIS) list(INSERT CMAKE_MODULE_PATH 0 "${HURRICANE_SOURCE_DIR}/cmake_modules/") set_cmake_policies() @@ -30,10 +30,10 @@ add_subdirectory(src) add_subdirectory(cmake_modules) - add_subdirectory(tests) +#add_subdirectory(tests) if(BUILD_DOC AND DOXYGEN_FOUND) add_subdirectory(doc) endif(BUILD_DOC AND DOXYGEN_FOUND) - enable_testing() - add_test(HurricaneTest ${PROJECT_BINARY_DIR}/tests/htest) +#enable_testing() +#add_test(HurricaneTest ${PROJECT_BINARY_DIR}/tests/htest) diff --git a/hurricane/doc/hurricane/images/transf-ID.fig b/hurricane/doc/hurricane/images/transf-ID.fig new file mode 100644 index 00000000..a3340bd1 --- /dev/null +++ b/hurricane/doc/hurricane/images/transf-ID.fig @@ -0,0 +1,28 @@ +#FIG 3.2 Produced by xfig version 3.2.5a +Landscape +Center +Inches +Letter +100.00 +Single +-2 +1200 2 +0 32 #ffffdd +6 3525 7425 4275 8475 +6 3750 7725 4125 8175 +2 1 0 4 18 18 45 -1 -1 0.000 0 0 -1 0 0 3 + 3825 8100 3825 7800 4050 7800 +2 1 0 4 18 18 45 -1 -1 0.000 0 0 -1 0 0 2 + 3825 7950 3975 7950 +-6 +2 2 0 4 18 18 50 -1 30 0.000 0 0 -1 0 0 5 + 3600 7500 4200 7500 4200 8400 3600 8400 3600 7500 +-6 +2 1 0 1 0 5 70 -1 -1 0.000 0 0 -1 1 0 2 + 0 0 1.00 60.00 120.00 + 3600 9300 3600 7200 +2 1 0 1 0 5 70 -1 -1 0.000 0 0 -1 1 0 2 + 0 0 1.00 60.00 120.00 + 2700 8400 4575 8400 +2 2 0 0 32 32 100 -1 40 0.000 0 0 -1 0 0 5 + 2625 7125 4575 7125 4575 9375 2625 9375 2625 7125 diff --git a/hurricane/doc/hurricane/images/transf-ID.png b/hurricane/doc/hurricane/images/transf-ID.png new file mode 100644 index 00000000..6d57b0a5 Binary files /dev/null and b/hurricane/doc/hurricane/images/transf-ID.png differ diff --git a/hurricane/doc/hurricane/images/transf-MX.fig b/hurricane/doc/hurricane/images/transf-MX.fig new file mode 100644 index 00000000..08a57c4c --- /dev/null +++ b/hurricane/doc/hurricane/images/transf-MX.fig @@ -0,0 +1,38 @@ +#FIG 3.2 Produced by xfig version 3.2.5a +Landscape +Center +Inches +Letter +100.00 +Single +-2 +1200 2 +0 32 #ffffdd +6 825 6525 1575 7575 +6 975 6825 1350 7275 +2 1 0 4 18 18 45 -1 -1 0.000 0 0 -1 0 0 3 + 1275 7200 1275 6900 1050 6900 +2 1 0 4 18 18 45 -1 -1 0.000 0 0 -1 0 0 2 + 1275 7050 1125 7050 +-6 +2 2 0 4 18 18 50 -1 30 0.000 0 0 -1 0 0 5 + 1500 6600 900 6600 900 7500 1500 7500 1500 6600 +-6 +6 1425 6525 2175 7575 +6 1650 6825 2025 7275 +2 1 0 4 0 18 55 -1 -1 0.000 0 0 -1 0 0 3 + 1725 7200 1725 6900 1950 6900 +2 1 0 4 0 18 55 -1 -1 0.000 0 0 -1 0 0 2 + 1725 7050 1875 7050 +-6 +2 2 0 4 0 0 60 -1 7 0.000 0 0 -1 0 0 5 + 1500 6600 2100 6600 2100 7500 1500 7500 1500 6600 +-6 +2 1 0 1 0 5 70 -1 -1 0.000 0 0 -1 1 0 2 + 0 0 1.00 60.00 120.00 + 1500 8400 1500 6300 +2 1 0 1 0 5 70 -1 -1 0.000 0 0 -1 1 0 2 + 0 0 1.00 60.00 120.00 + 600 7500 2475 7500 +2 2 0 0 32 32 100 -1 40 0.000 0 0 -1 0 0 5 + 525 6225 2475 6225 2475 8550 525 8550 525 6225 diff --git a/hurricane/doc/hurricane/images/transf-MX.png b/hurricane/doc/hurricane/images/transf-MX.png new file mode 100644 index 00000000..5b0583a2 Binary files /dev/null and b/hurricane/doc/hurricane/images/transf-MX.png differ diff --git a/hurricane/doc/hurricane/images/transf-MY.fig b/hurricane/doc/hurricane/images/transf-MY.fig new file mode 100644 index 00000000..ece82175 --- /dev/null +++ b/hurricane/doc/hurricane/images/transf-MY.fig @@ -0,0 +1,38 @@ +#FIG 3.2 Produced by xfig version 3.2.5a +Landscape +Center +Inches +Letter +100.00 +Single +-2 +1200 2 +0 32 #ffffdd +6 3225 8325 3975 9375 +6 3450 8625 3825 9075 +2 1 0 4 18 18 45 -1 -1 0.000 0 0 -1 0 0 3 + 3525 8700 3525 9000 3750 9000 +2 1 0 4 18 18 45 -1 -1 0.000 0 0 -1 0 0 2 + 3525 8850 3675 8850 +-6 +2 2 0 4 18 18 50 -1 30 0.000 0 0 -1 0 0 5 + 3300 9300 3900 9300 3900 8400 3300 8400 3300 9300 +-6 +6 3225 7425 3975 8475 +6 3450 7725 3825 8175 +2 1 0 4 0 18 55 -1 -1 0.000 0 0 -1 0 0 3 + 3525 8100 3525 7800 3750 7800 +2 1 0 4 0 18 55 -1 -1 0.000 0 0 -1 0 0 2 + 3525 7950 3675 7950 +-6 +2 2 0 4 0 0 60 -1 7 0.000 0 0 -1 0 0 5 + 3300 7500 3900 7500 3900 8400 3300 8400 3300 7500 +-6 +2 1 0 1 0 5 70 -1 -1 0.000 0 0 -1 1 0 2 + 0 0 1.00 60.00 120.00 + 3300 9300 3300 7200 +2 1 0 1 0 5 70 -1 -1 0.000 0 0 -1 1 0 2 + 0 0 1.00 60.00 120.00 + 2400 8400 4275 8400 +2 2 0 0 32 32 100 -1 40 0.000 0 0 -1 0 0 5 + 2325 7125 4275 7125 4275 9450 2325 9450 2325 7125 diff --git a/hurricane/doc/hurricane/images/transf-MY.png b/hurricane/doc/hurricane/images/transf-MY.png new file mode 100644 index 00000000..69e8d61c Binary files /dev/null and b/hurricane/doc/hurricane/images/transf-MY.png differ diff --git a/hurricane/doc/hurricane/images/transf-R1.fig b/hurricane/doc/hurricane/images/transf-R1.fig new file mode 100644 index 00000000..9ebcff63 --- /dev/null +++ b/hurricane/doc/hurricane/images/transf-R1.fig @@ -0,0 +1,38 @@ +#FIG 3.2 Produced by xfig version 3.2.5a +Landscape +Center +Inches +Letter +100.00 +Single +-2 +1200 2 +0 32 #ffffdd +6 3300 7425 4050 8475 +6 3525 7725 3900 8175 +2 1 0 4 0 18 55 -1 -1 0.000 0 0 -1 0 0 3 + 3600 8100 3600 7800 3825 7800 +2 1 0 4 0 18 55 -1 -1 0.000 0 0 -1 0 0 2 + 3600 7950 3750 7950 +-6 +2 2 0 4 0 0 60 -1 7 0.000 0 0 -1 0 0 5 + 3375 7500 3975 7500 3975 8400 3375 8400 3375 7500 +-6 +6 2400 8325 3450 9075 +6 2700 8475 3150 8850 +2 1 0 4 18 18 45 -1 -1 0.000 0 0 -1 0 0 3 + 3075 8775 2775 8775 2775 8550 +2 1 0 4 18 18 45 -1 -1 0.000 0 0 -1 0 0 2 + 2925 8775 2925 8625 +-6 +2 2 0 4 18 18 50 -1 30 0.000 0 0 -1 0 0 5 + 2475 9000 2475 8400 3375 8400 3375 9000 2475 9000 +-6 +2 1 0 1 0 5 70 -1 -1 0.000 0 0 -1 1 0 2 + 0 0 1.00 60.00 120.00 + 3375 9300 3375 7200 +2 1 0 1 0 5 70 -1 -1 0.000 0 0 -1 1 0 2 + 0 0 1.00 60.00 120.00 + 2475 8400 4275 8400 +2 2 0 0 32 32 100 -1 40 0.000 0 0 -1 0 0 5 + 2325 7125 4275 7125 4275 9375 2325 9375 2325 7125 diff --git a/hurricane/doc/hurricane/images/transf-R1.png b/hurricane/doc/hurricane/images/transf-R1.png new file mode 100644 index 00000000..8fa4cfc5 Binary files /dev/null and b/hurricane/doc/hurricane/images/transf-R1.png differ diff --git a/hurricane/doc/hurricane/images/transf-R2.fig b/hurricane/doc/hurricane/images/transf-R2.fig new file mode 100644 index 00000000..0e48faf2 --- /dev/null +++ b/hurricane/doc/hurricane/images/transf-R2.fig @@ -0,0 +1,38 @@ +#FIG 3.2 Produced by xfig version 3.2.5a +Landscape +Center +Inches +Letter +100.00 +Single +-2 +1200 2 +0 32 #ffffdd +6 2925 7425 3675 8475 +6 3150 7725 3525 8175 +2 1 0 4 0 18 55 -1 -1 0.000 0 0 -1 0 0 3 + 3225 8100 3225 7800 3450 7800 +2 1 0 4 0 18 55 -1 -1 0.000 0 0 -1 0 0 2 + 3225 7950 3375 7950 +-6 +2 2 0 4 0 0 60 -1 7 0.000 0 0 -1 0 0 5 + 3000 7500 3600 7500 3600 8400 3000 8400 3000 7500 +-6 +6 2325 8325 3075 9375 +6 2475 8625 2850 9075 +2 1 0 4 18 18 45 -1 -1 0.000 0 0 -1 0 0 3 + 2775 8700 2775 9000 2550 9000 +2 1 0 4 18 18 45 -1 -1 0.000 0 0 -1 0 0 2 + 2775 8850 2625 8850 +-6 +2 2 0 4 18 18 50 -1 30 0.000 0 0 -1 0 0 5 + 3000 9300 2400 9300 2400 8400 3000 8400 3000 9300 +-6 +2 1 0 1 0 5 70 -1 -1 0.000 0 0 -1 1 0 2 + 0 0 1.00 60.00 120.00 + 3000 9300 3000 7200 +2 1 0 1 0 5 70 -1 -1 0.000 0 0 -1 1 0 2 + 0 0 1.00 60.00 120.00 + 2100 8400 3975 8400 +2 2 0 0 32 32 100 -1 40 0.000 0 0 -1 0 0 5 + 2025 7125 3975 7125 3975 9375 2025 9375 2025 7125 diff --git a/hurricane/doc/hurricane/images/transf-R2.pdf b/hurricane/doc/hurricane/images/transf-R2.pdf new file mode 100644 index 00000000..c0542533 --- /dev/null +++ b/hurricane/doc/hurricane/images/transf-R2.pdf @@ -0,0 +1,85 @@ +%PDF-1.4 +%Çì¢ +5 0 obj +<> +stream +xœR1nÃ0 Üù +Î\R)ù}@Ѻƒ] éÐïWm4r2†à;Ü‘'Jº Œdßö[áéœqþFû®³΄…ðú'¸€Q%\Áª`.7 I |‚RB!¥:‰,U-tË‘­d”Fn:Yã×~AÚÏÏÍŸ´µÂHZ¼mÝžºŒ.}ú÷L¥Ô«^]2¸¹,mÙ-+YqÑ?ÅË÷!µ‰Ö9ó泩©÷]¼ÿ4¨Pç6­-Û¹¤ý2C®Çó@š ƬnhLÖ½ˆnÈuã+vä9aÌõQI[õ…Ðš’¤¼ß̽i‚$Œ‰,Â9ˆ¬rÝø +QùñüU9ŽÃendstream +endobj +6 0 obj +282 +endobj +4 0 obj +<> +/Contents 5 0 R +>> +endobj +3 0 obj +<< /Type /Pages /Kids [ +4 0 R +] /Count 1 +>> +endobj +1 0 obj +<> +endobj +7 0 obj +<>endobj +8 0 obj +<> +endobj +9 0 obj +<>stream + + + + + +2013-11-30T13:05:22+01:00 +2013-11-30T13:05:22+01:00 +fig2dev Version 3.2 Patchlevel 5 + +transf-R2.figjpc@lepka \(Jean-Paul Chaput\) + + + + + +endstream +endobj +2 0 obj +<>endobj +xref +0 10 +0000000000 65535 f +0000000576 00000 n +0000002215 00000 n +0000000517 00000 n +0000000386 00000 n +0000000015 00000 n +0000000367 00000 n +0000000640 00000 n +0000000681 00000 n +0000000710 00000 n +trailer +<< /Size 10 /Root 1 0 R /Info 2 0 R +/ID [<354D61171374F7A9723F4C5D6FB5D249><354D61171374F7A9723F4C5D6FB5D249>] +>> +startxref +2443 +%%EOF diff --git a/hurricane/doc/hurricane/images/transf-R2.png b/hurricane/doc/hurricane/images/transf-R2.png new file mode 100644 index 00000000..6fe6481a Binary files /dev/null and b/hurricane/doc/hurricane/images/transf-R2.png differ diff --git a/hurricane/doc/hurricane/images/transf-R3.fig b/hurricane/doc/hurricane/images/transf-R3.fig new file mode 100644 index 00000000..10825ebc --- /dev/null +++ b/hurricane/doc/hurricane/images/transf-R3.fig @@ -0,0 +1,38 @@ +#FIG 3.2 Produced by xfig version 3.2.5a +Landscape +Center +Inches +Letter +100.00 +Single +-2 +1200 2 +0 32 #ffffdd +6 3000 7425 3750 8475 +6 3225 7725 3600 8175 +2 1 0 4 0 18 55 -1 -1 0.000 0 0 -1 0 0 3 + 3300 8100 3300 7800 3525 7800 +2 1 0 4 0 18 55 -1 -1 0.000 0 0 -1 0 0 2 + 3300 7950 3450 7950 +-6 +2 2 0 4 0 0 60 -1 7 0.000 0 0 -1 0 0 5 + 3075 7500 3675 7500 3675 8400 3075 8400 3075 7500 +-6 +6 3000 8325 4050 9075 +6 3300 8550 3750 8925 +2 1 0 4 18 18 45 -1 -1 0.000 0 0 -1 0 0 3 + 3375 8625 3675 8625 3675 8850 +2 1 0 4 18 18 45 -1 -1 0.000 0 0 -1 0 0 2 + 3525 8625 3525 8775 +-6 +2 2 0 4 18 18 50 -1 30 0.000 0 0 -1 0 0 5 + 3975 8400 3975 9000 3075 9000 3075 8400 3975 8400 +-6 +2 1 0 1 0 5 70 -1 -1 0.000 0 0 -1 1 0 2 + 0 0 1.00 60.00 120.00 + 3075 9300 3075 7200 +2 1 0 1 0 5 70 -1 -1 0.000 0 0 -1 1 0 2 + 0 0 1.00 60.00 120.00 + 2175 8400 4050 8400 +2 2 0 0 32 32 100 -1 40 0.000 0 0 -1 0 0 5 + 2100 7125 4050 7125 4050 9375 2100 9375 2100 7125 diff --git a/hurricane/doc/hurricane/images/transf-R3.pdf b/hurricane/doc/hurricane/images/transf-R3.pdf new file mode 100644 index 00000000..e1a305fa Binary files /dev/null and b/hurricane/doc/hurricane/images/transf-R3.pdf differ diff --git a/hurricane/doc/hurricane/images/transf-R3.png b/hurricane/doc/hurricane/images/transf-R3.png new file mode 100644 index 00000000..f5d38d3d Binary files /dev/null and b/hurricane/doc/hurricane/images/transf-R3.png differ diff --git a/hurricane/doc/hurricane/images/transf-RX.fig b/hurricane/doc/hurricane/images/transf-RX.fig new file mode 100644 index 00000000..ab0b9715 --- /dev/null +++ b/hurricane/doc/hurricane/images/transf-RX.fig @@ -0,0 +1,38 @@ +#FIG 3.2 Produced by xfig version 3.2.5a +Landscape +Center +Inches +Letter +100.00 +Single +-2 +1200 2 +0 32 #ffffdd +6 2625 7425 3375 8475 +6 2775 7725 3150 8175 +2 1 0 4 18 18 45 -1 -1 0.000 0 0 -1 0 0 3 + 3075 8100 3075 7800 2850 7800 +2 1 0 4 18 18 45 -1 -1 0.000 0 0 -1 0 0 2 + 3075 7950 2925 7950 +-6 +2 2 0 4 18 18 50 -1 30 0.000 0 0 -1 0 0 5 + 3300 7500 2700 7500 2700 8400 3300 8400 3300 7500 +-6 +6 3225 7425 3975 8475 +6 3450 7725 3825 8175 +2 1 0 4 0 18 55 -1 -1 0.000 0 0 -1 0 0 3 + 3525 8100 3525 7800 3750 7800 +2 1 0 4 0 18 55 -1 -1 0.000 0 0 -1 0 0 2 + 3525 7950 3675 7950 +-6 +2 2 0 4 0 0 60 -1 7 0.000 0 0 -1 0 0 5 + 3300 7500 3900 7500 3900 8400 3300 8400 3300 7500 +-6 +2 1 0 1 0 5 70 -1 -1 0.000 0 0 -1 1 0 2 + 0 0 1.00 60.00 120.00 + 3300 9300 3300 7200 +2 1 0 1 0 5 70 -1 -1 0.000 0 0 -1 1 0 2 + 0 0 1.00 60.00 120.00 + 2400 8400 4275 8400 +2 2 0 0 32 32 100 -1 40 0.000 0 0 -1 0 0 5 + 2325 7125 4275 7125 4275 9450 2325 9450 2325 7125 diff --git a/hurricane/doc/hurricane/images/transf-RX.png b/hurricane/doc/hurricane/images/transf-RX.png new file mode 100644 index 00000000..5ae2501c Binary files /dev/null and b/hurricane/doc/hurricane/images/transf-RX.png differ diff --git a/hurricane/doc/hurricane/images/transf-XR.fig b/hurricane/doc/hurricane/images/transf-XR.fig new file mode 100644 index 00000000..574be911 --- /dev/null +++ b/hurricane/doc/hurricane/images/transf-XR.fig @@ -0,0 +1,38 @@ +#FIG 3.2 Produced by xfig version 3.2.5a +Landscape +Center +Inches +Letter +100.00 +Single +-2 +1200 2 +0 32 #ffffdd +6 2700 8325 3750 9075 +6 3000 8550 3450 8925 +2 1 0 4 18 18 45 -1 -1 0.000 0 0 -1 0 0 3 + 3375 8625 3075 8625 3075 8850 +2 1 0 4 18 18 45 -1 -1 0.000 0 0 -1 0 0 2 + 3225 8625 3225 8775 +-6 +2 2 0 4 18 18 50 -1 30 0.000 0 0 -1 0 0 5 + 2775 8400 2775 9000 3675 9000 3675 8400 2775 8400 +-6 +6 3600 7425 4350 8475 +6 3825 7725 4200 8175 +2 1 0 4 0 18 55 -1 -1 0.000 0 0 -1 0 0 3 + 3900 8100 3900 7800 4125 7800 +2 1 0 4 0 18 55 -1 -1 0.000 0 0 -1 0 0 2 + 3900 7950 4050 7950 +-6 +2 2 0 4 0 0 60 -1 7 0.000 0 0 -1 0 0 5 + 3675 7500 4275 7500 4275 8400 3675 8400 3675 7500 +-6 +2 1 0 1 0 5 70 -1 -1 0.000 0 0 -1 1 0 2 + 0 0 1.00 60.00 120.00 + 3675 9300 3675 7200 +2 1 0 1 0 5 70 -1 -1 0.000 0 0 -1 1 0 2 + 0 0 1.00 60.00 120.00 + 2775 8400 4575 8400 +2 2 0 0 32 32 100 -1 40 0.000 0 0 -1 0 0 5 + 2625 7125 4575 7125 4575 9450 2625 9450 2625 7125 diff --git a/hurricane/doc/hurricane/images/transf-XR.png b/hurricane/doc/hurricane/images/transf-XR.png new file mode 100644 index 00000000..814ad52b Binary files /dev/null and b/hurricane/doc/hurricane/images/transf-XR.png differ diff --git a/hurricane/doc/hurricane/images/transf-YR.fig b/hurricane/doc/hurricane/images/transf-YR.fig new file mode 100644 index 00000000..3e6d2a27 --- /dev/null +++ b/hurricane/doc/hurricane/images/transf-YR.fig @@ -0,0 +1,38 @@ +#FIG 3.2 Produced by xfig version 3.2.5a +Landscape +Center +Inches +Letter +100.00 +Single +-2 +1200 2 +0 32 #ffffdd +6 3525 7725 4575 8475 +6 3825 7875 4275 8250 +2 1 0 4 18 18 45 -1 -1 0.000 0 0 -1 0 0 3 + 3900 8175 4200 8175 4200 7950 +2 1 0 4 18 18 45 -1 -1 0.000 0 0 -1 0 0 2 + 4050 8175 4050 8025 +-6 +2 2 0 4 18 18 50 -1 30 0.000 0 0 -1 0 0 5 + 4500 8400 4500 7800 3600 7800 3600 8400 4500 8400 +-6 +6 3525 7425 4275 8475 +6 3750 7725 4125 8175 +2 1 0 4 0 18 55 -1 -1 0.000 0 0 -1 0 0 3 + 3825 8100 3825 7800 4050 7800 +2 1 0 4 0 18 55 -1 -1 0.000 0 0 -1 0 0 2 + 3825 7950 3975 7950 +-6 +2 2 0 4 0 0 60 -1 7 0.000 0 0 -1 0 0 5 + 3600 7500 4200 7500 4200 8400 3600 8400 3600 7500 +-6 +2 1 0 1 0 5 70 -1 -1 0.000 0 0 -1 1 0 2 + 0 0 1.00 60.00 120.00 + 3600 9300 3600 7200 +2 1 0 1 0 5 70 -1 -1 0.000 0 0 -1 1 0 2 + 0 0 1.00 60.00 120.00 + 2700 8400 4575 8400 +2 2 0 0 32 32 100 -1 40 0.000 0 0 -1 0 0 5 + 2625 7125 4575 7125 4575 9450 2625 9450 2625 7125 diff --git a/hurricane/doc/hurricane/images/transf-YR.png b/hurricane/doc/hurricane/images/transf-YR.png new file mode 100644 index 00000000..f3e8620a Binary files /dev/null and b/hurricane/doc/hurricane/images/transf-YR.png differ diff --git a/ispd/CMakeLists.txt b/ispd/CMakeLists.txt index 74c5e3f3..5bf685dd 100644 --- a/ispd/CMakeLists.txt +++ b/ispd/CMakeLists.txt @@ -1,11 +1,11 @@ +# -*- mode: CMAKE explicit-buffer-name: "CMakeLists.txt" -*- project(ISPD) cmake_minimum_required(VERSION 2.4.0) - list(INSERT CMAKE_MODULE_PATH 0 "$ENV{BOOTSTRAP_TOP}/share/cmake/Modules/") + list(INSERT CMAKE_MODULE_PATH 0 "$ENV{CORIOLIS_TOP}/share/cmake/Modules/") find_package(Bootstrap REQUIRED) - setup_project_paths(VLSISAPD) setup_project_paths(CORIOLIS) set_cmake_policies() diff --git a/katabatic/CMakeLists.txt b/katabatic/CMakeLists.txt index 7330087e..4a2296ef 100644 --- a/katabatic/CMakeLists.txt +++ b/katabatic/CMakeLists.txt @@ -7,9 +7,8 @@ cmake_minimum_required(VERSION 2.4.0) - list(INSERT CMAKE_MODULE_PATH 0 "${DESTDIR}/$ENV{BOOTSTRAP_TOP}/share/cmake/Modules/") + list(INSERT CMAKE_MODULE_PATH 0 "${DESTDIR}/$ENV{CORIOLIS_TOP}/share/cmake/Modules/") find_package(Bootstrap REQUIRED) - setup_project_paths(VLSISAPD) setup_project_paths(CORIOLIS) set_cmake_policies() diff --git a/katabatic/doc/AutoContactHTee.dox b/katabatic/doc/AutoContactHTee.dox new file mode 100644 index 00000000..41f1edd1 --- /dev/null +++ b/katabatic/doc/AutoContactHTee.dox @@ -0,0 +1,41 @@ + + // -*- C++ -*- + + namespace Katabatic { + + /*! \class AutoContactHTee + * + * \brief AutoContact H-Tee (two H, one V) + * + * AutoContact to build an horizontal tee (two H, one V). + */ + + //! \function AutoContactHTee* AutoContactHTee::create ( GCell* gcell, Net* net, const Layer* layer ); + //! \param gcell The GCell into which create the AutoContact. + //! \param net The Net to which this AutoContact belongs. + //! \param layer The Layer of the AutoContact. + //! \return The created AutoContactHTee. + //! + //! Create a new AutoContactHTee. + + //! \function void AutoContactHTee::updateTopology (); + //! Restore the topology (i.e. connexity) of the contact after any number + //! of connected segments has changed layer (at least one, up to three). + //! + //! For any configuration, the connexity can be restored by making only + //! one dogleg. + //! + //! We distinguish two kind of layer changes: + //! -# The two horizontals (\c h1 and \c h2) are still on the same layer + //! (either they both moved or the vertical only has moved, see figures + //! 2 & 4). + //! In that case, the dogleg is made on the vertical. + //! -# The two horizontals no longer are on the same layer (figures 1 & 3). + //! In that case, the dogleg is made on the horizontal which is at the + //! greater distance (in a layer sense) from the vertical. + //! + //! \image html updateTopologyHTee.png "Update H-Tee Topology" + + } + + diff --git a/katabatic/doc/AutoContactTerminal.dox b/katabatic/doc/AutoContactTerminal.dox new file mode 100644 index 00000000..482ce4dc --- /dev/null +++ b/katabatic/doc/AutoContactTerminal.dox @@ -0,0 +1,66 @@ + + // -*- C++ -*- + + namespace Katabatic { + + /*! \class AutoContactTerminal + * + * \brief AutoContact Terminal (S/T is a Terminal) + * + * AutoContact that are directly attached by either source or target + * or both to a terminal. + */ + + //! \function AutoContactTerminal* AutoContactTerminal::create ( GCell* gcell, Component* rp, const Layer* layer, const DbU::Unit x, const DbU::Unit y, const DbU::Unit width, const DbU::Unit height ); + //! \param gcell The GCell into which create the AutoContact. + //! \param rp The Component on which to anchor the AutoContact. + //! \param layer The Layer of the AutoContact. + //! \param x The absolute X position. + //! \param y The absolute Y position. + //! \param width The width of the AutoContact. + //! \param height The height of the AutoContact. + //! \return The created AutoContact. + //! + //! Create a new AutoContactTerminal anchored on \c rp. (x,y) gives + //! the \e absolute position. + //! + //! The anchor component \c rp is most often a Hurricane::RoutingPad (occurrencing + //! a Hurricane::Segment) or directly a Hurricane::Segment, in case of RoutingPad + //! layer promotion. + + //! \function AutoContactTerminal* AutoContactTerminal::create ( GCell* gcell, Component* rp, const Layer* layer, Point point, const DbU::Unit width, const DbU::Unit height ); + //! \param gcell The GCell into which create the AutoContact. + //! \param rp The RoutingPad on which to anchor the AutoContact. + //! \param layer The Layer of the AutoContact. + //! \param point The absolute position. + //! \param width The width of the AutoContact. + //! \param height The height of the AutoContact. + //! \return The created AutoContact. + //! + //! Create a new AutoContactTerminal anchored on \c rp. \c point gives + //! the \e absolute position. + + //! \function void AutoContactTerminal::updateTopology (); + //! Restore the topology (i.e. connexity) of the contact after the incident + //! segment has changed layer. + //! + //! Based on the layer depth delta between the terminal and the segment + //! three case can occurs: + //! - The delta is \b zero, then just sets the layer of the contact + //! to the common metal layer. + //! - The delta is \b one, then sets the contact layer to VIA connecting + //! the two layers. + //! - The delta is \b two, then create a dogleg to restore the connexity. + //! Depending on whether the terminal was attached to the source or + //! target, sets the layer of the segments. + //! - A delta of more than \b two is an error, and must never occurs. + //! + //! As, by default, the perpandicular is set in the layer above the + //! parallel, it may be necessary to adjust his layer as well (to the + //! one below). + //! + //! \image html updateTopologyTerminal.png "Update Terminal Topology" + + } + + diff --git a/katabatic/doc/AutoContactTurn.dox b/katabatic/doc/AutoContactTurn.dox new file mode 100644 index 00000000..e79d5a63 --- /dev/null +++ b/katabatic/doc/AutoContactTurn.dox @@ -0,0 +1,44 @@ + + // -*- C++ -*- + + namespace Katabatic { + + /*! \class AutoContactTurn + * + * \brief AutoContact Turn (one H, one V) + * + * AutoContact to make a turn (one H, one V). + */ + + //! \function AutoContactTurn* AutoContactTurn::create ( GCell* gcell, Net* net, const Layer* layer ); + //! \param gcell The GCell into which create the AutoContact. + //! \param net The Net to which this AutoContact belongs. + //! \param layer The Layer of the AutoContact. + //! \return The created AutoContactTurn. + //! + //! Create a new AutoContactTurn. + + //! \function void AutoContactTurn::updateTopology (); + //! Restore the topology (i.e. connexity) of the contact after one or both + //! connected segments has changed layer. + //! + //! Based on the layer depth delta between the two perpandiculars segments. + //! Three case can occurs: + //! - The delta is \b zero, then just sets the layer of the contact + //! to the common metal layer (turn in same layer). + //! - The delta is \b one, then sets the contact layer to VIA connecting + //! the two layers. + //! - The delta cannot be equal to two, due to the alternatives + //! routing directions, it would mean a \e turn connecting two \e horizontals + //! (or verticals) in different layers. + //! - The delta is \b three, then create a dogleg to restore the connexity. + //! The dogleg will be created on the connected segment which as been + //! layer invalidated. If both of them have been invalidated, + //! the horizontal one is preferred. + //! - A delta of more than \b three is an error, and must never occurs. + //! + //! \image html updateTopologyTurn.png "Update Turn Topology" + + } + + diff --git a/katabatic/doc/AutoContactVTee.dox b/katabatic/doc/AutoContactVTee.dox new file mode 100644 index 00000000..996a1288 --- /dev/null +++ b/katabatic/doc/AutoContactVTee.dox @@ -0,0 +1,30 @@ + + // -*- C++ -*- + + namespace Katabatic { + + /*! \class AutoContactVTee + * + * \brief AutoContact V-Tee (one H, two V) + * + * AutoContact to build a vertical tee (two V, one H). + */ + + //! \function AutoContactVTee* AutoContactVTee::create ( GCell* gcell, Net* net, const Layer* layer ); + //! \param gcell The GCell into which create the AutoContact. + //! \param net The Net to which this AutoContact belongs. + //! \param layer The Layer of the AutoContact. + //! \return The created AutoContactVTee. + //! + //! Create a new AutoContactVTee. + + //! \function void AutoContactVTee::updateTopology (); + //! Restore the topology (i.e. connexity) of the contact after any number + //! of connected segments has changed layer (at least one, up to three). + //! + //! For a detailed explanation, see AutoContactHTee::updateTopology() and + //! sawp horizontal & vertical... + + } + + diff --git a/katabatic/doc/AutoHorizontal.dox b/katabatic/doc/AutoHorizontal.dox new file mode 100644 index 00000000..f1dc00fe --- /dev/null +++ b/katabatic/doc/AutoHorizontal.dox @@ -0,0 +1,20 @@ + + + // -*- C++ -*- + + namespace Katabatic { + + //! \class AutoHorizontal + //! + //! \brief Concrete Horizontal AutoSegment + + //! \function void AutoHorizontal::_postCreate (); + //! + //! In addition to AutoSegment::_postCreate(), detect whether the + //! segment is global or local and register it in the relevant GCells + //! (if needed). + //! + //! If the segment is anchored directly on a terminal, adjust the + //! axis so it's connected. + + } diff --git a/katabatic/doc/AutoSegments.dox b/katabatic/doc/AutoSegments.dox new file mode 100644 index 00000000..59123b17 --- /dev/null +++ b/katabatic/doc/AutoSegments.dox @@ -0,0 +1,197 @@ + + + // -*- C++ -*- + + namespace Katabatic { + + //! \enum FunctionFlag + + //! \typedef typedef Hurricane::Filter AutoSegmentHF; + //! Shorthand for AutoSegment Hurricane Filter. + + //! \typedef typedef Hurricane::Locator AutoSegmentHL; + //! Shorthand for AutoSegment Hurricane Locator. + + //! \typedef typedef Hurricane::Collection AutoSegmentHC; + //! Shorthand for AutoSegment Hurricane Collection. + + //! \typedef typedef GenericFilter AutoSegmentFilter; + //! Shorthand for AutoSegment Hurricane Generic Filter + //! (filter with \c auto_ptr<> like support). + + //! \typedef typedef GenericLocator AutoSegmentLocator; + //! Shorthand for AutoSegment Hurricane Generic Locator + //! (locator with \c auto_ptr<> like support). + + //! \typedef typedef GenericCollection AutoSegments; + //! Shorthand for AutoSegment Hurricane Generic Collection + //! (collection with \c auto_ptr<> like support). + + /*! \class AutoSegments_OnContact + * \brief All AutoSegment anchored on a Contact + * + * A Collection to iterate over all the AutoSegment anchored on + * \c contact. If supplied, the AutoSegment \c master will be + * excluded from the list. + * + * \remark If a Hurricane::Segment is anchored on the \c contact, but is not + * associated to an AutoSegment, it will be silently skipped. + */ + + //! \function AutoSegments_OnContact::AutoSegments_OnContact ( AutoSegment* master, Contact* contact ); + //! \param master Exclude this AutoSegment from the Collection. + //! \param contact The Hurricane Contact over which to iterate. + //! + //! Construct a Collection of all the AutoSegment anchored on \c contact. + + //! \function AutoSegments_OnContact::AutoSegments_OnContact ( AutoSegment* master, Contact* contact ); + //! Create the collection of all AutoSegments direcly anchored on \c contact, + //! with exclusion of \c master. + + //! \function AutoSegments_OnContact::AutoSegments_OnContact ( const AutoSegments_OnContact& ); + //! Copy constructor. + + //! \function AutoSegmentHC* AutoSegments_OnContact::getClone () const; + //! \sreturn A deep copy of the Collection. + + //! \function AutoSegmentHC* AutoSegments_OnContact::getLocator () const; + //! \sreturn A deep copy of the Collection Locator. + + + /*! \class AutoSegments_Aligneds + * \brief All aligned AutoSegment of a set. + * + * A Collection to iterate over all the AutoSegment aligned with \c master. + * The \c master itself will not be included in the walkthrough. + * If the Katabatic::KbWithPerpands flag is passed as argument, the collection + * will also includes the AutoSegments directly perpandicular to the aligned + * set. + * + * \remark AutoSegments are forced to be aligneds only when connected through + * AutoContactHTee or AutoContactVTee. + * + */ + + //! \function AutoSegments_Aligneds::AutoSegments_Aligneds ( AutoSegment* master, unsigned int flags ); + //! Create a collection of all the AutoSegment aligned on \c master + //! (master itself is excluded from the Collection). If the flag Katabatic::KbWithPerpands + //! is given the directly perpandicular AutoSegment will also be includeds. + + //! \function AutoSegments_Aligneds::AutoSegments_Aligneds ( const AutoSegments_Aligneds& ); + //! Copy constructor. + + //! \function AutoSegmentHC* AutoSegments_Aligneds::getClone () const; + //! \sreturn A deep copy of the Collection. + + //! \function AutoSegmentHC* AutoSegments_Aligneds::getLocator () const; + //! \sreturn A deep copy of the Collection Locator. + + + /*! \class AutoSegments_Perpandiculars + * \brief All perpandicular AutoSegment to a set of aligneds. + * + * A Collection to iterate over all the AutoSegment perpandicular to + * the set of aligned AutoSegment of \c master. + * + * \remark This Collection is canonical aware (work on the aligned set). + * + */ + + //! \function AutoSegments_Perpandiculars::AutoSegments_Perpandiculars ( AutoSegment* master ); + //! Create a collection of all the AutoSegment perpandicular to the aligned + //! set of \c master. + + //! \function AutoSegments_Perpandiculars::AutoSegments_Perpandiculars ( const AutoSegments_Perpandiculars& ); + //! Copy constructor. + + //! \function AutoSegmentHC* AutoSegments_Perpandiculars::getClone () const; + //! \sreturn A deep copy of the Collection. + + //! \function AutoSegmentHC* AutoSegments_Perpandiculars::getLocator () const; + //! \sreturn A deep copy of the Collection Locator. + + + /*! \class AutoSegments_AnchorOnGCell + * \brief All AutoSegment Beginning and/or Stopping in a GCell + * + * A Collection to iterate over all the AutoSegment that begin from and/or + * end in a GCell. + * + */ + + //! \function AutoSegments_AnchorOnGCell::AutoSegments_AnchorOnGCell ( GCell* fcell, unsigned int flags ); + //! Create a collection of all the AutoSegment beginning from and/or + //! ending in \c fcell. The set returned by the Collection is selected + //! through \c flags : + //! - Katabatic::KbBySource : include AutoSegment starting from \c fcell. + //! - Katabatic::KbByTarget : include AutoSegment ending in \c fcell. + //! - Katabatic::KbHorizontal : include horizontal AutoSegment. + //! - Katabatic::KbVertical : include vertical AutoSegment. + + //! \function AutoSegments_AnchorOnGCell::AutoSegments_AnchorOnGCell ( const AutoSegments_AnchorOnGCell& ); + //! Copy constructor. + + //! \function AutoSegmentHC* AutoSegments_AnchorOnGCell::getClone () const; + //! \sreturn A deep copy of the Collection. + + //! \function AutoSegmentHC* AutoSegments_AnchorOnGCell::getLocator () const; + //! \sreturn A deep copy of the Collection Locator. + + + /*! \class AutoSegments_OnContact + * \brief All AutoSegment Beginning from an AutoContact + * + * A Collection to iterate over all the AutoSegment that begin from + * AutoContact. As AutoSegments are kept orienteds (source anchor must + * be lower than target), selecting source anchored AutoSegments + * implies that they are starting from this AutoContact. + */ + + //! \function AutoSegments_CachedOnContact::AutoSegments_CachedOnContact ( AutoContact* source, unsigned int direction=KbHorizontal|KbVertical ); + //! Create a collection of all the AutoSegment anchored on \c source. + //! Use \c direction to select the kind of AutoSegments: + //! - KbHorizontal : include horizontal AutoSegment. + //! - KbVertical : include vertical AutoSegment. + + //! \function AutoSegments_CachedOnContact::AutoSegments_CachedOnContact ( const AutoSegments_CachedOnContact& ); + //! Copy constructor. + + //! \function AutoSegmentHC* AutoSegments_CachedOnContact::getClone () const; + //! \sreturn A deep copy of the Collection. + + //! \function AutoSegmentHC* AutoSegments_CachedOnContact::getLocator () const; + //! \sreturn A deep copy of the Collection Locator. + + + /*! \class AutoSegments_IsAccountable + * \brief Filter to select accoutable AutoSegment. + * + * A Filter to select accoutable AutoSegment. An AutoSegment is said + * to be accountable if it is canonical (in the sense of an aligned set). + */ + + //! \function bool AutoSegments_IsAccountable::accept ( AutoSegment* segment ) const; + //! \sreturn \true if the \c segment is accountable (i.e. canonical). + + //! \function AutoSegmentHF* AutoSegments_IsAccountable::getClone () const; + //! \sreturn A deep copy of the Collection. + + + /*! \class AutoSegments_InDirection + * \brief Filter to select AutoSegment in a given direction. + * + * A Filter to select AutoSegment in a specific direction. + */ + + //! \function AutoSegments_InDirection::AutoSegments_InDirection ( unsigned int direction ); + //! Create a filter for AutoSegment in \c direction (Katabatic::KbHorizontal + //! or Katabatic::KbVertical). + + //! \function bool AutoSegments_InDirection::accept ( AutoSegment* segment ) const; + //! \sreturn \true if the \c segment is in the correct direction. + + //! \function AutoSegmentHF* AutoSegments_InDirection::getClone () const; + //! \sreturn A deep copy of the Collection. + + } + diff --git a/katabatic/doc/AutoVertical.dox b/katabatic/doc/AutoVertical.dox new file mode 100644 index 00000000..10f746f4 --- /dev/null +++ b/katabatic/doc/AutoVertical.dox @@ -0,0 +1,20 @@ + + + // -*- C++ -*- + + namespace Katabatic { + + //! \class AutoVertical + //! + //! \brief Concrete Vertical AutoSegment + + //! \function void AutoVertical::_postCreate (); + //! + //! In addition to AutoSegment::_postCreate(), detect whether the + //! segment is global or local and register it in the relevant GCells + //! (if needed). + //! + //! If the segment is anchored directly on a terminal, adjust the + //! axis so it's connected. + + } diff --git a/katabatic/doc/ChipTools.dox b/katabatic/doc/ChipTools.dox new file mode 100644 index 00000000..74876255 --- /dev/null +++ b/katabatic/doc/ChipTools.dox @@ -0,0 +1,62 @@ + + // -*- C++ -*- + + namespace Katabatic { + + /*! \class ChipTools + * + * \brief Utilities for Chip Level Design + * + * The ChipTools class provides a small set of utilities to ease + * the managment of a complete chip following the Alliance top + * hierarchical structure. + */ + + //! \function ChipTools::ChipTools ( Cell* cell ); + //! Create a ChipTool for \c cell. + + //! \function bool ChipTools::isChip () const; + //! \sreturn \true if the Cell is truly a top level design. If not, this + //! object is useless and does nothing. + + //! \function Cell* ChipTools::getCell () const; + //! \sreturn The top-level design. + + //! \function Instance* ChipTools::getCore () const; + //! \sreturn The instance of the core, that is, the only instance that is + //! \e not a pad... + + //! \function const Box& ChipTools::getChipBb () const; + //! \sreturn The chip complete bounding box, this *is* simply the Cell bounding box. + + //! \function const Box& ChipTools::getLeftPadsBb () const; + //! \sreturn The bounding box enclosing all the pads on the left side of the chip. + //! + //! \remark This box is computed from the chip bounding box and the pad height. + + //! \function const Box& ChipTools::getRightPadsBb () const; + //! \sreturn The bounding box enclosing all the pads on the right side of the chip. + //! + //! \remark This box is computed from the chip bounding box and the pad height. + + //! \function const Box& ChipTools::getTopPadsBb () const; + //! \sreturn The bounding box enclosing all the pads on the top side of the chip. + //! + //! \remark This box is computed from the chip bounding box and the pad height. + + //! \function const Box& ChipTools::getBottomPadsBb () const; + //! \sreturn The bounding box enclosing all the pads on the bottom side of the chip. + //! + //! \remark This box is computed from the chip bounding box and the pad height. + + //! \function const Torus& ChipTools::getCorona () const; + //! \sreturn The torus (in term of manhanttan distance) enclosed between the pad area + //! and the core area. + + //! \function bool ChipTools::intersectVPads ( const Box& ) const; + //! \sreturn \true if \c box intersect either the left or right pad box. + + //! \function bool ChipTools::intersectHPads ( const Box& ) const; + //! \sreturn \true if \c box intersect either the top or bottom pad box. + + } diff --git a/katabatic/doc/Constants.dox b/katabatic/doc/Constants.dox new file mode 100644 index 00000000..30235646 --- /dev/null +++ b/katabatic/doc/Constants.dox @@ -0,0 +1,62 @@ + // -*- mode: C++; explicit-buffer-name: "Constants.dox" -*- + + namespace Katabatic { + + //! \enum FunctionFlag + //! A set of flags to that can be passed to functions/methods througout + //! all Katabatic. + + //! \var KbOpenSession + //! Tells the function to open it's own Session, otherwise use + //! the one that should already have been opened. + + //! \var KbRealignate + //! On AutoSegment axis manipulation, force the realignment of all + //! the segment on an aligned set, even is the axis of the canonical + //! is already at the right coordinate. + + //! \var KbNativeConstraints + //! Ignore user-defined constraints or terminal induced ones (for AutoContacts + //! anchored on terminals) and return the owning GCell alone. + + //! \var KbForceMove + //! Tells the function to force move, even if it is not needed. + + //! \var KbHorizontal + //! Request some action to be done in the horizontal direction. + + //! \var KbVertical + //! Request some action to be done in the vertical direction. + + //! \var KbWithPerpands + //! Request that AutoSegments in perpandicular direction should be includeds. + + //! \var KbBySource + //! Request AutoSegments anchored by their source anchor. + + //! \var KbByTarget + //! Request AutoSegments anchored by their target anchor. + + //! \var KbWarnOnError + //! Display a warning if something has gone wrong. + + //! \var KbPropagate + //! The action will affect all the segments on an aligned set. + + //! \var KbUseAboveLayer + //! Request/tell the a above layer has been used. + + //! \var KbUseBelowLayer + //! Request/tell the a below layer has been used. + + //! \var KbDoglegOnLeft + //! The dogleg has occured on the left of something + + //! \var KbDoglegOnRight + //! The dogleg has occured on the right of something + + //! \var KbHalfSlacken + //! For AutoSegment::slacken(), change the overconstrained limit + //! from 10 tracks down to 3 (hard-wired). + + } diff --git a/katabatic/doc/DoxygenLayout.xml b/katabatic/doc/DoxygenLayout.xml new file mode 100644 index 00000000..1c8525c3 --- /dev/null +++ b/katabatic/doc/DoxygenLayout.xml @@ -0,0 +1,184 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/katabatic/doc/GCells.dox b/katabatic/doc/GCells.dox new file mode 100644 index 00000000..0545cd44 --- /dev/null +++ b/katabatic/doc/GCells.dox @@ -0,0 +1,15 @@ + + // -*- C++ -*- + + namespace Katabatic { + + //! \typedef typedef GenericCollection GCells; + //! GCell Collection with auto-pointer like support. + + //! \typedef typedef GenericLocator GCellLocator; + //! GCell Locator with auto-pointer like support. + + //! \typedef typedef GenericFilter GCellFilter; + //! GCell Filter with auto-pointer like support. + + } diff --git a/katabatic/doc/Katabatic.dox b/katabatic/doc/Katabatic.dox new file mode 100644 index 00000000..53f40568 --- /dev/null +++ b/katabatic/doc/Katabatic.dox @@ -0,0 +1,11 @@ + + // -*- C++ -*- + + + namespace Katabatic { + + /*! \namespace Katabatic + * \brief The namespace dedicated to Katabatic. + */ + + } diff --git a/katabatic/doc/Modifications.rst b/katabatic/doc/Modifications.rst new file mode 100644 index 00000000..764969fc --- /dev/null +++ b/katabatic/doc/Modifications.rst @@ -0,0 +1,52 @@ + +.. -*- Mode: rst -*- + +.. role:: raw-latex(raw) + :format: latex + +.. role:: ul +.. role:: cb +.. role:: sc + + +========================= +Katabatic 3 Modifications +========================= + + +General Structuration +===================== + +* Short-circuit the usage of the Hurricane DataBase. Now AutoContacts + & AutoSegments are cached directly in the relevant objects. This is + way bigger, but should be faster. And anyway simpler to write by + suppressing Ring walkthrough and Session::lookup() calls. + + +AutoContact +=========== + +* Now splitted in four sub-classes: + + * AutoContactTerminal + * AutoContactTurn + * AutoContactHTee + * AutoContactVTee + +* isCorner() renamed isTurn(). +* isTerminal() is now ambiguous. It may be flag an AutoContact which *is* + an AutoContactTurn indeed or an AutoContactTurn leading uniquely toward + a Terminal. + + +AutoHorizontal/AutoVertical +=========================== + +* New AutoSegment::makeTopologyDogLeg() creates dogleg needed by topological + adjustments on AutoContact. They are not counted (nor signaled) as explicit + dogleg request. **To Implement**. + +* The local ``slacken()`` methods are, in fact AutoSegment::makeTopologyDogLeg(). + +* We now must be able to create AutoHorizontal/AutoContact whithout suppling + the anchor AutoContacts. Allows more supple building constructions. diff --git a/katabatic/doc/Observer.dox b/katabatic/doc/Observer.dox new file mode 100644 index 00000000..9f460e07 --- /dev/null +++ b/katabatic/doc/Observer.dox @@ -0,0 +1,86 @@ + // -*- C++ -*- + + namespace Katabatic { + + /*! \class Observable + * + * \brief Observer Design Pattern, Subject part. + * + * + * Observable is the implementation of the \e subject part of the + * Observer design pattern. For the time beeing it's a simplificated + * version that allows only one Observer to watch the subject. + * + * Observable is designed to be an attribute of the subject, not one + * of it's base class. + * + * This implantation is completly generic and has nothing specific + * to Katabatic. It may be moved sometimes in Hurricane at Property + * level in Hurricane::DBo. + * + * Note to Myself: Observer pattern is the one behind signal/slots. + */ + + //! \function Observable::Observable (); + //! Default and only constructor. The copy constructor is disabled + //! (made private and unimplemented). + + //! \function T* Observable::getObserver (); + //! \sreturn The (only) observer, \c NULL if there is none. It is the object + //! of which the Observer is an attribute, that is, it's \e owner, and not + //! the Observer itself which is returned. + + //! \function void Observable::addObserver ( BaseObserver* observer ); + //! Adds an observer. If more than one is added, throw an error. + + //! \function void Observable::removeObserver ( BaseObserver* observer ); + //! Removes an observer. If the observer do not belong to this observable, + //! throw an exception. + + //! \function void Observable::notify ( unsigned int flags ); + //! Used by the subject to signal a change in it's state to the observers. + //! The \c flags parameter can be used to indicates what kind of change + //! is occuring. Values for \c flags are defined between the subject and + //! the observers. + + + /*! \class BaseObserver + * + * \brief Observer Design Pattern, Observer part. + * + * This class is used as a non-template base class for the templatized + * Observer one. It is used to avoid propagating template to the whole + * Observable class. It only contains the Observer::notify() virtual + * method. + */ + + //! \function void BaseObserver::notify ( unsigned int flags ); + //! The method which will be called whenever a change occurs on the Observable. + + + /*! \class Observer + * + * \brief Observer Design Pattern, Observer part. + * + * First, a warning about names: although this class is named + * Observer, it is intended to be an attribute nested inside the + * whole object which is indeed, the true Observer. This nesting object + * is called, most of the time the \b owner in the following. But + * sometimes, for simplification it may also be called the Observer. + * + * \section secImplObserver Observer Implementation Notes + * + * To retrieve the \e owner from the Observer attribute, we uses the + * offset from the attribute in the \e owner. This offset is computed + * once and for all the first time the template constructor is called. + */ + + //! \function Observer::Observer ( const T* owner ); + //! The owner of the oberver is needed to compute, on the first creation + //! only, the offset of the Observer attribute inside the \c owner complete + //! object. + + //! \function T* Observer::getOwner () const; + //! \sreturn The owner of the observer. + + } diff --git a/katabatic/doc/SoC.css b/katabatic/doc/SoC.css new file mode 100644 index 00000000..276a7c09 --- /dev/null +++ b/katabatic/doc/SoC.css @@ -0,0 +1,559 @@ + + +/* + * +-----------------------------------------------------------------+ + * | HTML Standart Tags | + * +-----------------------------------------------------------------+ + */ + + html, body, th, td, tr, p, li, h1, h2, h3, h4, h5, h6 { + font-size: 11pt; + /* The Open Sans font family is supplied by TexLive. */ + font-family: "Open Sans", Verdana, sans-serif;; + } + + body { + color: black; + background: white; + background-color: white; + background-position: top left; + background-attachment: fixed; + background-repeat: no-repeat; + margin-top: 2em; + width: 550pt; + margin-right: auto; + margin-left: auto; + /* + margin-right: 12%; + margin-left: 12%; + */ + } + + hr { + height: 1px; + border: 0; + color: #004400; + background-color: #004400; + } + + + h1, h2, h3, h4, h5, h6 { + /*font-family: "Liberation Serif", sans-serif;*/ + } + + h1 { text-align: center; } + h2, h3, h4, h5, h6 { text-align: left; + padding-top: 11pt; + } + h1, h2, h3 { /*font-family: "Liberation Serif", sans-serif; */ + /*color: #09550B;*/ + } + h1 { font-weight:normal; font-size: 170%; letter-spacing:0.2em; word-spacing:0.4em; } + h2 { font-weight:normal; font-size: 140%; letter-spacing:0.2em; word-spacing:0.4em; } + h3 { font-weight: bold; font-size: 118%; letter-spacing:0.2em; word-spacing:0.4em; } + h4 { font-weight: bold; font-size: 100%; } + h5 { font-style: italic; font-size: 100%; } + h6 { font-variant: small-caps; font-size: 100%; } + + h2.classHierarchy { + /*border: 1px none #008500;*/ + border: 1px none #000000; + border-top-width: 1px; + border-top-style: dotted; + padding-top: 1em; + } + + + .hide { + display: none; + color: white; + } + + + p { + margin-top: 0.6em; + margin-bottom: 0.6em; + margin-left: 0.0em; + margin-right: 0.0em; + } + + + address { + text-align: right; + font-weight: bold; + font-style: italic; + font-size: 80%; + } + + + caption { font-weight: bold } + + + blockquote { + margin-left: 4em; + margin-right: 4em; + margin-top: 0.8em; + margin-bottom: 0.8em; + font-style: italic; + color: #003300; + } + + blockquote p { + margin-bottom: 0; + } + + blockquote address { + margin: 0; + } + + + table { + border-collapse: collapse; + } + + dt, dd { margin-top: 0; margin-bottom: 0; } + dt { font-weight: bold; } + + + pre, tt, code { + /*font-family: "andale mono", monospace;*/ + font-size: 100%; + white-space: pre; + } + + pre { + font-size: 80%; + border: dashed; + border-width: thin; + border-color: #003300; + /* + background-color: #EEEEEE; + */ + background-color: #FCFCE1; + padding: 0.5em; + margin-left: 2em; + margin-right: 2em + } + + tt { color: green; } + em { font-style: italic; + font-weight: normal; } + strong { font-weight: bold; } + + span.textit { font-style: italic; } + span.textbf { font-weight: bold; } + + .small { font-size: 90%; } + .white { color: #FFFFFF; } + + + ul.toc { + list-style: disc; + list-style: none; + } + + + a:link img, a:visited img { border-style: none; } + a img { color: white; } + + a:link, a:active, a:visited { + color: #09550B; + text-decoration: none; + } + + a:hover, a:focus { + color: #FF9900; + text-decoration: underline; + } + + +/* + * +-----------------------------------------------------------------+ + * | Doxygen Specific Classes | + * +-----------------------------------------------------------------+ + */ + + +/* ------------------------------------------------------------------- + * Header & Footer Classes (customized top page navigation bar). + */ + + h1.header { + font-size: 200%; + /*font-family: times, verdana, sans-serif;*/ + } + + center.header { + background-color: #CCE6CA; + } + + table.header { + /*width: 100%;*/ + /*background-color: #EEEEEE;*/ + background-color: #CCE6CA; + } + + table.header td { + padding: 2px 14px; + text-align: center; + font-weight: bold; + /*font-family: verdana, sans-serif;*/ + font-size: 110%; + } + + table.DoxUser td, table.DoxUser th { + padding: 0px 5px; + border: 0px; + } + + table.DoxUser th { + background-color: #CCE6CA; + } + + table.footer1, table.footer2 { width: 100%; } + td.LFooter { text-align: left; } + td.RFooter { text-align: right; } + td.CFooter { text-align: center;} + table.footer2 td.RFooter { font-weight: bold; width: 35% } + table.footer2 td.CFooter { width: 30% } + table.footer2 td.LFooter { font-weight: bold; width: 35%; /*font-family: time;*/ } + + table.classHierarchy { + border-collapse: separate; + border-spacing: 5px; + font-size: 110%; + } + + table.classHierarchy tr { + border: 1px solid blue; + } + + table.classHierarchy td.normal { + border: 1px solid #CCE6CA; + width: 140pt; + text-align: center; + font-weight: bold; + background-color: #CCE6CA; + } + + table.classHierarchy td.virtual { + border: 1px solid black; + width: 140pt; + text-align: center; + font-weight: bold; + } + + table.classHierarchy td.wnormal { + border: 1px solid #CCE6CA; + width: 240pt; + text-align: center; + font-weight: bold; + background-color: #CCE6CA; + } + + table.classHierarchy td.wvirtual { + border: 1px solid black; + width: 240pt; + text-align: center; + font-weight: bold; + } + + div.ah { + /*font-family: time;*/ + font-size: 250%; + } + + +/* ------------------------------------------------------------------- + * Quick Index Class (top page navigation bar). + */ + + div.qindex, div.nav { + width: 100%-4px; + /*background-color: #DADAEF;*/ + /*background-color: #eeeeff;*/ + /*background-color: #EEEEEE;*/ + background-color: #CCE6CA; + border: 0px solid #003300; + text-align: center; + margin: 0px; + padding: 2px; + line-height: 140%; + } + + a.qindex, a.qindex:visited, a.qindex:hover, a.qindexHL, a.el, a.elRef { + text-decoration: none; + /*font-family: Courier;*/ + font-weight: normal; + /*font-size: 110%;*/ + } + + a.qindex, a.qindex:visited { + color: #09550B; + } + + a.qindex:hover { + background-color: #ddddff; + } + + a.qindexHL, a.qindexHL:hover, a.qindexHL:visited { + background-color: #0c780c; + color: #ffffff; + border: 1px double #9295C2; + } + + a.code:link, a.code:visited, a.codeRef:link, a.codeRef:visited { + text-decoration: none; + font-weight: normal; + color: #0000ff; + } + + .indexkey { + background-color: #eeeeff; + border: 1px solid #b0b0b0; + padding: 2px 15px; + } + + .indexkey, .indexvalue { + background-color: #eeeeff; + border: 1px solid #b0b0b0; + padding: 2px 15px; + } + + .indexkey { + width: 40%; + } + + .indexvalue { + width: 80%; + } + + h3 a[name="index__"], + h3 a[name="index_a"], + h3 a[name="index_b"], + h3 a[name="index_c"], + h3 a[name="index_d"], + h3 a[name="index_e"], + h3 a[name="index_f"], + h3 a[name="index_g"], + h3 a[name="index_h"], + h3 a[name="index_i"], + h3 a[name="index_j"], + h3 a[name="index_k"], + h3 a[name="index_l"], + h3 a[name="index_m"], + h3 a[name="index_n"], + h3 a[name="index_o"], + h3 a[name="index_p"], + h3 a[name="index_q"], + h3 a[name="index_r"], + h3 a[name="index_s"], + h3 a[name="index_t"], + h3 a[name="index_u"], + h3 a[name="index_v"], + h3 a[name="index_w"], + h3 a[name="index_x"], + h3 a[name="index_y"], + h3 a[name="index_z"], + h3 a[name="index_0"], + h3 a[name="index_1"], + h3 a[name="index_2"], + h3 a[name="index_3"], + h3 a[name="index_4"], + h3 a[name="index_5"], + h3 a[name="index_6"], + h3 a[name="index_7"], + h3 a[name="index_8"], + h3 a[name="index_9"] + h3 a[id="index__"], + h3 a#index_a, + h3 a#index_b, + h3 a#index_c, + h3 a#index_d, + h3 a#index_e, + h3 a#index_f, + h3 a#index_g, + h3 a#index_h, + h3 a#index_i, + h3 a#index_j, + h3 a#index_k, + h3 a#index_l, + h3 a#index_m, + h3 a#index_n, + h3 a#index_o, + h3 a#index_p, + h3 a#index_q, + h3 a#index_r, + h3 a#index_s, + h3 a#index_t, + h3 a#index_u, + h3 a#index_v, + h3 a#index_w, + h3 a#index_x, + h3 a#index_y, + h3 a#index_z, + h3 a#index_0, + h3 a#index_1, + h3 a#index_2, + h3 a#index_3, + h3 a#index_4, + h3 a#index_5, + h3 a#index_6, + h3 a#index_7, + h3 a#index_8, + h3 a#index_9, + h3 a#index_0x7e + { + font-family: time; + font-size: 250%; + } + + +/* ------------------------------------------------------------------- + * Verbatim Source Code / Examples. + */ + + /* pre.fragment { background-color: #EEEEEE; } */ + + span.keyword { color: #008000 } + span.keywordtype { color: #604020 } + span.keywordflow { color: #e08000 } + span.comment { color: #800000 } + span.preprocessor { color: #806020 } + span.stringliteral { color: #002080 } + span.charliteral { color: #008080 } + span.red { color: red } + + +/* ------------------------------------------------------------------- + * Attributes Listing. + */ + +p.formulaDsp { + text-align: center; +} + + .mdTable { + /*border: 1px solid #868686;*/ + /*background-color: #DADAEF;*/ + /*background-color: #F4F4FB;*/ + border: 1px none #008500; + border-left-width: 1px; + border-left-style: solid; + /*background-color: #B8E6B8;*/ + /*background-color: #CCE6CA;*/ + margin-top: 25px; + font-size: 105%; + } + + .mdRow { + padding: 5px 10px; + } + + /* This Mozilla/Firefox bug has been corrected from v1.5. + * .mdname1 { + * padding: 3px 0px 0px 0px; + * } + */ + + .mdescLeft, .mdescRight { + padding: 0px 8px 4px 8px; + font-size: 11px; + font-style: italic; + /*background-color: #FAFAFA;*/ + border-top: 1px none #E0E0E0; + border-right: 1px none #E0E0E0; + border-bottom: 1px none #E0E0E0; + border-left: 1px none #E0E0E0; + margin: 0px; + } + + .memitem { + margin-bottom: 30px; + border: 1px none #008500; + } + + .memproto { + background-color: #CCE6CA; + border-left-width: 4px; + border-left-style: solid; + border-color: #008500; + } + + .memname { + white-space: nowrap; + padding-left: 5px; + font-size: 105%; + } + + table.memname * { + font-family: "Monospace"; + } + + + .memdoc{ + padding-left: 5px; + /*margin-top: -8px;*/ + border-left-width: 1px; + border-left-style: solid; + border-color: #008500; + } + + div.contents * table tr { + padding: 3px 3px 3px 8px; + } + + .memItemLeft, .memItemRight, .memTemplItemLeft, .memTemplItemRight { + /*padding: 1px 0px 0px 8px;*/ + padding: 3px 3px 3px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + /* + border-top-color: #0c0c0c; + border-right-color: #0c0c0c; + border-bottom-color: #0c0c0c; + border-left-color: #0c0c0c; + */ + border-top-style: none; + border-right-style: none; + border-bottom-style: dotted; + border-left-style: none; + /*background-color: #DADAEF;*/ + /*background-color: #eeeeff;*/ + /*background-color: #EEEEEE;*/ + /*background-color: #CCE6CA;*/ + font-family: "Monospace"; + } + + .memTemplItemLeft, .memTemplItemRight { + border-bottom-width: 2px; + border-bottom-style: solid; + font-weight: bold; + } + + .memItemLeft { font-size: 11px; width: 35%; } + .memItemRight { font-size: 12px; } + .memTemplItemLeft { font-size: 11px; } + .memTemplItemRight { font-size: 12px; } + + .memTemplParams { + color: #FFFFFF; + background-color: #000000; + font-size: 11px; + font-weight: bold; + } + + .groupText, .groupHeader { + color: #09550B; + font-size: 130%; + font-weight: bold; + margin-top: 15px; + } + + .groupHeader { + margin-bottom: -30pt; + } + diff --git a/kite/CMakeLists.txt b/kite/CMakeLists.txt index ca5985a6..0b7b4a77 100644 --- a/kite/CMakeLists.txt +++ b/kite/CMakeLists.txt @@ -7,9 +7,8 @@ cmake_minimum_required(VERSION 2.4.0) - list(INSERT CMAKE_MODULE_PATH 0 "${DESTDIR}/$ENV{BOOTSTRAP_TOP}/share/cmake/Modules/") + list(INSERT CMAKE_MODULE_PATH 0 "${DESTDIR}/$ENV{CORIOLIS_TOP}/share/cmake/Modules/") find_package(Bootstrap REQUIRED) - setup_project_paths(VLSISAPD) setup_project_paths(CORIOLIS) set_cmake_policies() diff --git a/knik/CMakeLists.txt b/knik/CMakeLists.txt index 824edbc2..875d66da 100644 --- a/knik/CMakeLists.txt +++ b/knik/CMakeLists.txt @@ -1,11 +1,11 @@ +# -*- mode: CMAKE explicit-buffer-name: "CMakeLists.txt" -*- project(KNIK) cmake_minimum_required(VERSION 2.4.0) - list(INSERT CMAKE_MODULE_PATH 0 "${DESTDIR}/$ENV{BOOTSTRAP_TOP}/share/cmake/Modules/") + list(INSERT CMAKE_MODULE_PATH 0 "${DESTDIR}/$ENV{CORIOLIS_TOP}/share/cmake/Modules/") find_package(Bootstrap REQUIRED) - setup_project_paths(VLSISAPD) setup_project_paths(CORIOLIS) print_cmake_module_path() diff --git a/mauka/CMakeLists.txt b/mauka/CMakeLists.txt index 073918b2..59f2cb9a 100644 --- a/mauka/CMakeLists.txt +++ b/mauka/CMakeLists.txt @@ -1,11 +1,11 @@ +# -*- mode: CMAKE explicit-buffer-name: "CMakeLists.txt" -*- project(MAUKA) cmake_minimum_required(VERSION 2.4.0) - list(INSERT CMAKE_MODULE_PATH 0 "${DESTDIR}/$ENV{BOOTSTRAP_TOP}/share/cmake/Modules/") + list(INSERT CMAKE_MODULE_PATH 0 "${DESTDIR}/$ENV{CORIOLIS_TOP}/share/cmake/Modules/") find_package(Bootstrap REQUIRED) - setup_project_paths(VLSISAPD) setup_project_paths(CORIOLIS) print_cmake_module_path() diff --git a/metis/CMakeLists.txt b/metis/CMakeLists.txt index 9c971624..eb6c195f 100644 --- a/metis/CMakeLists.txt +++ b/metis/CMakeLists.txt @@ -1,11 +1,11 @@ +# -*- mode: CMAKE explicit-buffer-name: "CMakeLists.txt" -*- project(METIS) cmake_minimum_required(VERSION 2.4.0) - list(INSERT CMAKE_MODULE_PATH 0 "${DESTDIR}/$ENV{BOOTSTRAP_TOP}/share/cmake/Modules/") + list(INSERT CMAKE_MODULE_PATH 0 "${DESTDIR}/$ENV{CORIOLIS_TOP}/share/cmake/Modules/") find_package(Bootstrap REQUIRED) - setup_project_paths(VLSISAPD) setup_project_paths(CORIOLIS) print_cmake_module_path() diff --git a/nimbus/CMakeLists.txt b/nimbus/CMakeLists.txt index 44833376..fb89e928 100644 --- a/nimbus/CMakeLists.txt +++ b/nimbus/CMakeLists.txt @@ -1,11 +1,11 @@ +# -*- mode: CMAKE explicit-buffer-name: "CMakeLists.txt" -*- project(NIMBUS) cmake_minimum_required(VERSION 2.4.0) - list(INSERT CMAKE_MODULE_PATH 0 "${DESTDIR}/$ENV{BOOTSTRAP_TOP}/share/cmake/Modules/") + list(INSERT CMAKE_MODULE_PATH 0 "${DESTDIR}/$ENV{CORIOLIS_TOP}/share/cmake/Modules/") find_package(Bootstrap REQUIRED) - setup_project_paths(VLSISAPD) setup_project_paths(CORIOLIS) set_cmake_policies() diff --git a/nimbus/src/FenceProperty.cpp b/nimbus/src/FenceProperty.cpp new file mode 100644 index 00000000..070ad6bd --- /dev/null +++ b/nimbus/src/FenceProperty.cpp @@ -0,0 +1,54 @@ + +// This file is part of the Coriolis Project. +// Copyright (C) Laboratoire LIP6 - Departement ASIM +// Universite Pierre et Marie Curie +// +// Date : 29/01/2004 +// Author : Hugo Clément + + +#include "hurricane/Property.h" + +#include "nimbus/FenceProperty.h" +#include "nimbus/Fence.h" + +namespace Nimbus { + + template<> + Name StandardPrivateProperty::_name = "ComponentFencePropName"; + + +Fence* getFence ( const Component& component ) +{ + Property* property = component.getProperty(FenceProperty::staticGetName()); + if (!property) return NULL; + + FenceProperty* fenceProperty = dynamic_cast(property); + if (!fenceProperty) { + throw Error("Property is not a FenceProperty"); + } + + return fenceProperty->getValue(); +} + + +void setFence ( Component& component, Fence* fence ) +{ + Property* property = component.getProperty(FenceProperty::staticGetName()); + if (!property) { + property = FenceProperty::create(fence); + component.put(property); + return; + } + + FenceProperty* fenceProperty = dynamic_cast(property); + if (!fenceProperty) { + throw Error("Property is not a FenceProperty"); + } + + fenceProperty->setValue(fence); +} + + + +} // End of Nimbus namespace. diff --git a/nimbus/src/RoutTools.cpp b/nimbus/src/RoutTools.cpp new file mode 100644 index 00000000..d5ebcdb8 --- /dev/null +++ b/nimbus/src/RoutTools.cpp @@ -0,0 +1,424 @@ + +// This file is part of the Coriolis Project. +// Copyright (C) Laboratoire LIP6 - Departement ASIM +// Universite Pierre et Marie Curie +// +// Date : 29/01/2004 +// Author : Hugo Clément + + +#include "hurricane/Technology.h" +#include "hurricane/DataBase.h" +#include "hurricane/Contact.h" +#include "nimbus/Splitter.h" +#include "nimbus/GCell.h" +#include "nimbus/Fence.h" +#include "nimbus/RoutTools.h" + +namespace Nimbus { + + using namespace Hurricane; + +Layer* getGRLayer () +{ + return DataBase::getDB()->getTechnology()->getLayer (Name ("SPL1")); +} + +#if 0 +Contact* getContact (Net& net, Point& position) +{ + Contact* contact; + + //cout << "Searching for " << position << endl; + + for_each_contact (contact, net.getContacts()) { + + if (contact->getPosition() == position) { + return contact; + } else { + } + + end_for; + } + + return NULL; +} +#endif + +#if 0 +Contacts* getContact (Net& net, Box& box) +{ + + return (net.getContacts().getSubSet (getContactIsUnderFilter (box))); +} +#endif + +Contact* CheckGetContact (Component* compo) { + Contact* c = NULL; + + if (dynamic_cast (compo)) { + c = dynamic_cast (compo); + } else { + // empty + } + + return c; +} + + +// ******************************************************************** +// Rattachements des Splitters à leur Fence +// + +#if 0 +void StickSplittersToFences (Cell* cell) { + + for (unsigned step = 1; true ; step ++) { + + DisplaySlot* displaySlot = getDisplaySlot (cell, getFenceDisplayName(step)); + + if (!displaySlot) + return; + + for_each_net (net, cell->getNets()) { + + for_each_component (compo, net->getComponents()) { + + if ( ! (is_a (compo)) ) + continue; + + Splitter* splitter = dynamic_cast (compo); + + if (splitter->getFence()) + continue; + + unsigned sstep = splitter->getStep(); + if (sstep != step) continue; + Point p (splitter->getPosition()); + Box b = Box(p); b.Inflate(getUnit(10)); + for_each_go (go, displaySlot->_getQuadTree().getGosUnder (b)) { + if ( ! (is_a(go)) ) + continue; + + Fence* fence = dynamic_cast (go); + + if ( + (fence->getStep() == sstep) + ) + { + fence->attachSplitter (splitter); + splitter->setFence (fence); + break; + } + + end_for; + } + + end_for; + } + + end_for; + } + } + + return; +} +#endif + +// **************************************************************************************************** +// Filters declaration & implementation +// **************************************************************************************************** + +class Contact_IsUnderFilter : public Filter { +// ****************************************************** + + public: Box _area; + + public: Contact_IsUnderFilter(const Box& area) + // ********************************************* + : _area(area) + { + }; + + public: Contact_IsUnderFilter(const Contact_IsUnderFilter& filter) + // ******************************************************************* + : _area(filter._area) + { + }; + + public: Contact_IsUnderFilter& operator=(const Contact_IsUnderFilter& filter) + // ****************************************************************************** + { + _area = filter._area; + return *this; + }; + + public: virtual Filter* getClone() const + // ************************************************* + { + return new Contact_IsUnderFilter(*this); + }; + + public: virtual bool accept(Contact* contact) const + // **************************************************** + { + return (_area.intersect(contact->getBoundingBox())) && (getGRLayer() == contact->getLayer()); + }; + + public: virtual string _getString() const + // ************************************** + { + return "<" + _TName("Contact::isUnderFilter") + " " + getString(_area) + ">"; + }; + +}; + + +ContactFilter getIsUnderFilter(const Box& area) + // ********************************************************* +{ + return Contact_IsUnderFilter(area); +} + + +ContactFilter getContactIsUnderFilter (const Box& area) { + + return Contact_IsUnderFilter (area); +} + +class GCell_FenceFilter : public Filter { + + public: Fence* _fence; + + public: GCell_FenceFilter(Fence* fence) + : _fence (fence) + { + }; + public: GCell_FenceFilter(const GCell_FenceFilter& filter) + : _fence (filter._fence) + { + } + public: GCell_FenceFilter& operator=(const GCell_FenceFilter& filter) + { + _fence = filter._fence; + return *this; + }; + public: virtual Filter* getClone() const + { + return new GCell_FenceFilter(*this); + }; + public: virtual bool accept(GCell* gcell) const + { + for_each_fence(fence, gcell->getSurroundingFences()) + { + if (fence->getParentFence() == _fence) + return true; + end_for; + } + return false; + }; + public: virtual string _getString() const + { + return "<" + _TName("GCell::FenceFilter") + ">"; + }; +}; + +GCellFilter getGCellFenceFilter(Fence* fence) +{ + return GCell_FenceFilter(fence); +} + + +class GCell_StepFilter : public Filter { +// ****************************************************** + + public: unsigned _step; + + public: GCell_StepFilter(unsigned step) + // ********************************************* + : _step(step) + { + }; + + public: GCell_StepFilter(const GCell_StepFilter& filter) + // ******************************************************************* + : _step(filter._step) + { + }; + + public: GCell_StepFilter& operator=(const GCell_StepFilter& filter) + // ****************************************************************************** + { + _step = filter._step; + return *this; + }; + + public: virtual Filter* getClone() const + // ************************************************* + { + return new GCell_StepFilter(*this); + }; + + public: virtual bool accept(GCell* gcell) const + // **************************************************** + { + return (gcell->getStep() == _step); + }; + + public: virtual string _getString() const + // ************************************** + { + return "<" + _TName("GCell::StepFilter") + " " + getString(_step) + ">"; + }; + +}; + + +GCellFilter getStepFilter(unsigned step) + // ********************************************************* +{ + return GCell_StepFilter(step); +} + + +GCellFilter getGCellStepFilter (unsigned step) { + + return GCell_StepFilter (step); +} + + + + +// Fence filtering + + +class Fence_IsInnerOfFilter : public Filter { +// ****************************************************** + + public: const GCell* _gc; + + public: Fence_IsInnerOfFilter(const GCell* gcell) + // ********************************************* + : _gc(gcell) + { + }; + + public: Fence_IsInnerOfFilter(const Fence_IsInnerOfFilter& filter) + // ******************************************************************* + : _gc(filter._gc) + { + }; + + public: Fence_IsInnerOfFilter& operator=(const Fence_IsInnerOfFilter& filter) + // ****************************************************************************** + { + _gc = filter._gc; + return *this; + }; + + public: virtual Filter* getClone() const + // ************************************************* + { + return new Fence_IsInnerOfFilter(*this); + }; + + public: virtual bool accept(Fence* fence) const + // **************************************************** + { + GCell* gc1 = fence->getGCell1(); + GCell* gc2 = fence->getGCell2(); + return ((gc1 == gc2) && (gc1 == _gc)); + }; + + public: virtual string _getString() const + // ************************************** + { + return "<" + _TName("Fence::isInnerOfFilter") + " " + getString(_gc) + ">"; + }; + +}; + + +FenceFilter getIsInnerOfFilter(const GCell* gcell) + // ********************************************************* +{ + return Fence_IsInnerOfFilter(gcell); +} + + +FenceFilter getFenceIsInnerOfFilter (const GCell* gcell) { + + return Fence_IsInnerOfFilter (gcell); +} + + + + + +class Fence_IsSubFenceOfFilter : public Filter { +// ****************************************************** + + public: const Fence* _fence; + + public: Fence_IsSubFenceOfFilter(const Fence* fence) + // ********************************************* + : _fence(fence) + { + }; + + public: Fence_IsSubFenceOfFilter(const Fence_IsSubFenceOfFilter& filter) + // ******************************************************************* + : _fence(filter._fence) + { + }; + + public: Fence_IsSubFenceOfFilter& operator=(const Fence_IsSubFenceOfFilter& filter) + // ****************************************************************************** + { + _fence = filter._fence; + return *this; + }; + + public: virtual Filter* getClone() const + // ************************************************* + { + return new Fence_IsSubFenceOfFilter(*this); + }; + + public: virtual bool accept(Fence* fence) const + // **************************************************** + { + const GCell* gc1 = fence->getGCell1()->getContainer(); + const GCell* gc2 = fence->getGCell2()->getContainer(); + return ( + ( gc1 != gc2 ) + && + ( (gc1 == _fence->getGCell1()) || (gc1 == _fence->getGCell2()) ) + && + ( (gc2 == _fence->getGCell1()) || (gc2 == _fence->getGCell2()) ) + ); + }; + + public: virtual string _getString() const + // ************************************** + { + return "<" + _TName("Fence::isSubFenceOfFilter") + " " + getString(_fence) + ">"; + }; + +}; // class FenceIsSubFenceOfFilter + + +FenceFilter getIsSubFenceOfFilter(const Fence* fence) + // ********************************************************* +{ + return Fence_IsSubFenceOfFilter(fence); +} + + +FenceFilter getFenceIsSubFenceOfFilter (const Fence* fence) { + + return Fence_IsSubFenceOfFilter (fence); +} + + +} // namespace Nimbus diff --git a/nimbus/src/Splitter.cpp b/nimbus/src/Splitter.cpp new file mode 100644 index 00000000..ecf6d9e7 --- /dev/null +++ b/nimbus/src/Splitter.cpp @@ -0,0 +1,766 @@ + +// This file is part of the Coriolis Project. +// Copyright (C) Laboratoire LIP6 - Departement ASIM +// Universite Pierre et Marie Curie +// +// Date : 29/01/2004 +// Author : Hugo Clément + + +// **************************************************************************************************** +// File: Splitter.cpp +// **************************************************************************************************** + +#include "hurricane/Net.h" +#include "hurricane/Layer.h" +#include "hurricane/BasicLayer.h" +#include "hurricane/ContactLayer.h" +#include "hurricane/Plug.h" +#include "hurricane/Error.h" +#include "hurricane/Collection.h" +#include "nimbus/Fence.h" +#include "nimbus/HFence.h" +#include "nimbus/VFence.h" +#include "nimbus/GCell.h" +#include "nimbus/GCells.h" +#include "nimbus/Splitter.h" +#include "nimbus/SplitterContact.h" + +namespace Nimbus { + + using namespace std; + using namespace Hurricane; + +// **************************************************************************************************** +// Splitter_Hooks declaration +// **************************************************************************************************** + +class Splitter_Hooks : public Collection { +// ******************************************* + +// Types +// ***** + + public: typedef Collection Inherit; + + public: class Locator : public Hurricane::Locator { + // ***************************************************** + + public: typedef Hurricane::Locator Inherit; + + private: const Splitter* _splitter; + private: Hook* _hook; + + public: Locator(const Splitter* splitter = NULL); + public: Locator(const Locator& locator); + + public: Locator& operator=(const Locator& locator); + + public: virtual Hook* getElement() const; + public: virtual Hurricane::Locator* getClone() const; + + public: virtual bool isValid() const; + + public: virtual void progress(); + + public: virtual string _getString() const; + + }; + +// Attributes +// ********** + + private: const Splitter* _splitter; + +// Constructors +// ************ + + public: Splitter_Hooks(const Splitter* splitter = NULL); + public: Splitter_Hooks(const Splitter_Hooks& hooks); + +// Operators +// ********* + + public: Splitter_Hooks& operator=(const Splitter_Hooks& hooks); + +// Accessors +// ********* + + public: virtual Collection* getClone() const; + public: virtual Hurricane::Locator* getLocator() const; + +// Others +// ****** + + public: virtual string _getString() const; + +}; + + + +// **************************************************************************************************** +// Splitter implementation +// **************************************************************************************************** + +Splitter::Splitter(Net* net, Layer* layer, const SplitterOrientation direction, const DbU::Unit& x, const DbU::Unit& y, const DbU::Unit& width, const DbU::Unit& height, const DbU::Unit& halfLength) +// **************************************************************************************************** +: Inherit(net), + _layer(layer), + _direction (direction), + _dx(x), + _dy(y), + _width(width), + _height(height), + _halfLength(halfLength), + _c1(NULL), + _c2(NULL), + _fence(NULL) +{ + if (!_layer) + throw Error("Can't create " + _TName("Splitter") + " : null layer"); +} + +Splitter* Splitter::create( + Net* net, + Layer* layer, + const DbU::Unit& x, + const DbU::Unit& y, + const DbU::Unit& halfLength, + const DbU::Unit& width, + const DbU::Unit& height) +{ + Splitter* splitter = new Splitter(net, layer, undefined, x, y, width, height, halfLength); + + splitter->_postCreate(); + + return splitter; +} + +Splitter* Splitter::create( + Net* net, + Layer* layer, + Fence* fence, + GCell* gc1, + GCell* gc2, + const DbU::Unit& halfLength, + const DbU::Unit& width, + const DbU::Unit& height) +{ + Splitter* splitter = + new Splitter( + net, + layer, + ( + (dynamic_cast (fence)) ? + Vertical : + Horizontal + ), + fence->getXCenter(), + fence->getYCenter(), + width, + height, + halfLength + ) + ; + + splitter->_postCreate(); + splitter->setFence(fence); + //splitter->_attachTo(fence, gc1, gc2); + + return splitter; +} + +// ******************************************************************** + +Splitter* Splitter::createHorizontal( + Net* net, + Layer* layer, + Fence* fence, + const DbU::Unit& halfLength, + const DbU::Unit& width, + const DbU::Unit& height) +{ + assert (fence); + + Splitter* splitter = new Splitter(net, layer, Horizontal, fence->getXCenter(), fence->getY(), halfLength, width, height); + + splitter->_postCreate(); + splitter->setFence(fence); + + return splitter; +} + +Splitter* Splitter::createHorizontal( + Net* net, + Layer* layer, + const DbU::Unit& x, + const DbU::Unit& y, + const DbU::Unit& halfLength, + const DbU::Unit& width, + const DbU::Unit& height) +{ + Splitter* splitter = new Splitter(net, layer, Horizontal, x, y, halfLength, width, height); + + splitter->_postCreate(); + + return splitter; +} + +// ******************************************************************** + +Splitter* Splitter::createVertical( + Net* net, + Layer* layer, + Fence* fence, + const DbU::Unit& halfLength, + const DbU::Unit& width, + const DbU::Unit& height) +{ + assert (fence); + + Splitter* splitter = new Splitter(net, layer, Vertical, fence->getX(), fence->getYCenter(), halfLength, width, height); + + splitter->_postCreate(); + splitter->setFence(fence); + + return splitter; +} + +Splitter* Splitter::createVertical( + Net* net, + Layer* layer, + const DbU::Unit& x, + const DbU::Unit& y, + const DbU::Unit& halfLength, + const DbU::Unit& width, + const DbU::Unit& height) +{ + Splitter* splitter = new Splitter(net, layer, Vertical, x, y, halfLength, width, height); + + splitter->_postCreate(); + + return splitter; +} + +// ******************************************************************** + + +void Splitter::_postCreate () +// **************************************************************************************************** +{ + if (_direction == Horizontal) { + _c1 = SplitterContact::create (this, _layer, -_halfLength, 0, _width, _height); // XXX FIXME + _c2 = SplitterContact::create (this, _layer, _halfLength, 0, _width, _height); // XXX FIXME + } else if (_direction == Vertical) { + _c1 = SplitterContact::create (this, _layer, 0, _halfLength, _width, _height); // XXX FIXME + _c2 = SplitterContact::create (this, _layer, 0, -_halfLength, _width, _height); // XXX FIXME + } else { + _c1 = SplitterContact::create (this, _layer, 0, 0, _width, _height); // XXX FIXME + _c2 = SplitterContact::create (this, _layer, 0, 0, _width, _height); // XXX FIXME + } + + Inherit::_postCreate(); + /* class RoutShell -> tiens en main la largeur de segments, contacts, splitter, layer de routage etc. */ + + + return; +} + +void Splitter::_attachTo(Fence* fence, GCell* gc1, GCell* gc2) +{ + _fence = fence; + _c1->setGCell(gc1); + _c2->setGCell(gc2); + return; +} + +void Splitter::setFence(Fence* fence) +{ + //if (_fence) + // throw Error ("Splitter is already attached to a Fence"); + + _fence = fence; + + _c1->setGCell(_fence->getGCell1()); + _c2->setGCell(_fence->getGCell2()); + + return; +} + +void Splitter::onDeletedFence() { + + this->destroy(); + + + return; +} + +Hook* Splitter::getHook1() const { + return (_c1->getBodyHook()); +} + +Hook* Splitter::getHook2() const { + return (_c2->getBodyHook()); +} + +Hook* Splitter::getLeftHook () const { + return getHook1(); +} +Hook* Splitter::getBottomHook () const { + return getHook2(); +} +Hook* Splitter::getDownHook () const { + return getHook2(); +} +Hook* Splitter::getRightHook () const { + return getHook2(); +} +Hook* Splitter::getUpHook () const { + return getHook1(); +} +Hook* Splitter::getTopHook () const { + return getHook1(); +} + + +Hook* Splitter::getOppositeBodyHook(const Hook* hook) const +// ********************************************** +{ + if (hook) { + if (hook == _c1->getBodyHook()) return _c2->getBodyHook(); + if (hook == _c2->getBodyHook()) return _c1->getBodyHook(); + } + return NULL; +} + +Hooks Splitter::getHooks() const +// **************************** +{ + return Splitter_Hooks(this); +} + +DbU::Unit Splitter::getX() const +// *********************** +{ + return _dx; +} + +DbU::Unit Splitter::getY() const +// *********************** +{ + return _dy; +} + +Point Splitter::getPosition() const +// ******************************* +{ + return Point(_dx, _dy); +} + +Box Splitter::getBoundingBox() const +// ******************************** +{ + DbU::Unit size = _getSize(); + + return Box(getPosition()).inflate(getHalfWidth() + size, getHalfHeight() + size); +} + +Box Splitter::getBoundingBox(const BasicLayer* basicLayer) const +// ****************************************************** +{ + if (!_layer->contains(basicLayer)) return Box(); + + DbU::Unit size = _getSize(basicLayer); + + return Box(getPosition()).inflate(getHalfWidth() + size, getHalfHeight() + size); +} + +void Splitter::invalidate(bool propagateFlag) +// ************************ +{ + Inherit::invalidate(propagateFlag); + _c1->invalidate(true); + _c2->invalidate(true); + return; +} + +void Splitter::translate(const DbU::Unit& dx, const DbU::Unit& dy) +// **************************************************** +{ + if ((dx != 0) || (dy != 0)) { + invalidate(true); + _dx += dx; + _dy += dy; + } +} + +void Splitter::setLayer(Layer* layer) +// ********************************* +{ + if (!layer) + throw Error("Can't set layer : null layer"); + + if (layer != _layer) { + invalidate(false); + _layer = layer; + } +} + +void Splitter::setWidth(const DbU::Unit& width) +// ************************************** +{ + if (width != _width) { + invalidate(false); + _width = width; + } +} + +void Splitter::setHeight(const DbU::Unit& height) +// **************************************** +{ + if (height != _height) { + invalidate(false); + _height = height; + } +} + +void Splitter::setSizes(const DbU::Unit& width, const DbU::Unit& height) +// ********************************************************** +{ + if ((width != _width) || (height != _height)) { + invalidate(false); + _width = width; + _height = height; + } +} + +void Splitter::setX(const DbU::Unit& x) +// ****************************** +{ + setPosition(x, getY()); +} + +void Splitter::setY(const DbU::Unit& y) +// ****************************** +{ + setPosition(getX(), y); +} + +void Splitter::setPosition(const DbU::Unit& x, const DbU::Unit& y) +// **************************************************** +{ + setOffset(x, y); +} + +void Splitter::setPosition(const Point& position) +// ********************************************* +{ + setPosition(position.getX(), position.getY()); +} + +void Splitter::setDx(const DbU::Unit& dx) +// ******************************** +{ + setOffset(dx, _dy); +} + +void Splitter::setDy(const DbU::Unit& dy) +// ******************************** +{ + setOffset(_dx, dy); +} + +void Splitter::setOffset(const DbU::Unit& dx, const DbU::Unit& dy) +// **************************************************** +{ + if ((dx != _dx) || (dy != _dy)) { + invalidate(true); + _dx = dx; + _dy = dy; + } +} + +void Splitter::_preDestroy() +// *********************** +{ + Inherit::_preDestroy(); + if (_fence) _fence->detachSplitter(this); +} + +string Splitter::_getString() const +// ******************************* +{ + string s = Inherit::_getString(); + s.insert(s.length() - 1, " " + getString(_layer->getName())); + s.insert(s.length() - 1, " [" + DbU::getValueString(getX())); + s.insert(s.length() - 1, " " + DbU::getValueString(getY())); + s.insert(s.length() - 1, "] " + DbU::getValueString(_width)); + s.insert(s.length() - 1, "x" + DbU::getValueString(_height)); + return s; +} + +Record* Splitter::_getRecord() const +// ************************** +{ + Record* record = Inherit::_getRecord(); + if (record) { + record->add(getSlot("Layer", _layer)); + + record->add(getSlot("SplitterContact 1", _c1)); + record->add(getSlot("SplitterContact 2", _c2)); + record->add(getSlot("Dx", &_dx)); + record->add(getSlot("Dy", &_dy)); + record->add(getSlot("Width", &_width)); + record->add(getSlot("Height", &_height)); + + record->add(getSlot("Fence", _fence)); + record->add(getSlot("GCell1", _c1->getGCell())); + record->add(getSlot("GCell2", _c2->getGCell())); + } + return record; +} + +DbU::Unit Splitter::_getSize() const +// *************************** +{ + + //Layer* layer = getLayer(); + //if (is_a(layer)) + // size = ((CompositeLayer*)layer)->getMaximalSplitterSize(); + + return (_height < _width ? _width : _height); +} + +DbU::Unit Splitter::_getSize(const BasicLayer* basicLayer) const +// ************************************************* +{ + const Layer* layer = getLayer(); + + if (!layer->contains(basicLayer)) return 0; + + //if (is_a(layer)) + // size = ((CompositeLayer*)layer)->getSplitterSize(basicLayer); + + return _getSize(); +} + +// void Splitter::_Draw(View* view, BasicLayer* basicLayer, const Box& updateArea, const Transformation& transformation) +// // **************************************************************************************************** +// { +// if (_width && _height) { +// if (1 < view->getScreenSize(max(_width, _height))) +// basicLayer->_Fill(view, transformation.getBox(getBoundingBox(basicLayer))); +// } +// if (basicLayer == _layer->_getSymbolicBasicLayer()) { +// if (view->CutPointsAreVisible() && (3 < view->getScale())) { +// Point position = getPosition(); +// view->DrawPoint(transformation.getPoint(position), 3); +// if (_width) { +// Box box = transformation.getBox(Box(position).inflate(getHalfWidth(), 0)); +// view->DrawLine(box.getXMin(), box.getYMin(), box.getXMax(), box.getYMax()); +// } +// if (_height) { +// Box box = transformation.getBox(Box(position).inflate(0, getHalfHeight())); +// view->DrawLine(box.getXMin(), box.getYMin(), box.getXMax(), box.getYMax()); +// } +// } +// } +// } + +// void Splitter::_Highlight(View* view, const Box& updateArea, const Transformation& transformation) +// // ********************************************************************************************** +// { +// if (_width && _height) { +// if (1 < view->getScreenSize(max(_width, _height))) { +// for_each_basic_layer(basicLayer, getLayer()->getBasicLayers()) { +// basicLayer->_Fill(view, transformation.getBox(getBoundingBox(basicLayer))); +// end_for; +// } +// } +// } +// if (view->getScale() <= 1) +// view->DrawPoint(transformation.getPoint(getPosition()), 1); +// else if (view->getScale() <= 3) +// { +// view->DrawPoint(transformation.getPoint(getPosition()), 2); + +// if ( view->isTextVisible() ) +// { +// string text = "(" +// + getString ( getValue ( getX() ) ) + "," +// + getString ( getValue ( getY() ) ) + ") : Fence(" +// + getString ( getValue ( _fence->getXMin() ) ) + ":" + getString ( getValue ( _fence->getXMax() ) ) + "," +// + getString ( getValue ( _fence->getY() ) ) + ":" + getString ( getValue ( _fence->getYMax() ) ) + ")"; +// view->DrawString ( text, +// transformation.getBox ( getBoundingBox() ).getXMin(), +// transformation.getBox ( getBoundingBox() ).getYMax() ); +// } +// } +// else { +// Point position = getPosition(); +// view->DrawPoint(transformation.getPoint(position), 3); +// if (_width) { +// Box box = transformation.getBox(Box(position).inflate(getHalfWidth(), 0)); +// view->DrawLine(box.getXMin(), box.getYMin(), box.getXMax(), box.getYMax()); +// } +// if (_height) { +// Box box = transformation.getBox(Box(position).inflate(0, getHalfHeight())); +// view->DrawLine(box.getXMin(), box.getYMin(), box.getXMax(), box.getYMax()); +// } + +// if ( view->isTextVisible() ) +// { +// string text = "(" +// + getString ( getValue ( getX() ) ) + "," +// + getString ( getValue ( getY() ) ) + ") : Fence(" +// + getString ( getValue ( _fence->getXMin() ) ) + ":" + getString ( getValue ( _fence->getXMax() ) ) + "," +// + getString ( getValue ( _fence->getY() ) ) + ":" + getString ( getValue ( _fence->getYMax() ) ) + ")"; +// view->DrawString ( text, +// transformation.getBox ( getBoundingBox() ).getXMin(), +// transformation.getBox ( getBoundingBox() ).getYMax() ); +// } +// } +// view->DrawRectangle ( transformation.getBox ( getBoundingBox() ) ); +// } + +// void Splitter::_SaveHeaderTo(OutputFile& outputFile) +// // ************************************************ +// { +// Inherit::_SaveHeaderTo(outputFile); + +// outputFile << " " << outputFile.getId(getLayer()); +// outputFile << " " << getValueString(getDx()); +// outputFile << " " << getValueString(getDy()); +// outputFile << " " << getValueString(getWidth()); +// outputFile << " " << getValueString(getHeight()); +// } + + + +// **************************************************************************************************** +// Splitter_Hooks implementation +// **************************************************************************************************** + +Splitter_Hooks::Splitter_Hooks(const Splitter* splitter) +// ************************************************* +: Inherit(), + _splitter(splitter) +{ +} + +Splitter_Hooks::Splitter_Hooks(const Splitter_Hooks& hooks) +// ***************************************************** +: Inherit(), + _splitter(hooks._splitter) +{ +} + +Splitter_Hooks& Splitter_Hooks::operator=(const Splitter_Hooks& hooks) +// **************************************************************** +{ + _splitter = hooks._splitter; + return *this; +} + +Collection* Splitter_Hooks::getClone() const +// *********************************************** +{ + return new Splitter_Hooks(*this); +} + +Locator* Splitter_Hooks::getLocator() const +// ********************************************** +{ + return new Locator(_splitter); +} + +string Splitter_Hooks::_getString() const +// ************************************* +{ + string s = "<" + _TName("Splitter::Hooks"); + if (_splitter) s += " " + getString(_splitter); + s += ">"; + return s; +} + + + +// **************************************************************************************************** +// Splitter_Hooks::Locator implementation +// **************************************************************************************************** + +Splitter_Hooks::Locator::Locator(const Splitter* splitter) +// **************************************************** +: Inherit(), + _splitter(splitter), + _hook(NULL) +{ + if (_splitter) _hook = ((Splitter*)_splitter)->getBodyHook(); +} + +Splitter_Hooks::Locator::Locator(const Locator& locator) +// **************************************************** +: Inherit(), + _splitter(locator._splitter), + _hook(locator._hook) +{ +} + +Splitter_Hooks::Locator& Splitter_Hooks::Locator::operator=(const Locator& locator) +// ****************************************************************************** +{ + _splitter = locator._splitter; + _hook = locator._hook; + return *this; +} + +Hook* Splitter_Hooks::Locator::getElement() const +// ********************************************* +{ + return _hook; +} + +Locator* Splitter_Hooks::Locator::getClone() const +// ***************************************************** +{ + return new Locator(*this); +} + +bool Splitter_Hooks::Locator::isValid() const +// ***************************************** +{ + return (_hook != NULL); +} + +void Splitter_Hooks::Locator::progress() +// ************************************ +{ + if (_hook) { + //if (_hook = ((Splitter*)_splitter)->getBodyHook()) + //if (_hook = ((Splitter*)_splitter)->getLeftHook()) + // _hook = ((Splitter*)_splitter)->getRightHook(); + //else + // _hook = ((Splitter*)_splitter)->getLeftHook(); + //else + _hook = NULL; +#if 0 + if (_hook == ((Splitter*)_splitter)->getBodyHook()) + _hook = ((Splitter*)_splitter)->getAnchorHook(); + else +#endif +#if 0 + _hook = NULL; +#endif + } +} + +string Splitter_Hooks::Locator::_getString() const +// ********************************************** +{ + string s = "<" + _TName("Splitter::Hooks::Locator"); + if (_splitter) s += " " + getString(_splitter); + s += ">"; + return s; +} + +} diff --git a/nimbus/src/StepProperty.cpp b/nimbus/src/StepProperty.cpp new file mode 100644 index 00000000..ba4b95c3 --- /dev/null +++ b/nimbus/src/StepProperty.cpp @@ -0,0 +1,83 @@ +// +// This file is part of the Coriolis Project. +// Copyright (C) Laboratoire LIP6 - Departement ASIM +// Universite Pierre et Marie Curie +// +// Main contributors : +// Christophe Alexandre +// Sophie Belloeil +// Hugo Clément +// Jean-Paul Chaput +// Damien Dupuis +// Christian Masson +// Marek Sroka +// +// The Coriolis Project is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation; either version 2 of the +// License, or (at your option) any later version. +// +// The Coriolis Project is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with the Coriolis Project; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// +// License-Tag +// +// +// Date : 29/01/2004 +// Author : Hugo Clément +// +// Authors-Tag + + +#include "hurricane/Property.h" +#include "hurricane/Instance.h" +#include "nimbus/StepProperty.h" + +namespace Nimbus { + + using namespace Hurricane; + + typedef StandardPrivateProperty InstanceProperty; + + template<> + Name InstanceProperty::_name = "Nimbus::InstanceProperty"; + + +unsigned getStep(const Instance& instance) +{ + Property* property = instance.getProperty(InstanceProperty::staticGetName()); + if (!property) + return 0; + + if (!dynamic_cast(property)) + { + throw Error("bad property type"); + } + + return (static_cast(property))->getValue(); +} + +void setStep(Instance& instance, unsigned step) +{ + Property* property = instance.getProperty(InstanceProperty::staticGetName()); + if (!property) + { + property = InstanceProperty::create(step); + instance.put(property); + return; + } + if (!dynamic_cast(property)) + { + throw Error("bad property type"); + } + (static_cast(property))->setValue(step); +} + +} // End of Nimbus namespace. diff --git a/nimbus/src/nimbus/FenceProperty.h b/nimbus/src/nimbus/FenceProperty.h new file mode 100644 index 00000000..ddb10d69 --- /dev/null +++ b/nimbus/src/nimbus/FenceProperty.h @@ -0,0 +1,63 @@ +// +// This file is part of the Coriolis Project. +// Copyright (C) Laboratoire LIP6 - Departement ASIM +// Universite Pierre et Marie Curie +// +// Main contributors : +// Christophe Alexandre +// Sophie Belloeil +// Hugo Clément +// Jean-Paul Chaput +// Damien Dupuis +// Christian Masson +// Marek Sroka +// +// The Coriolis Project is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation; either version 2 of the +// License, or (at your option) any later version. +// +// The Coriolis Project is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with the Coriolis Project; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// +// License-Tag +// +// +// Date : 29/01/2004 +// Author : Hugo Clément +// +// Authors-Tag + + +#ifndef __NIMBUS_FENCE_PROPERTY_H__ +#define __NIMBUS_FENCE_PROPERTY_H__ + +#include "hurricane/Property.h" +#include "hurricane/Component.h" + + +namespace Nimbus { + + using namespace Hurricane; + + class Fence; + + + typedef StandardPrivateProperty FenceProperty; + + + extern Fence* getFence ( const Component& component ); + extern void setFence ( Component& component, Fence* ); + +} + +//setNestedSlotAdapter(Nimbus::FenceProperty) + +#endif /* __FENCEPROP_H__ */ diff --git a/nimbus/src/nimbus/Fences.h b/nimbus/src/nimbus/Fences.h new file mode 100644 index 00000000..8ed79352 --- /dev/null +++ b/nimbus/src/nimbus/Fences.h @@ -0,0 +1,63 @@ + +// This file is part of the Coriolis Project. +// Copyright (C) Laboratoire LIP6 - Departement ASIM +// Universite Pierre et Marie Curie +// +// Date : 29/01/2004 +// Author : Hugo Clément + + +#ifndef __NIMBUS_FENCES_H__ +#define __NIMBUS_FENCES_H__ + +#include +#include "hurricane/Collection.h" + +namespace Nimbus { + + using namespace std; + using namespace Hurricane; + + class Fence; + + typedef set FenceSet; + +// **************************************************************************************************** +// Fencesdeclaration +// **************************************************************************************************** + +typedef GenericCollection Fences; + + + +// **************************************************************************************************** +// FenceLocator declaration +// **************************************************************************************************** + +typedef GenericLocator FenceLocator; + + + +// **************************************************************************************************** +// FenceFilter declaration +// **************************************************************************************************** + +typedef GenericFilter FenceFilter; + + + +// **************************************************************************************************** +// for_each_fences declaration +// **************************************************************************************************** + +#define for_each_fence(fence, fences)\ +/****************************************************/\ +{\ + FenceLocator _locator = fences.getLocator();\ + while (_locator.isValid()) {\ + Fence* fence = _locator.getElement();\ + _locator.progress(); + + +} +#endif // __FENCES_H diff --git a/nimbus/src/nimbus/FrontLine.h b/nimbus/src/nimbus/FrontLine.h new file mode 100644 index 00000000..a6450b6b --- /dev/null +++ b/nimbus/src/nimbus/FrontLine.h @@ -0,0 +1,95 @@ +// +// This file is part of the Coriolis Project. +// Copyright (C) Laboratoire LIP6 - Departement ASIM +// Universite Pierre et Marie Curie +// +// Main contributors : +// Christophe Alexandre +// Sophie Belloeil +// Hugo Clément +// Jean-Paul Chaput +// Damien Dupuis +// Christian Masson +// Marek Sroka +// +// The Coriolis Project is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation; either version 2 of the +// License, or (at your option) any later version. +// +// The Coriolis Project is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with the Coriolis Project; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// +// License-Tag +// +// +// Date : 29/01/2004 +// Author : Hugo Clément +// +// Authors-Tag + + +#ifndef __NIMBUS_FRONTLINE_H__ +#define __NIMBUS_FRONTLINE_H__ + +#include "hurricane/ExtensionGo.h" +#include "nimbus/Fences.h" + + +namespace Nimbus { + +class Grid; + +class FrontLine { + + + private: + + vector _rootFences; + + protected: + Grid* _grid; + + FrontLine (); + ~FrontLine(); + + public: + FrontLine* create(); + void destroy(); + void _preDestroy(); + void _postCreate(); + + Grid* getGrid() { return _grid; }; + + void addRootFence (Fence* fence); + void moveTo (DbU::Unit target); + + DbU::Unit getX() const { return 0; }; + DbU::Unit getY() const { return 0; }; + +#if 0 + virtual DbU::Unit getXMin() const { return getX(); }; + virtual DbU::Unit getXMax() const { return getX(); }; + virtual DbU::Unit getYMin() const { return getY(); }; + virtual DbU::Unit getYMax() const { return getY(); }; + virtual Point getP1() const { return Point (getX(), getY()); }; + virtual Point getP2() const { return Point (getX(), getY()); }; + virtual DbU::Unit getXCenter() const { return 0;}; + virtual DbU::Unit getYCenter() const { return 0;}; + virtual Point getCenter() const { return Point (getXCenter(), getYCenter());}; + virtual Box getBoundingBox() const; +#endif + string _getTypeName() const {return _TName("FrontLine");}; +}; + +} + + +#endif diff --git a/nimbus/src/nimbus/GCells.h b/nimbus/src/nimbus/GCells.h new file mode 100644 index 00000000..7376f0b5 --- /dev/null +++ b/nimbus/src/nimbus/GCells.h @@ -0,0 +1,63 @@ +// +// This file is part of the Coriolis Project. +// Copyright (C) Laboratoire LIP6 - Departement ASIM +// Universite Pierre et Marie Curie +// +// Date : 29/01/2004 +// Author : Hugo Clément + + +#ifndef __NIMBUS_GCELLS_H__ +#define __NIMBUS_GCELLS_H__ + +#include +#include "hurricane/Collection.h" + +namespace Nimbus { + + using namespace std; + using namespace Hurricane; + + class GCell; + + typedef set GCellSet; + +// **************************************************************************************************** +// GCellsdeclaration +// **************************************************************************************************** + +typedef GenericCollection GCells; + + + +// **************************************************************************************************** +// GCelleLocator declaration +// **************************************************************************************************** + +typedef GenericLocator GCellLocator; + + + +// **************************************************************************************************** +// GCelleFilter declaration +// **************************************************************************************************** + +typedef GenericFilter GCellFilter; + + + +// **************************************************************************************************** +// for_each_routboxes declaration +// **************************************************************************************************** + +#define for_each_gcell(gcell, gcells)\ +/************************************/\ +{\ + GCellLocator _locator = gcells.getLocator();\ + while (_locator.isValid()) {\ + GCell* gcell = _locator.getElement();\ + _locator.progress(); + + +} +#endif // __GCELLS_H diff --git a/nimbus/src/nimbus/HFence.h b/nimbus/src/nimbus/HFence.h new file mode 100644 index 00000000..9b5c77fc --- /dev/null +++ b/nimbus/src/nimbus/HFence.h @@ -0,0 +1,97 @@ +// +// This file is part of the Coriolis Project. +// Copyright (C) Laboratoire LIP6 - Departement ASIM +// Universite Pierre et Marie Curie +// +// Main contributors : +// Christophe Alexandre +// Sophie Belloeil +// Hugo Clément +// Jean-Paul Chaput +// Damien Dupuis +// Christian Masson +// Marek Sroka +// +// The Coriolis Project is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation; either version 2 of the +// License, or (at your option) any later version. +// +// The Coriolis Project is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with the Coriolis Project; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// +// License-Tag +// +// +// Date : 29/01/2004 +// Author : Hugo Clément +// +// Authors-Tag + + +#ifndef __NIMBUS_HFENCE_H__ +#define __NIMBUS_HFENCE_H__ + +#include "hurricane/DbU.h" +#include "nimbus/Fence.h" + +namespace Nimbus { + +class GCell; + +class HFence : public Fence { + + public: + typedef Fence Inherit; + + private: + GCell* _gcup; + GCell* _gcdown; + + protected: + HFence (Grid* grid, GCell* gcup = NULL, GCell* gcdown = NULL); + ~HFence(); + + public: + static HFence* create (Grid* grid, GCell* gcup, GCell* gcdown); + + //virtual void _preDestroy (); + virtual void _postCreate (); + + virtual GCell* getUpGCell() const { return _gcup; }; + virtual GCell* getDownGCell() const { return _gcdown; }; + + virtual GCell* getGCell1() const { return getUpGCell(); }; + virtual GCell* getGCell2() const { return getDownGCell(); }; + + virtual DbU::Unit getX() const; + virtual DbU::Unit getY() const; + virtual DbU::Unit getXMin() const; + virtual DbU::Unit getXMax() const; + virtual Point getP1() const; + virtual Point getP2() const; + virtual DbU::Unit getXCenter() const; + virtual DbU::Unit getYCenter() const; + virtual Point getCenter() const; + + virtual bool isHorizontal() { return true; }; + virtual bool isVertical() { return false; }; + + virtual void computeCapacity(); + + virtual void _moveTo (DbU::Unit target); + + virtual Record* _getRecord() const; + virtual string _getString() const; + virtual string _getTypeName() const {return _TName("HFence");}; +}; + +} +#endif diff --git a/nimbus/src/nimbus/RoutTools.h b/nimbus/src/nimbus/RoutTools.h new file mode 100644 index 00000000..d409f342 --- /dev/null +++ b/nimbus/src/nimbus/RoutTools.h @@ -0,0 +1,60 @@ + +// This file is part of the Coriolis Project. +// Copyright (C) Laboratoire LIP6 - Departement ASIM +// Universite Pierre et Marie Curie +// +// Date : 29/01/2004 +// Author : Hugo Clément + + +#ifndef __NIMBUS_ROUTTOOLS_H__ +#define __NIMBUS_ROUTTOOLS_H__ + +#include +#include "nimbus/GCells.h" +#include "nimbus/Fences.h" + +namespace Hurricane { + class Plug; + class Contact; + class Segment; +} + +namespace Nimbus { + + using namespace std; + using namespace CRL; + using namespace Hurricane; + +typedef set NetSet; +typedef set PlugSet; +typedef set HookSet; +typedef set PointSet; +typedef set RubberSet; +typedef set SegmentSet; +typedef set ContactSet; + + +// recupere un contact, net et position donnee +//Contact* getContact (Net& net, Point& pos); + + +// Donne le layer du routage global +Layer* getGRLayer (); + +Contact* CheckGetContact (Component* compo); + +//void StickSplittersToFences (Cell* cell); + +// relie deux contacts par un ou plusieurs segments +//void LRout (Contact* c1, Contact* c2); +//void Link (Contact* c1, Contact* c2); +//bool Linked (Contact* c1, Contact* c2); +ContactFilter getContactIsUnderFilter(const Box& area); +GCellFilter getGCellStepFilter(unsigned step); +FenceFilter getFenceIsInnerOfFilter(const GCell* gcell); +FenceFilter getFenceIsSubFenceOfFilter(const Fence* fence); +GCellFilter getGCellFenceFilter(Fence* fence); + +} +#endif diff --git a/nimbus/src/nimbus/Splitter.h b/nimbus/src/nimbus/Splitter.h new file mode 100644 index 00000000..e67d429c --- /dev/null +++ b/nimbus/src/nimbus/Splitter.h @@ -0,0 +1,145 @@ + +// This file is part of the Coriolis Project. +// Copyright (C) Laboratoire LIP6 - Departement ASIM +// Universite Pierre et Marie Curie +// +// Date : 29/01/2004 +// Author : Hugo Clément + + +// *********************************************************************** +// File: Splitter.h +// *********************************************************************** + +#ifndef __NIMBUS_SPLITTER__ +#define __NIMBUS_SPLITTER__ + +#include "hurricane/Component.h" +#include "nimbus/Splitters.h" + +namespace Nimbus { + + using namespace Hurricane; + + class SplitterContact; + class Fence; + class GCell; + + +// *********************************************************************** +// Splitter declaration +// *********************************************************************** + +class Splitter : public Component { +// ***************************** + +// Types +// ***** + + public: typedef Component Inherit; + + private: typedef enum { + Horizontal = 1, + Vertical = 2, + undefined = 64, + } SplitterOrientation; + +// Attributes +// ********** + + private: Layer* _layer; + private: SplitterOrientation _direction; + private: DbU::Unit _dx; + private: DbU::Unit _dy; + private: DbU::Unit _width; + private: DbU::Unit _height; + private: DbU::Unit _halfLength; + private: SplitterContact* _c1; + private: SplitterContact* _c2; + private: Fence* _fence; + +// Constructors +// ************ + + protected: Splitter(Net* net, Layer* layer, const SplitterOrientation direction, const DbU::Unit& x, const DbU::Unit& y, const DbU::Unit& width = 0, const DbU::Unit& height = 0, const DbU::Unit& halfLength = 2); + + public: static Splitter* create(Net* net, Layer* layer, const DbU::Unit& x, const DbU::Unit& y, const DbU::Unit& halfLength = 2, const DbU::Unit& width = 0, const DbU::Unit& height = 0); + public: static Splitter* create(Net* net, Layer* layer, Fence* fence, GCell* gc1, GCell* gc2, const DbU::Unit& halfLength = 2, const DbU::Unit& width = 0, const DbU::Unit& height = 0); + public: static Splitter* createHorizontal(Net* net, Layer* layer, Fence* fence, const DbU::Unit& halfLength = 2, const DbU::Unit& width = 0, const DbU::Unit& height = 0); + public: static Splitter* createHorizontal(Net* net, Layer* layer, const DbU::Unit& x, const DbU::Unit& y, const DbU::Unit& halfLength = 2, const DbU::Unit& width = 0, const DbU::Unit& height = 0); + public: static Splitter* createVertical(Net* net, Layer* layer, Fence* fence, const DbU::Unit& halfLength = 2, const DbU::Unit& width = 0, const DbU::Unit& height = 0); + public: static Splitter* createVertical(Net* net, Layer* layer, const DbU::Unit& x, const DbU::Unit& y, const DbU::Unit& halfLength = 2, const DbU::Unit& width = 0, const DbU::Unit& height = 0); + public: void _postCreate (); + public: void _attachTo (Fence* fence, GCell* gc1, GCell* gc2); + +// Accessors +// ********* + + public: virtual Hooks getHooks() const; + public: SplitterContact* getSplitterContact1() const { return _c1; }; + public: SplitterContact* getSplitterContact2() const { return _c2; }; + public: Hook* getHook1() const; + public: Hook* getHook2() const; + public: Hook* getLeftHook() const; + public: Hook* getRightHook() const; + public: Hook* getUpHook() const; + public: Hook* getTopHook() const; + public: Hook* getBottomHook() const; + public: Hook* getDownHook() const; + public: Hook* getOppositeBodyHook(const Hook* hook) const; + public: bool isHorizontal() const { return _direction == Horizontal; }; + public: bool isVertical() const { return _direction == Vertical; }; + public: virtual DbU::Unit getX() const; + public: virtual DbU::Unit getY() const; + public: virtual Point getPosition() const; + public: virtual Box getBoundingBox() const; + public: virtual const Layer* getLayer() const {return _layer;}; + public: virtual Box getBoundingBox(const BasicLayer* basicLayer) const; + public: const DbU::Unit& getDx() const {return _dx;}; + public: const DbU::Unit& getDy() const {return _dy;}; + public: const DbU::Unit& getWidth() const {return _width;}; + public: DbU::Unit getHalfWidth() const {return (_width / 2);}; + public: const DbU::Unit& getHeight() const {return _height;}; + public: DbU::Unit getHalfHeight() const {return (_height / 2);}; + public: void onDeletedFence(); + public: Fence* getFence() const { return _fence; }; + public: void setFence(Fence* fence); + +// Updators +// ******** + + public: virtual void invalidate(bool propagateFlag = true); + public: virtual void translate(const DbU::Unit& dx, const DbU::Unit& dy); + + public: void setLayer(Layer* layer); + public: void setWidth(const DbU::Unit& width); + public: void setHeight(const DbU::Unit& height); + public: void setSizes(const DbU::Unit& width, const DbU::Unit& height); + public: void setX(const DbU::Unit& x); + public: void setY(const DbU::Unit& y); + public: void setPosition(const DbU::Unit& x, const DbU::Unit& y); + public: void setPosition(const Point& position); + public: void setDx(const DbU::Unit& dx); + public: void setDy(const DbU::Unit& dy); + public: void setOffset(const DbU::Unit& dx, const DbU::Unit& dy); + +// Others +// ****** + + protected: virtual void _preDestroy(); + + public: virtual string _getTypeName() const {return _TName("Splitter");}; + public: virtual string _getString() const; + public: virtual Record* _getRecord() const; + + public: DbU::Unit _getSize() const; + public: DbU::Unit _getSize(const BasicLayer* basicLayer) const; + +}; + +} // namespace nimbus + +//typedef set SplitterSet; + + +#endif // HURRICANE_SPLITTER diff --git a/nimbus/src/nimbus/SplitterContact.h b/nimbus/src/nimbus/SplitterContact.h new file mode 100644 index 00000000..93cf32c5 --- /dev/null +++ b/nimbus/src/nimbus/SplitterContact.h @@ -0,0 +1,162 @@ +// +// This file is part of the Coriolis Project. +// Copyright (C) Laboratoire LIP6 - Departement ASIM +// Universite Pierre et Marie Curie +// +// Date : 29/01/2004 +// Author : Hugo Clément + + +#ifndef __NIMBUS_SPLITTERCONTACT__ +#define __NIMBUS_SPLITTERCONTACT__ + +#include "hurricane/Component.h" +#include "crlcore/RoutingLayerGauge.h" +#include "nimbus/GCells.h" +#include "nimbus/SplitterContacts.h" + + +namespace Nimbus { + + using namespace std; + using namespace Hurricane; + using namespace CRL; + + class Splitter; + + +// **************************************************************************************************** +// SplitterContact declaration +// **************************************************************************************************** + +class SplitterContact : public Component { +// ************************************* + +// Types +// ***** + + public: typedef Component Inherit; + + public: class AnchorHook : public Hook { + // *********************************** + + friend class SplitterContact; + + public: typedef Hook Inherit; + + private: AnchorHook(SplitterContact* splittercontact); + + public: virtual Component* getComponent() const; + + public: virtual bool isMaster() const {return false;}; + + public: virtual string _getTypeName() const { return _TName("SplitterContact::AnchorHook"); }; + public: virtual string _getString() const; + }; + + enum SPType { SP_1 = (1 << 2) + , SP_2 = (1 << 3) + , SP_LEFT = SP_1 | Constant::Horizontal + , SP_RIGHT = SP_2 | Constant::Horizontal + , SP_TOP = SP_1 | Constant::Vertical + , SP_BOTTOM = SP_2 | Constant::Vertical + }; + + +// Attributes +// ********** + + private: AnchorHook _anchorHook; + private: Layer* _layer; + private: DbU::Unit _dx; + private: DbU::Unit _dy; + private: DbU::Unit _width; + private: DbU::Unit _height; + private: GCell* _gcell; + + private: unsigned _oppositePlugCount; + private: unsigned _oppositeSplitterCount; + private: unsigned _oppositePinCount; + +// Constructors +// ************ + + protected: SplitterContact(Net* net, Layer* layer, const DbU::Unit& x, const DbU::Unit& y, const DbU::Unit& width = 0, const DbU::Unit& height = 0, GCell* gcell = NULL); + protected: SplitterContact(Net* net, Component* anchor, Layer* layer, const DbU::Unit& dx, const DbU::Unit& dy, const DbU::Unit& width = 0, const DbU::Unit& height = 0, GCell* gcell = NULL); + + public: static SplitterContact* create(Net* net, Layer* layer, const DbU::Unit& x, const DbU::Unit& y, const DbU::Unit& width = 0, const DbU::Unit& height = 0, GCell* gcell = NULL); + public: static SplitterContact* create(Component* anchor, Layer* layer, const DbU::Unit& dx, const DbU::Unit& dy, const DbU::Unit& width = 0, const DbU::Unit& height = 0, GCell* gcell = NULL); + +// Accessors +// ********* + + public: Splitter* getSplitter () const; + public: Hook* getOppositeBodyHook ();// const; + public: SplitterContact* getOppositeSplitterContact ();// const; + + public: unsigned getOppositeSplitterCount(); + public: unsigned getOppositePlugCount(); + public: unsigned getOppositePinCount(); + private: void computeOppositeCounts(); + public: void invalidateOppositeCounts(); + + public: virtual Hooks getHooks() const; + public: virtual DbU::Unit getX() const; + public: virtual DbU::Unit getY() const; + public: virtual Point getPosition() const; + public: virtual Box getBoundingBox() const; + public: virtual const Layer* getLayer() const {return _layer;}; + public: virtual Box getBoundingBox(const BasicLayer* basicLayer) const; + public: Hook* getAnchorHook() {return &_anchorHook;}; + public: Component* getAnchor() const; + public: const DbU::Unit& getDx() const {return _dx;}; + public: const DbU::Unit& getDy() const {return _dy;}; + public: const DbU::Unit& getWidth() const {return _width;}; + public: DbU::Unit getHalfWidth() const {return (_width / 2);}; + public: const DbU::Unit& getHeight() const {return _height;}; + public: DbU::Unit getHalfHeight() const {return (_height / 2);}; + public: GCell* getGCell() const { return _gcell; }; + public: GCells getSubGCells(); + //public: GCells getSubPlacementLeaves(); + public: unsigned int getSPType(); + +// Updators +// ******** + + public: virtual void translate(const DbU::Unit& dx, const DbU::Unit& dy); + + public: void setGCell(GCell* gcell); + public: void setLayer(Layer* layer); + public: void setWidth(const DbU::Unit& width); + public: void setHeight(const DbU::Unit& height); + public: void setSizes(const DbU::Unit& width, const DbU::Unit& height); + public: void setX(const DbU::Unit& x); + public: void setY(const DbU::Unit& y); + public: void setPosition(const DbU::Unit& x, const DbU::Unit& y); + public: void setPosition(const Point& position); + public: void setDx(const DbU::Unit& dx); + public: void setDy(const DbU::Unit& dy); + public: void setOffset(const DbU::Unit& dx, const DbU::Unit& dy); + +// Others +// ****** + + protected: virtual void _preDestroy(); + + public: virtual string _getTypeName() const {return _TName("SplitterContact");}; + public: virtual string _getString() const; + public: virtual Record* _getRecord() const; + + public: DbU::Unit _getSize() const; + public: DbU::Unit _getSize(const BasicLayer* basicLayer) const; + +}; + + +string getStringDir ( unsigned int direction ); + +} + + + +#endif // __NIMBUS_SPLITTERCONTACT__ diff --git a/nimbus/src/nimbus/SplitterContacts.h b/nimbus/src/nimbus/SplitterContacts.h new file mode 100644 index 00000000..871d87b8 --- /dev/null +++ b/nimbus/src/nimbus/SplitterContacts.h @@ -0,0 +1,99 @@ +// +// This file is part of the Coriolis Project. +// Copyright (C) Laboratoire LIP6 - Departement ASIM +// Universite Pierre et Marie Curie +// +// Main contributors : +// Christophe Alexandre +// Sophie Belloeil +// Hugo Clément +// Jean-Paul Chaput +// Damien Dupuis +// Christian Masson +// Marek Sroka +// +// The Coriolis Project is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation; either version 2 of the +// License, or (at your option) any later version. +// +// The Coriolis Project is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with the Coriolis Project; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// +// License-Tag +// +// +// Date : 29/01/2004 +// Author : Hugo Clément +// +// Authors-Tag + + +// **************************************************************************************************** +// File: SplitterContacts.h +// Authors: R. Escassut +// Copyright (C) SILVACO & BULL S.A. 2000-2002 All rights reserved +// **************************************************************************************************** + +#ifndef __NIMBUS_SPLITTER_CONTACTS__ +#define __NIMBUS_SPLITTER_CONTACTS__ + +#include "hurricane/Collection.h" + +namespace Nimbus { + +class SplitterContact; + + + +// **************************************************************************************************** +// SplitterContacts declaration +// **************************************************************************************************** + +typedef GenericCollection SplitterContacts; + + + +// **************************************************************************************************** +// SplitterContactLocator declaration +// **************************************************************************************************** + +typedef GenericLocator SplitterContactLocator; + + + +// **************************************************************************************************** +// SplitterContactFilter declaration +// **************************************************************************************************** + +typedef GenericFilter SplitterContactFilter; + + + +// **************************************************************************************************** +// for_each_splittercontact declaration +// **************************************************************************************************** + +#define for_each_splittercontact(splittercontact, splittercontacts)\ +/******************************************/\ +{\ + SplitterContactLocator _locator = splittercontacts.getLocator();\ + while (_locator.isValid()) {\ + SplitterContact* splittercontact = _locator.getElement();\ + _locator.progress(); + + + +} +#endif // HURRICANE_SPLITTERCONTACTS + +// **************************************************************************************************** +// Copyright (C) SILVACO & BULL S.A. 2000-2002 All rights reserved +// **************************************************************************************************** diff --git a/nimbus/src/nimbus/Splitters.h b/nimbus/src/nimbus/Splitters.h new file mode 100644 index 00000000..468b0470 --- /dev/null +++ b/nimbus/src/nimbus/Splitters.h @@ -0,0 +1,61 @@ +// +// This file is part of the Coriolis Project. +// Copyright (C) Laboratoire LIP6 - Departement ASIM +// Universite Pierre et Marie Curie +// +// Date : 29/01/2004 +// Author : Hugo Clément + + +#ifndef __NIMBUS_SPLITTERS__ +#define __NIMBUS_SPLITTERS__ + +#include "hurricane/Collection.h" + +namespace Nimbus { + + using namespace Hurricane; + + class Splitter; + + + +// **************************************************************************************************** +// Splitters declaration +// **************************************************************************************************** + +typedef GenericCollection Splitters; + + + +// **************************************************************************************************** +// SplitterLocator declaration +// **************************************************************************************************** + +typedef GenericLocator SplitterLocator; + + + +// **************************************************************************************************** +// SplitterFilter declaration +// **************************************************************************************************** + +typedef GenericFilter SplitterFilter; + + + +// **************************************************************************************************** +// for_each_splitter declaration +// **************************************************************************************************** + +#define for_each_splitter(splitter, splitters)\ +/******************************************/\ +{\ + SplitterLocator _locator = splitters.getLocator();\ + while (_locator.isValid()) {\ + Splitter* splitter = _locator.getElement();\ + _locator.progress(); + + +} +#endif // __NIMBUS_SPLITTERS__ diff --git a/nimbus/src/nimbus/StepProperty.h b/nimbus/src/nimbus/StepProperty.h new file mode 100644 index 00000000..96e9278f --- /dev/null +++ b/nimbus/src/nimbus/StepProperty.h @@ -0,0 +1,55 @@ +// +// This file is part of the Coriolis Project. +// Copyright (C) Laboratoire LIP6 - Departement ASIM +// Universite Pierre et Marie Curie +// +// Main contributors : +// Christophe Alexandre +// Sophie Belloeil +// Hugo Clément +// Jean-Paul Chaput +// Damien Dupuis +// Christian Masson +// Marek Sroka +// +// The Coriolis Project is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation; either version 2 of the +// License, or (at your option) any later version. +// +// The Coriolis Project is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with the Coriolis Project; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// +// License-Tag +// +// +// Date : 29/01/2004 +// Author : Hugo Clément +// +// Authors-Tag + + +#ifndef __NIMBUS_STEP_PROPERTY_H__ +#define __NIMBUS_STEP_PROPERTY_H__ + +namespace Hurricane { + class Instance; +} + +namespace Nimbus { + + using Hurricane::Instance; + + extern unsigned getStep(const Instance& instance); + extern void setStep(Instance& instance, unsigned step); + +} + +#endif /* __STEPPROPS_H__ */ diff --git a/nimbus/src/nimbus/VFence.h b/nimbus/src/nimbus/VFence.h new file mode 100644 index 00000000..53a66240 --- /dev/null +++ b/nimbus/src/nimbus/VFence.h @@ -0,0 +1,97 @@ +// +// This file is part of the Coriolis Project. +// Copyright (C) Laboratoire LIP6 - Departement ASIM +// Universite Pierre et Marie Curie +// +// Main contributors : +// Christophe Alexandre +// Sophie Belloeil +// Hugo Clément +// Jean-Paul Chaput +// Damien Dupuis +// Christian Masson +// Marek Sroka +// +// The Coriolis Project is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation; either version 2 of the +// License, or (at your option) any later version. +// +// The Coriolis Project is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with the Coriolis Project; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// +// License-Tag +// +// +// Date : 29/01/2004 +// Author : Hugo Clément +// +// Authors-Tag + + +#ifndef __NIMBUS_VFENCE_H__ +#define __NIMBUS_VFENCE_H__ + +#include "hurricane/DbU.h" +#include "nimbus/Fence.h" + +namespace Nimbus { + +class GCell; + +class VFence : public Fence { + + public: + typedef Fence Inherit; + + private: + GCell* _gcleft; + GCell* _gcright; + + protected: + VFence (Grid* grid, GCell* gcleft = NULL, GCell* gcright = NULL); + ~VFence(); + + public: + static VFence* create (Grid* grid, GCell* gcleft, GCell* gcright); + + virtual void _postCreate(); + //virtual void _preDestroy(); + + virtual GCell* getLeftGCell() const { return _gcleft; }; + virtual GCell* getRightGCell() const { return _gcright; }; + + virtual GCell* getGCell1() const { return getLeftGCell(); }; + virtual GCell* getGCell2() const { return getRightGCell(); }; + + virtual DbU::Unit getX() const; + virtual DbU::Unit getY() const; + virtual DbU::Unit getYMin() const; + virtual DbU::Unit getYMax() const; + virtual Point getP1() const; + virtual Point getP2() const; + virtual DbU::Unit getXCenter() const; + virtual DbU::Unit getYCenter() const; + virtual Point getCenter() const; + + virtual bool isHorizontal() { return true; }; + virtual bool isVertical() { return false; }; + + virtual void computeCapacity(); + + virtual void _moveTo (DbU::Unit target); + + virtual Record* _getRecord() const; + virtual string _getString() const; + virtual string _getTypeName() const {return _TName("VFence");}; +}; + +} +#endif diff --git a/solstice/CMakeLists.txt b/solstice/CMakeLists.txt index 7a822268..5d67c22d 100644 --- a/solstice/CMakeLists.txt +++ b/solstice/CMakeLists.txt @@ -1,11 +1,11 @@ +# -*- mode: CMAKE explicit-buffer-name: "CMakeLists.txt" -*- project(SOLSTICE) cmake_minimum_required(VERSION 2.4.0) - list(INSERT CMAKE_MODULE_PATH 0 "${DESTDIR}/$ENV{BOOTSTRAP_TOP}/share/cmake/Modules/") + list(INSERT CMAKE_MODULE_PATH 0 "${DESTDIR}/$ENV{CORIOLIS_TOP}/share/cmake/Modules/") find_package(Bootstrap REQUIRED) - setup_project_paths(VLSISAPD) setup_project_paths(CORIOLIS) set_cmake_policies() diff --git a/stratus1/CMakeLists.txt b/stratus1/CMakeLists.txt index 8dd4130b..8351f64c 100644 --- a/stratus1/CMakeLists.txt +++ b/stratus1/CMakeLists.txt @@ -1,12 +1,12 @@ +# -*- mode: CMAKE explicit-buffer-name: "CMakeLists.txt" -*- project(STRATUS1) option(BUILD_DOC "Build the documentation (latex2html)" OFF) cmake_minimum_required(VERSION 2.4.0) - list(INSERT CMAKE_MODULE_PATH 0 "${DESTDIR}/$ENV{BOOTSTRAP_TOP}/share/cmake/Modules/") + list(INSERT CMAKE_MODULE_PATH 0 "${DESTDIR}/$ENV{CORIOLIS_TOP}/share/cmake/Modules/") find_package(Bootstrap REQUIRED) - setup_project_paths(VLSISAPD) setup_project_paths(CORIOLIS) find_package(Bootstrap REQUIRED) diff --git a/unicorn/CMakeLists.txt b/unicorn/CMakeLists.txt index 09b0ef5b..084b062d 100644 --- a/unicorn/CMakeLists.txt +++ b/unicorn/CMakeLists.txt @@ -1,11 +1,11 @@ +# -*- mode: CMAKE explicit-buffer-name: "CMakeLists.txt" -*- project(UNICORN) cmake_minimum_required(VERSION 2.4.0) - list(INSERT CMAKE_MODULE_PATH 0 "${DESTDIR}/$ENV{BOOTSTRAP_TOP}/share/cmake/Modules/") + list(INSERT CMAKE_MODULE_PATH 0 "${DESTDIR}/$ENV{CORIOLIS_TOP}/share/cmake/Modules/") find_package(Bootstrap REQUIRED) - setup_project_paths(VLSISAPD) setup_project_paths(CORIOLIS) set_cmake_policies() diff --git a/vlsisapd/CMakeLists.txt b/vlsisapd/CMakeLists.txt index e51dcc7c..932fe8ee 100644 --- a/vlsisapd/CMakeLists.txt +++ b/vlsisapd/CMakeLists.txt @@ -1,11 +1,13 @@ +# -*- mode: CMAKE explicit-buffer-name: "CMakeLists.txt" -*- project(VLSISAPD) cmake_minimum_required(VERSION 2.4.0) - list(INSERT CMAKE_MODULE_PATH 0 "${DESTDIR}/$ENV{BOOTSTRAP_TOP}/share/cmake/Modules/") + list(INSERT CMAKE_MODULE_PATH 0 "${DESTDIR}/$ENV{CORIOLIS_TOP}/share/cmake/Modules/") find_package(Bootstrap REQUIRED) list(INSERT CMAKE_MODULE_PATH 0 "${VLSISAPD_SOURCE_DIR}/cmake_modules/") + print_cmake_module_path() set_cmake_policies() setup_boost(program_options python regex) diff --git a/vlsisapd/cmake_modules/FindVLSISAPD.cmake b/vlsisapd/cmake_modules/FindVLSISAPD.cmake index 35b82a08..af82620f 100644 --- a/vlsisapd/cmake_modules/FindVLSISAPD.cmake +++ b/vlsisapd/cmake_modules/FindVLSISAPD.cmake @@ -5,81 +5,57 @@ # VLSISAPD_INCLUDE_DIR - the VLSISAPD include directory # VLSISAPD_LIBRARIES - The libraries needed to use VLSISAPD -SET(VLSISAPD_FOUND FALSE) + set(VLSISAPD_FOUND FALSE) + setup_search_dir(CORIOLIS) -# Setup the DIR_SEARCH_PATH. -MACRO(SETUP_SEARCH_DIR project) - IF( NOT("$ENV{${project}_TOP}" STREQUAL "") ) - MESSAGE("-- ${project}_TOP is set to $ENV{${project}_TOP}") - LIST(INSERT ${project}_DIR_SEARCH 0 "${DESTDIR}$ENV{${project}_TOP}") - ENDIF( NOT("$ENV{${project}_TOP}" STREQUAL "") ) + if(CORIOLIS_DIR_SEARCH) + #MESSAGE("-- CORIOLIS_DIR_SEARCH: ${CORIOLIS_DIR_SEARCH}") - IF( NOT("$ENV{${project}_USER_TOP}" STREQUAL "") ) - MESSAGE("-- ${project}_USER_TOP is set to $ENV{${project}_USER_TOP}") - LIST(INSERT ${project}_DIR_SEARCH 0 "${DESTDIR}$ENV{${project}_USER_TOP}") - ENDIF( NOT("$ENV{${project}_USER_TOP}" STREQUAL "") ) - - LIST(REMOVE_DUPLICATES ${project}_DIR_SEARCH) -ENDMACRO(SETUP_SEARCH_DIR project) - -MACRO(SET_FOUND project) - IF(${project}_INCLUDE_DIR AND ${project}_LIBRARY) - SET(${project}_FOUND TRUE) - ELSE(${project}_INCLUDE_DIR AND ${project}_LIBRARY) - SET(${project}_FOUND FALSE) - ENDIF(${project}_INCLUDE_DIR AND ${project}_LIBRARY) -ENDMACRO(SET_FOUND project) - -SETUP_SEARCH_DIR(VLSISAPD) - -IF(VLSISAPD_DIR_SEARCH) - #MESSAGE("-- VLSISAPD_DIR_SEARCH: ${VLSISAPD_DIR_SEARCH}") - - # Utilities - FIND_PATH (UTILITIES_INCLUDE_DIR NAMES vlsisapd/utilities/Path.h PATHS ${VLSISAPD_DIR_SEARCH} PATH_SUFFIXES include) - FIND_LIBRARY(UTILITIES_LIBRARY NAMES vlsisapdutils PATHS ${VLSISAPD_DIR_SEARCH} PATH_SUFFIXES lib${LIB_SUFFIX}) - SET_FOUND (UTILITIES) - MESSAGE("-- Utilities: ${UTILITIES_LIBRARY}") + # Utilities + FIND_PATH (UTILITIES_INCLUDE_DIR NAMES vlsisapd/utilities/Path.h PATHS ${CORIOLIS_DIR_SEARCH} PATH_SUFFIXES include) + FIND_LIBRARY(UTILITIES_LIBRARY NAMES vlsisapdutils PATHS ${CORIOLIS_DIR_SEARCH} PATH_SUFFIXES lib${LIB_SUFFIX}) + SET_FOUND (UTILITIES) + MESSAGE("-- Utilities: ${UTILITIES_LIBRARY}") # AGDS - FIND_PATH (AGDS_INCLUDE_DIR NAMES vlsisapd/agds/GdsLibrary.h PATHS ${VLSISAPD_DIR_SEARCH} PATH_SUFFIXES include) - FIND_LIBRARY(AGDS_LIBRARY NAMES agds PATHS ${VLSISAPD_DIR_SEARCH} PATH_SUFFIXES lib${LIB_SUFFIX}) + FIND_PATH (AGDS_INCLUDE_DIR NAMES vlsisapd/agds/GdsLibrary.h PATHS ${CORIOLIS_DIR_SEARCH} PATH_SUFFIXES include) + FIND_LIBRARY(AGDS_LIBRARY NAMES agds PATHS ${CORIOLIS_DIR_SEARCH} PATH_SUFFIXES lib${LIB_SUFFIX}) SET_FOUND (AGDS) MESSAGE("-- AGDS: ${AGDS_LIBRARY}") # CIF - FIND_PATH (CIF_INCLUDE_DIR NAMES vlsisapd/cif/Circuit.h PATHS ${VLSISAPD_DIR_SEARCH} PATH_SUFFIXES include) - FIND_LIBRARY(CIF_LIBRARY NAMES cif PATHS ${VLSISAPD_DIR_SEARCH} PATH_SUFFIXES lib${LIB_SUFFIX}) + FIND_PATH (CIF_INCLUDE_DIR NAMES vlsisapd/cif/Circuit.h PATHS ${CORIOLIS_DIR_SEARCH} PATH_SUFFIXES include) + FIND_LIBRARY(CIF_LIBRARY NAMES cif PATHS ${CORIOLIS_DIR_SEARCH} PATH_SUFFIXES lib${LIB_SUFFIX}) SET_FOUND (CIF) MESSAGE("-- Cif: ${CIF_LIBRARY}") # OPENCHAMS - FIND_PATH (OPENCHAMS_INCLUDE_DIR NAMES vlsisapd/openChams/Circuit.h PATHS ${VLSISAPD_DIR_SEARCH} PATH_SUFFIXES include) - FIND_LIBRARY(OPENCHAMS_LIBRARY NAMES openChams PATHS ${VLSISAPD_DIR_SEARCH} PATH_SUFFIXES lib${LIB_SUFFIX}) + FIND_PATH (OPENCHAMS_INCLUDE_DIR NAMES vlsisapd/openChams/Circuit.h PATHS ${CORIOLIS_DIR_SEARCH} PATH_SUFFIXES include) + FIND_LIBRARY(OPENCHAMS_LIBRARY NAMES openChams PATHS ${CORIOLIS_DIR_SEARCH} PATH_SUFFIXES lib${LIB_SUFFIX}) SET_FOUND (OPENCHAMS) MESSAGE("-- OPENCHAMS: ${OPENCHAMS_LIBRARY}") # DTR - FIND_PATH (DTR_INCLUDE_DIR NAMES vlsisapd/dtr/Techno.h PATHS ${VLSISAPD_DIR_SEARCH} PATH_SUFFIXES include) - FIND_LIBRARY(DTR_LIBRARY NAMES dtr PATHS ${VLSISAPD_DIR_SEARCH} PATH_SUFFIXES lib${LIB_SUFFIX}) + FIND_PATH (DTR_INCLUDE_DIR NAMES vlsisapd/dtr/Techno.h PATHS ${CORIOLIS_DIR_SEARCH} PATH_SUFFIXES include) + FIND_LIBRARY(DTR_LIBRARY NAMES dtr PATHS ${CORIOLIS_DIR_SEARCH} PATH_SUFFIXES lib${LIB_SUFFIX}) SET_FOUND (DTR) MESSAGE("-- DTR: ${DTR_LIBRARY}") # SPICE - FIND_PATH (SPICE_INCLUDE_DIR NAMES vlsisapd/spice/Circuit.h PATHS ${VLSISAPD_DIR_SEARCH} PATH_SUFFIXES include) - FIND_LIBRARY(SPICE_LIBRARY NAMES spice PATHS ${VLSISAPD_DIR_SEARCH} PATH_SUFFIXES lib${LIB_SUFFIX}) + FIND_PATH (SPICE_INCLUDE_DIR NAMES vlsisapd/spice/Circuit.h PATHS ${CORIOLIS_DIR_SEARCH} PATH_SUFFIXES include) + FIND_LIBRARY(SPICE_LIBRARY NAMES spice PATHS ${CORIOLIS_DIR_SEARCH} PATH_SUFFIXES lib${LIB_SUFFIX}) SET_FOUND (SPICE) MESSAGE("-- SPICE: ${SPICE_LIBRARY}") # Bookshelf - FIND_PATH (BOOKSHELF_INCLUDE_DIR NAMES vlsisapd/bookshelf/Circuit.h PATHS ${VLSISAPD_DIR_SEARCH} PATH_SUFFIXES include) - FIND_LIBRARY(BOOKSHELF_LIBRARY NAMES bookshelf PATHS ${VLSISAPD_DIR_SEARCH} PATH_SUFFIXES lib${LIB_SUFFIX}) + FIND_PATH (BOOKSHELF_INCLUDE_DIR NAMES vlsisapd/bookshelf/Circuit.h PATHS ${CORIOLIS_DIR_SEARCH} PATH_SUFFIXES include) + FIND_LIBRARY(BOOKSHELF_LIBRARY NAMES bookshelf PATHS ${CORIOLIS_DIR_SEARCH} PATH_SUFFIXES lib${LIB_SUFFIX}) SET_FOUND (BOOKSHELF) MESSAGE("-- Bookshelf: ${BOOKSHELF_LIBRARY}") # Configuration - FIND_PATH (CONFIGURATION_INCLUDE_DIR NAMES vlsisapd/configuration/ConfigurationWidget.h PATHS ${VLSISAPD_DIR_SEARCH} PATH_SUFFIXES include) - FIND_LIBRARY(CONFIGURATION_LIBRARY NAMES configuration PATHS ${VLSISAPD_DIR_SEARCH} PATH_SUFFIXES lib${LIB_SUFFIX}) + FIND_PATH (CONFIGURATION_INCLUDE_DIR NAMES vlsisapd/configuration/ConfigurationWidget.h PATHS ${CORIOLIS_DIR_SEARCH} PATH_SUFFIXES include) + FIND_LIBRARY(CONFIGURATION_LIBRARY NAMES configuration PATHS ${CORIOLIS_DIR_SEARCH} PATH_SUFFIXES lib${LIB_SUFFIX}) SET_FOUND (CONFIGURATION) MESSAGE("-- Configuration: ${CONFIGURATION_LIBRARY}") @@ -88,13 +64,13 @@ IF(VLSISAPD_DIR_SEARCH) ELSE(AGDS_FOUND OR CIF_FOUND OR OPENCHAMS_FOUND OR DTR_FOUND OR SPICE_FOUND) SET(VLSISAPD_FOUND FALSE) ENDIF(AGDS_FOUND OR CIF_FOUND OR OPENCHAMS_FOUND OR DTR_FOUND OR SPICE_FOUND) -ELSE(VLSISAPD_DIR_SEARCH) - MESSAGE("-- Cannot find VLSISAPD_LIBRARIES since VLSISAPD_DIR_SEARCH is not defined.") -ENDIF(VLSISAPD_DIR_SEARCH) +ELSE(CORIOLIS_DIR_SEARCH) + MESSAGE("-- Cannot find VLSISAPD_LIBRARIES since CORIOLIS_DIR_SEARCH is not defined.") +ENDIF(CORIOLIS_DIR_SEARCH) IF (NOT VLSISAPD_FOUND) SET(VLSISAPD_MESSAGE - "VLSISAPD libraries were not found. Make sure VLSISAPD_TOP env variable is set.") + "VLSISAPD libraries were not found. Make sure CORIOLIS_TOP env variable is set.") IF (NOT VLSISAPD_FIND_QUIETLY) MESSAGE(STATUS "${VLSISAPD_MESSAGE}") ELSE(NOT VLSISAPD_FIND_QUIETLY) @@ -103,6 +79,6 @@ IF (NOT VLSISAPD_FOUND) ENDIF(VLSISAPD_FIND_REQUIRED) ENDIF(NOT VLSISAPD_FIND_QUIETLY) ELSE (NOT VLSISAPD_FOUND) - MESSAGE(STATUS "VLSISAPD library was found in ${VLSISAPD_DIR_SEARCH}") + MESSAGE(STATUS "VLSISAPD library was found in ${CORIOLIS_DIR_SEARCH}") ENDIF (NOT VLSISAPD_FOUND)