ecic 0.6.1 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/README.md +1 -3
- data/config/locales/help.en.yaml +7 -3
- data/lib/ecic.rb +1 -0
- data/lib/ecic/cli.rb +39 -28
- data/lib/ecic/file_adder.rb +4 -5
- data/lib/ecic/helpers/library_creation_helper.rb +2 -2
- data/lib/ecic/project_cmd.rb +23 -0
- data/lib/ecic/source_file_info.rb +1 -1
- data/lib/ecic/version.rb +1 -1
- 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: c6b9cbccccd5b2673f19c2784227f75efa75bd5dcaa10ec4255dc761b6633ab6
|
4
|
+
data.tar.gz: 5489f7e5ea4cf76bfc226a04db97770306034fffb3a711f5887d995a5958c64e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2179977315b2f98d5ce51935b28f28ac423a2425ef8bd98ebb71c08fd0fa6efadce9ddaf2daa32cf015300606cbc55998345c08ff59077fc6f77c96fd0673a5
|
7
|
+
data.tar.gz: 64c591e207d601b42861694790e91005eb2b8fff36d9ee22c9d892a4aca340d802c82123dceba1c68f00e9d83c82c268ee758767d6d4d619e3de425b7f285930
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
ecic (0.
|
4
|
+
ecic (0.6.2)
|
5
5
|
activesupport (~> 5.2)
|
6
6
|
colorize (~> 0.8)
|
7
7
|
rake (~> 12.3)
|
@@ -22,7 +22,7 @@ GEM
|
|
22
22
|
concurrent-ruby (1.0.5)
|
23
23
|
diff-lcs (1.3)
|
24
24
|
docile (1.1.5)
|
25
|
-
i18n (1.1.
|
25
|
+
i18n (1.1.1)
|
26
26
|
concurrent-ruby (~> 1.0)
|
27
27
|
json (2.1.0)
|
28
28
|
minitest (5.11.3)
|
data/README.md
CHANGED
@@ -32,7 +32,7 @@ The `ecic new` command creates a new ECIC project with a default directory struc
|
|
32
32
|
|
33
33
|
$ ecic new my_project
|
34
34
|
|
35
|
-
and
|
35
|
+
and then install the dependencies for your new project using Bundler:
|
36
36
|
|
37
37
|
$ cd ./my_project
|
38
38
|
$ bundle install
|
@@ -215,5 +215,3 @@ To install the ECIC framework onto your local machine, run `bundle exec rake ins
|
|
215
215
|
5. Create new Pull Request
|
216
216
|
|
217
217
|
Bug reports and pull requests are most welcome on GitHub at https://github.com/ic-factory/ecic.
|
218
|
-
|
219
|
-
|
data/config/locales/help.en.yaml
CHANGED
@@ -51,9 +51,9 @@ help:
|
|
51
51
|
eval $(ecic completion script)
|
52
52
|
|
53
53
|
addfile:
|
54
|
-
short: Add existing design and testbench files to the project
|
54
|
+
short: Add existing design and testbench files to the project
|
55
55
|
long: |
|
56
|
-
Add one or more existing design files to a given library in the project
|
56
|
+
Add one or more existing design files to a given library in the project
|
57
57
|
|
58
58
|
Example: ecic addfile --lib=my_lib ./foo/bar/some_design.sv ../toto/kuku.vhd
|
59
59
|
|
@@ -66,8 +66,12 @@ help:
|
|
66
66
|
|
67
67
|
If an added file is located outside the project folder, an absolute path will be used by default.
|
68
68
|
|
69
|
+
project:
|
70
|
+
short: Print various information about your project
|
71
|
+
root:
|
72
|
+
short: Print path to the root directory of your project
|
69
73
|
generate:
|
70
|
-
short: Generate new testbenches, RTL modules, tests etc
|
74
|
+
short: Generate new testbenches, RTL modules, tests etc.
|
71
75
|
|
72
76
|
testbench:
|
73
77
|
short: Create a new testbench
|
data/lib/ecic.rb
CHANGED
@@ -24,6 +24,7 @@ module Ecic
|
|
24
24
|
autoload :FileAdder, "ecic/file_adder"
|
25
25
|
autoload :Completion, "ecic/completion"
|
26
26
|
autoload :Completer, "ecic/completer"
|
27
|
+
autoload :ProjectCmd, "ecic/project_cmd"
|
27
28
|
autoload :DesignGenerator, "ecic/design_generator"
|
28
29
|
autoload :SvDesignGenerator, "ecic/sv_design_generator"
|
29
30
|
autoload :ProjectGenerator, "ecic/project_generator"
|
data/lib/ecic/cli.rb
CHANGED
@@ -8,9 +8,10 @@ module Ecic
|
|
8
8
|
shell.say "Usage: ecic COMMAND [ARGS]"
|
9
9
|
shell.say ""
|
10
10
|
super
|
11
|
-
shell.say "
|
11
|
+
shell.say "Commands may be abbreviated, so long as they are unambiguous."
|
12
|
+
shell.say "E.g. 'ecic p r' is short for 'ecic project root'."
|
13
|
+
shell.say "\nTo get more help on a specific command, try 'ecic help [COMMAND]'"
|
12
14
|
end
|
13
|
-
|
14
15
|
end
|
15
16
|
|
16
17
|
check_unknown_options!
|
@@ -48,7 +49,12 @@ module Ecic
|
|
48
49
|
desc "generate SUBCOMMAND ...ARGS", Help.text('generate')['short']
|
49
50
|
subcommand "generate", Generate
|
50
51
|
|
51
|
-
|
52
|
+
#--------------------------------------------------------------------------
|
53
|
+
# PROJECT command:
|
54
|
+
#--------------------------------------------------------------------------
|
55
|
+
desc "project SUBCOMMAND ...ARGS", Help.text('project')['short']
|
56
|
+
subcommand "project", ProjectCmd
|
57
|
+
|
52
58
|
#--------------------------------------------------------------------------
|
53
59
|
# design generator:
|
54
60
|
#--------------------------------------------------------------------------
|
@@ -80,10 +86,8 @@ module Ecic
|
|
80
86
|
shell.error set_color(exc.message, Thor::Shell::Color::RED)
|
81
87
|
exit(3)
|
82
88
|
end
|
83
|
-
|
84
89
|
end
|
85
90
|
|
86
|
-
|
87
91
|
#--------------------------------------------------------------------------
|
88
92
|
# COMPLETION command:
|
89
93
|
#--------------------------------------------------------------------------
|
@@ -109,7 +113,7 @@ module Ecic
|
|
109
113
|
def version
|
110
114
|
say "#{VERSION}"
|
111
115
|
end
|
112
|
-
|
116
|
+
|
113
117
|
#--------------------------------------------------------------------------
|
114
118
|
# LIBRARIES command:
|
115
119
|
#--------------------------------------------------------------------------
|
@@ -118,29 +122,36 @@ module Ecic
|
|
118
122
|
option :format, :type => :string, :banner => 'text|json', :desc => 'Specify the output format'
|
119
123
|
option :include_source_files, :type => :boolean, :aliases => '-s', :desc => "Include source files for each library"
|
120
124
|
def libraries
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
125
|
+
begin
|
126
|
+
defaults = {
|
127
|
+
"format" => "text",
|
128
|
+
"include_source_files" => false
|
129
|
+
}
|
130
|
+
opt = defaults.merge(options)
|
131
|
+
|
132
|
+
root_dir = Project::root
|
133
|
+
if root_dir.nil?
|
134
|
+
shell.error set_color("You must be within an ECIC project before calling this command",Thor::Shell::Color::RED)
|
135
|
+
exit(3)
|
136
|
+
end
|
137
|
+
project = Project.new(root_dir)
|
138
|
+
project.load_libraries
|
139
|
+
if opt['include_source_files']
|
140
|
+
project.load_sources
|
141
|
+
end
|
142
|
+
if opt['format'] == 'json'
|
143
|
+
require 'json'
|
144
|
+
say project.libraries.map{ |lib| lib.to_json(:include_source_files => opt['include_source_files']) }.join(",")
|
145
|
+
else
|
146
|
+
say project.libraries.map{ |lib| lib.to_s(:include_source_files => opt['include_source_files']) }.join("\n")
|
147
|
+
end
|
148
|
+
|
149
|
+
rescue Exception => exc
|
150
|
+
shell.error set_color(exc.message, Thor::Shell::Color::RED)
|
130
151
|
exit(3)
|
131
152
|
end
|
132
|
-
|
133
|
-
|
134
|
-
if opt['include_source_files']
|
135
|
-
# puts "reading source files..."
|
136
|
-
project.load_sources
|
137
|
-
end
|
138
|
-
if opt['format'] == 'json'
|
139
|
-
require 'json'
|
140
|
-
say project.libraries.map{ |lib| lib.to_json(:include_source_files => opt['include_source_files']) }.join(",")
|
141
|
-
else
|
142
|
-
say project.libraries.map{ |lib| lib.to_s(:include_source_files => opt['include_source_files']) }.join("\n")
|
143
|
-
end
|
153
|
+
|
154
|
+
|
144
155
|
end
|
145
156
|
end
|
146
|
-
end
|
157
|
+
end
|
data/lib/ecic/file_adder.rb
CHANGED
@@ -8,9 +8,9 @@ module Ecic
|
|
8
8
|
attr_accessor :library_name, :file_names, :project
|
9
9
|
|
10
10
|
def add_files_to_source_list
|
11
|
-
#If a library name is given,
|
12
|
-
#name. Otherwise an error message must be returned, because we
|
13
|
-
#design or testbench library.
|
11
|
+
#If a library name is given, the project must already contain a library
|
12
|
+
#with that name. Otherwise an error message must be returned, because we
|
13
|
+
#do not know if it is a design or testbench library.
|
14
14
|
unless library_name.nil?
|
15
15
|
library = project.get_library(library_name)
|
16
16
|
raise "Unknown library called '#{library_name}'. Please create the library before adding files to it. " if library.nil?
|
@@ -18,8 +18,7 @@ module Ecic
|
|
18
18
|
destination_path = Pathname.new(destination_root)
|
19
19
|
file_names.each { |file_name|
|
20
20
|
src_file_info = SourceFileInfo.new(project, file_name, library)
|
21
|
-
raise "Library name could not be determined from the path of '#{file_name}'
|
22
|
-
# puts "lib name=#{src_file_info.library.name}, lib_path = #{src_file_info.library.path}"
|
21
|
+
raise "Library name could not be determined from the path of '#{file_name}'.\nMake sure the appropriate library has been created and specify it with the --lib option - or create an empty sources.rb file in the root directory of the library." if src_file_info.library.nil?
|
23
22
|
if create_library_if_missing(src_file_info.library)
|
24
23
|
add_src_file(src_file_info, destination_path)
|
25
24
|
else
|
@@ -42,11 +42,11 @@ module Ecic::LibraryCreationHelper
|
|
42
42
|
when nil
|
43
43
|
say ""
|
44
44
|
return true
|
45
|
-
when is?(:yes),
|
45
|
+
when is?(:yes), ""
|
46
46
|
return true
|
47
47
|
when is?(:no), is?(:skip)
|
48
48
|
return false
|
49
|
-
when is?(:
|
49
|
+
when is?(:all)
|
50
50
|
return @always_create_library = true
|
51
51
|
when is?(:quit)
|
52
52
|
say "Aborting..."
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module Ecic
|
2
|
+
class ProjectCmd < Command
|
3
|
+
|
4
|
+
#--------------------------------------------------------------------------
|
5
|
+
# project root:
|
6
|
+
#--------------------------------------------------------------------------
|
7
|
+
desc "rootdir", Help.text('project')['root']['short']
|
8
|
+
def rootdir
|
9
|
+
begin
|
10
|
+
project_root_path = Ecic::Project::root
|
11
|
+
if project_root_path.nil?
|
12
|
+
shell.error set_color("You must be within an ECIC project before calling this command",Thor::Shell::Color::RED)
|
13
|
+
exit(1)
|
14
|
+
else
|
15
|
+
say project_root_path
|
16
|
+
end
|
17
|
+
rescue Exception => exc
|
18
|
+
shell.error set_color(exc.message,Thor::Shell::Color::RED)
|
19
|
+
exit(3)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
data/lib/ecic/version.rb
CHANGED
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.6.
|
4
|
+
version: 0.6.2
|
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-11-
|
11
|
+
date: 2018-11-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -149,6 +149,7 @@ files:
|
|
149
149
|
- lib/ecic/library.rb
|
150
150
|
- lib/ecic/library_generator.rb
|
151
151
|
- lib/ecic/project.rb
|
152
|
+
- lib/ecic/project_cmd.rb
|
152
153
|
- lib/ecic/project_generator.rb
|
153
154
|
- lib/ecic/source_file.rb
|
154
155
|
- lib/ecic/source_file_info.rb
|