rpicsim 1.0.0 → 1.1.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
  SHA1:
3
- metadata.gz: 5b6af21f7563390039da12c8b89f5680a02cb986
4
- data.tar.gz: 1b76b192dcbea43027d5279cebc2f4949c42377d
3
+ metadata.gz: ffc22a3d36cfe7fe55d2bd971e0e01410e639dcc
4
+ data.tar.gz: a8589f0756b0cb3fd7fbd9af22727945318414e3
5
5
  SHA512:
6
- metadata.gz: ac3c2f02ad9039fc16940f436cc35bffe710c028e084f52f23c4b4c81d4d4ead4b982af6032529b4259e2ef39e21d130fecead04486d70b3cdd7cbdc95ee936f
7
- data.tar.gz: fedd8d6089a28a1e7395beb446e7a7467778c69c696e3a6e7fffa5eb2910cf15cf370b51f268e49e379b8f33116c88197e1b571ac7778b58b6495c28615c4ff7
6
+ metadata.gz: 9d5209c814cf043635c779466ba9687246228644a368f6d7bea5d53d4a5944b8f7dbe04f83ee548db9c77b3ec3d1151323350146bf6639105bd6c992a7656195
7
+ data.tar.gz: c106a56ba5c1ac8932b0563d91f9d38eb03bc3fcfc29349ab90fadc02ffdfd0c837a9ab0e27c59c57a95ef22b01996a598feb6abdc3b0d9eefc5158426db2388
@@ -1,6 +1,12 @@
1
1
  Change log
2
2
  ====
3
3
 
4
+ 1.1.0
5
+ ----
6
+ Released on 2015-07-27.
7
+
8
+ - Added support for MPLAB X v3.05.
9
+
4
10
  1.0.0
5
11
  ----
6
12
  Released on 2014-09-17.
@@ -57,6 +57,29 @@ _MPLAB X versions affected: all tested versions_
57
57
  This issue is tested in `spec/mplab/program_file_spec.rb`.
58
58
 
59
59
 
60
+ MPLAB X writes log files to the current directory
61
+ ----
62
+ _Type: MPLAB X issue_
63
+
64
+ _MPLAB X versions affected: 2.20 and later_
65
+
66
+ Starting with MPLAB X v2.20, the MPLAB X code writes log files to the current working directory.
67
+ These files have names that start with "MPLABXLog.xml".
68
+ Unfortunately, these files cannot be deleted from the same Ruby process that runs RPicSim, because MPLAB X keeps handles open to the files and we have not found a way to close those handles.
69
+
70
+ If you are using Rake to run your specs, you can enhance the spec task so that it removes the files after running the specs:
71
+
72
+ # After running specs, clean up the log files that MPLAB X makes.
73
+ Rake::Task['spec'].enhance do
74
+ FileUtils.rm Dir.glob 'MPLABXLog.xml*'
75
+ end
76
+
77
+ These files are created as soon as the com.microchip.mplab.logger.Logger class is loaded by the JVM.
78
+ It might be possible to replace the implementation of that class in order to avoid creating the files.
79
+
80
+ This issue is tested in `spec/mplab/log_file_spec.rb`.
81
+
82
+
60
83
  Cannot detect PIC model from COF file
61
84
  ----
62
85
  _Type: RPicSim missing feature_
@@ -179,17 +202,18 @@ Midrange ADC gives incorrect readings
179
202
  ----
180
203
  _Type: MPLAB X bug_
181
204
 
182
- _MPLAB X versions affected: all tested versions_
205
+ _MPLAB X versions affected: 1.85, 1.90, 1.95, 2.00, 2.05, 2.10, 2.15, 2.20_
183
206
 
184
207
  The simulated ADC for midrange PIC microcontrollers has various issues in different versions of MPLAB X that make it give incorrect readings.
185
208
  These issues might affect other PIC architectures as well.
186
209
 
187
- * **Bad modulus:** In MPLAB X 1.90 and later, simply setting a pin to high with `pin.set(true)` will result in an ADC reading of 0.
210
+ * **Bad modulus:** In MPLAB X 1.90 through 2.20, simply setting a pin to high with `pin.set(true)` will result in an ADC reading of 0.
188
211
  The workaround is to use `pin.set(4.9)`.
189
212
  The ADC acts like it is using a modulus operator incorrectly as a way of limiting the ADC result to be between 0 and 255.
190
213
  * **No intermediate values:** In MPLAB X 1.85, setting a pin to any voltage other than 0 V will result in an ADC reading of 255.
191
214
 
192
215
  These issues are tested in `spec/integration/adc_midrange_spec.rb`. The bad modulus issue was {http://www.microchip.com/forums/m760886.aspx reported to Microchip} in November 2013.
216
+ The midrange ADC seems to work correctly in MPLAB X 3.05.
193
217
 
194
218
 
195
219
  Variables from XC8 are not correctly identified
@@ -208,4 +232,21 @@ _MPLAB X versions affected: all tested verions_
208
232
  Attempting to read from the top (last) byte of program memory will cause an exception because the top address is not considered to be valid.
209
233
  For example, you cannot use `program_memory.read_byte(0x7FFF)` on a PIC18F25K50 simulation.
210
234
  One workaround is to use `read_word` instead.
211
- This seems to only affect PIC18 devices.
235
+ This seems to only affect PIC18 devices.
236
+
237
+ Older versions of MPLAB X do not work with later Java SE Runtime Environments
238
+ ----
239
+
240
+ MPLAB X is based on NetBeans, so older versions of it suffer from [Netbeans bug 229191](https://netbeans.org/bugzilla/show_bug.cgi?id=229191) and will not run properly on the Java SE Runtime Environment 8 or later. If you try to use an older version of MPLAB X with a newer version of Java, you might get this error:
241
+
242
+ java.lang.IllegalStateException: java.lang.IllegalAccessException:
243
+ Class org.openide.util.WeakListenerImpl$ProxyListener can not access
244
+ a member of class org.openide.filesystems.$Proxy20 with modifiers "public"
245
+ at org.openide.util.WeakListenerImpl$ProxyListener.<init>(WeakListenerImpl.java:423)
246
+ ...
247
+
248
+ A solution is to download and install the "Java SE Runtime Environment 7u80" from [Oracle](http://www.oracle.com/).
249
+ JRuby uses the JAVA_HOME environment variable to figure out which version of Java to use, so you would set the JAVA_HOME environment variable to point to version 7 for the purposes of running your tests.
250
+ If you are using a shell like Bash, a command like the one below can be used to temporarily set the environment variable for the duration of one command instead of changing it globally for your whole system:
251
+
252
+ JAVA_HOME="C:\Program Files\Java\jre7" rspec
@@ -8,7 +8,7 @@ Most of the example code in this manual assumes that you have the RSpec integrat
8
8
  Turning on RSpec integration
9
9
  ----
10
10
 
11
- To enable the RSpec integration, simply put this line in your `spec_helper.rb`:
11
+ To load RPicSim and enable its RSpec integration, simply put this line in your `spec_helper.rb`:
12
12
 
13
13
  !!!ruby
14
14
  require 'rpicsim/rspec'
@@ -38,6 +38,9 @@ Alternatively, if you just want a subset of the features described here, you can
38
38
  # Better error messages for RSpec 2.x
39
39
  require 'rpicsim/rspec/be_predicate'
40
40
 
41
+ You will also need to load RPicSim itself by writing:
42
+
43
+ require 'rpicsim'
41
44
 
42
45
  Helper methods
43
46
  ----
@@ -49,9 +49,14 @@ module RPicSim
49
49
 
50
50
  @flaw_hash = {}
51
51
 
52
- # Returns the {Flaw} with the specified name.
53
- # @param name [Symbol] The name of the flaw. The names are listed in +flaws.rb+.
54
- # @return [Flaw]
52
+ # Returns the effect of the flaw with the specified name for the currently
53
+ # loaded version of MPLAB X.
54
+ #
55
+ # The names and effects are listed in +flaws.rb+.
56
+ #
57
+ # The returned value will usually be a boolean, but sometimes a Symbol.
58
+ #
59
+ # @param name [Symbol] The name of the flaw.
55
60
  def self.[](name)
56
61
  @flaw_hash[name].effect Mplab.version
57
62
  end
@@ -62,6 +67,18 @@ module RPicSim
62
67
  yield flaw
63
68
  end
64
69
 
70
+ add(:creates_log_files) do |flaw|
71
+ flaw.affects_version '1.85', false
72
+ flaw.affects_version '1.90', false
73
+ flaw.affects_version '1.95', false
74
+ flaw.affects_version '2.00', false
75
+ flaw.affects_version '2.05', false
76
+ flaw.affects_version '2.10', false
77
+ flaw.affects_version '2.15', false
78
+ flaw.affects_version '2.20', true
79
+ flaw.probably_affects_other_versions true
80
+ end
81
+
65
82
  add(:writing_tris_affects_output) do |flaw|
66
83
  flaw.affects_version '1.85', true
67
84
  flaw.affects_version '1.90', true
@@ -86,7 +103,15 @@ module RPicSim
86
103
 
87
104
  add(:adc_midrange) do |flaw|
88
105
  flaw.affects_version '1.85', :no_middle_values
89
- flaw.probably_affects_other_versions :bad_modulus
106
+ flaw.affects_version '1.90', :bad_modulus
107
+ flaw.affects_version '1.95', :bad_modulus
108
+ flaw.affects_version '2.00', :bad_modulus
109
+ flaw.affects_version '2.05', :bad_modulus
110
+ flaw.affects_version '2.10', :bad_modulus
111
+ flaw.affects_version '2.15', :bad_modulus
112
+ flaw.affects_version '2.20', :bad_modulus
113
+ flaw.affects_version '3.05', false
114
+ flaw.probably_affects_other_versions false
90
115
  end
91
116
 
92
117
  add(:instruction_inc_is_in_byte_units) do |flaw|
@@ -19,7 +19,6 @@ module RPicSim::Mplab
19
19
  mplablibs/modules/*.jar
20
20
  mplablibs/modules/ext/*.jar
21
21
  platform/lib/org-openide-util*.jar
22
- platform/lib/org-openide-util.jar
23
22
  mdbcore/modules/ext/org-openide-filesystems.jar
24
23
  }.each do |pattern|
25
24
  Dir.glob(jar_dir + pattern).each do |jar_file|
@@ -31,8 +30,10 @@ module RPicSim::Mplab
31
30
  # In case MPLAB X was uninstalled and its directory remains, this can provide
32
31
  # a useful error message to the user.
33
32
  begin
33
+ org.openide.filesystems.FileObject
34
34
  org.openide.util.Lookup
35
35
  com.microchip.mplab.mdbcore.simulator.Simulator
36
+ com.microchip.mplab.mdbcore.platformtool.PlatformToolMetaManager
36
37
  rescue NameError
37
38
  $stderr.puts "Failed to load MPLAB X classes.\n" +
38
39
  "MPLAB X dir: #{dir}\nMPLAB X jar dir: #{jar_dir}\nClass path:\n" + $CLASSPATH.to_a.join("\n") + "\n\n"
@@ -77,7 +78,6 @@ module RPicSim::Mplab
77
78
  end
78
79
 
79
80
  def auto_detect_mplab_dir
80
- # Default installation directories for MPLAB X:
81
81
  candidates = [
82
82
  'C:/Program Files (x86)/Microchip/MPLABX/', # 64-bit Windows
83
83
  'C:/Program Files/Microchip/MPLABX/', # 32-bit Windows
@@ -86,7 +86,13 @@ module RPicSim::Mplab
86
86
  ]
87
87
  dir = candidates.find { |d| File.directory?(d) }
88
88
  raise cannot_find_mplab_error if !dir
89
- dir
89
+
90
+ # Some time between 2.20 and 3.05, MPLABX started installing itself into
91
+ # a subdirectory named after the version, for example "v3.05". Here we
92
+ # check for the existence of such subdirectories and use the highest
93
+ # version of MPLAB X that is available. If it is not available, we'll
94
+ # use dir anyway because it might contain an older version of MPLAB X.
95
+ Dir.glob(dir + 'v?.??').sort.last or dir
90
96
  end
91
97
 
92
98
  def cannot_find_mplab_error
@@ -6,7 +6,7 @@ module RPicSim::Mplab
6
6
  def initialize(filename, device)
7
7
  raise "File does not exist: #{filename}" if !File.exist?(filename) # Avoid a Java exception.
8
8
 
9
- if !File.realdirpath(filename).split('/').include?('dist')
9
+ if !File.realdirpath(filename).split(%r{/|\\}).include?('dist')
10
10
  raise 'The file must be inside a directory named dist or else the MCLoader ' \
11
11
  'class will throw an exception saying that it cannot find the COF file.'
12
12
  end
@@ -2,5 +2,5 @@
2
2
  module RPicSim
3
3
  # The version number of this gem, as a string.
4
4
  # @return [String]
5
- VERSION = '1.0.0'
5
+ VERSION = '1.1.0'
6
6
  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: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pololu
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-17 00:00:00.000000000 Z
11
+ date: 2015-07-27 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email:
@@ -16,48 +16,11 @@ executables: []
16
16
  extensions: []
17
17
  extra_rdoc_files: []
18
18
  files:
19
- - lib/rpicsim.rb
20
- - lib/rpicsim/composite_memory.rb
21
- - lib/rpicsim/flaws.rb
22
- - lib/rpicsim/label.rb
23
- - lib/rpicsim/memory.rb
24
- - lib/rpicsim/memory_watcher.rb
25
- - lib/rpicsim/mplab.rb
26
- - lib/rpicsim/pin.rb
27
- - lib/rpicsim/program_counter.rb
28
- - lib/rpicsim/program_file.rb
29
- - lib/rpicsim/rspec.rb
30
- - lib/rpicsim/sim.rb
31
- - lib/rpicsim/stack_pointer.rb
32
- - lib/rpicsim/stack_trace.rb
33
- - lib/rpicsim/symbol_set.rb
34
- - lib/rpicsim/variable.rb
35
- - lib/rpicsim/variable_set.rb
36
- - lib/rpicsim/version.rb
37
- - lib/rpicsim/xc8_sym_file.rb
38
- - lib/rpicsim/mplab/mplab_assembly.rb
39
- - lib/rpicsim/mplab/mplab_device_info.rb
40
- - lib/rpicsim/mplab/mplab_instruction.rb
41
- - lib/rpicsim/mplab/mplab_loader.rb
42
- - lib/rpicsim/mplab/mplab_memory.rb
43
- - lib/rpicsim/mplab/mplab_nmmr_info.rb
44
- - lib/rpicsim/mplab/mplab_observer.rb
45
- - lib/rpicsim/mplab/mplab_pin.rb
46
- - lib/rpicsim/mplab/mplab_processor.rb
47
- - lib/rpicsim/mplab/mplab_program_file.rb
48
- - lib/rpicsim/mplab/mplab_register.rb
49
- - lib/rpicsim/mplab/mplab_sfr_info.rb
50
- - lib/rpicsim/mplab/mplab_simulator.rb
51
- - lib/rpicsim/rspec/be_predicate.rb
52
- - lib/rpicsim/rspec/helpers.rb
53
- - lib/rpicsim/rspec/persistent_expectations.rb
54
- - lib/rpicsim/rspec/sim_diagnostics.rb
55
- - lib/rpicsim/storage/memory_integer.rb
56
- - lib/rpicsim/storage/register.rb
19
+ - ".yardopts"
20
+ - Gemfile
57
21
  - Introduction.md
58
22
  - LICENSE.txt
59
23
  - README.md
60
- - Gemfile
61
24
  - docs/ChangeLog.md
62
25
  - docs/Contributing.md
63
26
  - docs/Debugging.md
@@ -75,8 +38,8 @@ files:
75
38
  - docs/PersistentExpectations.md
76
39
  - docs/Pins.md
77
40
  - docs/QuickStartGuide.md
78
- - docs/RamWatcher.md
79
41
  - docs/RSpecIntegration.md
42
+ - docs/RamWatcher.md
80
43
  - docs/Running.md
81
44
  - docs/Stubbing.md
82
45
  - docs/SupportedCompilers.md
@@ -85,7 +48,44 @@ files:
85
48
  - docs/SupportedOperatingSystems.md
86
49
  - docs/UnitTesting.md
87
50
  - docs/Variables.md
88
- - .yardopts
51
+ - lib/rpicsim.rb
52
+ - lib/rpicsim/composite_memory.rb
53
+ - lib/rpicsim/flaws.rb
54
+ - lib/rpicsim/label.rb
55
+ - lib/rpicsim/memory.rb
56
+ - lib/rpicsim/memory_watcher.rb
57
+ - lib/rpicsim/mplab.rb
58
+ - lib/rpicsim/mplab/mplab_assembly.rb
59
+ - lib/rpicsim/mplab/mplab_device_info.rb
60
+ - lib/rpicsim/mplab/mplab_instruction.rb
61
+ - lib/rpicsim/mplab/mplab_loader.rb
62
+ - lib/rpicsim/mplab/mplab_memory.rb
63
+ - lib/rpicsim/mplab/mplab_nmmr_info.rb
64
+ - lib/rpicsim/mplab/mplab_observer.rb
65
+ - lib/rpicsim/mplab/mplab_pin.rb
66
+ - lib/rpicsim/mplab/mplab_processor.rb
67
+ - lib/rpicsim/mplab/mplab_program_file.rb
68
+ - lib/rpicsim/mplab/mplab_register.rb
69
+ - lib/rpicsim/mplab/mplab_sfr_info.rb
70
+ - lib/rpicsim/mplab/mplab_simulator.rb
71
+ - lib/rpicsim/pin.rb
72
+ - lib/rpicsim/program_counter.rb
73
+ - lib/rpicsim/program_file.rb
74
+ - lib/rpicsim/rspec.rb
75
+ - lib/rpicsim/rspec/be_predicate.rb
76
+ - lib/rpicsim/rspec/helpers.rb
77
+ - lib/rpicsim/rspec/persistent_expectations.rb
78
+ - lib/rpicsim/rspec/sim_diagnostics.rb
79
+ - lib/rpicsim/sim.rb
80
+ - lib/rpicsim/stack_pointer.rb
81
+ - lib/rpicsim/stack_trace.rb
82
+ - lib/rpicsim/storage/memory_integer.rb
83
+ - lib/rpicsim/storage/register.rb
84
+ - lib/rpicsim/symbol_set.rb
85
+ - lib/rpicsim/variable.rb
86
+ - lib/rpicsim/variable_set.rb
87
+ - lib/rpicsim/version.rb
88
+ - lib/rpicsim/xc8_sym_file.rb
89
89
  homepage: https://github.com/pololu/rpicsim
90
90
  licenses:
91
91
  - MIT
@@ -96,19 +96,19 @@ require_paths:
96
96
  - lib
97
97
  required_ruby_version: !ruby/object:Gem::Requirement
98
98
  requirements:
99
- - - '>='
99
+ - - ">="
100
100
  - !ruby/object:Gem::Version
101
101
  version: '0'
102
102
  required_rubygems_version: !ruby/object:Gem::Requirement
103
103
  requirements:
104
- - - '>='
104
+ - - ">="
105
105
  - !ruby/object:Gem::Version
106
106
  version: '2'
107
107
  requirements:
108
108
  - JRuby
109
109
  - MPLAB X
110
110
  rubyforge_project:
111
- rubygems_version: 2.1.9
111
+ rubygems_version: 2.4.8
112
112
  signing_key:
113
113
  specification_version: 4
114
114
  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.