origen 0.7.2 → 0.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6924c8fd9b6f9043fc3e2706d24dd645c2ba3a04
4
- data.tar.gz: 28ff7c05aa1857d2586aac761cfd7e7e6c2ff039
3
+ metadata.gz: 55916e76f5bdf501c90b99100958b5679c2cdb3f
4
+ data.tar.gz: bdb95336085bf8ebcdef8ad13a3a822c8019381f
5
5
  SHA512:
6
- metadata.gz: 7c69ed2f1daeeb8c6d729ebde1fb8b7cf6fa41678600aa0f7fba5ce2453713662c9e6ec0beb0dac0e045a87b7576f9600dfd73241db12e5d10f6da586365dba7
7
- data.tar.gz: b842b9584e28e6f19420a9dd553099488e6e849c2781331612ba1bd813c3806e91a95091ac6b5abbcf2ec15e60a54d561b85bac7032bff225630a277c7678c63
6
+ metadata.gz: bb6d9bb6cdd345f83eb5c5b1644e2fb5e5e1c8f0e3eebee828cc54a2ab6503b6429a095633ba783d2b485a6692115ea7870366c12e0ee72f4198d2496bb308b7
7
+ data.tar.gz: a28f70593e2d10c39353f2f5e897d2c0561fd13a7b6cbe0f2a8c9586b8933596802e9291bf1fb8cbfdcc05c7c3de26383440a0e63e9aa12250b42590ecc114bb
@@ -1,7 +1,7 @@
1
1
  module Origen
2
2
  MAJOR = 0
3
3
  MINOR = 7
4
- BUGFIX = 2
4
+ BUGFIX = 3
5
5
  DEV = nil
6
6
 
7
7
  VERSION = [MAJOR, MINOR, BUGFIX].join(".") + (DEV ? ".pre#{DEV}" : '')
@@ -98,16 +98,38 @@ module Origen
98
98
  # not intended to be inserted into production pattern logic.
99
99
  def sync
100
100
  if tester.try(:link?)
101
- v = tester.capture do
102
- store!
101
+ preserve_flags do
102
+ v = tester.capture do
103
+ store!
104
+ end
105
+ reverse_each.with_index do |bit, i|
106
+ bit.write(v.first[i])
107
+ end
103
108
  end
104
- write(v.first)
105
109
  parent
106
110
  else
107
111
  Origen.log.warning 'Sync is not supported on the current tester driver, register not updated'
108
112
  end
109
113
  end
110
114
 
115
+ # At the end of the given block, the status flags of all bits will be restored to the state that
116
+ # they were upon entry to the block
117
+ def preserve_flags
118
+ orig = []
119
+ each do |bit|
120
+ orig << [bit.overlay_str, bit.is_to_be_read?, bit.is_to_be_stored?]
121
+ end
122
+ yield
123
+ each do |bit|
124
+ bit.clear_flags
125
+ flags = orig.shift
126
+ bit.overlay(flags[0])
127
+ bit.read if flags[1]
128
+ bit.store if flags[2]
129
+ end
130
+ self
131
+ end
132
+
111
133
  # Copies all data and flags from one bit collection (or reg) object to another
112
134
  #
113
135
  # This method will accept a dumb value as the argument, in which case it is essentially a write,
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.7.2
4
+ version: 0.7.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen McGinty
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-31 00:00:00.000000000 Z
11
+ date: 2016-04-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport