Class: ManualVersion

Inherits:
ArchDefObject show all
Defined in:
lib/arch_obj_models/manual.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_defArchDef (readonly)

Returns The architecture definition.

Returns:

  • (ArchDef)

    The architecture definition



116
117
118
# File 'lib/arch_obj_models/manual.rb', line 116

def arch_def
  @arch_def
end

#manualManual (readonly)

Returns The manual this version belongs to.

Returns:

  • (Manual)

    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

#csrsArray<Csr>

Returns All csrs defined in this version.

Returns:

  • (Array<Csr>)

    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

#extensionsArray<ExtensionVersion>

Returns Array of extension versions in this manual version.

Returns:

  • (Array<ExtensionVersion>)

    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

#instructionsArray<Instruction>

Returns All instructions defined in this version.

Returns:

  • (Array<Instruction>)

    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_treeString

Returns The git tree-ish of riscv-isa-manual used by this version.

Returns:

  • (String)

    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_versionString

Returns Version name used by marketing.

Returns:

  • (String)

    Version name used by marketing



128
# File 'lib/arch_obj_models/manual.rb', line 128

def marketing_version = @data["marketing_version"]

#pathString

Returns Path to the directory containing contents.yaml file for this version.

Returns:

  • (String)

    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

#stateObject



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.

Returns:

  • (Boolean)

    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

#versionString

Returns Semantic version number.

Returns:

  • (String)

    Semantic version number



125
# File 'lib/arch_obj_models/manual.rb', line 125

def version = @data["version"]

#volumesArray<ManualVolume>

Returns All volumes defined in this manual version.

Returns:

  • (Array<ManualVolume>)

    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