fanqimeng
Newbie level 3
systemc crashes modelsim
Hello guys,
I got a problem on systemc using modelsim. I designed an adder and was trying to simulate. however, the program terminated at 20ns and quited to windows from modelsim. I guess there must be something wrong with my code on simulation time but i cannot fix it. does anyone can help me please? cheers.:?:
Here are some of the test bench code.
void TestAdder4bit:rocess(){
A_p.write("0000");
B_p.write("0001");
CIN_p.write(SC_LOGIC_0);
wait (5, SC_NS);
assert(SUM_p.read() == "0001");
assert(COUT_p == SC_LOGIC_0);
wait(10, SC_NS);
print();
A_p.write("0011");
B_p.write("1100");
CIN_p.write(SC_LOGIC_0);
wait (5, SC_NS);
assert(SUM_p.read() == "1111");
assert(COUT_p == SC_LOGIC_0 );
wait(10, SC_NS);
print();
A_p.write("0011");
B_p.write("1100");
CIN_p.write(SC_LOGIC_1);
wait (5, SC_NS);
assert(SUM_p.read() == "0000");
assert(COUT_p == SC_LOGIC_1 );
wait (10, SC_NS);
print();
wait(100, SC_NS);
sc_stop(); //End Simulation
}
Hello guys,
I got a problem on systemc using modelsim. I designed an adder and was trying to simulate. however, the program terminated at 20ns and quited to windows from modelsim. I guess there must be something wrong with my code on simulation time but i cannot fix it. does anyone can help me please? cheers.:?:
Here are some of the test bench code.
void TestAdder4bit:rocess(){
A_p.write("0000");
B_p.write("0001");
CIN_p.write(SC_LOGIC_0);
wait (5, SC_NS);
assert(SUM_p.read() == "0001");
assert(COUT_p == SC_LOGIC_0);
wait(10, SC_NS);
print();
A_p.write("0011");
B_p.write("1100");
CIN_p.write(SC_LOGIC_0);
wait (5, SC_NS);
assert(SUM_p.read() == "1111");
assert(COUT_p == SC_LOGIC_0 );
wait(10, SC_NS);
print();
A_p.write("0011");
B_p.write("1100");
CIN_p.write(SC_LOGIC_1);
wait (5, SC_NS);
assert(SUM_p.read() == "0000");
assert(COUT_p == SC_LOGIC_1 );
wait (10, SC_NS);
print();
wait(100, SC_NS);
sc_stop(); //End Simulation
}