Z
zoro
Guest
Hi,
I have encountred a problem while working with resolved sc_logic type.
Considering using resolved sc_logic even for signals, when I assign a
new value to such signals their value change to 'X'.
for example in the following code, "sa" signal gets 'X' at 25 ns
instead of '1'; This case doesn't happen for a,b,c signals.
-------Header
SC_MODULE (testbench) {
sc_signal_rv<8> a;
sc_signal_rv<8> b;
sc_signal_rv<8> c;
sc_signal_resolved sa;
sc_signal_resolved sb;
sc_signal_resolved sc;
sc_signal_rv<8> z;
void p1 ();
....
SC_CTOR(testbench) {
sa = (sc_logic )'0';
SC_THREAD(p1);
SC_THREAD(p2);
....
};
#endif
---------CPP
void testbench:1(){
while(true){
sa = (sc_logic )'0';
wait(25,SC_NS);
sa = (sc_logic )'1';
wait(25,SC_NS);
}
}
I have encountred a problem while working with resolved sc_logic type.
Considering using resolved sc_logic even for signals, when I assign a
new value to such signals their value change to 'X'.
for example in the following code, "sa" signal gets 'X' at 25 ns
instead of '1'; This case doesn't happen for a,b,c signals.
-------Header
SC_MODULE (testbench) {
sc_signal_rv<8> a;
sc_signal_rv<8> b;
sc_signal_rv<8> c;
sc_signal_resolved sa;
sc_signal_resolved sb;
sc_signal_resolved sc;
sc_signal_rv<8> z;
void p1 ();
....
SC_CTOR(testbench) {
sa = (sc_logic )'0';
SC_THREAD(p1);
SC_THREAD(p2);
....
};
#endif
---------CPP
void testbench:1(){
while(true){
sa = (sc_logic )'0';
wait(25,SC_NS);
sa = (sc_logic )'1';
wait(25,SC_NS);
}
}