Class: Udb::ManualVersion

Inherits:
TopLevelDatabaseObject show all
Defined in:
lib/udb/obj/manual.rb

Instance Method Summary collapse

Constructor Details

This class inherits a constructor from Udb::TopLevelDatabaseObject

Instance Method Details

#csrsArray<Csr>

Returns All csrs defined in this version.

Returns:

  • (Array<Csr>)

    All csrs defined in this version



188
189
190
191
192
193
194
195
196
197
198
199
# File 'lib/udb/obj/manual.rb', line 188

def csrs
  return @csrs unless @csrs.nil?

  @csrs = []
  extensions.each do |ext|
    ext_obj = @cfg_arch.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



167
168
169
170
171
# File 'lib/udb/obj/manual.rb', line 167

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



174
175
176
177
178
179
180
181
182
183
184
185
# File 'lib/udb/obj/manual.rb', line 174

def instructions
  return @instructions unless @instructions.nil?

  @instructions = []
  extensions.each do |ext|
    ext_obj = @cfg_arch.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



150
# File 'lib/udb/obj/manual.rb', line 150

def isa_manual_tree = @data["isa_manual_tree"]

#manualManual

Returns The manual this version belongs to.

Returns:

  • (Manual)

    The manual this version belongs to



126
127
128
129
130
131
132
133
# File 'lib/udb/obj/manual.rb', line 126

def manual
  return @manual unless @manual.nil?

  @manual = @arch.ref(@data["manual"]["$ref"])
  raise "Error: manual #{@data['manual']['$ref']} is not found" if @manual.nil?

  @manual
end

#marketing_versionString

Returns Version name used by marketing.

Returns:

  • (String)

    Version name used by marketing



139
# File 'lib/udb/obj/manual.rb', line 139

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



142
143
144
# File 'lib/udb/obj/manual.rb', line 142

def path
  File.dirname(@data["$source"])
end

#repo_path=(path) ⇒ Object



201
202
203
204
# File 'lib/udb/obj/manual.rb', line 201

def repo_path=(path)
  @repo_path = path
  volumes.each { |v| v.repo_path = path }
end

#stateObject



164
# File 'lib/udb/obj/manual.rb', line 164

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



147
# File 'lib/udb/obj/manual.rb', line 147

def uses_isa_manual? = @data["uses_isa_manual"] == true

#versionString

Returns Semantic version number.

Returns:

  • (String)

    Semantic version number



136
# File 'lib/udb/obj/manual.rb', line 136

def version = @data["version"]

#volumesArray<ManualVolume>

Returns All volumes defined in this manual version.

Returns:

  • (Array<ManualVolume>)

    All volumes defined in this manual version



153
154
155
156
157
158
159
160
161
162
# File 'lib/udb/obj/manual.rb', line 153

def volumes
  return @volumes unless @volumes.nil?

  @volumes = []
  @data["volumes"].each do |volume|
    @volumes << ManualVolume.new(volume, self)
  end

  @volumes
end