R
rickman
Guest
I am testing a VHDL design using embedded CPU program memory which needs
to be initialized. The data to be stored in the RAM comes from an
external source and will be part of the configuration download in the
final system. During simulation, I can't seem to figure out how to
initialize it. I thought I might use the test bench to read the data
from a file, but I can't figure out how to access the memory since it
does not have an external interface. If I add logic to initialize the
memory from the test bench, this will be unused in the real chip and so
I will have a difference between my simulated chip and the real chip. I
prefer not to do that. I have been using an initial value on the memory
variable declaration, but the data changes as I work and this is very
clumsy.
I also saw an example using a shared variable with one process being the
normal memory model and the other being an init routine. But again,
this will use code that is only part of the simulation and should not be
there for the end device. I guess the code will not be synthesized, but
since it has to be in the target source and not the test bench, it will
either need to be removed or it will likely produce errors in synthesis.
Is there a way to directly access an internal signal or variable from a
test bench? I seem to recall doing this before, but it was a long time
ago and I may be getting a simulator command mixed up with VHDL.
--
Rick "rickman" Collins
rick.collins@XYarius.com
Ignore the reply address. To email me use the above address with the XY
removed.
Arius - A Signal Processing Solutions Company
Specializing in DSP and FPGA design URL http://www.arius.com
4 King Ave 301-682-7772 Voice
Frederick, MD 21701-3110 301-682-7666 FAX
to be initialized. The data to be stored in the RAM comes from an
external source and will be part of the configuration download in the
final system. During simulation, I can't seem to figure out how to
initialize it. I thought I might use the test bench to read the data
from a file, but I can't figure out how to access the memory since it
does not have an external interface. If I add logic to initialize the
memory from the test bench, this will be unused in the real chip and so
I will have a difference between my simulated chip and the real chip. I
prefer not to do that. I have been using an initial value on the memory
variable declaration, but the data changes as I work and this is very
clumsy.
I also saw an example using a shared variable with one process being the
normal memory model and the other being an init routine. But again,
this will use code that is only part of the simulation and should not be
there for the end device. I guess the code will not be synthesized, but
since it has to be in the target source and not the test bench, it will
either need to be removed or it will likely produce errors in synthesis.
Is there a way to directly access an internal signal or variable from a
test bench? I seem to recall doing this before, but it was a long time
ago and I may be getting a simulator command mixed up with VHDL.
--
Rick "rickman" Collins
rick.collins@XYarius.com
Ignore the reply address. To email me use the above address with the XY
removed.
Arius - A Signal Processing Solutions Company
Specializing in DSP and FPGA design URL http://www.arius.com
4 King Ave 301-682-7772 Voice
Frederick, MD 21701-3110 301-682-7666 FAX