Class: ManualVersion
- Inherits:
-
ArchDefObject
- Object
- ArchDefObject
- ManualVersion
- Defined in:
- lib/arch_obj_models/manual.rb
Instance Attribute Summary collapse
-
#arch_def ⇒ ArchDef
readonly
The architecture definition.
-
#manual ⇒ Manual
readonly
The manual this version belongs to.
Instance Method Summary collapse
-
#csrs ⇒ Array<Csr>
All csrs defined in this version.
-
#extensions ⇒ Array<ExtensionVersion>
Array of extension versions in this manual version.
-
#initialize(data, manual, arch_def) ⇒ ManualVersion
constructor
A new instance of ManualVersion.
-
#instructions ⇒ Array<Instruction>
All instructions defined in this version.
-
#isa_manual_tree ⇒ String
The git tree-ish of riscv-isa-manual used by this version.
-
#marketing_version ⇒ String
Version name used by marketing.
-
#path ⇒ String
Path to the directory containing contents.yaml file for this version.
- #state ⇒ Object
-
#uses_isa_manual? ⇒ Boolean
Whether or not this version is using riscv-isa-manual as a source.
-
#version ⇒ String
Semantic version number.
-
#volumes ⇒ Array<ManualVolume>
All volumes defined in this manual version.
Constructor Details
#initialize(data, manual, arch_def) ⇒ ManualVersion
Returns a new instance of ManualVersion.
118 119 120 121 122 |
# File 'lib/arch_obj_models/manual.rb', line 118 def initialize(data, manual, arch_def) super(data) @manual = manual @arch_def = arch_def end |
Instance Attribute Details
#arch_def ⇒ ArchDef (readonly)
Returns The architecture definition.
116 117 118 |
# File 'lib/arch_obj_models/manual.rb', line 116 def arch_def @arch_def end |
#manual ⇒ Manual (readonly)
Returns The manual this version belongs to.
113 114 115 |
# File 'lib/arch_obj_models/manual.rb', line 113 def manual @manual end |
Instance Method Details
#csrs ⇒ Array<Csr>
Returns All csrs defined in this version.
177 178 179 180 181 182 183 184 185 186 187 188 |
# File 'lib/arch_obj_models/manual.rb', line 177 def csrs return @csrs unless @csrs.nil? @csrs = [] extensions.each do |ext| ext_obj = @arch_def.extension(ext.name) ext_obj.csrs.each do |csr| @csrs << csr end end @csrs = @csrs.uniq(&:name) end |
#extensions ⇒ Array<ExtensionVersion>
Returns Array of extension versions in this manual version.
156 157 158 159 160 |
# File 'lib/arch_obj_models/manual.rb', line 156 def extensions return @extensions unless @extensions.nil? @extensions = volumes.map(&:extensions).flatten.uniq end |
#instructions ⇒ Array<Instruction>
Returns All instructions defined in this version.
163 164 165 166 167 168 169 170 171 172 173 174 |
# File 'lib/arch_obj_models/manual.rb', line 163 def instructions return @instructions unless @instructions.nil? @instructions = [] extensions.each do |ext| ext_obj = @arch_def.extension(ext.name) ext_obj.instructions.each do |inst| @instructions << inst end end @instructions = @instructions.uniq(&:name) end |
#isa_manual_tree ⇒ String
Returns The git tree-ish of riscv-isa-manual used by this version.
139 |
# File 'lib/arch_obj_models/manual.rb', line 139 def isa_manual_tree = @data["isa_manual_tree"] |
#marketing_version ⇒ String
Returns Version name used by marketing.
128 |
# File 'lib/arch_obj_models/manual.rb', line 128 def marketing_version = @data["marketing_version"] |
#path ⇒ String
Returns Path to the directory containing contents.yaml file for this version.
131 132 133 |
# File 'lib/arch_obj_models/manual.rb', line 131 def path File.dirname(@data["__source"]) end |
#state ⇒ Object
153 |
# File 'lib/arch_obj_models/manual.rb', line 153 def state = @data["state"] |
#uses_isa_manual? ⇒ Boolean
Returns Whether or not this version is using riscv-isa-manual as a source.
136 |
# File 'lib/arch_obj_models/manual.rb', line 136 def uses_isa_manual? = @data["uses_isa_manual"] == true |
#version ⇒ String
Returns Semantic version number.
125 |
# File 'lib/arch_obj_models/manual.rb', line 125 def version = @data["version"] |
#volumes ⇒ Array<ManualVolume>
Returns All volumes defined in this manual version.
142 143 144 145 146 147 148 149 150 151 |
# File 'lib/arch_obj_models/manual.rb', line 142 def volumes return @volumes unless @volumes.nil? @volumes = [] @data["volumes"].each do |volume| @volumes << ManualVolume.new(volume, self) end @volumes end |