origen_ahb 0.2.0.pre5 → 0.2.0.pre6

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
  SHA1:
3
- metadata.gz: 01ba3bd4ef447c9a8a0931e5ec54dd30d9705939
4
- data.tar.gz: 89d495830b99f6f12c7d4820e6d757bf5ca8ba2d
3
+ metadata.gz: dad9b0541a36c1a019d291224a68259a76e0c23d
4
+ data.tar.gz: be04c303f2c819a128fc37e5bd449de24bdf6be1
5
5
  SHA512:
6
- metadata.gz: e27cabbb799a1291936756827f63e167f054e18e8b119fed3ee13baaf48049557a14fc4903fcfc4cb66edd4d4a8822680586932418c884dbb705a91f3b5fc448
7
- data.tar.gz: ce9bc1d9f2282457521d38ca15a621e0cb54ac7d3412b3b43386853864268bd183dee2c05c13e9f98079e66c1d3ccd9a0c520cbe533553e2cd8b11247085af0f
6
+ metadata.gz: 113207f1f4bce8cfffee756a0f417b006d7e51e61f078f8a8613a16235a9e98dc1a9cc075b2c9d8a9cffa153d2ab6e98dab3701490ca3068c88062d80ff87953
7
+ data.tar.gz: 4f4603b273f969fea4fdf9da5fe1a0ccd5938a47308c7e94715d245a238166929ff521d9b414d2d0aa3ee8b080fca96e079d0daf49de525437eaf8263f84fa8f
data/config/version.rb CHANGED
@@ -2,7 +2,7 @@ module OrigenAhb
2
2
  MAJOR = 0
3
3
  MINOR = 2
4
4
  BUGFIX = 0
5
- DEV = 5
5
+ DEV = 6
6
6
 
7
7
  VERSION = [MAJOR, MINOR, BUGFIX].join(".") + (DEV ? ".pre#{DEV}" : '')
8
8
  end
@@ -8,8 +8,8 @@ module OrigenAhb
8
8
 
9
9
  def read_register(reg_or_val, options = {})
10
10
  options = {
11
- haddr: reg_or_val.address,
12
- hdata: reg_or_val.data,
11
+ haddr: options[:address] || reg_or_val.address,
12
+ hdata: reg_or_val,
13
13
  hwrite: 0,
14
14
  hsize: get_hsize(reg_or_val.size),
15
15
  hburst: 0,
@@ -17,14 +17,20 @@ module OrigenAhb
17
17
  hprot: 0xF
18
18
  }.merge(options)
19
19
  cc '==== AHB Read Transaction ===='
20
- cc 'Address: 0x' + options[:haddr].to_s(16) + ' Data: 0x' + options[:hdata].to_s(16) + ' Size: ' + options[:hsize].to_s
20
+ if reg_or_val.respond_to?('data')
21
+ data = reg_or_val.data
22
+ else
23
+ data = reg_or_val
24
+ options[:hsize] = 2
25
+ end
26
+ cc 'Address: 0x' + options[:haddr].to_s(16) + ' Data: 0x' + data.to_s(16) + ' Size: ' + options[:hsize].to_s
21
27
  $dut.ahb_trans(options)
22
28
  end
23
29
 
24
30
  def write_register(reg_or_val, options = {})
25
31
  options = {
26
- haddr: reg_or_val.address,
27
- hdata: reg_or_val.data,
32
+ haddr: options[:address] || reg_or_val.address,
33
+ hdata: reg_or_val,
28
34
  hwrite: 1,
29
35
  hsize: get_hsize(reg_or_val.size),
30
36
  hburst: 0,
@@ -32,7 +38,13 @@ module OrigenAhb
32
38
  hprot: 0xF
33
39
  }.merge(options)
34
40
  cc '==== AHB Write Transaction ===='
35
- cc 'Address: 0x' + options[:haddr].to_s(16) + ' Data: 0x' + options[:hdata].to_s(16) + ' Size: ' + options[:hsize].to_s
41
+ if reg_or_val.respond_to?('data')
42
+ data = reg_or_val.data
43
+ else
44
+ data = reg_or_val
45
+ options[:hsize] = 2
46
+ end
47
+ cc 'Address: 0x' + options[:haddr].to_s(16) + ' Data: 0x' + data.to_s(16) + ' Size: ' + options[:hsize].to_s
36
48
  $dut.ahb_trans(options)
37
49
  end
38
50
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: origen_ahb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0.pre5
4
+ version: 0.2.0.pre6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris P Nappi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-24 00:00:00.000000000 Z
11
+ date: 2016-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: origen