origen 0.60.7 → 0.60.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (127) hide show
  1. checksums.yaml +4 -4
  2. data/config/rubocop/easy.yml +4875 -308
  3. data/config/rubocop/strict.yml +4875 -308
  4. data/config/version.rb +1 -1
  5. data/lib/origen/application/configuration.rb +6 -3
  6. data/lib/origen/application/deployer.rb +4 -4
  7. data/lib/origen/application/environment.rb +4 -2
  8. data/lib/origen/application/lsf.rb +23 -4
  9. data/lib/origen/application/lsf_manager.rb +48 -52
  10. data/lib/origen/application/plugins.rb +7 -7
  11. data/lib/origen/application/release.rb +5 -3
  12. data/lib/origen/application/runner.rb +5 -6
  13. data/lib/origen/application/statistics.rb +1 -0
  14. data/lib/origen/application/target.rb +9 -6
  15. data/lib/origen/application/version_tracker.rb +4 -5
  16. data/lib/origen/application/workspace_manager.rb +5 -2
  17. data/lib/origen/application.rb +9 -9
  18. data/lib/origen/boot/api.rb +3 -0
  19. data/lib/origen/boot/app.rb +28 -30
  20. data/lib/origen/boot.rb +1 -0
  21. data/lib/origen/bugs.rb +2 -2
  22. data/lib/origen/chip_mode.rb +7 -4
  23. data/lib/origen/chip_package.rb +50 -53
  24. data/lib/origen/chips/chip.rb +8 -4
  25. data/lib/origen/chips.rb +16 -12
  26. data/lib/origen/client.rb +1 -0
  27. data/lib/origen/clocks/clock.rb +8 -7
  28. data/lib/origen/clocks/clocks_collection.rb +2 -1
  29. data/lib/origen/code_generators/actions.rb +1 -1
  30. data/lib/origen/code_generators/base.rb +1 -1
  31. data/lib/origen/code_generators.rb +3 -0
  32. data/lib/origen/commands/archive.rb +1 -1
  33. data/lib/origen/commands/compile.rb +2 -2
  34. data/lib/origen/commands/fetch.rb +1 -1
  35. data/lib/origen/commands/generate.rb +3 -3
  36. data/lib/origen/commands/interactive.rb +6 -7
  37. data/lib/origen/commands/lint.rb +1 -1
  38. data/lib/origen/commands/lsf.rb +2 -2
  39. data/lib/origen/commands/new.rb +1 -1
  40. data/lib/origen/commands/plugin.rb +2 -2
  41. data/lib/origen/commands/program.rb +3 -3
  42. data/lib/origen/commands/rc.rb +4 -4
  43. data/lib/origen/commands/save.rb +1 -1
  44. data/lib/origen/commands/time.rb +4 -6
  45. data/lib/origen/commands/web.rb +5 -2
  46. data/lib/origen/commands.rb +1 -1
  47. data/lib/origen/componentable.rb +1 -0
  48. data/lib/origen/controller.rb +11 -13
  49. data/lib/origen/core_ext/array.rb +2 -1
  50. data/lib/origen/core_ext/enumerable.rb +4 -2
  51. data/lib/origen/core_ext/hash.rb +5 -6
  52. data/lib/origen/core_ext/integer.rb +2 -4
  53. data/lib/origen/core_ext/object.rb +2 -2
  54. data/lib/origen/core_ext/option_parser/optparse.rb +1 -1
  55. data/lib/origen/core_ext/string.rb +8 -8
  56. data/lib/origen/database/key_value_store.rb +12 -14
  57. data/lib/origen/database/key_value_stores.rb +1 -0
  58. data/lib/origen/errata/hw_erratum.rb +1 -1
  59. data/lib/origen/errata.rb +7 -8
  60. data/lib/origen/features/feature.rb +1 -0
  61. data/lib/origen/features.rb +4 -6
  62. data/lib/origen/file_handler.rb +8 -7
  63. data/lib/origen/fuses/fuse_field.rb +2 -2
  64. data/lib/origen/generator/compiler.rb +2 -4
  65. data/lib/origen/generator/job.rb +3 -2
  66. data/lib/origen/generator/pattern.rb +3 -3
  67. data/lib/origen/generator/pattern_finder.rb +6 -5
  68. data/lib/origen/generator/pattern_sequence.rb +3 -0
  69. data/lib/origen/generator/renderer.rb +3 -4
  70. data/lib/origen/generator/resources.rb +1 -1
  71. data/lib/origen/generator/stage.rb +3 -0
  72. data/lib/origen/limits/limit.rb +14 -11
  73. data/lib/origen/limits/limit_set.rb +2 -1
  74. data/lib/origen/loader.rb +4 -2
  75. data/lib/origen/log.rb +3 -2
  76. data/lib/origen/memory.rb +1 -0
  77. data/lib/origen/model.rb +10 -4
  78. data/lib/origen/models.rb +2 -2
  79. data/lib/origen/netlist/list.rb +1 -0
  80. data/lib/origen/netlist.rb +5 -7
  81. data/lib/origen/org_file/interceptor.rb +1 -1
  82. data/lib/origen/org_file.rb +4 -1
  83. data/lib/origen/parameters/set.rb +1 -0
  84. data/lib/origen/parameters.rb +3 -1
  85. data/lib/origen/pins/pin.rb +18 -12
  86. data/lib/origen/pins/pin_bank.rb +3 -0
  87. data/lib/origen/pins/pin_clock.rb +3 -2
  88. data/lib/origen/pins/pin_collection.rb +3 -0
  89. data/lib/origen/pins/timing/wave.rb +5 -0
  90. data/lib/origen/pins.rb +7 -1
  91. data/lib/origen/ports.rb +1 -1
  92. data/lib/origen/power_domains/power_domain.rb +5 -2
  93. data/lib/origen/power_domains/power_domains_collection.rb +2 -1
  94. data/lib/origen/registers/bit.rb +21 -17
  95. data/lib/origen/registers/bit_collection.rb +15 -6
  96. data/lib/origen/registers/reg.rb +34 -28
  97. data/lib/origen/registers.rb +25 -24
  98. data/lib/origen/remote_manager.rb +3 -2
  99. data/lib/origen/revision_control/base.rb +1 -4
  100. data/lib/origen/revision_control/design_sync.rb +10 -10
  101. data/lib/origen/revision_control/git.rb +4 -2
  102. data/lib/origen/site_config/config.rb +3 -1
  103. data/lib/origen/site_config.rb +3 -0
  104. data/lib/origen/specs/checkers.rb +12 -8
  105. data/lib/origen/specs/doc_resource.rb +3 -4
  106. data/lib/origen/specs/spec.rb +5 -1
  107. data/lib/origen/specs/version_history.rb +1 -1
  108. data/lib/origen/specs.rb +52 -37
  109. data/lib/origen/sub_blocks.rb +20 -14
  110. data/lib/origen/top_level.rb +2 -1
  111. data/lib/origen/users/user.rb +4 -5
  112. data/lib/origen/utility/csv_data.rb +6 -4
  113. data/lib/origen/utility/diff.rb +9 -9
  114. data/lib/origen/utility/file_diff.rb +4 -0
  115. data/lib/origen/utility/input_capture.rb +6 -6
  116. data/lib/origen/utility/mailer.rb +8 -11
  117. data/lib/origen/utility/time_and_date.rb +1 -2
  118. data/lib/origen/utility.rb +2 -2
  119. data/lib/origen/value.rb +2 -1
  120. data/lib/origen/version_string.rb +33 -41
  121. data/lib/origen.rb +62 -64
  122. data/origen_app_generators/origen_app_generators.gemspec +1 -1
  123. metadata +9 -27
  124. data/config/rubocop/easy_disabled.yml +0 -275
  125. data/config/rubocop/easy_enabled.yml +0 -727
  126. data/config/rubocop/strict_disabled.yml +0 -251
  127. data/config/rubocop/strict_enabled.yml +0 -751
@@ -30,7 +30,7 @@ module Origen
30
30
  attr_accessor :invert
31
31
  # Attribute used to generate vectors where the pin state is assigned the
32
32
  # repeat_previous opcode, used by Tester#repeat_previous
33
- attr_accessor :repeat_previous
33
+ attr_reader :repeat_previous
34
34
  attr_reader :owner
35
35
  attr_reader :size
36
36
  # Returns a hash containing the aliases associated with the given pin
@@ -41,15 +41,15 @@ module Origen
41
41
  attr_accessor :supply
42
42
  attr_accessor :supply_str
43
43
  # Boolean on whether pin is open drain
44
- attr_accessor :open_drain
44
+ attr_reader :open_drain
45
45
  # Boolean on whether pin has external pull-up
46
- attr_accessor :ext_pullup
46
+ attr_reader :ext_pullup
47
47
  # Boolean on whether pin has external pull-down
48
- attr_accessor :ext_pulldown
48
+ attr_reader :ext_pulldown
49
49
  # Pin type, either :analog or :digital
50
- attr_accessor :type
50
+ attr_reader :type
51
51
  # Pin RTL name
52
- attr_accessor :rtl_name
52
+ attr_writer :rtl_name
53
53
  # Value to be forced on the pin, e.g. during simulation
54
54
  attr_accessor :force
55
55
 
@@ -694,7 +694,7 @@ module Origen
694
694
  # If val is a data bit extract the value of it
695
695
  val = val.respond_to?(:data) ? val.data : val
696
696
  # Assume driving/asserting a nil value means 0
697
- val = 0 unless val
697
+ val ||= 0
698
698
  if !val.x_or_z? && val > 1
699
699
  fail "Attempt to set a value of #{val} on pin #{name}"
700
700
  end
@@ -1047,6 +1047,7 @@ module Origen
1047
1047
 
1048
1048
  def toggle_clock
1049
1049
  fail "ERROR: Clock on #{@owner.name} not running." unless is_a_running_clock?
1050
+
1050
1051
  @clock.toggle
1051
1052
  end
1052
1053
 
@@ -1090,11 +1091,12 @@ module Origen
1090
1091
  end
1091
1092
  end
1092
1093
 
1093
- def index?(context: nil)
1094
- !!index(context: context).nil?
1094
+ def index?(options = { context: nil })
1095
+ !!index(options).nil?
1095
1096
  end
1096
1097
 
1097
- def index(context: nil)
1098
+ def index(options = { context: nil })
1099
+ context = options[:context]
1098
1100
  if context.is_a?(Symbol)
1099
1101
  # Context pin group provided
1100
1102
  group = groups[context].instance_variable_get(:@store)
@@ -1114,7 +1116,8 @@ module Origen
1114
1116
  end
1115
1117
  end
1116
1118
 
1117
- def mask(context: nil)
1119
+ def mask(options = { context: nil })
1120
+ context = options[:context]
1118
1121
  index = context.is_a?(Integer) ? context : self.index(context: context)
1119
1122
 
1120
1123
  if index.nil? && context.nil?
@@ -1130,7 +1133,10 @@ module Origen
1130
1133
  alias_method :set_mask, :mask
1131
1134
  alias_method :smask, :mask
1132
1135
 
1133
- def clear_mask(context: nil, size: nil)
1136
+ def clear_mask(options = { context: nil, size: nil })
1137
+ context = options[:context]
1138
+ size = options[:size]
1139
+
1134
1140
  index = context.is_a?(Integer) ? context : self.index(context: context)
1135
1141
 
1136
1142
  if index.nil? && context.nil?
@@ -33,6 +33,7 @@ module Origen
33
33
  if bank[pin.id]
34
34
  fail "A pin with id #{pin.id} already exists!"
35
35
  end
36
+
36
37
  all_ids << pin.id
37
38
  bank[pin.id] = pin
38
39
  # If ends in a number
@@ -248,6 +249,7 @@ module Origen
248
249
  # First delete the pin from any of the pin groups it resides
249
250
  Origen.pin_bank.pin_groups.each do |_name, grp|
250
251
  next unless grp.store.include?(pin)
252
+
251
253
  grp.delete(pin)
252
254
  end
253
255
  # Now delete the pin from the pin bank
@@ -391,6 +393,7 @@ module Origen
391
393
  if pins.size > 1
392
394
  fail "Mutliple pins with the alias #{id} have been found in the current scope!"
393
395
  end
396
+
394
397
  pins.first
395
398
  end
396
399
  end
@@ -85,10 +85,10 @@ module Origen
85
85
 
86
86
  def update_tester_period_local
87
87
  if Origen.tester.current_period_in_ns == @tester_period_in_ns
88
- return false
88
+ false
89
89
  else
90
90
  @tester_period_in_ns = Origen.tester.current_period_in_ns
91
- return true
91
+ true
92
92
  end
93
93
  end
94
94
 
@@ -127,6 +127,7 @@ module Origen
127
127
 
128
128
  return @clock_period_in_ns if p.empty?
129
129
  fail "[Pin Clock] ERROR: Multiple unit declarations for #{@owner.name}.clock" if p.size > 1
130
+
130
131
  p[0].to_int
131
132
  end
132
133
 
@@ -62,6 +62,7 @@ module Origen
62
62
  # pin_group.to_vector # => "LLLLLLLL"
63
63
  def to_vector
64
64
  return @vector_formatted_value if @vector_formatted_value
65
+
65
66
  vals = map(&:to_vector)
66
67
  vals.reverse! if endian == :little
67
68
  @vector_formatted_value = vals.join('')
@@ -90,6 +91,7 @@ module Origen
90
91
  unless val.size == size
91
92
  fail 'When setting vector_formatted_value on a pin group you must supply values for all pins!'
92
93
  end
94
+
93
95
  val.split(//).reverse.each_with_index do |val, i|
94
96
  myself[i].vector_formatted_value = val
95
97
  end
@@ -507,6 +509,7 @@ pins(:some_group).map(&:id).sort
507
509
 
508
510
  def clean_value(val)
509
511
  return val if val.respond_to?(:contains_bits?)
512
+
510
513
  val = val.data if val.respond_to?('data')
511
514
  if val.is_a?(String) || val.is_a?(Symbol)
512
515
  Origen::Value.new(val)
@@ -99,11 +99,13 @@ module Origen
99
99
  unless valid.include?(data)
100
100
  fail "Uknown data value #{data}, only these are valid: #{valid.join(', ')}"
101
101
  end
102
+
102
103
  yield data
103
104
  end
104
105
 
105
106
  def calc
106
107
  return @calc if @calc
108
+
107
109
  require 'dentaku'
108
110
  @calc = Dentaku::Calculator.new
109
111
  end
@@ -122,6 +124,7 @@ module Origen
122
124
  unless options[:at]
123
125
  fail 'When defining a wave event you must supply the time via the option :at'
124
126
  end
127
+
125
128
  t = options[:at]
126
129
 
127
130
  if t.is_a?(String)
@@ -129,10 +132,12 @@ module Origen
129
132
  unless d.empty?
130
133
  fail "Wave time formulas can only include the variable 'period' (or 'period_in_ns'), this variable is not allowed: #{d}"
131
134
  end
135
+
132
136
  t = t.gsub('period_in_ns', 'period')
133
137
  unless calc.evaluate(t, period: 100)
134
138
  fail "There appears to be an error in the formula: #{t}"
135
139
  end
140
+
136
141
  yield t
137
142
  return
138
143
  elsif t.is_a?(Numeric)
data/lib/origen/pins.rb CHANGED
@@ -693,7 +693,13 @@ If you meant to define the virtual_pin_group then use the add_virtual_pin_group
693
693
  end
694
694
  alias_method :virtual_pin_group, :virtual_pin_groups
695
695
 
696
- def all_pin_ids(type: nil, **options)
696
+ def all_pin_ids(*options)
697
+ type = nil
698
+ if options.first.is_a?(Hash)
699
+ options = options.first
700
+ type = options[:type]
701
+ end
702
+
697
703
  case type
698
704
  when :power_pin, :power_pins
699
705
  dut.pins(power_pin: true).map { |n, p| [n, *p.aliases.keys] }.flatten.map { |n| [n, dut.power_pin(n)] }.to_h
data/lib/origen/ports.rb CHANGED
@@ -2,7 +2,7 @@ module Origen
2
2
  module Ports
3
3
  autoload :Port, 'origen/ports/port'
4
4
  autoload :Section, 'origen/ports/section'
5
- autoload :BitCollection, 'origen/ports/bit_collection'
5
+ autoload :BitCollection, 'origen/ports/bit_collection'
6
6
  autoload :PortCollection, 'origen/ports/port_collection'
7
7
 
8
8
  def add_port(name, options = {})
@@ -3,7 +3,8 @@ module Origen
3
3
  module PowerDomains
4
4
  class PowerDomain
5
5
  include Origen::Specs
6
- attr_accessor :id, :description, :unit_voltage_range, :nominal_voltage, :setpoint, :maximum_voltage_rating, :min, :max
6
+ attr_accessor :id, :description, :min, :max
7
+ attr_writer :maximum_voltage_rating, :nominal_voltage, :unit_voltage_range
7
8
 
8
9
  # Generic Power Domain Name
9
10
  # This is the power supply that can be blocked off to multiple power supplies
@@ -38,6 +39,7 @@ module Origen
38
39
  (block.arity < 1 ? (instance_eval(&block)) : block.call(self)) if block_given?
39
40
  @unit_voltage_range = :fixed if @unit_voltage_range.nil?
40
41
  fail unless attrs_ok?
42
+
41
43
  create_dut_spec unless @min.nil? || @max.nil?
42
44
  end
43
45
 
@@ -110,7 +112,7 @@ module Origen
110
112
 
111
113
  # Checks for a pin type, returns nil if it is not found
112
114
  def pin_type(pin)
113
- if self.has_pin?(pin) == false
115
+ if has_pin?(pin) == false
114
116
  nil
115
117
  else
116
118
  [:signal, :ground, :power].each do |pintype|
@@ -152,6 +154,7 @@ module Origen
152
154
  # This will need rework once the class has spec limits added
153
155
  def setpoint_ok?(val = nil)
154
156
  return true if maximum_voltage_rating.nil?
157
+
155
158
  compare_val = val.nil? ? setpoint : val
156
159
  if compare_val.nil?
157
160
  false
@@ -14,6 +14,7 @@ module Origen
14
14
  attr_getter = attr.to_s[/\@(\S+)/, 1].to_sym
15
15
  attr_val = domain.send attr_getter
16
16
  next unless [String, Numeric, Float, Integer, Symbol, Range].include? attr_val.class
17
+
17
18
  headers << attr_getter unless headers.include?(attr_getter)
18
19
  str = case attr_val
19
20
  when Range
@@ -22,7 +23,7 @@ module Origen
22
23
  "#{start_voltage}\.\.#{end_voltage}"
23
24
  else
24
25
  attr_val.to_s
25
- end
26
+ end
26
27
  curr_longest = [attr_getter, str].max_by(&:length).size + 2 # Add 2 for the whitespace
27
28
  if colhash[attr].nil? || (colhash[attr] < curr_longest)
28
29
  colhash[attr] = curr_longest
@@ -32,14 +32,14 @@ module Origen
32
32
  w1crs: { implemented: false, base: 'read-write', write: 'oneToClear', read: 'set', writable: true, readable: true, w1c: true, set_only: false, clr_only: false, description: "Write '1' to clear and set-on-read" },
33
33
  w0src: { implemented: false, base: 'read-write', write: 'zeroToSet', read: 'clear', writable: true, readable: true, w1c: false, set_only: false, clr_only: false, description: "Write '0' to set and clear-on-read" },
34
34
  w0crs: { implemented: false, base: 'read-write', write: 'zeroToClear', read: 'set', writable: true, readable: true, w1c: false, set_only: false, clr_only: false, description: "Write '0' to clear and set-on-read" },
35
- wo: { implemented: false, base: 'write-only', write: nil, read: nil, writable: true, readable: false, w1c: false, set_only: false, clr_only: false, description: 'Write-only' },
36
- woc: { implemented: false, base: 'write-only', write: 'clear', read: nil, writable: true, readable: false, w1c: false, set_only: false, clr_only: true, description: "When written sets the field to '0'. Read undeterministic" },
37
- worz: { implemented: false, base: 'write-only', write: nil, read: nil, writable: true, readable: false, w1c: false, set_only: false, clr_only: false, description: 'Write-only, Reads zero' },
38
- wos: { implemented: false, base: 'write-only', write: 'set', read: nil, writable: true, readable: false, w1c: false, set_only: true, clr_only: false, description: "When written sets all bits to '1'. Read undeterministic" },
39
- w1: { implemented: false, base: 'read-writeOnce', write: nil, read: nil, writable: true, readable: true, w1c: false, set_only: false, clr_only: false, description: 'Write-once. Next time onwards, write is ignored. Read returns the value' },
40
- wo1: { implemented: false, base: 'writeOnce', write: nil, read: nil, writable: true, readable: false, w1c: false, set_only: false, clr_only: false, description: 'Write-once. Next time onwards, write is ignored. Read is undeterministic' },
41
- dc: { implemented: false, base: 'read-write', write: nil, read: nil, writable: true, readable: true, w1c: false, set_only: false, clr_only: false, description: 'RW but no check' },
42
- rowz: { implemented: false, base: 'read-only', write: nil, read: 'clear', writable: false, readable: true, w1c: false, set_only: false, clr_only: false, description: 'Read-only, value is cleared on read' }
35
+ wo: { implemented: false, base: 'write-only', write: nil, read: nil, writable: true, readable: false, w1c: false, set_only: false, clr_only: false, description: 'Write-only' },
36
+ woc: { implemented: false, base: 'write-only', write: 'clear', read: nil, writable: true, readable: false, w1c: false, set_only: false, clr_only: true, description: "When written sets the field to '0'. Read undeterministic" },
37
+ worz: { implemented: false, base: 'write-only', write: nil, read: nil, writable: true, readable: false, w1c: false, set_only: false, clr_only: false, description: 'Write-only, Reads zero' },
38
+ wos: { implemented: false, base: 'write-only', write: 'set', read: nil, writable: true, readable: false, w1c: false, set_only: true, clr_only: false, description: "When written sets all bits to '1'. Read undeterministic" },
39
+ w1: { implemented: false, base: 'read-writeOnce', write: nil, read: nil, writable: true, readable: true, w1c: false, set_only: false, clr_only: false, description: 'Write-once. Next time onwards, write is ignored. Read returns the value' },
40
+ wo1: { implemented: false, base: 'writeOnce', write: nil, read: nil, writable: true, readable: false, w1c: false, set_only: false, clr_only: false, description: 'Write-once. Next time onwards, write is ignored. Read is undeterministic' },
41
+ dc: { implemented: false, base: 'read-write', write: nil, read: nil, writable: true, readable: true, w1c: false, set_only: false, clr_only: false, description: 'RW but no check' },
42
+ rowz: { implemented: false, base: 'read-only', write: nil, read: 'clear', writable: false, readable: true, w1c: false, set_only: false, clr_only: false, description: 'Read-only, value is cleared on read' }
43
43
  }
44
44
 
45
45
  # Returns the Reg object that owns the bit
@@ -100,7 +100,7 @@ module Origen
100
100
  # Can be set to indicate that the current state of the bit is unknown, e.g. after reading X from a simulation
101
101
  attr_accessor :unknown
102
102
 
103
- def initialize(owner, position, options = {}) # rubocop:disable MethodLength
103
+ def initialize(owner, position, options = {})
104
104
  options = {
105
105
  start: false, # whether bit starts a state machine so be careful
106
106
  read_data_matches_write: true,
@@ -109,7 +109,7 @@ module Origen
109
109
  store: false,
110
110
  sticky_overlay: true,
111
111
  sticky_store: false,
112
- nvm_dep: false, # whether is an NVM dependent bit
112
+ nvm_dep: false # whether is an NVM dependent bit
113
113
  }.merge(options)
114
114
  @owner = owner
115
115
  @position = position
@@ -141,7 +141,7 @@ module Origen
141
141
  readable: true, # whether bit is readable
142
142
  clr_only: false, # whether bit is clear only
143
143
  set_only: false, # whether bit is set only
144
- w1c: false, # whether bit is w1c (when written to 1 immediately becomes 0)
144
+ w1c: false # whether bit is w1c (when written to 1 immediately becomes 0)
145
145
  }.merge(options)
146
146
  @readable = options.delete(:readable)
147
147
  @writable = options.delete(:writable)
@@ -240,7 +240,8 @@ module Origen
240
240
  def default_bit_metadata
241
241
  if owner
242
242
  Origen::Registers.default_bit_metadata.merge(
243
- Origen::Registers.bit_metadata[owner.owner.class] || {})
243
+ Origen::Registers.bit_metadata[owner.owner.class] || {}
244
+ )
244
245
  else
245
246
  Origen::Registers.default_bit_metadata
246
247
  end
@@ -336,11 +337,14 @@ module Origen
336
337
  self
337
338
  end
338
339
 
340
+ # rubocop:disable Lint/DuplicateMethods
341
+
339
342
  # Set the overlay attribute to the supplied value
340
343
  def overlay(value)
341
344
  @overlay = value
342
345
  self
343
346
  end
347
+ # rubocop:enable Lint/DuplicateMethods
344
348
 
345
349
  # Returns the overlay attribute
346
350
  def overlay_str
@@ -411,7 +415,7 @@ module Origen
411
415
  # Returns the value you would need to write to the register to put the given
412
416
  # value in this bit
413
417
  def setting(value)
414
- value = value & 1 # As this bit can only hold one bit of data force it
418
+ value = value & 1 # As this bit can only hold one bit of data force it
415
419
  value << @position
416
420
  end
417
421
 
@@ -495,7 +499,7 @@ module Origen
495
499
  return true
496
500
  end
497
501
  end
498
- return false
502
+ false
499
503
  else
500
504
  feature == name
501
505
  end
@@ -538,7 +542,7 @@ module Origen
538
542
  break # break if feature not found and return false
539
543
  end
540
544
  end # iterated through all features in array
541
- return value
545
+ value
542
546
  else # if feature.class != Array
543
547
  loop do
544
548
  if current_owner.respond_to?(:owner)
@@ -561,10 +565,10 @@ module Origen
561
565
  value = true
562
566
  end
563
567
  end
564
- return value
568
+ value
565
569
  end
566
570
  else
567
- return true
571
+ true
568
572
  end
569
573
  end
570
574
  end
@@ -88,6 +88,7 @@ module Origen
88
88
  # end
89
89
  def [](*indexes)
90
90
  return self if indexes.empty?
91
+
91
92
  b = BitCollection.new(parent, name)
92
93
  expand_and_order(*indexes).each do |i|
93
94
  b << fetch(i)
@@ -261,6 +262,7 @@ module Origen
261
262
  if any? { |b| b.access != val }
262
263
  fail 'Not all bits the collection have the same access value!'
263
264
  end
265
+
264
266
  val
265
267
  end
266
268
 
@@ -334,6 +336,7 @@ module Origen
334
336
  data = 0
335
337
  shift_out_with_index do |bit, i|
336
338
  return undefined if bit.is_a?(Origen::UndefinedClass)
339
+
337
340
  data |= bit.data << i
338
341
  end
339
342
  data
@@ -352,16 +355,20 @@ module Origen
352
355
  data = 0
353
356
  reverse_shift_out_with_index do |bit, i|
354
357
  return undefined if bit.is_a?(Origen::UndefinedClass)
358
+
355
359
  data |= bit.data << i
356
360
  end
357
361
  data
358
362
  end
359
363
  alias_method :reverse_data, :data_reverse
360
364
 
365
+ # rubocop:disable Lint/DuplicateMethods
366
+
361
367
  # Supports reg.bit[0] and bitcollection.bit[0]
362
368
  def bit
363
369
  self
364
370
  end
371
+ # rubocop:enable Lint/DuplicateMethods
365
372
 
366
373
  # Returns true if the collection contains all bits in the register
367
374
  def whole_reg?
@@ -647,8 +654,8 @@ module Origen
647
654
 
648
655
  # Sets the store flag on all bits that already have the overlay flag set
649
656
  def store_overlay_bits(options = {})
650
- options = { exclude: [], # Pass in an array of any overlays that are to be excluded from store
651
- }.merge(options)
657
+ # Pass in an array of any overlays that are to be excluded from store
658
+ options = { exclude: [] }.merge(options)
652
659
  each do |bit|
653
660
  bit.store if bit.has_overlay? && !options[:exclude].include?(bit.overlay_str)
654
661
  end
@@ -768,6 +775,7 @@ module Origen
768
775
  data = 0
769
776
  shift_out_with_index do |bit, i|
770
777
  return bit.reset_data if bit.reset_data.is_a?(Symbol)
778
+
771
779
  data |= bit.reset_data << i
772
780
  end
773
781
  data
@@ -799,15 +807,16 @@ module Origen
799
807
  feature.delete(nil) if feature.include?(nil)
800
808
  if !feature.empty?
801
809
  if feature.size == 1
802
- return feature[0]
810
+ feature[0]
803
811
  else
804
- return feature.uniq
812
+ feature.uniq
805
813
  end
806
814
  else
807
815
  if Origen.config.strict_errors
808
816
  fail 'No feature found'
809
817
  end
810
- return nil
818
+
819
+ nil
811
820
  end
812
821
  end
813
822
  alias_method :features, :feature
@@ -995,7 +1004,7 @@ module Origen
995
1004
  Regexp.new(regex) =~ regval
996
1005
 
997
1006
  nibbles = []
998
- size_in_nibbles.times do |n| # now grouped by nibble
1007
+ size_in_nibbles.times do |n| # now grouped by nibble
999
1008
  nibbles << Regexp.last_match[n + 1]
1000
1009
  end
1001
1010