fhlow 1.91.0 → 1.91.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/bin/fhlow +58 -10
- data/lib/module_config/complexitem.rb +57 -0
- data/lib/module_config/config.rb +5 -3
- data/lib/module_config/item.rb +0 -4
- data/lib/module_config/items/complex.rb +44 -0
- data/lib/module_config/items/complexfreqencies.rb +59 -0
- data/lib/module_config/items/complexlibrary.rb +46 -0
- data/lib/module_config/items/complexpackage.rb +47 -0
- data/lib/module_config/items/complexpins.rb +59 -0
- data/lib/module_config/items/complexunit.rb +53 -0
- data/lib/module_config/items/simple.rb +29 -0
- data/lib/module_config/items/simplearchitecture.rb +34 -0
- data/lib/module_config/items/simplebindir.rb +31 -0
- data/lib/module_config/items/simplebool.rb +24 -0
- data/lib/module_config/items/simplepostlayoutsdf.rb +24 -0
- data/lib/module_config/items/simplesimulaterun.rb +25 -0
- data/lib/module_config/items/simpleverbose.rb +33 -0
- data/lib/module_config/section.rb +16 -4
- data/lib/module_config/simpleitem.rb +37 -0
- data/lib/module_config/test.flw +33 -12
- data/lib/module_config/test.rb +54 -4
- data/lib/module_config/unittests/config_test.rb +15 -12
- data/lib/module_fhlow/leaf.rb +28 -24
- data/lib/module_fhlow/leafs/Library.rb +60 -0
- data/lib/module_fhlow/leafs/Package.rb +4 -1
- data/lib/module_fhlow/leafs/Unit.rb +9 -1
- data/lib/module_fhlow/node.rb +4 -5
- data/lib/module_fhlow/plugin.rb +11 -0
- data/lib/module_fhlow/pluginpool.rb +17 -5
- data/lib/module_fhlow/rootnode.rb +4 -3
- data/lib/plugins/Modelsim.flw +18 -0
- data/lib/plugins/Modelsim.rb +331 -0
- data/lib/plugins/Quartus.flw +5 -0
- data/lib/plugins/Quartus.rb +237 -0
- data/tests/testsuite.rb +0 -0
- metadata +84 -79
- data/lib/module_config/configitems/complex.rb +0 -71
- data/lib/module_config/configitems/complexpackage.rb +0 -67
- data/lib/module_config/configitems/complexunit.rb +0 -76
- data/lib/module_config/configitems/simple.rb +0 -56
- data/lib/module_config/configitems/simplearchitecture.rb +0 -52
- data/lib/module_config/configitems/simplepackage.rb +0 -47
- data/lib/module_config/configitems/simpleunit.rb +0 -53
- data/lib/module_config/configs.test +0 -24
- data/lib/module_config/tmp +0 -3
- data/lib/module_config/unittests/coverage/-home-simon-tmp-fhlow_v2-flw-core-lib-module_config-configexception_rb.html +0 -647
- data/lib/module_config/unittests/coverage/-home-simon-tmp-fhlow_v2-flw-core-lib-module_config-configitems-complex_rb.html +0 -700
- data/lib/module_config/unittests/coverage/-home-simon-tmp-fhlow_v2-flw-core-lib-module_config-configitems-complexpackage_rb.html +0 -694
- data/lib/module_config/unittests/coverage/-home-simon-tmp-fhlow_v2-flw-core-lib-module_config-configitems-complexunit_rb.html +0 -704
- data/lib/module_config/unittests/coverage/-home-simon-tmp-fhlow_v2-flw-core-lib-module_config-configitems-simple_rb.html +0 -685
- data/lib/module_config/unittests/coverage/-home-simon-tmp-fhlow_v2-flw-core-lib-module_config-configitems-simplepackage_rb.html +0 -676
- data/lib/module_config/unittests/coverage/-home-simon-tmp-fhlow_v2-flw-core-lib-module_config-configitems-simpleunit_rb.html +0 -682
- data/lib/module_config/unittests/coverage/-home-simon-tmp-fhlow_v2-flw-core-lib-module_config-item_rb.html +0 -663
- data/lib/module_config/unittests/coverage/-home-simon-tmp-fhlow_v2-flw-core-lib-module_config-itemfactory_rb.html +0 -687
- data/lib/module_config/unittests/coverage/-home-simon-tmp-fhlow_v2-flw-core-lib-module_config-myconfig_rb.html +0 -687
- data/lib/module_config/unittests/coverage/-home-simon-tmp-fhlow_v2-flw-core-lib-module_config-section_rb.html +0 -692
- data/lib/module_config/unittests/coverage/index.html +0 -689
- data/lib/module_fhlow/leaf.rb~ +0 -202
- data/lib/module_fhlow/test.rb +0 -15
data/lib/module_fhlow/leaf.rb~
DELETED
@@ -1,202 +0,0 @@
|
|
1
|
-
|
2
|
-
#----------------------------------------------------------------------------
|
3
|
-
#
|
4
|
-
# Copyright (C) 2006 Simon Lasselsberger
|
5
|
-
# simon.lasselsberger@fh-hagenberg.at
|
6
|
-
#
|
7
|
-
# This file is part of the _fhlow_ scripting environment.
|
8
|
-
#
|
9
|
-
# The _fhlow_ scripting environment is free software; you can redistribute
|
10
|
-
# it and/or modify it under the terms of the GNU General Public License
|
11
|
-
# as published by the Free Software Foundation; either version 2 of the
|
12
|
-
# License, or (at your option) any later version.
|
13
|
-
#
|
14
|
-
# _fhlow_ is distributed in the hope that it will be useful,
|
15
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
16
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
17
|
-
# GNU General Public License for more details.
|
18
|
-
#
|
19
|
-
# You should have received a copy of the GNU General Public License
|
20
|
-
# along with _fhlow_; if not, write to the Free Software
|
21
|
-
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
22
|
-
#
|
23
|
-
#----------------------------------------------------------------------------
|
24
|
-
|
25
|
-
require 'fhlowexception'
|
26
|
-
require 'config'
|
27
|
-
|
28
|
-
module Fhlow
|
29
|
-
|
30
|
-
# Leaf's are fhlows major objects. They are created while parsing the directory
|
31
|
-
# structure as children of Node's. A Leaf holds informations about its dependencies
|
32
|
-
# which are also Leaf's.
|
33
|
-
# Leaf is an _acstract_ class, so there have to be subclasses in order to create
|
34
|
-
# Leaf objects.
|
35
|
-
class Leaf
|
36
|
-
# The name of the Leaf
|
37
|
-
attr_reader :name
|
38
|
-
|
39
|
-
# The prefix of the Leaf.
|
40
|
-
attr_reader :prefix
|
41
|
-
|
42
|
-
# The configuration container.
|
43
|
-
attr_reader :conf
|
44
|
-
|
45
|
-
protected
|
46
|
-
# Initializes the class valiables and loads the config file.
|
47
|
-
# +_prefix+:: The prefix of the Leaf.
|
48
|
-
# +_name+:: The Name of the Leaf.
|
49
|
-
# +_parent+:: The reference to the parent.
|
50
|
-
# +_conf+:: The configuration information from higher levels.
|
51
|
-
# +_log+:: The reference to the Log object.
|
52
|
-
# +_pen+:: The reference to a Pen object.
|
53
|
-
def initialize(_prefix, _name, _parent, _log, _pen)
|
54
|
-
@name = _name
|
55
|
-
@dependencies = Hash.new # a list of objects that leaf depends on
|
56
|
-
@parent = _parent
|
57
|
-
@conf = nil
|
58
|
-
@prefix = _prefix
|
59
|
-
@log = _log
|
60
|
-
@pen = _pen
|
61
|
-
|
62
|
-
if File.exist?(@parent.getPath+@prefix+@name+"/config.flw")
|
63
|
-
@conf = Config::Config.new(@parent.getPath+@prefix+@name+"/config.flw")
|
64
|
-
# inherit the configurations from previous levels
|
65
|
-
@conf.merge(@parent.conf)
|
66
|
-
@log.debug(@prefix+@name, "Sucessfully merged inherited configs from #{@parent.prefix+@parent.name}.")
|
67
|
-
else
|
68
|
-
raise FhlowException.new(@parent.getPath+@prefix+@name, "/config.flw not found.")
|
69
|
-
end
|
70
|
-
|
71
|
-
@log.info(@prefix+@name, "leaf initialized -> #{self}")
|
72
|
-
end
|
73
|
-
|
74
|
-
public
|
75
|
-
# Collects the dependencies by building a list of object references using the
|
76
|
-
# information from the configuration object.
|
77
|
-
# This function is invoked by the _parent_. See RootNode.initialize and Node.fetchDependencies for more
|
78
|
-
# information.
|
79
|
-
def fetchDependencies()
|
80
|
-
|
81
|
-
# there needs to be a [Dependencies] section the config file
|
82
|
-
if @conf["Dependencies"].nil?
|
83
|
-
raise FhlowException.new(getPath, "Couldn't find section [Dependencies] in any config.flw file responsible for this leaf.")
|
84
|
-
end
|
85
|
-
|
86
|
-
# iterate through all items of the [Dependencies] section
|
87
|
-
@conf["Dependencies"].each do |item| # item -> one item of the [Dependencies] section
|
88
|
-
fetchOneDependency(item)
|
89
|
-
end
|
90
|
-
|
91
|
-
dummy = ""
|
92
|
-
@dependencies.each{ |deptype, leafs| dummy += "#{deptype} -> "; leafs.each { |leaf| dummy += "#{leaf.prefix}#{leaf.name} "}; dummy += "; " }
|
93
|
-
@log.debug(@prefix+@name, "direct dependencies: #{dummy}")
|
94
|
-
|
95
|
-
end
|
96
|
-
|
97
|
-
|
98
|
-
# Each configuration item in the [Dependencies] section of the config file is passed to this function in order to
|
99
|
-
# request the coresponding Leaf from the _parent_. If __item_ is is of type Config::ComplexUnit architectures are
|
100
|
-
# also handled.
|
101
|
-
# +_item+:: One item from the section [Dependencies].
|
102
|
-
# == TODO
|
103
|
-
# in die konkreten leafs auslagern
|
104
|
-
def fetchOneDependency(_item)
|
105
|
-
if _item.instance_of?(Config::ComplexUnit)
|
106
|
-
_item.value.each do |value|
|
107
|
-
begin
|
108
|
-
|
109
|
-
if @name == "Cpu"
|
110
|
-
puts "here"
|
111
|
-
end
|
112
|
-
|
113
|
-
leaf = @parent.getLeaf(value["deppath"], value["deppath"].length+1)
|
114
|
-
raise FhlowException.new(@prefix+@name), "requested a Fhlow::Unit but got a #{leaf.class.to_s}!" unless leaf.instance_of?(Unit)
|
115
|
-
leaf.addArchitectures(self, _item.name, value["archs"])
|
116
|
-
raise FhlowException.new(@prefix+@name), "has itself as dependency!" if leaf == self
|
117
|
-
rescue FhlowObjectNotFoundException => e
|
118
|
-
# fetch the exception and add the name of this leaf so the errormessage is more accurate
|
119
|
-
raise FhlowObjectNotFoundException.new(@prefix+@name), "#{e.caller}: #{e.message}"
|
120
|
-
end
|
121
|
-
|
122
|
-
# init the container if it is nil
|
123
|
-
@dependencies[_item.name] = Array.new if @dependencies[_item.name].nil?
|
124
|
-
|
125
|
-
# save the object in the container if it does'nt exist
|
126
|
-
@dependencies[_item.name].push(leaf) unless @dependencies[_item.name].include?(leaf)
|
127
|
-
end
|
128
|
-
|
129
|
-
elsif _item.instance_of?(Config::ComplexPackage)
|
130
|
-
_item.value.each do |value|
|
131
|
-
begin
|
132
|
-
leaf = @parent.getLeaf(value, value.length+1)
|
133
|
-
raise FhlowException.new(@prefix+@name), "has itself as dependency!" if leaf == self
|
134
|
-
rescue FhlowObjectNotFoundException => e
|
135
|
-
# fetch the exception and add the name of this leaf so the errormessage is more accurate
|
136
|
-
raise FhlowObjectNotFoundException.new(@prefix+@name), "#{e.caller}: #{e.message}"
|
137
|
-
end
|
138
|
-
|
139
|
-
# init the container if it is nil
|
140
|
-
@dependencies[_item.name] = Array.new if @dependencies[_item.name].nil?
|
141
|
-
|
142
|
-
# save the object in the container if it does'nt exist
|
143
|
-
@dependencies[_item.name].push(leaf) unless @dependencies[_item.name].include?(leaf)
|
144
|
-
end
|
145
|
-
end
|
146
|
-
end
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
=begin def fetchOneDependency(_name, _value)
|
151
|
-
# this funktion needs to be implemented in an derived class!
|
152
|
-
raise FhlowException.new(self.class), "fetchOneDependency() is not implemented for "+self.class.to_s
|
153
|
-
end
|
154
|
-
=end
|
155
|
-
|
156
|
-
|
157
|
-
# This function returns an Array of filenames in respect of the dependency tree and needs to be implemented
|
158
|
-
# by subclasses.
|
159
|
-
# +_deptype+:: Type of the requested dependencies (could be Units, BhvUnits, Packages and so on)
|
160
|
-
# +_istoplevel+:: Is used to indicate the first entrance to this function.
|
161
|
-
# +_caller+:: Reference to the caller of the function. This is needed to request architectures.
|
162
|
-
# +_files+:: The Array of the files which will be filled with the requested filenames and returned in the end.
|
163
|
-
def getFiles(_deptype, _istoplevel=true, _caller=nil, _files=Array.new)
|
164
|
-
# this funktion needs to be implemented in an derived class!
|
165
|
-
raise FhlowException.new(self.class), "getFiles() is not implemented for "+self.class.to_s
|
166
|
-
end
|
167
|
-
|
168
|
-
# Returns the absolute path in the filesystem by requesting the path from the _parent_ and adding
|
169
|
-
# _prefix_ and _name_.
|
170
|
-
def getPath()
|
171
|
-
@parent.getPath+@prefix+@name+"/"
|
172
|
-
end
|
173
|
-
|
174
|
-
# Prints information about this child.
|
175
|
-
# +_prefix+:: This prefix will be added to the output of ths function.
|
176
|
-
# +_depth+:: The depth of the recursion.
|
177
|
-
# +_caller+:: The reference to the caller.
|
178
|
-
# == TODO
|
179
|
-
# in die konkreten leafs auslagern
|
180
|
-
def printMe(_prefix=" ", _depth=0, _caller=nil)
|
181
|
-
|
182
|
-
if self.instance_of?(Unit)
|
183
|
-
str = ""
|
184
|
-
@pen.puts _prefix, @pen.magenta, @prefix, @name, @pen.clear,
|
185
|
-
@architectures[_depth==0 ? self : _caller].nil? ?
|
186
|
-
"\n" :
|
187
|
-
"( "+(@architectures[_depth==0 ? self : _caller].each { |key, value| str += "#{@pen.blue}#{key}#{@pen.clear} -> #{value.join(", ")}; " }; str+=")")
|
188
|
-
else
|
189
|
-
@pen.print _prefix, @pen.yellow, @prefix, @name, @pen.clear, "\n"
|
190
|
-
end
|
191
|
-
|
192
|
-
@dependencies.each do |deptype, leafs|
|
193
|
-
leafs.each { |leaf| leaf.printMe(_prefix+" ", _depth+1, self) }
|
194
|
-
end if !@dependencies.empty?
|
195
|
-
|
196
|
-
@pen.print "\n" if _depth == 0
|
197
|
-
|
198
|
-
end
|
199
|
-
|
200
|
-
end
|
201
|
-
|
202
|
-
end
|