Class: OrigenSim::Simulator::SnapshotDetails

Inherits:
UserDetails
  • Object
show all
Defined in:
lib/origen_sim/simulator/snapshot_details.rb

Overview

The SnapshotDetails and UserDetails share a lot in common, with the SnapshotDetails containing a bit of extra stuff.

Constant Summary

Constants inherited from UserDetails

UserDetails::DETAIL_NAMES_NET

Instance Attribute Summary collapse

Attributes inherited from UserDetails

#cache, #details

Instance Method Summary collapse

Methods inherited from UserDetails

#[], #available_details, #detail_names_net, #fetch, #method_missing, #to_ary

Constructor Details

#initialize(simulator:, cache: true) ⇒ SnapshotDetails

Returns a new instance of SnapshotDetails.



10
11
12
13
14
15
# File 'lib/origen_sim/simulator/snapshot_details.rb', line 10

def initialize(simulator:, cache: true)
  # @fetch_error_message = "OrigenSim was unable to find net #{detail_names_net} in the snapshot! Unable to retrieve snapshot details!"
  super(simulator: simulator, cache: cache)

  @_user_details = UserDetails.new(simulator: simulator, cache: cache)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class OrigenSim::Simulator::UserDetails

Instance Attribute Details

#_user_detailsObject (readonly)

Returns the value of attribute _user_details.



8
9
10
# File 'lib/origen_sim/simulator/snapshot_details.rb', line 8

def _user_details
  @_user_details
end

Instance Method Details

#_missing_detail_message(d) ⇒ Object



21
22
23
# File 'lib/origen_sim/simulator/snapshot_details.rb', line 21

def _missing_detail_message(d)
  "Detail '#{d}' is not an available snapshot detail name!"
end

#detail_to_net(d) ⇒ Object



17
18
19
# File 'lib/origen_sim/simulator/snapshot_details.rb', line 17

def detail_to_net(d)
  "#{@simulator.testbench_top}.debug.snapshot_details.#{d}"
end

#user_detail(d) ⇒ Object



36
37
38
# File 'lib/origen_sim/simulator/snapshot_details.rb', line 36

def user_detail(d)
  user_details(d)
end

#user_details(d = nil) ⇒ Object

The user details interface is the same as the snapshot_details ### just on the snapshot_details itself ###



28
29
30
31
32
33
34
# File 'lib/origen_sim/simulator/snapshot_details.rb', line 28

def user_details(d = nil)
  if d
    _user_details[d]
  else
    _user_details
  end
end