ecic 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +37 -0
- data/README.md +186 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/ecic +6 -0
- data/bin/setup +6 -0
- data/config/ecic.yaml +9 -0
- data/config/locales/help.en.yaml +31 -0
- data/ecic.gemspec +26 -0
- data/features_wishlist.md +25 -0
- data/lib/ecic.rb +111 -0
- data/lib/ecic/library_generator.rb +27 -0
- data/lib/ecic/project_generator.rb +40 -0
- data/lib/ecic/version.rb +3 -0
- data/notes.txt +6 -0
- data/templates/project/Gemfile +3 -0
- data/templates/project/config/libraries.rb +9 -0
- data/templates/project/config/project.rb +13 -0
- data/templates/project/gitignore +2 -0
- data/templates/project/src/design/lib/sources.rb +0 -0
- data/templates/project/src/packages/README.txt +0 -0
- metadata +111 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: a76ed0b791619e00df7b26769de0149cd2c50bf7
|
4
|
+
data.tar.gz: 32bdd099afd3603acb07f92e3d65059693b4308c
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 00fb2b177b7d849519218ad947caad8885ee6024beed10ea01945bb9aeac43557c3faf3205a7f3012a873a6910ddf3cd7b59b24887e15f5d93d626d20f06a4c3
|
7
|
+
data.tar.gz: 6b9e3d628bb5982c30cabc505be385a80a4bf2fd3ba0e47d4f597c170ce75fc098afe88f340d8378d514dc7e509e158835e63cb3811dfd0f671b065adf07903f
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
ecic (0.1.4)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
diff-lcs (1.3)
|
10
|
+
rake (10.5.0)
|
11
|
+
rspec (3.8.0)
|
12
|
+
rspec-core (~> 3.8.0)
|
13
|
+
rspec-expectations (~> 3.8.0)
|
14
|
+
rspec-mocks (~> 3.8.0)
|
15
|
+
rspec-core (3.8.0)
|
16
|
+
rspec-support (~> 3.8.0)
|
17
|
+
rspec-expectations (3.8.1)
|
18
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
19
|
+
rspec-support (~> 3.8.0)
|
20
|
+
rspec-mocks (3.8.0)
|
21
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
22
|
+
rspec-support (~> 3.8.0)
|
23
|
+
rspec-support (3.8.0)
|
24
|
+
thor (0.20.0)
|
25
|
+
|
26
|
+
PLATFORMS
|
27
|
+
ruby
|
28
|
+
|
29
|
+
DEPENDENCIES
|
30
|
+
bundler (~> 1.13)
|
31
|
+
ecic!
|
32
|
+
rake (~> 10.0)
|
33
|
+
rspec (~> 3.0)
|
34
|
+
thor
|
35
|
+
|
36
|
+
BUNDLED WITH
|
37
|
+
1.13.5
|
data/README.md
ADDED
@@ -0,0 +1,186 @@
|
|
1
|
+
# Easy IC : open-source, cross-platform framework for developing digital ASIC and FPGA designs
|
2
|
+
|
3
|
+
## NOTE: this project has just been started. Hence, the description below is what will come in the future, but none of the features have been implemented yet.
|
4
|
+
|
5
|
+
ECIC is pronounced '`Easy IC`' and is an open-source, cross-platform framework for developing digital ASIC and FPGA designs. It enables you to quickly start a new IC project that is independent of both IC tool vendors and technology (FPGA/ASIC). ECIC creates a suitable project folder/file structure and provides a user friendly flow for configuring the project, fast compilation of RTL files etc.. It also provides generators for generating eg. new RTL files, libraries and testbenches for both VHDL, SystemVerilog and UVM.
|
6
|
+
|
7
|
+
One of the mantras for ECIC is `Convention Over Configuration` (inspired by the [https://rubyonrails.org/](RubyOnRails) web framework), which ensures a consistent structure across all projects using this framework - and a minimum of required configuration.
|
8
|
+
|
9
|
+
**The main highlights are:**
|
10
|
+
|
11
|
+
* Free and open-source
|
12
|
+
* Cross-platform (Windows, Linux)
|
13
|
+
* Scaffolding of projects and sub components
|
14
|
+
* IC tool vendor independent flow
|
15
|
+
* IC technology independent flow
|
16
|
+
* Convention over configuration
|
17
|
+
* Fast, parallel compilation of RTL files
|
18
|
+
* Automatic GNU Make dependency graph generation for VHDL files
|
19
|
+
* Easily extendable with custom features
|
20
|
+
|
21
|
+
## Installation
|
22
|
+
|
23
|
+
To install the framework, simply use the `gem` command:
|
24
|
+
|
25
|
+
$ gem install ecic
|
26
|
+
|
27
|
+
If the `gem` command is not available on your computer, you can get it through the RubyGems package available at [rubygems.org](https://rubygems.org).
|
28
|
+
|
29
|
+
## Usage
|
30
|
+
|
31
|
+
The `ecic new` command creates a new ECIC project with a default directory structure and configuration at the path you specify. To create a new project in a folder called `./my_project`, run:
|
32
|
+
|
33
|
+
$ ecic new my_project
|
34
|
+
|
35
|
+
If you already have an existing project and you want the project to use the ECIC framework, please follow the steps described in the 'Migrating an existing project to use ECIC' section below.
|
36
|
+
|
37
|
+
### Create new RTL library
|
38
|
+
|
39
|
+
Each RTL file in your project must belong to a given VHDL/Verilog library. When creating or adding RTL files to you project, a library can be created on the fly, but you can also create libraries manually using the `ecic generate library` command.
|
40
|
+
|
41
|
+
To create a library called `my_lib`, enter the project folder and run the `generate library` command, eg.:
|
42
|
+
|
43
|
+
$ cd my_project
|
44
|
+
$ ecic generate library my_lib
|
45
|
+
|
46
|
+
This will create a folder called `my_lib` in the `./src/design` folder and add the library to the project (by adding it to the `./src/config/libraries.rb` file).
|
47
|
+
|
48
|
+
You can create multiple libraries with one command by specifying a list of libraries, eg.:
|
49
|
+
|
50
|
+
$ ecic generate library my_lib1 my_lib2
|
51
|
+
|
52
|
+
<!--
|
53
|
+
By default, the `ecic generate library` command will also create an RTL design (VHDL component + entity + architecture or Verilog module) with the same name as the library.
|
54
|
+
The RTL design is automatically added to the library by adding it to the `sources.rb` file, which will be created at the root of each library folder.
|
55
|
+
-->
|
56
|
+
A `sources.rb` file will be created at the root of each library folder, which defines the RTL files that must be associated with the given library.
|
57
|
+
|
58
|
+
To see the full list of options for the `ecic generate library` command, run `ecic generate help library`.
|
59
|
+
|
60
|
+
### Create new RTL file
|
61
|
+
|
62
|
+
Creating a **new** RTL design can be done with the `ecic generate design` command. For VHDL designs, this command will generate both the component, entity and architecture and for SystemVerilog it will create a module. If you already have existing RTL design files you wish to add to the project, you should use the `ecic add design` command instead, see the 'Add existing RTL files' section.
|
63
|
+
|
64
|
+
The type of RTL design (VHDL or Verilog) to create is controlled by a `--type=vhdl|verilog` option and defaults to the value defined by the `config.generator.library.type.default` setting in the `./src/config/ecic.rb` configuratinon file.
|
65
|
+
|
66
|
+
The `ecic generate design` command can be called from any directory within your project. To see the full list of options for the `ecic generate design` command, run `ecic generate help design`.
|
67
|
+
|
68
|
+
#### Create new VHDL design(s)
|
69
|
+
|
70
|
+
To create a new VHDL design called `my_design1` and associate it with a library called `my_lib`, run:
|
71
|
+
|
72
|
+
$ ecic generate design --type=vhdl --lib=my_lib my_design1
|
73
|
+
|
74
|
+
If you specify a library that does not exist, you will be asked to confirm the creation of the new library.
|
75
|
+
|
76
|
+
When creating a new VHDL design, you will be given the option to also create and include a `types and constants` package definition file.
|
77
|
+
|
78
|
+
The following VHDL files will be created (relative to the project root folder):
|
79
|
+
|
80
|
+
./src/design/my_lib/my_design1-pkg-comp.vhd # Component definition
|
81
|
+
./src/design/my_lib/my_design1-ent.vhd # Entity definition
|
82
|
+
./src/design/my_lib/my_design1-arc-rtl.vhd # RTL architecture
|
83
|
+
./src/design/my_lib/my_design1-pkg-types.vhd # Types and constants definition package (optional)
|
84
|
+
|
85
|
+
Placing each component, entity and architecture in separate files allows a projects to be recompiled very fast when only a few files have been modified, since eg. an update that is isolated to a single RTL architecture only requires that one file to be recompiled. Splitting the entity and architecture into separate files also allows you to have multiple architectures for the save entity and choose between the architecture files at compile time without having to use `VHDL configuration` constructs.
|
86
|
+
|
87
|
+
Should you still wish to combine eg. the entity and architecture files into one file, you can configure `ECIC` to do this by default by setting `config.generator.design.vhdl.combine` option in `./src/config/ecic.rb`:
|
88
|
+
|
89
|
+
config.generator.design.vhdl.combine = 'entity + architecture'
|
90
|
+
|
91
|
+
##### Create multiple VHDL design for the same library
|
92
|
+
|
93
|
+
You can create multiple designs at the same time, and designs can be placed in subfolders within a library. For example, to create a new VHDL design called `my_design2` at the root of a library called `my_lib` and create another VHDL design called `my_design3` in a subfolder called `my_subblock`, run:
|
94
|
+
|
95
|
+
$ ecic generate design --type=vhdl --types-package --lib=my_lib my_design2 my_subblock/my_design3
|
96
|
+
|
97
|
+
This will create the following VHDL files (relative to the project root folder):
|
98
|
+
|
99
|
+
./src/design/my_lib/my_design2-comp.pkg.vhd # Component definition
|
100
|
+
./src/design/my_lib/my_design2-ent.vhd # Entity definition
|
101
|
+
./src/design/my_lib/my_design2-rtl_arc.vhd # RTL architecture
|
102
|
+
./src/design/my_lib/my_design2-pkg-types.vhd # Types and constants definition package (optional)
|
103
|
+
./src/design/my_lib/my_subblock/my_design3-comp-pkg.vhd # Component definition
|
104
|
+
./src/design/my_lib/my_subblock/my_design3-ent.vhd # Entity definition
|
105
|
+
./src/design/my_lib/my_subblock/my_design3-rtl_arc.vhd # RTL architecture
|
106
|
+
./src/design/my_lib/my_subblock/my_design3-pkg-types.vhd # Types and constants definition package (optional)
|
107
|
+
|
108
|
+
In this example the `--types-package` option is used to automatically include the `*-pkg-types.vhd` files without prompting the user with the option.
|
109
|
+
|
110
|
+
All generated VHDL files will be added to the `sources.rb` file in the given library.
|
111
|
+
|
112
|
+
#### Create new SystemVerilog file(s)
|
113
|
+
|
114
|
+
The procedure for creating SystemVerilog files is the same as for generating VHDL files, except that the `--type` option must be set to `sv`.
|
115
|
+
|
116
|
+
For example, to create two SystemVerilog modules called `my_design1` and `my_design2` and place them in separate subfolders within a library called `my_lib`, run:
|
117
|
+
|
118
|
+
$ ecic generate design --type=sv --lib=my_lib my_design1 my_design2
|
119
|
+
|
120
|
+
This will create the following SystemVerilog files (relative to the project root folder):
|
121
|
+
|
122
|
+
./src/design/my_lib/my_design1.sv # SystemVerilog module
|
123
|
+
./src/design/my_lib/my_design2.sv # SystemVerilog module
|
124
|
+
|
125
|
+
All generated SystemVerilog files will be added to the `sources.rb` file in the given library.
|
126
|
+
|
127
|
+
#### Omitting the --lib option
|
128
|
+
|
129
|
+
If the `ecic generate design` command is called from within a library folder (or subfolder), the `--lib` option can be omitted, in which case the new designs will be created for that library. The files will be placed relative to the current working directory.
|
130
|
+
|
131
|
+
Example:
|
132
|
+
|
133
|
+
$ cd ./src/design/queue_system/arbitor
|
134
|
+
$ ecic generate design --type=vhdl statemachine
|
135
|
+
|
136
|
+
That will generate the files as:
|
137
|
+
|
138
|
+
./src/design/queue_system/arbitor/statemachine-*.vhd #Path is relative to the project root folder
|
139
|
+
|
140
|
+
## Migrating an existing project to use ECIC
|
141
|
+
|
142
|
+
If you already have an existing project and you want the project to use the ECIC framework, simply specify the path to that project folder (after making sure you have a backup, of course) eg.:
|
143
|
+
|
144
|
+
ecic new ~/my_existing_project
|
145
|
+
|
146
|
+
If the folder contains files that will normally be overwritten by the framework, you will be asked whether to overwrite them. If you want to keep any conflicting files, then choose `n` (no, do not overwrite) for each conflicting file. You can then move or rename the original, conflicting files and run the `ecic new PATH` command again.
|
147
|
+
|
148
|
+
### Add existing RTL files
|
149
|
+
|
150
|
+
To add an existing RTL file to the project, go to the project folder and use the `ecic add design` commmand. This will add all the listed files to the given design library. If the library does not already exist, you will be asked to confirm the creation of it.
|
151
|
+
|
152
|
+
For example, to add two existing files named `./foo/bar/some_design.sv` and `../toto/kuku.vhd` to a library called `my_lib`, run:
|
153
|
+
|
154
|
+
$ ecic add design my_lib ./foo/bar/some_design.sv ../toto/kuku.vhd
|
155
|
+
|
156
|
+
Although all files that belong to a given library should be placed in the folder for that library, you can specify files that are placed anywhere in your file system.
|
157
|
+
|
158
|
+
If you have a Unix like terminal and want to eg. add all files in a `./foo` folder that has the extension `.vhd`, you can use the standard Unix `find` command:
|
159
|
+
|
160
|
+
$ ecic add design my_lib `find ./foo -name "*.vhd"`
|
161
|
+
|
162
|
+
When adding files to the project, the file extension (eg. vhd) is used to determine the file type. VHDL files are expected to have a .vhd or .vhdl extension and Verilog/SystemVerilog files are expected to have a .sv og .v extension. You can also specify the file type with a `type=vhdl|sv` option, eg.:
|
163
|
+
|
164
|
+
$ ecic add design --type=vhdl my_lib `find ./foo -name "*.*"`
|
165
|
+
|
166
|
+
## Compiling and elaborating RTL files
|
167
|
+
|
168
|
+
The project is compiled and elaborated with the `ecic compile [SCOPE]` command. The `SCOPE` option is optional and allows you to compile and elaborate different set of RTL files, eg. one set of files for an FPGA, another set of files for ASIC RTL simulations and a third set of files for ASIC gate-level simulations.
|
169
|
+
|
170
|
+
To compile and elaborate your project, simply run:
|
171
|
+
|
172
|
+
$ ecic compile [SCOPE]
|
173
|
+
|
174
|
+
SystemVerilog files will be compiled in the order they are listed in the sources.rb files and they will be compiled before any VHDL files.
|
175
|
+
|
176
|
+
## Development
|
177
|
+
|
178
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
179
|
+
|
180
|
+
To install the ECIC framework onto your local machine, run `bundle exec rake install`.
|
181
|
+
<!--
|
182
|
+
To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
183
|
+
-->
|
184
|
+
## Contributing
|
185
|
+
|
186
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/ic-factory/ecic.
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "ecic"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
data/bin/ecic
ADDED
data/bin/setup
ADDED
data/config/ecic.yaml
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
help:
|
2
|
+
new:
|
3
|
+
short: Generate a new project called NAME
|
4
|
+
long: |
|
5
|
+
Creates a new chip project called NAME.
|
6
|
+
|
7
|
+
Example: ecic new my_project
|
8
|
+
|
9
|
+
This creates a new project called 'my_project' in ./my_project
|
10
|
+
generate:
|
11
|
+
short: Generate new testbenches, RTL modules, tests etc.!
|
12
|
+
generators:
|
13
|
+
testbench:
|
14
|
+
short: Create a new testbench
|
15
|
+
long: |
|
16
|
+
Create a new VHDL, SystemVerilog or UVM testbench.
|
17
|
+
The testbench type MUST be defined with the --type option.
|
18
|
+
|
19
|
+
Example: ecic generate testbench my_tb --type=uvm --verbose
|
20
|
+
|
21
|
+
This creates a new UVM testbench called 'my_tb' in ./src/testbench/my_tb and prints info along the way
|
22
|
+
|
23
|
+
library:
|
24
|
+
short: Create a new library
|
25
|
+
long: |
|
26
|
+
Create a new VHDL/SystemVerilog library.
|
27
|
+
|
28
|
+
Example: ecic generate library lib1 lib2 lib3...
|
29
|
+
|
30
|
+
This creates the given libraries in the ./src/design/ directory of
|
31
|
+
your project and adds the libraries to ./src/config/libraries.rb
|
data/ecic.gemspec
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'ecic/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "ecic"
|
8
|
+
spec.version = Ecic::VERSION
|
9
|
+
spec.authors = ["Torben Fox Jacobsen"]
|
10
|
+
spec.email = ["ecic@ic-factory.com"]
|
11
|
+
spec.licenses = ['LGPL-3.0']
|
12
|
+
spec.summary = %q{Easy-IC : provides a framework for ASIC and FPGA projects that favors convention over configuration.}
|
13
|
+
spec.description = %q{This gem allows you to easily create a new ASIC/FPGA project with a file structure and support tools that ensures consistency between your projects and gets you up to speed in no time. To create a new project simply type 'ecic new PATH'.}
|
14
|
+
spec.homepage = "https://github.com/ic-factory/ecic"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
17
|
+
f.match(%r{^(test|spec|features)/})
|
18
|
+
end
|
19
|
+
spec.bindir = "exe"
|
20
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
21
|
+
spec.require_paths = ["lib"]
|
22
|
+
|
23
|
+
spec.add_development_dependency "bundler", "~> 1.13"
|
24
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
25
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
26
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
Here is a list of tools and features that we hope will be available in the future. Contributions and suggestions are most welcome.
|
2
|
+
|
3
|
+
### Tools:
|
4
|
+
|
5
|
+
* Plugin for various editors that make is easy to eg. create new RTL libraries and designs.
|
6
|
+
* Tool to include external libraries from 3ed parties.
|
7
|
+
* Tool to import a XILINX Vivado project file.
|
8
|
+
|
9
|
+
### Features:
|
10
|
+
|
11
|
+
* TBD
|
12
|
+
|
13
|
+
###Observations:
|
14
|
+
|
15
|
+
GNU Make commands are not suited as a multiple-level command line. It does not have built-in argument checking for target, in the sence that if you need to provide an argument to the a Make command and you misspell the argument, no built-in warnings will be given.
|
16
|
+
|
17
|
+
Example:
|
18
|
+
|
19
|
+
> make some_target some_option=whatever
|
20
|
+
> make some_target something_wrong=whatever
|
21
|
+
> make some_target some_option=whatever
|
22
|
+
|
23
|
+
|
24
|
+
#Requirements
|
25
|
+
* library names must be converted to snake_case before creating a new library.
|
data/lib/ecic.rb
ADDED
@@ -0,0 +1,111 @@
|
|
1
|
+
#TBA:
|
2
|
+
# 1. Create a generator that creates a new (custom) generator
|
3
|
+
# 2. Add project name and version as options to 'new' generator
|
4
|
+
# 3. Add option to specify whether separate files must be used (by default) for VHDL entities
|
5
|
+
# and architectures.
|
6
|
+
# 4. Make sure the 'new' action calls 'bundle install' in new project.
|
7
|
+
# 5. What should the file format be for libraries and source file config files? We want
|
8
|
+
# to be able to automatically add content to these files.
|
9
|
+
# sources.yaml
|
10
|
+
# sources.yaml.erb
|
11
|
+
# sources.rb <- This might be the best option (and have a convention for what it should contain).
|
12
|
+
# libraries.rb <- This might be the best option.
|
13
|
+
# If the user tries to call the 'generate' command outside a project,
|
14
|
+
# an error message must be returned stating that this command can only be called from within a project.
|
15
|
+
|
16
|
+
require "ecic/version"
|
17
|
+
|
18
|
+
module Ecic
|
19
|
+
require 'yaml'
|
20
|
+
require 'thor'
|
21
|
+
require 'thor/group'
|
22
|
+
require "ecic/project_generator"
|
23
|
+
require "ecic/library_generator"
|
24
|
+
|
25
|
+
def self.help_text
|
26
|
+
YAML.load(File.read(File.expand_path("../../config/locales/help.en.yaml", __FILE__)))['help']
|
27
|
+
end
|
28
|
+
|
29
|
+
#TBA: Make a function that returns the root folder for the project
|
30
|
+
def self.root
|
31
|
+
File.expand_path("./tfj2")
|
32
|
+
end
|
33
|
+
|
34
|
+
class Generate < Thor
|
35
|
+
#--------------------------------------------------------------------------
|
36
|
+
# TESTBENCH generator:
|
37
|
+
#--------------------------------------------------------------------------
|
38
|
+
class_option :verbose, :type => :boolean
|
39
|
+
|
40
|
+
desc "testbench NAME", Ecic::help_text['generators']['testbench']['short']
|
41
|
+
long_desc Ecic::help_text['generators']['testbench']['long']
|
42
|
+
option :type, :banner => 'vhdl|sv|uvm', :required => true, :desc => 'Speficy the testbench type (VHDL, SystemVerilog or UVM)'
|
43
|
+
option :just_print, :type => :boolean, :aliases => '-n', :desc => "Don't actually run any commands; just print them."
|
44
|
+
def testbench(name)
|
45
|
+
puts "Implement a generator for creating a new testbench"
|
46
|
+
end
|
47
|
+
|
48
|
+
desc "library NAME...", Ecic::help_text['generators']['library']['short']
|
49
|
+
long_desc Ecic::help_text['generators']['library']['long']
|
50
|
+
option :just_print, :type => :boolean, :aliases => '-n', :desc => "Don't actually run any commands; just print them."
|
51
|
+
# def library(names)
|
52
|
+
def library(lib_name)
|
53
|
+
generator = LibraryGenerator.new
|
54
|
+
generator.destination_root = Ecic::root
|
55
|
+
# names.each do |lib_name|
|
56
|
+
generator.library_name = lib_name
|
57
|
+
generator.invoke_all
|
58
|
+
# end
|
59
|
+
end
|
60
|
+
|
61
|
+
end
|
62
|
+
|
63
|
+
class Cli < Thor
|
64
|
+
|
65
|
+
check_unknown_options!
|
66
|
+
|
67
|
+
#Make sure to return non-zero value if an error is thrown.
|
68
|
+
def self.exit_on_failure?
|
69
|
+
true
|
70
|
+
end
|
71
|
+
|
72
|
+
class << self
|
73
|
+
def help(shell, subcommand = false)
|
74
|
+
shell.say "Usage: ecic COMMAND [ARGS]"
|
75
|
+
shell.say ""
|
76
|
+
super
|
77
|
+
shell.say "To get more help on a specific command, try 'ecic help [COMMAND]'"
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
#--------------------------------------------------------------------------
|
82
|
+
# VERSION command:
|
83
|
+
#--------------------------------------------------------------------------
|
84
|
+
desc 'version', 'Display version'
|
85
|
+
map %w[-v --version] => :version
|
86
|
+
def version
|
87
|
+
say "#{VERSION}"
|
88
|
+
end
|
89
|
+
|
90
|
+
#--------------------------------------------------------------------------
|
91
|
+
# NEW command:
|
92
|
+
#--------------------------------------------------------------------------
|
93
|
+
long_desc Ecic::help_text['new']['long']
|
94
|
+
desc "new PATH", Ecic::help_text['new']['short']
|
95
|
+
option :verbose, :type => :boolean
|
96
|
+
def new(path)
|
97
|
+
path = File.expand_path(path)
|
98
|
+
puts "Generating a new project in #{path}"
|
99
|
+
generator = ProjectGenerator.new
|
100
|
+
generator.destination_root = path
|
101
|
+
generator.invoke_all
|
102
|
+
#TBA: invoke installation by eg. calling 'bundler install' from within the generate project folder
|
103
|
+
|
104
|
+
end
|
105
|
+
|
106
|
+
desc "generate SUBCOMMAND ...ARGS", Ecic::help_text['generate']['short']
|
107
|
+
subcommand "generate", Generate
|
108
|
+
|
109
|
+
end
|
110
|
+
|
111
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module Ecic
|
2
|
+
|
3
|
+
class LibraryGenerator < Thor::Group
|
4
|
+
include Thor::Actions
|
5
|
+
desc 'Generate a new RTL library'
|
6
|
+
|
7
|
+
attr_writer :library_name
|
8
|
+
|
9
|
+
def self.source_root
|
10
|
+
File.dirname(__FILE__) + '/../../templates'
|
11
|
+
end
|
12
|
+
|
13
|
+
# def create_library_directory
|
14
|
+
# copy_file 'projects/src/design/lib/sources.rb', "src/design/#{@library_name}/sources.rb"
|
15
|
+
# end
|
16
|
+
|
17
|
+
def update_library_list
|
18
|
+
#TBA 'src/config' creation is only temporary fix!
|
19
|
+
libraries_file = File.expand_path("#{destination_root}/src/config/libraries.rb")
|
20
|
+
empty_directory 'src/config' unless File.exist?(File.dirname(libraries_file))
|
21
|
+
create_file libraries_file unless File.exist?(libraries_file)
|
22
|
+
append_to_file 'src/config/libraries.rb', "add library #{@library_name}\n"
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
module Ecic
|
2
|
+
|
3
|
+
class ProjectGenerator < Thor::Group
|
4
|
+
include Thor::Actions
|
5
|
+
desc 'Generate a new chip project'
|
6
|
+
|
7
|
+
def self.source_root
|
8
|
+
File.dirname(__FILE__) + '/../../templates/project'
|
9
|
+
end
|
10
|
+
|
11
|
+
def create_base_files
|
12
|
+
copy_file 'gitignore', '.gitignore'
|
13
|
+
copy_file 'config/project.rb', 'src/config/project.rb'
|
14
|
+
copy_file 'config/libraries.rb', 'src/config/libraries.rb'
|
15
|
+
copy_file 'Gemfile', 'Gemfile'
|
16
|
+
end
|
17
|
+
|
18
|
+
def create_output_directories
|
19
|
+
#TBA: Replace these lines with a call to a TestbenchGenerator class
|
20
|
+
empty_directory 'src/testbench/chip'
|
21
|
+
empty_directory 'src/verification/chip'
|
22
|
+
|
23
|
+
copy_file 'src/packages/README.txt', 'src/packages/README.txt'
|
24
|
+
create_file 'src/design/chip/sources.rb'
|
25
|
+
empty_directory 'src/external_packages'
|
26
|
+
end
|
27
|
+
|
28
|
+
#Replace this function with a call to a 'VHDLComponentGenerator' class
|
29
|
+
def create_top_entity
|
30
|
+
create_file 'src/design/chip/sources.yaml.erb'
|
31
|
+
create_file 'src/design/chip/chip-rtl_arc.vhd'
|
32
|
+
create_file 'src/design/chip/chip-ent.vhd'
|
33
|
+
end
|
34
|
+
|
35
|
+
def git_init
|
36
|
+
run 'git init ' + destination_root
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
data/lib/ecic/version.rb
ADDED
data/notes.txt
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
#This file lists all libraries in the project.
|
2
|
+
|
3
|
+
#Syntax:
|
4
|
+
# add library LIBRARY
|
5
|
+
# where LIBRARY is the name of a VHDL/Verilog library that must be placed in a folder of the same name under src/design
|
6
|
+
|
7
|
+
#Syntax:
|
8
|
+
# add testbench TESTBENCH
|
9
|
+
# where TESTBENCH is the name of a testbench that must be placed in a folder of the same name under src/testbench
|
@@ -0,0 +1,13 @@
|
|
1
|
+
Ecic.project.configure do
|
2
|
+
|
3
|
+
#Select the default type of RTL files you wish to generate:
|
4
|
+
#VHDL or SystemVerilog:
|
5
|
+
config.generator.library.type.default = 'vhdl'
|
6
|
+
# config.generator.library.type.default = 'sv'
|
7
|
+
|
8
|
+
config.generator.design.vhdl.combine = ''
|
9
|
+
# config.generator.design.vhdl.combine = 'entity + architecture'
|
10
|
+
# config.generator.design.vhdl.combine = 'entity + component'
|
11
|
+
# config.generator.design.vhdl.combine = 'entity + architecture + component'
|
12
|
+
|
13
|
+
end
|
File without changes
|
File without changes
|
metadata
ADDED
@@ -0,0 +1,111 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: ecic
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Torben Fox Jacobsen
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-10-02 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.13'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.13'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.0'
|
55
|
+
description: This gem allows you to easily create a new ASIC/FPGA project with a file
|
56
|
+
structure and support tools that ensures consistency between your projects and gets
|
57
|
+
you up to speed in no time. To create a new project simply type 'ecic new PATH'.
|
58
|
+
email:
|
59
|
+
- ecic@ic-factory.com
|
60
|
+
executables: []
|
61
|
+
extensions: []
|
62
|
+
extra_rdoc_files: []
|
63
|
+
files:
|
64
|
+
- Gemfile
|
65
|
+
- Gemfile.lock
|
66
|
+
- README.md
|
67
|
+
- Rakefile
|
68
|
+
- bin/console
|
69
|
+
- bin/ecic
|
70
|
+
- bin/setup
|
71
|
+
- config/ecic.yaml
|
72
|
+
- config/locales/help.en.yaml
|
73
|
+
- ecic.gemspec
|
74
|
+
- features_wishlist.md
|
75
|
+
- lib/ecic.rb
|
76
|
+
- lib/ecic/library_generator.rb
|
77
|
+
- lib/ecic/project_generator.rb
|
78
|
+
- lib/ecic/version.rb
|
79
|
+
- notes.txt
|
80
|
+
- templates/project/Gemfile
|
81
|
+
- templates/project/config/libraries.rb
|
82
|
+
- templates/project/config/project.rb
|
83
|
+
- templates/project/gitignore
|
84
|
+
- templates/project/src/design/lib/sources.rb
|
85
|
+
- templates/project/src/packages/README.txt
|
86
|
+
homepage: https://github.com/ic-factory/ecic
|
87
|
+
licenses:
|
88
|
+
- LGPL-3.0
|
89
|
+
metadata: {}
|
90
|
+
post_install_message:
|
91
|
+
rdoc_options: []
|
92
|
+
require_paths:
|
93
|
+
- lib
|
94
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
95
|
+
requirements:
|
96
|
+
- - ">="
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: '0'
|
99
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
requirements: []
|
105
|
+
rubyforge_project:
|
106
|
+
rubygems_version: 2.6.7
|
107
|
+
signing_key:
|
108
|
+
specification_version: 4
|
109
|
+
summary: 'Easy-IC : provides a framework for ASIC and FPGA projects that favors convention
|
110
|
+
over configuration.'
|
111
|
+
test_files: []
|