ecic 0.2.2 → 0.3.0
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.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/ecic.rb +1 -0
- data/lib/ecic/cli.rb +14 -0
- data/lib/ecic/library.rb +18 -0
- data/lib/ecic/library_generator.rb +1 -1
- data/lib/ecic/project.rb +31 -0
- data/lib/ecic/version.rb +1 -1
- data/notes.txt +4 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2a216371da32fdac9361a74bec2731d155686754f57b0d36a8568eb5c48caf1d
|
4
|
+
data.tar.gz: 90920997e9a82cdeb267d83b18fe3a685198ffa0aa2be1c1898775d84f2a6267
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6e121298d8fbb508c1ea7215e7aa346162b34bc75778612835018fd6104267c8ac270c5c3cd6c74e55c437a2641aa19e93768c469ca0b0084e15e0886dbe0caa
|
7
|
+
data.tar.gz: 034ca0e7b15f88814183258af18f825f1f0b2b916857dc6876cf4f6de3b206e0789561e1cf1bd81b45c8e49b1fe774b9a36e9c97c68998de7c36d85bcb47a112
|
data/Gemfile.lock
CHANGED
data/lib/ecic.rb
CHANGED
data/lib/ecic/cli.rb
CHANGED
@@ -76,6 +76,20 @@ module Ecic
|
|
76
76
|
def version
|
77
77
|
say "#{VERSION}"
|
78
78
|
end
|
79
|
+
|
80
|
+
#--------------------------------------------------------------------------
|
81
|
+
# LIBRARIES command:
|
82
|
+
#--------------------------------------------------------------------------
|
83
|
+
desc 'libraries', 'Display list of libraries in your project'
|
84
|
+
def libraries
|
85
|
+
root_dir = Project::root
|
86
|
+
shell.error "You must be within an ECIC project before calling this command" if root_dir.nil?
|
87
|
+
library_cfg_file = Project::library_cfg_file(root_dir)
|
88
|
+
project = Project.new
|
89
|
+
project.load_libraries(library_cfg_file)
|
90
|
+
say project.libraries { |lib| "#{lib.to_s}" }.join("\n")
|
91
|
+
end
|
92
|
+
|
79
93
|
end
|
80
94
|
end
|
81
95
|
|
data/lib/ecic/library.rb
ADDED
@@ -18,7 +18,7 @@ module Ecic
|
|
18
18
|
libraries_file = File.expand_path("#{destination_root}/src/config/libraries.rb")
|
19
19
|
empty_directory 'src/config' unless File.exist?(File.dirname(libraries_file))
|
20
20
|
create_file libraries_file unless File.exist?(libraries_file)
|
21
|
-
append_to_file 'src/config/libraries.rb', "
|
21
|
+
append_to_file 'src/config/libraries.rb', "\nlibrary.create('#{@library_name}')"
|
22
22
|
end
|
23
23
|
|
24
24
|
end
|
data/lib/ecic/project.rb
CHANGED
@@ -2,9 +2,20 @@ module Ecic
|
|
2
2
|
|
3
3
|
class Project
|
4
4
|
|
5
|
+
attr_accessor :libraries
|
6
|
+
|
5
7
|
require 'pathname'
|
8
|
+
|
9
|
+
def initialize
|
10
|
+
@libraries = []
|
11
|
+
end
|
6
12
|
|
7
13
|
SCRIPT_ECIC = File.join('src', 'config', 'ecic.rb')
|
14
|
+
LIBRARIES_CFG_SCRIPT = File.join('src', 'config', 'libraries.rb')
|
15
|
+
|
16
|
+
def self.library_cfg_file(root = Project::root)
|
17
|
+
File.join(root, LIBRARIES_CFG_SCRIPT)
|
18
|
+
end
|
8
19
|
|
9
20
|
#Function that returns the root directory of a ECIC project
|
10
21
|
def self.root(path = Pathname.new(Dir.pwd))
|
@@ -15,6 +26,26 @@ module Ecic
|
|
15
26
|
end
|
16
27
|
return root(path.parent)
|
17
28
|
end
|
29
|
+
|
30
|
+
def load_libraries(lib_file)
|
31
|
+
if File.exists?(lib_file)
|
32
|
+
puts "Reading #{lib_file}"
|
33
|
+
eval File.read(lib_file)
|
34
|
+
else
|
35
|
+
raise "Could not read library definitions from #{lib_file}"
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
39
|
+
|
40
|
+
def add_libray(name)
|
41
|
+
@libraries << Library.new(name)
|
42
|
+
end
|
43
|
+
|
44
|
+
def library
|
45
|
+
new_lib = Library.new()
|
46
|
+
libraries << new_lib
|
47
|
+
new_lib
|
48
|
+
end
|
18
49
|
|
19
50
|
end
|
20
51
|
end
|
data/lib/ecic/version.rb
CHANGED
data/notes.txt
CHANGED
@@ -4,3 +4,7 @@ add design chip, :env => ['asic_rtl', 'asic_gate', 'fpga_rtl']
|
|
4
4
|
add design [basic_vhdl, chip], :except => {:env => ['asic']}
|
5
5
|
#add design chip_tb, :path => '/some/absolute/path'
|
6
6
|
#add testbench chip_tb, :path => '/some/absolute/path'
|
7
|
+
#Libraries can be added in libraries.rb with two different syntaxes, eg.:
|
8
|
+
library.create('lib_x')
|
9
|
+
and
|
10
|
+
libraries << Library.new('lib_z')
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ecic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Torben Fox Jacobsen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-10-
|
11
|
+
date: 2018-10-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -142,6 +142,7 @@ files:
|
|
142
142
|
- lib/ecic/completion.rb
|
143
143
|
- lib/ecic/generate.rb
|
144
144
|
- lib/ecic/help.rb
|
145
|
+
- lib/ecic/library.rb
|
145
146
|
- lib/ecic/library_generator.rb
|
146
147
|
- lib/ecic/project.rb
|
147
148
|
- lib/ecic/project_generator.rb
|