Go Back   Velocity Reviews > Newsgroups > VHDL
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

VHDL - Modelsim/Matlab co-simulation

 
Thread Tools Search this Thread
Old 12-15-2003, 05:47 PM   #1
Default Modelsim/Matlab co-simulation


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
  Reply With Quote
Old 12-15-2003, 06:25 PM   #2
Mike Treseler
 
Posts: n/a
Default Re: Modelsim/Matlab co-simulation
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



Mike Treseler
  Reply With Quote
Old 12-15-2003, 07:41 PM   #3
bko-no-spam-please@ieee.org
 
Posts: n/a
Default Re: Modelsim/Matlab co-simulation
(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
  Reply With Quote
Old 12-15-2003, 08:19 PM   #4
Mike Treseler
 
Posts: n/a
Default Re: Modelsim/Matlab co-simulation
bko-no-spam- 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



Mike Treseler
  Reply With Quote
Old 12-17-2003, 03:25 AM   #5
Ouadid
 
Posts: n/a
Default Re: Modelsim/Matlab co-simulation
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
  Reply With Quote
Old 12-17-2003, 10:09 AM   #6
Marcus Schaemann
 
Posts: n/a
Default Re: Modelsim/Matlab co-simulation
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


Marcus Schaemann
  Reply With Quote
Old 12-17-2003, 05:40 PM   #7
Mike Treseler
 
Posts: n/a
Default Re: Modelsim/Matlab co-simulation
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



Mike Treseler
  Reply With Quote
Old 12-18-2003, 03:54 AM   #8
Jim Wu
 
Posts: n/a
Default Re: Modelsim/Matlab co-simulation
> 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
(remove capital letters)
http://www.geocities.com/jimwu88/chips





Jim Wu
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Simulation question Issue Rahul MCITP 9 06-30-2008 09:53 PM
Simulation in 70-444 CorreiaLC MCITP 0 10-11-2007 07:18 PM
Post-Route Simulation does not give output for the first clock cycle Options velocityreviews Software 0 04-17-2007 05:47 PM
simulation Tom MCITP 0 04-05-2007 01:40 AM
Wanna site names that provide simulation tests for A+ raisasheikh@lycos.com A+ Certification 0 09-06-2005 07:50 PM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46