Modelsim/Matlab co-simulation

O

Ouadid

Guest
Hello,
I'm looking for any help about using simulation data that i
generat with matlab in the Modelsim Waveform in order to show that my
algorithm are working well and that it gives the same results.
I think it's possible to use matlab in order to generate a
testbench and i can integrate the results in it.
Any idea.
Buy the way i saw a nice toolbox that mathworks and mentor graphic
developped. It uses the client/server architecture to do the operation
but unfortunatly i don't have that toolbox:)
Thanks
 
Ouadid wrote:

I'm looking for any help about using simulation data that i
generate with matlab in the Modelsim Waveform in order to show that my
algorithm are working well and that it gives the same results.
You should be able to verify the algorithm
using matlab only. Modelsim would be needed
only if if you intend to convert your algorithm
to an HDL for synthesis.

If this is your intent,
you can either learn VHDL or Verilog, and do it
yourself, hire a consultant to do it for you,
or evaluate a software tool like
http://www.accelchip.com/products.html
that claims to do such conversions.

Once your algorithm is coded in an HDL,
you can use modelsim to test it.

The fpga vendors have app notes on inferring
multiplier/accumulators from HDL code.

-- Mike Treseler
 
ouadid@iquebec.com (Ouadid) writes:

Hello,
I'm looking for any help about using simulation data that i
generat with matlab in the Modelsim Waveform in order to show that my
algorithm are working well and that it gives the same results.
I think it's possible to use matlab in order to generate a
testbench and i can integrate the results in it.
Any idea.
Buy the way i saw a nice toolbox that mathworks and mentor graphic
developped. It uses the client/server architecture to do the operation
but unfortunatly i don't have that toolbox:)
Thanks
Here is a link to the description of our new Link for ModelSim co-simulation
product that is focused on doing just this type of verification:

http://www.mathworks.com/products/modelsim/

Why don't you ask for for an evaluation license and try it out?
 
bko-no-spam-please@ieee.org wrote:

Here is a link to the description of our new Link for ModelSim co-simulation
product that is focused on doing just this type of verification:

http://www.mathworks.com/products/modelsim/
This might be a reasonable way to evaluate
vhdl synth code using matlab.

However, the user
must know how to design dsp functions in vhdl
for synthesis in the first place.

If Ouadid just wants to validate
an algorithm, matlab should be
all he needs.

-- Mike Treseler
 
Hi every body,
I'll be more specific this time. I have to design an algorithm in
VHDl. It's done and it's a kind of Error control code. I want to
validate my design, so i need some test vectors as inputs and the
output that are associated with them. I wrote the same algorithm in
matlab and it works number one. In the fact, i generate some random
bits in the matlab file and i use the functions that implemet trellis
coding, then i use a function that map the out puts to a BPSK
modulation and finally they go through an AWGN channel and a quantizer
then they will be decoded.
I saved the quantized inputs and the outputs of the decoder in file
and then i copy-past the wall in my test bench in order to see if my
VHDl description of the decoder is reacting like the one i wrote in
matlab.
The problem i'm facing, is that i have to change the power of the
noise in the AWGN (in order to plot SNR VS BER graph of the decoder)
in matlab. So every time i change my SNR i had to do the copy past
operation. The operation is tedious,time consuming and not elegant. I
saw that mathworks developped a new toolbox targeting this operation,
but i'm curious to see if some one tried another approach.
Thanks for ur interest
Ouadid
 
Ouadid wrote:
Hi every body,
I'll be more specific this time. I have to design an algorithm in
VHDl. It's done and it's a kind of Error control code. I want to
validate my design, so i need some test vectors as inputs and the
output that are associated with them. I wrote the same algorithm in
matlab and it works number one. In the fact, i generate some random
bits in the matlab file and i use the functions that implemet trellis
coding, then i use a function that map the out puts to a BPSK
modulation and finally they go through an AWGN channel and a quantizer
then they will be decoded.
I saved the quantized inputs and the outputs of the decoder in file
and then i copy-past the wall in my test bench in order to see if my
VHDl description of the decoder is reacting like the one i wrote in
matlab.
The problem i'm facing, is that i have to change the power of the
noise in the AWGN (in order to plot SNR VS BER graph of the decoder)
in matlab. So every time i change my SNR i had to do the copy past
operation. The operation is tedious,time consuming and not elegant. I
saw that mathworks developped a new toolbox targeting this operation,
but i'm curious to see if some one tried another approach.
Thanks for ur interest
Ouadid
Hi,

I've done a Matlab/SystemC co-simulation of a CDMA receiver. It works as
follows:

1. Matlab generates the input data for the receiver and writes them to a
file

2. SystemC Program is executed in matlab with the matlab command
system('receiver_model'). The SystemC program evaluates the generated
file an input and write output to another file

3. Matlab reads the output file and compares it with the matlab model of
the receiver.

This is done for several SNR values to create a SNR vs. BER plot.
The same seems to be applicable to your case if you write a testbench
with file input and output modules and are able to run your simulation
as executable file (not in interactive mode).

As far as I know the same approach is used by design centers to compare
if different models with the same input file behave the same (search for
"golden file" on google)

I hope that I was able to help you,

Marcus
 
Ouadid wrote:

I'll be more specific this time. I have to design an algorithm in
VHDl. It's done and it's a kind of Error control code.
.. . .
The problem i'm facing, is that i have to change the power of the
noise in the AWGN (in order to plot SNR VS BER graph of the decoder)
in matlab.
I am assuming this means that you already
have a modelsim VHDL testbench, but no automated way
to convert the stim and expected data in VHDL constants.

In this case, your choices are:

1. Try out the mathworks interface referenced by bko-no-spam
2. Do the math directly in your VHDL testbench
using the packages at: http://www.eda.org/fphdl/
3. Add file input to your VHDL testbench that parses
the matlab data and converts it to VHDL data structures.
4. Make due with cut/paste/edit cycles.


-- Mike Treseler
 
So every time i change my SNR i had to do the copy past
operation. The operation is tedious,time consuming and not elegant. I
saw that mathworks developped a new toolbox targeting this operation,
but i'm curious to see if some one tried another approach.
You can write a program in matlab to automatically generate files that feed
your VHDL code. I did FIR filter designs on FPGA before and the coefficients
were saved in a very simple text file, which was then read in by HDL code.

Jim Wu
jimwu88NOOOSPAM@yahoo.com (remove capital letters)
http://www.geocities.com/jimwu88/chips
 

Welcome to EDABoard.com

Sponsor

Back
Top