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

Reply

VHDL - systemC and modelsim

 
Thread Tools Search this Thread
Old 06-29-2006, 12:16 PM   #1
Question systemC and modelsim


hi everyone,

I am trying to work on systemC in modelsim 6.1 PE. i need to force a user defined value through a .do file making use of proc function. the force command doesn't force values to systemc variables and on using the change comand i get an error saying

Error: (vsim-3661) Unable to change 'a_i': Invalid target for a value change.

the command refernce clearly mentions that i can change values for a scalar c variable using change command and i have declared a_i as a variable of type int. still the error shows up. i have switched on the c debug mode as mentioned in the command refernce.

can some one tell me what am i doing wrong or an alternate way of forcing values to systemc variables.



-----------------
Regards
Goose


goose
goose is offline   Reply With Quote
Old 06-29-2006, 12:17 PM   #2
goose
Junior Member
 
Join Date: Jun 2006
Posts: 4
Thumbs up code

i am putting up the code tht i am using to test the thing and also the do file

code

//test.cpp

#include "systemc.h"

SC_MODULE(test)
{
sc_signal <int> a;

int a_i;

void prc_test();
void prc_driver();

SC_CTOR(test)
{
a_i=0;
a=0;
SC_METHOD(prc_test);
SC_THREAD(prc_driver);
sensitive<<a;
}
};

void test:rc_test()
{
cout<<"The value you entered is "<<a;
}

void test:rc_driver()
{
wait(25,SC_NS);
a.write((int)a_i);
}

SC_MODULE_EXPORT(test);


do file

quit -sim

# Setting the Proj Directory and the working Directory

set projdir "C:/Modeltech_6.1/Sourabh"

# Change directory to the simulation directory

cd $projdir/sim

# Delete the Initial work file

file delete -force work

# Create the work library

vlib work

vmap work work

onbreak {resume}

sccom -g -work work C:/modeltech_6.1/sourabh/test.cpp
sccom -link
vsim test
add wave a
add wave a_i
cdbg debug_on
proc mov {a_u} {
change a_i $a_u
run 100 ns
}




-----------------
Regards
Goose
goose is offline   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
Forum Jump