Skip to content

Commit e18e631

Browse files
authored
Under development (#25)
Fixed - Moved machine timer nodes to platform yaml. Added - --version option to arguments to print version and exit when specified. - Print help and exit when no options/arguments are specified. - Closes #24
1 parent e9cc028 commit e18e631

File tree

9 files changed

+95
-233
lines changed

9 files changed

+95
-233
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
44

5+
## 2.1.0 - 2020-03-29
6+
## Fixed
7+
- Moved machine timer nodes to platform yaml.
8+
## Added
9+
- `--version` option to arguments to print version and exit when specified.
10+
- Print help and exit when no options/arguments are specified.
11+
512
## 2.0.2 - 2020-03-28
613
### Fixed
714
- Redundant reset-val check for mtvec and misa registers.

docs/source/quickstart.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,20 +78,21 @@ Once you have RISCV_CONFIG installed, executing ``riscv_config --help`` should p
7878

7979
.. code-block:: bash
8080
81-
riscv-config [-h] --isa_spec YAML --platform_spec YAML [--verbose]
82-
83-
RISC-V Configuration Validator
81+
riscv_config [-h] [--version] [--isa_spec YAML] [--platform_spec YAML]
82+
[--work_dir DIR] [--verbose]
83+
84+
RISC-V Configuration Validator
8485
8586
optional arguments:
8687
--isa_spec YAML, -ispec YAML
8788
The YAML which contains the ISA specs.
8889
--platform_spec YAML, -pspec YAML
8990
The YAML which contains the Platfrorm specs.
9091
--verbose debug | info | warning | error
92+
--version, -v Print version of RISCV-CONFIG being used
93+
--work_dir DIR The name of the work dir to dump the output files to.
9194
-h, --help show this help message and exit
9295
93-
94-
9596
RISCV_CONFIG for Developers
9697
===========================
9798

examples/rv32i_isa.yaml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,6 @@ mvendorid:
2323
ro_constant: [0xdeadbeef]
2424
rv64:
2525
implemented: false
26-
27-
mtime:
28-
rv32:
29-
implemented: false
30-
rv64:
31-
implemented: false
32-
mtimecmp:
33-
rv32:
34-
implemented: false
35-
rv64:
36-
implemented: false
37-
3826
mtvec:
3927
reset-val: 0x80010000
4028
rv32:

examples/rv64i_isa.yaml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,6 @@ mvendorid:
2424
implemented: true
2525
type:
2626
ro_constant: [0xdeadbeef]
27-
mtime:
28-
rv32:
29-
implemented: false
30-
rv64:
31-
implemented: false
32-
mtimecmp:
33-
rv32:
34-
implemented: false
35-
rv64:
36-
implemented: false
37-
3827
mtvec:
3928
reset-val: 0x0000000080000000
4029
rv64:

riscv_config/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
from pkgutil import extend_path
22
__path__ = extend_path(__path__, __name__)
3-
__version__ = "2.0.2"
3+
__version__ = "2.1.0"

riscv_config/main.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import logging
22
import os
3+
import sys
34
import shutil
5+
from riscv_config import __version__ as version
46
import riscv_config.checker as checker
57
import riscv_config.utils as utils
68
from riscv_config.errors import ValidationError
@@ -13,6 +15,13 @@ def main():
1315
# Set up the parser
1416
parser = utils.riscv_config_cmdline_args()
1517
args = parser.parse_args()
18+
if len(sys.argv) < 2:
19+
parser.print_help()
20+
raise SystemExit
21+
if (args.version):
22+
print('RISCV-CONFIG: RISC-V Configuration Validator')
23+
print('Version: ' + version)
24+
return 0
1625

1726
# Set up the logger
1827
utils.setup_logging(args.verbose)

riscv_config/schemas/schema_isa.yaml

Lines changed: 0 additions & 198 deletions
Original file line numberDiff line numberDiff line change
@@ -4111,204 +4111,6 @@ mie:
41114111
implemented: true
41124112
required: true
41134113
required: true
4114-
mtime:
4115-
type: dict
4116-
schema:
4117-
description:
4118-
type: string
4119-
default: Memory mapped timer register.
4120-
address:
4121-
type: integer
4122-
priv_mode:
4123-
type: string
4124-
allowed:
4125-
- M
4126-
default: M
4127-
reset-val:
4128-
type: integer
4129-
check_with: max_length
4130-
default: 0
4131-
rv32:
4132-
type: dict
4133-
schema:
4134-
implemented:
4135-
type: boolean
4136-
default: false
4137-
check_with: rv32_check
4138-
fields:
4139-
type: list
4140-
default: []
4141-
shadow:
4142-
type: string
4143-
default: none
4144-
msb:
4145-
type: integer
4146-
default: 63
4147-
allowed:
4148-
- 63
4149-
lsb:
4150-
type: integer
4151-
default: 0
4152-
allowed:
4153-
- 0
4154-
type:
4155-
type: dict
4156-
check_with: wr_illegal
4157-
oneof:
4158-
- schema:
4159-
ro_constant:
4160-
type: list
4161-
schema:
4162-
type: integer
4163-
max: 4611686018427387903
4164-
maxlength: 1
4165-
- schema:
4166-
ro_variable:
4167-
type: boolean
4168-
- schema:
4169-
warl: *id001
4170-
default:
4171-
implemented: false
4172-
rv64:
4173-
type: dict
4174-
schema:
4175-
implemented:
4176-
default: false
4177-
check_with: rv64_check
4178-
fields:
4179-
type: list
4180-
default: []
4181-
shadow:
4182-
type: string
4183-
default: none
4184-
msb:
4185-
type: integer
4186-
default: 63
4187-
allowed:
4188-
- 63
4189-
lsb:
4190-
type: integer
4191-
default: 0
4192-
allowed:
4193-
- 0
4194-
type:
4195-
type: dict
4196-
check_with: wr_illegal
4197-
oneof:
4198-
- schema:
4199-
ro_constant:
4200-
type: list
4201-
schema:
4202-
type: integer
4203-
max: 4611686018427387903
4204-
maxlength: 1
4205-
- schema:
4206-
ro_variable:
4207-
type: boolean
4208-
- schema:
4209-
warl: *id001
4210-
default:
4211-
implemented: false
4212-
required: true
4213-
mtimecmp:
4214-
type: dict
4215-
schema:
4216-
description:
4217-
type: string
4218-
default: Memory mapped timer compare register.
4219-
address:
4220-
type: integer
4221-
priv_mode:
4222-
type: string
4223-
allowed:
4224-
- M
4225-
default: M
4226-
reset-val:
4227-
type: integer
4228-
default: 0
4229-
check_with: max_length
4230-
rv32:
4231-
type: dict
4232-
schema:
4233-
implemented:
4234-
type: boolean
4235-
default: false
4236-
check_with: rv32_check
4237-
fields:
4238-
type: list
4239-
default: []
4240-
shadow:
4241-
type: string
4242-
default: none
4243-
msb:
4244-
type: integer
4245-
default: 63
4246-
allowed:
4247-
- 63
4248-
lsb:
4249-
type: integer
4250-
default: 0
4251-
allowed:
4252-
- 0
4253-
type:
4254-
type: dict
4255-
check_with: wr_illegal
4256-
oneof:
4257-
- schema:
4258-
ro_constant:
4259-
type: list
4260-
schema:
4261-
type: integer
4262-
max: 4611686018427387903
4263-
maxlength: 1
4264-
- schema:
4265-
ro_variable:
4266-
type: boolean
4267-
- schema:
4268-
warl: *id001
4269-
default:
4270-
implemented: false
4271-
rv64:
4272-
type: dict
4273-
schema:
4274-
implemented:
4275-
default: false
4276-
check_with: rv64_check
4277-
fields:
4278-
type: list
4279-
default: []
4280-
shadow:
4281-
type: string
4282-
default: none
4283-
msb:
4284-
type: integer
4285-
default: 63
4286-
allowed:
4287-
- 63
4288-
lsb:
4289-
type: integer
4290-
default: 0
4291-
allowed:
4292-
- 0
4293-
type:
4294-
type: dict
4295-
check_with: wr_illegal
4296-
oneof:
4297-
- schema:
4298-
ro_constant:
4299-
type: list
4300-
schema:
4301-
type: integer
4302-
max: 4611686018427387903
4303-
maxlength: 1
4304-
- schema:
4305-
ro_variable:
4306-
type: boolean
4307-
- schema:
4308-
warl: *id001
4309-
default:
4310-
implemented: false
4311-
required: true
43124114
mscratch:
43134115
type: dict
43144116
schema:

riscv_config/schemas/schema_platform.yaml

Lines changed: 65 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,69 @@ nmi:
5757
excludes: ['label']
5858
required: True
5959

60+
###
61+
#mtime
62+
#-----
63+
#
64+
# **Description**: Stores the fields for memory mapped *mtime* register.
65+
#
66+
# * implemented: A boolean field indicating that the register has been implemented.
67+
# * address: A value equal to the physical address at which the register is present.
68+
#
69+
# **Examples**:
70+
#
71+
# .. code-block:: yaml
72+
#
73+
# mtime:
74+
# implemented: True
75+
# address: 0x458
76+
#
77+
# **Constraints**:
78+
#
79+
# - None
80+
81+
mtime:
82+
type: dict
83+
schema:
84+
address:
85+
type: integer
86+
implemented:
87+
type: boolean
88+
default: False
89+
default:
90+
implemented: False
91+
92+
###
93+
#mtimecmp
94+
#--------
95+
#
96+
# **Description**: Stores the fields for memory mapped *mtimecmp* register.
97+
#
98+
# * implemented: A boolean field indicating that the register has been implemented.
99+
# * address: A value equal to the physical address at which the register is present.
100+
#
101+
# **Examples**:
102+
#
103+
# .. code-block:: yaml
104+
#
105+
# mtimecmp:
106+
# implemented: True
107+
# address: 0x458
108+
#
109+
# **Constraints**:
110+
#
111+
# - None
112+
113+
mtimecmp:
114+
type: dict
115+
schema:
116+
address:
117+
type: integer
118+
implemented:
119+
type: boolean
120+
default: False
121+
default:
122+
implemented: False
60123

61124
###
62125
#mcause_non_standard
@@ -75,7 +138,8 @@ nmi:
75138
# implemented: True
76139
# value: [16,17,20]
77140
#
78-
# **Constraints**:
141+
# **Constraints**:
142+
#
79143
# - None
80144

81145
mcause_non_standard:

0 commit comments

Comments
 (0)