ROM Editor/Programmer Guide

The ROM components are programmable in various modes, including the possibility of initialing the memory with a sampled waveform. In the example of the next figure, the user has activated the context menu of the component, to launch the ROM Editor/Programmer:

The ROM Editor/Programmer dialog (see the figure below) can be used to edit directly the memory contents in Binary, Hexadecimal or ASCII text format (Undo/Redo buttons are available). To edit a memory cell, simply click on it. To go to the next cell, press the <right arrow key>.

The dialog has also three buttons (Load, Save, Waveform), and the Label field. In the Label edit field (up-right side), the user can edit a symbolic name for the memory component (see also the example in the previous figure, just over the symbol: "Sine Wave").

Waveform Generation Utility

By clicking on the Waveform button, we open the "Waveform in ROM" dialog, initially in Viewer Mode. As visible in the next figure, the dialog shows the Rom data as a digital signal, in a bi-dimensional chart (on the horizontal axis: the internal addresses of the memory; on the vertical axis: the corresponding data values). In this example, the memory contains the 8-bits samples of a complete cycle of a sine wave (the samples are coded as signed binary numbers).

To define a new waveform, you must change the mode (see the figure below):

Now it is possible to choose a new waveform, selecting it from the Wave list box:

The user can select a standard function: sine, cosine, saw-tooth, triangle and square wave (in the figure above, the cosine waveform). The waveform samples are calculated to memorize an entire cycle of the wave and to reach the maximum possible amplitude, centered on the zero (from +127 to -127, if signed, as in this example), or all-positive (unsigned, from 0 to 254).

The button "Copy Image" will copy the waveform image on the clipboard, ready to be pasted in a user document.

At the end of the list, a Fourier Series utility is available (the Fourier Series is a mathematical method to represent a periodic function as a sum of sine waves). We can choose between two classic series (square wave and saw-tooth wave), and stop the series at a given order. In the example below, a square wave series is set (as only the "Odd" harmonics has been selected), limited at the seventh harmonic.

Moving the mouse on the desired sample, with a click, the user will open a magnifying window (visible in the next figure):

In this example, we see a detail of the waveform seen in the previous figure, magnified around the sample of address 106, whose value is +116 (in blue, the digitized waveform; in red, the analog original waveform that has been sampled).

Buttons are available to manage time scale and horizontal Panning; the vertical scale, instead, is adaptive. Also here, a "Copy Image" button allows to the user to copy the waveform image on the clipboard.

Returning to the Waveform Editor, note that we can add to the waveform a certain amount of white noise, as visible in the following figure:

Data Import and Export

Let's return to the ROM Editor/Programmer dialog, and consider the buttons "Load" and "Save":

The ROM memory contents can be saved on, and loaded from, a coded text file. By clicking on the "Save" button, the dialog changes its appearance, entering the export mode, as shown in the following figures. The code is displayed in the dialog, before it is saved. The default file format is ".drs" (Deeds Rom Source file).

In the example above data is formatted in hex, below in binary. As shown, we have the possibility to choose the export data coding (hexadecimal, binary or decimal).

When the Export button is pressed, a save as dialog opens. After saving the file, the dialog returns to the previous appearance. We can also press the Cancel button or the Escape key to exit the export mode.

DRS File Format

The ".drs" files can be opened and edited by a simple text file editor. By clicking on the Load button, we can import a .drs file. The file is compiled and the ROM component is programmed with the file data.

In the example below, the "#-" in first position indicates that the entire line is a comment. A "#" followed by a letter is a directive. All the HEX numbers that will follow, in the lines without a "#" in first position, represent the data contents of the ROM, location by location.

  #-----------------------------------------------------------
  #- Deeds (Digital Electronics Education and Design Suite)
  #- … omissis …
  #-----------------------------------------------------------
  #R ROM256x8, id 02F0   
  #A 0000h   
  #H ;
  4E 65 6C 20 6D 65 7A 7A 6F 20 64 65 6C 20 63 61
  6D 6D 69 6E 20 64 69 20 6E 6F 73 74 72 61 20 76
  69 74 61 20 6D 69 20 72 69 74 72 6F 76 61 69 20
  … omissis …

A directive must be written in the first position, and can be one of the following:

  #-                         Comment (or header) (ignored at compile time);
  #R ROM256x16, id 0004      Rom component Type (ignored at compile time);
  #A <address>               Start address of data that will follow (hex or decimal),
                             if no #A directive is defined, the default address is zero;
  #T                         "Text contents follow", that is read starting from the next
                             line (including CR/LF), and stored from the address defined
                             [this is the default];
  #H                         Declares that the following numbers are hex;
  #B                         Declares that the following numbers are binary;
  #D                         Declares that the following numbers are decimal.

In the following example, the file has been coded to load in the memory the first lines of the "Divina Commedia" (a poem written by Dante Alighieri). Note that the directives could be cut away, leaving only the text in the file:

  #-----------------------------------------------------------
  #- Dante Alighieri
  #-----------------------------------------------------------
  #A 0000h
  #T
  Nel mezzo del cammin di nostra vita
  mi ritrovai per una selva oscura
  ché la diritta via era smarrita.
  Ahi quanto a dir qual era è cosa dura
  esta selva selvaggia e aspra e forte
  che nel pensier rinova la paura!

The resulting contents will be visible in the ROM editor grid (see the next figure):

VHDL Generation

It is possible to generate also the VHDL code of the ROM component, including data (see below).