I noticed a wierd behaviour in using the .mem file with "at25320a.vhd".
According to my custom mem file, location 0x20 of the eeprom contains 0x9a.
Here's the operations (assuming [0x20] already contains 0x9a)
WREN
WRITE 0xF0 to [0x20]
WAIT FOR 5.2ms
READ FROM [0x20]
the READ command gets 0x90!!!
It's like the initial value (0x9A) masks the new value in an AND fashion:
0x9A AND 0xF0 = 0x90
I tried other values, all were masked.
(ie 0x9A AND 0xFF = 0x9a)
I don't know if this has to do with the mem file itself. As you can see,
memory locations not initialized by the mem file default to 0xFF. Obviously
every new value is not masked in this case.
According to the datasheet at25320a's write cycle doesn't last more than 5ms
so i guess that the lack of 1's doesn't depend on that.
ModelSim has a vmake command that should do everything for you. I do
not use it so this may be just hearsay.
Fortunately after i compiled the chain in the right order i don't need to
recompile it all again... provided that every change i make doesn't
involve
the library, i guess. I just get the usual warnings but it runs. I wrote a
basic state machine to perform a READ command through my SPI.vhd and i get
the expected values.
The .mem file format is documented in the model. Also see the FAQ on
the FMF website (
www.FreeModelFoundry.com).
I've taken care of that. The notes in the model are almost all that is
needed to write the .mem file, but i had to take a look at MemPreload
process itself either. I was hoping i could write multiple data values on
a
single line, but that's not allowed. It shouldn't be so hard to implement
it
though.
Here my sample .mem file
/test
@000
19
@010
bb
@020
9a
I'm writing an SPI module to drive MMC or SD so, again, models for such
devices would be useful. I2C seeprom models like 24lcxx would also be
useful
to test I2C master communication.
As far as i know only Denali's MMAV has some of those models, but MMAV is
a
long way to go to get just a single model every once in a while.
devices wrote:
I would use a batch file, but i'm afraid that the GUI views wouldn't
be
updated in accordance to reflect the state of the project. I also read
somewhere that it is possible to change the compilation order
modifying
an
".ini" file or something. I guess it is a "use it at your own risk"
solution. A batch file would give me more freedom if the Navigator was
aware
of it.
devices wrote:
Tired of crosswords i decided to face the issue
with a little more patience. I "explicitly" compiled
the files in the following order
gen_utils.vhd (in the fmf library)
conversions.vhd (in the fmf library)
at25320a.vhd
spi.vhd
board.vhd
tb_board.vhd
Then i ran the "Ise Simulator". It finally worked.
I would expect an IDE to take care of the compilation order
or at least to let me enter the file names in the right order.
I'm afraid that every change i make i have to manually recompile
the whole chain.
No, you should not need to recompile the whole chain. In general, the
first time through, everything needs to be compiled in the right
order
(which is a real pain, I agree). After that, you should only need to
compile a file that has changed, and the next file down the list only
if
something has changed in the entity.
But I will agree that sometimes that doesn't seem to work, or
somewhere
I missed a step. For this reason, and so that I can recompile
everything
from scratch, I tend to always have around a batch file (that I name
"compile") that explicitly recompiles everything in the right order.
That is, it is a list of commands:
vcom file1.vhd
vcom file2.vhd
...
Therefore, at the command line, I can do:
rm -rf work
vlib work
./compile
Those commands are of course from Modelsim on a Linux system, but you
could do the same on Windows and I assume the ISE simulator has
similar
command line commands. Modelsim also has a build project menu command
that will perform a similar task, but I generally prefer the command
line.