I have configured a ROM device to be 16 x 15 (Addr x Data) bit. In one image, none of the values set the MSB data bit to '1' and this one loads fine and can be saved in the circuit (ie: File->Save followed by re-open of circuit shows valid ROM contents).
When I attempt to load my modified image file where some entries have the MSB set to '1', the load fails in that sometimes nothing is loaded, other times only the first $2000 entries appear. Even for the partial load, I am unable to save the information by circuit save. No matter what I try, reloading the circuit shows a ROM with all zero entries.
I have created two sets of test image files. Each set contains a compresses and uncompressed version. One set loads fine, the other fails.
The problem appears to be independant of whether or not the load image is compressed or not.
I did some quick tests with sample image loads such as "65536*7FFF" and this loads/saves/reloads fine, so I am not 100% sure it has something to do only with the MSB (data) being set to '1'.
This problem first occuredon 2.6.0 and I just verified it in 2.6.1 prior to posting this.
Attached are the test case images and minimal circuit that reproduces the problem.
I have generated
Sample circuit and test images
Thanks for the thorough report, particularly with the nice test cases! I would probably not have found the problem without the sample files that you put together.
The actual problem is rather embarrassing: So that it doesn't eat up huge portions of the host system's RAM, Logisim divides RAM/ROM into "pages" and it doesn't store pages consisting entirely of zero values. In testing whether segments of the file are all zero, though, Logisim's code used "==" where it should have said "!=", so that a "page" containing entirely nonzero values would be identified as consisting only zero values, and so the page was deleted.
Anyway, the bug is repaired in the current fragile release, 2.6.2.146. I anticipate 2.6.2 will appear soon containing this fix and some other bug fixes.
This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by
the administrator of this Tracker).