origen 0.37.0 → 0.38.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8f5dc0a0e894edf7f948dabf34643520bc2bf29862a484016888130663f55290
4
- data.tar.gz: ccfe5cb101ac8cfb894e3f29a8edd4c81fb2d4f67765481af09bb8ffb22e09a3
3
+ metadata.gz: 9aa332ea30ff6e2185ef86ef42fb8ed6444b525555bd8509fed4f28a721596f0
4
+ data.tar.gz: 9aa1c645c4a77f2b9ce18b0b406d7c18fef099f9dca71bfd45dd97361a18116c
5
5
  SHA512:
6
- metadata.gz: 72c8537554c0aa1045d3a390b84a364caf87ed28c1f6c3c500a158cee29866d51f1247c197693171ed14343c4031b07f9de5c8b6426c09848ec0698db1ad4e55
7
- data.tar.gz: ccc58c03e5fad80a93afbb8ff507252cb7202e0f7f1aadcc45adcedeeaff613259d4ecbe3f82249c8c7d25932377f417ea807ed2e442df1afe142fe98dc7e80a
6
+ metadata.gz: c9aaf744fbb84e2e6fee05f7f53c148a36a789d7ff6c83ded3129f0762acb5afdd98c6ce872608105c35b129a5283b6027e501b571d8512279629ad026854bd9
7
+ data.tar.gz: 3d0f7817ed9bf9c5098ac89effbc4cfbab473f6fb6572ee9bf3e39756f1fdf22925ca0a01104272ca6138964ba807804137c60cf31115a9ce915f161b3caee1c
data/config/version.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  module Origen
2
2
  MAJOR = 0
3
- MINOR = 37
3
+ MINOR = 38
4
4
  BUGFIX = 0
5
5
  DEV = nil
6
6
 
data/lib/origen/pins.rb CHANGED
@@ -229,21 +229,23 @@ module Origen
229
229
 
230
230
  rtl_name = options[:rtl_name]
231
231
  force = options[:force]
232
+ offset = options.delete(:offset) || 0
232
233
  options.delete(:size).times do |i|
233
- options[:name] = "#{id}#{i}".to_sym
234
- options[:rtl_name] = "#{rtl_name}#{i}".to_sym if rtl_name
235
- options[:force] = force[i] if force
234
+ pin_index = offset + i
235
+ options[:name] = "#{id}#{pin_index}".to_sym
236
+ options[:rtl_name] = "#{rtl_name}#{pin_index}".to_sym if rtl_name
237
+ options[:force] = force[pin_index] if force
236
238
 
237
239
  if power_pin
238
- group[i] = PowerPin.new(i, self, options)
240
+ group[i] = PowerPin.new(pin_index, self, options)
239
241
  elsif ground_pin
240
- group[i] = GroundPin.new(i, self, options)
242
+ group[i] = GroundPin.new(pin_index, self, options)
241
243
  elsif virtual_pin
242
- group[i] = VirtualPin.new(i, self, options)
244
+ group[i] = VirtualPin.new(pin_index, self, options)
243
245
  elsif other_pin
244
- group[i] = OtherPin.new(i, self, options)
246
+ group[i] = OtherPin.new(pin_index, self, options)
245
247
  else
246
- group[i] = Pin.new(i, self, options)
248
+ group[i] = Pin.new(pin_index, self, options)
247
249
  end
248
250
  group[i].invalidate_group_cache
249
251
  end
@@ -5,35 +5,41 @@ module Origen
5
5
  # The :access property of registers or bits can be set to any of the following
6
6
  # key values. Implemented refers to whether the behaviour is accurately modelled
7
7
  # by the Origen register model or not.
8
+ #
9
+ # :base is used in CrossOrigen to set the IP-XACT access type on export.
10
+ #
11
+ # :read and :write are used in CrossOrigen for IP-XACT export to cover 'readAction'
12
+ # and 'modifiedWriteValue' attributes in the IEEE 1685-2009 schema - they do not affect
13
+ # Origen Core functionality (yet?).
8
14
  ACCESS_CODES = {
9
- ro: { implemented: false, description: 'Read-Only' },
10
- rw: { implemented: true, description: 'Read-Write' },
11
- rc: { implemented: false, description: 'Read-only, Clear-on-read' },
12
- rs: { implemented: false, description: "Set-on-read (all bits become '1' on read)" },
13
- wrc: { implemented: false, description: 'Writable, clear-on-read' },
14
- wrs: { implemented: false, description: 'Writable, Sets-on-read' },
15
- wc: { implemented: false, description: 'Clear-on-write' },
16
- ws: { implemented: false, description: 'Set-on-write' },
17
- wsrc: { implemented: false, description: 'Set-on-write, clear-on-read' },
18
- wcrs: { implemented: false, description: 'Clear-on-write, set-on-read' },
19
- w1c: { implemented: false, description: "Write '1' to clear bits" },
20
- w1s: { implemented: false, description: "Write '1' to set bits" },
21
- w1t: { implemented: false, description: "Write '1' to toggle bits" },
22
- w0c: { implemented: false, description: "Write '0' to clear bits" },
23
- w0s: { implemented: false, description: "Write '0' to set bits" },
24
- w0t: { implemented: false, description: "Write '0' to toggle bits" },
25
- w1src: { implemented: false, description: "Write '1' to set and clear-on-read" },
26
- w1crs: { implemented: false, description: "Write '1' to clear and set-on-read" },
27
- w0src: { implemented: false, description: "Write '0' to set and clear-on-read" },
28
- w0crs: { implemented: false, description: "Write '0' to clear and set-on-read" },
29
- wo: { implemented: false, description: 'Write-only' },
30
- woc: { implemented: false, description: "When written sets the field to '0'. Read undeterministic" },
31
- worz: { implemented: false, description: 'Write-only, Reads zero' },
32
- wos: { implemented: false, description: "When written sets all bits to '1'. Read undeterministic" },
33
- w1: { implemented: false, description: 'Write-once. Next time onwards, write is ignored. Read returns the value' },
34
- wo1: { implemented: false, description: 'Write-once. Next time onwards, write is ignored. Read is undeterministic' },
35
- dc: { implemented: false, description: 'RW but no check' },
36
- rowz: { implemented: false, description: 'Read-only, value is cleared on read' }
15
+ ro: { implemented: false, base: 'read-only', write: nil, read: nil, writable: false, readable: true, w1c: false, set_only: false, clr_only: false, description: 'Read-Only' },
16
+ rw: { implemented: true, base: 'read-write', write: nil, read: nil, writable: true, readable: true, w1c: false, set_only: false, clr_only: false, description: 'Read-Write' },
17
+ rc: { implemented: false, base: 'read-only', write: nil, read: 'clear', writable: false, readable: true, w1c: false, set_only: false, clr_only: false, description: 'Read-only, Clear-on-read' },
18
+ rs: { implemented: false, base: 'read-only', write: nil, read: 'set', writable: false, readable: true, w1c: false, set_only: false, clr_only: false, description: "Set-on-read (all bits become '1' on read)" },
19
+ wrc: { implemented: false, base: 'read-write', write: nil, read: 'clear', writable: true, readable: true, w1c: false, set_only: false, clr_only: false, description: 'Writable, clear-on-read' },
20
+ wrs: { implemented: false, base: 'read-write', write: nil, read: 'set', writable: true, readable: true, w1c: false, set_only: false, clr_only: false, description: 'Writable, Sets-on-read' },
21
+ wc: { implemented: false, base: 'read-write', write: 'clear', read: nil, writable: true, readable: true, w1c: false, set_only: false, clr_only: true, description: 'Clear-on-write' },
22
+ ws: { implemented: false, base: 'read-write', write: 'set', read: nil, writable: true, readable: true, w1c: false, set_only: true, clr_only: false, description: 'Set-on-write' },
23
+ wsrc: { implemented: false, base: 'read-write', write: 'set', read: 'clear', writable: true, readable: true, w1c: false, set_only: false, clr_only: false, description: 'Set-on-write, clear-on-read' },
24
+ wcrs: { implemented: false, base: 'read-write', write: 'clear', read: 'set', writable: true, readable: true, w1c: false, set_only: false, clr_only: false, description: 'Clear-on-write, set-on-read' },
25
+ w1c: { implemented: false, base: 'read-write', write: 'oneToClear', read: nil, writable: true, readable: true, w1c: true, set_only: false, clr_only: false, description: "Write '1' to clear bits" },
26
+ w1s: { implemented: false, base: 'read-write', write: 'oneToSet', read: nil, writable: true, readable: true, w1c: false, set_only: false, clr_only: false, description: "Write '1' to set bits" },
27
+ w1t: { implemented: false, base: 'read-write', write: 'oneToToggle', read: nil, writable: true, readable: true, w1c: false, set_only: false, clr_only: false, description: "Write '1' to toggle bits" },
28
+ w0c: { implemented: false, base: 'read-write', write: 'zeroToClear', read: nil, writable: true, readable: true, w1c: false, set_only: false, clr_only: false, description: "Write '0' to clear bits" },
29
+ w0s: { implemented: false, base: 'read-write', write: 'zeroToSet', read: nil, writable: true, readable: true, w1c: false, set_only: false, clr_only: false, description: "Write '0' to set bits" },
30
+ w0t: { implemented: false, base: 'read-write', write: 'zeroToToggle', read: nil, writable: true, readable: true, w1c: false, set_only: false, clr_only: false, description: "Write '0' to toggle bits" },
31
+ w1src: { implemented: false, base: 'read-write', write: 'oneToSet', read: 'clear', writable: true, readable: true, w1c: false, set_only: false, clr_only: false, description: "Write '1' to set and clear-on-read" },
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
+ 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
+ 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' }
37
43
  }
38
44
 
39
45
  # Returns the Reg object that owns the bit
@@ -72,6 +78,10 @@ module Origen
72
78
  attr_writer :clr_only
73
79
  # Allow modify of set_only flag, bit can only be set (made 1)
74
80
  attr_writer :set_only
81
+ # Returns read_action - whether anything happens to the bit when read
82
+ attr_reader :read_action
83
+ # Returns mod_write_value - what write value modification occurs when written
84
+ attr_reader :mod_write_value
75
85
  # Returns true if bit depends on initial state of NVM in some way
76
86
  attr_reader :nvm_dep
77
87
  # Returns true if bit is critical to starting an important operation (like a state machine)
@@ -84,6 +94,9 @@ module Origen
84
94
  # Returns the access method for the given bit (a symbol), see the ACCESS_CODES constant for
85
95
  # the possible values this can have and their meaning
86
96
  attr_accessor :access
97
+ # Returns the basic access string for a given access method. Possible values: read-write, read-only,
98
+ # write-only, writeOnce, read-writeOnce. Used primarily by CrossOrigen IP-XACT import/export.
99
+ attr_reader :base_access
87
100
 
88
101
  def initialize(owner, position, options = {}) # rubocop:disable MethodLength
89
102
  options = {
@@ -161,6 +174,10 @@ module Origen
161
174
  @meta = (default_bit_metadata).merge(options)
162
175
  end
163
176
 
177
+ def access_codes
178
+ ACCESS_CODES
179
+ end
180
+
164
181
  def set_access(value)
165
182
  unless ACCESS_CODES.keys.include?(value)
166
183
  puts 'Invalid access code, must be one of these:'
@@ -172,30 +189,15 @@ module Origen
172
189
  end
173
190
  @access = value
174
191
 
175
- # Set readable & writable based on access
176
- if @access == :ro
177
- @readable = true
178
- @writable = false
179
- elsif @access == :wo || @access == :worz
180
- @writable = true
181
- @readable = false
182
- elsif @access == :w1c
183
- @w1c = true
184
- @writable = true
185
- @readable = true # Is this always valid?
186
- elsif @access == :wc
187
- @clr_only = true
188
- @writable = true
189
- @readable = true # Is this always valid?
190
- elsif @access == :ws
191
- @set_only = true
192
- @writable = true
193
- @readable = true # Is this always valid?
194
- # Catch all for now until the behavior of this class is based around @access
195
- else
196
- @writable = true
197
- @readable = true
198
- end
192
+ # Set access attributes by pulling key-value pairs from ACCESS_CODES[<access>]
193
+ @readable = ACCESS_CODES[@access][:readable]
194
+ @writable = ACCESS_CODES[@access][:writable]
195
+ @w1c = ACCESS_CODES[@access][:w1c]
196
+ @set_only = ACCESS_CODES[@access][:set_only]
197
+ @clr_only = ACCESS_CODES[@access][:clr_only]
198
+ @base_access = ACCESS_CODES[@access][:base]
199
+ @read_action = ACCESS_CODES[@access][:read]
200
+ @mod_write_value = ACCESS_CODES[@access][:write]
199
201
  end
200
202
 
201
203
  # Set @access based on @readable and @writable
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: origen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.37.0
4
+ version: 0.38.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen McGinty
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-11-15 00:00:00.000000000 Z
11
+ date: 2018-11-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport