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



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

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



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

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



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

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



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

def isa_manual_tree = @data["isa_manual_tree"]

#manualManual

Returns The manual this version belongs to.

Returns:

  • (Manual)

    The manual this version belongs to



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

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



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

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



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

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

#repo_path=(path) ⇒ Object



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

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

#stateObject



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

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



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

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

#versionString

Returns Semantic version number.

Returns:

  • (String)

    Semantic version number



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

def version = @data["version"]

#volumesArray<ManualVolume>

Returns All volumes defined in this manual version.

Returns:

  • (Array<ManualVolume>)

    All volumes defined in this manual version



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

def volumes
  return @volumes unless @volumes.nil?

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

  @volumes
end