Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > question regarding modelsim - systemC testbench

Reply
Thread Tools

question regarding modelsim - systemC testbench

 
 
doromdor doromdor is offline
Junior Member
Join Date: Nov 2009
Posts: 2
 
      11-17-2009
Sorry if this is not the correct place to post my question, but I really need help, as I am a total newbie in systemC.

I have a question about using modelsim to simulate systemC files .
I am not sure how to build the test bench for programs in systemC and how the simulation Process works.

For example I have a program that I built in systemC – mux_2x4 which
Has 2 inputs of 4 bits each and a 1 bit control that according to its value the output
Receive one of the 2 inputs.

This is the program:

#include "systemc.h"

SC_MODULE (mux_2x4)
{
sc_in < sc_lv<4> > din0, din1;
sc_in < sc_logic > ctr_mux;
sc_out < sc_lv<4> > dout;

void main_proc();
SC_CTOR (mux_2x4)
{
SC_METHOD(main_proc);

sensitive << din0 << din1 << ctr_mux;
}
};

void mux_2x4::main_proc()
{
if (ctr_mux.read() == SC_LOGIC_0)
dout.write(din0.read());
else if (ctr_mux.read() == SC_LOGIC_1)
dout.write(din1.read());
}
I want to build a systemC testbench for this program and run a simulation on modelsim.
Also what can u do with H files since the compiler (unlike Visual studio) will not compile them
Like the cpp files. Can anyone help me please ?
Thanks in advance ,

Dor
 
Reply With Quote
 
 
 
Reply

Thread Tools

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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Co simulation of SystemC files with VHDL testbench doromdor VHDL 0 12-07-2009 12:06 PM
Problem during mixed VHDL SystemC simulation with Modelsim 6.2a Steven Derrien VHDL 2 07-13-2006 09:50 AM
systemC and modelsim goose C++ 1 06-29-2006 11:30 AM
systemC and modelsim goose VHDL 1 06-29-2006 11:17 AM
How to use Modelsim 6.od for simulating systemc Baskar VHDL 0 03-06-2006 06:02 PM



Advertisments
 



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 47 48 49 50 51 52 53 54 55 56 57