Commit 46e8171a authored by Tristan Gingold's avatar Tristan Gingold

Refactor: do not use modules_pool.

parent ed6e9881
......@@ -29,7 +29,7 @@ import sys
import logging
from .manifest_parser import ManifestParser
from .module_pool import ModulePool
from .action.core import ActionCore
from ._version import __version__
......@@ -53,10 +53,12 @@ def hdlmake(args):
try:
# Create a ModulePool object, this will become our workspace
modules_pool = ModulePool(options)
action = ActionCore(options)
action.load_top_module()
action.run()
# Execute the appropriated action for the freshly created modules pool
_action_runner(modules_pool)
_action_runner(action)
except Exception as e:
import traceback
logging.error(e)
......
......@@ -70,11 +70,16 @@ class Action(list):
self._deps_solved = False
self.options = options
set_logging_level(options)
def load_top_module(self):
# Top level module.
self.new_module(parent=None,
url=os.getcwd(),
source=None,
fetchto=".")
self.config = self._get_config_dict()
def run(self):
action = self.config.get("action")
if action == None:
self.tool = None
......
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2013-2016 CERN
# Author: Pawel Szostek (pawel.szostek@cern.ch)
# Garcia-Lasheras (javier@garcialasheras.com)
#
# This file is part of Hdlmake.
#
# Hdlmake 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 3 of the License, or
# (at your option) any later version.
#
# Hdlmake 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 Hdlmake. If not, see <http://www.gnu.org/licenses/>.
#
"""This is the Python module providing the container for the HDL Modules"""
from .action import ActionCore, ActionTree
class ModulePool(ActionCore, ActionTree):
"""
The ModulePool class acts as the container for the HDLMake modules that
are progressively being added to the design hierarchy.
"""
def __init__(self, *args):
ActionCore.__init__(self, *args)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment