cross_origen 1.2.0 → 1.2.1

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: fa363dd12d4fee8fd75ab281271dd739994b0a433c9630fb556c16ef8095542d
4
- data.tar.gz: 4bfd5b6d824821fe249a095451f9229145435d2c813bc9d4836f6315989cbe89
3
+ metadata.gz: 3aa045609ddda2f3de9f4fe4851f7ab31201e2b1bfcf2021caffabe3b0f0a3bd
4
+ data.tar.gz: a34da76233dad5ad6110c6632a0061b9b5092f380922effc4ad537c998adf6cf
5
5
  SHA512:
6
- metadata.gz: 98950a584c2f3c81fe453a79341bd97b7ea8a8fbe4b887ba84ee480671ae2b86a942ea7c842a1d4af85476f5e66080b05d4ed0f51a8f24313a3510ad35b2339e
7
- data.tar.gz: c510adad00c3db5c117c320105a2eba67c529209dd0cb9e66d6fdd540ea8c0ad787578c29322fb1171fff2bc12cb0f1767c51027c69aa7374a97ef0eef1726a2
6
+ metadata.gz: ac3d2456ce9fa735d504a76640a5cd6b68901eb7d1c669bef46057d3f404c06186f3da57f2c47ad0dc2993180dcf892c874a12db6d7f0bc2a28a5bb2d1707035
7
+ data.tar.gz: 58941b7e05d5c9e82eaccf8057d823e6ddb5380c24aaf2e97cbaa2788a935f29b52d215b2035941b24135ed70768094bc9d169874605ac391d6ba83574181c15
data/config/version.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  module CrossOrigen
2
2
  MAJOR = 1
3
3
  MINOR = 2
4
- BUGFIX = 0
4
+ BUGFIX = 1
5
5
  DEV = nil
6
6
 
7
7
  VERSION = [MAJOR, MINOR, BUGFIX].join(".") + (DEV ? ".pre#{DEV}" : '')
@@ -60,14 +60,28 @@ module CrossOrigen
60
60
  size = fetch register.at_xpath('spirit:size'), get_text: true, to_i: true
61
61
  addr_offset = fetch register.at_xpath('spirit:addressOffset'), get_text: true, to_dec: true
62
62
  access = fetch register.at_xpath('spirit:access'), get_text: true
63
- reset_value = fetch register.at_xpath('spirit:reset/spirit:value'), get_text: true, to_dec: true
64
- reset_mask = fetch register.at_xpath('spirit:reset/spirit:mask'), get_text: true, to_dec: true
65
- if [reset_value, reset_mask].include? nil
66
- # Set default values for some register attributes
67
- reset_value, reset_mask = 0, 0
63
+ # Determine if a reset is defined for the register
64
+ if register.at_xpath('spirit:reset').nil?
65
+ # If a reset does not exist, need to set the reset_value to 0, as Origen does not (yet) have a concept
66
+ # of a register without a reset.
67
+ reset_value = 0
68
68
  else
69
- # Do a logical bitwise AND with the reset value and mask
70
- reset_value = reset_value & reset_mask
69
+ # If a reset exists, determine the reset_value (required) and reset_mask (if defined)
70
+ reset_value = fetch register.at_xpath('spirit:reset/spirit:value'), get_text: true, to_dec: true
71
+ reset_mask = fetch register.at_xpath('spirit:reset/spirit:mask'), get_text: true, to_dec: true
72
+ # Issue #8 fix - reset_mask is optional, keep reset value as imported when a mask is not defined.
73
+ # Only perform AND-ing if mask is defined. Only zero-out the reset_value if reset_value was nil.
74
+ if reset_value.nil?
75
+ # Set default for reset_value attribute if none was provided and issue a warning.
76
+ reset_value = 0
77
+ Origen.log.warning "Register #{name.upcase} was defined as having a reset, but did not have a defined reset value. This is not compliant with IP-XACT standard."
78
+ Origen.log.warning "The reset value for #{name.upcase} has been defined as 0x0 as a result."
79
+ elsif reset_mask.nil?
80
+ # If mask is undefined, leave reset_value alone.
81
+ else
82
+ # Do a logical bitwise AND with the reset value and mask
83
+ reset_value = reset_value & reset_mask
84
+ end
71
85
  end
72
86
  # Future expansion: pull in HDL path as abs_path in Origen.
73
87
  addr_block_obj.reg name, addr_offset, size: size, access: access, description: reg_description(register) do |reg|
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cross_origen
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
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-12-13 00:00:00.000000000 Z
11
+ date: 2019-01-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: origen
@@ -97,7 +97,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
97
97
  version: 1.8.11
98
98
  requirements: []
99
99
  rubyforge_project:
100
- rubygems_version: 2.7.6
100
+ rubygems_version: 2.7.7
101
101
  signing_key:
102
102
  specification_version: 4
103
103
  summary: Translators for importing and exporting Origen data to/from 3rd party formats