mooreio-client 2.0.2__tar.gz
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.
- mooreio_client-2.0.2/LICENSE +21 -0
- mooreio_client-2.0.2/PKG-INFO +209 -0
- mooreio_client-2.0.2/README.md +168 -0
- mooreio_client-2.0.2/mio_client/__init__.py +0 -0
- mooreio_client-2.0.2/mio_client/__main__.py +9 -0
- mooreio_client-2.0.2/mio_client/cli.py +188 -0
- mooreio_client-2.0.2/mio_client/commands/__init__.py +0 -0
- mooreio_client-2.0.2/mio_client/commands/gen.py +262 -0
- mooreio_client-2.0.2/mio_client/commands/ip.py +599 -0
- mooreio_client-2.0.2/mio_client/commands/misc.py +210 -0
- mooreio_client-2.0.2/mio_client/commands/project.py +11 -0
- mooreio_client-2.0.2/mio_client/commands/sim.py +932 -0
- mooreio_client-2.0.2/mio_client/commands/team.py +11 -0
- mooreio_client-2.0.2/mio_client/commands/user.py +133 -0
- mooreio_client-2.0.2/mio_client/commands/web.py +10 -0
- mooreio_client-2.0.2/mio_client/core/__init__.py +0 -0
- mooreio_client-2.0.2/mio_client/core/command.py +868 -0
- mooreio_client-2.0.2/mio_client/core/configuration.py +130 -0
- mooreio_client-2.0.2/mio_client/core/ip.py +1146 -0
- mooreio_client-2.0.2/mio_client/core/model.py +34 -0
- mooreio_client-2.0.2/mio_client/core/phase.py +160 -0
- mooreio_client-2.0.2/mio_client/core/root_manager.py +1179 -0
- mooreio_client-2.0.2/mio_client/core/scheduler.py +374 -0
- mooreio_client-2.0.2/mio_client/core/service.py +143 -0
- mooreio_client-2.0.2/mio_client/core/user.py +63 -0
- mooreio_client-2.0.2/mio_client/core/version.py +86 -0
- mooreio_client-2.0.2/mio_client/schedulers/__init__.py +0 -0
- mooreio_client-2.0.2/mio_client/schedulers/grid_engine.py +32 -0
- mooreio_client-2.0.2/mio_client/schedulers/lsf.py +31 -0
- mooreio_client-2.0.2/mio_client/schedulers/sub_process.py +65 -0
- mooreio_client-2.0.2/mio_client/services/__init__.py +0 -0
- mooreio_client-2.0.2/mio_client/services/cdc.py +14 -0
- mooreio_client-2.0.2/mio_client/services/dft.py +16 -0
- mooreio_client-2.0.2/mio_client/services/doxygen.py +117 -0
- mooreio_client-2.0.2/mio_client/services/emulation.py +14 -0
- mooreio_client-2.0.2/mio_client/services/formal.py +16 -0
- mooreio_client-2.0.2/mio_client/services/fsoc.py +15 -0
- mooreio_client-2.0.2/mio_client/services/init.py +212 -0
- mooreio_client-2.0.2/mio_client/services/layout.py +15 -0
- mooreio_client-2.0.2/mio_client/services/lint.py +16 -0
- mooreio_client-2.0.2/mio_client/services/pv.py +16 -0
- mooreio_client-2.0.2/mio_client/services/regression.py +862 -0
- mooreio_client-2.0.2/mio_client/services/simulation.py +2369 -0
- mooreio_client-2.0.2/mio_client/services/spice.py +16 -0
- mooreio_client-2.0.2/mio_client/services/sta.py +16 -0
- mooreio_client-2.0.2/mio_client/services/synthesis.py +16 -0
- mooreio_client-2.0.2/mio_client/services/uvmf.py +16 -0
- mooreio_client-2.0.2/mio_client/services/uvmx.py +16 -0
- mooreio_client-2.0.2/mio_client/tests/__init__.py +0 -0
- mooreio_client-2.0.2/mio_client/tests/common.py +253 -0
- mooreio_client-2.0.2/mio_client/tests/conftest.py +10 -0
- mooreio_client-2.0.2/mio_client/tests/test_cli_dox.py +52 -0
- mooreio_client-2.0.2/mio_client/tests/test_cli_init.py +102 -0
- mooreio_client-2.0.2/mio_client/tests/test_cli_ip.py +133 -0
- mooreio_client-2.0.2/mio_client/tests/test_cli_misc.py +161 -0
- mooreio_client-2.0.2/mio_client/tests/test_cli_regr.py +134 -0
- mooreio_client-2.0.2/mio_client/tests/test_cli_sim.py +167 -0
- mooreio_client-2.0.2/mio_client/tests/test_cli_user.py +28 -0
- mooreio_client-2.0.2/mio_client/tests/test_configuration.py +86 -0
- mooreio_client-2.0.2/mio_client/tests/test_core.py +258 -0
- mooreio_client-2.0.2/mio_client/tests/test_init.py +63 -0
- mooreio_client-2.0.2/mio_client/tests/test_ip.py +106 -0
- mooreio_client-2.0.2/mio_client/tests/test_ts.py +141 -0
- mooreio_client-2.0.2/mio_client/tests/test_user.py +54 -0
- mooreio_client-2.0.2/mooreio_client.egg-info/PKG-INFO +209 -0
- mooreio_client-2.0.2/mooreio_client.egg-info/SOURCES.txt +70 -0
- mooreio_client-2.0.2/mooreio_client.egg-info/dependency_links.txt +1 -0
- mooreio_client-2.0.2/mooreio_client.egg-info/entry_points.txt +2 -0
- mooreio_client-2.0.2/mooreio_client.egg-info/requires.txt +26 -0
- mooreio_client-2.0.2/mooreio_client.egg-info/top_level.txt +1 -0
- mooreio_client-2.0.2/setup.cfg +4 -0
- mooreio_client-2.0.2/setup.py +42 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Datum Technology Corporation
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: mooreio_client
|
|
3
|
+
Version: 2.0.2
|
|
4
|
+
Summary: CLI tool to automate EDA tasks for ASICs, FPGAs, and UVM IP.
|
|
5
|
+
Home-page: https://github.com/Datum-Technology-Corporation/mooreio_client
|
|
6
|
+
Author: Datum Technology Corporation
|
|
7
|
+
Author-email: info@datumtc.ca
|
|
8
|
+
License: MIT
|
|
9
|
+
Project-URL: Documentation, https://readthedocs.org/projects/mooreio-client/
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
+
Classifier: Operating System :: OS Independent
|
|
13
|
+
Requires-Python: >=3.12
|
|
14
|
+
Description-Content-Type: text/markdown
|
|
15
|
+
License-File: LICENSE
|
|
16
|
+
Requires-Dist: docutils~=0.19
|
|
17
|
+
Requires-Dist: requests~=2.31.0
|
|
18
|
+
Requires-Dist: pydantic~=2.9.2
|
|
19
|
+
Requires-Dist: semantic-version~=2.10.0
|
|
20
|
+
Requires-Dist: PyYAML~=6.0
|
|
21
|
+
Requires-Dist: Jinja2~=3.1.2
|
|
22
|
+
Requires-Dist: toml~=0.10.2
|
|
23
|
+
Requires-Dist: pydantic-extra-types==2.9.0
|
|
24
|
+
Requires-Dist: semver==3.0.2
|
|
25
|
+
Requires-Dist: tqdm==4.67.1
|
|
26
|
+
Provides-Extra: dev
|
|
27
|
+
Requires-Dist: flake8>=7.1.1; extra == "dev"
|
|
28
|
+
Requires-Dist: mccabe>=0.7.0; extra == "dev"
|
|
29
|
+
Requires-Dist: pycodestyle>=2.12.1; extra == "dev"
|
|
30
|
+
Requires-Dist: pyflakes>=3.2.0; extra == "dev"
|
|
31
|
+
Requires-Dist: coverage>=7.6.1; extra == "dev"
|
|
32
|
+
Requires-Dist: pytest-cov>=5.0.0; extra == "dev"
|
|
33
|
+
Requires-Dist: pytest>=8.3.3; extra == "dev"
|
|
34
|
+
Requires-Dist: pytest-xdist>=3.6.1; extra == "dev"
|
|
35
|
+
Requires-Dist: pytest-metadata>=3.1.1; extra == "dev"
|
|
36
|
+
Requires-Dist: flake8-html>=0.4.3; extra == "dev"
|
|
37
|
+
Requires-Dist: pygments>=2.18.0; extra == "dev"
|
|
38
|
+
Requires-Dist: pytest-html>=4.1.1; extra == "dev"
|
|
39
|
+
Requires-Dist: pytest-flake8>=1.3.0; extra == "dev"
|
|
40
|
+
Requires-Dist: setuptools>=65.5.0; extra == "dev"
|
|
41
|
+
|
|
42
|
+

|
|
43
|
+
|
|
44
|
+
# Moore.io Client
|
|
45
|
+
|
|
46
|
+
The Moore.io Client is an open-source CLI tool designed to automate Electronic Design Automation (EDA) tasks encountered
|
|
47
|
+
during the development of ASIC, FPGA and UVM IP. This tool also serves as a client for the Moore.io Web Site
|
|
48
|
+
(https://mooreio.com), providing functionalities such as installing IP dependencies, generating UVM code and
|
|
49
|
+
packaging/publishing IPs.
|
|
50
|
+
|
|
51
|
+
## Why?
|
|
52
|
+
The EDA (Electronic Design Automation) field clearly lags behind in terms of Free & Open-Source (FOS) developer tools
|
|
53
|
+
when compared to the software world. There is no FOS tool that can drive the various CAD software necessary and provide
|
|
54
|
+
the kind of automation needed to produce commercial-grade FPGA and ASIC designs. Instead, homebrew (and seldom shared)
|
|
55
|
+
Makefiles and Shell scripts rule the field of DevOps in semiconductors.
|
|
56
|
+
|
|
57
|
+
### The Problem
|
|
58
|
+
Writing a Makefile/Shell script that can perform all the tasks required to create a Chip Design is a LARGE job. Since
|
|
59
|
+
these languages do not come with any meaningful libraries, the end result is a mess of patched, brittle code painful to
|
|
60
|
+
maintain/debug, yet on which every engineering task directly depends. These issues are usually compounded by
|
|
61
|
+
copying the project Makefile/Shell script from project to project; thus losing all Git history while commenting
|
|
62
|
+
out old code and adding to the mess.
|
|
63
|
+
|
|
64
|
+
Surely, there must be a better way ...
|
|
65
|
+
|
|
66
|
+
### The Solution
|
|
67
|
+
The Moore.io Client is a FOS Command Line Interface (CLI) tool implemented in Python 3, using Object-Oriented
|
|
68
|
+
Practices, strong typing, unit testing, and a modular architecture that will be very familiar to UVM engineers: the
|
|
69
|
+
primary target audience of this tool. The Client, invoked via `mio`, has all the features you would expect from a
|
|
70
|
+
"Project Makefile" at a high-end Semiconductor engineering firm AND all the best features from Software package
|
|
71
|
+
managers:
|
|
72
|
+
|
|
73
|
+
* The concept of a Project, which is identified by a `mio.toml` file in its root directory
|
|
74
|
+
* A layered Configuration Space defined with TOML files (`mio.toml`) at the user (`~/.mio/mio.toml`) and project levels
|
|
75
|
+
* Packaging of HDL source file into IPs (Intellectual Property) identified by `ip.yml` descriptors in their root directory
|
|
76
|
+
* Performing tasks at the IP-level, including generating code, specifying and installing dependencies
|
|
77
|
+
* Ability to drive all Logic Simulators (VCS, XCelium, Questa, Vivado, Metrics DSim, Riviera-PRO) with a single set of commands and parameters
|
|
78
|
+
* A feature-driven Test Suite schema for specifying Regressions in UVM Test Benches, AND the ability to run these Regressions on Job Schedulers (LSF, GRID, etc.)
|
|
79
|
+
* Built-in compatibility with Continuous Integration (CI) tools like Jenkins
|
|
80
|
+
|
|
81
|
+
## How much does it cost?
|
|
82
|
+
The EDA Automation and Package management is Free & Open-Source. Some commands, such as UVM Code Generation, "phone
|
|
83
|
+
home" to the Moore.io Server and therefore require a User Account (which can be created at
|
|
84
|
+
https://mooreio.com/register) and a license for Datum UVMx. However, the tool operates independently of the site in all
|
|
85
|
+
other regards and can be used without authentication to build a Chip from start to finish.
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
## Installation
|
|
89
|
+
|
|
90
|
+
You can install `mio` via `pip`:
|
|
91
|
+
|
|
92
|
+
```sh
|
|
93
|
+
pip install mooreio_client
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Usage
|
|
97
|
+
|
|
98
|
+
```sh
|
|
99
|
+
mio <command> [<args>]
|
|
100
|
+
mio help <command>
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
For complete list of commands and options, you can use:
|
|
104
|
+
|
|
105
|
+
```sh
|
|
106
|
+
mio --help
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
For quick reference on a specific command:
|
|
110
|
+
|
|
111
|
+
```sh
|
|
112
|
+
mio help <command>
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Documentation
|
|
116
|
+
|
|
117
|
+
Comprehensive documentation is available on [Read the Docs](https://readthedocs.org/projects/mooreio_client).
|
|
118
|
+
|
|
119
|
+
## Development
|
|
120
|
+
|
|
121
|
+
### Architecture
|
|
122
|
+
The Design Pattern for the Moore.io Client mimics UVM's phases and component structure. A RootManager (RM) class instance
|
|
123
|
+
is created by the CLI argument parser and given a Command instance to execute. The RM operates in 3 steps:
|
|
124
|
+
|
|
125
|
+
1. Discovery: finding the project file, loading/validating the configuration space and finding/loading IP files
|
|
126
|
+
2. Main: RM gives control to the Command which invokes Service(s) (simulators, synthesizers, etc.) to perform Task(s) (compilation, simulation, etc.) via a JobScheduler instance (SubProcess, LSF, GRID) which accepts Jobs (shell commands)
|
|
127
|
+
3. Post: RM and Command parse results, generate reports, clean up files, close sockets, stop processes and print out final notes to the user
|
|
128
|
+
|
|
129
|
+
Each step is broken up into phases, with each phase having a 'pre' and 'post' phase associated to it:
|
|
130
|
+
|
|
131
|
+
* The Discovery step is handled by the RM; the Command can participate via pre/post phase hooks
|
|
132
|
+
* During the Main phase, control shifts to the Command, which has a selection of Service tasks and JobSchedulers with which to run them
|
|
133
|
+
* The post step is shared between the RM and the Command
|
|
134
|
+
|
|
135
|
+
Each phase method has a Phase instance parameter that can be used to end the program arbitrarily and/or report errors to the RM.
|
|
136
|
+
|
|
137
|
+
Commands are discovered by `cli.py` and must append their CLI argument subparser to the main `argparse` instance.
|
|
138
|
+
If the user selects the command, an instance is created, fed to the RM and execution begins via `RM.run()`.
|
|
139
|
+
|
|
140
|
+
Errors are handled via the `raise` of Python Exceptions. The RM catches these and exits with the appropriate error message and return code.
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
### Requirements
|
|
144
|
+
|
|
145
|
+
- Python 3.11.4
|
|
146
|
+
- `pip` package manager
|
|
147
|
+
- `make` utility (for convenience in development and CI)
|
|
148
|
+
|
|
149
|
+
### Setup
|
|
150
|
+
|
|
151
|
+
1. Clone the repository:
|
|
152
|
+
```sh
|
|
153
|
+
git clone https://github.com/Datum-Technology-Corporation/mooreio_client.git
|
|
154
|
+
cd mooreio_client
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
2. Set up Virtual Environment and install Dependencies:
|
|
158
|
+
```sh
|
|
159
|
+
make venv
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
3. Run tests:
|
|
163
|
+
```sh
|
|
164
|
+
make test
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
4. Build documentation:
|
|
168
|
+
```sh
|
|
169
|
+
make docs
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
5. Build package:
|
|
173
|
+
```sh
|
|
174
|
+
make build
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
6. Print Makefile User Manual:
|
|
178
|
+
```sh
|
|
179
|
+
make help
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
## Continuous Integration
|
|
183
|
+
Most popular CI/CD tools are supported out-of-the-box. Some systems are better fleshed out than others; please don't
|
|
184
|
+
hesitate to contribute your tweaks!
|
|
185
|
+
|
|
186
|
+
### Supported Continuous Integration Tools
|
|
187
|
+
- Azure Pipelines
|
|
188
|
+
- Bamboo
|
|
189
|
+
- Bitbucket Pipelines
|
|
190
|
+
- CircleCI
|
|
191
|
+
- Codeship
|
|
192
|
+
- GitHub Actions
|
|
193
|
+
- GitLab CI/CD
|
|
194
|
+
- Jenkins
|
|
195
|
+
- TeamCity
|
|
196
|
+
- Travis CI
|
|
197
|
+
|
|
198
|
+
## Contributing
|
|
199
|
+
|
|
200
|
+
We welcome contributions! Please see the [CONTRIBUTING.md](CONTRIBUTING.md) file for guidelines on how to contribute.
|
|
201
|
+
|
|
202
|
+
## License
|
|
203
|
+
|
|
204
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
205
|
+
|
|
206
|
+
## Contact
|
|
207
|
+
|
|
208
|
+
- Official site: [www.mooreio.com](http://www.mooreio.com)
|
|
209
|
+
- Copyright Holder: [Datum Technology Corporation](http://www.datumtc.ca)
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+

|
|
2
|
+
|
|
3
|
+
# Moore.io Client
|
|
4
|
+
|
|
5
|
+
The Moore.io Client is an open-source CLI tool designed to automate Electronic Design Automation (EDA) tasks encountered
|
|
6
|
+
during the development of ASIC, FPGA and UVM IP. This tool also serves as a client for the Moore.io Web Site
|
|
7
|
+
(https://mooreio.com), providing functionalities such as installing IP dependencies, generating UVM code and
|
|
8
|
+
packaging/publishing IPs.
|
|
9
|
+
|
|
10
|
+
## Why?
|
|
11
|
+
The EDA (Electronic Design Automation) field clearly lags behind in terms of Free & Open-Source (FOS) developer tools
|
|
12
|
+
when compared to the software world. There is no FOS tool that can drive the various CAD software necessary and provide
|
|
13
|
+
the kind of automation needed to produce commercial-grade FPGA and ASIC designs. Instead, homebrew (and seldom shared)
|
|
14
|
+
Makefiles and Shell scripts rule the field of DevOps in semiconductors.
|
|
15
|
+
|
|
16
|
+
### The Problem
|
|
17
|
+
Writing a Makefile/Shell script that can perform all the tasks required to create a Chip Design is a LARGE job. Since
|
|
18
|
+
these languages do not come with any meaningful libraries, the end result is a mess of patched, brittle code painful to
|
|
19
|
+
maintain/debug, yet on which every engineering task directly depends. These issues are usually compounded by
|
|
20
|
+
copying the project Makefile/Shell script from project to project; thus losing all Git history while commenting
|
|
21
|
+
out old code and adding to the mess.
|
|
22
|
+
|
|
23
|
+
Surely, there must be a better way ...
|
|
24
|
+
|
|
25
|
+
### The Solution
|
|
26
|
+
The Moore.io Client is a FOS Command Line Interface (CLI) tool implemented in Python 3, using Object-Oriented
|
|
27
|
+
Practices, strong typing, unit testing, and a modular architecture that will be very familiar to UVM engineers: the
|
|
28
|
+
primary target audience of this tool. The Client, invoked via `mio`, has all the features you would expect from a
|
|
29
|
+
"Project Makefile" at a high-end Semiconductor engineering firm AND all the best features from Software package
|
|
30
|
+
managers:
|
|
31
|
+
|
|
32
|
+
* The concept of a Project, which is identified by a `mio.toml` file in its root directory
|
|
33
|
+
* A layered Configuration Space defined with TOML files (`mio.toml`) at the user (`~/.mio/mio.toml`) and project levels
|
|
34
|
+
* Packaging of HDL source file into IPs (Intellectual Property) identified by `ip.yml` descriptors in their root directory
|
|
35
|
+
* Performing tasks at the IP-level, including generating code, specifying and installing dependencies
|
|
36
|
+
* Ability to drive all Logic Simulators (VCS, XCelium, Questa, Vivado, Metrics DSim, Riviera-PRO) with a single set of commands and parameters
|
|
37
|
+
* A feature-driven Test Suite schema for specifying Regressions in UVM Test Benches, AND the ability to run these Regressions on Job Schedulers (LSF, GRID, etc.)
|
|
38
|
+
* Built-in compatibility with Continuous Integration (CI) tools like Jenkins
|
|
39
|
+
|
|
40
|
+
## How much does it cost?
|
|
41
|
+
The EDA Automation and Package management is Free & Open-Source. Some commands, such as UVM Code Generation, "phone
|
|
42
|
+
home" to the Moore.io Server and therefore require a User Account (which can be created at
|
|
43
|
+
https://mooreio.com/register) and a license for Datum UVMx. However, the tool operates independently of the site in all
|
|
44
|
+
other regards and can be used without authentication to build a Chip from start to finish.
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
## Installation
|
|
48
|
+
|
|
49
|
+
You can install `mio` via `pip`:
|
|
50
|
+
|
|
51
|
+
```sh
|
|
52
|
+
pip install mooreio_client
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Usage
|
|
56
|
+
|
|
57
|
+
```sh
|
|
58
|
+
mio <command> [<args>]
|
|
59
|
+
mio help <command>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
For complete list of commands and options, you can use:
|
|
63
|
+
|
|
64
|
+
```sh
|
|
65
|
+
mio --help
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
For quick reference on a specific command:
|
|
69
|
+
|
|
70
|
+
```sh
|
|
71
|
+
mio help <command>
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Documentation
|
|
75
|
+
|
|
76
|
+
Comprehensive documentation is available on [Read the Docs](https://readthedocs.org/projects/mooreio_client).
|
|
77
|
+
|
|
78
|
+
## Development
|
|
79
|
+
|
|
80
|
+
### Architecture
|
|
81
|
+
The Design Pattern for the Moore.io Client mimics UVM's phases and component structure. A RootManager (RM) class instance
|
|
82
|
+
is created by the CLI argument parser and given a Command instance to execute. The RM operates in 3 steps:
|
|
83
|
+
|
|
84
|
+
1. Discovery: finding the project file, loading/validating the configuration space and finding/loading IP files
|
|
85
|
+
2. Main: RM gives control to the Command which invokes Service(s) (simulators, synthesizers, etc.) to perform Task(s) (compilation, simulation, etc.) via a JobScheduler instance (SubProcess, LSF, GRID) which accepts Jobs (shell commands)
|
|
86
|
+
3. Post: RM and Command parse results, generate reports, clean up files, close sockets, stop processes and print out final notes to the user
|
|
87
|
+
|
|
88
|
+
Each step is broken up into phases, with each phase having a 'pre' and 'post' phase associated to it:
|
|
89
|
+
|
|
90
|
+
* The Discovery step is handled by the RM; the Command can participate via pre/post phase hooks
|
|
91
|
+
* During the Main phase, control shifts to the Command, which has a selection of Service tasks and JobSchedulers with which to run them
|
|
92
|
+
* The post step is shared between the RM and the Command
|
|
93
|
+
|
|
94
|
+
Each phase method has a Phase instance parameter that can be used to end the program arbitrarily and/or report errors to the RM.
|
|
95
|
+
|
|
96
|
+
Commands are discovered by `cli.py` and must append their CLI argument subparser to the main `argparse` instance.
|
|
97
|
+
If the user selects the command, an instance is created, fed to the RM and execution begins via `RM.run()`.
|
|
98
|
+
|
|
99
|
+
Errors are handled via the `raise` of Python Exceptions. The RM catches these and exits with the appropriate error message and return code.
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
### Requirements
|
|
103
|
+
|
|
104
|
+
- Python 3.11.4
|
|
105
|
+
- `pip` package manager
|
|
106
|
+
- `make` utility (for convenience in development and CI)
|
|
107
|
+
|
|
108
|
+
### Setup
|
|
109
|
+
|
|
110
|
+
1. Clone the repository:
|
|
111
|
+
```sh
|
|
112
|
+
git clone https://github.com/Datum-Technology-Corporation/mooreio_client.git
|
|
113
|
+
cd mooreio_client
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
2. Set up Virtual Environment and install Dependencies:
|
|
117
|
+
```sh
|
|
118
|
+
make venv
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
3. Run tests:
|
|
122
|
+
```sh
|
|
123
|
+
make test
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
4. Build documentation:
|
|
127
|
+
```sh
|
|
128
|
+
make docs
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
5. Build package:
|
|
132
|
+
```sh
|
|
133
|
+
make build
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
6. Print Makefile User Manual:
|
|
137
|
+
```sh
|
|
138
|
+
make help
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
## Continuous Integration
|
|
142
|
+
Most popular CI/CD tools are supported out-of-the-box. Some systems are better fleshed out than others; please don't
|
|
143
|
+
hesitate to contribute your tweaks!
|
|
144
|
+
|
|
145
|
+
### Supported Continuous Integration Tools
|
|
146
|
+
- Azure Pipelines
|
|
147
|
+
- Bamboo
|
|
148
|
+
- Bitbucket Pipelines
|
|
149
|
+
- CircleCI
|
|
150
|
+
- Codeship
|
|
151
|
+
- GitHub Actions
|
|
152
|
+
- GitLab CI/CD
|
|
153
|
+
- Jenkins
|
|
154
|
+
- TeamCity
|
|
155
|
+
- Travis CI
|
|
156
|
+
|
|
157
|
+
## Contributing
|
|
158
|
+
|
|
159
|
+
We welcome contributions! Please see the [CONTRIBUTING.md](CONTRIBUTING.md) file for guidelines on how to contribute.
|
|
160
|
+
|
|
161
|
+
## License
|
|
162
|
+
|
|
163
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
164
|
+
|
|
165
|
+
## Contact
|
|
166
|
+
|
|
167
|
+
- Official site: [www.mooreio.com](http://www.mooreio.com)
|
|
168
|
+
- Copyright Holder: [Datum Technology Corporation](http://www.datumtc.ca)
|
|
File without changes
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Copyright 2020-2024 Datum Technology Corporation
|
|
2
|
+
# All rights reserved.
|
|
3
|
+
#######################################################################################################################
|
|
4
|
+
import sys
|
|
5
|
+
|
|
6
|
+
from mio_client.cli import main
|
|
7
|
+
|
|
8
|
+
if __name__ == "__main__":
|
|
9
|
+
sys.exit(main(sys.argv[1:]))
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
# Copyright 2020-2024 Datum Technology Corporation
|
|
2
|
+
# All rights reserved.
|
|
3
|
+
#######################################################################################################################
|
|
4
|
+
import argparse
|
|
5
|
+
import pathlib
|
|
6
|
+
import sys
|
|
7
|
+
import os
|
|
8
|
+
|
|
9
|
+
from mio_client.commands import sim, ip, misc, project, team, user, web, gen
|
|
10
|
+
from mio_client.core.root_manager import RootManager
|
|
11
|
+
|
|
12
|
+
#######################################################################################################################
|
|
13
|
+
# User Manual Top
|
|
14
|
+
#######################################################################################################################
|
|
15
|
+
VERSION = "2.0.2"
|
|
16
|
+
|
|
17
|
+
HELP_TEXT = f"""
|
|
18
|
+
Moore.io (`mio`) Client - v{VERSION}
|
|
19
|
+
User Manual: https://mio-client.readthedocs.io/
|
|
20
|
+
https://mooreio.com - Copyright 2020-2024 Datum Technology Corporation - https://datumtc.ca
|
|
21
|
+
Usage:
|
|
22
|
+
mio [--version] [--help]
|
|
23
|
+
mio [--wd WD] [--dbg] CMD [OPTIONS]
|
|
24
|
+
|
|
25
|
+
Options:
|
|
26
|
+
-v, --version
|
|
27
|
+
Prints the mio version and exits.
|
|
28
|
+
|
|
29
|
+
-h, --help
|
|
30
|
+
Prints the overall synopsis and a list of the most commonly used commands and exits.
|
|
31
|
+
|
|
32
|
+
-C WD, --wd WD
|
|
33
|
+
Run as if mio was started in WD (Working Directory) instead of the Present Working Directory `pwd`.
|
|
34
|
+
|
|
35
|
+
--dbg
|
|
36
|
+
Enables tracing outputs from mio.
|
|
37
|
+
|
|
38
|
+
Full Command List (`mio help CMD` for help on a specific command):
|
|
39
|
+
Help and Shell/Editor Integration
|
|
40
|
+
help Prints documentation for mio commands
|
|
41
|
+
|
|
42
|
+
Project and Code Management
|
|
43
|
+
init Creates essential files necessary for new Projects/IPs
|
|
44
|
+
|
|
45
|
+
IP and Credentials Management
|
|
46
|
+
install Installs all IP dependencies from IP Marketplace
|
|
47
|
+
login Starts session with IP Marketplace
|
|
48
|
+
package Creates a compressed (and encrypted) archive of an IP
|
|
49
|
+
publish Publishes IP to Server (must have mio admin account)
|
|
50
|
+
|
|
51
|
+
EDA Automation
|
|
52
|
+
clean Delete IP EDA artifacts and/or Moore.io Project directory contents (.mio)
|
|
53
|
+
sim Performs necessary steps to simulate an IP with any simulator
|
|
54
|
+
regr Runs regression against an IP
|
|
55
|
+
dox Generates source reference documentation with Doxygen"""
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
#######################################################################################################################
|
|
59
|
+
# Main
|
|
60
|
+
#######################################################################################################################
|
|
61
|
+
URL_BASE = 'https://mooreio.com'
|
|
62
|
+
URL_AUTHENTICATION = f'{URL_BASE}/auth/token'
|
|
63
|
+
TEST_MODE = False
|
|
64
|
+
USER_HOME_PATH = pathlib.Path(os.path.expanduser("~/.mio"))
|
|
65
|
+
root_manager: RootManager
|
|
66
|
+
def main(args=None) -> int:
|
|
67
|
+
"""
|
|
68
|
+
Main entry point. Performs the following steps in order:
|
|
69
|
+
- Create CLI argument parser
|
|
70
|
+
- Find all commands and register them
|
|
71
|
+
- Parse CLI arguments
|
|
72
|
+
- Find the command which matches the parsed arguments
|
|
73
|
+
- Create the Root instance
|
|
74
|
+
- Run the command via the Root instance
|
|
75
|
+
:return: Exit code
|
|
76
|
+
"""
|
|
77
|
+
global root_manager
|
|
78
|
+
|
|
79
|
+
try:
|
|
80
|
+
parser = create_top_level_parser()
|
|
81
|
+
subparsers = parser.add_subparsers(dest='command', help='Sub-command help')
|
|
82
|
+
commands = register_all_commands(subparsers)
|
|
83
|
+
args = parser.parse_args(args)
|
|
84
|
+
except Exception as e:
|
|
85
|
+
print(f"Error during parsing of CLI arguments: {e}", file=sys.stderr)
|
|
86
|
+
return 1
|
|
87
|
+
|
|
88
|
+
if args.version:
|
|
89
|
+
print_version_text()
|
|
90
|
+
return 0
|
|
91
|
+
if (not args.command) or args.help:
|
|
92
|
+
print_help_text()
|
|
93
|
+
return 0
|
|
94
|
+
|
|
95
|
+
command = next(
|
|
96
|
+
(
|
|
97
|
+
cmd for cmd in commands
|
|
98
|
+
if cmd.name().lower() == args.command
|
|
99
|
+
),
|
|
100
|
+
None
|
|
101
|
+
)
|
|
102
|
+
if not command:
|
|
103
|
+
print(f"Unknown command '{args.command}' specified.", file=sys.stderr)
|
|
104
|
+
return 1
|
|
105
|
+
|
|
106
|
+
wd = None
|
|
107
|
+
if args.wd is None:
|
|
108
|
+
wd = pathlib.Path.cwd()
|
|
109
|
+
else:
|
|
110
|
+
try:
|
|
111
|
+
wd = pathlib.Path(args.wd).resolve()
|
|
112
|
+
except Exception as e:
|
|
113
|
+
print(f"Invalid path '{wd}' provided as working directory: {e}", file=sys.stderr)
|
|
114
|
+
return 1
|
|
115
|
+
|
|
116
|
+
root_manager = RootManager("Moore.io Client Root Manager", wd, URL_BASE, URL_AUTHENTICATION, TEST_MODE, USER_HOME_PATH)
|
|
117
|
+
command.parsed_cli_arguments = args
|
|
118
|
+
|
|
119
|
+
if args.dbg:
|
|
120
|
+
root_manager.print_trace = True
|
|
121
|
+
|
|
122
|
+
return root_manager.run(command)
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
#######################################################################################################################
|
|
126
|
+
# Helper functions
|
|
127
|
+
#######################################################################################################################
|
|
128
|
+
def create_top_level_parser():
|
|
129
|
+
"""
|
|
130
|
+
Creates a top-level CLI argument parser.
|
|
131
|
+
:return: argparse.ArgumentParser object representing the top-level parser
|
|
132
|
+
"""
|
|
133
|
+
parser = argparse.ArgumentParser(prog="mio", description="", add_help=False)
|
|
134
|
+
parser.add_argument("-h" , "--help" , help="Shows this help message and exits.", action="store_true", default=False, required=False)
|
|
135
|
+
parser.add_argument("-v" , "--version", help="Prints version and exit." , action="store_true", default=False, required=False)
|
|
136
|
+
parser.add_argument("--dbg", help="Enable tracing output." , action="store_true", default=False, required=False)
|
|
137
|
+
parser.add_argument("-C" , "--wd" , help="Run as if mio was started in <path> instead of the current working directory.", type=pathlib.Path, required=False)
|
|
138
|
+
return parser
|
|
139
|
+
|
|
140
|
+
def register_all_commands(subparsers):
|
|
141
|
+
"""
|
|
142
|
+
Register all commands to the subparsers.
|
|
143
|
+
:param subparsers: An instance of argparse.ArgumentParser that contains the subparsers.
|
|
144
|
+
:return: A list of registered commands.
|
|
145
|
+
"""
|
|
146
|
+
commands = []
|
|
147
|
+
register_commands(commands, sim.get_commands())
|
|
148
|
+
register_commands(commands, ip.get_commands())
|
|
149
|
+
register_commands(commands, misc.get_commands())
|
|
150
|
+
register_commands(commands, project.get_commands())
|
|
151
|
+
register_commands(commands, team.get_commands())
|
|
152
|
+
register_commands(commands, user.get_commands())
|
|
153
|
+
register_commands(commands, web.get_commands())
|
|
154
|
+
register_commands(commands, gen.get_commands())
|
|
155
|
+
for command in commands:
|
|
156
|
+
command.add_to_subparsers(subparsers)
|
|
157
|
+
return commands
|
|
158
|
+
|
|
159
|
+
def register_commands(existing_commands, new_commands):
|
|
160
|
+
"""
|
|
161
|
+
Registers new commands into an existing list of commands.
|
|
162
|
+
:param existing_commands: A list of existing commands.
|
|
163
|
+
:param new_commands: A list of new commands to be registered.
|
|
164
|
+
:return: None
|
|
165
|
+
Raises:
|
|
166
|
+
ValueError: If a command name in `new_commands` is already registered in `existing_commands`.
|
|
167
|
+
|
|
168
|
+
"""
|
|
169
|
+
new_command_names = {command.name for command in new_commands}
|
|
170
|
+
existing_command_names = {command.name for command in existing_commands}
|
|
171
|
+
for command in new_commands:
|
|
172
|
+
if command.name not in existing_command_names:
|
|
173
|
+
existing_commands.append(command)
|
|
174
|
+
else:
|
|
175
|
+
raise ValueError(f"Command '{command}' is already registered.")
|
|
176
|
+
|
|
177
|
+
def print_help_text():
|
|
178
|
+
print(HELP_TEXT)
|
|
179
|
+
|
|
180
|
+
def print_version_text():
|
|
181
|
+
print(f"Moore.io Client v{VERSION}")
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
#######################################################################################################################
|
|
185
|
+
# Entry point
|
|
186
|
+
#######################################################################################################################
|
|
187
|
+
if __name__ == "__main__":
|
|
188
|
+
sys.exit(main(sys.argv[1:]))
|
|
File without changes
|