From e354b3ac4bca8abb7aeddaadec428d2471e832d0 Mon Sep 17 00:00:00 2001 From: Las Safin Date: Fri, 3 Sep 2021 13:48:01 +0000 Subject: [PATCH] Fix stratus1 --- nix/stratus1.nix | 33 +++++++------ stratus1/CMakeLists.txt | 4 +- stratus1/src/stratus/stratus.py | 82 ++++++++++++++------------------- 3 files changed, 55 insertions(+), 64 deletions(-) diff --git a/nix/stratus1.nix b/nix/stratus1.nix index 8e2647f3..8915752a 100644 --- a/nix/stratus1.nix +++ b/nix/stratus1.nix @@ -1,18 +1,21 @@ -{ version, meta }: +{ generic, ... }: -{ lib, stdenv, cmake, ninja, python2, qt4, coriolis-crlcore -, coriolis-bootstrap, coriolis-vlsisapd, coriolis-hurricane }: +let pkg = + { lib, coriolis-crlcore, coriolis-vlsisapd, coriolis-hurricane + , python2Packages, coriolis-cumulus }: + { + name = "coriolis-stratus1"; + src = ../stratus1; -stdenv.mkDerivation { - pname = "coriolis-stratus1"; + propagatedBuildInputs = [ + coriolis-vlsisapd coriolis-crlcore coriolis-hurricane coriolis-cumulus + ]; + postInstall = '' + ln -s -t $out/${python2Packages.python.sitePackages} \ + $out/${python2Packages.python.sitePackages}/stratus/* + ''; + pythonImportsCheck = [ "stratus" "patterns" "patread" "synopsys" "utils" "util" ]; - src = ../stratus1; - - buildInputs = [ - python2 coriolis-bootstrap coriolis-vlsisapd - coriolis-crlcore coriolis-hurricane qt4 - ]; - nativeBuildInputs = [ cmake ninja ]; - - inherit version meta; -} + meta.license = lib.licenses.gpl2; + }; +in generic pkg diff --git a/stratus1/CMakeLists.txt b/stratus1/CMakeLists.txt index 18969ad6..9ad4ef38 100644 --- a/stratus1/CMakeLists.txt +++ b/stratus1/CMakeLists.txt @@ -20,9 +20,9 @@ find_package(PythonLibs 2 REQUIRED) find_package(PythonSitePackages REQUIRED) - find_package(VLSISAPD REQUIRED) + find_package(VLSISAPD REQUIRED) find_package(HURRICANE REQUIRED) - find_package(CORIOLIS REQUIRED) + find_package(CORIOLIS REQUIRED) add_subdirectory(src) add_subdirectory(etc) diff --git a/stratus1/src/stratus/stratus.py b/stratus1/src/stratus/stratus.py index c2a3e8d5..dd011e3d 100644 --- a/stratus1/src/stratus/stratus.py +++ b/stratus1/src/stratus/stratus.py @@ -14,57 +14,45 @@ # +-----------------------------------------------------------------+ -try: - import sys - import traceback - import Cfg - import CRL +import sys +import traceback +import Cfg +import CRL - # Triggers the default configuration files loading. - CRL.AllianceFramework.get() +# Triggers the default configuration files loading. +CRL.AllianceFramework.get() - Cfg.Configuration.pushDefaultPriority(Cfg.Parameter.Priority.ApplicationBuiltin) - Cfg.getParamString('stratus1.format' ).setString('vst') - Cfg.getParamString('stratus1.simulator').setString('asimut') - Cfg.Configuration.popDefaultPriority() +Cfg.Configuration.pushDefaultPriority(Cfg.Parameter.Priority.ApplicationBuiltin) +Cfg.getParamString('stratus1.format' ).setString('vst') +Cfg.getParamString('stratus1.simulator').setString('asimut') +Cfg.Configuration.popDefaultPriority() - print ' o Stratus Configuration:' - print ' - Netlist format: <%s>.' % Cfg.getParamString('stratus1.format').asString() - print ' - Simulator: <%s>.' % Cfg.getParamString('stratus1.simulator').asString() - - from Hurricane import UpdateSession - from st_model import * - from st_net import * - from st_instance import * - from st_placement import * - #from st_placeAndRoute import * - from st_ref import * - from st_generate import * - from st_const import * - from st_cat import * - from st_param import * - from st_getrealmodel import GetWeightTime, GetWeightArea, GetWeightPower - - from util_Const import * - from util_Defs import * - from util_Misc import * - from util_Gen import * - from util_Shift import * - from util_uRom import * - from util import * - - from patterns import * -except ImportError, e: - module = str(e).split()[-1] +print ' o Stratus Configuration:' +print ' - Netlist format: <%s>.' % Cfg.getParamString('stratus1.format').asString() +print ' - Simulator: <%s>.' % Cfg.getParamString('stratus1.simulator').asString() - print '[ERROR] The <%s> python module or symbol cannot be loaded.' % module - print ' Please check the integrity of the package.' - sys.exit(1) -except Exception, e: - print '[ERROR] A strange exception occurred while loading the basic Coriolis/Python' - print ' modules. Something may be wrong at Python/C API level.\n' - print ' %s' % e - sys.exit(2) +from Hurricane import UpdateSession +from st_model import * +from st_net import * +from st_instance import * +from st_placement import * +#from st_placeAndRoute import * +from st_ref import * +from st_generate import * +from st_const import * +from st_cat import * +from st_param import * +from st_getrealmodel import GetWeightTime, GetWeightArea, GetWeightPower + +from util_Const import * +from util_Defs import * +from util_Misc import * +from util_Gen import * +from util_Shift import * +from util_uRom import * +from util import * + +from patterns import * DoNetlist = 0x00000001