Class: SystemRDL::Evaluator::RegInstance

Inherits:
Instance
  • Object
show all
Includes:
ArrayInstance, InstTypeAwareInstance
Defined in:
lib/systemrdl/evaluator/reg.rb

Instance Attribute Summary collapse

Attributes included from InstTypeAwareInstance

#external

Attributes included from ArrayInstance

#array_info

Attributes inherited from Instance

#array_info, #definition, #instances, #name, #parent, #properties, #token_range

Instance Method Summary collapse

Methods included from ArrayInstance

#array?, #array_indices, #array_sizes, #first_element?, #last_element?

Methods inherited from Instance

#addrmap?, #array?, #element_name, #field?, #finalize, #find_addrmap, #full_name, #initialize, #layer, #mem?, #property, #property_value, #reg?, #regfile?, #revalidate, #root?, #structural_component?, #to_value, #upper_instances, #validate

Constructor Details

This class inherits a constructor from SystemRDL::Evaluator::Instance

Instance Attribute Details

#addressObject

Returns the value of attribute address.



221
222
223
# File 'lib/systemrdl/evaluator/reg.rb', line 221

def address
  @address
end

#alignmentObject

Returns the value of attribute alignment.



223
224
225
# File 'lib/systemrdl/evaluator/reg.rb', line 223

def alignment
  @alignment
end

#strideObject

Returns the value of attribute stride.



222
223
224
# File 'lib/systemrdl/evaluator/reg.rb', line 222

def stride
  @stride
end

Instance Method Details

#accesswidthObject



237
238
239
# File 'lib/systemrdl/evaluator/reg.rb', line 237

def accesswidth
  property_value(:accesswidth).value
end

#definable?(definition) ⇒ Boolean

Returns:



229
230
231
# File 'lib/systemrdl/evaluator/reg.rb', line 229

def definable?(definition)
  definition.layer in :field
end

#instantiable?(definition) ⇒ Boolean

Returns:



233
234
235
# File 'lib/systemrdl/evaluator/reg.rb', line 233

def instantiable?(definition)
  definable?(definition)
end

#sizeObject



241
242
243
# File 'lib/systemrdl/evaluator/reg.rb', line 241

def size
  property_value(:regwidth).value / 8
end

#sw_readable?Boolean

Returns:



245
246
247
# File 'lib/systemrdl/evaluator/reg.rb', line 245

def sw_readable?
  instances.any?(&:sw_readable?)
end

#sw_writable?Boolean

Returns:



249
250
251
# File 'lib/systemrdl/evaluator/reg.rb', line 249

def sw_writable?
  instances.any?(&:sw_writable?)
end

#virtual_reg?Boolean

Returns:



225
226
227
# File 'lib/systemrdl/evaluator/reg.rb', line 225

def virtual_reg?
  parent.mem?
end