rpicsim 0.2.2 → 0.2.3

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: 1d41b2c70c97b2d8129b34801fdd6344cc5b57c5
4
- data.tar.gz: 2c54285f1ffcc4e4eb0ad19d0bda948641c2edc2
3
+ metadata.gz: 7942ae725016bb382c3214020eeaf8191e25b311
4
+ data.tar.gz: 9a5e4fb1eaac0ebd49b11b99618efa47cda520cc
5
5
  SHA512:
6
- metadata.gz: 44351582e59474aec0fec8ffec411ba8dffe81e3d1c6003f79b180236fe86e2f92c8b82a22c00030e334fadd27f06686603daf302bc12ffefef9ac5dc667ea0f
7
- data.tar.gz: 6f424c03cab34851a7943530f2c31c7014b47908713b5bb06f775452f6c28c75b10c0f892fda30d326d5cc2f746d9d4c6d9506da0a47e9fbbfcdb1056cfb7d97
6
+ metadata.gz: 1696c66457debd316648fd2f405c370d96f685d0d6297936b267d53acc463aa4a886847dee60ffa6fb70ec86833bc56f31941743f970577533d454e65d42af9a
7
+ data.tar.gz: 97c0223646863b0168099d59971e75a12e7cb448ae84b2acda6d96f4ecb710780a696c1ca03016475d92309348765beb9401ed66a501b3e6bebb4d92bd7b8af7
data/Gemfile CHANGED
@@ -7,5 +7,5 @@ group :development do
7
7
  gem 'deg-yard' # My little fork of the yard gem that has some bug fixes.
8
8
  gem 'guard'
9
9
  gem 'guard-rspec'
10
- gem 'rubocop'
10
+ gem 'rubocop', '0.18.1' # They made breaking changes in 0.19.x so let's not update yet.
11
11
  end
@@ -1,6 +1,12 @@
1
1
  Change log
2
2
  ====
3
3
 
4
+ 0.2.3
5
+ ----
6
+ Released on 2014-03-17.
7
+
8
+ - Fixed a bug preventing symbols in RAM generated by the XC8 compiler from being recognized.
9
+
4
10
  0.2.2
5
11
  ----
6
12
  Released on 2014-03-07.
@@ -18,28 +18,64 @@ module RPicSim::Mplab
18
18
 
19
19
  def symbols_in_ram
20
20
  @symbols_in_ram ||= Hash[
21
- symbols.select { |s| s.m_lType == 0 }.map { |s| [s.m_Symbol.to_sym, s.address] }
21
+ grouped_symbols[:ram]
22
+ .map { |s| [s.m_Symbol.to_sym, s.address] }
22
23
  ]
23
24
  end
24
25
 
25
26
  def symbols_in_program_memory
26
27
  @symbols_in_code_space ||= Hash[
27
- symbols
28
- .select { |s| s.m_lType != 0 && !EepromRange.include?(s.address) }
28
+ grouped_symbols[:program_memory]
29
29
  .map { |s| [s.m_Symbol.to_sym, s.address] }
30
30
  ]
31
31
  end
32
32
 
33
33
  def symbols_in_eeprom
34
34
  @symbols_in_eeprom ||= Hash[
35
- symbols
36
- .select { |s| s.m_lType != 0 && EepromRange.include?(s.address) }
35
+ grouped_symbols[:eeprom]
37
36
  .map { |s| [s.m_Symbol.to_sym, s.address - EepromRange.min] }
38
37
  ]
39
38
  end
40
39
 
41
40
  private
42
41
 
42
+ def grouped_symbols
43
+ @grouped_symbols ||= begin
44
+ hash = symbols.group_by(&method(:memory_type))
45
+ hash.default = []
46
+ hash
47
+ end
48
+ end
49
+
50
+ # m_lType: meaning:
51
+ # 0 MPASM RAM
52
+ # 12 XC8 RAM
53
+ # 22 MPASM program memory or EEPROM
54
+ # 14 XC8 program memory variable
55
+ # 65 XC8 program memory function
56
+
57
+ def memory_type(symbol)
58
+ case symbol.m_lType
59
+ when 0, 12
60
+ :ram
61
+ when 22
62
+ EepromRange.include?(symbol.address) ? :eeprom : :program_memory
63
+ when 12
64
+ :ram
65
+ when 14, 65
66
+ :program_memory
67
+ else
68
+ raise "Unknown m_lType #{symbol.m_lType} for symbol #{symbol.name}."
69
+ end
70
+ end
71
+
72
+ # Useful for debugging.
73
+ # Just put this line in your simulation class definition temporarily:
74
+ # pp program_file.instance_variable_get(:@mplab_program_file).send(:symbol_dump)
75
+ def symbol_dump
76
+ symbols.map { |s| [s.m_Symbol, s.m_lType, s.address, memory_type(s)] }
77
+ end
78
+
43
79
  def symbols
44
80
  @program_file.getSymbolTable.getSymbols(0, 0)
45
81
  end
@@ -623,11 +623,11 @@ module RPicSim
623
623
  ram_var_names = self.class.variable_set.var_names_for_memory(:ram)
624
624
  @vars.values_at(*ram_var_names)
625
625
  end
626
-
626
+
627
627
  def sfr_vars
628
628
  @sfrs.values
629
629
  end
630
-
630
+
631
631
  def address_increment
632
632
  @assembly.device_info.code_address_increment
633
633
  end
@@ -1,3 +1,3 @@
1
1
  module RPicSim
2
- VERSION = '0.2.2'
2
+ VERSION = '0.2.3'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rpicsim
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pololu
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-07 00:00:00.000000000 Z
11
+ date: 2014-03-17 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email:
@@ -16,11 +16,50 @@ executables: []
16
16
  extensions: []
17
17
  extra_rdoc_files: []
18
18
  files:
19
- - .yardopts
20
- - Gemfile
19
+ - lib/rpicsim.rb
20
+ - lib/rpicsim/call_stack_info.rb
21
+ - lib/rpicsim/composite_memory.rb
22
+ - lib/rpicsim/flaws.rb
23
+ - lib/rpicsim/instruction.rb
24
+ - lib/rpicsim/label.rb
25
+ - lib/rpicsim/memory.rb
26
+ - lib/rpicsim/memory_watcher.rb
27
+ - lib/rpicsim/mplab.rb
28
+ - lib/rpicsim/pin.rb
29
+ - lib/rpicsim/program_counter.rb
30
+ - lib/rpicsim/program_file.rb
31
+ - lib/rpicsim/rspec.rb
32
+ - lib/rpicsim/search.rb
33
+ - lib/rpicsim/sim.rb
34
+ - lib/rpicsim/stack_pointer.rb
35
+ - lib/rpicsim/stack_trace.rb
36
+ - lib/rpicsim/variable.rb
37
+ - lib/rpicsim/variable_set.rb
38
+ - lib/rpicsim/version.rb
39
+ - lib/rpicsim/mplab/mplab_assembly.rb
40
+ - lib/rpicsim/mplab/mplab_device_info.rb
41
+ - lib/rpicsim/mplab/mplab_disassembler.rb
42
+ - lib/rpicsim/mplab/mplab_instruction.rb
43
+ - lib/rpicsim/mplab/mplab_loader.rb
44
+ - lib/rpicsim/mplab/mplab_memory.rb
45
+ - lib/rpicsim/mplab/mplab_nmmr_info.rb
46
+ - lib/rpicsim/mplab/mplab_observer.rb
47
+ - lib/rpicsim/mplab/mplab_pin.rb
48
+ - lib/rpicsim/mplab/mplab_processor.rb
49
+ - lib/rpicsim/mplab/mplab_program_file.rb
50
+ - lib/rpicsim/mplab/mplab_register.rb
51
+ - lib/rpicsim/mplab/mplab_sfr_info.rb
52
+ - lib/rpicsim/mplab/mplab_simulator.rb
53
+ - lib/rpicsim/rspec/be_predicate.rb
54
+ - lib/rpicsim/rspec/helpers.rb
55
+ - lib/rpicsim/rspec/persistent_expectations.rb
56
+ - lib/rpicsim/rspec/sim_diagnostics.rb
57
+ - lib/rpicsim/storage/memory_integer.rb
58
+ - lib/rpicsim/storage/register.rb
21
59
  - Introduction.md
22
60
  - LICENSE.txt
23
61
  - README.md
62
+ - Gemfile
24
63
  - docs/ChangeLog.md
25
64
  - docs/Contributing.md
26
65
  - docs/Debugging.md
@@ -39,8 +78,8 @@ files:
39
78
  - docs/Pins.md
40
79
  - docs/PreventingCallStackOverflow.md
41
80
  - docs/QuickStartGuide.md
42
- - docs/RSpecIntegration.md
43
81
  - docs/RamWatcher.md
82
+ - docs/RSpecIntegration.md
44
83
  - docs/Running.md
45
84
  - docs/Stubbing.md
46
85
  - docs/SupportedCompilers.md
@@ -49,46 +88,7 @@ files:
49
88
  - docs/SupportedOperatingSystems.md
50
89
  - docs/UnitTesting.md
51
90
  - docs/Variables.md
52
- - lib/rpicsim.rb
53
- - lib/rpicsim/call_stack_info.rb
54
- - lib/rpicsim/composite_memory.rb
55
- - lib/rpicsim/flaws.rb
56
- - lib/rpicsim/instruction.rb
57
- - lib/rpicsim/label.rb
58
- - lib/rpicsim/memory.rb
59
- - lib/rpicsim/memory_watcher.rb
60
- - lib/rpicsim/mplab.rb
61
- - lib/rpicsim/mplab/mplab_assembly.rb
62
- - lib/rpicsim/mplab/mplab_device_info.rb
63
- - lib/rpicsim/mplab/mplab_disassembler.rb
64
- - lib/rpicsim/mplab/mplab_instruction.rb
65
- - lib/rpicsim/mplab/mplab_loader.rb
66
- - lib/rpicsim/mplab/mplab_memory.rb
67
- - lib/rpicsim/mplab/mplab_nmmr_info.rb
68
- - lib/rpicsim/mplab/mplab_observer.rb
69
- - lib/rpicsim/mplab/mplab_pin.rb
70
- - lib/rpicsim/mplab/mplab_processor.rb
71
- - lib/rpicsim/mplab/mplab_program_file.rb
72
- - lib/rpicsim/mplab/mplab_register.rb
73
- - lib/rpicsim/mplab/mplab_sfr_info.rb
74
- - lib/rpicsim/mplab/mplab_simulator.rb
75
- - lib/rpicsim/pin.rb
76
- - lib/rpicsim/program_counter.rb
77
- - lib/rpicsim/program_file.rb
78
- - lib/rpicsim/rspec.rb
79
- - lib/rpicsim/rspec/be_predicate.rb
80
- - lib/rpicsim/rspec/helpers.rb
81
- - lib/rpicsim/rspec/persistent_expectations.rb
82
- - lib/rpicsim/rspec/sim_diagnostics.rb
83
- - lib/rpicsim/search.rb
84
- - lib/rpicsim/sim.rb
85
- - lib/rpicsim/stack_pointer.rb
86
- - lib/rpicsim/stack_trace.rb
87
- - lib/rpicsim/storage/memory_integer.rb
88
- - lib/rpicsim/storage/register.rb
89
- - lib/rpicsim/variable.rb
90
- - lib/rpicsim/variable_set.rb
91
- - lib/rpicsim/version.rb
91
+ - .yardopts
92
92
  homepage: https://github.com/pololu/rpicsim
93
93
  licenses:
94
94
  - MIT
@@ -111,7 +111,7 @@ requirements:
111
111
  - JRuby
112
112
  - MPLAB X
113
113
  rubyforge_project:
114
- rubygems_version: 2.2.1
114
+ rubygems_version: 2.1.9
115
115
  signing_key:
116
116
  specification_version: 4
117
117
  summary: RPicSim provides an interface to the MPLAB X PIC simulator that allows you to write simulator-based automated tests of PIC firmware with Ruby and RSpec.