Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

why did systemc variables change unexpectedly?

Status
Not open for further replies.

suituse

Member level 1
Joined
Jan 10, 2005
Messages
33
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
317
the variables are assigned in methods, the methods sensitive at the posedges of some signals. sometimes,the variables changed ,but I cannot see any changes in the signals.

who knows the reason?
 

Can you post ur code here?? If not complete code an example code
where the problem exist will do.
 

Thank you for your attention:

sc_in<bool> i_rst_b;

int flag[4];

int buf1;
int buf2;

sc_signal<bool> w_start;
sc_signal<bool> w_update;
sc_signal<bool> w_drop;

SC_METHOD(gen_flags)
sensitive_pos<<w_start<<w_update<<w_drop;
sensitive_neg<<i_rst_b;

gen_flags()
{
if(!i_rst_b.read())
{
for(i=0;i<4;i++)
{
flag=1;
}
}
else
{
;// do nothing
}

if(w_update)
{
flag[buf1]=1;
}
else
{
;// do nothing
}

if(w_start)
{
flag[buf2]=0;
}
else if(w_drop)
{
flag[buf2]=1;
}
else
{
;// do nothing
}

}

w_start and w_update maybe change at the same time.
the same to w_drop and w_update .

flag[3] changed from 1 to 0 while none of the signals were changing.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top