In the schematic capture program, go to the "Options" menu and select "LogiBlox". Select the moudle type to be "MEMORIES". Once you have done this, you will see choices for ROM, RAM, SYNC_RAM or DP_RAM (which means dual-ported RAM). The dual-ported RAM allows you to perform two reads and one write per cycle. This is the maximum you can do in your labs.
Next select your "MemoryDepth" and "Word Size". For memory depth, most of you will choose somewhere between 64 and 256, while the Word size is "8". Note that the memory depth must be a multiple of 16
Now the part that you actually need this tutorial for. If you are programming your ROMs for your program, or want to initialize memory nicely, you have to put in a file name, and click on the "Edit" button besides the MemFile= area. When you click on the edit button, it will pull up a file which looks something like this.
;This is the file you must edit. First, you will notice the size of the memory depth and width. This must be the same as you selected in your LogiBlox window. (LogiBlox automatically does this for you, but if you change something later on in LogiBlox and then try to use this file, it won't work unless you change the depth and width here too.)
The Default line is very important. If you want you memory to be initialized to all 5's, you can do it here. Default is what will be in your memory locations unless you specify otherwise in the way I'll tell you in a second. Notice that the default here is RADIX 10, or decimal numbers, so don't try to put in a number like (here at least).
Now notice the line that says DATA. The help gives a good example, but here is another one as well.
RADIX 16This demonstrates the basics of how you put data into memory. Right after the DATA statement, any values you put in are assumed to start at memory location 0. In this example, the value FF is put into location 0 (notice the RADIX 16 statement has changed us into hexadecimal numbers. You can change this if desired.) On the next line, I put it values that will start at memory location 0A. 0A gets F0, 0B get F1, etc up through memory location 1A getting A0.
This type of memory file works for both ROMs and RAMs, and is the easiest way to do your memories.
Happy labbing...