systemC and modelsim

Joined
Jun 29, 2006
Messages
4
Reaction score
0
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
 
Joined
Jun 29, 2006
Messages
4
Reaction score
0
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::prc_test()
{
cout<<"The value you entered is "<<a;
}

void test::prc_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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,059
Latest member
cryptoseoagencies

Latest Threads

Top