kevinawalsh / logisim-evolution

Digital logic designer and simulator
GNU General Public License v3.0
114 stars 17 forks source link

Feature Request: Allow files to be mapped like RAM and/or ROM. #100

Open TChapman500 opened 1 year ago

TChapman500 commented 1 year ago

This would simply be a way to streamline loading the contents of a file into Logisim. The format of the file would be part of the component's properties rather than being selected every time a file needs to be loaded or saved.

Details: Make a "File ROM" component that loads the contents of a file that the user selects as the contents of the ROM. This will act like a normal ROM except that the width of the address is determined by the size of the file and the width of the data bus. The context menu will have a "Refresh Contents" button that can be used when the file is modified by an external program, or (if possible) have an auto refresh that detects when the file is modified and update the contents of the ROM then.

Make a "File RAM" component that loads the contents of a file that the user selects as the contents of the RAM. Address and data width would be specified by the user to give a maximum file size. The number of "bytes" from address 0 to the last non-0 "byte" would determine the actual size of the file. To prevent excessive writing to the physical device, the file would be written to only under the following conditions which can be adjusted by the user: (a) A certain number of bytes have been modified. (b) A certain period of time has elapsed since the first unsaved modification. (c) Or the circuit has been saved by the user or auto-save. For security, the file must be in the same directory as the circuit or in a sub-directory.